summaryrefslogtreecommitdiffstats
path: root/drivers/media/IR/ir-core-priv.h
diff options
context:
space:
mode:
authorDavid Härdeman2010-06-13 22:29:31 +0200
committerMauro Carvalho Chehab2010-08-02 19:54:27 +0200
commit667c9ebe97f7e5f1e48e7eb321644c6fb1668de5 (patch)
tree11dae4e3d480960fe697964776222b16ee0ecce8 /drivers/media/IR/ir-core-priv.h
parentV4L/DVB: ir-core: partially convert ir-kbd-i2c.c to not use ir-functions.c (diff)
downloadkernel-qcow2-linux-667c9ebe97f7e5f1e48e7eb321644c6fb1668de5.tar.gz
kernel-qcow2-linux-667c9ebe97f7e5f1e48e7eb321644c6fb1668de5.tar.xz
kernel-qcow2-linux-667c9ebe97f7e5f1e48e7eb321644c6fb1668de5.zip
V4L/DVB: ir-core: centralize sysfs raw decoder enabling/disabling
With the current logic, each raw decoder needs to add a copy of the exact same sysfs code. This is both unnecessary and also means that (re)loading an IR driver after raw decoder modules have been loaded won't work as expected. This patch moves that logic into ir-raw-event and adds a single sysfs file per device. Reading that file returns something like: "rc5 [rc6] nec jvc [sony]" (with enabled protocols in [] brackets) Writing either "+protocol" or "-protocol" to that file will enable or disable the according protocol decoder. An additional benefit is that the disabling of a decoder will be remembered across module removal/insertion so a previously disabled decoder won't suddenly be activated again. The default setting is to enable all decoders. This is also necessary for the next patch which moves even more decoder state into the central raw decoding structs. Signed-off-by: David Härdeman <david@hardeman.nu> Acked-by: Jarod Wilson <jarod@redhat.com> Tested-by: Jarod Wilson <jarod@redhat.com> Signed-off-by: Mauro Carvalho Chehab <mchehab@redhat.com>
Diffstat (limited to 'drivers/media/IR/ir-core-priv.h')
-rw-r--r--drivers/media/IR/ir-core-priv.h3
1 files changed, 3 insertions, 0 deletions
diff --git a/drivers/media/IR/ir-core-priv.h b/drivers/media/IR/ir-core-priv.h
index 9a5e65a471a5..5111dc23909a 100644
--- a/drivers/media/IR/ir-core-priv.h
+++ b/drivers/media/IR/ir-core-priv.h
@@ -22,6 +22,7 @@
struct ir_raw_handler {
struct list_head list;
+ u64 protocols; /* which are handled by this handler */
int (*decode)(struct input_dev *input_dev, struct ir_raw_event event);
int (*raw_register)(struct input_dev *input_dev);
int (*raw_unregister)(struct input_dev *input_dev);
@@ -33,6 +34,7 @@ struct ir_raw_event_ctrl {
ktime_t last_event; /* when last event occurred */
enum raw_event_type last_type; /* last event type */
struct input_dev *input_dev; /* pointer to the parent input_dev */
+ u64 enabled_protocols; /* enabled raw protocol decoders */
};
/* macros for IR decoders */
@@ -74,6 +76,7 @@ void ir_unregister_class(struct input_dev *input_dev);
/*
* Routines from ir-raw-event.c to be used internally and by decoders
*/
+u64 ir_raw_get_allowed_protocols(void);
int ir_raw_event_register(struct input_dev *input_dev);
void ir_raw_event_unregister(struct input_dev *input_dev);
int ir_raw_handler_register(struct ir_raw_handler *ir_raw_handler);