blob: 8c37b5ec0cf6f601c54cec97b479459dc3a3b9a8 [file] [log] [blame]
Mauro Carvalho Chehabd5e52652005-11-08 21:37:32 -08001#ifndef _IR_I2C
2#define _IR_I2C
3
4#include <media/ir-common.h>
5
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;
Mauro Carvalho Chehab715a2232009-08-29 14:15:55 -030012
Jean Delvarec668f322009-05-13 16:48:50 -030013 struct i2c_client *c;
Mauro Carvalho Chehabd5e52652005-11-08 21:37:32 -080014 struct input_dev *input;
David Härdeman62c65032010-10-29 16:08:07 -030015
Mauro Carvalho Chehabd5e52652005-11-08 21:37:32 -080016 /* Used to avoid fast repeating */
17 unsigned char old;
18
Mauro Carvalho Chehabc72ba8e2010-09-23 01:23:10 -030019 u32 polling_interval; /* in ms */
20
Jean Delvarec1089bd2009-03-07 07:43:43 -030021 struct delayed_work work;
Jean Delvare1df8e982009-05-13 16:48:07 -030022 char name[32];
Mauro Carvalho Chehabd5e52652005-11-08 21:37:32 -080023 char phys[32];
24 int (*get_key)(struct IR_i2c*, u32*, u32*);
25};
Jean Delvare4d7a2d62009-05-13 16:49:32 -030026
Andy Walls1b6e59e2009-07-28 11:44:05 -030027enum ir_kbd_get_key_fn {
28 IR_KBD_GET_KEY_CUSTOM = 0,
29 IR_KBD_GET_KEY_PIXELVIEW,
Andy Walls1b6e59e2009-07-28 11:44:05 -030030 IR_KBD_GET_KEY_HAUP,
31 IR_KBD_GET_KEY_KNC1,
32 IR_KBD_GET_KEY_FUSIONHDTV,
33 IR_KBD_GET_KEY_HAUP_XVR,
34 IR_KBD_GET_KEY_AVERMEDIA_CARDBUS,
35};
36
Jean Delvare4d7a2d62009-05-13 16:49:32 -030037/* Can be passed when instantiating an ir_video i2c device */
38struct IR_i2c_init_data {
Mauro Carvalho Chehab02858ee2010-04-02 20:01:00 -030039 char *ir_codes;
Mauro Carvalho Chehabc72ba8e2010-09-23 01:23:10 -030040 const char *name;
41 u64 type; /* IR_TYPE_RC5, etc */
42 u32 polling_interval; /* 0 means DEFAULT_POLLING_INTERVAL */
David Härdeman62c65032010-10-29 16:08:07 -030043
Andy Walls1b6e59e2009-07-28 11:44:05 -030044 /*
45 * Specify either a function pointer or a value indicating one of
46 * ir_kbd_i2c's internal get_key functions
47 */
Jean Delvare4d7a2d62009-05-13 16:49:32 -030048 int (*get_key)(struct IR_i2c*, u32*, u32*);
Andy Walls1b6e59e2009-07-28 11:44:05 -030049 enum ir_kbd_get_key_fn internal_get_key_func;
Jean Delvare4d7a2d62009-05-13 16:49:32 -030050};
Mauro Carvalho Chehabd5e52652005-11-08 21:37:32 -080051#endif