aboutsummaryrefslogtreecommitdiffstats
path: root/include/media
diff options
context:
space:
mode:
authorMauro Carvalho Chehab <mchehab@redhat.com>2010-04-06 22:21:46 -0400
committerMauro Carvalho Chehab <mchehab@redhat.com>2010-05-19 11:57:02 -0400
commit626cf6979e99bf2c642456308bed7bb25a37569b (patch)
tree4a5654588a37399f9240639d75064901c8737d8c /include/media
parentde88f31cef8fee7c890cf2128bec8dae06bb20f2 (diff)
V4L/DVB: ir-core: Distinguish sysfs attributes for in-hardware and raw decoders
Some devices have in-hardware Remote Controller decoder, while others need a software decoder to get the IR code. As each software decoder can be enabled/disabled individually, allowing multiple protocol decoding capability. On the other hand, hardware decoders have a limited protocol support, often being able of decoding just one protocol each time. So, each type needs a different set of capabilities to control the supported protocol(s). Signed-off-by: Mauro Carvalho Chehab <mchehab@redhat.com>
Diffstat (limited to 'include/media')
-rw-r--r--include/media/ir-core.h20
1 files changed, 14 insertions, 6 deletions
diff --git a/include/media/ir-core.h b/include/media/ir-core.h
index 4397ea3d9754..e9fa94fe2ef5 100644
--- a/include/media/ir-core.h
+++ b/include/media/ir-core.h
@@ -26,6 +26,11 @@ extern int ir_core_debug;
26#define IR_dprintk(level, fmt, arg...) if (ir_core_debug >= level) \ 26#define IR_dprintk(level, fmt, arg...) if (ir_core_debug >= level) \
27 printk(KERN_DEBUG "%s: " fmt , __func__, ## arg) 27 printk(KERN_DEBUG "%s: " fmt , __func__, ## arg)
28 28
29enum rc_driver_type {
30 RC_DRIVER_SCANCODE = 0, /* Driver or hardware generates a scancode */
31 RC_DRIVER_IR_RAW, /* Needs a Infra-Red pulse/space decoder */
32};
33
29enum raw_event_type { 34enum raw_event_type {
30 IR_SPACE = (1 << 0), 35 IR_SPACE = (1 << 0),
31 IR_PULSE = (1 << 1), 36 IR_PULSE = (1 << 1),
@@ -35,6 +40,8 @@ enum raw_event_type {
35 40
36/** 41/**
37 * struct ir_dev_props - Allow caller drivers to set special properties 42 * struct ir_dev_props - Allow caller drivers to set special properties
43 * @driver_type: specifies if the driver or hardware have already a decoder,
44 * or if it needs to use the IR raw event decoders to produce a scancode
38 * @allowed_protos: bitmask with the supported IR_TYPE_* protocols 45 * @allowed_protos: bitmask with the supported IR_TYPE_* protocols
39 * @scanmask: some hardware decoders are not capable of providing the full 46 * @scanmask: some hardware decoders are not capable of providing the full
40 * scancode to the application. As this is a hardware limit, we can't do 47 * scancode to the application. As this is a hardware limit, we can't do
@@ -49,12 +56,13 @@ enum raw_event_type {
49 * is opened. 56 * is opened.
50 */ 57 */
51struct ir_dev_props { 58struct ir_dev_props {
52 unsigned long allowed_protos; 59 enum rc_driver_type driver_type;
53 u32 scanmask; 60 unsigned long allowed_protos;
54 void *priv; 61 u32 scanmask;
55 int (*change_protocol)(void *priv, u64 ir_type); 62 void *priv;
56 int (*open)(void *priv); 63 int (*change_protocol)(void *priv, u64 ir_type);
57 void (*close)(void *priv); 64 int (*open)(void *priv);
65 void (*close)(void *priv);
58}; 66};
59 67
60struct ir_raw_event { 68struct ir_raw_event {