diff options
author | Jarod Wilson <jarod@redhat.com> | 2010-06-01 16:27:07 -0400 |
---|---|---|
committer | Mauro Carvalho Chehab <mchehab@redhat.com> | 2010-08-02 13:05:46 -0400 |
commit | 7366646e20f8800433333a7102e3ce488215e33f (patch) | |
tree | cba4f6fc7606d9ad68d05f7ab94a2e9060485f92 /drivers | |
parent | c2284261113f09bca4d362f5d51c008b65f55b6a (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')
-rw-r--r-- | drivers/media/IR/ir-jvc-decoder.c | 4 | ||||
-rw-r--r-- | drivers/media/IR/ir-nec-decoder.c | 4 | ||||
-rw-r--r-- | drivers/media/IR/ir-rc5-decoder.c | 4 | ||||
-rw-r--r-- | drivers/media/IR/ir-rc6-decoder.c | 4 | ||||
-rw-r--r-- | drivers/media/IR/ir-sony-decoder.c | 4 |
5 files changed, 15 insertions, 5 deletions
diff --git a/drivers/media/IR/ir-jvc-decoder.c b/drivers/media/IR/ir-jvc-decoder.c index 0b804944cbb0..b02e8013b9bb 100644 --- a/drivers/media/IR/ir-jvc-decoder.c +++ b/drivers/media/IR/ir-jvc-decoder.c | |||
@@ -253,6 +253,7 @@ static int ir_jvc_register(struct input_dev *input_dev) | |||
253 | { | 253 | { |
254 | struct ir_input_dev *ir_dev = input_get_drvdata(input_dev); | 254 | struct ir_input_dev *ir_dev = input_get_drvdata(input_dev); |
255 | struct decoder_data *data; | 255 | struct decoder_data *data; |
256 | u64 ir_type = ir_dev->rc_tab.ir_type; | ||
256 | int rc; | 257 | int rc; |
257 | 258 | ||
258 | rc = sysfs_create_group(&ir_dev->dev.kobj, &decoder_attribute_group); | 259 | rc = sysfs_create_group(&ir_dev->dev.kobj, &decoder_attribute_group); |
@@ -266,7 +267,8 @@ static int ir_jvc_register(struct input_dev *input_dev) | |||
266 | } | 267 | } |
267 | 268 | ||
268 | data->ir_dev = ir_dev; | 269 | data->ir_dev = ir_dev; |
269 | data->enabled = 1; | 270 | if (ir_type == IR_TYPE_JVC || ir_type == IR_TYPE_UNKNOWN) |
271 | data->enabled = 1; | ||
270 | 272 | ||
271 | spin_lock(&decoder_lock); | 273 | spin_lock(&decoder_lock); |
272 | list_add_tail(&data->list, &decoder_list); | 274 | list_add_tail(&data->list, &decoder_list); |
diff --git a/drivers/media/IR/ir-nec-decoder.c b/drivers/media/IR/ir-nec-decoder.c index ba79233112ef..6059a1f1e151 100644 --- a/drivers/media/IR/ir-nec-decoder.c +++ b/drivers/media/IR/ir-nec-decoder.c | |||
@@ -260,6 +260,7 @@ static int ir_nec_register(struct input_dev *input_dev) | |||
260 | { | 260 | { |
261 | struct ir_input_dev *ir_dev = input_get_drvdata(input_dev); | 261 | struct ir_input_dev *ir_dev = input_get_drvdata(input_dev); |
262 | struct decoder_data *data; | 262 | struct decoder_data *data; |
263 | u64 ir_type = ir_dev->rc_tab.ir_type; | ||
263 | int rc; | 264 | int rc; |
264 | 265 | ||
265 | rc = sysfs_create_group(&ir_dev->dev.kobj, &decoder_attribute_group); | 266 | rc = sysfs_create_group(&ir_dev->dev.kobj, &decoder_attribute_group); |
@@ -273,7 +274,8 @@ static int ir_nec_register(struct input_dev *input_dev) | |||
273 | } | 274 | } |
274 | 275 | ||
275 | data->ir_dev = ir_dev; | 276 | data->ir_dev = ir_dev; |
276 | data->enabled = 1; | 277 | if (ir_type == IR_TYPE_NEC || ir_type == IR_TYPE_UNKNOWN) |
278 | data->enabled = 1; | ||
277 | 279 | ||
278 | spin_lock(&decoder_lock); | 280 | spin_lock(&decoder_lock); |
279 | list_add_tail(&data->list, &decoder_list); | 281 | list_add_tail(&data->list, &decoder_list); |
diff --git a/drivers/media/IR/ir-rc5-decoder.c b/drivers/media/IR/ir-rc5-decoder.c index 23cdb1b1a3bc..4aa797bc69fd 100644 --- a/drivers/media/IR/ir-rc5-decoder.c +++ b/drivers/media/IR/ir-rc5-decoder.c | |||
@@ -256,6 +256,7 @@ static int ir_rc5_register(struct input_dev *input_dev) | |||
256 | { | 256 | { |
257 | struct ir_input_dev *ir_dev = input_get_drvdata(input_dev); | 257 | struct ir_input_dev *ir_dev = input_get_drvdata(input_dev); |
258 | struct decoder_data *data; | 258 | struct decoder_data *data; |
259 | u64 ir_type = ir_dev->rc_tab.ir_type; | ||
259 | int rc; | 260 | int rc; |
260 | 261 | ||
261 | rc = sysfs_create_group(&ir_dev->dev.kobj, &decoder_attribute_group); | 262 | rc = sysfs_create_group(&ir_dev->dev.kobj, &decoder_attribute_group); |
@@ -269,7 +270,8 @@ static int ir_rc5_register(struct input_dev *input_dev) | |||
269 | } | 270 | } |
270 | 271 | ||
271 | data->ir_dev = ir_dev; | 272 | data->ir_dev = ir_dev; |
272 | data->enabled = 1; | 273 | if (ir_type == IR_TYPE_RC5 || ir_type == IR_TYPE_UNKNOWN) |
274 | data->enabled = 1; | ||
273 | 275 | ||
274 | spin_lock(&decoder_lock); | 276 | spin_lock(&decoder_lock); |
275 | list_add_tail(&data->list, &decoder_list); | 277 | list_add_tail(&data->list, &decoder_list); |
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) | |||
352 | { | 352 | { |
353 | struct ir_input_dev *ir_dev = input_get_drvdata(input_dev); | 353 | struct ir_input_dev *ir_dev = input_get_drvdata(input_dev); |
354 | struct decoder_data *data; | 354 | struct decoder_data *data; |
355 | u64 ir_type = ir_dev->rc_tab.ir_type; | ||
355 | int rc; | 356 | int rc; |
356 | 357 | ||
357 | rc = sysfs_create_group(&ir_dev->dev.kobj, &decoder_attribute_group); | 358 | 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) | |||
365 | } | 366 | } |
366 | 367 | ||
367 | data->ir_dev = ir_dev; | 368 | data->ir_dev = ir_dev; |
368 | data->enabled = 1; | 369 | if (ir_type == IR_TYPE_RC6 || ir_type == IR_TYPE_UNKNOWN) |
370 | data->enabled = 1; | ||
369 | 371 | ||
370 | spin_lock(&decoder_lock); | 372 | spin_lock(&decoder_lock); |
371 | list_add_tail(&data->list, &decoder_list); | 373 | list_add_tail(&data->list, &decoder_list); |
diff --git a/drivers/media/IR/ir-sony-decoder.c b/drivers/media/IR/ir-sony-decoder.c index 9f440c5c060d..219075ffd6b7 100644 --- a/drivers/media/IR/ir-sony-decoder.c +++ b/drivers/media/IR/ir-sony-decoder.c | |||
@@ -245,6 +245,7 @@ static int ir_sony_register(struct input_dev *input_dev) | |||
245 | { | 245 | { |
246 | struct ir_input_dev *ir_dev = input_get_drvdata(input_dev); | 246 | struct ir_input_dev *ir_dev = input_get_drvdata(input_dev); |
247 | struct decoder_data *data; | 247 | struct decoder_data *data; |
248 | u64 ir_type = ir_dev->rc_tab.ir_type; | ||
248 | int rc; | 249 | int rc; |
249 | 250 | ||
250 | rc = sysfs_create_group(&ir_dev->dev.kobj, &decoder_attribute_group); | 251 | rc = sysfs_create_group(&ir_dev->dev.kobj, &decoder_attribute_group); |
@@ -258,7 +259,8 @@ static int ir_sony_register(struct input_dev *input_dev) | |||
258 | } | 259 | } |
259 | 260 | ||
260 | data->ir_dev = ir_dev; | 261 | data->ir_dev = ir_dev; |
261 | data->enabled = 1; | 262 | if (ir_type == IR_TYPE_SONY || ir_type == IR_TYPE_UNKNOWN) |
263 | data->enabled = 1; | ||
262 | 264 | ||
263 | spin_lock(&decoder_lock); | 265 | spin_lock(&decoder_lock); |
264 | list_add_tail(&data->list, &decoder_list); | 266 | list_add_tail(&data->list, &decoder_list); |