diff options
author | Mauro Carvalho Chehab <mchehab@redhat.com> | 2009-12-13 22:16:55 -0500 |
---|---|---|
committer | Mauro Carvalho Chehab <mchehab@redhat.com> | 2010-02-26 13:10:23 -0500 |
commit | e93854da880d6dc357c00625d8371b6a926fd19b (patch) | |
tree | 8bf87df8cf639fe7af7e35fb5cbc42792742a31b /include/media | |
parent | 4714eda87748f226833c32400ab60dd6a3b80766 (diff) |
V4L/DVB (13634): ir-core: allow passing IR device parameters to ir-core
Adds an structure to ir_input_register to contain IR device characteristics,
like supported protocols and a callback to handle protocol event changes.
Signed-off-by: Mauro Carvalho Chehab <mchehab@redhat.com>
Diffstat (limited to 'include/media')
-rw-r--r-- | include/media/ir-common.h | 4 | ||||
-rw-r--r-- | include/media/ir-core.h | 18 | ||||
-rw-r--r-- | include/media/ir-kbd-i2c.h | 2 |
3 files changed, 16 insertions, 8 deletions
diff --git a/include/media/ir-common.h b/include/media/ir-common.h index 2c6af24b905e..1b43b772165a 100644 --- a/include/media/ir-common.h +++ b/include/media/ir-common.h | |||
@@ -35,7 +35,7 @@ | |||
35 | 35 | ||
36 | struct ir_input_state { | 36 | struct ir_input_state { |
37 | /* configuration */ | 37 | /* configuration */ |
38 | int ir_type; | 38 | enum ir_type ir_type; |
39 | 39 | ||
40 | /* key info */ | 40 | /* key info */ |
41 | u32 ir_key; /* ir scancode */ | 41 | u32 ir_key; /* ir scancode */ |
@@ -84,7 +84,7 @@ struct card_ir { | |||
84 | /* Routines from ir-functions.c */ | 84 | /* Routines from ir-functions.c */ |
85 | 85 | ||
86 | int ir_input_init(struct input_dev *dev, struct ir_input_state *ir, | 86 | int ir_input_init(struct input_dev *dev, struct ir_input_state *ir, |
87 | int ir_type); | 87 | const enum ir_type ir_type); |
88 | void ir_input_nokey(struct input_dev *dev, struct ir_input_state *ir); | 88 | void ir_input_nokey(struct input_dev *dev, struct ir_input_state *ir); |
89 | void ir_input_keydown(struct input_dev *dev, struct ir_input_state *ir, | 89 | void ir_input_keydown(struct input_dev *dev, struct ir_input_state *ir, |
90 | u32 ir_key); | 90 | u32 ir_key); |
diff --git a/include/media/ir-core.h b/include/media/ir-core.h index a5a3bda354de..dbdffd1458fb 100644 --- a/include/media/ir-core.h +++ b/include/media/ir-core.h | |||
@@ -23,10 +23,10 @@ extern int ir_core_debug; | |||
23 | 23 | ||
24 | enum ir_type { | 24 | enum ir_type { |
25 | IR_TYPE_UNKNOWN = 0, | 25 | IR_TYPE_UNKNOWN = 0, |
26 | IR_TYPE_RC5 = 1, | 26 | IR_TYPE_RC5 = 1L << 0, /* Philips RC5 protocol */ |
27 | IR_TYPE_PD = 2, /* Pulse distance encoded IR */ | 27 | IR_TYPE_PD = 1L << 1, /* Pulse distance encoded IR */ |
28 | IR_TYPE_NEC = 3, | 28 | IR_TYPE_NEC = 1L << 2, |
29 | IR_TYPE_OTHER = 99, | 29 | IR_TYPE_OTHER = 1L << 63, |
30 | }; | 30 | }; |
31 | 31 | ||
32 | struct ir_scancode { | 32 | struct ir_scancode { |
@@ -41,12 +41,19 @@ struct ir_scancode_table { | |||
41 | spinlock_t lock; | 41 | spinlock_t lock; |
42 | }; | 42 | }; |
43 | 43 | ||
44 | struct ir_dev_props { | ||
45 | unsigned long allowed_protos; | ||
46 | void *priv; | ||
47 | int (*change_protocol)(void *priv, unsigned long protocol); | ||
48 | }; | ||
49 | |||
44 | struct ir_input_dev { | 50 | struct ir_input_dev { |
45 | struct input_dev *dev; /* Input device*/ | 51 | struct input_dev *dev; /* Input device*/ |
46 | struct ir_scancode_table rc_tab; /* scan/key table */ | 52 | struct ir_scancode_table rc_tab; /* scan/key table */ |
47 | unsigned long devno; /* device number */ | 53 | unsigned long devno; /* device number */ |
48 | struct attribute_group attr; /* IR attributes */ | 54 | struct attribute_group attr; /* IR attributes */ |
49 | struct device *class_dev; /* virtual class dev */ | 55 | struct device *class_dev; /* virtual class dev */ |
56 | const struct ir_dev_props *props; /* Device properties */ | ||
50 | }; | 57 | }; |
51 | 58 | ||
52 | /* Routines from ir-keytable.c */ | 59 | /* Routines from ir-keytable.c */ |
@@ -59,7 +66,8 @@ int ir_set_keycode_table(struct input_dev *input_dev, | |||
59 | 66 | ||
60 | int ir_roundup_tablesize(int n_elems); | 67 | int ir_roundup_tablesize(int n_elems); |
61 | int ir_input_register(struct input_dev *dev, | 68 | int ir_input_register(struct input_dev *dev, |
62 | struct ir_scancode_table *ir_codes); | 69 | const struct ir_scancode_table *ir_codes, |
70 | const struct ir_dev_props *props); | ||
63 | void ir_input_unregister(struct input_dev *input_dev); | 71 | void ir_input_unregister(struct input_dev *input_dev); |
64 | 72 | ||
65 | /* Routines from ir-sysfs.c */ | 73 | /* Routines from ir-sysfs.c */ |
diff --git a/include/media/ir-kbd-i2c.h b/include/media/ir-kbd-i2c.h index aaf65e8b1a40..45926e3559f3 100644 --- a/include/media/ir-kbd-i2c.h +++ b/include/media/ir-kbd-i2c.h | |||
@@ -36,7 +36,7 @@ enum ir_kbd_get_key_fn { | |||
36 | struct IR_i2c_init_data { | 36 | struct IR_i2c_init_data { |
37 | struct ir_scancode_table *ir_codes; | 37 | struct ir_scancode_table *ir_codes; |
38 | const char *name; | 38 | const char *name; |
39 | int type; /* IR_TYPE_RC5, IR_TYPE_PD, etc */ | 39 | enum ir_type type; /* IR_TYPE_RC5, IR_TYPE_PD, etc */ |
40 | /* | 40 | /* |
41 | * Specify either a function pointer or a value indicating one of | 41 | * Specify either a function pointer or a value indicating one of |
42 | * ir_kbd_i2c's internal get_key functions | 42 | * ir_kbd_i2c's internal get_key functions |