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>
This commit is contained in:
Mauro Carvalho Chehab
2010-04-06 23:21:46 -03:00
parent de88f31cef
commit 626cf6979e
5 changed files with 47 additions and 26 deletions

View File

@@ -26,6 +26,11 @@ extern int ir_core_debug;
#define IR_dprintk(level, fmt, arg...) if (ir_core_debug >= level) \
printk(KERN_DEBUG "%s: " fmt , __func__, ## arg)
enum rc_driver_type {
RC_DRIVER_SCANCODE = 0, /* Driver or hardware generates a scancode */
RC_DRIVER_IR_RAW, /* Needs a Infra-Red pulse/space decoder */
};
enum raw_event_type {
IR_SPACE = (1 << 0),
IR_PULSE = (1 << 1),
@@ -35,6 +40,8 @@ enum raw_event_type {
/**
* struct ir_dev_props - Allow caller drivers to set special properties
* @driver_type: specifies if the driver or hardware have already a decoder,
* or if it needs to use the IR raw event decoders to produce a scancode
* @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
@@ -49,12 +56,13 @@ enum raw_event_type {
* is opened.
*/
struct ir_dev_props {
unsigned long allowed_protos;
u32 scanmask;
void *priv;
int (*change_protocol)(void *priv, u64 ir_type);
int (*open)(void *priv);
void (*close)(void *priv);
enum rc_driver_type driver_type;
unsigned long allowed_protos;
u32 scanmask;
void *priv;
int (*change_protocol)(void *priv, u64 ir_type);
int (*open)(void *priv);
void (*close)(void *priv);
};
struct ir_raw_event {