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/ir-core.h | |
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/ir-core.h')
-rw-r--r-- | include/media/ir-core.h | 18 |
1 files changed, 13 insertions, 5 deletions
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 */ |