]> git.proxmox.com Git - mirror_ubuntu-zesty-kernel.git/commitdiff
V4L/DVB (13536): em28xx: Use the full RC5 code on HVR-950 Remote Controller
authorMauro Carvalho Chehab <mchehab@redhat.com>
Sat, 28 Nov 2009 02:28:40 +0000 (23:28 -0300)
committerMauro Carvalho Chehab <mchehab@redhat.com>
Sat, 5 Dec 2009 20:42:20 +0000 (18:42 -0200)
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>
drivers/media/video/em28xx/em28xx-cards.c
drivers/media/video/em28xx/em28xx-input.c

index ed5acc3a2b5aac2e28422fa1a40d1064761ed36e..82da205047befb219b7c6f945a6c44af222d93ed 100644 (file)
@@ -837,7 +837,7 @@ struct em28xx_board em28xx_boards[] = {
                .mts_firmware   = 1,
                .has_dvb        = 1,
                .dvb_gpio       = hauppauge_wintv_hvr_900_digital,
-               .ir_codes       = &ir_codes_hauppauge_new_table,
+               .ir_codes       = &ir_codes_rc5_hauppauge_new_table,
                .decoder        = EM28XX_TVP5150,
                .input          = { {
                        .type     = EM28XX_VMUX_TELEVISION,
index 990ee04bbd5e1c7f7a828b98f9c48b221ba3acc9..5550de9c669f65a2240e2e06417505cd959a9edd 100644 (file)
@@ -70,6 +70,7 @@ struct em28xx_IR {
        int polling;
        struct delayed_work work;
        unsigned int last_toggle:1;
+       unsigned int full_code:1;
        unsigned int last_readcount;
        unsigned int repeat_interval;
 
@@ -246,9 +247,10 @@ static void em28xx_ir_handle_key(struct em28xx_IR *ir)
                return;
        }
 
-       dprintk("ir->get_key result tb=%02x rc=%02x lr=%02x data=%02x\n",
+       dprintk("ir->get_key result tb=%02x rc=%02x lr=%02x data=%02x%02x\n",
                poll_result.toggle_bit, poll_result.read_count,
-               ir->last_readcount, poll_result.rc_data[0]);
+               ir->last_readcount, poll_result.rc_address,
+               poll_result.rc_data[0]);
 
        if (ir->dev->chip_id == CHIP_ID_EM2874) {
                /* The em2874 clears the readcount field every time the
@@ -282,7 +284,15 @@ static void em28xx_ir_handle_key(struct em28xx_IR *ir)
 
        if (do_sendkey) {
                dprintk("sending keypress\n");
-               ir_input_keydown(ir->input, &ir->ir, poll_result.rc_data[0]);
+
+               if (ir->full_code)
+                       ir_input_keydown(ir->input, &ir->ir,
+                                        poll_result.rc_address << 8 |
+                                        poll_result.rc_data[0]);
+               else
+                       ir_input_keydown(ir->input, &ir->ir,
+                                        poll_result.rc_data[0]);
+
                ir_input_nokey(ir->input, &ir->ir);
        }
 
@@ -332,6 +342,8 @@ int em28xx_ir_init(struct em28xx *dev)
        switch (dev->chip_id) {
        case CHIP_ID_EM2860:
        case CHIP_ID_EM2883:
+               if (dev->model == EM2883_BOARD_HAUPPAUGE_WINTV_HVR_950)
+                       ir->full_code = 1;
                ir->get_key = default_polling_getkey;
                break;
        case CHIP_ID_EM2874: