From 9dfe4e8339499bfe8e9a362fefc290b4cb9c3803 Mon Sep 17 00:00:00 2001 From: Mauro Carvalho Chehab Date: Sun, 4 Apr 2010 14:06:55 -0300 Subject: V4L/DVB: ir-core: Add support for badly-implemented hardware decoders A few hardware Remote Controller decoders, even using a standard protocol, aren't able to provide the entire scancode. Due to that, the capability of using other IR's are limited on those hardware. Adds a way to indicate to ir-core what are the bits that the hardware provides, from a scancode, allowing the addition of a complete IR table to the kernel and allowing a limited support for changing the Remote Controller on those devices. Signed-off-by: Mauro Carvalho Chehab --- include/media/ir-core.h | 24 ++++++++++++++++++++---- 1 file changed, 20 insertions(+), 4 deletions(-) (limited to 'include/media/ir-core.h') diff --git a/include/media/ir-core.h b/include/media/ir-core.h index 0f64b48ecd9..4397ea3d975 100644 --- a/include/media/ir-core.h +++ b/include/media/ir-core.h @@ -33,12 +33,28 @@ enum raw_event_type { IR_STOP_EVENT = (1 << 3), }; +/** + * struct ir_dev_props - Allow caller drivers to set special properties + * @allowed_protos: bitmask with the supported IR_TYPE_* protocols + * @scanmask: some hardware decoders are not capable of providing the full + * scancode to the application. As this is a hardware limit, we can't do + * anything with it. Yet, as the same keycode table can be used with other + * devices, a mask is provided to allow its usage. Drivers should generally + * leave this field in blank + * @priv: driver-specific data, to be used on the callbacks + * @change_protocol: allow changing the protocol used on hardware decoders + * @open: callback to allow drivers to enable polling/irq when IR input device + * is opened. + * @close: callback to allow drivers to disable polling/irq when IR input device + * is opened. + */ struct ir_dev_props { - unsigned long allowed_protos; + unsigned long allowed_protos; + u32 scanmask; void *priv; - int (*change_protocol)(void *priv, u64 ir_type); - int (*open)(void *priv); - void (*close)(void *priv); + int (*change_protocol)(void *priv, u64 ir_type); + int (*open)(void *priv); + void (*close)(void *priv); }; struct ir_raw_event { -- cgit v1.2.3-70-g09d2