summaryrefslogtreecommitdiff
path: root/drivers/media/IR/ir-rc6-decoder.c
diff options
context:
space:
mode:
authorJarod Wilson <jarod@redhat.com>2010-06-01 17:27:07 -0300
committerMauro Carvalho Chehab <mchehab@redhat.com>2010-08-02 14:05:46 -0300
commit7366646e20f8800433333a7102e3ce488215e33f (patch)
treecba4f6fc7606d9ad68d05f7ab94a2e9060485f92 /drivers/media/IR/ir-rc6-decoder.c
parentc2284261113f09bca4d362f5d51c008b65f55b6a (diff)
V4L/DVB: IR: only initially registers protocol that matches loaded keymap
Rather than registering all IR protocol decoders as enabled when bringing up a new device, only enable the IR protocol decoder that matches the keymap being loaded. Additional decoders can be enabled on the fly by those that need to, either by twiddling sysfs bits or by using the ir-keytable util from v4l-utils. Functional testing done with the mceusb driver, and it behaves as expected, only the rc6 decoder is enabled, keys are all handled properly, etc. Signed-off-by: Jarod Wilson <jarod@redhat.com> Signed-off-by: Mauro Carvalho Chehab <mchehab@redhat.com>
Diffstat (limited to 'drivers/media/IR/ir-rc6-decoder.c')
-rw-r--r--drivers/media/IR/ir-rc6-decoder.c4
1 files changed, 3 insertions, 1 deletions
diff --git a/drivers/media/IR/ir-rc6-decoder.c b/drivers/media/IR/ir-rc6-decoder.c
index 2bf479f4f1bc..9f61da29face 100644
--- a/drivers/media/IR/ir-rc6-decoder.c
+++ b/drivers/media/IR/ir-rc6-decoder.c
@@ -352,6 +352,7 @@ static int ir_rc6_register(struct input_dev *input_dev)
{
struct ir_input_dev *ir_dev = input_get_drvdata(input_dev);
struct decoder_data *data;
+ u64 ir_type = ir_dev->rc_tab.ir_type;
int rc;
rc = sysfs_create_group(&ir_dev->dev.kobj, &decoder_attribute_group);
@@ -365,7 +366,8 @@ static int ir_rc6_register(struct input_dev *input_dev)
}
data->ir_dev = ir_dev;
- data->enabled = 1;
+ if (ir_type == IR_TYPE_RC6 || ir_type == IR_TYPE_UNKNOWN)
+ data->enabled = 1;
spin_lock(&decoder_lock);
list_add_tail(&data->list, &decoder_list);