Linux kernel mirror (for testing) git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
kernel os linux

Merge branch 'for-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/dtor/input

Pull input fixes from Dmitry Torokhov:
"Nothing terribly interesting, just a few fixups"

* 'for-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/dtor/input:
Input: xpad - sync supported devices with fork on GitHub
Input: ariel-pwrbutton - remove unused variable ariel_pwrbutton_id_table
Input: goodix - add support for Goodix GT9286 chip
dt-bindings: input: touchscreen: goodix: Add binding for GT9286 IC
dt-bindings: input: adc-keys: clarify description
Input: ili210x - implement pressure reporting for ILI251x
Input: i8042 - unbreak Pegatron C15B
Input: st1232 - wait until device is ready before reading resolution
Input: st1232 - do not read more bytes than needed
Input: st1232 - fix off-by-one error in resolution handling

+102 -22
+20 -2
Documentation/devicetree/bindings/input/adc-keys.txt
··· 5 5 - compatible: "adc-keys" 6 6 - io-channels: Phandle to an ADC channel 7 7 - io-channel-names = "buttons"; 8 - - keyup-threshold-microvolt: Voltage at which all the keys are considered up. 8 + - keyup-threshold-microvolt: Voltage above or equal to which all the keys are 9 + considered up. 9 10 10 11 Optional properties: 11 12 - poll-interval: Poll interval time in milliseconds ··· 18 17 Required subnode-properties: 19 18 - label: Descriptive name of the key. 20 19 - linux,code: Keycode to emit. 21 - - press-threshold-microvolt: Voltage ADC input when this key is pressed. 20 + - press-threshold-microvolt: voltage above or equal to which this key is 21 + considered pressed. 22 + 23 + No two values of press-threshold-microvolt may be the same. 24 + All values of press-threshold-microvolt must be less than 25 + keyup-threshold-microvolt. 22 26 23 27 Example: 24 28 ··· 53 47 press-threshold-microvolt = <500000>; 54 48 }; 55 49 }; 50 + 51 + +--------------------------------+------------------------+ 52 + | 2.000.000 <= value | no key pressed | 53 + +--------------------------------+------------------------+ 54 + | 1.500.000 <= value < 2.000.000 | KEY_VOLUMEUP pressed | 55 + +--------------------------------+------------------------+ 56 + | 1.000.000 <= value < 1.500.000 | KEY_VOLUMEDOWN pressed | 57 + +--------------------------------+------------------------+ 58 + | 500.000 <= value < 1.000.000 | KEY_ENTER pressed | 59 + +--------------------------------+------------------------+ 60 + | value < 500.000 | no key pressed | 61 + +--------------------------------+------------------------+
+1
Documentation/devicetree/bindings/input/touchscreen/goodix.yaml
··· 26 26 - goodix,gt927 27 27 - goodix,gt9271 28 28 - goodix,gt928 29 + - goodix,gt9286 29 30 - goodix,gt967 30 31 31 32 reg:
+16 -1
drivers/input/joystick/xpad.c
··· 215 215 { 0x0e6f, 0x0213, "Afterglow Gamepad for Xbox 360", 0, XTYPE_XBOX360 }, 216 216 { 0x0e6f, 0x021f, "Rock Candy Gamepad for Xbox 360", 0, XTYPE_XBOX360 }, 217 217 { 0x0e6f, 0x0246, "Rock Candy Gamepad for Xbox One 2015", 0, XTYPE_XBOXONE }, 218 - { 0x0e6f, 0x02ab, "PDP Controller for Xbox One", 0, XTYPE_XBOXONE }, 218 + { 0x0e6f, 0x02a0, "PDP Xbox One Controller", 0, XTYPE_XBOXONE }, 219 + { 0x0e6f, 0x02a1, "PDP Xbox One Controller", 0, XTYPE_XBOXONE }, 220 + { 0x0e6f, 0x02a2, "PDP Wired Controller for Xbox One - Crimson Red", 0, XTYPE_XBOXONE }, 219 221 { 0x0e6f, 0x02a4, "PDP Wired Controller for Xbox One - Stealth Series", 0, XTYPE_XBOXONE }, 220 222 { 0x0e6f, 0x02a6, "PDP Wired Controller for Xbox One - Camo Series", 0, XTYPE_XBOXONE }, 223 + { 0x0e6f, 0x02a7, "PDP Xbox One Controller", 0, XTYPE_XBOXONE }, 224 + { 0x0e6f, 0x02a8, "PDP Xbox One Controller", 0, XTYPE_XBOXONE }, 225 + { 0x0e6f, 0x02ab, "PDP Controller for Xbox One", 0, XTYPE_XBOXONE }, 226 + { 0x0e6f, 0x02ad, "PDP Wired Controller for Xbox One - Stealth Series", 0, XTYPE_XBOXONE }, 227 + { 0x0e6f, 0x02b3, "Afterglow Prismatic Wired Controller", 0, XTYPE_XBOXONE }, 228 + { 0x0e6f, 0x02b8, "Afterglow Prismatic Wired Controller", 0, XTYPE_XBOXONE }, 221 229 { 0x0e6f, 0x0301, "Logic3 Controller", 0, XTYPE_XBOX360 }, 222 230 { 0x0e6f, 0x0346, "Rock Candy Gamepad for Xbox One 2016", 0, XTYPE_XBOXONE }, 223 231 { 0x0e6f, 0x0401, "Logic3 Controller", 0, XTYPE_XBOX360 }, ··· 304 296 { 0x1bad, 0xfa01, "MadCatz GamePad", 0, XTYPE_XBOX360 }, 305 297 { 0x1bad, 0xfd00, "Razer Onza TE", 0, XTYPE_XBOX360 }, 306 298 { 0x1bad, 0xfd01, "Razer Onza", 0, XTYPE_XBOX360 }, 299 + { 0x20d6, 0x2001, "BDA Xbox Series X Wired Controller", 0, XTYPE_XBOXONE }, 300 + { 0x20d6, 0x281f, "PowerA Wired Controller For Xbox 360", 0, XTYPE_XBOX360 }, 301 + { 0x2e24, 0x0652, "Hyperkin Duke X-Box One pad", 0, XTYPE_XBOXONE }, 307 302 { 0x24c6, 0x5000, "Razer Atrox Arcade Stick", MAP_TRIGGERS_TO_BUTTONS, XTYPE_XBOX360 }, 308 303 { 0x24c6, 0x5300, "PowerA MINI PROEX Controller", 0, XTYPE_XBOX360 }, 309 304 { 0x24c6, 0x5303, "Xbox Airflo wired controller", 0, XTYPE_XBOX360 }, ··· 440 429 XPAD_XBOX360_VENDOR(0x162e), /* Joytech X-Box 360 controllers */ 441 430 XPAD_XBOX360_VENDOR(0x1689), /* Razer Onza */ 442 431 XPAD_XBOX360_VENDOR(0x1bad), /* Harminix Rock Band Guitar and Drums */ 432 + XPAD_XBOX360_VENDOR(0x20d6), /* PowerA Controllers */ 433 + XPAD_XBOXONE_VENDOR(0x20d6), /* PowerA Controllers */ 443 434 XPAD_XBOX360_VENDOR(0x24c6), /* PowerA Controllers */ 444 435 XPAD_XBOXONE_VENDOR(0x24c6), /* PowerA Controllers */ 436 + XPAD_XBOXONE_VENDOR(0x2e24), /* Hyperkin Duke X-Box One pad */ 437 + XPAD_XBOX360_VENDOR(0x2f24), /* GameSir Controllers */ 445 438 { } 446 439 }; 447 440
-6
drivers/input/misc/ariel-pwrbutton.c
··· 149 149 }; 150 150 MODULE_DEVICE_TABLE(of, ariel_pwrbutton_of_match); 151 151 152 - static const struct spi_device_id ariel_pwrbutton_id_table[] = { 153 - { "wyse-ariel-ec-input", 0 }, 154 - {} 155 - }; 156 - MODULE_DEVICE_TABLE(spi, ariel_pwrbutton_id_table); 157 - 158 152 static struct spi_driver ariel_pwrbutton_driver = { 159 153 .driver = { 160 154 .name = "dell-wyse-ariel-ec-input",
+2
drivers/input/serio/i8042-x86ia64io.h
··· 219 219 DMI_MATCH(DMI_SYS_VENDOR, "PEGATRON CORPORATION"), 220 220 DMI_MATCH(DMI_PRODUCT_NAME, "C15B"), 221 221 }, 222 + }, 223 + { 222 224 .matches = { 223 225 DMI_MATCH(DMI_SYS_VENDOR, "ByteSpeed LLC"), 224 226 DMI_MATCH(DMI_PRODUCT_NAME, "ByteSpeed Laptop C15B"),
+2
drivers/input/touchscreen/goodix.c
··· 157 157 { .id = "5663", .data = &gt1x_chip_data }, 158 158 { .id = "5688", .data = &gt1x_chip_data }, 159 159 { .id = "917S", .data = &gt1x_chip_data }, 160 + { .id = "9286", .data = &gt1x_chip_data }, 160 161 161 162 { .id = "911", .data = &gt911_chip_data }, 162 163 { .id = "9271", .data = &gt911_chip_data }, ··· 1449 1448 { .compatible = "goodix,gt927" }, 1450 1449 { .compatible = "goodix,gt9271" }, 1451 1450 { .compatible = "goodix,gt928" }, 1451 + { .compatible = "goodix,gt9286" }, 1452 1452 { .compatible = "goodix,gt967" }, 1453 1453 { } 1454 1454 };
+19 -7
drivers/input/touchscreen/ili210x.c
··· 29 29 void *buf, size_t len); 30 30 int (*get_touch_data)(struct i2c_client *client, u8 *data); 31 31 bool (*parse_touch_data)(const u8 *data, unsigned int finger, 32 - unsigned int *x, unsigned int *y); 32 + unsigned int *x, unsigned int *y, 33 + unsigned int *z); 33 34 bool (*continue_polling)(const u8 *data, bool touch); 34 35 unsigned int max_touches; 35 36 unsigned int resolution; 36 37 bool has_calibrate_reg; 38 + bool has_pressure_reg; 37 39 }; 38 40 39 41 struct ili210x { ··· 84 82 85 83 static bool ili210x_touchdata_to_coords(const u8 *touchdata, 86 84 unsigned int finger, 87 - unsigned int *x, unsigned int *y) 85 + unsigned int *x, unsigned int *y, 86 + unsigned int *z) 88 87 { 89 88 if (touchdata[0] & BIT(finger)) 90 89 return false; ··· 140 137 141 138 static bool ili211x_touchdata_to_coords(const u8 *touchdata, 142 139 unsigned int finger, 143 - unsigned int *x, unsigned int *y) 140 + unsigned int *x, unsigned int *y, 141 + unsigned int *z) 144 142 { 145 143 u32 data; 146 144 ··· 173 169 174 170 static bool ili212x_touchdata_to_coords(const u8 *touchdata, 175 171 unsigned int finger, 176 - unsigned int *x, unsigned int *y) 172 + unsigned int *x, unsigned int *y, 173 + unsigned int *z) 177 174 { 178 175 u16 val; 179 176 ··· 240 235 241 236 static bool ili251x_touchdata_to_coords(const u8 *touchdata, 242 237 unsigned int finger, 243 - unsigned int *x, unsigned int *y) 238 + unsigned int *x, unsigned int *y, 239 + unsigned int *z) 244 240 { 245 241 u16 val; 246 242 ··· 251 245 252 246 *x = val & 0x3fff; 253 247 *y = get_unaligned_be16(touchdata + 1 + (finger * 5) + 2); 248 + *z = touchdata[1 + (finger * 5) + 4]; 254 249 255 250 return true; 256 251 } ··· 268 261 .continue_polling = ili251x_check_continue_polling, 269 262 .max_touches = 10, 270 263 .has_calibrate_reg = true, 264 + .has_pressure_reg = true, 271 265 }; 272 266 273 267 static bool ili210x_report_events(struct ili210x *priv, u8 *touchdata) ··· 276 268 struct input_dev *input = priv->input; 277 269 int i; 278 270 bool contact = false, touch; 279 - unsigned int x = 0, y = 0; 271 + unsigned int x = 0, y = 0, z = 0; 280 272 281 273 for (i = 0; i < priv->chip->max_touches; i++) { 282 - touch = priv->chip->parse_touch_data(touchdata, i, &x, &y); 274 + touch = priv->chip->parse_touch_data(touchdata, i, &x, &y, &z); 283 275 284 276 input_mt_slot(input, i); 285 277 if (input_mt_report_slot_state(input, MT_TOOL_FINGER, touch)) { 286 278 touchscreen_report_pos(input, &priv->prop, x, y, true); 279 + if (priv->chip->has_pressure_reg) 280 + input_report_abs(input, ABS_MT_PRESSURE, z); 287 281 contact = true; 288 282 } 289 283 } ··· 447 437 max_xy = (chip->resolution ?: SZ_64K) - 1; 448 438 input_set_abs_params(input, ABS_MT_POSITION_X, 0, max_xy, 0, 0); 449 439 input_set_abs_params(input, ABS_MT_POSITION_Y, 0, max_xy, 0, 0); 440 + if (priv->chip->has_pressure_reg) 441 + input_set_abs_params(input, ABS_MT_PRESSURE, 0, 0xa, 0, 0); 450 442 touchscreen_parse_properties(input, true, &priv->prop); 451 443 452 444 error = input_mt_init_slots(input, priv->chip->max_touches,
+42 -6
drivers/input/touchscreen/st1232.c
··· 26 26 #define ST1232_TS_NAME "st1232-ts" 27 27 #define ST1633_TS_NAME "st1633-ts" 28 28 29 + #define REG_STATUS 0x01 /* Device Status | Error Code */ 30 + 31 + #define STATUS_NORMAL 0x00 32 + #define STATUS_INIT 0x01 33 + #define STATUS_ERROR 0x02 34 + #define STATUS_AUTO_TUNING 0x03 35 + #define STATUS_IDLE 0x04 36 + #define STATUS_POWER_DOWN 0x05 37 + 38 + #define ERROR_NONE 0x00 39 + #define ERROR_INVALID_ADDRESS 0x10 40 + #define ERROR_INVALID_VALUE 0x20 41 + #define ERROR_INVALID_PLATFORM 0x30 42 + 29 43 #define REG_XY_RESOLUTION 0x04 30 44 #define REG_XY_COORDINATES 0x12 31 45 #define ST_TS_MAX_FINGERS 10 ··· 61 47 u8 *read_buf; 62 48 }; 63 49 64 - static int st1232_ts_read_data(struct st1232_ts_data *ts, u8 reg) 50 + static int st1232_ts_read_data(struct st1232_ts_data *ts, u8 reg, 51 + unsigned int n) 65 52 { 66 53 struct i2c_client *client = ts->client; 67 54 struct i2c_msg msg[] = { ··· 74 59 { 75 60 .addr = client->addr, 76 61 .flags = I2C_M_RD | I2C_M_DMA_SAFE, 77 - .len = ts->read_buf_len, 62 + .len = n, 78 63 .buf = ts->read_buf, 79 64 } 80 65 }; ··· 87 72 return 0; 88 73 } 89 74 75 + static int st1232_ts_wait_ready(struct st1232_ts_data *ts) 76 + { 77 + unsigned int retries; 78 + int error; 79 + 80 + for (retries = 10; retries; retries--) { 81 + error = st1232_ts_read_data(ts, REG_STATUS, 1); 82 + if (!error && ts->read_buf[0] == (STATUS_NORMAL | ERROR_NONE)) 83 + return 0; 84 + 85 + usleep_range(1000, 2000); 86 + } 87 + 88 + return -ENXIO; 89 + } 90 + 90 91 static int st1232_ts_read_resolution(struct st1232_ts_data *ts, u16 *max_x, 91 92 u16 *max_y) 92 93 { ··· 110 79 int error; 111 80 112 81 /* select resolution register */ 113 - error = st1232_ts_read_data(ts, REG_XY_RESOLUTION); 82 + error = st1232_ts_read_data(ts, REG_XY_RESOLUTION, 3); 114 83 if (error) 115 84 return error; 116 85 117 86 buf = ts->read_buf; 118 87 119 - *max_x = ((buf[0] & 0x0070) << 4) | buf[1]; 120 - *max_y = ((buf[0] & 0x0007) << 8) | buf[2]; 88 + *max_x = (((buf[0] & 0x0070) << 4) | buf[1]) - 1; 89 + *max_y = (((buf[0] & 0x0007) << 8) | buf[2]) - 1; 121 90 122 91 return 0; 123 92 } ··· 171 140 int count; 172 141 int error; 173 142 174 - error = st1232_ts_read_data(ts, REG_XY_COORDINATES); 143 + error = st1232_ts_read_data(ts, REG_XY_COORDINATES, ts->read_buf_len); 175 144 if (error) 176 145 goto out; 177 146 ··· 281 250 282 251 input_dev->name = "st1232-touchscreen"; 283 252 input_dev->id.bustype = BUS_I2C; 253 + 254 + /* Wait until device is ready */ 255 + error = st1232_ts_wait_ready(ts); 256 + if (error) 257 + return error; 284 258 285 259 /* Read resolution from the chip */ 286 260 error = st1232_ts_read_resolution(ts, &max_x, &max_y);