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 updates from Dmitry Torokhov:
"Just random driver fixups, nothing exiting"

* 'for-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/dtor/input:
Input: synaptics - avoid using uninitialized variable when probing
Input: xen-kbdfront - mark expected switch fall-through
Input: atmel_mxt_ts - mark expected switch fall-through
Input: cyapa - mark expected switch fall-throughs
Input: wm97xx-ts - fix exit path
Input: of_touchscreen - add support for touchscreen-min-x|y
Input: Fix DIR-685 touchkeys MAINTAINERS entry
Input: elants_i2c - use DMA safe i2c when possible
Input: silead - try firmware reload after unsuccessful resume
Input: st1232 - set INPUT_PROP_DIRECT property
Input: xilinx_ps2 - convert to using %pOFn instead of device_node.name
Input: atmel_mxt_ts - fix multiple <linux/property.h> includes
Input: sun4i-lradc - convert to using %pOFn instead of device_node.name
Input: pwm-vibrator - correct pwms in DT binding example

+64 -29
+2 -2
Documentation/devicetree/bindings/input/pwm-vibrator.txt
··· 58 58 59 59 vibrator { 60 60 compatible = "pwm-vibrator"; 61 - pwms = <&pwm8 0 1000000000 0>, 62 - <&pwm9 0 1000000000 0>; 61 + pwms = <&pwm9 0 1000000000 0>, 62 + <&pwm8 0 1000000000 0>; 63 63 pwm-names = "enable", "direction"; 64 64 direction-duty-cycle-ns = <1000000000>; 65 65 };
+4 -2
Documentation/devicetree/bindings/input/touchscreen/touchscreen.txt
··· 1 1 General Touchscreen Properties: 2 2 3 3 Optional properties for Touchscreens: 4 + - touchscreen-min-x : minimum x coordinate reported (0 if not set) 5 + - touchscreen-min-y : minimum y coordinate reported (0 if not set) 4 6 - touchscreen-size-x : horizontal resolution of touchscreen 5 - (in pixels) 7 + (maximum x coordinate reported + 1) 6 8 - touchscreen-size-y : vertical resolution of touchscreen 7 - (in pixels) 9 + (maximum y coordinate reported + 1) 8 10 - touchscreen-max-pressure : maximum reported pressure (arbitrary range 9 11 dependent on the controller) 10 12 - touchscreen-min-pressure : minimum pressure on the touchscreen to be
+1 -1
MAINTAINERS
··· 4099 4099 M: Linus Walleij <linus.walleij@linaro.org> 4100 4100 L: linux-input@vger.kernel.org 4101 4101 S: Supported 4102 - F: drivers/input/dlink-dir685-touchkeys.c 4102 + F: drivers/input/keyboard/dlink-dir685-touchkeys.c 4103 4103 4104 4104 DALLAS/MAXIM DS1685-FAMILY REAL TIME CLOCK 4105 4105 M: Joshua Kinard <kumba@gentoo.org>
+3 -3
drivers/input/keyboard/sun4i-lradc-keys.c
··· 185 185 186 186 error = of_property_read_u32(pp, "channel", &channel); 187 187 if (error || channel != 0) { 188 - dev_err(dev, "%s: Inval channel prop\n", pp->name); 188 + dev_err(dev, "%pOFn: Inval channel prop\n", pp); 189 189 return -EINVAL; 190 190 } 191 191 192 192 error = of_property_read_u32(pp, "voltage", &map->voltage); 193 193 if (error) { 194 - dev_err(dev, "%s: Inval voltage prop\n", pp->name); 194 + dev_err(dev, "%pOFn: Inval voltage prop\n", pp); 195 195 return -EINVAL; 196 196 } 197 197 198 198 error = of_property_read_u32(pp, "linux,code", &map->keycode); 199 199 if (error) { 200 - dev_err(dev, "%s: Inval linux,code prop\n", pp->name); 200 + dev_err(dev, "%pOFn: Inval linux,code prop\n", pp); 201 201 return -EINVAL; 202 202 } 203 203
+1 -1
drivers/input/misc/xen-kbdfront.c
··· 524 524 case XenbusStateClosed: 525 525 if (dev->state == XenbusStateClosed) 526 526 break; 527 - /* Missed the backend's CLOSING state -- fallthrough */ 527 + /* fall through - Missed the backend's CLOSING state */ 528 528 case XenbusStateClosing: 529 529 xenbus_frontend_closed(dev); 530 530 break;
+2 -2
drivers/input/mouse/cyapa_gen3.c
··· 1067 1067 return error; 1068 1068 } 1069 1069 1070 - /* Fallthrough state */ 1070 + /* Fall through */ 1071 1071 case CYAPA_STATE_BL_IDLE: 1072 1072 /* Try to get firmware version in bootloader mode. */ 1073 1073 cyapa_gen3_bl_query_data(cyapa); ··· 1078 1078 return error; 1079 1079 } 1080 1080 1081 - /* Fallthrough state */ 1081 + /* Fall through */ 1082 1082 case CYAPA_STATE_OP: 1083 1083 /* 1084 1084 * Reading query data before going back to the full mode
+1 -3
drivers/input/mouse/synaptics.c
··· 99 99 int synaptics_detect(struct psmouse *psmouse, bool set_properties) 100 100 { 101 101 struct ps2dev *ps2dev = &psmouse->ps2dev; 102 - u8 param[4]; 103 - 104 - param[0] = 0; 102 + u8 param[4] = { 0 }; 105 103 106 104 ps2_command(ps2dev, param, PSMOUSE_CMD_SETRES); 107 105 ps2_command(ps2dev, param, PSMOUSE_CMD_SETRES);
+1 -1
drivers/input/serio/xilinx_ps2.c
··· 245 245 unsigned int irq; 246 246 int error; 247 247 248 - dev_info(dev, "Device Tree Probing \'%s\'\n", dev->of_node->name); 248 + dev_info(dev, "Device Tree Probing \'%pOFn\'\n", dev->of_node); 249 249 250 250 /* Get iospace for the device */ 251 251 error = of_address_to_resource(dev->of_node, 0, &r_mem);
+1 -2
drivers/input/touchscreen/atmel_mxt_ts.c
··· 29 29 #include <linux/property.h> 30 30 #include <linux/slab.h> 31 31 #include <linux/gpio/consumer.h> 32 - #include <linux/property.h> 33 32 #include <asm/unaligned.h> 34 33 #include <media/v4l2-device.h> 35 34 #include <media/v4l2-ioctl.h> ··· 488 489 bootloader = appmode - 0x24; 489 490 break; 490 491 } 491 - /* Fall through for normal case */ 492 + /* Fall through - for normal case */ 492 493 case 0x4c: 493 494 case 0x4d: 494 495 case 0x5a:
+4 -3
drivers/input/touchscreen/elants_i2c.c
··· 147 147 u8 cmd_resp[HEADER_SIZE]; 148 148 struct completion cmd_done; 149 149 150 - u8 buf[MAX_PACKET_SIZE]; 151 - 152 150 bool wake_irq_enabled; 153 151 bool keep_power_in_suspend; 152 + 153 + /* Must be last to be used for DMA operations */ 154 + u8 buf[MAX_PACKET_SIZE] ____cacheline_aligned; 154 155 }; 155 156 156 157 static int elants_i2c_send(struct i2c_client *client, ··· 864 863 int i; 865 864 int len; 866 865 867 - len = i2c_master_recv(client, ts->buf, sizeof(ts->buf)); 866 + len = i2c_master_recv_dmasafe(client, ts->buf, sizeof(ts->buf)); 868 867 if (len < 0) { 869 868 dev_err(&client->dev, "%s: failed to read data: %d\n", 870 869 __func__, len);
+28 -8
drivers/input/touchscreen/of_touchscreen.c
··· 35 35 36 36 static void touchscreen_set_params(struct input_dev *dev, 37 37 unsigned long axis, 38 - int max, int fuzz) 38 + int min, int max, int fuzz) 39 39 { 40 40 struct input_absinfo *absinfo; 41 41 ··· 47 47 } 48 48 49 49 absinfo = &dev->absinfo[axis]; 50 + absinfo->minimum = min; 50 51 absinfo->maximum = max; 51 52 absinfo->fuzz = fuzz; 52 53 } ··· 69 68 struct touchscreen_properties *prop) 70 69 { 71 70 struct device *dev = input->dev.parent; 71 + struct input_absinfo *absinfo; 72 72 unsigned int axis; 73 - unsigned int maximum, fuzz; 73 + unsigned int minimum, maximum, fuzz; 74 74 bool data_present; 75 75 76 76 input_alloc_absinfo(input); ··· 79 77 return; 80 78 81 79 axis = multitouch ? ABS_MT_POSITION_X : ABS_X; 82 - data_present = touchscreen_get_prop_u32(dev, "touchscreen-size-x", 80 + data_present = touchscreen_get_prop_u32(dev, "touchscreen-min-x", 81 + input_abs_get_min(input, axis), 82 + &minimum) | 83 + touchscreen_get_prop_u32(dev, "touchscreen-size-x", 83 84 input_abs_get_max(input, 84 85 axis) + 1, 85 86 &maximum) | ··· 90 85 input_abs_get_fuzz(input, axis), 91 86 &fuzz); 92 87 if (data_present) 93 - touchscreen_set_params(input, axis, maximum - 1, fuzz); 88 + touchscreen_set_params(input, axis, minimum, maximum - 1, fuzz); 94 89 95 90 axis = multitouch ? ABS_MT_POSITION_Y : ABS_Y; 96 - data_present = touchscreen_get_prop_u32(dev, "touchscreen-size-y", 91 + data_present = touchscreen_get_prop_u32(dev, "touchscreen-min-y", 92 + input_abs_get_min(input, axis), 93 + &minimum) | 94 + touchscreen_get_prop_u32(dev, "touchscreen-size-y", 97 95 input_abs_get_max(input, 98 96 axis) + 1, 99 97 &maximum) | ··· 104 96 input_abs_get_fuzz(input, axis), 105 97 &fuzz); 106 98 if (data_present) 107 - touchscreen_set_params(input, axis, maximum - 1, fuzz); 99 + touchscreen_set_params(input, axis, minimum, maximum - 1, fuzz); 108 100 109 101 axis = multitouch ? ABS_MT_PRESSURE : ABS_PRESSURE; 110 102 data_present = touchscreen_get_prop_u32(dev, ··· 116 108 input_abs_get_fuzz(input, axis), 117 109 &fuzz); 118 110 if (data_present) 119 - touchscreen_set_params(input, axis, maximum, fuzz); 111 + touchscreen_set_params(input, axis, 0, maximum, fuzz); 120 112 121 113 if (!prop) 122 114 return; ··· 125 117 126 118 prop->max_x = input_abs_get_max(input, axis); 127 119 prop->max_y = input_abs_get_max(input, axis + 1); 120 + 128 121 prop->invert_x = 129 122 device_property_read_bool(dev, "touchscreen-inverted-x"); 123 + if (prop->invert_x) { 124 + absinfo = &input->absinfo[axis]; 125 + absinfo->maximum -= absinfo->minimum; 126 + absinfo->minimum = 0; 127 + } 128 + 130 129 prop->invert_y = 131 130 device_property_read_bool(dev, "touchscreen-inverted-y"); 131 + if (prop->invert_y) { 132 + absinfo = &input->absinfo[axis + 1]; 133 + absinfo->maximum -= absinfo->minimum; 134 + absinfo->minimum = 0; 135 + } 136 + 132 137 prop->swap_x_y = 133 138 device_property_read_bool(dev, "touchscreen-swapped-x-y"); 134 - 135 139 if (prop->swap_x_y) 136 140 swap(input->absinfo[axis], input->absinfo[axis + 1]); 137 141 }
+13
drivers/input/touchscreen/silead.c
··· 558 558 static int __maybe_unused silead_ts_resume(struct device *dev) 559 559 { 560 560 struct i2c_client *client = to_i2c_client(dev); 561 + bool second_try = false; 561 562 int error, status; 562 563 563 564 silead_ts_set_power(client, SILEAD_POWER_ON); 564 565 566 + retry: 565 567 error = silead_ts_reset(client); 566 568 if (error) 567 569 return error; 570 + 571 + if (second_try) { 572 + error = silead_ts_load_fw(client); 573 + if (error) 574 + return error; 575 + } 568 576 569 577 error = silead_ts_startup(client); 570 578 if (error) ··· 580 572 581 573 status = silead_ts_get_status(client); 582 574 if (status != SILEAD_STATUS_OK) { 575 + if (!second_try) { 576 + second_try = true; 577 + dev_dbg(dev, "Reloading firmware after unsuccessful resume\n"); 578 + goto retry; 579 + } 583 580 dev_err(dev, "Resume error, status: 0x%02x\n", status); 584 581 return -ENODEV; 585 582 }
+1
drivers/input/touchscreen/st1232.c
··· 195 195 input_dev->id.bustype = BUS_I2C; 196 196 input_dev->dev.parent = &client->dev; 197 197 198 + __set_bit(INPUT_PROP_DIRECT, input_dev->propbit); 198 199 __set_bit(EV_SYN, input_dev->evbit); 199 200 __set_bit(EV_KEY, input_dev->evbit); 200 201 __set_bit(EV_ABS, input_dev->evbit);
+2 -1
drivers/input/touchscreen/wm97xx-core.c
··· 929 929 930 930 static void __exit wm97xx_exit(void) 931 931 { 932 - driver_unregister(&wm97xx_driver); 932 + if (IS_BUILTIN(CONFIG_AC97_BUS)) 933 + driver_unregister(&wm97xx_driver); 933 934 platform_driver_unregister(&wm97xx_mfd_driver); 934 935 } 935 936