aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/media
diff options
context:
space:
mode:
authorMauro Carvalho Chehab <mchehab@redhat.com>2009-11-27 21:28:40 -0500
committerMauro Carvalho Chehab <mchehab@redhat.com>2009-12-05 15:42:20 -0500
commit0278155c84af42d78785731263b69fb49f945ea7 (patch)
treef0b1a540d7b5ff1fb65d86b2b6ae86da9e7a4aab /drivers/media
parent35d1988c6e19db3d4240e2a60c71b3a13abf0781 (diff)
V4L/DVB (13536): em28xx: Use the full RC5 code on HVR-950 Remote Controller
Modifies the IR table for HVR-950 to use the newer Hauppauge RC5 table, and adds the RC5 address to the functions that get the scancode for this device. It is easy to add support for all other RC5 IR's on em2880 boards, but the scancode table needs to be re-generated. So, keep using the old 7bits tables while we don't have all tables converted. Also, the 7bits tables are still used on other drivers, so this small patch needs to be ported to all drivers. Signed-off-by: Mauro Carvalho Chehab <mchehab@redhat.com>
Diffstat (limited to 'drivers/media')
-rw-r--r--drivers/media/video/em28xx/em28xx-cards.c2
-rw-r--r--drivers/media/video/em28xx/em28xx-input.c18
2 files changed, 16 insertions, 4 deletions
diff --git a/drivers/media/video/em28xx/em28xx-cards.c b/drivers/media/video/em28xx/em28xx-cards.c
index ed5acc3a2b5a..82da205047be 100644
--- a/drivers/media/video/em28xx/em28xx-cards.c
+++ b/drivers/media/video/em28xx/em28xx-cards.c
@@ -837,7 +837,7 @@ struct em28xx_board em28xx_boards[] = {
837 .mts_firmware = 1, 837 .mts_firmware = 1,
838 .has_dvb = 1, 838 .has_dvb = 1,
839 .dvb_gpio = hauppauge_wintv_hvr_900_digital, 839 .dvb_gpio = hauppauge_wintv_hvr_900_digital,
840 .ir_codes = &ir_codes_hauppauge_new_table, 840 .ir_codes = &ir_codes_rc5_hauppauge_new_table,
841 .decoder = EM28XX_TVP5150, 841 .decoder = EM28XX_TVP5150,
842 .input = { { 842 .input = { {
843 .type = EM28XX_VMUX_TELEVISION, 843 .type = EM28XX_VMUX_TELEVISION,
diff --git a/drivers/media/video/em28xx/em28xx-input.c b/drivers/media/video/em28xx/em28xx-input.c
index 990ee04bbd5e..5550de9c669f 100644
--- a/drivers/media/video/em28xx/em28xx-input.c
+++ b/drivers/media/video/em28xx/em28xx-input.c
@@ -70,6 +70,7 @@ struct em28xx_IR {
70 int polling; 70 int polling;
71 struct delayed_work work; 71 struct delayed_work work;
72 unsigned int last_toggle:1; 72 unsigned int last_toggle:1;
73 unsigned int full_code:1;
73 unsigned int last_readcount; 74 unsigned int last_readcount;
74 unsigned int repeat_interval; 75 unsigned int repeat_interval;
75 76
@@ -246,9 +247,10 @@ static void em28xx_ir_handle_key(struct em28xx_IR *ir)
246 return; 247 return;
247 } 248 }
248 249
249 dprintk("ir->get_key result tb=%02x rc=%02x lr=%02x data=%02x\n", 250 dprintk("ir->get_key result tb=%02x rc=%02x lr=%02x data=%02x%02x\n",
250 poll_result.toggle_bit, poll_result.read_count, 251 poll_result.toggle_bit, poll_result.read_count,
251 ir->last_readcount, poll_result.rc_data[0]); 252 ir->last_readcount, poll_result.rc_address,
253 poll_result.rc_data[0]);
252 254
253 if (ir->dev->chip_id == CHIP_ID_EM2874) { 255 if (ir->dev->chip_id == CHIP_ID_EM2874) {
254 /* The em2874 clears the readcount field every time the 256 /* The em2874 clears the readcount field every time the
@@ -282,7 +284,15 @@ static void em28xx_ir_handle_key(struct em28xx_IR *ir)
282 284
283 if (do_sendkey) { 285 if (do_sendkey) {
284 dprintk("sending keypress\n"); 286 dprintk("sending keypress\n");
285 ir_input_keydown(ir->input, &ir->ir, poll_result.rc_data[0]); 287
288 if (ir->full_code)
289 ir_input_keydown(ir->input, &ir->ir,
290 poll_result.rc_address << 8 |
291 poll_result.rc_data[0]);
292 else
293 ir_input_keydown(ir->input, &ir->ir,
294 poll_result.rc_data[0]);
295
286 ir_input_nokey(ir->input, &ir->ir); 296 ir_input_nokey(ir->input, &ir->ir);
287 } 297 }
288 298
@@ -332,6 +342,8 @@ int em28xx_ir_init(struct em28xx *dev)
332 switch (dev->chip_id) { 342 switch (dev->chip_id) {
333 case CHIP_ID_EM2860: 343 case CHIP_ID_EM2860:
334 case CHIP_ID_EM2883: 344 case CHIP_ID_EM2883:
345 if (dev->model == EM2883_BOARD_HAUPPAUGE_WINTV_HVR_950)
346 ir->full_code = 1;
335 ir->get_key = default_polling_getkey; 347 ir->get_key = default_polling_getkey;
336 break; 348 break;
337 case CHIP_ID_EM2874: 349 case CHIP_ID_EM2874: