]>
Commit | Line | Data |
---|---|---|
b2441318 | 1 | /* SPDX-License-Identifier: GPL-2.0 */ |
d5e52653 MCC |
2 | #ifndef _IR_I2C |
3 | #define _IR_I2C | |
4 | ||
6bda9644 | 5 | #include <media/rc-core.h> |
d5e52653 | 6 | |
c72ba8e6 MCC |
7 | #define DEFAULT_POLLING_INTERVAL 100 /* ms */ |
8 | ||
d5e52653 MCC |
9 | struct IR_i2c; |
10 | ||
11 | struct IR_i2c { | |
02858eed | 12 | char *ir_codes; |
c668f32d | 13 | struct i2c_client *c; |
d8b4b582 | 14 | struct rc_dev *rc; |
62c65031 | 15 | |
d5e52653 MCC |
16 | /* Used to avoid fast repeating */ |
17 | unsigned char old; | |
18 | ||
c72ba8e6 MCC |
19 | u32 polling_interval; /* in ms */ |
20 | ||
c1089bdc | 21 | struct delayed_work work; |
1df8e986 | 22 | char name[32]; |
d5e52653 | 23 | char phys[32]; |
6d741bfe SY |
24 | int (*get_key)(struct IR_i2c *ir, |
25 | enum rc_proto *protocol, | |
4dd9bb91 | 26 | u32 *scancode, u8 *toggle); |
d5e52653 | 27 | }; |
4d7a2d67 | 28 | |
1b6e59e3 AW |
29 | enum ir_kbd_get_key_fn { |
30 | IR_KBD_GET_KEY_CUSTOM = 0, | |
31 | IR_KBD_GET_KEY_PIXELVIEW, | |
1b6e59e3 AW |
32 | IR_KBD_GET_KEY_HAUP, |
33 | IR_KBD_GET_KEY_KNC1, | |
34 | IR_KBD_GET_KEY_FUSIONHDTV, | |
35 | IR_KBD_GET_KEY_HAUP_XVR, | |
36 | IR_KBD_GET_KEY_AVERMEDIA_CARDBUS, | |
37 | }; | |
38 | ||
4d7a2d67 JD |
39 | /* Can be passed when instantiating an ir_video i2c device */ |
40 | struct IR_i2c_init_data { | |
02858eed | 41 | char *ir_codes; |
c72ba8e6 | 42 | const char *name; |
6d741bfe | 43 | u64 type; /* RC_PROTO_BIT_RC5, etc */ |
c72ba8e6 | 44 | u32 polling_interval; /* 0 means DEFAULT_POLLING_INTERVAL */ |
62c65031 | 45 | |
1b6e59e3 AW |
46 | /* |
47 | * Specify either a function pointer or a value indicating one of | |
48 | * ir_kbd_i2c's internal get_key functions | |
49 | */ | |
6d741bfe SY |
50 | int (*get_key)(struct IR_i2c *ir, |
51 | enum rc_proto *protocol, | |
4dd9bb91 | 52 | u32 *scancode, u8 *toggle); |
1b6e59e3 | 53 | enum ir_kbd_get_key_fn internal_get_key_func; |
2eb25832 MCC |
54 | |
55 | struct rc_dev *rc_dev; | |
4d7a2d67 | 56 | }; |
d5e52653 | 57 | #endif |