diff options
author | Frank Schaefer <fschaefer.oss@googlemail.com> | 2012-12-27 17:02:47 -0500 |
---|---|---|
committer | Mauro Carvalho Chehab <mchehab@redhat.com> | 2013-01-04 22:12:11 -0500 |
commit | 6ea887efadec30ec830ed9466073715b7d339d2b (patch) | |
tree | f88ac9d9599fa6626ce20c94114616ed3b29e36c | |
parent | 05fe2175cf87da8a5475aed422bd636475ab0412 (diff) |
[media] em28xx: IR RC: move assignment of get_key functions from *_change_protocol() functions to em28xx_ir_init()
The get_key functions are independent from the selected protocol, so assign
them once only at device initialization.
[mchehab@redhat.com: fix a merge conflict]
Signed-off-by: Frank Schäfer <fschaefer.oss@googlemail.com>
Signed-off-by: Mauro Carvalho Chehab <mchehab@redhat.com>
-rw-r--r-- | drivers/media/usb/em28xx/em28xx-input.c | 6 |
1 files changed, 2 insertions, 4 deletions
diff --git a/drivers/media/usb/em28xx/em28xx-input.c b/drivers/media/usb/em28xx/em28xx-input.c index 5b3292c8310b..07f6030d7455 100644 --- a/drivers/media/usb/em28xx/em28xx-input.c +++ b/drivers/media/usb/em28xx/em28xx-input.c | |||
@@ -384,7 +384,6 @@ static int em2860_ir_change_protocol(struct rc_dev *rc_dev, u64 *rc_type) | |||
384 | *rc_type = ir->rc_type; | 384 | *rc_type = ir->rc_type; |
385 | return -EINVAL; | 385 | return -EINVAL; |
386 | } | 386 | } |
387 | ir->get_key = default_polling_getkey; | ||
388 | em28xx_write_reg_bits(dev, EM28XX_R0F_XCLK, dev->board.xclk, | 387 | em28xx_write_reg_bits(dev, EM28XX_R0F_XCLK, dev->board.xclk, |
389 | EM28XX_XCLK_IR_RC5_MODE); | 388 | EM28XX_XCLK_IR_RC5_MODE); |
390 | 389 | ||
@@ -420,10 +419,7 @@ static int em2874_ir_change_protocol(struct rc_dev *rc_dev, u64 *rc_type) | |||
420 | *rc_type = ir->rc_type; | 419 | *rc_type = ir->rc_type; |
421 | return -EINVAL; | 420 | return -EINVAL; |
422 | } | 421 | } |
423 | |||
424 | ir->get_key = em2874_polling_getkey; | ||
425 | em28xx_write_regs(dev, EM2874_R50_IR_CONFIG, &ir_config, 1); | 422 | em28xx_write_regs(dev, EM2874_R50_IR_CONFIG, &ir_config, 1); |
426 | |||
427 | em28xx_write_reg_bits(dev, EM28XX_R0F_XCLK, dev->board.xclk, | 423 | em28xx_write_reg_bits(dev, EM28XX_R0F_XCLK, dev->board.xclk, |
428 | EM28XX_XCLK_IR_RC5_MODE); | 424 | EM28XX_XCLK_IR_RC5_MODE); |
429 | 425 | ||
@@ -633,10 +629,12 @@ static int em28xx_ir_init(struct em28xx *dev) | |||
633 | case CHIP_ID_EM2860: | 629 | case CHIP_ID_EM2860: |
634 | case CHIP_ID_EM2883: | 630 | case CHIP_ID_EM2883: |
635 | rc->allowed_protos = RC_BIT_RC5 | RC_BIT_NEC; | 631 | rc->allowed_protos = RC_BIT_RC5 | RC_BIT_NEC; |
632 | ir->get_key = default_polling_getkey; | ||
636 | break; | 633 | break; |
637 | case CHIP_ID_EM2884: | 634 | case CHIP_ID_EM2884: |
638 | case CHIP_ID_EM2874: | 635 | case CHIP_ID_EM2874: |
639 | case CHIP_ID_EM28174: | 636 | case CHIP_ID_EM28174: |
637 | ir->get_key = em2874_polling_getkey; | ||
640 | rc->allowed_protos = RC_BIT_RC5 | RC_BIT_NEC | RC_BIT_RC6_0; | 638 | rc->allowed_protos = RC_BIT_RC5 | RC_BIT_NEC | RC_BIT_RC6_0; |
641 | break; | 639 | break; |
642 | default: | 640 | default: |