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:

- a new driver for STM FingerTip touchscreen

- a new driver for D-Link DIR-685 touch keys

- updated list of supported devices in xpad driver

- other assorted updates and fixes

* 'for-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/dtor/input: (23 commits)
MAINTAINERS: update input subsystem patterns
Input: introduce KEY_ASSISTANT
Input: xpad - sync supported devices with XBCD
Input: xpad - sync supported devices with 360Controller
Input: xen-kbdfront - use string constants from PV protocol
Input: stmfts - mark all PM functions as __maybe_unused
Input: add support for the STMicroelectronics FingerTip touchscreen
Input: add D-Link DIR-685 touchkeys driver
Input: s3c2410_ts - handle return value of clk_prepare_enable
Input: axp20x-pek - add wakeup support
Input: synaptics-rmi4 - use %phN to form F34 configuration ID
Input: synaptics-rmi4 - change a char type to u8
Input: sparse-keymap - remove sparse_keymap_free()
Input: tsc2007 - move header file out of I2C realm
Input: mms114 - move header file out of I2C realm
Input: mcs - move header file out of I2C realm
Input: lm8323 - move header file out of I2C realm
Input: elantech - force relative mode on a certain module
Input: elan_i2c - add support for fetching chip type on newer hardware
Input: elan_i2c - check if device is there before really probing
...

+1349 -71
+21
Documentation/devicetree/bindings/input/dlink,dir685-touchkeys.txt
··· 1 + * D-Link DIR-685 Touchkeys 2 + 3 + This is a I2C one-off touchkey controller based on the Cypress Semiconductor 4 + CY8C214 MCU with some firmware in its internal 8KB flash. The circuit 5 + board inside the router is named E119921. 6 + 7 + The touchkey device node should be placed inside an I2C bus node. 8 + 9 + Required properties: 10 + - compatible: must be "dlink,dir685-touchkeys" 11 + - reg: the I2C address of the touchkeys 12 + - interrupts: reference to the interrupt number 13 + 14 + Example: 15 + 16 + touchkeys@26 { 17 + compatible = "dlink,dir685-touchkeys"; 18 + reg = <0x26>; 19 + interrupt-parent = <&gpio0>; 20 + interrupts = <17 IRQ_TYPE_EDGE_FALLING>; 21 + };
+43
Documentation/devicetree/bindings/input/touchscreen/st,stmfts.txt
··· 1 + * ST-Microelectronics FingerTip touchscreen controller 2 + 3 + The ST-Microelectronics FingerTip device provides a basic touchscreen 4 + functionality. Along with it the user can enable the touchkey which can work as 5 + a basic HOME and BACK key for phones. 6 + 7 + The driver supports also hovering as an absolute single touch event with x, y, z 8 + coordinates. 9 + 10 + Required properties: 11 + - compatible : must be "st,stmfts" 12 + - reg : I2C slave address, (e.g. 0x49) 13 + - interrupt-parent : the phandle to the interrupt controller which provides 14 + the interrupt 15 + - interrupts : interrupt specification 16 + - avdd-supply : analogic power supply 17 + - vdd-supply : power supply 18 + - touchscreen-size-x : see touchscreen.txt 19 + - touchscreen-size-y : see touchscreen.txt 20 + 21 + Optional properties: 22 + - touch-key-connected : specifies whether the touchkey feature is connected 23 + - ledvdd-supply : power supply to the touch key leds 24 + 25 + Example: 26 + 27 + i2c@00000000 { 28 + 29 + /* ... */ 30 + 31 + touchscreen@49 { 32 + compatible = "st,stmfts"; 33 + reg = <0x49>; 34 + interrupt-parent = <&gpa1>; 35 + interrupts = <1 IRQ_TYPE_NONE>; 36 + touchscreen-size-x = <1599>; 37 + touchscreen-size-y = <2559>; 38 + touch-key-connected; 39 + avdd-supply = <&ldo30_reg>; 40 + vdd-supply = <&ldo31_reg>; 41 + ledvdd-supply = <&ldo33_reg>; 42 + }; 43 + };
+8
MAINTAINERS
··· 3846 3846 F: drivers/input/touchscreen/cyttsp* 3847 3847 F: include/linux/input/cyttsp.h 3848 3848 3849 + D-LINK DIR-685 TOUCHKEYS DRIVER 3850 + M: Linus Walleij <linus.walleij@linaro.org> 3851 + L: linux-input@vger.kernel.org 3852 + S: Supported 3853 + F: drivers/input/dlink-dir685-touchkeys.c 3854 + 3849 3855 DALLAS/MAXIM DS1685-FAMILY REAL TIME CLOCK 3850 3856 M: Joshua Kinard <kumba@gentoo.org> 3851 3857 S: Maintained ··· 6695 6689 F: drivers/input/ 6696 6690 F: include/linux/input.h 6697 6691 F: include/uapi/linux/input.h 6692 + F: include/uapi/linux/input-event-codes.h 6698 6693 F: include/linux/input/ 6699 6694 F: Documentation/devicetree/bindings/input/ 6695 + F: Documentation/input/ 6700 6696 6701 6697 INPUT MULTITOUCH (MT) PROTOCOL 6702 6698 M: Henrik Rydberg <rydberg@bitmath.org>
+1 -1
arch/sh/boards/mach-ecovec24/setup.c
··· 24 24 #include <linux/usb/r8a66597.h> 25 25 #include <linux/usb/renesas_usbhs.h> 26 26 #include <linux/i2c.h> 27 - #include <linux/i2c/tsc2007.h> 27 + #include <linux/platform_data/tsc2007.h> 28 28 #include <linux/spi/spi.h> 29 29 #include <linux/spi/sh_msiof.h> 30 30 #include <linux/spi/mmc_spi.h>
+6 -6
drivers/input/input.c
··· 481 481 void input_alloc_absinfo(struct input_dev *dev) 482 482 { 483 483 if (!dev->absinfo) 484 - dev->absinfo = kcalloc(ABS_CNT, sizeof(struct input_absinfo), 484 + dev->absinfo = kcalloc(ABS_CNT, sizeof(*dev->absinfo), 485 485 GFP_KERNEL); 486 486 487 487 WARN(!dev->absinfo, "%s(): kcalloc() failed?\n", __func__); ··· 1126 1126 * If no output was produced print a single 0. 1127 1127 */ 1128 1128 if (skip_empty) 1129 - seq_puts(seq, "0"); 1129 + seq_putc(seq, '0'); 1130 1130 1131 1131 seq_putc(seq, '\n'); 1132 1132 } ··· 1144 1144 seq_printf(seq, "P: Phys=%s\n", dev->phys ? dev->phys : ""); 1145 1145 seq_printf(seq, "S: Sysfs=%s\n", path ? path : ""); 1146 1146 seq_printf(seq, "U: Uniq=%s\n", dev->uniq ? dev->uniq : ""); 1147 - seq_printf(seq, "H: Handlers="); 1147 + seq_puts(seq, "H: Handlers="); 1148 1148 1149 1149 list_for_each_entry(handle, &dev->h_list, d_node) 1150 1150 seq_printf(seq, "%s ", handle->name); ··· 1783 1783 static atomic_t input_no = ATOMIC_INIT(-1); 1784 1784 struct input_dev *dev; 1785 1785 1786 - dev = kzalloc(sizeof(struct input_dev), GFP_KERNEL); 1786 + dev = kzalloc(sizeof(*dev), GFP_KERNEL); 1787 1787 if (dev) { 1788 1788 dev->dev.type = &input_dev_type; 1789 1789 dev->dev.class = &input_class; ··· 1849 1849 struct input_devres *devres; 1850 1850 1851 1851 devres = devres_alloc(devm_input_device_release, 1852 - sizeof(struct input_devres), GFP_KERNEL); 1852 + sizeof(*devres), GFP_KERNEL); 1853 1853 if (!devres) 1854 1854 return NULL; 1855 1855 ··· 2099 2099 2100 2100 if (dev->devres_managed) { 2101 2101 devres = devres_alloc(devm_input_device_unregister, 2102 - sizeof(struct input_devres), GFP_KERNEL); 2102 + sizeof(*devres), GFP_KERNEL); 2103 2103 if (!devres) 2104 2104 return -ENOMEM; 2105 2105
+87
drivers/input/joystick/xpad.c
··· 126 126 u8 mapping; 127 127 u8 xtype; 128 128 } xpad_device[] = { 129 + { 0x044f, 0x0f00, "Thrustmaster Wheel", 0, XTYPE_XBOX }, 130 + { 0x044f, 0x0f03, "Thrustmaster Wheel", 0, XTYPE_XBOX }, 129 131 { 0x044f, 0x0f07, "Thrustmaster, Inc. Controller", 0, XTYPE_XBOX }, 132 + { 0x044f, 0x0f10, "Thrustmaster Modena GT Wheel", 0, XTYPE_XBOX }, 130 133 { 0x044f, 0xb326, "Thrustmaster Gamepad GP XID", 0, XTYPE_XBOX360 }, 131 134 { 0x045e, 0x0202, "Microsoft X-Box pad v1 (US)", 0, XTYPE_XBOX }, 132 135 { 0x045e, 0x0285, "Microsoft X-Box pad (Japan)", 0, XTYPE_XBOX }, 133 136 { 0x045e, 0x0287, "Microsoft Xbox Controller S", 0, XTYPE_XBOX }, 137 + { 0x045e, 0x0288, "Microsoft Xbox Controller S v2", 0, XTYPE_XBOX }, 134 138 { 0x045e, 0x0289, "Microsoft X-Box pad v2 (US)", 0, XTYPE_XBOX }, 135 139 { 0x045e, 0x028e, "Microsoft X-Box 360 pad", 0, XTYPE_XBOX360 }, 140 + { 0x045e, 0x028f, "Microsoft X-Box 360 pad v2", 0, XTYPE_XBOX360 }, 136 141 { 0x045e, 0x0291, "Xbox 360 Wireless Receiver (XBOX)", MAP_DPAD_TO_BUTTONS, XTYPE_XBOX360W }, 137 142 { 0x045e, 0x02d1, "Microsoft X-Box One pad", 0, XTYPE_XBOXONE }, 138 143 { 0x045e, 0x02dd, "Microsoft X-Box One pad (Firmware 2015)", 0, XTYPE_XBOXONE }, ··· 150 145 { 0x046d, 0xc242, "Logitech Chillstream Controller", 0, XTYPE_XBOX360 }, 151 146 { 0x046d, 0xca84, "Logitech Xbox Cordless Controller", 0, XTYPE_XBOX }, 152 147 { 0x046d, 0xca88, "Logitech Compact Controller for Xbox", 0, XTYPE_XBOX }, 148 + { 0x046d, 0xca8a, "Logitech Precision Vibration Feedback Wheel", 0, XTYPE_XBOX }, 149 + { 0x046d, 0xcaa3, "Logitech DriveFx Racing Wheel", 0, XTYPE_XBOX360 }, 153 150 { 0x056e, 0x2004, "Elecom JC-U3613M", 0, XTYPE_XBOX360 }, 154 151 { 0x05fd, 0x1007, "Mad Catz Controller (unverified)", 0, XTYPE_XBOX }, 155 152 { 0x05fd, 0x107a, "InterAct 'PowerPad Pro' X-Box pad (Germany)", 0, XTYPE_XBOX }, 153 + { 0x05fe, 0x3030, "Chic Controller", 0, XTYPE_XBOX }, 154 + { 0x05fe, 0x3031, "Chic Controller", 0, XTYPE_XBOX }, 155 + { 0x062a, 0x0020, "Logic3 Xbox GamePad", 0, XTYPE_XBOX }, 156 + { 0x062a, 0x0033, "Competition Pro Steering Wheel", 0, XTYPE_XBOX }, 157 + { 0x06a3, 0x0200, "Saitek Racing Wheel", 0, XTYPE_XBOX }, 158 + { 0x06a3, 0x0201, "Saitek Adrenalin", 0, XTYPE_XBOX }, 159 + { 0x06a3, 0xf51a, "Saitek P3600", 0, XTYPE_XBOX360 }, 160 + { 0x0738, 0x4506, "Mad Catz 4506 Wireless Controller", 0, XTYPE_XBOX }, 156 161 { 0x0738, 0x4516, "Mad Catz Control Pad", 0, XTYPE_XBOX }, 162 + { 0x0738, 0x4520, "Mad Catz Control Pad Pro", 0, XTYPE_XBOX }, 157 163 { 0x0738, 0x4522, "Mad Catz LumiCON", 0, XTYPE_XBOX }, 158 164 { 0x0738, 0x4526, "Mad Catz Control Pad Pro", 0, XTYPE_XBOX }, 165 + { 0x0738, 0x4530, "Mad Catz Universal MC2 Racing Wheel and Pedals", 0, XTYPE_XBOX }, 159 166 { 0x0738, 0x4536, "Mad Catz MicroCON", 0, XTYPE_XBOX }, 160 167 { 0x0738, 0x4540, "Mad Catz Beat Pad", MAP_DPAD_TO_BUTTONS, XTYPE_XBOX }, 161 168 { 0x0738, 0x4556, "Mad Catz Lynx Wireless Controller", 0, XTYPE_XBOX }, 169 + { 0x0738, 0x4586, "Mad Catz MicroCon Wireless Controller", 0, XTYPE_XBOX }, 170 + { 0x0738, 0x4588, "Mad Catz Blaster", 0, XTYPE_XBOX }, 171 + { 0x0738, 0x45ff, "Mad Catz Beat Pad (w/ Handle)", MAP_DPAD_TO_BUTTONS, XTYPE_XBOX }, 162 172 { 0x0738, 0x4716, "Mad Catz Wired Xbox 360 Controller", 0, XTYPE_XBOX360 }, 163 173 { 0x0738, 0x4718, "Mad Catz Street Fighter IV FightStick SE", 0, XTYPE_XBOX360 }, 164 174 { 0x0738, 0x4726, "Mad Catz Xbox 360 Controller", 0, XTYPE_XBOX360 }, 165 175 { 0x0738, 0x4728, "Mad Catz Street Fighter IV FightPad", MAP_TRIGGERS_TO_BUTTONS, XTYPE_XBOX360 }, 176 + { 0x0738, 0x4736, "Mad Catz MicroCon Gamepad", 0, XTYPE_XBOX360 }, 166 177 { 0x0738, 0x4738, "Mad Catz Wired Xbox 360 Controller (SFIV)", MAP_TRIGGERS_TO_BUTTONS, XTYPE_XBOX360 }, 167 178 { 0x0738, 0x4740, "Mad Catz Beat Pad", 0, XTYPE_XBOX360 }, 179 + { 0x0738, 0x4743, "Mad Catz Beat Pad Pro", MAP_DPAD_TO_BUTTONS, XTYPE_XBOX }, 180 + { 0x0738, 0x4758, "Mad Catz Arcade Game Stick", MAP_TRIGGERS_TO_BUTTONS, XTYPE_XBOX360 }, 168 181 { 0x0738, 0x4a01, "Mad Catz FightStick TE 2", MAP_TRIGGERS_TO_BUTTONS, XTYPE_XBOXONE }, 169 182 { 0x0738, 0x6040, "Mad Catz Beat Pad Pro", MAP_DPAD_TO_BUTTONS, XTYPE_XBOX }, 183 + { 0x0738, 0x9871, "Mad Catz Portable Drum", 0, XTYPE_XBOX360 }, 170 184 { 0x0738, 0xb726, "Mad Catz Xbox controller - MW2", 0, XTYPE_XBOX360 }, 185 + { 0x0738, 0xb738, "Mad Catz MVC2TE Stick 2", MAP_TRIGGERS_TO_BUTTONS, XTYPE_XBOX360 }, 171 186 { 0x0738, 0xbeef, "Mad Catz JOYTECH NEO SE Advanced GamePad", XTYPE_XBOX360 }, 172 187 { 0x0738, 0xcb02, "Saitek Cyborg Rumble Pad - PC/Xbox 360", 0, XTYPE_XBOX360 }, 173 188 { 0x0738, 0xcb03, "Saitek P3200 Rumble Pad - PC/Xbox 360", 0, XTYPE_XBOX360 }, 189 + { 0x0738, 0xcb29, "Saitek Aviator Stick AV8R02", 0, XTYPE_XBOX360 }, 174 190 { 0x0738, 0xf738, "Super SFIV FightStick TE S", 0, XTYPE_XBOX360 }, 191 + { 0x07ff, 0xffff, "Mad Catz GamePad", 0, XTYPE_XBOX360 }, 192 + { 0x0c12, 0x0005, "Intec wireless", 0, XTYPE_XBOX }, 193 + { 0x0c12, 0x8801, "Nyko Xbox Controller", 0, XTYPE_XBOX }, 175 194 { 0x0c12, 0x8802, "Zeroplus Xbox Controller", 0, XTYPE_XBOX }, 176 195 { 0x0c12, 0x8809, "RedOctane Xbox Dance Pad", DANCEPAD_MAP_CONFIG, XTYPE_XBOX }, 177 196 { 0x0c12, 0x880a, "Pelican Eclipse PL-2023", 0, XTYPE_XBOX }, ··· 203 174 { 0x0c12, 0x9902, "HAMA VibraX - *FAULTY HARDWARE*", 0, XTYPE_XBOX }, 204 175 { 0x0d2f, 0x0002, "Andamiro Pump It Up pad", MAP_DPAD_TO_BUTTONS, XTYPE_XBOX }, 205 176 { 0x0e4c, 0x1097, "Radica Gamester Controller", 0, XTYPE_XBOX }, 177 + { 0x0e4c, 0x1103, "Radica Gamester Reflex", MAP_TRIGGERS_TO_BUTTONS, XTYPE_XBOX }, 206 178 { 0x0e4c, 0x2390, "Radica Games Jtech Controller", 0, XTYPE_XBOX }, 179 + { 0x0e4c, 0x3510, "Radica Gamester", 0, XTYPE_XBOX }, 207 180 { 0x0e6f, 0x0003, "Logic3 Freebird wireless Controller", 0, XTYPE_XBOX }, 208 181 { 0x0e6f, 0x0005, "Eclipse wireless Controller", 0, XTYPE_XBOX }, 209 182 { 0x0e6f, 0x0006, "Edge wireless Controller", 0, XTYPE_XBOX }, 183 + { 0x0e6f, 0x0008, "After Glow Pro Controller", 0, XTYPE_XBOX }, 210 184 { 0x0e6f, 0x0105, "HSM3 Xbox360 dancepad", MAP_DPAD_TO_BUTTONS, XTYPE_XBOX360 }, 211 185 { 0x0e6f, 0x0113, "Afterglow AX.1 Gamepad for Xbox 360", 0, XTYPE_XBOX360 }, 212 186 { 0x0e6f, 0x011f, "Rock Candy Gamepad Wired Controller", 0, XTYPE_XBOX360 }, 187 + { 0x0e6f, 0x0131, "PDP EA Sports Controller", 0, XTYPE_XBOX360 }, 188 + { 0x0e6f, 0x0133, "Xbox 360 Wired Controller", 0, XTYPE_XBOX360 }, 213 189 { 0x0e6f, 0x0139, "Afterglow Prismatic Wired Controller", 0, XTYPE_XBOXONE }, 190 + { 0x0e6f, 0x013a, "PDP Xbox One Controller", 0, XTYPE_XBOXONE }, 214 191 { 0x0e6f, 0x0146, "Rock Candy Wired Controller for Xbox One", 0, XTYPE_XBOXONE }, 192 + { 0x0e6f, 0x0147, "PDP Marvel Xbox One Controller", 0, XTYPE_XBOXONE }, 193 + { 0x0e6f, 0x015c, "PDP Xbox One Arcade Stick", MAP_TRIGGERS_TO_BUTTONS, XTYPE_XBOXONE }, 194 + { 0x0e6f, 0x0161, "PDP Xbox One Controller", 0, XTYPE_XBOXONE }, 195 + { 0x0e6f, 0x0162, "PDP Xbox One Controller", 0, XTYPE_XBOXONE }, 196 + { 0x0e6f, 0x0163, "PDP Xbox One Controller", 0, XTYPE_XBOXONE }, 197 + { 0x0e6f, 0x0164, "PDP Battlefield One", 0, XTYPE_XBOXONE }, 198 + { 0x0e6f, 0x0165, "PDP Titanfall 2", 0, XTYPE_XBOXONE }, 215 199 { 0x0e6f, 0x0201, "Pelican PL-3601 'TSZ' Wired Xbox 360 Controller", 0, XTYPE_XBOX360 }, 216 200 { 0x0e6f, 0x0213, "Afterglow Gamepad for Xbox 360", 0, XTYPE_XBOX360 }, 217 201 { 0x0e6f, 0x021f, "Rock Candy Gamepad for Xbox 360", 0, XTYPE_XBOX360 }, 202 + { 0x0e6f, 0x0246, "Rock Candy Gamepad for Xbox One 2015", 0, XTYPE_XBOXONE }, 218 203 { 0x0e6f, 0x0301, "Logic3 Controller", 0, XTYPE_XBOX360 }, 204 + { 0x0e6f, 0x0346, "Rock Candy Gamepad for Xbox One 2016", 0, XTYPE_XBOXONE }, 219 205 { 0x0e6f, 0x0401, "Logic3 Controller", 0, XTYPE_XBOX360 }, 220 206 { 0x0e6f, 0x0413, "Afterglow AX.1 Gamepad for Xbox 360", 0, XTYPE_XBOX360 }, 207 + { 0x0e6f, 0x0501, "PDP Xbox 360 Controller", 0, XTYPE_XBOX360 }, 208 + { 0x0e6f, 0xf900, "PDP Afterglow AX.1", 0, XTYPE_XBOX360 }, 221 209 { 0x0e8f, 0x0201, "SmartJoy Frag Xpad/PS2 adaptor", 0, XTYPE_XBOX }, 222 210 { 0x0e8f, 0x3008, "Generic xbox control (dealextreme)", 0, XTYPE_XBOX }, 223 211 { 0x0f0d, 0x000a, "Hori Co. DOA4 FightStick", 0, XTYPE_XBOX360 }, 212 + { 0x0f0d, 0x000c, "Hori PadEX Turbo", 0, XTYPE_XBOX360 }, 224 213 { 0x0f0d, 0x000d, "Hori Fighting Stick EX2", MAP_TRIGGERS_TO_BUTTONS, XTYPE_XBOX360 }, 225 214 { 0x0f0d, 0x0016, "Hori Real Arcade Pro.EX", MAP_TRIGGERS_TO_BUTTONS, XTYPE_XBOX360 }, 215 + { 0x0f0d, 0x001b, "Hori Real Arcade Pro VX", MAP_TRIGGERS_TO_BUTTONS, XTYPE_XBOX360 }, 216 + { 0x0f0d, 0x0063, "Hori Real Arcade Pro Hayabusa (USA) Xbox One", MAP_TRIGGERS_TO_BUTTONS, XTYPE_XBOXONE }, 226 217 { 0x0f0d, 0x0067, "HORIPAD ONE", 0, XTYPE_XBOXONE }, 218 + { 0x0f0d, 0x0078, "Hori Real Arcade Pro V Kai Xbox One", MAP_TRIGGERS_TO_BUTTONS, XTYPE_XBOXONE }, 219 + { 0x0f30, 0x010b, "Philips Recoil", 0, XTYPE_XBOX }, 227 220 { 0x0f30, 0x0202, "Joytech Advanced Controller", 0, XTYPE_XBOX }, 228 221 { 0x0f30, 0x8888, "BigBen XBMiniPad Controller", 0, XTYPE_XBOX }, 229 222 { 0x102c, 0xff0c, "Joytech Wireless Advanced Controller", 0, XTYPE_XBOX }, 223 + { 0x11c9, 0x55f0, "Nacon GC-100XF", 0, XTYPE_XBOX360 }, 230 224 { 0x12ab, 0x0004, "Honey Bee Xbox360 dancepad", MAP_DPAD_TO_BUTTONS, XTYPE_XBOX360 }, 231 225 { 0x12ab, 0x0301, "PDP AFTERGLOW AX.1", 0, XTYPE_XBOX360 }, 226 + { 0x12ab, 0x0303, "Mortal Kombat Klassic FightStick", MAP_TRIGGERS_TO_BUTTONS, XTYPE_XBOX360 }, 232 227 { 0x12ab, 0x8809, "Xbox DDR dancepad", MAP_DPAD_TO_BUTTONS, XTYPE_XBOX }, 233 228 { 0x1430, 0x4748, "RedOctane Guitar Hero X-plorer", 0, XTYPE_XBOX360 }, 234 229 { 0x1430, 0x8888, "TX6500+ Dance Pad (first generation)", MAP_DPAD_TO_BUTTONS, XTYPE_XBOX }, 230 + { 0x1430, 0xf801, "RedOctane Controller", 0, XTYPE_XBOX360 }, 235 231 { 0x146b, 0x0601, "BigBen Interactive XBOX 360 Controller", 0, XTYPE_XBOX360 }, 236 232 { 0x1532, 0x0037, "Razer Sabertooth", 0, XTYPE_XBOX360 }, 233 + { 0x1532, 0x0a00, "Razer Atrox Arcade Stick", MAP_TRIGGERS_TO_BUTTONS, XTYPE_XBOXONE }, 237 234 { 0x1532, 0x0a03, "Razer Wildcat", 0, XTYPE_XBOXONE }, 238 235 { 0x15e4, 0x3f00, "Power A Mini Pro Elite", 0, XTYPE_XBOX360 }, 239 236 { 0x15e4, 0x3f0a, "Xbox Airflo wired controller", 0, XTYPE_XBOX360 }, ··· 270 215 { 0x1689, 0xfe00, "Razer Sabertooth", 0, XTYPE_XBOX360 }, 271 216 { 0x1bad, 0x0002, "Harmonix Rock Band Guitar", 0, XTYPE_XBOX360 }, 272 217 { 0x1bad, 0x0003, "Harmonix Rock Band Drumkit", MAP_DPAD_TO_BUTTONS, XTYPE_XBOX360 }, 218 + { 0x1bad, 0x0130, "Ion Drum Rocker", MAP_DPAD_TO_BUTTONS, XTYPE_XBOX360 }, 273 219 { 0x1bad, 0xf016, "Mad Catz Xbox 360 Controller", 0, XTYPE_XBOX360 }, 274 220 { 0x1bad, 0xf018, "Mad Catz Street Fighter IV SE Fighting Stick", MAP_TRIGGERS_TO_BUTTONS, XTYPE_XBOX360 }, 275 221 { 0x1bad, 0xf019, "Mad Catz Brawlstick for Xbox 360", MAP_TRIGGERS_TO_BUTTONS, XTYPE_XBOX360 }, 276 222 { 0x1bad, 0xf021, "Mad Cats Ghost Recon FS GamePad", 0, XTYPE_XBOX360 }, 277 223 { 0x1bad, 0xf023, "MLG Pro Circuit Controller (Xbox)", 0, XTYPE_XBOX360 }, 224 + { 0x1bad, 0xf025, "Mad Catz Call Of Duty", 0, XTYPE_XBOX360 }, 225 + { 0x1bad, 0xf027, "Mad Catz FPS Pro", 0, XTYPE_XBOX360 }, 278 226 { 0x1bad, 0xf028, "Street Fighter IV FightPad", 0, XTYPE_XBOX360 }, 279 227 { 0x1bad, 0xf02e, "Mad Catz Fightpad", MAP_TRIGGERS_TO_BUTTONS, XTYPE_XBOX360 }, 228 + { 0x1bad, 0xf030, "Mad Catz Xbox 360 MC2 MicroCon Racing Wheel", 0, XTYPE_XBOX360 }, 229 + { 0x1bad, 0xf036, "Mad Catz MicroCon GamePad Pro", 0, XTYPE_XBOX360 }, 280 230 { 0x1bad, 0xf038, "Street Fighter IV FightStick TE", 0, XTYPE_XBOX360 }, 231 + { 0x1bad, 0xf039, "Mad Catz MvC2 TE", MAP_TRIGGERS_TO_BUTTONS, XTYPE_XBOX360 }, 281 232 { 0x1bad, 0xf03a, "Mad Catz SFxT Fightstick Pro", MAP_TRIGGERS_TO_BUTTONS, XTYPE_XBOX360 }, 233 + { 0x1bad, 0xf03d, "Street Fighter IV Arcade Stick TE - Chun Li", MAP_TRIGGERS_TO_BUTTONS, XTYPE_XBOX360 }, 234 + { 0x1bad, 0xf03e, "Mad Catz MLG FightStick TE", MAP_TRIGGERS_TO_BUTTONS, XTYPE_XBOX360 }, 235 + { 0x1bad, 0xf03f, "Mad Catz FightStick SoulCaliber", MAP_TRIGGERS_TO_BUTTONS, XTYPE_XBOX360 }, 236 + { 0x1bad, 0xf042, "Mad Catz FightStick TES+", MAP_TRIGGERS_TO_BUTTONS, XTYPE_XBOX360 }, 237 + { 0x1bad, 0xf080, "Mad Catz FightStick TE2", MAP_TRIGGERS_TO_BUTTONS, XTYPE_XBOX360 }, 238 + { 0x1bad, 0xf501, "HoriPad EX2 Turbo", 0, XTYPE_XBOX360 }, 239 + { 0x1bad, 0xf502, "Hori Real Arcade Pro.VX SA", MAP_TRIGGERS_TO_BUTTONS, XTYPE_XBOX360 }, 240 + { 0x1bad, 0xf503, "Hori Fighting Stick VX", MAP_TRIGGERS_TO_BUTTONS, XTYPE_XBOX360 }, 241 + { 0x1bad, 0xf504, "Hori Real Arcade Pro. EX", MAP_TRIGGERS_TO_BUTTONS, XTYPE_XBOX360 }, 242 + { 0x1bad, 0xf505, "Hori Fighting Stick EX2B", MAP_TRIGGERS_TO_BUTTONS, XTYPE_XBOX360 }, 243 + { 0x1bad, 0xf506, "Hori Real Arcade Pro.EX Premium VLX", 0, XTYPE_XBOX360 }, 282 244 { 0x1bad, 0xf900, "Harmonix Xbox 360 Controller", 0, XTYPE_XBOX360 }, 283 245 { 0x1bad, 0xf901, "Gamestop Xbox 360 Controller", 0, XTYPE_XBOX360 }, 284 246 { 0x1bad, 0xf903, "Tron Xbox 360 controller", 0, XTYPE_XBOX360 }, 247 + { 0x1bad, 0xf904, "PDP Versus Fighting Pad", 0, XTYPE_XBOX360 }, 248 + { 0x1bad, 0xf906, "MortalKombat FightStick", MAP_TRIGGERS_TO_BUTTONS, XTYPE_XBOX360 }, 285 249 { 0x1bad, 0xfa01, "MadCatz GamePad", 0, XTYPE_XBOX360 }, 250 + { 0x1bad, 0xfd00, "Razer Onza TE", 0, XTYPE_XBOX360 }, 251 + { 0x1bad, 0xfd01, "Razer Onza", 0, XTYPE_XBOX360 }, 286 252 { 0x24c6, 0x5000, "Razer Atrox Arcade Stick", MAP_TRIGGERS_TO_BUTTONS, XTYPE_XBOX360 }, 287 253 { 0x24c6, 0x5300, "PowerA MINI PROEX Controller", 0, XTYPE_XBOX360 }, 288 254 { 0x24c6, 0x5303, "Xbox Airflo wired controller", 0, XTYPE_XBOX360 }, 255 + { 0x24c6, 0x530a, "Xbox 360 Pro EX Controller", 0, XTYPE_XBOX360 }, 289 256 { 0x24c6, 0x531a, "PowerA Pro Ex", 0, XTYPE_XBOX360 }, 290 257 { 0x24c6, 0x5397, "FUS1ON Tournament Controller", 0, XTYPE_XBOX360 }, 291 258 { 0x24c6, 0x541a, "PowerA Xbox One Mini Wired Controller", 0, XTYPE_XBOXONE }, ··· 315 238 { 0x24c6, 0x543a, "PowerA Xbox One wired controller", 0, XTYPE_XBOXONE }, 316 239 { 0x24c6, 0x5500, "Hori XBOX 360 EX 2 with Turbo", 0, XTYPE_XBOX360 }, 317 240 { 0x24c6, 0x5501, "Hori Real Arcade Pro VX-SA", 0, XTYPE_XBOX360 }, 241 + { 0x24c6, 0x5502, "Hori Fighting Stick VX Alt", MAP_TRIGGERS_TO_BUTTONS, XTYPE_XBOX360 }, 318 242 { 0x24c6, 0x5503, "Hori Fighting Edge", MAP_TRIGGERS_TO_BUTTONS, XTYPE_XBOX360 }, 319 243 { 0x24c6, 0x5506, "Hori SOULCALIBUR V Stick", 0, XTYPE_XBOX360 }, 320 244 { 0x24c6, 0x550d, "Hori GEM Xbox controller", 0, XTYPE_XBOX360 }, 245 + { 0x24c6, 0x550e, "Hori Real Arcade Pro V Kai 360", MAP_TRIGGERS_TO_BUTTONS, XTYPE_XBOX360 }, 246 + { 0x24c6, 0x551a, "PowerA FUSION Pro Controller", 0, XTYPE_XBOXONE }, 247 + { 0x24c6, 0x561a, "PowerA FUSION Controller", 0, XTYPE_XBOXONE }, 248 + { 0x24c6, 0x5b00, "ThrustMaster Ferrari 458 Racing Wheel", 0, XTYPE_XBOX360 }, 321 249 { 0x24c6, 0x5b02, "Thrustmaster, Inc. GPX Controller", 0, XTYPE_XBOX360 }, 322 250 { 0x24c6, 0x5b03, "Thrustmaster Ferrari 458 Racing Wheel", 0, XTYPE_XBOX360 }, 323 251 { 0x24c6, 0x5d04, "Razer Sabertooth", 0, XTYPE_XBOX360 }, 252 + { 0x24c6, 0xfafe, "Rock Candy Gamepad for Xbox 360", 0, XTYPE_XBOX360 }, 253 + { 0x3767, 0x0101, "Fanatec Speedster 3 Forceshock Wheel", 0, XTYPE_XBOX }, 324 254 { 0xffff, 0xffff, "Chinese-made Xbox Controller", 0, XTYPE_XBOX }, 325 255 { 0x0000, 0x0000, "Generic X-Box pad", 0, XTYPE_UNKNOWN } 326 256 }; ··· 415 331 XPAD_XBOXONE_VENDOR(0x045e), /* Microsoft X-Box One controllers */ 416 332 XPAD_XBOX360_VENDOR(0x046d), /* Logitech X-Box 360 style controllers */ 417 333 XPAD_XBOX360_VENDOR(0x056e), /* Elecom JC-U3613M */ 334 + XPAD_XBOX360_VENDOR(0x06a3), /* Saitek P3600 */ 418 335 XPAD_XBOX360_VENDOR(0x0738), /* Mad Catz X-Box 360 controllers */ 419 336 { USB_DEVICE(0x0738, 0x4540) }, /* Mad Catz Beat Pad */ 420 337 XPAD_XBOXONE_VENDOR(0x0738), /* Mad Catz FightStick TE 2 */ 338 + XPAD_XBOX360_VENDOR(0x07ff), /* Mad Catz GamePad */ 421 339 XPAD_XBOX360_VENDOR(0x0e6f), /* 0x0e6f X-Box 360 controllers */ 422 340 XPAD_XBOXONE_VENDOR(0x0e6f), /* 0x0e6f X-Box One controllers */ 423 341 XPAD_XBOX360_VENDOR(0x0f0d), /* Hori Controllers */ 424 342 XPAD_XBOXONE_VENDOR(0x0f0d), /* Hori Controllers */ 343 + XPAD_XBOX360_VENDOR(0x11c9), /* Nacon GC100XF */ 425 344 XPAD_XBOX360_VENDOR(0x12ab), /* X-Box 360 dance pads */ 426 345 XPAD_XBOX360_VENDOR(0x1430), /* RedOctane X-Box 360 controllers */ 427 346 XPAD_XBOX360_VENDOR(0x146b), /* BigBen Interactive Controllers */
+11
drivers/input/keyboard/Kconfig
··· 178 178 To compile this driver as a module, choose M here: the 179 179 module will be called clps711x-keypad. 180 180 181 + config KEYBOARD_DLINK_DIR685 182 + tristate "D-Link DIR-685 touchkeys support" 183 + depends on I2C 184 + default ARCH_GEMINI 185 + help 186 + If you say yes here you get support for the D-Link DIR-685 187 + touchkeys. 188 + 189 + To compile this driver as a module, choose M here: the 190 + module will be called dlink-dir685-touchkeys. 191 + 181 192 config KEYBOARD_LKKBD 182 193 tristate "DECstation/VAXstation LK201/LK401 keyboard" 183 194 select SERIO
+1
drivers/input/keyboard/Makefile
··· 17 17 obj-$(CONFIG_KEYBOARD_CLPS711X) += clps711x-keypad.o 18 18 obj-$(CONFIG_KEYBOARD_CROS_EC) += cros_ec_keyb.o 19 19 obj-$(CONFIG_KEYBOARD_DAVINCI) += davinci_keyscan.o 20 + obj-$(CONFIG_KEYBOARD_DLINK_DIR685) += dlink-dir685-touchkeys.o 20 21 obj-$(CONFIG_KEYBOARD_EP93XX) += ep93xx_keypad.o 21 22 obj-$(CONFIG_KEYBOARD_GOLDFISH_EVENTS) += goldfish_events.o 22 23 obj-$(CONFIG_KEYBOARD_GPIO) += gpio_keys.o
+1 -1
drivers/input/keyboard/lm8323.c
··· 30 30 #include <linux/delay.h> 31 31 #include <linux/input.h> 32 32 #include <linux/leds.h> 33 + #include <linux/platform_data/lm8323.h> 33 34 #include <linux/pm.h> 34 - #include <linux/i2c/lm8323.h> 35 35 #include <linux/slab.h> 36 36 37 37 /* Commands to send to the chip. */
+1 -1
drivers/input/keyboard/mcs_touchkey.c
··· 13 13 14 14 #include <linux/module.h> 15 15 #include <linux/i2c.h> 16 - #include <linux/i2c/mcs.h> 17 16 #include <linux/interrupt.h> 18 17 #include <linux/input.h> 19 18 #include <linux/irq.h> 20 19 #include <linux/slab.h> 20 + #include <linux/platform_data/mcs.h> 21 21 #include <linux/pm.h> 22 22 23 23 /* MCS5000 Touchkey */
+28
drivers/input/misc/axp20x-pek.c
··· 253 253 return error; 254 254 } 255 255 256 + if (axp20x_pek->axp20x->variant == AXP288_ID) 257 + enable_irq_wake(axp20x_pek->irq_dbr); 258 + 256 259 return 0; 257 260 } 258 261 ··· 334 331 return 0; 335 332 } 336 333 334 + static int __maybe_unused axp20x_pek_resume_noirq(struct device *dev) 335 + { 336 + struct axp20x_pek *axp20x_pek = dev_get_drvdata(dev); 337 + 338 + if (axp20x_pek->axp20x->variant != AXP288_ID) 339 + return 0; 340 + 341 + /* 342 + * Clear interrupts from button presses during suspend, to avoid 343 + * a wakeup power-button press getting reported to userspace. 344 + */ 345 + regmap_write(axp20x_pek->axp20x->regmap, 346 + AXP20X_IRQ1_STATE + AXP288_IRQ_POKN / 8, 347 + BIT(AXP288_IRQ_POKN % 8)); 348 + 349 + return 0; 350 + } 351 + 352 + static const struct dev_pm_ops axp20x_pek_pm_ops = { 353 + #ifdef CONFIG_PM_SLEEP 354 + .resume_noirq = axp20x_pek_resume_noirq, 355 + #endif 356 + }; 357 + 337 358 static struct platform_driver axp20x_pek_driver = { 338 359 .probe = axp20x_pek_probe, 339 360 .driver = { 340 361 .name = "axp20x-pek", 362 + .pm = &axp20x_pek_pm_ops, 341 363 }, 342 364 }; 343 365 module_platform_driver(axp20x_pek_driver);
+13 -9
drivers/input/misc/xen-kbdfront.c
··· 135 135 goto error_nomem; 136 136 137 137 /* Set input abs params to match backend screen res */ 138 - abs = xenbus_read_unsigned(dev->otherend, "feature-abs-pointer", 0); 139 - ptr_size[KPARAM_X] = xenbus_read_unsigned(dev->otherend, "width", 138 + abs = xenbus_read_unsigned(dev->otherend, 139 + XENKBD_FIELD_FEAT_ABS_POINTER, 0); 140 + ptr_size[KPARAM_X] = xenbus_read_unsigned(dev->otherend, 141 + XENKBD_FIELD_WIDTH, 140 142 ptr_size[KPARAM_X]); 141 - ptr_size[KPARAM_Y] = xenbus_read_unsigned(dev->otherend, "height", 143 + ptr_size[KPARAM_Y] = xenbus_read_unsigned(dev->otherend, 144 + XENKBD_FIELD_HEIGHT, 142 145 ptr_size[KPARAM_Y]); 143 146 if (abs) { 144 147 ret = xenbus_write(XBT_NIL, dev->nodename, 145 - "request-abs-pointer", "1"); 148 + XENKBD_FIELD_REQ_ABS_POINTER, "1"); 146 149 if (ret) { 147 150 pr_warn("xenkbd: can't request abs-pointer\n"); 148 151 abs = 0; ··· 274 271 xenbus_dev_fatal(dev, ret, "starting transaction"); 275 272 goto error_irqh; 276 273 } 277 - ret = xenbus_printf(xbt, dev->nodename, "page-ref", "%lu", 274 + ret = xenbus_printf(xbt, dev->nodename, XENKBD_FIELD_RING_REF, "%lu", 278 275 virt_to_gfn(info->page)); 279 276 if (ret) 280 277 goto error_xenbus; 281 - ret = xenbus_printf(xbt, dev->nodename, "page-gref", "%u", info->gref); 278 + ret = xenbus_printf(xbt, dev->nodename, XENKBD_FIELD_RING_GREF, 279 + "%u", info->gref); 282 280 if (ret) 283 281 goto error_xenbus; 284 - ret = xenbus_printf(xbt, dev->nodename, "event-channel", "%u", 282 + ret = xenbus_printf(xbt, dev->nodename, XENKBD_FIELD_EVT_CHANNEL, "%u", 285 283 evtchn); 286 284 if (ret) 287 285 goto error_xenbus; ··· 357 353 } 358 354 359 355 static const struct xenbus_device_id xenkbd_ids[] = { 360 - { "vkbd" }, 356 + { XENKBD_DRIVER_NAME }, 361 357 { "" } 362 358 }; 363 359 ··· 394 390 395 391 MODULE_DESCRIPTION("Xen virtual keyboard/pointer device frontend"); 396 392 MODULE_LICENSE("GPL"); 397 - MODULE_ALIAS("xen:vkbd"); 393 + MODULE_ALIAS("xen:" XENKBD_DRIVER_NAME);
+2 -1
drivers/input/mouse/elan_i2c.h
··· 58 58 59 59 int (*get_version)(struct i2c_client *client, bool iap, u8 *version); 60 60 int (*get_sm_version)(struct i2c_client *client, 61 - u8* ic_type, u8 *version); 61 + u16 *ic_type, u8 *version); 62 62 int (*get_checksum)(struct i2c_client *client, bool iap, u16 *csum); 63 63 int (*get_product_id)(struct i2c_client *client, u16 *id); 64 64 ··· 82 82 int (*get_report)(struct i2c_client *client, u8 *report); 83 83 int (*get_pressure_adjustment)(struct i2c_client *client, 84 84 int *adjustment); 85 + int (*get_pattern)(struct i2c_client *client, u8 *pattern); 85 86 }; 86 87 87 88 extern const struct elan_transport_ops elan_smbus_ops, elan_i2c_ops;
+32 -8
drivers/input/mouse/elan_i2c_core.c
··· 5 5 * 6 6 * Author: 林政維 (Duson Lin) <dusonlin@emc.com.tw> 7 7 * Author: KT Liao <kt.liao@emc.com.tw> 8 - * Version: 1.6.2 8 + * Version: 1.6.3 9 9 * 10 10 * Based on cyapa driver: 11 11 * copyright (c) 2011-2012 Cypress Semiconductor, Inc. ··· 41 41 #include "elan_i2c.h" 42 42 43 43 #define DRIVER_NAME "elan_i2c" 44 - #define ELAN_DRIVER_VERSION "1.6.2" 44 + #define ELAN_DRIVER_VERSION "1.6.3" 45 45 #define ELAN_VENDOR_ID 0x04f3 46 46 #define ETP_MAX_PRESSURE 255 47 47 #define ETP_FWIDTH_REDUCE 90 ··· 78 78 unsigned int x_res; 79 79 unsigned int y_res; 80 80 81 + u8 pattern; 81 82 u16 product_id; 82 83 u8 fw_version; 83 84 u8 sm_version; ··· 86 85 u16 fw_checksum; 87 86 int pressure_adjustment; 88 87 u8 mode; 89 - u8 ic_type; 88 + u16 ic_type; 90 89 u16 fw_validpage_count; 91 90 u16 fw_signature_address; 92 91 ··· 97 96 bool baseline_ready; 98 97 }; 99 98 100 - static int elan_get_fwinfo(u8 iap_version, u16 *validpage_count, 99 + static int elan_get_fwinfo(u16 ic_type, u16 *validpage_count, 101 100 u16 *signature_address) 102 101 { 103 - switch (iap_version) { 102 + switch (ic_type) { 104 103 case 0x00: 105 104 case 0x06: 106 105 case 0x08: ··· 119 118 break; 120 119 case 0x0E: 121 120 *validpage_count = 640; 121 + break; 122 + case 0x10: 123 + *validpage_count = 1024; 122 124 break; 123 125 default: 124 126 /* unknown ic type clear value */ ··· 309 305 static int elan_query_device_info(struct elan_tp_data *data) 310 306 { 311 307 int error; 308 + u16 ic_type; 312 309 313 310 error = data->ops->get_version(data->client, false, &data->fw_version); 314 311 if (error) ··· 329 324 if (error) 330 325 return error; 331 326 332 - error = elan_get_fwinfo(data->iap_version, &data->fw_validpage_count, 327 + error = data->ops->get_pattern(data->client, &data->pattern); 328 + if (error) 329 + return error; 330 + 331 + if (data->pattern == 0x01) 332 + ic_type = data->ic_type; 333 + else 334 + ic_type = data->iap_version; 335 + 336 + error = elan_get_fwinfo(ic_type, &data->fw_validpage_count, 333 337 &data->fw_signature_address); 334 338 if (error) 335 339 dev_warn(&data->client->dev, ··· 1091 1077 return error; 1092 1078 } 1093 1079 1080 + /* Make sure there is something at this address */ 1081 + error = i2c_smbus_read_byte(client); 1082 + if (error < 0) { 1083 + dev_dbg(&client->dev, "nothing at this address: %d\n", error); 1084 + return -ENXIO; 1085 + } 1086 + 1094 1087 /* Initialize the touchpad. */ 1095 1088 error = elan_initialize(data); 1096 1089 if (error) ··· 1122 1101 "Elan Touchpad Extra Information:\n" 1123 1102 " Max ABS X,Y: %d,%d\n" 1124 1103 " Width X,Y: %d,%d\n" 1125 - " Resolution X,Y: %d,%d (dots/mm)\n", 1104 + " Resolution X,Y: %d,%d (dots/mm)\n" 1105 + " ic type: 0x%x\n" 1106 + " info pattern: 0x%x\n", 1126 1107 data->max_x, data->max_y, 1127 1108 data->width_x, data->width_y, 1128 - data->x_res, data->y_res); 1109 + data->x_res, data->y_res, 1110 + data->ic_type, data->pattern); 1129 1111 1130 1112 /* Set up input device properties based on queried parameters. */ 1131 1113 error = elan_setup_input_device(data);
+64 -7
drivers/input/mouse/elan_i2c_i2c.c
··· 34 34 #define ETP_I2C_DESC_CMD 0x0001 35 35 #define ETP_I2C_REPORT_DESC_CMD 0x0002 36 36 #define ETP_I2C_STAND_CMD 0x0005 37 + #define ETP_I2C_PATTERN_CMD 0x0100 37 38 #define ETP_I2C_UNIQUEID_CMD 0x0101 38 39 #define ETP_I2C_FW_VERSION_CMD 0x0102 39 - #define ETP_I2C_SM_VERSION_CMD 0x0103 40 + #define ETP_I2C_IC_TYPE_CMD 0x0103 41 + #define ETP_I2C_OSM_VERSION_CMD 0x0103 42 + #define ETP_I2C_NSM_VERSION_CMD 0x0104 40 43 #define ETP_I2C_XY_TRACENUM_CMD 0x0105 41 44 #define ETP_I2C_MAX_X_AXIS_CMD 0x0106 42 45 #define ETP_I2C_MAX_Y_AXIS_CMD 0x0107 ··· 242 239 return 0; 243 240 } 244 241 242 + static int elan_i2c_get_pattern(struct i2c_client *client, u8 *pattern) 243 + { 244 + int error; 245 + u8 val[3]; 246 + 247 + error = elan_i2c_read_cmd(client, ETP_I2C_PATTERN_CMD, val); 248 + if (error) { 249 + dev_err(&client->dev, "failed to get pattern: %d\n", error); 250 + return error; 251 + } 252 + *pattern = val[1]; 253 + 254 + return 0; 255 + } 256 + 245 257 static int elan_i2c_get_version(struct i2c_client *client, 246 258 bool iap, u8 *version) 247 259 { 248 260 int error; 261 + u8 pattern_ver; 249 262 u8 val[3]; 263 + 264 + error = elan_i2c_get_pattern(client, &pattern_ver); 265 + if (error) { 266 + dev_err(&client->dev, "failed to get pattern version\n"); 267 + return error; 268 + } 250 269 251 270 error = elan_i2c_read_cmd(client, 252 271 iap ? ETP_I2C_IAP_VERSION_CMD : ··· 280 255 return error; 281 256 } 282 257 283 - *version = val[0]; 258 + if (pattern_ver == 0x01) 259 + *version = iap ? val[1] : val[0]; 260 + else 261 + *version = val[0]; 284 262 return 0; 285 263 } 286 264 287 265 static int elan_i2c_get_sm_version(struct i2c_client *client, 288 - u8 *ic_type, u8 *version) 266 + u16 *ic_type, u8 *version) 289 267 { 290 268 int error; 269 + u8 pattern_ver; 291 270 u8 val[3]; 292 271 293 - error = elan_i2c_read_cmd(client, ETP_I2C_SM_VERSION_CMD, val); 272 + error = elan_i2c_get_pattern(client, &pattern_ver); 294 273 if (error) { 295 - dev_err(&client->dev, "failed to get SM version: %d\n", error); 274 + dev_err(&client->dev, "failed to get pattern version\n"); 296 275 return error; 297 276 } 298 277 299 - *version = val[0]; 300 - *ic_type = val[1]; 278 + if (pattern_ver == 0x01) { 279 + error = elan_i2c_read_cmd(client, ETP_I2C_IC_TYPE_CMD, val); 280 + if (error) { 281 + dev_err(&client->dev, "failed to get ic type: %d\n", 282 + error); 283 + return error; 284 + } 285 + *ic_type = be16_to_cpup((__be16 *)val); 286 + 287 + error = elan_i2c_read_cmd(client, ETP_I2C_NSM_VERSION_CMD, 288 + val); 289 + if (error) { 290 + dev_err(&client->dev, "failed to get SM version: %d\n", 291 + error); 292 + return error; 293 + } 294 + *version = val[1]; 295 + } else { 296 + error = elan_i2c_read_cmd(client, ETP_I2C_OSM_VERSION_CMD, val); 297 + if (error) { 298 + dev_err(&client->dev, "failed to get SM version: %d\n", 299 + error); 300 + return error; 301 + } 302 + *version = val[0]; 303 + *ic_type = val[1]; 304 + } 305 + 301 306 return 0; 302 307 } 303 308 ··· 695 640 .prepare_fw_update = elan_i2c_prepare_fw_update, 696 641 .write_fw_block = elan_i2c_write_fw_block, 697 642 .finish_fw_update = elan_i2c_finish_fw_update, 643 + 644 + .get_pattern = elan_i2c_get_pattern, 698 645 699 646 .get_report = elan_i2c_get_report, 700 647 };
+8 -1
drivers/input/mouse/elan_i2c_smbus.c
··· 166 166 } 167 167 168 168 static int elan_smbus_get_sm_version(struct i2c_client *client, 169 - u8 *ic_type, u8 *version) 169 + u16 *ic_type, u8 *version) 170 170 { 171 171 int error; 172 172 u8 val[3]; ··· 495 495 return 0; 496 496 } 497 497 498 + static int elan_smbus_get_pattern(struct i2c_client *client, u8 *pattern) 499 + { 500 + *pattern = 0; 501 + return 0; 502 + } 503 + 498 504 const struct elan_transport_ops elan_smbus_ops = { 499 505 .initialize = elan_smbus_initialize, 500 506 .sleep_control = elan_smbus_sleep_control, ··· 530 524 .finish_fw_update = elan_smbus_finish_fw_update, 531 525 532 526 .get_report = elan_smbus_get_report, 527 + .get_pattern = elan_smbus_get_pattern, 533 528 };
+11
drivers/input/mouse/elantech.c
··· 1711 1711 etd->samples[0], etd->samples[1], etd->samples[2]); 1712 1712 } 1713 1713 1714 + if (etd->samples[1] == 0x74 && etd->hw_version == 0x03) { 1715 + /* 1716 + * This module has a bug which makes absolute mode 1717 + * unusable, so let's abort so we'll be using standard 1718 + * PS/2 protocol. 1719 + */ 1720 + psmouse_info(psmouse, 1721 + "absolute mode broken, forcing standard PS/2 protocol\n"); 1722 + goto init_fail; 1723 + } 1724 + 1714 1725 if (elantech_set_absolute_mode(psmouse)) { 1715 1726 psmouse_err(psmouse, 1716 1727 "failed to put touchpad into absolute mode.\n");
+9 -15
drivers/input/rmi4/rmi_f34v7.c
··· 9 9 * the Free Software Foundation. 10 10 */ 11 11 12 + #include <linux/bitops.h> 12 13 #include <linux/kernel.h> 13 14 #include <linux/rmi.h> 14 15 #include <linux/firmware.h> 15 - #include <asm/unaligned.h> 16 16 #include <linux/delay.h> 17 17 #include <linux/slab.h> 18 18 #include <linux/jiffies.h> 19 + #include <asm/unaligned.h> 19 20 20 21 #include "rmi_driver.h" 21 22 #include "rmi_f34.h" ··· 465 464 static int rmi_f34v7_read_queries(struct f34_data *f34) 466 465 { 467 466 int ret; 468 - int i, j; 467 + int i; 469 468 u8 base; 470 469 int offset; 471 470 u8 *ptable; ··· 519 518 query_1_7.partition_support[1] & HAS_GUEST_CODE; 520 519 521 520 if (query_0 & HAS_CONFIG_ID) { 522 - char f34_ctrl[CONFIG_ID_SIZE]; 523 - int i = 0; 524 - u8 *p = f34->configuration_id; 525 - *p = '\0'; 521 + u8 f34_ctrl[CONFIG_ID_SIZE]; 526 522 527 523 ret = rmi_read_block(f34->fn->rmi_dev, 528 524 f34->fn->fd.control_base_addr, ··· 529 531 return ret; 530 532 531 533 /* Eat leading zeros */ 532 - while (i < sizeof(f34_ctrl) && !f34_ctrl[i]) 533 - i++; 534 + for (i = 0; i < sizeof(f34_ctrl) - 1 && !f34_ctrl[i]; i++) 535 + /* Empty */; 534 536 535 - for (; i < sizeof(f34_ctrl); i++) 536 - p += snprintf(p, f34->configuration_id 537 - + sizeof(f34->configuration_id) - p, 538 - "%02X", f34_ctrl[i]); 537 + snprintf(f34->configuration_id, sizeof(f34->configuration_id), 538 + "%*phN", (int)sizeof(f34_ctrl) - i, f34_ctrl + i); 539 539 540 540 rmi_dbg(RMI_DEBUG_FN, &f34->fn->dev, "Configuration ID: %s\n", 541 541 f34->configuration_id); ··· 541 545 542 546 f34->v7.partitions = 0; 543 547 for (i = 0; i < sizeof(query_1_7.partition_support); i++) 544 - for (j = 0; j < 8; j++) 545 - if (query_1_7.partition_support[i] & (1 << j)) 546 - f34->v7.partitions++; 548 + f34->v7.partitions += hweight8(query_1_7.partition_support[i]); 547 549 548 550 rmi_dbg(RMI_DEBUG_FN, &f34->fn->dev, "%s: Supported partitions: %*ph\n", 549 551 __func__, sizeof(query_1_7.partition_support),
-14
drivers/input/sparse-keymap.c
··· 224 224 EXPORT_SYMBOL(sparse_keymap_setup); 225 225 226 226 /** 227 - * sparse_keymap_free - free memory allocated for sparse keymap 228 - * @dev: Input device using sparse keymap 229 - * 230 - * This function used to free memory allocated by sparse keymap 231 - * in an input device that was set up by sparse_keymap_setup(). 232 - * Since sparse_keymap_setup() now uses a managed allocation for the 233 - * keymap copy, use of this function is deprecated. 234 - */ 235 - void sparse_keymap_free(struct input_dev *dev) 236 - { 237 - } 238 - EXPORT_SYMBOL(sparse_keymap_free); 239 - 240 - /** 241 227 * sparse_keymap_report_entry - report event corresponding to given key entry 242 228 * @dev: Input device for which event should be reported 243 229 * @ke: key entry describing event
+11
drivers/input/touchscreen/Kconfig
··· 1114 1114 To compile this driver as a module, choose M here: the 1115 1115 module will be called st1232_ts. 1116 1116 1117 + config TOUCHSCREEN_STMFTS 1118 + tristate "STMicroelectronics STMFTS touchscreen" 1119 + depends on I2C 1120 + depends on LEDS_CLASS 1121 + help 1122 + Say Y here if you want support for STMicroelectronics 1123 + STMFTS touchscreen. 1124 + 1125 + To compile this driver as a module, choose M here: the 1126 + module will be called stmfts. 1127 + 1117 1128 config TOUCHSCREEN_STMPE 1118 1129 tristate "STMicroelectronics STMPE touchscreens" 1119 1130 depends on MFD_STMPE
+1
drivers/input/touchscreen/Makefile
··· 67 67 obj-$(CONFIG_TOUCHSCREEN_SILEAD) += silead.o 68 68 obj-$(CONFIG_TOUCHSCREEN_SIS_I2C) += sis_i2c.o 69 69 obj-$(CONFIG_TOUCHSCREEN_ST1232) += st1232.o 70 + obj-$(CONFIG_TOUCHSCREEN_STMFTS) += stmfts.o 70 71 obj-$(CONFIG_TOUCHSCREEN_STMPE) += stmpe-ts.o 71 72 obj-$(CONFIG_TOUCHSCREEN_SUN4I) += sun4i-ts.o 72 73 obj-$(CONFIG_TOUCHSCREEN_SUR40) += sur40.o
+1 -1
drivers/input/touchscreen/mcs5000_ts.c
··· 15 15 16 16 #include <linux/module.h> 17 17 #include <linux/i2c.h> 18 - #include <linux/i2c/mcs.h> 19 18 #include <linux/interrupt.h> 20 19 #include <linux/input.h> 21 20 #include <linux/irq.h> 21 + #include <linux/platform_data/mcs.h> 22 22 #include <linux/slab.h> 23 23 24 24 /* Registers */
+1 -1
drivers/input/touchscreen/mms114.c
··· 11 11 #include <linux/delay.h> 12 12 #include <linux/of.h> 13 13 #include <linux/i2c.h> 14 - #include <linux/i2c/mms114.h> 15 14 #include <linux/input/mt.h> 16 15 #include <linux/interrupt.h> 16 + #include <linux/platform_data/mms114.h> 17 17 #include <linux/regulator/consumer.h> 18 18 #include <linux/slab.h> 19 19
+7 -1
drivers/input/touchscreen/s3c2410_ts.c
··· 264 264 return -ENOENT; 265 265 } 266 266 267 - clk_prepare_enable(ts.clock); 267 + ret = clk_prepare_enable(ts.clock); 268 + if (ret) { 269 + dev_err(dev, "Failed! to enabled clocks\n"); 270 + goto err_clk_get; 271 + } 268 272 dev_dbg(dev, "got and enabled clocks\n"); 269 273 270 274 ts.irq_tc = ret = platform_get_irq(pdev, 0); ··· 357 353 err_iomap: 358 354 iounmap(ts.io); 359 355 err_clk: 356 + clk_disable_unprepare(ts.clock); 360 357 del_timer_sync(&touch_timer); 358 + err_clk_get: 361 359 clk_put(ts.clock); 362 360 return ret; 363 361 }
+822
drivers/input/touchscreen/stmfts.c
··· 1 + /* 2 + * Copyright (c) 2017 Samsung Electronics Co., Ltd. 3 + * Author: Andi Shyti <andi.shyti@samsung.com> 4 + * 5 + * This program is free software; you can redistribute it and/or modify 6 + * it under the terms of the GNU General Public License version 2 as 7 + * published by the Free Software Foundation. 8 + * 9 + * STMicroelectronics FTS Touchscreen device driver 10 + */ 11 + 12 + #include <linux/delay.h> 13 + #include <linux/i2c.h> 14 + #include <linux/input/mt.h> 15 + #include <linux/input/touchscreen.h> 16 + #include <linux/interrupt.h> 17 + #include <linux/irq.h> 18 + #include <linux/leds.h> 19 + #include <linux/module.h> 20 + #include <linux/pm_runtime.h> 21 + #include <linux/regulator/consumer.h> 22 + 23 + /* I2C commands */ 24 + #define STMFTS_READ_INFO 0x80 25 + #define STMFTS_READ_STATUS 0x84 26 + #define STMFTS_READ_ONE_EVENT 0x85 27 + #define STMFTS_READ_ALL_EVENT 0x86 28 + #define STMFTS_LATEST_EVENT 0x87 29 + #define STMFTS_SLEEP_IN 0x90 30 + #define STMFTS_SLEEP_OUT 0x91 31 + #define STMFTS_MS_MT_SENSE_OFF 0x92 32 + #define STMFTS_MS_MT_SENSE_ON 0x93 33 + #define STMFTS_SS_HOVER_SENSE_OFF 0x94 34 + #define STMFTS_SS_HOVER_SENSE_ON 0x95 35 + #define STMFTS_MS_KEY_SENSE_OFF 0x9a 36 + #define STMFTS_MS_KEY_SENSE_ON 0x9b 37 + #define STMFTS_SYSTEM_RESET 0xa0 38 + #define STMFTS_CLEAR_EVENT_STACK 0xa1 39 + #define STMFTS_FULL_FORCE_CALIBRATION 0xa2 40 + #define STMFTS_MS_CX_TUNING 0xa3 41 + #define STMFTS_SS_CX_TUNING 0xa4 42 + 43 + /* events */ 44 + #define STMFTS_EV_NO_EVENT 0x00 45 + #define STMFTS_EV_MULTI_TOUCH_DETECTED 0x02 46 + #define STMFTS_EV_MULTI_TOUCH_ENTER 0x03 47 + #define STMFTS_EV_MULTI_TOUCH_LEAVE 0x04 48 + #define STMFTS_EV_MULTI_TOUCH_MOTION 0x05 49 + #define STMFTS_EV_HOVER_ENTER 0x07 50 + #define STMFTS_EV_HOVER_LEAVE 0x08 51 + #define STMFTS_EV_HOVER_MOTION 0x09 52 + #define STMFTS_EV_KEY_STATUS 0x0e 53 + #define STMFTS_EV_ERROR 0x0f 54 + #define STMFTS_EV_CONTROLLER_READY 0x10 55 + #define STMFTS_EV_SLEEP_OUT_CONTROLLER_READY 0x11 56 + #define STMFTS_EV_STATUS 0x16 57 + #define STMFTS_EV_DEBUG 0xdb 58 + 59 + /* multi touch related event masks */ 60 + #define STMFTS_MASK_EVENT_ID 0x0f 61 + #define STMFTS_MASK_TOUCH_ID 0xf0 62 + #define STMFTS_MASK_LEFT_EVENT 0x0f 63 + #define STMFTS_MASK_X_MSB 0x0f 64 + #define STMFTS_MASK_Y_LSB 0xf0 65 + 66 + /* key related event masks */ 67 + #define STMFTS_MASK_KEY_NO_TOUCH 0x00 68 + #define STMFTS_MASK_KEY_MENU 0x01 69 + #define STMFTS_MASK_KEY_BACK 0x02 70 + 71 + #define STMFTS_EVENT_SIZE 8 72 + #define STMFTS_STACK_DEPTH 32 73 + #define STMFTS_DATA_MAX_SIZE (STMFTS_EVENT_SIZE * STMFTS_STACK_DEPTH) 74 + #define STMFTS_MAX_FINGERS 10 75 + #define STMFTS_DEV_NAME "stmfts" 76 + 77 + enum stmfts_regulators { 78 + STMFTS_REGULATOR_VDD, 79 + STMFTS_REGULATOR_AVDD, 80 + }; 81 + 82 + struct stmfts_data { 83 + struct i2c_client *client; 84 + struct input_dev *input; 85 + struct led_classdev led_cdev; 86 + struct mutex mutex; 87 + 88 + struct touchscreen_properties prop; 89 + 90 + struct regulator_bulk_data regulators[2]; 91 + 92 + /* 93 + * Presence of ledvdd will be used also to check 94 + * whether the LED is supported. 95 + */ 96 + struct regulator *ledvdd; 97 + 98 + u16 chip_id; 99 + u8 chip_ver; 100 + u16 fw_ver; 101 + u8 config_id; 102 + u8 config_ver; 103 + 104 + u8 data[STMFTS_DATA_MAX_SIZE]; 105 + 106 + struct completion cmd_done; 107 + 108 + bool use_key; 109 + bool led_status; 110 + bool hover_enabled; 111 + bool running; 112 + }; 113 + 114 + static void stmfts_brightness_set(struct led_classdev *led_cdev, 115 + enum led_brightness value) 116 + { 117 + struct stmfts_data *sdata = container_of(led_cdev, 118 + struct stmfts_data, led_cdev); 119 + int err; 120 + 121 + if (value == sdata->led_status || !sdata->ledvdd) 122 + return; 123 + 124 + if (!value) { 125 + regulator_disable(sdata->ledvdd); 126 + } else { 127 + err = regulator_enable(sdata->ledvdd); 128 + if (err) 129 + dev_warn(&sdata->client->dev, 130 + "failed to disable ledvdd regulator: %d\n", 131 + err); 132 + } 133 + 134 + sdata->led_status = value; 135 + } 136 + 137 + static enum led_brightness stmfts_brightness_get(struct led_classdev *led_cdev) 138 + { 139 + struct stmfts_data *sdata = container_of(led_cdev, 140 + struct stmfts_data, led_cdev); 141 + 142 + return !!regulator_is_enabled(sdata->ledvdd); 143 + } 144 + 145 + /* 146 + * We can't simply use i2c_smbus_read_i2c_block_data because we 147 + * need to read more than 255 bytes ( 148 + */ 149 + static int stmfts_read_events(struct stmfts_data *sdata) 150 + { 151 + u8 cmd = STMFTS_READ_ALL_EVENT; 152 + struct i2c_msg msgs[2] = { 153 + { 154 + .addr = sdata->client->addr, 155 + .len = 1, 156 + .buf = &cmd, 157 + }, 158 + { 159 + .addr = sdata->client->addr, 160 + .flags = I2C_M_RD, 161 + .len = STMFTS_DATA_MAX_SIZE, 162 + .buf = sdata->data, 163 + }, 164 + }; 165 + int ret; 166 + 167 + ret = i2c_transfer(sdata->client->adapter, msgs, ARRAY_SIZE(msgs)); 168 + if (ret < 0) 169 + return ret; 170 + 171 + return ret == ARRAY_SIZE(msgs) ? 0 : -EIO; 172 + } 173 + 174 + static void stmfts_report_contact_event(struct stmfts_data *sdata, 175 + const u8 event[]) 176 + { 177 + u8 slot_id = (event[0] & STMFTS_MASK_TOUCH_ID) >> 4; 178 + u16 x = event[1] | ((event[2] & STMFTS_MASK_X_MSB) << 8); 179 + u16 y = (event[2] >> 4) | (event[3] << 4); 180 + u8 maj = event[4]; 181 + u8 min = event[5]; 182 + u8 orientation = event[6]; 183 + u8 area = event[7]; 184 + 185 + input_mt_slot(sdata->input, slot_id); 186 + 187 + input_mt_report_slot_state(sdata->input, MT_TOOL_FINGER, true); 188 + input_report_abs(sdata->input, ABS_MT_POSITION_X, x); 189 + input_report_abs(sdata->input, ABS_MT_POSITION_Y, y); 190 + input_report_abs(sdata->input, ABS_MT_TOUCH_MAJOR, maj); 191 + input_report_abs(sdata->input, ABS_MT_TOUCH_MINOR, min); 192 + input_report_abs(sdata->input, ABS_MT_PRESSURE, area); 193 + input_report_abs(sdata->input, ABS_MT_ORIENTATION, orientation); 194 + 195 + input_sync(sdata->input); 196 + } 197 + 198 + static void stmfts_report_contact_release(struct stmfts_data *sdata, 199 + const u8 event[]) 200 + { 201 + u8 slot_id = (event[0] & STMFTS_MASK_TOUCH_ID) >> 4; 202 + 203 + input_mt_slot(sdata->input, slot_id); 204 + input_mt_report_slot_state(sdata->input, MT_TOOL_FINGER, false); 205 + 206 + input_sync(sdata->input); 207 + } 208 + 209 + static void stmfts_report_hover_event(struct stmfts_data *sdata, 210 + const u8 event[]) 211 + { 212 + u16 x = (event[2] << 4) | (event[4] >> 4); 213 + u16 y = (event[3] << 4) | (event[4] & STMFTS_MASK_Y_LSB); 214 + u8 z = event[5]; 215 + 216 + input_report_abs(sdata->input, ABS_X, x); 217 + input_report_abs(sdata->input, ABS_Y, y); 218 + input_report_abs(sdata->input, ABS_DISTANCE, z); 219 + 220 + input_sync(sdata->input); 221 + } 222 + 223 + static void stmfts_report_key_event(struct stmfts_data *sdata, const u8 event[]) 224 + { 225 + switch (event[2]) { 226 + case 0: 227 + input_report_key(sdata->input, KEY_BACK, 0); 228 + input_report_key(sdata->input, KEY_MENU, 0); 229 + break; 230 + 231 + case STMFTS_MASK_KEY_BACK: 232 + input_report_key(sdata->input, KEY_BACK, 1); 233 + break; 234 + 235 + case STMFTS_MASK_KEY_MENU: 236 + input_report_key(sdata->input, KEY_MENU, 1); 237 + break; 238 + 239 + default: 240 + dev_warn(&sdata->client->dev, 241 + "unknown key event: %#02x\n", event[2]); 242 + break; 243 + } 244 + 245 + input_sync(sdata->input); 246 + } 247 + 248 + static void stmfts_parse_events(struct stmfts_data *sdata) 249 + { 250 + int i; 251 + 252 + for (i = 0; i < STMFTS_STACK_DEPTH; i++) { 253 + u8 *event = &sdata->data[i * STMFTS_EVENT_SIZE]; 254 + 255 + switch (event[0]) { 256 + 257 + case STMFTS_EV_CONTROLLER_READY: 258 + case STMFTS_EV_SLEEP_OUT_CONTROLLER_READY: 259 + case STMFTS_EV_STATUS: 260 + complete(&sdata->cmd_done); 261 + /* fall through */ 262 + 263 + case STMFTS_EV_NO_EVENT: 264 + case STMFTS_EV_DEBUG: 265 + return; 266 + } 267 + 268 + switch (event[0] & STMFTS_MASK_EVENT_ID) { 269 + 270 + case STMFTS_EV_MULTI_TOUCH_ENTER: 271 + case STMFTS_EV_MULTI_TOUCH_MOTION: 272 + stmfts_report_contact_event(sdata, event); 273 + break; 274 + 275 + case STMFTS_EV_MULTI_TOUCH_LEAVE: 276 + stmfts_report_contact_release(sdata, event); 277 + break; 278 + 279 + case STMFTS_EV_HOVER_ENTER: 280 + case STMFTS_EV_HOVER_LEAVE: 281 + case STMFTS_EV_HOVER_MOTION: 282 + stmfts_report_hover_event(sdata, event); 283 + break; 284 + 285 + case STMFTS_EV_KEY_STATUS: 286 + stmfts_report_key_event(sdata, event); 287 + break; 288 + 289 + case STMFTS_EV_ERROR: 290 + dev_warn(&sdata->client->dev, 291 + "error code: 0x%x%x%x%x%x%x", 292 + event[6], event[5], event[4], 293 + event[3], event[2], event[1]); 294 + break; 295 + 296 + default: 297 + dev_err(&sdata->client->dev, 298 + "unknown event %#02x\n", event[0]); 299 + } 300 + } 301 + } 302 + 303 + static irqreturn_t stmfts_irq_handler(int irq, void *dev) 304 + { 305 + struct stmfts_data *sdata = dev; 306 + int err; 307 + 308 + mutex_lock(&sdata->mutex); 309 + 310 + err = stmfts_read_events(sdata); 311 + if (unlikely(err)) 312 + dev_err(&sdata->client->dev, 313 + "failed to read events: %d\n", err); 314 + else 315 + stmfts_parse_events(sdata); 316 + 317 + mutex_unlock(&sdata->mutex); 318 + return IRQ_HANDLED; 319 + } 320 + 321 + static int stmfts_command(struct stmfts_data *sdata, const u8 cmd) 322 + { 323 + int err; 324 + 325 + reinit_completion(&sdata->cmd_done); 326 + 327 + err = i2c_smbus_write_byte(sdata->client, cmd); 328 + if (err) 329 + return err; 330 + 331 + if (!wait_for_completion_timeout(&sdata->cmd_done, 332 + msecs_to_jiffies(1000))) 333 + return -ETIMEDOUT; 334 + 335 + return 0; 336 + } 337 + 338 + static int stmfts_input_open(struct input_dev *dev) 339 + { 340 + struct stmfts_data *sdata = input_get_drvdata(dev); 341 + int err; 342 + 343 + err = pm_runtime_get_sync(&sdata->client->dev); 344 + if (err < 0) 345 + return err; 346 + 347 + err = i2c_smbus_write_byte(sdata->client, STMFTS_MS_MT_SENSE_ON); 348 + if (err) 349 + return err; 350 + 351 + mutex_lock(&sdata->mutex); 352 + sdata->running = true; 353 + 354 + if (sdata->hover_enabled) { 355 + err = i2c_smbus_write_byte(sdata->client, 356 + STMFTS_SS_HOVER_SENSE_ON); 357 + if (err) 358 + dev_warn(&sdata->client->dev, 359 + "failed to enable hover\n"); 360 + } 361 + mutex_unlock(&sdata->mutex); 362 + 363 + if (sdata->use_key) { 364 + err = i2c_smbus_write_byte(sdata->client, 365 + STMFTS_MS_KEY_SENSE_ON); 366 + if (err) 367 + /* I can still use only the touch screen */ 368 + dev_warn(&sdata->client->dev, 369 + "failed to enable touchkey\n"); 370 + } 371 + 372 + return 0; 373 + } 374 + 375 + static void stmfts_input_close(struct input_dev *dev) 376 + { 377 + struct stmfts_data *sdata = input_get_drvdata(dev); 378 + int err; 379 + 380 + err = i2c_smbus_write_byte(sdata->client, STMFTS_MS_MT_SENSE_OFF); 381 + if (err) 382 + dev_warn(&sdata->client->dev, 383 + "failed to disable touchscreen: %d\n", err); 384 + 385 + mutex_lock(&sdata->mutex); 386 + 387 + sdata->running = false; 388 + 389 + if (sdata->hover_enabled) { 390 + err = i2c_smbus_write_byte(sdata->client, 391 + STMFTS_SS_HOVER_SENSE_OFF); 392 + if (err) 393 + dev_warn(&sdata->client->dev, 394 + "failed to disable hover: %d\n", err); 395 + } 396 + mutex_unlock(&sdata->mutex); 397 + 398 + if (sdata->use_key) { 399 + err = i2c_smbus_write_byte(sdata->client, 400 + STMFTS_MS_KEY_SENSE_OFF); 401 + if (err) 402 + dev_warn(&sdata->client->dev, 403 + "failed to disable touchkey: %d\n", err); 404 + } 405 + 406 + pm_runtime_put_sync(&sdata->client->dev); 407 + } 408 + 409 + static ssize_t stmfts_sysfs_chip_id(struct device *dev, 410 + struct device_attribute *attr, char *buf) 411 + { 412 + struct stmfts_data *sdata = dev_get_drvdata(dev); 413 + 414 + return sprintf(buf, "%#x\n", sdata->chip_id); 415 + } 416 + 417 + static ssize_t stmfts_sysfs_chip_version(struct device *dev, 418 + struct device_attribute *attr, char *buf) 419 + { 420 + struct stmfts_data *sdata = dev_get_drvdata(dev); 421 + 422 + return sprintf(buf, "%u\n", sdata->chip_ver); 423 + } 424 + 425 + static ssize_t stmfts_sysfs_fw_ver(struct device *dev, 426 + struct device_attribute *attr, char *buf) 427 + { 428 + struct stmfts_data *sdata = dev_get_drvdata(dev); 429 + 430 + return sprintf(buf, "%u\n", sdata->fw_ver); 431 + } 432 + 433 + static ssize_t stmfts_sysfs_config_id(struct device *dev, 434 + struct device_attribute *attr, char *buf) 435 + { 436 + struct stmfts_data *sdata = dev_get_drvdata(dev); 437 + 438 + return sprintf(buf, "%#x\n", sdata->config_id); 439 + } 440 + 441 + static ssize_t stmfts_sysfs_config_version(struct device *dev, 442 + struct device_attribute *attr, char *buf) 443 + { 444 + struct stmfts_data *sdata = dev_get_drvdata(dev); 445 + 446 + return sprintf(buf, "%u\n", sdata->config_ver); 447 + } 448 + 449 + static ssize_t stmfts_sysfs_read_status(struct device *dev, 450 + struct device_attribute *attr, char *buf) 451 + { 452 + struct stmfts_data *sdata = dev_get_drvdata(dev); 453 + u8 status[4]; 454 + int err; 455 + 456 + err = i2c_smbus_read_i2c_block_data(sdata->client, STMFTS_READ_STATUS, 457 + sizeof(status), status); 458 + if (err) 459 + return err; 460 + 461 + return sprintf(buf, "%#02x\n", status[0]); 462 + } 463 + 464 + static ssize_t stmfts_sysfs_hover_enable_read(struct device *dev, 465 + struct device_attribute *attr, char *buf) 466 + { 467 + struct stmfts_data *sdata = dev_get_drvdata(dev); 468 + 469 + return sprintf(buf, "%u\n", sdata->hover_enabled); 470 + } 471 + 472 + static ssize_t stmfts_sysfs_hover_enable_write(struct device *dev, 473 + struct device_attribute *attr, 474 + const char *buf, size_t len) 475 + { 476 + struct stmfts_data *sdata = dev_get_drvdata(dev); 477 + unsigned long value; 478 + int err = 0; 479 + 480 + if (kstrtoul(buf, 0, &value)) 481 + return -EINVAL; 482 + 483 + mutex_lock(&sdata->mutex); 484 + 485 + if (value & sdata->hover_enabled) 486 + goto out; 487 + 488 + if (sdata->running) 489 + err = i2c_smbus_write_byte(sdata->client, 490 + value ? STMFTS_SS_HOVER_SENSE_ON : 491 + STMFTS_SS_HOVER_SENSE_OFF); 492 + 493 + if (!err) 494 + sdata->hover_enabled = !!value; 495 + 496 + out: 497 + mutex_unlock(&sdata->mutex); 498 + 499 + return len; 500 + } 501 + 502 + static DEVICE_ATTR(chip_id, 0444, stmfts_sysfs_chip_id, NULL); 503 + static DEVICE_ATTR(chip_version, 0444, stmfts_sysfs_chip_version, NULL); 504 + static DEVICE_ATTR(fw_ver, 0444, stmfts_sysfs_fw_ver, NULL); 505 + static DEVICE_ATTR(config_id, 0444, stmfts_sysfs_config_id, NULL); 506 + static DEVICE_ATTR(config_version, 0444, stmfts_sysfs_config_version, NULL); 507 + static DEVICE_ATTR(status, 0444, stmfts_sysfs_read_status, NULL); 508 + static DEVICE_ATTR(hover_enable, 0644, stmfts_sysfs_hover_enable_read, 509 + stmfts_sysfs_hover_enable_write); 510 + 511 + static struct attribute *stmfts_sysfs_attrs[] = { 512 + &dev_attr_chip_id.attr, 513 + &dev_attr_chip_version.attr, 514 + &dev_attr_fw_ver.attr, 515 + &dev_attr_config_id.attr, 516 + &dev_attr_config_version.attr, 517 + &dev_attr_status.attr, 518 + &dev_attr_hover_enable.attr, 519 + NULL 520 + }; 521 + 522 + static struct attribute_group stmfts_attribute_group = { 523 + .attrs = stmfts_sysfs_attrs 524 + }; 525 + 526 + static int stmfts_power_on(struct stmfts_data *sdata) 527 + { 528 + int err; 529 + u8 reg[8]; 530 + 531 + err = regulator_bulk_enable(ARRAY_SIZE(sdata->regulators), 532 + sdata->regulators); 533 + if (err) 534 + return err; 535 + 536 + /* 537 + * The datasheet does not specify the power on time, but considering 538 + * that the reset time is < 10ms, I sleep 20ms to be sure 539 + */ 540 + msleep(20); 541 + 542 + err = i2c_smbus_read_i2c_block_data(sdata->client, STMFTS_READ_INFO, 543 + sizeof(reg), reg); 544 + if (err < 0) 545 + return err; 546 + if (err != sizeof(reg)) 547 + return -EIO; 548 + 549 + sdata->chip_id = be16_to_cpup((__be16 *)&reg[6]); 550 + sdata->chip_ver = reg[0]; 551 + sdata->fw_ver = be16_to_cpup((__be16 *)&reg[2]); 552 + sdata->config_id = reg[4]; 553 + sdata->config_ver = reg[5]; 554 + 555 + enable_irq(sdata->client->irq); 556 + 557 + msleep(50); 558 + 559 + err = stmfts_command(sdata, STMFTS_SYSTEM_RESET); 560 + if (err) 561 + return err; 562 + 563 + err = stmfts_command(sdata, STMFTS_SLEEP_OUT); 564 + if (err) 565 + return err; 566 + 567 + /* optional tuning */ 568 + err = stmfts_command(sdata, STMFTS_MS_CX_TUNING); 569 + if (err) 570 + dev_warn(&sdata->client->dev, 571 + "failed to perform mutual auto tune: %d\n", err); 572 + 573 + /* optional tuning */ 574 + err = stmfts_command(sdata, STMFTS_SS_CX_TUNING); 575 + if (err) 576 + dev_warn(&sdata->client->dev, 577 + "failed to perform self auto tune: %d\n", err); 578 + 579 + err = stmfts_command(sdata, STMFTS_FULL_FORCE_CALIBRATION); 580 + if (err) 581 + return err; 582 + 583 + /* 584 + * At this point no one is using the touchscreen 585 + * and I don't really care about the return value 586 + */ 587 + (void) i2c_smbus_write_byte(sdata->client, STMFTS_SLEEP_IN); 588 + 589 + return 0; 590 + } 591 + 592 + static void stmfts_power_off(void *data) 593 + { 594 + struct stmfts_data *sdata = data; 595 + 596 + disable_irq(sdata->client->irq); 597 + regulator_bulk_disable(ARRAY_SIZE(sdata->regulators), 598 + sdata->regulators); 599 + } 600 + 601 + /* This function is void because I don't want to prevent using the touch key 602 + * only because the LEDs don't get registered 603 + */ 604 + static int stmfts_enable_led(struct stmfts_data *sdata) 605 + { 606 + int err; 607 + 608 + /* get the regulator for powering the leds on */ 609 + sdata->ledvdd = devm_regulator_get(&sdata->client->dev, "ledvdd"); 610 + if (IS_ERR(sdata->ledvdd)) 611 + return PTR_ERR(sdata->ledvdd); 612 + 613 + sdata->led_cdev.name = STMFTS_DEV_NAME; 614 + sdata->led_cdev.max_brightness = LED_ON; 615 + sdata->led_cdev.brightness = LED_OFF; 616 + sdata->led_cdev.brightness_set = stmfts_brightness_set; 617 + sdata->led_cdev.brightness_get = stmfts_brightness_get; 618 + 619 + err = devm_led_classdev_register(&sdata->client->dev, &sdata->led_cdev); 620 + if (err) { 621 + devm_regulator_put(sdata->ledvdd); 622 + return err; 623 + } 624 + 625 + return 0; 626 + } 627 + 628 + static int stmfts_probe(struct i2c_client *client, 629 + const struct i2c_device_id *id) 630 + { 631 + int err; 632 + struct stmfts_data *sdata; 633 + 634 + if (!i2c_check_functionality(client->adapter, I2C_FUNC_I2C | 635 + I2C_FUNC_SMBUS_BYTE_DATA | 636 + I2C_FUNC_SMBUS_I2C_BLOCK)) 637 + return -ENODEV; 638 + 639 + sdata = devm_kzalloc(&client->dev, sizeof(*sdata), GFP_KERNEL); 640 + if (!sdata) 641 + return -ENOMEM; 642 + 643 + i2c_set_clientdata(client, sdata); 644 + 645 + sdata->client = client; 646 + mutex_init(&sdata->mutex); 647 + init_completion(&sdata->cmd_done); 648 + 649 + sdata->regulators[STMFTS_REGULATOR_VDD].supply = "vdd"; 650 + sdata->regulators[STMFTS_REGULATOR_AVDD].supply = "avdd"; 651 + err = devm_regulator_bulk_get(&client->dev, 652 + ARRAY_SIZE(sdata->regulators), 653 + sdata->regulators); 654 + if (err) 655 + return err; 656 + 657 + sdata->input = devm_input_allocate_device(&client->dev); 658 + if (!sdata->input) 659 + return -ENOMEM; 660 + 661 + sdata->input->name = STMFTS_DEV_NAME; 662 + sdata->input->id.bustype = BUS_I2C; 663 + sdata->input->open = stmfts_input_open; 664 + sdata->input->close = stmfts_input_close; 665 + 666 + touchscreen_parse_properties(sdata->input, true, &sdata->prop); 667 + 668 + input_set_abs_params(sdata->input, ABS_MT_POSITION_X, 0, 669 + sdata->prop.max_x, 0, 0); 670 + input_set_abs_params(sdata->input, ABS_MT_POSITION_Y, 0, 671 + sdata->prop.max_y, 0, 0); 672 + input_set_abs_params(sdata->input, ABS_MT_TOUCH_MAJOR, 0, 255, 0, 0); 673 + input_set_abs_params(sdata->input, ABS_MT_TOUCH_MINOR, 0, 255, 0, 0); 674 + input_set_abs_params(sdata->input, ABS_MT_ORIENTATION, 0, 255, 0, 0); 675 + input_set_abs_params(sdata->input, ABS_MT_PRESSURE, 0, 255, 0, 0); 676 + input_set_abs_params(sdata->input, ABS_DISTANCE, 0, 255, 0, 0); 677 + 678 + sdata->use_key = device_property_read_bool(&client->dev, 679 + "touch-key-connected"); 680 + if (sdata->use_key) { 681 + input_set_capability(sdata->input, EV_KEY, KEY_MENU); 682 + input_set_capability(sdata->input, EV_KEY, KEY_BACK); 683 + } 684 + 685 + err = input_mt_init_slots(sdata->input, 686 + STMFTS_MAX_FINGERS, INPUT_MT_DIRECT); 687 + if (err) 688 + return err; 689 + 690 + input_set_drvdata(sdata->input, sdata); 691 + 692 + err = devm_request_threaded_irq(&client->dev, client->irq, 693 + NULL, stmfts_irq_handler, 694 + IRQF_ONESHOT, 695 + "stmfts_irq", sdata); 696 + if (err) 697 + return err; 698 + 699 + /* stmfts_power_on expects interrupt to be disabled */ 700 + disable_irq(client->irq); 701 + 702 + dev_dbg(&client->dev, "initializing ST-Microelectronics FTS...\n"); 703 + 704 + err = stmfts_power_on(sdata); 705 + if (err) 706 + return err; 707 + 708 + err = devm_add_action_or_reset(&client->dev, stmfts_power_off, sdata); 709 + if (err) 710 + return err; 711 + 712 + err = input_register_device(sdata->input); 713 + if (err) 714 + return err; 715 + 716 + if (sdata->use_key) { 717 + err = stmfts_enable_led(sdata); 718 + if (err) { 719 + /* 720 + * Even if the LEDs have failed to be initialized and 721 + * used in the driver, I can still use the device even 722 + * without LEDs. The ledvdd regulator pointer will be 723 + * used as a flag. 724 + */ 725 + dev_warn(&client->dev, "unable to use touchkey leds\n"); 726 + sdata->ledvdd = NULL; 727 + } 728 + } 729 + 730 + err = sysfs_create_group(&sdata->client->dev.kobj, 731 + &stmfts_attribute_group); 732 + if (err) 733 + return err; 734 + 735 + pm_runtime_enable(&client->dev); 736 + 737 + return 0; 738 + } 739 + 740 + static int stmfts_remove(struct i2c_client *client) 741 + { 742 + pm_runtime_disable(&client->dev); 743 + sysfs_remove_group(&client->dev.kobj, &stmfts_attribute_group); 744 + 745 + return 0; 746 + } 747 + 748 + static int __maybe_unused stmfts_runtime_suspend(struct device *dev) 749 + { 750 + struct stmfts_data *sdata = dev_get_drvdata(dev); 751 + int ret; 752 + 753 + ret = i2c_smbus_write_byte(sdata->client, STMFTS_SLEEP_IN); 754 + if (ret) 755 + dev_warn(dev, "failed to suspend device: %d\n", ret); 756 + 757 + return ret; 758 + } 759 + 760 + static int __maybe_unused stmfts_runtime_resume(struct device *dev) 761 + { 762 + struct stmfts_data *sdata = dev_get_drvdata(dev); 763 + int ret; 764 + 765 + ret = i2c_smbus_write_byte(sdata->client, STMFTS_SLEEP_OUT); 766 + if (ret) 767 + dev_err(dev, "failed to resume device: %d\n", ret); 768 + 769 + return ret; 770 + } 771 + 772 + static int __maybe_unused stmfts_suspend(struct device *dev) 773 + { 774 + struct stmfts_data *sdata = dev_get_drvdata(dev); 775 + 776 + stmfts_power_off(sdata); 777 + 778 + return 0; 779 + } 780 + 781 + static int __maybe_unused stmfts_resume(struct device *dev) 782 + { 783 + struct stmfts_data *sdata = dev_get_drvdata(dev); 784 + 785 + return stmfts_power_on(sdata); 786 + } 787 + 788 + static const struct dev_pm_ops stmfts_pm_ops = { 789 + SET_SYSTEM_SLEEP_PM_OPS(stmfts_suspend, stmfts_resume) 790 + SET_RUNTIME_PM_OPS(stmfts_runtime_suspend, stmfts_runtime_resume, NULL) 791 + }; 792 + 793 + #ifdef CONFIG_OF 794 + static const struct of_device_id stmfts_of_match[] = { 795 + { .compatible = "st,stmfts", }, 796 + { }, 797 + }; 798 + MODULE_DEVICE_TABLE(of, stmfts_of_match); 799 + #endif 800 + 801 + static const struct i2c_device_id stmfts_id[] = { 802 + { "stmfts", 0 }, 803 + { }, 804 + }; 805 + MODULE_DEVICE_TABLE(i2c, stmfts_id); 806 + 807 + static struct i2c_driver stmfts_driver = { 808 + .driver = { 809 + .name = STMFTS_DEV_NAME, 810 + .of_match_table = of_match_ptr(stmfts_of_match), 811 + .pm = &stmfts_pm_ops, 812 + }, 813 + .probe = stmfts_probe, 814 + .remove = stmfts_remove, 815 + .id_table = stmfts_id, 816 + }; 817 + 818 + module_i2c_driver(stmfts_driver); 819 + 820 + MODULE_AUTHOR("Andi Shyti <andi.shyti@samsung.com>"); 821 + MODULE_DESCRIPTION("STMicroelectronics FTS Touch Screen"); 822 + MODULE_LICENSE("GPL v2");
+1 -1
drivers/input/touchscreen/tsc2007_core.c
··· 25 25 #include <linux/input.h> 26 26 #include <linux/interrupt.h> 27 27 #include <linux/i2c.h> 28 - #include <linux/i2c/tsc2007.h> 29 28 #include <linux/of_device.h> 30 29 #include <linux/of_gpio.h> 30 + #include <linux/platform_data/tsc2007.h> 31 31 #include "tsc2007.h" 32 32 33 33 int tsc2007_xfer(struct tsc2007 *tsc, u8 cmd)
+1 -1
drivers/mfd/timberdale.c
··· 32 32 #include <linux/i2c.h> 33 33 #include <linux/i2c-ocores.h> 34 34 #include <linux/i2c-xiic.h> 35 - #include <linux/i2c/tsc2007.h> 36 35 37 36 #include <linux/spi/spi.h> 38 37 #include <linux/spi/xilinx_spi.h> 39 38 #include <linux/spi/max7301.h> 40 39 #include <linux/spi/mc33880.h> 41 40 41 + #include <linux/platform_data/tsc2007.h> 42 42 #include <linux/platform_data/media/timb_radio.h> 43 43 #include <linux/platform_data/media/timb_video.h> 44 44
include/linux/i2c/lm8323.h include/linux/platform_data/lm8323.h
include/linux/i2c/mcs.h include/linux/platform_data/mcs.h
include/linux/i2c/mms114.h include/linux/platform_data/mms114.h
+1 -1
include/linux/i2c/tsc2007.h include/linux/platform_data/tsc2007.h
··· 1 1 #ifndef __LINUX_I2C_TSC2007_H 2 2 #define __LINUX_I2C_TSC2007_H 3 3 4 - /* linux/i2c/tsc2007.h */ 4 + /* linux/platform_data/tsc2007.h */ 5 5 6 6 struct tsc2007_platform_data { 7 7 u16 model; /* 2007. */
-1
include/linux/input/sparse-keymap.h
··· 51 51 int sparse_keymap_setup(struct input_dev *dev, 52 52 const struct key_entry *keymap, 53 53 int (*setup)(struct input_dev *, struct key_entry *)); 54 - void sparse_keymap_free(struct input_dev *dev); 55 54 56 55 void sparse_keymap_report_entry(struct input_dev *dev, const struct key_entry *ke, 57 56 unsigned int value, bool autorelease);
+1
include/uapi/linux/input-event-codes.h
··· 600 600 #define KEY_APPSELECT 0x244 /* AL Select Task/Application */ 601 601 #define KEY_SCREENSAVER 0x245 /* AL Screen Saver */ 602 602 #define KEY_VOICECOMMAND 0x246 /* Listening Voice Command */ 603 + #define KEY_ASSISTANT 0x247 /* AL Context-aware desktop assistant */ 603 604 604 605 #define KEY_BRIGHTNESS_MIN 0x250 /* Set Brightness to Minimum */ 605 606 #define KEY_BRIGHTNESS_MAX 0x251 /* Set Brightness to Maximum */