diff options
author | Mauro Carvalho Chehab <mchehab@redhat.com> | 2009-12-14 00:16:55 -0300 |
---|---|---|
committer | Mauro Carvalho Chehab <mchehab@redhat.com> | 2010-02-26 15:10:23 -0300 |
commit | e93854da880d6dc357c00625d8371b6a926fd19b (patch) | |
tree | 8bf87df8cf639fe7af7e35fb5cbc42792742a31b /drivers/media/IR | |
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 'drivers/media/IR')
-rw-r--r-- | drivers/media/IR/ir-functions.c | 2 | ||||
-rw-r--r-- | drivers/media/IR/ir-keytable.c | 9 |
2 files changed, 8 insertions, 3 deletions
diff --git a/drivers/media/IR/ir-functions.c b/drivers/media/IR/ir-functions.c index 776a136616d..b501ac9d401 100644 --- a/drivers/media/IR/ir-functions.c +++ b/drivers/media/IR/ir-functions.c @@ -52,7 +52,7 @@ static void ir_input_key_event(struct input_dev *dev, struct ir_input_state *ir) /* -------------------------------------------------------------------------- */ int ir_input_init(struct input_dev *dev, struct ir_input_state *ir, - int ir_type) + const enum ir_type ir_type) { ir->ir_type = ir_type; diff --git a/drivers/media/IR/ir-keytable.c b/drivers/media/IR/ir-keytable.c index 8097561ec66..b2d498c3183 100644 --- a/drivers/media/IR/ir-keytable.c +++ b/drivers/media/IR/ir-keytable.c @@ -89,6 +89,8 @@ EXPORT_SYMBOL_GPL(ir_roundup_tablesize); * @origin: origin table * * Copies all entries where the keycode is not KEY_UNKNOWN/KEY_RESERVED + * Also copies table size and table protocol. + * NOTE: It shouldn't copy the lock field */ int ir_copy_table(struct ir_scancode_table *destin, @@ -105,6 +107,7 @@ int ir_copy_table(struct ir_scancode_table *destin, j++; } destin->size = j; + destin->ir_type = origin->ir_type; IR_dprintk(1, "Copied %d scancodes to the new keycode table\n", destin->size); @@ -404,7 +407,8 @@ EXPORT_SYMBOL_GPL(ir_g_keycode_from_table); * It should be called before registering the IR device. */ int ir_input_register(struct input_dev *input_dev, - struct ir_scancode_table *rc_tab) + const struct ir_scancode_table *rc_tab, + const struct ir_dev_props *props) { struct ir_input_dev *ir_dev; struct ir_scancode *keymap = rc_tab->scan; @@ -417,7 +421,7 @@ int ir_input_register(struct input_dev *input_dev, if (!ir_dev) return -ENOMEM; - spin_lock_init(&rc_tab->lock); + spin_lock_init(&ir_dev->rc_tab.lock); ir_dev->rc_tab.size = ir_roundup_tablesize(rc_tab->size); ir_dev->rc_tab.scan = kzalloc(ir_dev->rc_tab.size * @@ -430,6 +434,7 @@ int ir_input_register(struct input_dev *input_dev, ir_dev->rc_tab.size * sizeof(ir_dev->rc_tab.scan)); ir_copy_table(&ir_dev->rc_tab, rc_tab); + ir_dev->props = props; /* set the bits for the keys */ IR_dprintk(1, "key map size: %d\n", rc_tab->size); |