diff options
author | David Härdeman <david@hardeman.nu> | 2014-04-03 19:31:25 -0400 |
---|---|---|
committer | Mauro Carvalho Chehab <m.chehab@samsung.com> | 2014-07-23 19:05:56 -0400 |
commit | 4dd9bb91bb5dc44e3f8c23c60a0ba432e50d7488 (patch) | |
tree | eadbd0f9d33fc8e5da28a03356170cdee7404b3b /include/media | |
parent | 2886f013c312d288fdd4b8472b82a0a9590e3134 (diff) |
[media] rc-core: improve ir-kbd-i2c get_key functions
The arguments used for ir-kbd-i2c's get_key() functions are not
really suited for rc-core and the ir_raw/ir_key distinction is
just confusing.
Convert all of them to return a protocol/scancode/toggle triple instead.
Signed-off-by: David Härdeman <david@hardeman.nu>
Signed-off-by: Mauro Carvalho Chehab <m.chehab@samsung.com>
Diffstat (limited to 'include/media')
-rw-r--r-- | include/media/ir-kbd-i2c.h | 6 | ||||
-rw-r--r-- | include/media/rc-map.h | 10 |
2 files changed, 14 insertions, 2 deletions
diff --git a/include/media/ir-kbd-i2c.h b/include/media/ir-kbd-i2c.h index e221bc74020b..d8564354debb 100644 --- a/include/media/ir-kbd-i2c.h +++ b/include/media/ir-kbd-i2c.h | |||
@@ -20,7 +20,8 @@ struct IR_i2c { | |||
20 | struct delayed_work work; | 20 | struct delayed_work work; |
21 | char name[32]; | 21 | char name[32]; |
22 | char phys[32]; | 22 | char phys[32]; |
23 | int (*get_key)(struct IR_i2c*, u32*, u32*); | 23 | int (*get_key)(struct IR_i2c *ir, enum rc_type *protocol, |
24 | u32 *scancode, u8 *toggle); | ||
24 | }; | 25 | }; |
25 | 26 | ||
26 | enum ir_kbd_get_key_fn { | 27 | enum ir_kbd_get_key_fn { |
@@ -44,7 +45,8 @@ struct IR_i2c_init_data { | |||
44 | * Specify either a function pointer or a value indicating one of | 45 | * Specify either a function pointer or a value indicating one of |
45 | * ir_kbd_i2c's internal get_key functions | 46 | * ir_kbd_i2c's internal get_key functions |
46 | */ | 47 | */ |
47 | int (*get_key)(struct IR_i2c*, u32*, u32*); | 48 | int (*get_key)(struct IR_i2c *ir, enum rc_type *protocol, |
49 | u32 *scancode, u8 *toggle); | ||
48 | enum ir_kbd_get_key_fn internal_get_key_func; | 50 | enum ir_kbd_get_key_fn internal_get_key_func; |
49 | 51 | ||
50 | struct rc_dev *rc_dev; | 52 | struct rc_dev *rc_dev; |
diff --git a/include/media/rc-map.h b/include/media/rc-map.h index e5aa2409c0ea..894c7e4c409b 100644 --- a/include/media/rc-map.h +++ b/include/media/rc-map.h | |||
@@ -62,6 +62,16 @@ enum rc_type { | |||
62 | RC_BIT_RC6_0 | RC_BIT_RC6_6A_20 | RC_BIT_RC6_6A_24 | \ | 62 | RC_BIT_RC6_0 | RC_BIT_RC6_6A_20 | RC_BIT_RC6_6A_24 | \ |
63 | RC_BIT_RC6_6A_32 | RC_BIT_RC6_MCE | RC_BIT_SHARP) | 63 | RC_BIT_RC6_6A_32 | RC_BIT_RC6_MCE | RC_BIT_SHARP) |
64 | 64 | ||
65 | #define RC_SCANCODE_UNKNOWN(x) (x) | ||
66 | #define RC_SCANCODE_OTHER(x) (x) | ||
67 | #define RC_SCANCODE_NEC(addr, cmd) (((addr) << 8) | (cmd)) | ||
68 | #define RC_SCANCODE_NECX(addr, cmd) (((addr) << 8) | (cmd)) | ||
69 | #define RC_SCANCODE_NEC32(data) ((data) & 0xffffffff) | ||
70 | #define RC_SCANCODE_RC5(sys, cmd) (((sys) << 8) | (cmd)) | ||
71 | #define RC_SCANCODE_RC5_SZ(sys, cmd) (((sys) << 8) | (cmd)) | ||
72 | #define RC_SCANCODE_RC6_0(sys, cmd) (((sys) << 8) | (cmd)) | ||
73 | #define RC_SCANCODE_RC6_6A(vendor, sys, cmd) (((vendor) << 16) | ((sys) << 8) | (cmd)) | ||
74 | |||
65 | struct rc_map_table { | 75 | struct rc_map_table { |
66 | u32 scancode; | 76 | u32 scancode; |
67 | u32 keycode; | 77 | u32 keycode; |