blob: 768aa77925cd952049cff78ae1c6ff8116369d90 [file] [log] [blame]
Mauro Carvalho Chehabd5e52652005-11-08 21:37:32 -08001#ifndef _IR_I2C
2#define _IR_I2C
3
Mauro Carvalho Chehab6bda9642010-11-17 13:28:38 -03004#include <media/rc-core.h>
Mauro Carvalho Chehabd5e52652005-11-08 21:37:32 -08005
Mauro Carvalho Chehabc72ba8e2010-09-23 01:23:10 -03006#define DEFAULT_POLLING_INTERVAL 100 /* ms */
7
Mauro Carvalho Chehabd5e52652005-11-08 21:37:32 -08008struct IR_i2c;
9
10struct IR_i2c {
Mauro Carvalho Chehab02858ee2010-04-02 20:01:00 -030011 char *ir_codes;
Jean Delvarec668f322009-05-13 16:48:50 -030012 struct i2c_client *c;
David Härdemand8b4b582010-10-29 16:08:23 -030013 struct rc_dev *rc;
David Härdeman62c65032010-10-29 16:08:07 -030014
Mauro Carvalho Chehabd5e52652005-11-08 21:37:32 -080015 /* Used to avoid fast repeating */
16 unsigned char old;
17
Mauro Carvalho Chehabc72ba8e2010-09-23 01:23:10 -030018 u32 polling_interval; /* in ms */
19
Jean Delvarec1089bd2009-03-07 07:43:43 -030020 struct delayed_work work;
Jean Delvare1df8e982009-05-13 16:48:07 -030021 char name[32];
Mauro Carvalho Chehabd5e52652005-11-08 21:37:32 -080022 char phys[32];
23 int (*get_key)(struct IR_i2c*, u32*, u32*);
24};
Jean Delvare4d7a2d62009-05-13 16:49:32 -030025
Andy Walls1b6e59e2009-07-28 11:44:05 -030026enum ir_kbd_get_key_fn {
27 IR_KBD_GET_KEY_CUSTOM = 0,
28 IR_KBD_GET_KEY_PIXELVIEW,
Andy Walls1b6e59e2009-07-28 11:44:05 -030029 IR_KBD_GET_KEY_HAUP,
30 IR_KBD_GET_KEY_KNC1,
31 IR_KBD_GET_KEY_FUSIONHDTV,
32 IR_KBD_GET_KEY_HAUP_XVR,
33 IR_KBD_GET_KEY_AVERMEDIA_CARDBUS,
34};
35
Jean Delvare4d7a2d62009-05-13 16:49:32 -030036/* Can be passed when instantiating an ir_video i2c device */
37struct IR_i2c_init_data {
Mauro Carvalho Chehab02858ee2010-04-02 20:01:00 -030038 char *ir_codes;
Mauro Carvalho Chehabc72ba8e2010-09-23 01:23:10 -030039 const char *name;
Mauro Carvalho Chehab52b66142010-11-17 14:20:52 -030040 u64 type; /* RC_TYPE_RC5, etc */
Mauro Carvalho Chehabc72ba8e2010-09-23 01:23:10 -030041 u32 polling_interval; /* 0 means DEFAULT_POLLING_INTERVAL */
David Härdeman62c65032010-10-29 16:08:07 -030042
Andy Walls1b6e59e2009-07-28 11:44:05 -030043 /*
44 * Specify either a function pointer or a value indicating one of
45 * ir_kbd_i2c's internal get_key functions
46 */
Jean Delvare4d7a2d62009-05-13 16:49:32 -030047 int (*get_key)(struct IR_i2c*, u32*, u32*);
Andy Walls1b6e59e2009-07-28 11:44:05 -030048 enum ir_kbd_get_key_fn internal_get_key_func;
Mauro Carvalho Chehab2eb25832010-11-12 09:02:40 -030049
50 struct rc_dev *rc_dev;
Jean Delvare4d7a2d62009-05-13 16:49:32 -030051};
Mauro Carvalho Chehabd5e52652005-11-08 21:37:32 -080052#endif