diff options
author | Mauro Carvalho Chehab <mchehab@redhat.com> | 2009-12-05 06:27:49 -0500 |
---|---|---|
committer | Mauro Carvalho Chehab <mchehab@redhat.com> | 2009-12-15 21:17:52 -0500 |
commit | 1bad429e81f9a9ffa01c4158e6d1b1a3e06d9886 (patch) | |
tree | a87f098b83549bd393819c9852524cf811bc7f98 /drivers/media/video/em28xx/em28xx-input.c | |
parent | 4039ff28a501cf6b9fc2b6a2c2b28476d7fa14cd (diff) |
V4L/DVB (13545): em28xx: properly select IR protocol based on the IR table
Signed-off-by: Mauro Carvalho Chehab <mchehab@redhat.com>
Diffstat (limited to 'drivers/media/video/em28xx/em28xx-input.c')
-rw-r--r-- | drivers/media/video/em28xx/em28xx-input.c | 17 |
1 files changed, 13 insertions, 4 deletions
diff --git a/drivers/media/video/em28xx/em28xx-input.c b/drivers/media/video/em28xx/em28xx-input.c index d96ec7c09dca..3f5cf02f3147 100644 --- a/drivers/media/video/em28xx/em28xx-input.c +++ b/drivers/media/video/em28xx/em28xx-input.c | |||
@@ -337,19 +337,28 @@ int em28xx_ir_init(struct em28xx *dev) | |||
337 | goto err_out_free; | 337 | goto err_out_free; |
338 | 338 | ||
339 | ir->input = input_dev; | 339 | ir->input = input_dev; |
340 | ir_config = EM2874_IR_RC5; | ||
341 | |||
342 | /* Adjust xclk based o IR table for RC5/NEC tables */ | ||
343 | if (dev->board.ir_codes->ir_type == IR_TYPE_RC5) { | ||
344 | dev->board.xclk |= EM28XX_XCLK_IR_RC5_MODE; | ||
345 | ir->full_code = 1; | ||
346 | } else if (dev->board.ir_codes->ir_type == IR_TYPE_NEC) { | ||
347 | dev->board.xclk &= ~EM28XX_XCLK_IR_RC5_MODE; | ||
348 | ir_config = EM2874_IR_NEC; | ||
349 | ir->full_code = 1; | ||
350 | } | ||
351 | em28xx_write_reg_bits(dev, EM28XX_R0F_XCLK, dev->board.xclk, | ||
352 | EM28XX_XCLK_IR_RC5_MODE); | ||
340 | 353 | ||
341 | /* Setup the proper handler based on the chip */ | 354 | /* Setup the proper handler based on the chip */ |
342 | switch (dev->chip_id) { | 355 | switch (dev->chip_id) { |
343 | case CHIP_ID_EM2860: | 356 | case CHIP_ID_EM2860: |
344 | case CHIP_ID_EM2883: | 357 | case CHIP_ID_EM2883: |
345 | if (dev->model == EM2883_BOARD_HAUPPAUGE_WINTV_HVR_950) | ||
346 | ir->full_code = 1; | ||
347 | ir->get_key = default_polling_getkey; | 358 | ir->get_key = default_polling_getkey; |
348 | break; | 359 | break; |
349 | case CHIP_ID_EM2874: | 360 | case CHIP_ID_EM2874: |
350 | ir->get_key = em2874_polling_getkey; | 361 | ir->get_key = em2874_polling_getkey; |
351 | /* For now we only support RC5, so enable it */ | ||
352 | ir_config = EM2874_IR_RC5; | ||
353 | em28xx_write_regs(dev, EM2874_R50_IR_CONFIG, &ir_config, 1); | 362 | em28xx_write_regs(dev, EM2874_R50_IR_CONFIG, &ir_config, 1); |
354 | break; | 363 | break; |
355 | default: | 364 | default: |