--- zzzz-none-000/linux-3.10.107/drivers/media/usb/cx231xx/cx231xx-input.c 2017-06-27 09:49:32.000000000 +0000 +++ scorpion-7490-727/linux-3.10.107/drivers/media/usb/cx231xx/cx231xx-input.c 2021-02-04 17:41:59.000000000 +0000 @@ -1,7 +1,7 @@ /* * cx231xx IR glue driver * - * Copyright (C) 2010 Mauro Carvalho Chehab + * Copyright (C) 2010 Mauro Carvalho Chehab * * Polaris (cx231xx) has its support for IR's with a design close to MCE. * however, a few designs are using an external I2C chip for IR, instead @@ -19,13 +19,13 @@ */ #include "cx231xx.h" -#include #include +#include #define MODULE_NAME "cx231xx-input" -static int get_key_isdbt(struct IR_i2c *ir, u32 *ir_key, - u32 *ir_raw) +static int get_key_isdbt(struct IR_i2c *ir, enum rc_type *protocol, + u32 *pscancode, u8 *toggle) { int rc; u8 cmd, scancode; @@ -46,21 +46,14 @@ if (cmd == 0xff) return 0; - scancode = - ((cmd & 0x01) ? 0x80 : 0) | - ((cmd & 0x02) ? 0x40 : 0) | - ((cmd & 0x04) ? 0x20 : 0) | - ((cmd & 0x08) ? 0x10 : 0) | - ((cmd & 0x10) ? 0x08 : 0) | - ((cmd & 0x20) ? 0x04 : 0) | - ((cmd & 0x40) ? 0x02 : 0) | - ((cmd & 0x80) ? 0x01 : 0); + scancode = bitrev8(cmd); dev_dbg(&ir->rc->input_dev->dev, "cmd %02x, scan = %02x\n", cmd, scancode); - *ir_key = scancode; - *ir_raw = scancode; + *protocol = RC_TYPE_OTHER; + *pscancode = scancode; + *toggle = 0; return 1; } @@ -69,7 +62,7 @@ struct i2c_board_info info; u8 ir_i2c_bus; - dev_dbg(&dev->udev->dev, "%s\n", __func__); + dev_dbg(dev->dev, "%s\n", __func__); /* Only initialize if a rc keycode map is defined */ if (!cx231xx_boards[dev->model].rc_map_name) @@ -97,16 +90,17 @@ dev->init_data.get_key = get_key_isdbt; dev->init_data.ir_codes = cx231xx_boards[dev->model].rc_map_name; /* The i2c micro-controller only outputs the cmd part of NEC protocol */ - dev->init_data.rc_dev->scanmask = 0xff; + dev->init_data.rc_dev->scancode_mask = 0xff; dev->init_data.rc_dev->driver_name = "cx231xx"; dev->init_data.type = RC_BIT_NEC; info.addr = 0x30; /* Load and bind ir-kbd-i2c */ ir_i2c_bus = cx231xx_boards[dev->model].ir_i2c_master; - dev_dbg(&dev->udev->dev, "Trying to bind ir at bus %d, addr 0x%02x\n", + dev_dbg(dev->dev, "Trying to bind ir at bus %d, addr 0x%02x\n", ir_i2c_bus, info.addr); - dev->ir_i2c_client = i2c_new_device(&dev->i2c_bus[ir_i2c_bus].i2c_adap, &info); + dev->ir_i2c_client = i2c_new_device( + cx231xx_get_i2c_adap(dev, ir_i2c_bus), &info); return 0; }