]> git.proxmox.com Git - mirror_ubuntu-disco-kernel.git/commitdiff
media: saa7134: hvr1110 can decode rc6
authorSean Young <sean@mess.org>
Sat, 27 Oct 2018 14:44:22 +0000 (10:44 -0400)
committerMauro Carvalho Chehab <mchehab+samsung@kernel.org>
Thu, 22 Nov 2018 18:31:32 +0000 (13:31 -0500)
The function get_key_hvr1110 can only decode rc5, however this is a
standard hauppauge z8f0811 which can decode rc6 as well. Use
get_key_haup_xvr() instead.

Tested on a HVR 1110.

Signed-off-by: Sean Young <sean@mess.org>
Signed-off-by: Mauro Carvalho Chehab <mchehab+samsung@kernel.org>
drivers/media/pci/saa7134/saa7134-input.c

index 6e6d68964017a82d32bd59eacfaa4a5e0bcbd30e..bc1ed7798d2165be895a3b5db690ccf2d2f5abcc 100644 (file)
@@ -299,43 +299,6 @@ static int get_key_purpletv(struct IR_i2c *ir, enum rc_proto *protocol,
        return 1;
 }
 
-static int get_key_hvr1110(struct IR_i2c *ir, enum rc_proto *protocol,
-                          u32 *scancode, u8 *toggle)
-{
-       int rc;
-       unsigned char buf[5];
-
-       /* poll IR chip */
-       rc = i2c_master_recv(ir->c, buf, 5);
-       if (rc != 5) {
-               ir_dbg(ir, "read error\n");
-               if (rc < 0)
-                       return rc;
-               return -EIO;
-       }
-
-       /* Check if some key were pressed */
-       if (!(buf[0] & 0x80))
-               return 0;
-
-       /*
-        * buf[3] & 0x80 is always high.
-        * buf[3] & 0x40 is a parity bit. A repeat event is marked
-        * by preserving it into two separate readings
-        * buf[4] bits 0 and 1, and buf[1] and buf[2] are always
-        * zero.
-        *
-        * Note that the keymap which the hvr1110 uses is RC5.
-        *
-        * FIXME: start bits could maybe be used...?
-        */
-       *protocol = RC_PROTO_RC5;
-       *scancode = RC_SCANCODE_RC5(buf[3] & 0x1f, buf[4] >> 2);
-       *toggle = !!(buf[3] & 0x40);
-       return 1;
-}
-
-
 static int get_key_beholdm6xx(struct IR_i2c *ir, enum rc_proto *protocol,
                              u32 *scancode, u8 *toggle)
 {
@@ -1029,9 +992,11 @@ void saa7134_probe_i2c_ir(struct saa7134_dev *dev)
                        (1 == rc) ? "yes" : "no");
                break;
        case SAA7134_BOARD_HAUPPAUGE_HVR1110:
-               dev->init_data.name = "HVR 1110";
-               dev->init_data.get_key = get_key_hvr1110;
+               dev->init_data.name = saa7134_boards[dev->board].name;
                dev->init_data.ir_codes = RC_MAP_HAUPPAUGE;
+               dev->init_data.type = RC_PROTO_BIT_RC5 |
+                               RC_PROTO_BIT_RC6_MCE | RC_PROTO_BIT_RC6_6A_32;
+               dev->init_data.internal_get_key_func = IR_KBD_GET_KEY_HAUP_XVR;
                info.addr = 0x71;
                break;
        case SAA7134_BOARD_BEHOLD_607FM_MK3: