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

Merge tag 'input-for-v6.8-rc0' of git://git.kernel.org/pub/scm/linux/kernel/git/dtor/input

Pull input updates from Dmitry Torokhov:

- a new driver for Adafruit Seesaw gamepad device

- Zforce touchscreen will handle standard device properties for axis
swap/inversion

- handling of advanced sensitivity settings in Microchip CAP11xx
capacitive sensor driver

- more drivers have been converted to use newer gpiod API

- support for dedicated wakeup IRQs in gpio-keys dirver

- support for slider gestures and OTP variants in iqs269a driver

- atkbd will report keyboard version as 0xab83 in cases when GET ID
command was skipped (to deal with problematic firmware on newer
laptops), restoring the previous behavior

- other assorted cleanups and changes

* tag 'input-for-v6.8-rc0' of git://git.kernel.org/pub/scm/linux/kernel/git/dtor/input: (44 commits)
Input: atkbd - use ab83 as id when skipping the getid command
Input: driver for Adafruit Seesaw Gamepad
dt-bindings: input: bindings for Adafruit Seesaw Gamepad
Input: da9063_onkey - avoid explicitly setting input's parent
Input: da9063_onkey - avoid using OF-specific APIs
Input: iqs269a - add support for OTP variants
dt-bindings: input: iqs269a: Add bindings for OTP variants
Input: iqs269a - add support for slider gestures
dt-bindings: input: iqs269a: Add bindings for slider gestures
Input: gpio-keys - filter gpio_keys -EPROBE_DEFER error messages
Input: zforce_ts - accept standard touchscreen properties
dt-bindings: touchscreen: neonode,zforce: Use standard properties
dt-bindings: touchscreen: convert neonode,zforce to json-schema
dt-bindings: input: convert drv266x to json-schema
Input: da9063 - use dev_err_probe()
Input: da9063 - drop redundant prints in probe()
Input: da9063 - simplify obtaining OF match data
Input: as5011 - convert to GPIO descriptor
Input: omap-keypad - drop optional GPIO support
Input: tca6416-keypad - drop unused include
...

+1634 -551
+63
Documentation/devicetree/bindings/input/adafruit,seesaw-gamepad.yaml
··· 1 + # SPDX-License-Identifier: (GPL-2.0-only OR BSD-2-Clause) 2 + %YAML 1.2 3 + --- 4 + $id: http://devicetree.org/schemas/input/adafruit,seesaw-gamepad.yaml# 5 + $schema: http://devicetree.org/meta-schemas/core.yaml# 6 + 7 + title: Adafruit Mini I2C Gamepad with seesaw 8 + 9 + maintainers: 10 + - Anshul Dalal <anshulusr@gmail.com> 11 + 12 + description: | 13 + Adafruit Mini I2C Gamepad 14 + 15 + +-----------------------------+ 16 + | ___ | 17 + | / \ (X) | 18 + | | S | __ __ (Y) (A) | 19 + | \___/ |ST| |SE| (B) | 20 + | | 21 + +-----------------------------+ 22 + 23 + S -> 10-bit precision bidirectional analog joystick 24 + ST -> Start 25 + SE -> Select 26 + X, A, B, Y -> Digital action buttons 27 + 28 + Datasheet: https://cdn-learn.adafruit.com/downloads/pdf/gamepad-qt.pdf 29 + Product page: https://www.adafruit.com/product/5743 30 + Arduino Driver: https://github.com/adafruit/Adafruit_Seesaw 31 + 32 + properties: 33 + compatible: 34 + const: adafruit,seesaw-gamepad 35 + 36 + reg: 37 + maxItems: 1 38 + 39 + interrupts: 40 + maxItems: 1 41 + description: 42 + The gamepad's IRQ pin triggers a rising edge if interrupts are enabled. 43 + 44 + required: 45 + - compatible 46 + - reg 47 + 48 + additionalProperties: false 49 + 50 + examples: 51 + - | 52 + #include <dt-bindings/interrupt-controller/irq.h> 53 + 54 + i2c { 55 + #address-cells = <1>; 56 + #size-cells = <0>; 57 + 58 + joystick@50 { 59 + compatible = "adafruit,seesaw-gamepad"; 60 + interrupts = <18 IRQ_TYPE_EDGE_RISING>; 61 + reg = <0x50>; 62 + }; 63 + };
+40 -1
Documentation/devicetree/bindings/input/gpio-keys.yaml
··· 31 31 maxItems: 1 32 32 33 33 interrupts: 34 - maxItems: 1 34 + oneOf: 35 + - items: 36 + - description: Optional key interrupt or wakeup interrupt 37 + - items: 38 + - description: Key interrupt 39 + - description: Wakeup interrupt 40 + 41 + interrupt-names: 42 + description: 43 + Optional interrupt names, can be used to specify a separate dedicated 44 + wake-up interrupt in addition to the gpio irq 45 + oneOf: 46 + - items: 47 + - enum: [ irq, wakeup ] 48 + - items: 49 + - const: irq 50 + - const: wakeup 35 51 36 52 label: 37 53 description: Descriptive name of the key. ··· 113 97 - required: 114 98 - gpios 115 99 100 + allOf: 101 + - if: 102 + properties: 103 + interrupts: 104 + minItems: 2 105 + required: 106 + - interrupts 107 + then: 108 + properties: 109 + interrupt-names: 110 + minItems: 2 111 + required: 112 + - interrupt-names 113 + 116 114 dependencies: 117 115 wakeup-event-action: [ wakeup-source ] 118 116 linux,input-value: [ gpios ] ··· 166 136 label = "GPIO Key DOWN"; 167 137 linux,code = <108>; 168 138 interrupts = <1 IRQ_TYPE_EDGE_FALLING>; 139 + }; 140 + 141 + key-wakeup { 142 + label = "GPIO Key WAKEUP"; 143 + linux,code = <143>; 144 + interrupts-extended = <&intc 2 IRQ_TYPE_EDGE_FALLING>, 145 + <&intc_wakeup 0 IRQ_TYPE_LEVEL_HIGH>; 146 + interrupt-names = "irq", "wakeup"; 147 + wakeup-source; 169 148 }; 170 149 }; 171 150
-32
Documentation/devicetree/bindings/input/gpio-mouse.txt
··· 1 - Device-Tree bindings for GPIO attached mice 2 - 3 - This simply uses standard GPIO handles to define a simple mouse connected 4 - to 5-7 GPIO lines. 5 - 6 - Required properties: 7 - - compatible: must be "gpio-mouse" 8 - - scan-interval-ms: The scanning interval in milliseconds 9 - - up-gpios: GPIO line phandle to the line indicating "up" 10 - - down-gpios: GPIO line phandle to the line indicating "down" 11 - - left-gpios: GPIO line phandle to the line indicating "left" 12 - - right-gpios: GPIO line phandle to the line indicating "right" 13 - 14 - Optional properties: 15 - - button-left-gpios: GPIO line handle to the left mouse button 16 - - button-middle-gpios: GPIO line handle to the middle mouse button 17 - - button-right-gpios: GPIO line handle to the right mouse button 18 - Example: 19 - 20 - #include <dt-bindings/gpio/gpio.h> 21 - 22 - gpio-mouse { 23 - compatible = "gpio-mouse"; 24 - scan-interval-ms = <50>; 25 - up-gpios = <&gpio0 0 GPIO_ACTIVE_LOW>; 26 - down-gpios = <&gpio0 1 GPIO_ACTIVE_LOW>; 27 - left-gpios = <&gpio0 2 GPIO_ACTIVE_LOW>; 28 - right-gpios = <&gpio0 3 GPIO_ACTIVE_LOW>; 29 - button-left-gpios = <&gpio0 4 GPIO_ACTIVE_LOW>; 30 - button-middle-gpios = <&gpio0 5 GPIO_ACTIVE_LOW>; 31 - button-right-gpios = <&gpio0 6 GPIO_ACTIVE_LOW>; 32 - };
+68
Documentation/devicetree/bindings/input/gpio-mouse.yaml
··· 1 + # SPDX-License-Identifier: (GPL-2.0-only OR BSD-2-Clause) 2 + %YAML 1.2 3 + --- 4 + $id: http://devicetree.org/schemas/input/gpio-mouse.yaml# 5 + $schema: http://devicetree.org/meta-schemas/core.yaml# 6 + 7 + title: GPIO attached mouse 8 + 9 + description: | 10 + This simply uses standard GPIO handles to define a simple mouse connected 11 + to 5-7 GPIO lines. 12 + 13 + maintainers: 14 + - Anshul Dalal <anshulusr@gmail.com> 15 + 16 + properties: 17 + compatible: 18 + const: gpio-mouse 19 + 20 + scan-interval-ms: 21 + maxItems: 1 22 + 23 + up-gpios: 24 + maxItems: 1 25 + 26 + down-gpios: 27 + maxItems: 1 28 + 29 + left-gpios: 30 + maxItems: 1 31 + 32 + right-gpios: 33 + maxItems: 1 34 + 35 + button-left-gpios: 36 + maxItems: 1 37 + 38 + button-middle-gpios: 39 + maxItems: 1 40 + 41 + button-right-gpios: 42 + maxItems: 1 43 + 44 + required: 45 + - compatible 46 + - scan-interval-ms 47 + - up-gpios 48 + - down-gpios 49 + - left-gpios 50 + - right-gpios 51 + 52 + additionalProperties: false 53 + 54 + examples: 55 + - | 56 + #include <dt-bindings/gpio/gpio.h> 57 + 58 + gpio-mouse { 59 + compatible = "gpio-mouse"; 60 + scan-interval-ms = <50>; 61 + up-gpios = <&gpio0 0 GPIO_ACTIVE_LOW>; 62 + down-gpios = <&gpio0 1 GPIO_ACTIVE_LOW>; 63 + left-gpios = <&gpio0 2 GPIO_ACTIVE_LOW>; 64 + right-gpios = <&gpio0 3 GPIO_ACTIVE_LOW>; 65 + button-left-gpios = <&gpio0 4 GPIO_ACTIVE_LOW>; 66 + button-middle-gpios = <&gpio0 5 GPIO_ACTIVE_LOW>; 67 + button-right-gpios = <&gpio0 6 GPIO_ACTIVE_LOW>; 68 + };
+97 -1
Documentation/devicetree/bindings/input/iqs269a.yaml
··· 9 9 maintainers: 10 10 - Jeff LaBundy <jeff@labundy.com> 11 11 12 + allOf: 13 + - $ref: input.yaml# 14 + 12 15 description: | 13 16 The Azoteq IQS269A is an 8-channel capacitive touch controller that features 14 17 additional Hall-effect and inductive sensing capabilities. ··· 20 17 21 18 properties: 22 19 compatible: 23 - const: azoteq,iqs269a 20 + enum: 21 + - azoteq,iqs269a 22 + - azoteq,iqs269a-00 23 + - azoteq,iqs269a-d0 24 24 25 25 reg: 26 26 maxItems: 1 ··· 209 203 enum: [0, 1, 2, 3] 210 204 default: 1 211 205 description: Specifies the slider coordinate filter strength. 206 + 207 + azoteq,touch-hold-ms: 208 + multipleOf: 256 209 + minimum: 256 210 + maximum: 65280 211 + default: 5120 212 + description: 213 + Specifies the length of time (in ms) for which the channel selected by 214 + 'azoteq,gpio3-select' must be held in a state of touch in order for an 215 + approximately 60-ms pulse to be asserted on the GPIO4 pin. 216 + 217 + linux,keycodes: 218 + minItems: 1 219 + maxItems: 8 220 + description: | 221 + Specifies the numeric keycodes associated with each available gesture in 222 + the following order (enter 0 for unused gestures): 223 + 0: Slider 0 tap 224 + 1: Slider 0 hold 225 + 2: Slider 0 positive flick or swipe 226 + 3: Slider 0 negative flick or swipe 227 + 4: Slider 1 tap 228 + 5: Slider 1 hold 229 + 6: Slider 1 positive flick or swipe 230 + 7: Slider 1 negative flick or swipe 231 + 232 + azoteq,gesture-swipe: 233 + type: boolean 234 + description: 235 + Directs the device to interpret axial gestures as a swipe (finger remains 236 + on slider) instead of a flick (finger leaves slider). 237 + 238 + azoteq,timeout-tap-ms: 239 + multipleOf: 16 240 + minimum: 0 241 + maximum: 4080 242 + default: 400 243 + description: 244 + Specifies the length of time (in ms) within which a slider touch must be 245 + released in order to be interpreted as a tap. Default and maximum values 246 + as well as step size are reduced by a factor of 4 with device version 2. 247 + 248 + azoteq,timeout-swipe-ms: 249 + multipleOf: 16 250 + minimum: 0 251 + maximum: 4080 252 + default: 2000 253 + description: 254 + Specifies the length of time (in ms) within which an axial gesture must be 255 + completed in order to be interpreted as a flick or swipe. Default and max- 256 + imum values as well as step size are reduced by a factor of 4 with device 257 + version 2. 258 + 259 + azoteq,thresh-swipe: 260 + $ref: /schemas/types.yaml#/definitions/uint32 261 + minimum: 0 262 + maximum: 255 263 + default: 128 264 + description: 265 + Specifies the number of points across which an axial gesture must travel 266 + in order to be interpreted as a flick or swipe. 267 + 268 + dependencies: 269 + azoteq,gesture-swipe: ["linux,keycodes"] 270 + azoteq,timeout-tap-ms: ["linux,keycodes"] 271 + azoteq,timeout-swipe-ms: ["linux,keycodes"] 272 + azoteq,thresh-swipe: ["linux,keycodes"] 212 273 213 274 patternProperties: 214 275 "^channel@[0-7]$": ··· 527 454 528 455 additionalProperties: false 529 456 457 + if: 458 + properties: 459 + compatible: 460 + contains: 461 + enum: 462 + - azoteq,iqs269a-d0 463 + then: 464 + patternProperties: 465 + "^channel@[0-7]$": 466 + properties: 467 + azoteq,slider1-select: false 468 + else: 469 + properties: 470 + azoteq,touch-hold-ms: false 471 + 530 472 required: 531 473 - compatible 532 474 - reg ··· 571 483 572 484 azoteq,hall-enable; 573 485 azoteq,suspend-mode = <2>; 486 + 487 + linux,keycodes = <KEY_PLAYPAUSE>, 488 + <KEY_STOPCD>, 489 + <KEY_NEXTSONG>, 490 + <KEY_PREVIOUSSONG>; 491 + 492 + azoteq,timeout-tap-ms = <400>; 493 + azoteq,timeout-swipe-ms = <800>; 574 494 575 495 channel@0 { 576 496 reg = <0x0>;
+1 -23
Documentation/devicetree/bindings/input/mediatek,pmic-keys.yaml
··· 90 90 91 91 unevaluatedProperties: false 92 92 93 - examples: 94 - - | 95 - #include <dt-bindings/input/input.h> 96 - #include <dt-bindings/interrupt-controller/arm-gic.h> 97 - 98 - pmic { 99 - compatible = "mediatek,mt6397"; 100 - 101 - keys { 102 - compatible = "mediatek,mt6397-keys"; 103 - mediatek,long-press-mode = <1>; 104 - power-off-time-sec = <0>; 105 - 106 - key-power { 107 - linux,keycodes = <KEY_POWER>; 108 - wakeup-source; 109 - }; 110 - 111 - key-home { 112 - linux,keycodes = <KEY_VOLUMEDOWN>; 113 - }; 114 - }; 115 - }; 93 + ...
+77 -3
Documentation/devicetree/bindings/input/microchip,cap11xx.yaml
··· 45 45 Enables the Linux input system's autorepeat feature on the input device. 46 46 47 47 linux,keycodes: 48 - minItems: 6 49 - maxItems: 6 48 + minItems: 3 49 + maxItems: 8 50 50 description: | 51 51 Specifies an array of numeric keycode values to 52 52 be used for the channels. If this property is 53 53 omitted, KEY_A, KEY_B, etc are used as defaults. 54 - The array must have exactly six entries. 54 + The number of entries must correspond to the number of channels. 55 55 56 56 microchip,sensor-gain: 57 57 $ref: /schemas/types.yaml#/definitions/uint32 ··· 69 69 By default the interrupt pin is active low 70 70 open drain. This property allows using the active 71 71 high push-pull output. 72 + 73 + microchip,sensitivity-delta-sense: 74 + $ref: /schemas/types.yaml#/definitions/uint32 75 + default: 32 76 + enum: [1, 2, 4, 8, 16, 32, 64, 128] 77 + description: 78 + Controls the sensitivity multiplier of a touch detection. 79 + Higher value means more sensitive settings. 80 + At the more sensitive settings, touches are detected for a smaller delta 81 + capacitance corresponding to a "lighter" touch. 82 + 83 + microchip,signal-guard: 84 + $ref: /schemas/types.yaml#/definitions/uint32-array 85 + minItems: 3 86 + maxItems: 8 87 + items: 88 + enum: [0, 1] 89 + description: | 90 + 0 - off 91 + 1 - on 92 + The signal guard isolates the signal from virtual grounds. 93 + If enabled then the behavior of the channel is changed to signal guard. 94 + The number of entries must correspond to the number of channels. 95 + 96 + microchip,input-threshold: 97 + $ref: /schemas/types.yaml#/definitions/uint32-array 98 + minItems: 3 99 + maxItems: 8 100 + items: 101 + minimum: 0 102 + maximum: 127 103 + description: 104 + Specifies the delta threshold that is used to determine if a touch has 105 + been detected. A higher value means a larger difference in capacitance 106 + is required for a touch to be registered, making the touch sensor less 107 + sensitive. 108 + The number of entries must correspond to the number of channels. 109 + 110 + microchip,calib-sensitivity: 111 + $ref: /schemas/types.yaml#/definitions/uint32-array 112 + minItems: 3 113 + maxItems: 8 114 + items: 115 + enum: [1, 2, 4] 116 + description: | 117 + Specifies an array of numeric values that controls the gain 118 + used by the calibration routine to enable sensor inputs 119 + to be more sensitive for proximity detection. 120 + Gain is based on touch pad capacitance range 121 + 1 - 5-50pF 122 + 2 - 0-25pF 123 + 4 - 0-12.5pF 124 + The number of entries must correspond to the number of channels. 72 125 73 126 patternProperties: 74 127 "^led@[0-7]$": ··· 152 99 contains: 153 100 enum: 154 101 - microchip,cap1106 102 + - microchip,cap1203 103 + - microchip,cap1206 104 + - microchip,cap1293 105 + - microchip,cap1298 155 106 then: 156 107 patternProperties: 157 108 "^led@[0-7]$": false 109 + 110 + - if: 111 + properties: 112 + compatible: 113 + contains: 114 + enum: 115 + - microchip,cap1106 116 + - microchip,cap1126 117 + - microchip,cap1188 118 + - microchip,cap1203 119 + - microchip,cap1206 120 + then: 121 + properties: 122 + microchip,signal-guard: false 123 + microchip,calib-sensitivity: false 158 124 159 125 required: 160 126 - compatible ··· 194 122 reg = <0x28>; 195 123 autorepeat; 196 124 microchip,sensor-gain = <2>; 125 + microchip,sensitivity-delta-sense = <16>; 126 + microchip,input-threshold = <21>, <18>, <46>, <46>, <46>, <21>; 197 127 198 128 linux,keycodes = <103>, /* KEY_UP */ 199 129 <106>, /* KEY_RIGHT */
+1 -18
Documentation/devicetree/bindings/input/sprd,sc27xx-vibrator.yaml
··· 28 28 29 29 additionalProperties: false 30 30 31 - examples: 32 - - | 33 - #include <dt-bindings/interrupt-controller/arm-gic.h> 34 - sc2731_pmic: pmic@0 { 35 - compatible = "sprd,sc2731"; 36 - reg = <0 0>; 37 - spi-max-frequency = <26000000>; 38 - interrupts = <GIC_SPI 31 IRQ_TYPE_LEVEL_HIGH>; 39 - interrupt-controller; 40 - #interrupt-cells = <2>; 41 - #address-cells = <1>; 42 - #size-cells = <0>; 43 - 44 - vibrator@eb4 { 45 - compatible = "sprd,sc2731-vibrator"; 46 - reg = <0xeb4>; 47 - }; 48 - }; 31 + ...
-17
Documentation/devicetree/bindings/input/ti,drv2665.txt
··· 1 - * Texas Instruments - drv2665 Haptics driver 2 - 3 - Required properties: 4 - - compatible - "ti,drv2665" - DRV2665 5 - - reg - I2C slave address 6 - - vbat-supply - Required supply regulator 7 - 8 - Example: 9 - 10 - haptics: haptics@59 { 11 - compatible = "ti,drv2665"; 12 - reg = <0x59>; 13 - vbat-supply = <&vbat>; 14 - }; 15 - 16 - For more product information please see the link below: 17 - http://www.ti.com/product/drv2665
-17
Documentation/devicetree/bindings/input/ti,drv2667.txt
··· 1 - * Texas Instruments - drv2667 Haptics driver 2 - 3 - Required properties: 4 - - compatible - "ti,drv2667" - DRV2667 5 - - reg - I2C slave address 6 - - vbat-supply - Required supply regulator 7 - 8 - Example: 9 - 10 - haptics: haptics@59 { 11 - compatible = "ti,drv2667"; 12 - reg = <0x59>; 13 - vbat-supply = <&vbat>; 14 - }; 15 - 16 - For more product information please see the link below: 17 - http://www.ti.com/product/drv2667
+50
Documentation/devicetree/bindings/input/ti,drv266x.yaml
··· 1 + # SPDX-License-Identifier: (GPL-2.0-only OR BSD-2-Clause) 2 + %YAML 1.2 3 + --- 4 + $id: http://devicetree.org/schemas/input/ti,drv266x.yaml# 5 + $schema: http://devicetree.org/meta-schemas/core.yaml# 6 + 7 + title: Texas Instruments - drv266x Haptics driver 8 + 9 + description: | 10 + Product Page: 11 + http://www.ti.com/product/drv2665 12 + http://www.ti.com/product/drv2667 13 + 14 + maintainers: 15 + - Anshul Dalal <anshulusr@gmail.com> 16 + 17 + properties: 18 + compatible: 19 + enum: 20 + - ti,drv2665 21 + - ti,drv2667 22 + 23 + reg: 24 + maxItems: 1 25 + 26 + vbat-supply: 27 + description: Required supply regulator 28 + 29 + required: 30 + - compatible 31 + - reg 32 + - vbat-supply 33 + 34 + additionalProperties: false 35 + 36 + examples: 37 + - | 38 + #include <dt-bindings/gpio/gpio.h> 39 + 40 + 41 + i2c { 42 + #address-cells = <1>; 43 + #size-cells = <0>; 44 + 45 + haptics@59 { 46 + compatible = "ti,drv2667"; 47 + reg = <0x59>; 48 + vbat-supply = <&vbat>; 49 + }; 50 + };
+72
Documentation/devicetree/bindings/input/touchscreen/neonode,zforce.yaml
··· 1 + # SPDX-License-Identifier: GPL-2.0-only OR BSD-2-Clause 2 + %YAML 1.2 3 + --- 4 + $id: http://devicetree.org/schemas/input/touchscreen/neonode,zforce.yaml# 5 + $schema: http://devicetree.org/meta-schemas/core.yaml# 6 + 7 + title: Neonode infrared touchscreen controller 8 + 9 + maintainers: 10 + - Heiko Stuebner <heiko@sntech.de> 11 + 12 + allOf: 13 + - $ref: touchscreen.yaml# 14 + 15 + properties: 16 + compatible: 17 + const: neonode,zforce 18 + 19 + reg: 20 + maxItems: 1 21 + 22 + interrupts: 23 + maxItems: 1 24 + 25 + reset-gpios: 26 + maxItems: 1 27 + 28 + irq-gpios: 29 + maxItems: 1 30 + 31 + x-size: 32 + deprecated: true 33 + $ref: /schemas/types.yaml#/definitions/uint32 34 + 35 + y-size: 36 + deprecated: true 37 + $ref: /schemas/types.yaml#/definitions/uint32 38 + 39 + vdd-supply: true 40 + 41 + required: 42 + - compatible 43 + - reg 44 + - interrupts 45 + - reset-gpios 46 + 47 + unevaluatedProperties: false 48 + 49 + examples: 50 + - | 51 + #include <dt-bindings/interrupt-controller/irq.h> 52 + 53 + i2c { 54 + #address-cells = <1>; 55 + #size-cells = <0>; 56 + 57 + touchscreen@50 { 58 + compatible = "neonode,zforce"; 59 + reg = <0x50>; 60 + interrupts = <2 0>; 61 + vdd-supply = <&reg_zforce_vdd>; 62 + 63 + reset-gpios = <&gpio5 9 0>; /* RST */ 64 + irq-gpios = <&gpio5 6 0>; /* IRQ, optional */ 65 + 66 + touchscreen-min-x = <0>; 67 + touchscreen-size-x = <800>; 68 + touchscreen-min-y = <0>; 69 + touchscreen-size-y = <600>; 70 + }; 71 + }; 72 + ...
-32
Documentation/devicetree/bindings/input/touchscreen/samsung,s6sy761.txt
··· 1 - * Samsung S6SY761 touchscreen controller 2 - 3 - Required properties: 4 - - compatible : must be "samsung,s6sy761" 5 - - reg : I2C slave address, (e.g. 0x48) 6 - - interrupts : interrupt specification 7 - - avdd-supply : analogic power supply 8 - - vdd-supply : power supply 9 - 10 - Optional properties: 11 - - touchscreen-size-x : see touchscreen.txt. This property is embedded in the 12 - device. If defined it forces a different x resolution. 13 - - touchscreen-size-y : see touchscreen.txt. This property is embedded in the 14 - device. If defined it forces a different y resolution. 15 - 16 - Example: 17 - 18 - i2c@00000000 { 19 - 20 - /* ... */ 21 - 22 - touchscreen@48 { 23 - compatible = "samsung,s6sy761"; 24 - reg = <0x48>; 25 - interrupt-parent = <&gpa1>; 26 - interrupts = <1 IRQ_TYPE_NONE>; 27 - avdd-supply = <&ldo30_reg>; 28 - vdd-supply = <&ldo31_reg>; 29 - touchscreen-size-x = <4096>; 30 - touchscreen-size-y = <4096>; 31 - }; 32 - };
+54
Documentation/devicetree/bindings/input/touchscreen/samsung,s6sy761.yaml
··· 1 + # SPDX-License-Identifier: (GPL-2.0-only OR BSD-2-Clause) 2 + %YAML 1.2 3 + --- 4 + $id: http://devicetree.org/schemas/input/touchscreen/samsung,s6sy761.yaml# 5 + $schema: http://devicetree.org/meta-schemas/core.yaml# 6 + 7 + title: Samsung S6SY761 touchscreen controller 8 + 9 + maintainers: 10 + - Andi Shyti <andi.shyti@kernel.org> 11 + 12 + allOf: 13 + - $ref: touchscreen.yaml# 14 + 15 + properties: 16 + compatible: 17 + const: samsung,s6sy761 18 + 19 + reg: 20 + maxItems: 1 21 + 22 + interrupts: 23 + maxItems: 1 24 + 25 + avdd-supply: true 26 + vdd-supply: true 27 + 28 + unevaluatedProperties: false 29 + 30 + required: 31 + - compatible 32 + - reg 33 + - interrupts 34 + - avdd-supply 35 + - vdd-supply 36 + 37 + examples: 38 + - | 39 + #include <dt-bindings/interrupt-controller/irq.h> 40 + i2c { 41 + #address-cells = <1>; 42 + #size-cells = <0>; 43 + 44 + touchscreen@48 { 45 + compatible = "samsung,s6sy761"; 46 + reg = <0x48>; 47 + interrupt-parent = <&gpa1>; 48 + interrupts = <1 IRQ_TYPE_LEVEL_HIGH>; 49 + avdd-supply = <&ldo30_reg>; 50 + vdd-supply = <&ldo31_reg>; 51 + touchscreen-size-x = <4096>; 52 + touchscreen-size-y = <4096>; 53 + }; 54 + };
-34
Documentation/devicetree/bindings/input/touchscreen/zforce_ts.txt
··· 1 - * Neonode infrared touchscreen controller 2 - 3 - Required properties: 4 - - compatible: must be "neonode,zforce" 5 - - reg: I2C address of the chip 6 - - interrupts: interrupt to which the chip is connected 7 - - reset-gpios: reset gpio the chip is connected to 8 - - x-size: horizontal resolution of touchscreen 9 - - y-size: vertical resolution of touchscreen 10 - 11 - Optional properties: 12 - - irq-gpios : interrupt gpio the chip is connected to 13 - - vdd-supply: Regulator controlling the controller supply 14 - 15 - Example: 16 - 17 - i2c@00000000 { 18 - /* ... */ 19 - 20 - zforce_ts@50 { 21 - compatible = "neonode,zforce"; 22 - reg = <0x50>; 23 - interrupts = <2 0>; 24 - vdd-supply = <&reg_zforce_vdd>; 25 - 26 - reset-gpios = <&gpio5 9 0>; /* RST */ 27 - irq-gpios = <&gpio5 6 0>; /* IRQ, optional */ 28 - 29 - x-size = <800>; 30 - y-size = <600>; 31 - }; 32 - 33 - /* ... */ 34 - };
+7
MAINTAINERS
··· 441 441 W: https://ez.analog.com/linux-software-drivers 442 442 F: drivers/input/touchscreen/ad7879.c 443 443 444 + ADAFRUIT MINI I2C GAMEPAD 445 + M: Anshul Dalal <anshulusr@gmail.com> 446 + L: linux-input@vger.kernel.org 447 + S: Maintained 448 + F: Documentation/devicetree/bindings/input/adafruit,seesaw-gamepad.yaml 449 + F: drivers/input/joystick/adafruit-seesaw.c 450 + 444 451 ADDRESS SPACE LAYOUT RANDOMIZATION (ASLR) 445 452 M: Jiri Kosina <jikos@kernel.org> 446 453 S: Maintained
+4 -4
drivers/input/input.c
··· 1365 1365 { \ 1366 1366 struct input_dev *input_dev = to_input_dev(dev); \ 1367 1367 \ 1368 - return scnprintf(buf, PAGE_SIZE, "%s\n", \ 1369 - input_dev->name ? input_dev->name : ""); \ 1368 + return sysfs_emit(buf, "%s\n", \ 1369 + input_dev->name ? input_dev->name : ""); \ 1370 1370 } \ 1371 1371 static DEVICE_ATTR(name, S_IRUGO, input_dev_show_##name, NULL) 1372 1372 ··· 1458 1458 { 1459 1459 struct input_dev *input_dev = to_input_dev(dev); 1460 1460 1461 - return scnprintf(buf, PAGE_SIZE, "%d\n", input_dev->inhibited); 1461 + return sysfs_emit(buf, "%d\n", input_dev->inhibited); 1462 1462 } 1463 1463 1464 1464 static ssize_t inhibited_store(struct device *dev, ··· 1505 1505 char *buf) \ 1506 1506 { \ 1507 1507 struct input_dev *input_dev = to_input_dev(dev); \ 1508 - return scnprintf(buf, PAGE_SIZE, "%04x\n", input_dev->id.name); \ 1508 + return sysfs_emit(buf, "%04x\n", input_dev->id.name); \ 1509 1509 } \ 1510 1510 static DEVICE_ATTR(name, S_IRUGO, input_dev_show_id_##name, NULL) 1511 1511
+10
drivers/input/joystick/Kconfig
··· 412 412 To compile this driver as a module, choose M here: the 413 413 module will be called sensehat_joystick. 414 414 415 + config JOYSTICK_SEESAW 416 + tristate "Adafruit Mini I2C Gamepad with Seesaw" 417 + depends on I2C 418 + select INPUT_SPARSEKMAP 419 + help 420 + Say Y here if you want to use the Adafruit Mini I2C Gamepad. 421 + 422 + To compile this driver as a module, choose M here: the module will be 423 + called adafruit-seesaw. 424 + 415 425 endif
+1
drivers/input/joystick/Makefile
··· 28 28 obj-$(CONFIG_JOYSTICK_PSXPAD_SPI) += psxpad-spi.o 29 29 obj-$(CONFIG_JOYSTICK_PXRC) += pxrc.o 30 30 obj-$(CONFIG_JOYSTICK_QWIIC) += qwiic-joystick.o 31 + obj-$(CONFIG_JOYSTICK_SEESAW) += adafruit-seesaw.o 31 32 obj-$(CONFIG_JOYSTICK_SENSEHAT) += sensehat-joystick.o 32 33 obj-$(CONFIG_JOYSTICK_SIDEWINDER) += sidewinder.o 33 34 obj-$(CONFIG_JOYSTICK_SPACEBALL) += spaceball.o
+315
drivers/input/joystick/adafruit-seesaw.c
··· 1 + // SPDX-License-Identifier: GPL-2.0-or-later 2 + /* 3 + * Copyright (C) 2023 Anshul Dalal <anshulusr@gmail.com> 4 + * 5 + * Driver for Adafruit Mini I2C Gamepad 6 + * 7 + * Based on the work of: 8 + * Oleh Kravchenko (Sparkfun Qwiic Joystick driver) 9 + * 10 + * Datasheet: https://cdn-learn.adafruit.com/downloads/pdf/gamepad-qt.pdf 11 + * Product page: https://www.adafruit.com/product/5743 12 + * Firmware and hardware sources: https://github.com/adafruit/Adafruit_Seesaw 13 + * 14 + * TODO: 15 + * - Add interrupt support 16 + */ 17 + 18 + #include <asm/unaligned.h> 19 + #include <linux/bits.h> 20 + #include <linux/delay.h> 21 + #include <linux/i2c.h> 22 + #include <linux/input.h> 23 + #include <linux/input/sparse-keymap.h> 24 + #include <linux/kernel.h> 25 + #include <linux/module.h> 26 + 27 + #define SEESAW_DEVICE_NAME "seesaw-gamepad" 28 + 29 + #define SEESAW_ADC_BASE 0x0900 30 + 31 + #define SEESAW_GPIO_DIRCLR_BULK 0x0103 32 + #define SEESAW_GPIO_BULK 0x0104 33 + #define SEESAW_GPIO_BULK_SET 0x0105 34 + #define SEESAW_GPIO_PULLENSET 0x010b 35 + 36 + #define SEESAW_STATUS_HW_ID 0x0001 37 + #define SEESAW_STATUS_SWRST 0x007f 38 + 39 + #define SEESAW_ADC_OFFSET 0x07 40 + 41 + #define SEESAW_BUTTON_A 0x05 42 + #define SEESAW_BUTTON_B 0x01 43 + #define SEESAW_BUTTON_X 0x06 44 + #define SEESAW_BUTTON_Y 0x02 45 + #define SEESAW_BUTTON_START 0x10 46 + #define SEESAW_BUTTON_SELECT 0x00 47 + 48 + #define SEESAW_ANALOG_X 0x0e 49 + #define SEESAW_ANALOG_Y 0x0f 50 + 51 + #define SEESAW_JOYSTICK_MAX_AXIS 1023 52 + #define SEESAW_JOYSTICK_FUZZ 2 53 + #define SEESAW_JOYSTICK_FLAT 4 54 + 55 + #define SEESAW_GAMEPAD_POLL_INTERVAL_MS 16 56 + #define SEESAW_GAMEPAD_POLL_MIN 8 57 + #define SEESAW_GAMEPAD_POLL_MAX 32 58 + 59 + static const unsigned long SEESAW_BUTTON_MASK = 60 + BIT(SEESAW_BUTTON_A) | BIT(SEESAW_BUTTON_B) | BIT(SEESAW_BUTTON_X) | 61 + BIT(SEESAW_BUTTON_Y) | BIT(SEESAW_BUTTON_START) | 62 + BIT(SEESAW_BUTTON_SELECT); 63 + 64 + struct seesaw_gamepad { 65 + struct input_dev *input_dev; 66 + struct i2c_client *i2c_client; 67 + }; 68 + 69 + struct seesaw_data { 70 + u16 x; 71 + u16 y; 72 + u32 button_state; 73 + }; 74 + 75 + static const struct key_entry seesaw_buttons_new[] = { 76 + { KE_KEY, SEESAW_BUTTON_A, .keycode = BTN_SOUTH }, 77 + { KE_KEY, SEESAW_BUTTON_B, .keycode = BTN_EAST }, 78 + { KE_KEY, SEESAW_BUTTON_X, .keycode = BTN_NORTH }, 79 + { KE_KEY, SEESAW_BUTTON_Y, .keycode = BTN_WEST }, 80 + { KE_KEY, SEESAW_BUTTON_START, .keycode = BTN_START }, 81 + { KE_KEY, SEESAW_BUTTON_SELECT, .keycode = BTN_SELECT }, 82 + { KE_END, 0 } 83 + }; 84 + 85 + static int seesaw_register_read(struct i2c_client *client, u16 reg, void *buf, 86 + int count) 87 + { 88 + __be16 register_buf = cpu_to_be16(reg); 89 + struct i2c_msg message_buf[2] = { 90 + { 91 + .addr = client->addr, 92 + .flags = client->flags, 93 + .len = sizeof(register_buf), 94 + .buf = (u8 *)&register_buf, 95 + }, 96 + { 97 + .addr = client->addr, 98 + .flags = client->flags | I2C_M_RD, 99 + .len = count, 100 + .buf = (u8 *)buf, 101 + }, 102 + }; 103 + int ret; 104 + 105 + ret = i2c_transfer(client->adapter, message_buf, 106 + ARRAY_SIZE(message_buf)); 107 + if (ret < 0) 108 + return ret; 109 + 110 + return 0; 111 + } 112 + 113 + static int seesaw_register_write_u8(struct i2c_client *client, u16 reg, 114 + u8 value) 115 + { 116 + u8 write_buf[sizeof(reg) + sizeof(value)]; 117 + int ret; 118 + 119 + put_unaligned_be16(reg, write_buf); 120 + write_buf[sizeof(reg)] = value; 121 + 122 + ret = i2c_master_send(client, write_buf, sizeof(write_buf)); 123 + if (ret < 0) 124 + return ret; 125 + 126 + return 0; 127 + } 128 + 129 + static int seesaw_register_write_u32(struct i2c_client *client, u16 reg, 130 + u32 value) 131 + { 132 + u8 write_buf[sizeof(reg) + sizeof(value)]; 133 + int ret; 134 + 135 + put_unaligned_be16(reg, write_buf); 136 + put_unaligned_be32(value, write_buf + sizeof(reg)); 137 + ret = i2c_master_send(client, write_buf, sizeof(write_buf)); 138 + if (ret < 0) 139 + return ret; 140 + 141 + return 0; 142 + } 143 + 144 + static int seesaw_read_data(struct i2c_client *client, struct seesaw_data *data) 145 + { 146 + __be16 adc_data; 147 + __be32 read_buf; 148 + int err; 149 + 150 + err = seesaw_register_read(client, SEESAW_GPIO_BULK, 151 + &read_buf, sizeof(read_buf)); 152 + if (err) 153 + return err; 154 + 155 + data->button_state = ~be32_to_cpu(read_buf); 156 + 157 + err = seesaw_register_read(client, 158 + SEESAW_ADC_BASE | 159 + (SEESAW_ADC_OFFSET + SEESAW_ANALOG_X), 160 + &adc_data, sizeof(adc_data)); 161 + if (err) 162 + return err; 163 + /* 164 + * ADC reads left as max and right as 0, must be reversed since kernel 165 + * expects reports in opposite order. 166 + */ 167 + data->x = SEESAW_JOYSTICK_MAX_AXIS - be16_to_cpu(adc_data); 168 + 169 + err = seesaw_register_read(client, 170 + SEESAW_ADC_BASE | 171 + (SEESAW_ADC_OFFSET + SEESAW_ANALOG_Y), 172 + &adc_data, sizeof(adc_data)); 173 + if (err) 174 + return err; 175 + 176 + data->y = be16_to_cpu(adc_data); 177 + 178 + return 0; 179 + } 180 + 181 + static void seesaw_poll(struct input_dev *input) 182 + { 183 + struct seesaw_gamepad *private = input_get_drvdata(input); 184 + struct seesaw_data data; 185 + int err, i; 186 + 187 + err = seesaw_read_data(private->i2c_client, &data); 188 + if (err) { 189 + dev_err_ratelimited(&input->dev, 190 + "failed to read joystick state: %d\n", err); 191 + return; 192 + } 193 + 194 + input_report_abs(input, ABS_X, data.x); 195 + input_report_abs(input, ABS_Y, data.y); 196 + 197 + for_each_set_bit(i, &SEESAW_BUTTON_MASK, 198 + BITS_PER_TYPE(SEESAW_BUTTON_MASK)) { 199 + if (!sparse_keymap_report_event(input, i, 200 + data.button_state & BIT(i), 201 + false)) 202 + dev_err_ratelimited(&input->dev, 203 + "failed to report keymap event"); 204 + } 205 + 206 + input_sync(input); 207 + } 208 + 209 + static int seesaw_probe(struct i2c_client *client) 210 + { 211 + struct seesaw_gamepad *seesaw; 212 + u8 hardware_id; 213 + int err; 214 + 215 + err = seesaw_register_write_u8(client, SEESAW_STATUS_SWRST, 0xFF); 216 + if (err) 217 + return err; 218 + 219 + /* Wait for the registers to reset before proceeding */ 220 + usleep_range(10000, 15000); 221 + 222 + seesaw = devm_kzalloc(&client->dev, sizeof(*seesaw), GFP_KERNEL); 223 + if (!seesaw) 224 + return -ENOMEM; 225 + 226 + err = seesaw_register_read(client, SEESAW_STATUS_HW_ID, 227 + &hardware_id, sizeof(hardware_id)); 228 + if (err) 229 + return err; 230 + 231 + dev_dbg(&client->dev, "Adafruit Seesaw Gamepad, Hardware ID: %02x\n", 232 + hardware_id); 233 + 234 + /* Set Pin Mode to input and enable pull-up resistors */ 235 + err = seesaw_register_write_u32(client, SEESAW_GPIO_DIRCLR_BULK, 236 + SEESAW_BUTTON_MASK); 237 + if (err) 238 + return err; 239 + err = seesaw_register_write_u32(client, SEESAW_GPIO_PULLENSET, 240 + SEESAW_BUTTON_MASK); 241 + if (err) 242 + return err; 243 + err = seesaw_register_write_u32(client, SEESAW_GPIO_BULK_SET, 244 + SEESAW_BUTTON_MASK); 245 + if (err) 246 + return err; 247 + 248 + seesaw->i2c_client = client; 249 + seesaw->input_dev = devm_input_allocate_device(&client->dev); 250 + if (!seesaw->input_dev) 251 + return -ENOMEM; 252 + 253 + seesaw->input_dev->id.bustype = BUS_I2C; 254 + seesaw->input_dev->name = "Adafruit Seesaw Gamepad"; 255 + seesaw->input_dev->phys = "i2c/" SEESAW_DEVICE_NAME; 256 + input_set_drvdata(seesaw->input_dev, seesaw); 257 + input_set_abs_params(seesaw->input_dev, ABS_X, 258 + 0, SEESAW_JOYSTICK_MAX_AXIS, 259 + SEESAW_JOYSTICK_FUZZ, SEESAW_JOYSTICK_FLAT); 260 + input_set_abs_params(seesaw->input_dev, ABS_Y, 261 + 0, SEESAW_JOYSTICK_MAX_AXIS, 262 + SEESAW_JOYSTICK_FUZZ, SEESAW_JOYSTICK_FLAT); 263 + 264 + err = sparse_keymap_setup(seesaw->input_dev, seesaw_buttons_new, NULL); 265 + if (err) { 266 + dev_err(&client->dev, 267 + "failed to set up input device keymap: %d\n", err); 268 + return err; 269 + } 270 + 271 + err = input_setup_polling(seesaw->input_dev, seesaw_poll); 272 + if (err) { 273 + dev_err(&client->dev, "failed to set up polling: %d\n", err); 274 + return err; 275 + } 276 + 277 + input_set_poll_interval(seesaw->input_dev, 278 + SEESAW_GAMEPAD_POLL_INTERVAL_MS); 279 + input_set_max_poll_interval(seesaw->input_dev, SEESAW_GAMEPAD_POLL_MAX); 280 + input_set_min_poll_interval(seesaw->input_dev, SEESAW_GAMEPAD_POLL_MIN); 281 + 282 + err = input_register_device(seesaw->input_dev); 283 + if (err) { 284 + dev_err(&client->dev, "failed to register joystick: %d\n", err); 285 + return err; 286 + } 287 + 288 + return 0; 289 + } 290 + 291 + static const struct i2c_device_id seesaw_id_table[] = { 292 + { SEESAW_DEVICE_NAME }, 293 + { /* Sentinel */ } 294 + }; 295 + MODULE_DEVICE_TABLE(i2c, seesaw_id_table); 296 + 297 + static const struct of_device_id seesaw_of_table[] = { 298 + { .compatible = "adafruit,seesaw-gamepad"}, 299 + { /* Sentinel */ } 300 + }; 301 + MODULE_DEVICE_TABLE(of, seesaw_of_table); 302 + 303 + static struct i2c_driver seesaw_driver = { 304 + .driver = { 305 + .name = SEESAW_DEVICE_NAME, 306 + .of_match_table = seesaw_of_table, 307 + }, 308 + .id_table = seesaw_id_table, 309 + .probe = seesaw_probe, 310 + }; 311 + module_i2c_driver(seesaw_driver); 312 + 313 + MODULE_AUTHOR("Anshul Dalal <anshulusr@gmail.com>"); 314 + MODULE_DESCRIPTION("Adafruit Mini I2C Gamepad driver"); 315 + MODULE_LICENSE("GPL");
+11 -13
drivers/input/joystick/as5011.c
··· 13 13 #include <linux/i2c.h> 14 14 #include <linux/interrupt.h> 15 15 #include <linux/input.h> 16 - #include <linux/gpio.h> 16 + #include <linux/gpio/consumer.h> 17 17 #include <linux/delay.h> 18 18 #include <linux/input/as5011.h> 19 19 #include <linux/slab.h> ··· 61 61 struct as5011_device { 62 62 struct input_dev *input_dev; 63 63 struct i2c_client *i2c_client; 64 - unsigned int button_gpio; 64 + struct gpio_desc *button_gpiod; 65 65 unsigned int button_irq; 66 66 unsigned int axis_irq; 67 67 }; ··· 114 114 static irqreturn_t as5011_button_interrupt(int irq, void *dev_id) 115 115 { 116 116 struct as5011_device *as5011 = dev_id; 117 - int val = gpio_get_value_cansleep(as5011->button_gpio); 117 + int val = gpiod_get_value_cansleep(as5011->button_gpiod); 118 118 119 119 input_report_key(as5011->input_dev, BTN_JOYSTICK, !val); 120 120 input_sync(as5011->input_dev); ··· 248 248 249 249 as5011->i2c_client = client; 250 250 as5011->input_dev = input_dev; 251 - as5011->button_gpio = plat_data->button_gpio; 252 251 as5011->axis_irq = plat_data->axis_irq; 253 252 254 253 input_dev->name = "Austria Microsystem as5011 joystick"; ··· 261 262 input_set_abs_params(as5011->input_dev, ABS_Y, 262 263 AS5011_MIN_AXIS, AS5011_MAX_AXIS, AS5011_FUZZ, AS5011_FLAT); 263 264 264 - error = gpio_request(as5011->button_gpio, "AS5011 button"); 265 - if (error < 0) { 266 - dev_err(&client->dev, "Failed to request button gpio\n"); 265 + as5011->button_gpiod = devm_gpiod_get(&client->dev, NULL, GPIOD_IN); 266 + if (IS_ERR(as5011->button_gpiod)) { 267 + error = PTR_ERR(as5011->button_gpiod); 268 + dev_err(&client->dev, "Failed to request button GPIO\n"); 267 269 goto err_free_mem; 268 270 } 271 + gpiod_set_consumer_name(as5011->button_gpiod, "AS5011 button"); 269 272 270 - irq = gpio_to_irq(as5011->button_gpio); 273 + irq = gpiod_to_irq(as5011->button_gpiod); 271 274 if (irq < 0) { 272 275 dev_err(&client->dev, 273 276 "Failed to get irq number for button gpio\n"); 274 277 error = irq; 275 - goto err_free_button_gpio; 278 + goto err_free_mem; 276 279 } 277 280 278 281 as5011->button_irq = irq; ··· 287 286 if (error < 0) { 288 287 dev_err(&client->dev, 289 288 "Can't allocate button irq %d\n", as5011->button_irq); 290 - goto err_free_button_gpio; 289 + goto err_free_mem; 291 290 } 292 291 293 292 error = as5011_configure_chip(as5011, plat_data); ··· 318 317 free_irq(as5011->axis_irq, as5011); 319 318 err_free_button_irq: 320 319 free_irq(as5011->button_irq, as5011); 321 - err_free_button_gpio: 322 - gpio_free(as5011->button_gpio); 323 320 err_free_mem: 324 321 input_free_device(input_dev); 325 322 kfree(as5011); ··· 331 332 332 333 free_irq(as5011->axis_irq, as5011); 333 334 free_irq(as5011->button_irq, as5011); 334 - gpio_free(as5011->button_gpio); 335 335 336 336 input_unregister_device(as5011->input_dev); 337 337 kfree(as5011);
+18 -24
drivers/input/joystick/pxrc.c
··· 5 5 * Copyright (C) 2018 Marcus Folkesson <marcus.folkesson@gmail.com> 6 6 */ 7 7 8 - #include <linux/kernel.h> 8 + #include <linux/cleanup.h> 9 9 #include <linux/errno.h> 10 - #include <linux/slab.h> 10 + #include <linux/input.h> 11 + #include <linux/kernel.h> 11 12 #include <linux/module.h> 13 + #include <linux/mutex.h> 14 + #include <linux/slab.h> 12 15 #include <linux/uaccess.h> 16 + 13 17 #include <linux/usb.h> 14 18 #include <linux/usb/input.h> 15 - #include <linux/mutex.h> 16 - #include <linux/input.h> 17 19 18 20 #define PXRC_VENDOR_ID 0x1781 19 21 #define PXRC_PRODUCT_ID 0x0898 ··· 83 81 static int pxrc_open(struct input_dev *input) 84 82 { 85 83 struct pxrc *pxrc = input_get_drvdata(input); 86 - int retval; 84 + int error; 87 85 88 - mutex_lock(&pxrc->pm_mutex); 89 - retval = usb_submit_urb(pxrc->urb, GFP_KERNEL); 90 - if (retval) { 86 + guard(mutex)(&pxrc->pm_mutex); 87 + error = usb_submit_urb(pxrc->urb, GFP_KERNEL); 88 + if (error) { 91 89 dev_err(&pxrc->intf->dev, 92 90 "%s - usb_submit_urb failed, error: %d\n", 93 - __func__, retval); 94 - retval = -EIO; 95 - goto out; 91 + __func__, error); 92 + return -EIO; 96 93 } 97 94 98 95 pxrc->is_open = true; 99 - 100 - out: 101 - mutex_unlock(&pxrc->pm_mutex); 102 - return retval; 96 + return 0; 103 97 } 104 98 105 99 static void pxrc_close(struct input_dev *input) 106 100 { 107 101 struct pxrc *pxrc = input_get_drvdata(input); 108 102 109 - mutex_lock(&pxrc->pm_mutex); 103 + guard(mutex)(&pxrc->pm_mutex); 110 104 usb_kill_urb(pxrc->urb); 111 105 pxrc->is_open = false; 112 - mutex_unlock(&pxrc->pm_mutex); 113 106 } 114 107 115 108 static void pxrc_free_urb(void *_pxrc) ··· 205 208 { 206 209 struct pxrc *pxrc = usb_get_intfdata(intf); 207 210 208 - mutex_lock(&pxrc->pm_mutex); 211 + guard(mutex)(&pxrc->pm_mutex); 209 212 if (pxrc->is_open) 210 213 usb_kill_urb(pxrc->urb); 211 - mutex_unlock(&pxrc->pm_mutex); 212 214 213 215 return 0; 214 216 } ··· 215 219 static int pxrc_resume(struct usb_interface *intf) 216 220 { 217 221 struct pxrc *pxrc = usb_get_intfdata(intf); 218 - int retval = 0; 219 222 220 - mutex_lock(&pxrc->pm_mutex); 223 + guard(mutex)(&pxrc->pm_mutex); 221 224 if (pxrc->is_open && usb_submit_urb(pxrc->urb, GFP_KERNEL) < 0) 222 - retval = -EIO; 225 + return -EIO; 223 226 224 - mutex_unlock(&pxrc->pm_mutex); 225 - return retval; 227 + return 0; 226 228 } 227 229 228 230 static int pxrc_pre_reset(struct usb_interface *intf)
+3 -3
drivers/input/joystick/xpad.c
··· 1670 1670 if (!led) 1671 1671 return -ENOMEM; 1672 1672 1673 - xpad->pad_nr = ida_simple_get(&xpad_pad_seq, 0, 0, GFP_KERNEL); 1673 + xpad->pad_nr = ida_alloc(&xpad_pad_seq, GFP_KERNEL); 1674 1674 if (xpad->pad_nr < 0) { 1675 1675 error = xpad->pad_nr; 1676 1676 goto err_free_mem; ··· 1693 1693 return 0; 1694 1694 1695 1695 err_free_id: 1696 - ida_simple_remove(&xpad_pad_seq, xpad->pad_nr); 1696 + ida_free(&xpad_pad_seq, xpad->pad_nr); 1697 1697 err_free_mem: 1698 1698 kfree(led); 1699 1699 xpad->led = NULL; ··· 1706 1706 1707 1707 if (xpad_led) { 1708 1708 led_classdev_unregister(&xpad_led->led_cdev); 1709 - ida_simple_remove(&xpad_pad_seq, xpad->pad_nr); 1709 + ida_free(&xpad_pad_seq, xpad->pad_nr); 1710 1710 kfree(xpad_led); 1711 1711 } 1712 1712 }
+7 -5
drivers/input/keyboard/atkbd.c
··· 791 791 * not work. So in this case simply assume a keyboard is connected to avoid 792 792 * confusing some laptop keyboards. 793 793 * 794 - * Skipping ATKBD_CMD_GETID ends up using a fake keyboard id. Using a fake id is 795 - * ok in translated mode, only atkbd_select_set() checks atkbd->id and in 796 - * translated mode that is a no-op. 794 + * Skipping ATKBD_CMD_GETID ends up using a fake keyboard id. Using the standard 795 + * 0xab83 id is ok in translated mode, only atkbd_select_set() checks atkbd->id 796 + * and in translated mode that is a no-op. 797 797 */ 798 798 static bool atkbd_skip_getid(struct atkbd *atkbd) 799 799 { ··· 811 811 { 812 812 struct ps2dev *ps2dev = &atkbd->ps2dev; 813 813 unsigned char param[2]; 814 + bool skip_getid; 814 815 815 816 /* 816 817 * Some systems, where the bit-twiddling when testing the io-lines of the ··· 833 832 */ 834 833 835 834 param[0] = param[1] = 0xa5; /* initialize with invalid values */ 836 - if (atkbd_skip_getid(atkbd) || ps2_command(ps2dev, param, ATKBD_CMD_GETID)) { 835 + skip_getid = atkbd_skip_getid(atkbd); 836 + if (skip_getid || ps2_command(ps2dev, param, ATKBD_CMD_GETID)) { 837 837 838 838 /* 839 839 * If the get ID command was skipped or failed, we check if we can at least set ··· 844 842 param[0] = 0; 845 843 if (ps2_command(ps2dev, param, ATKBD_CMD_SETLEDS)) 846 844 return -1; 847 - atkbd->id = 0xabba; 845 + atkbd->id = skip_getid ? 0xab83 : 0xabba; 848 846 return 0; 849 847 } 850 848
+197 -58
drivers/input/keyboard/cap11xx.c
··· 10 10 #include <linux/interrupt.h> 11 11 #include <linux/input.h> 12 12 #include <linux/leds.h> 13 - #include <linux/of_irq.h> 13 + #include <linux/of.h> 14 14 #include <linux/regmap.h> 15 15 #include <linux/i2c.h> 16 16 #include <linux/gpio/consumer.h> 17 + #include <linux/bitfield.h> 17 18 18 19 #define CAP11XX_REG_MAIN_CONTROL 0x00 19 20 #define CAP11XX_REG_MAIN_CONTROL_GAIN_SHIFT (6) ··· 25 24 #define CAP11XX_REG_NOISE_FLAG_STATUS 0x0a 26 25 #define CAP11XX_REG_SENOR_DELTA(X) (0x10 + (X)) 27 26 #define CAP11XX_REG_SENSITIVITY_CONTROL 0x1f 27 + #define CAP11XX_REG_SENSITIVITY_CONTROL_DELTA_SENSE_MASK 0x70 28 28 #define CAP11XX_REG_CONFIG 0x20 29 29 #define CAP11XX_REG_SENSOR_ENABLE 0x21 30 30 #define CAP11XX_REG_SENSOR_CONFIG 0x22 ··· 34 32 #define CAP11XX_REG_CALIBRATION 0x26 35 33 #define CAP11XX_REG_INT_ENABLE 0x27 36 34 #define CAP11XX_REG_REPEAT_RATE 0x28 35 + #define CAP11XX_REG_SIGNAL_GUARD_ENABLE 0x29 37 36 #define CAP11XX_REG_MT_CONFIG 0x2a 38 37 #define CAP11XX_REG_MT_PATTERN_CONFIG 0x2b 39 38 #define CAP11XX_REG_MT_PATTERN 0x2d ··· 50 47 #define CAP11XX_REG_SENSOR_BASE_CNT(X) (0x50 + (X)) 51 48 #define CAP11XX_REG_LED_POLARITY 0x73 52 49 #define CAP11XX_REG_LED_OUTPUT_CONTROL 0x74 50 + #define CAP11XX_REG_CALIB_SENSITIVITY_CONFIG 0x80 51 + #define CAP11XX_REG_CALIB_SENSITIVITY_CONFIG2 0x81 53 52 54 53 #define CAP11XX_REG_LED_DUTY_CYCLE_1 0x90 55 54 #define CAP11XX_REG_LED_DUTY_CYCLE_2 0x91 ··· 83 78 84 79 struct cap11xx_priv { 85 80 struct regmap *regmap; 81 + struct device *dev; 86 82 struct input_dev *idev; 83 + const struct cap11xx_hw_model *model; 84 + u8 id; 87 85 88 86 struct cap11xx_led *leds; 89 87 int num_leds; 90 88 91 89 /* config */ 90 + u8 analog_gain; 91 + u8 sensitivity_delta_sense; 92 + u8 signal_guard_inputs_mask; 93 + u32 thresholds[8]; 94 + u32 calib_sensitivities[8]; 92 95 u32 keycodes[]; 93 96 }; 94 97 ··· 173 160 case CAP11XX_REG_SENOR_DELTA(3): 174 161 case CAP11XX_REG_SENOR_DELTA(4): 175 162 case CAP11XX_REG_SENOR_DELTA(5): 176 - case CAP11XX_REG_PRODUCT_ID: 177 - case CAP11XX_REG_MANUFACTURER_ID: 178 - case CAP11XX_REG_REVISION: 179 163 return true; 180 164 } 181 165 ··· 187 177 .reg_defaults = cap11xx_reg_defaults, 188 178 189 179 .num_reg_defaults = ARRAY_SIZE(cap11xx_reg_defaults), 190 - .cache_type = REGCACHE_RBTREE, 180 + .cache_type = REGCACHE_MAPLE, 191 181 .volatile_reg = cap11xx_volatile_reg, 192 182 }; 183 + 184 + static int cap11xx_write_calib_sens_config_1(struct cap11xx_priv *priv) 185 + { 186 + return regmap_write(priv->regmap, 187 + CAP11XX_REG_CALIB_SENSITIVITY_CONFIG, 188 + (priv->calib_sensitivities[3] << 6) | 189 + (priv->calib_sensitivities[2] << 4) | 190 + (priv->calib_sensitivities[1] << 2) | 191 + priv->calib_sensitivities[0]); 192 + } 193 + 194 + static int cap11xx_write_calib_sens_config_2(struct cap11xx_priv *priv) 195 + { 196 + return regmap_write(priv->regmap, 197 + CAP11XX_REG_CALIB_SENSITIVITY_CONFIG2, 198 + (priv->calib_sensitivities[7] << 6) | 199 + (priv->calib_sensitivities[6] << 4) | 200 + (priv->calib_sensitivities[5] << 2) | 201 + priv->calib_sensitivities[4]); 202 + } 203 + 204 + static int cap11xx_init_keys(struct cap11xx_priv *priv) 205 + { 206 + struct device_node *node = priv->dev->of_node; 207 + struct device *dev = priv->dev; 208 + int i, error; 209 + u32 u32_val; 210 + 211 + if (!node) { 212 + dev_err(dev, "Corresponding DT entry is not available\n"); 213 + return -ENODEV; 214 + } 215 + 216 + if (!of_property_read_u32(node, "microchip,sensor-gain", &u32_val)) { 217 + if (priv->model->no_gain) { 218 + dev_warn(dev, 219 + "This model doesn't support 'sensor-gain'\n"); 220 + } else if (is_power_of_2(u32_val) && u32_val <= 8) { 221 + priv->analog_gain = (u8)ilog2(u32_val); 222 + 223 + error = regmap_update_bits(priv->regmap, 224 + CAP11XX_REG_MAIN_CONTROL, 225 + CAP11XX_REG_MAIN_CONTROL_GAIN_MASK, 226 + priv->analog_gain << CAP11XX_REG_MAIN_CONTROL_GAIN_SHIFT); 227 + if (error) 228 + return error; 229 + } else { 230 + dev_err(dev, "Invalid sensor-gain value %u\n", u32_val); 231 + return -EINVAL; 232 + } 233 + } 234 + 235 + if (of_property_read_bool(node, "microchip,irq-active-high")) { 236 + if (priv->id == CAP1106 || 237 + priv->id == CAP1126 || 238 + priv->id == CAP1188) { 239 + error = regmap_update_bits(priv->regmap, 240 + CAP11XX_REG_CONFIG2, 241 + CAP11XX_REG_CONFIG2_ALT_POL, 242 + 0); 243 + if (error) 244 + return error; 245 + } else { 246 + dev_warn(dev, 247 + "This model doesn't support 'irq-active-high'\n"); 248 + } 249 + } 250 + 251 + if (!of_property_read_u32(node, "microchip,sensitivity-delta-sense", &u32_val)) { 252 + if (!is_power_of_2(u32_val) || u32_val > 128) { 253 + dev_err(dev, "Invalid sensitivity-delta-sense value %u\n", u32_val); 254 + return -EINVAL; 255 + } 256 + 257 + priv->sensitivity_delta_sense = (u8)ilog2(u32_val); 258 + u32_val = ~(FIELD_PREP(CAP11XX_REG_SENSITIVITY_CONTROL_DELTA_SENSE_MASK, 259 + priv->sensitivity_delta_sense)); 260 + 261 + error = regmap_update_bits(priv->regmap, 262 + CAP11XX_REG_SENSITIVITY_CONTROL, 263 + CAP11XX_REG_SENSITIVITY_CONTROL_DELTA_SENSE_MASK, 264 + u32_val); 265 + if (error) 266 + return error; 267 + } 268 + 269 + if (!of_property_read_u32_array(node, "microchip,input-threshold", 270 + priv->thresholds, priv->model->num_channels)) { 271 + for (i = 0; i < priv->model->num_channels; i++) { 272 + if (priv->thresholds[i] > 127) { 273 + dev_err(dev, "Invalid input-threshold value %u\n", 274 + priv->thresholds[i]); 275 + return -EINVAL; 276 + } 277 + 278 + error = regmap_write(priv->regmap, 279 + CAP11XX_REG_SENSOR_THRESH(i), 280 + priv->thresholds[i]); 281 + if (error) 282 + return error; 283 + } 284 + } 285 + 286 + if (!of_property_read_u32_array(node, "microchip,calib-sensitivity", 287 + priv->calib_sensitivities, 288 + priv->model->num_channels)) { 289 + if (priv->id == CAP1293 || priv->id == CAP1298) { 290 + for (i = 0; i < priv->model->num_channels; i++) { 291 + if (!is_power_of_2(priv->calib_sensitivities[i]) || 292 + priv->calib_sensitivities[i] > 4) { 293 + dev_err(dev, "Invalid calib-sensitivity value %u\n", 294 + priv->calib_sensitivities[i]); 295 + return -EINVAL; 296 + } 297 + priv->calib_sensitivities[i] = ilog2(priv->calib_sensitivities[i]); 298 + } 299 + 300 + error = cap11xx_write_calib_sens_config_1(priv); 301 + if (error) 302 + return error; 303 + 304 + if (priv->id == CAP1298) { 305 + error = cap11xx_write_calib_sens_config_2(priv); 306 + if (error) 307 + return error; 308 + } 309 + } else { 310 + dev_warn(dev, 311 + "This model doesn't support 'calib-sensitivity'\n"); 312 + } 313 + } 314 + 315 + for (i = 0; i < priv->model->num_channels; i++) { 316 + if (!of_property_read_u32_index(node, "microchip,signal-guard", 317 + i, &u32_val)) { 318 + if (u32_val > 1) 319 + return -EINVAL; 320 + if (u32_val) 321 + priv->signal_guard_inputs_mask |= 0x01 << i; 322 + } 323 + } 324 + 325 + if (priv->signal_guard_inputs_mask) { 326 + if (priv->id == CAP1293 || priv->id == CAP1298) { 327 + error = regmap_write(priv->regmap, 328 + CAP11XX_REG_SIGNAL_GUARD_ENABLE, 329 + priv->signal_guard_inputs_mask); 330 + if (error) 331 + return error; 332 + } else { 333 + dev_warn(dev, 334 + "This model doesn't support 'signal-guard'\n"); 335 + } 336 + } 337 + 338 + /* Provide some useful defaults */ 339 + for (i = 0; i < priv->model->num_channels; i++) 340 + priv->keycodes[i] = KEY_A + i; 341 + 342 + of_property_read_u32_array(node, "linux,keycodes", 343 + priv->keycodes, priv->model->num_channels); 344 + 345 + /* Disable autorepeat. The Linux input system has its own handling. */ 346 + error = regmap_write(priv->regmap, CAP11XX_REG_REPEAT_RATE, 0); 347 + if (error) 348 + return error; 349 + 350 + return 0; 351 + } 193 352 194 353 static irqreturn_t cap11xx_thread_func(int irq_num, void *data) 195 354 { ··· 511 332 const struct i2c_device_id *id = i2c_client_get_device_id(i2c_client); 512 333 struct device *dev = &i2c_client->dev; 513 334 struct cap11xx_priv *priv; 514 - struct device_node *node; 515 335 const struct cap11xx_hw_model *cap; 516 - int i, error, irq, gain = 0; 336 + int i, error; 517 337 unsigned int val, rev; 518 - u32 gain32; 519 338 520 339 if (id->driver_data >= ARRAY_SIZE(cap11xx_devices)) { 521 340 dev_err(dev, "Invalid device ID %lu\n", id->driver_data); ··· 531 354 GFP_KERNEL); 532 355 if (!priv) 533 356 return -ENOMEM; 357 + 358 + priv->dev = dev; 534 359 535 360 priv->regmap = devm_regmap_init_i2c(i2c_client, &cap11xx_regmap_config); 536 361 if (IS_ERR(priv->regmap)) ··· 563 384 return error; 564 385 565 386 dev_info(dev, "CAP11XX detected, model %s, revision 0x%02x\n", 387 + id->name, rev); 388 + 389 + priv->model = cap; 390 + priv->id = id->driver_data; 391 + 392 + dev_info(dev, "CAP11XX device detected, model %s, revision 0x%02x\n", 566 393 id->name, rev); 567 - node = dev->of_node; 568 394 569 - if (!of_property_read_u32(node, "microchip,sensor-gain", &gain32)) { 570 - if (cap->no_gain) 571 - dev_warn(dev, 572 - "This version doesn't support sensor gain\n"); 573 - else if (is_power_of_2(gain32) && gain32 <= 8) 574 - gain = ilog2(gain32); 575 - else 576 - dev_err(dev, "Invalid sensor-gain value %d\n", gain32); 577 - } 578 - 579 - if (id->driver_data == CAP1106 || 580 - id->driver_data == CAP1126 || 581 - id->driver_data == CAP1188) { 582 - if (of_property_read_bool(node, "microchip,irq-active-high")) { 583 - error = regmap_update_bits(priv->regmap, 584 - CAP11XX_REG_CONFIG2, 585 - CAP11XX_REG_CONFIG2_ALT_POL, 586 - 0); 587 - if (error) 588 - return error; 589 - } 590 - } 591 - 592 - /* Provide some useful defaults */ 593 - for (i = 0; i < cap->num_channels; i++) 594 - priv->keycodes[i] = KEY_A + i; 595 - 596 - of_property_read_u32_array(node, "linux,keycodes", 597 - priv->keycodes, cap->num_channels); 598 - 599 - if (!cap->no_gain) { 600 - error = regmap_update_bits(priv->regmap, 601 - CAP11XX_REG_MAIN_CONTROL, 602 - CAP11XX_REG_MAIN_CONTROL_GAIN_MASK, 603 - gain << CAP11XX_REG_MAIN_CONTROL_GAIN_SHIFT); 604 - if (error) 605 - return error; 606 - } 607 - 608 - /* Disable autorepeat. The Linux input system has its own handling. */ 609 - error = regmap_write(priv->regmap, CAP11XX_REG_REPEAT_RATE, 0); 395 + error = cap11xx_init_keys(priv); 610 396 if (error) 611 397 return error; 612 398 ··· 583 439 priv->idev->id.bustype = BUS_I2C; 584 440 priv->idev->evbit[0] = BIT_MASK(EV_KEY); 585 441 586 - if (of_property_read_bool(node, "autorepeat")) 442 + if (of_property_read_bool(dev->of_node, "autorepeat")) 587 443 __set_bit(EV_REP, priv->idev->evbit); 588 444 589 445 for (i = 0; i < cap->num_channels; i++) ··· 618 474 if (error) 619 475 return error; 620 476 621 - irq = irq_of_parse_and_map(node, 0); 622 - if (!irq) { 623 - dev_err(dev, "Unable to parse or map IRQ\n"); 624 - return -ENXIO; 625 - } 626 - 627 - error = devm_request_threaded_irq(dev, irq, NULL, cap11xx_thread_func, 477 + error = devm_request_threaded_irq(dev, i2c_client->irq, 478 + NULL, cap11xx_thread_func, 628 479 IRQF_ONESHOT, dev_name(dev), priv); 629 480 if (error) 630 481 return error;
+68 -7
drivers/input/keyboard/gpio_keys.c
··· 45 45 unsigned int software_debounce; /* in msecs, for GPIO-driven buttons */ 46 46 47 47 unsigned int irq; 48 + unsigned int wakeirq; 48 49 unsigned int wakeup_trigger_type; 50 + 49 51 spinlock_t lock; 50 52 bool disabled; 51 53 bool key_pressed; ··· 513 511 struct gpio_button_data *bdata = &ddata->data[idx]; 514 512 irq_handler_t isr; 515 513 unsigned long irqflags; 514 + const char *wakedesc; 516 515 int irq; 517 516 int error; 518 517 ··· 578 575 !gpiod_cansleep(bdata->gpiod); 579 576 } 580 577 578 + /* 579 + * If an interrupt was specified, use it instead of the gpio 580 + * interrupt and use the gpio for reading the state. A separate 581 + * interrupt may be used as the main button interrupt for 582 + * runtime PM to detect events also in deeper idle states. If a 583 + * dedicated wakeirq is used for system suspend only, see below 584 + * for bdata->wakeirq setup. 585 + */ 581 586 if (button->irq) { 582 587 bdata->irq = button->irq; 583 588 } else { 584 589 irq = gpiod_to_irq(bdata->gpiod); 585 590 if (irq < 0) { 586 591 error = irq; 587 - dev_err(dev, 588 - "Unable to get irq number for GPIO %d, error %d\n", 589 - button->gpio, error); 592 + dev_err_probe(dev, error, 593 + "Unable to get irq number for GPIO %d\n", 594 + button->gpio); 590 595 return error; 591 596 } 592 597 bdata->irq = irq; ··· 683 672 return error; 684 673 } 685 674 675 + if (!button->wakeirq) 676 + return 0; 677 + 678 + /* Use :wakeup suffix like drivers/base/power/wakeirq.c does */ 679 + wakedesc = devm_kasprintf(dev, GFP_KERNEL, "%s:wakeup", desc); 680 + if (!wakedesc) 681 + return -ENOMEM; 682 + 683 + bdata->wakeirq = button->wakeirq; 684 + irqflags |= IRQF_NO_SUSPEND; 685 + 686 + /* 687 + * Wakeirq shares the handler with the main interrupt, it's only 688 + * active during system suspend. See gpio_keys_button_enable_wakeup() 689 + * and gpio_keys_button_disable_wakeup(). 690 + */ 691 + error = devm_request_any_context_irq(dev, bdata->wakeirq, isr, 692 + irqflags, wakedesc, bdata); 693 + if (error < 0) { 694 + dev_err(dev, "Unable to claim wakeirq %d; error %d\n", 695 + bdata->irq, error); 696 + return error; 697 + } 698 + 699 + /* 700 + * Disable wakeirq until suspend. IRQF_NO_AUTOEN won't work if 701 + * IRQF_SHARED was set based on !button->can_disable. 702 + */ 703 + disable_irq(bdata->wakeirq); 704 + 686 705 return 0; 687 706 } 688 707 ··· 769 728 struct gpio_keys_platform_data *pdata; 770 729 struct gpio_keys_button *button; 771 730 struct fwnode_handle *child; 772 - int nbuttons; 731 + int nbuttons, irq; 773 732 774 733 nbuttons = device_get_child_node_count(dev); 775 734 if (nbuttons == 0) ··· 791 750 device_property_read_string(dev, "label", &pdata->name); 792 751 793 752 device_for_each_child_node(dev, child) { 794 - if (is_of_node(child)) 795 - button->irq = 796 - irq_of_parse_and_map(to_of_node(child), 0); 753 + if (is_of_node(child)) { 754 + irq = of_irq_get_byname(to_of_node(child), "irq"); 755 + if (irq > 0) 756 + button->irq = irq; 757 + 758 + irq = of_irq_get_byname(to_of_node(child), "wakeup"); 759 + if (irq > 0) 760 + button->wakeirq = irq; 761 + 762 + if (!button->irq && !button->wakeirq) 763 + button->irq = 764 + irq_of_parse_and_map(to_of_node(child), 0); 765 + } 797 766 798 767 if (fwnode_property_read_u32(child, "linux,code", 799 768 &button->code)) { ··· 972 921 } 973 922 } 974 923 924 + if (bdata->wakeirq) { 925 + enable_irq(bdata->wakeirq); 926 + disable_irq(bdata->irq); 927 + } 928 + 975 929 return 0; 976 930 } 977 931 ··· 984 928 gpio_keys_button_disable_wakeup(struct gpio_button_data *bdata) 985 929 { 986 930 int error; 931 + 932 + if (bdata->wakeirq) { 933 + enable_irq(bdata->irq); 934 + disable_irq(bdata->wakeirq); 935 + } 987 936 988 937 /* 989 938 * The trigger type is always both edges for gpio-based keys and we do
+1 -18
drivers/input/keyboard/omap-keypad.c
··· 21 21 #include <linux/mutex.h> 22 22 #include <linux/errno.h> 23 23 #include <linux/slab.h> 24 - #include <linux/gpio.h> 25 24 #include <linux/platform_data/gpio-omap.h> 26 25 #include <linux/platform_data/keypad-omap.h> 27 26 #include <linux/soc/ti/omap1-io.h> ··· 47 48 }; 48 49 49 50 static DECLARE_TASKLET_DISABLED_OLD(kp_tasklet, omap_kp_tasklet); 50 - 51 - static unsigned int *row_gpios; 52 - static unsigned int *col_gpios; 53 51 54 52 static irqreturn_t omap_kp_interrupt(int irq, void *dev_id) 55 53 { ··· 176 180 struct omap_kp *omap_kp; 177 181 struct input_dev *input_dev; 178 182 struct omap_kp_platform_data *pdata = dev_get_platdata(&pdev->dev); 179 - int i, col_idx, row_idx, ret; 183 + int ret; 180 184 unsigned int row_shift, keycodemax; 181 185 182 186 if (!pdata->rows || !pdata->cols || !pdata->keymap_data) { ··· 205 209 if (pdata->delay) 206 210 omap_kp->delay = pdata->delay; 207 211 208 - if (pdata->row_gpios && pdata->col_gpios) { 209 - row_gpios = pdata->row_gpios; 210 - col_gpios = pdata->col_gpios; 211 - } 212 - 213 212 omap_kp->rows = pdata->rows; 214 213 omap_kp->cols = pdata->cols; 215 - 216 - col_idx = 0; 217 - row_idx = 0; 218 214 219 215 timer_setup(&omap_kp->timer, omap_kp_timer, 0); 220 216 ··· 264 276 err3: 265 277 device_remove_file(&pdev->dev, &dev_attr_enable); 266 278 err2: 267 - for (i = row_idx - 1; i >= 0; i--) 268 - gpio_free(row_gpios[i]); 269 - for (i = col_idx - 1; i >= 0; i--) 270 - gpio_free(col_gpios[i]); 271 - 272 279 kfree(omap_kp); 273 280 input_free_device(input_dev); 274 281
+14 -1
drivers/input/keyboard/omap4-keypad.c
··· 11 11 #include <linux/module.h> 12 12 #include <linux/interrupt.h> 13 13 #include <linux/platform_device.h> 14 + #include <linux/clk.h> 14 15 #include <linux/errno.h> 15 16 #include <linux/io.h> 16 17 #include <linux/of.h> ··· 84 83 bool no_autorepeat; 85 84 u64 keys; 86 85 unsigned short *keymap; 86 + struct clk *fck; 87 87 }; 88 88 89 89 static int kbd_readl(struct omap4_keypad *keypad_data, u32 offset) ··· 211 209 if (error) 212 210 return error; 213 211 212 + error = clk_prepare_enable(keypad_data->fck); 213 + if (error) 214 + goto out; 215 + 214 216 disable_irq(keypad_data->irq); 215 217 216 218 kbd_writel(keypad_data, OMAP4_KBD_CTRL, ··· 232 226 233 227 enable_irq(keypad_data->irq); 234 228 229 + out: 235 230 pm_runtime_mark_last_busy(dev); 236 231 pm_runtime_put_autosuspend(dev); 237 232 238 - return 0; 233 + return error; 239 234 } 240 235 241 236 static void omap4_keypad_stop(struct omap4_keypad *keypad_data) ··· 265 258 disable_irq(keypad_data->irq); 266 259 omap4_keypad_stop(keypad_data); 267 260 enable_irq(keypad_data->irq); 261 + clk_disable_unprepare(keypad_data->fck); 268 262 269 263 pm_runtime_mark_last_busy(dev); 270 264 pm_runtime_put_autosuspend(dev); ··· 364 356 } 365 357 366 358 keypad_data->irq = irq; 359 + keypad_data->fck = devm_clk_get(&pdev->dev, "fck"); 360 + if (IS_ERR(keypad_data->fck)) 361 + return dev_err_probe(&pdev->dev, PTR_ERR(keypad_data->fck), 362 + "unable to get fck"); 363 + 367 364 mutex_init(&keypad_data->lock); 368 365 platform_set_drvdata(pdev, keypad_data); 369 366
+1 -1
drivers/input/keyboard/qt1050.c
··· 213 213 .val_bits = 8, 214 214 .max_register = QT1050_RES_CAL, 215 215 216 - .cache_type = REGCACHE_RBTREE, 216 + .cache_type = REGCACHE_MAPLE, 217 217 218 218 .wr_table = &qt1050_writeable_table, 219 219 .rd_table = &qt1050_readable_table,
-1
drivers/input/keyboard/tca6416-keypad.c
··· 14 14 #include <linux/slab.h> 15 15 #include <linux/interrupt.h> 16 16 #include <linux/workqueue.h> 17 - #include <linux/gpio.h> 18 17 #include <linux/i2c.h> 19 18 #include <linux/input.h> 20 19 #include <linux/tca6416_keypad.h>
+26 -43
drivers/input/misc/da9063_onkey.c
··· 9 9 #include <linux/errno.h> 10 10 #include <linux/input.h> 11 11 #include <linux/interrupt.h> 12 + #include <linux/mod_devicetable.h> 12 13 #include <linux/platform_device.h> 13 14 #include <linux/pm_wakeirq.h> 15 + #include <linux/property.h> 14 16 #include <linux/workqueue.h> 15 17 #include <linux/regmap.h> 16 - #include <linux/of.h> 17 18 #include <linux/mfd/da9063/core.h> 18 19 #include <linux/mfd/da9063/registers.h> 19 20 #include <linux/mfd/da9062/core.h> ··· 74 73 /* NAMES */ 75 74 .name = "da9062-onkey", 76 75 }; 77 - 78 - static const struct of_device_id da9063_compatible_reg_id_table[] = { 79 - { .compatible = "dlg,da9063-onkey", .data = &da9063_regs }, 80 - { .compatible = "dlg,da9062-onkey", .data = &da9062_regs }, 81 - { }, 82 - }; 83 - MODULE_DEVICE_TABLE(of, da9063_compatible_reg_id_table); 84 76 85 77 static void da9063_poll_on(struct work_struct *work) 86 78 { ··· 181 187 static int da9063_onkey_probe(struct platform_device *pdev) 182 188 { 183 189 struct da9063_onkey *onkey; 184 - const struct of_device_id *match; 185 - int irq; 186 190 int error; 187 - 188 - match = of_match_node(da9063_compatible_reg_id_table, 189 - pdev->dev.of_node); 190 - if (!match) 191 - return -ENXIO; 191 + int irq; 192 192 193 193 onkey = devm_kzalloc(&pdev->dev, sizeof(struct da9063_onkey), 194 194 GFP_KERNEL); 195 - if (!onkey) { 196 - dev_err(&pdev->dev, "Failed to allocate memory.\n"); 195 + if (!onkey) 197 196 return -ENOMEM; 198 - } 199 197 200 - onkey->config = match->data; 198 + onkey->config = device_get_match_data(&pdev->dev); 199 + if (!onkey->config) 200 + return -ENXIO; 201 + 201 202 onkey->dev = &pdev->dev; 202 203 203 204 onkey->regmap = dev_get_regmap(pdev->dev.parent, NULL); 204 - if (!onkey->regmap) { 205 - dev_err(&pdev->dev, "Parent regmap unavailable.\n"); 206 - return -ENXIO; 207 - } 205 + if (!onkey->regmap) 206 + return dev_err_probe(&pdev->dev, -ENXIO, 207 + "Parent regmap unavailable.\n"); 208 208 209 - onkey->key_power = !of_property_read_bool(pdev->dev.of_node, 210 - "dlg,disable-key-power"); 209 + onkey->key_power = !device_property_read_bool(&pdev->dev, 210 + "dlg,disable-key-power"); 211 211 212 212 onkey->input = devm_input_allocate_device(&pdev->dev); 213 - if (!onkey->input) { 214 - dev_err(&pdev->dev, "Failed to allocated input device.\n"); 213 + if (!onkey->input) 215 214 return -ENOMEM; 216 - } 217 215 218 216 onkey->input->name = onkey->config->name; 219 217 snprintf(onkey->phys, sizeof(onkey->phys), "%s/input0", 220 218 onkey->config->name); 221 219 onkey->input->phys = onkey->phys; 222 - onkey->input->dev.parent = &pdev->dev; 223 220 224 221 input_set_capability(onkey->input, EV_KEY, KEY_POWER); 225 222 226 223 error = devm_delayed_work_autocancel(&pdev->dev, &onkey->work, 227 224 da9063_poll_on); 228 - if (error) { 229 - dev_err(&pdev->dev, 230 - "Failed to add cancel poll action: %d\n", 231 - error); 225 + if (error) 232 226 return error; 233 - } 234 227 235 228 irq = platform_get_irq_byname(pdev, "ONKEY"); 236 229 if (irq < 0) ··· 227 246 NULL, da9063_onkey_irq_handler, 228 247 IRQF_TRIGGER_LOW | IRQF_ONESHOT, 229 248 "ONKEY", onkey); 230 - if (error) { 231 - dev_err(&pdev->dev, 232 - "Failed to request IRQ %d: %d\n", irq, error); 233 - return error; 234 - } 249 + if (error) 250 + return dev_err_probe(&pdev->dev, error, 251 + "Failed to allocate onkey IRQ\n"); 235 252 236 253 error = dev_pm_set_wake_irq(&pdev->dev, irq); 237 254 if (error) ··· 240 261 device_init_wakeup(&pdev->dev, true); 241 262 242 263 error = input_register_device(onkey->input); 243 - if (error) { 244 - dev_err(&pdev->dev, 245 - "Failed to register input device: %d\n", error); 264 + if (error) 246 265 return error; 247 - } 248 266 249 267 return 0; 250 268 } 269 + 270 + static const struct of_device_id da9063_compatible_reg_id_table[] = { 271 + { .compatible = "dlg,da9063-onkey", .data = &da9063_regs }, 272 + { .compatible = "dlg,da9062-onkey", .data = &da9062_regs }, 273 + { } 274 + }; 275 + MODULE_DEVICE_TABLE(of, da9063_compatible_reg_id_table); 251 276 252 277 static struct platform_driver da9063_onkey_driver = { 253 278 .probe = da9063_onkey_probe,
+5 -5
drivers/input/misc/ims-pcu.c
··· 1050 1050 container_of(dattr, struct ims_pcu_attribute, dattr); 1051 1051 char *field = (char *)pcu + attr->field_offset; 1052 1052 1053 - return scnprintf(buf, PAGE_SIZE, "%.*s\n", attr->field_length, field); 1053 + return sysfs_emit(buf, "%.*s\n", attr->field_length, field); 1054 1054 } 1055 1055 1056 1056 static ssize_t ims_pcu_attribute_store(struct device *dev, ··· 1206 1206 struct usb_interface *intf = to_usb_interface(dev); 1207 1207 struct ims_pcu *pcu = usb_get_intfdata(intf); 1208 1208 1209 - return scnprintf(buf, PAGE_SIZE, "%d\n", pcu->update_firmware_status); 1209 + return sysfs_emit(buf, "%d\n", pcu->update_firmware_status); 1210 1210 } 1211 1211 1212 1212 static DEVICE_ATTR(update_firmware_status, S_IRUGO, ··· 1309 1309 if (error) 1310 1310 return error; 1311 1311 1312 - return scnprintf(buf, PAGE_SIZE, "%x\n", data); 1312 + return sysfs_emit(buf, "%x\n", data); 1313 1313 } 1314 1314 1315 1315 static ssize_t ims_pcu_ofn_reg_data_store(struct device *dev, ··· 1344 1344 int error; 1345 1345 1346 1346 mutex_lock(&pcu->cmd_mutex); 1347 - error = scnprintf(buf, PAGE_SIZE, "%x\n", pcu->ofn_reg_addr); 1347 + error = sysfs_emit(buf, "%x\n", pcu->ofn_reg_addr); 1348 1348 mutex_unlock(&pcu->cmd_mutex); 1349 1349 1350 1350 return error; ··· 1397 1397 if (error) 1398 1398 return error; 1399 1399 1400 - return scnprintf(buf, PAGE_SIZE, "%d\n", !!(data & (1 << attr->nr))); 1400 + return sysfs_emit(buf, "%d\n", !!(data & (1 << attr->nr))); 1401 1401 } 1402 1402 1403 1403 static ssize_t ims_pcu_ofn_bit_store(struct device *dev,
+291 -44
drivers/input/misc/iqs269a.c
··· 9 9 * axial sliders presented by the device. 10 10 */ 11 11 12 + #include <linux/bits.h> 12 13 #include <linux/completion.h> 13 14 #include <linux/delay.h> 14 15 #include <linux/device.h> ··· 27 26 28 27 #define IQS269_VER_INFO 0x00 29 28 #define IQS269_VER_INFO_PROD_NUM 0x4F 29 + #define IQS269_VER_INFO_FW_NUM_2 0x03 30 + #define IQS269_VER_INFO_FW_NUM_3 0x10 30 31 31 32 #define IQS269_SYS_FLAGS 0x02 32 33 #define IQS269_SYS_FLAGS_SHOW_RESET BIT(15) ··· 56 53 #define IQS269_SYS_SETTINGS_ULP_UPDATE_MASK GENMASK(10, 8) 57 54 #define IQS269_SYS_SETTINGS_ULP_UPDATE_SHIFT 8 58 55 #define IQS269_SYS_SETTINGS_ULP_UPDATE_MAX 7 56 + #define IQS269_SYS_SETTINGS_SLIDER_SWIPE BIT(7) 59 57 #define IQS269_SYS_SETTINGS_RESEED_OFFSET BIT(6) 60 58 #define IQS269_SYS_SETTINGS_EVENT_MODE BIT(5) 61 59 #define IQS269_SYS_SETTINGS_EVENT_MODE_LP BIT(4) ··· 73 69 #define IQS269_FILT_STR_MAX 3 74 70 75 71 #define IQS269_EVENT_MASK_SYS BIT(6) 72 + #define IQS269_EVENT_MASK_GESTURE BIT(3) 76 73 #define IQS269_EVENT_MASK_DEEP BIT(2) 77 74 #define IQS269_EVENT_MASK_TOUCH BIT(1) 78 75 #define IQS269_EVENT_MASK_PROX BIT(0) ··· 101 96 #define IQS269_MISC_B_RESEED_UI_SEL_MAX 3 102 97 #define IQS269_MISC_B_TRACKING_UI_ENABLE BIT(4) 103 98 #define IQS269_MISC_B_FILT_STR_SLIDER GENMASK(1, 0) 99 + 100 + #define IQS269_TOUCH_HOLD_SLIDER_SEL 0x89 101 + #define IQS269_TOUCH_HOLD_DEFAULT 0x14 102 + #define IQS269_TOUCH_HOLD_MS_MIN 256 103 + #define IQS269_TOUCH_HOLD_MS_MAX 65280 104 + 105 + #define IQS269_TIMEOUT_TAP_MS_MAX 4080 106 + #define IQS269_TIMEOUT_SWIPE_MS_MAX 4080 107 + #define IQS269_THRESH_SWIPE_MAX 255 104 108 105 109 #define IQS269_CHx_ENG_A_MEAS_CAP_SIZE BIT(15) 106 110 #define IQS269_CHx_ENG_A_RX_GND_INACTIVE BIT(13) ··· 156 142 157 143 #define IQS269_MAX_REG 0xFF 158 144 145 + #define IQS269_OTP_OPTION_DEFAULT 0x00 146 + #define IQS269_OTP_OPTION_TWS 0xD0 147 + #define IQS269_OTP_OPTION_HOLD BIT(7) 148 + 159 149 #define IQS269_NUM_CH 8 160 150 #define IQS269_NUM_SL 2 161 151 ··· 191 173 IQS269_EVENT_TOUCH_UP, 192 174 IQS269_EVENT_DEEP_DN, 193 175 IQS269_EVENT_DEEP_UP, 176 + }; 177 + 178 + enum iqs269_slider_id { 179 + IQS269_SLIDER_NONE, 180 + IQS269_SLIDER_KEY, 181 + IQS269_SLIDER_RAW, 182 + }; 183 + 184 + enum iqs269_gesture_id { 185 + IQS269_GESTURE_TAP, 186 + IQS269_GESTURE_HOLD, 187 + IQS269_GESTURE_FLICK_POS, 188 + IQS269_GESTURE_FLICK_NEG, 189 + IQS269_NUM_GESTURES, 194 190 }; 195 191 196 192 struct iqs269_switch_desc { ··· 266 234 u8 prod_num; 267 235 u8 sw_num; 268 236 u8 hw_num; 269 - u8 padding; 237 + u8 fw_num; 270 238 } __packed; 271 239 272 240 struct iqs269_ch_reg { ··· 317 285 struct regmap *regmap; 318 286 struct mutex lock; 319 287 struct iqs269_switch_desc switches[ARRAY_SIZE(iqs269_events)]; 288 + struct iqs269_ver_info ver_info; 320 289 struct iqs269_sys_reg sys_reg; 321 290 struct completion ati_done; 322 291 struct input_dev *keypad; 323 292 struct input_dev *slider[IQS269_NUM_SL]; 324 293 unsigned int keycode[ARRAY_SIZE(iqs269_events) * IQS269_NUM_CH]; 294 + unsigned int sl_code[IQS269_NUM_SL][IQS269_NUM_GESTURES]; 295 + unsigned int otp_option; 325 296 unsigned int ch_num; 326 297 bool hall_enable; 327 298 bool ati_current; 328 299 }; 300 + 301 + static enum iqs269_slider_id iqs269_slider_type(struct iqs269_private *iqs269, 302 + int slider_num) 303 + { 304 + int i; 305 + 306 + /* 307 + * Slider 1 is unavailable if the touch-and-hold option is enabled via 308 + * OTP. In that case, the channel selection register is repurposed for 309 + * the touch-and-hold timer ceiling. 310 + */ 311 + if (slider_num && (iqs269->otp_option & IQS269_OTP_OPTION_HOLD)) 312 + return IQS269_SLIDER_NONE; 313 + 314 + if (!iqs269->sys_reg.slider_select[slider_num]) 315 + return IQS269_SLIDER_NONE; 316 + 317 + for (i = 0; i < IQS269_NUM_GESTURES; i++) 318 + if (iqs269->sl_code[slider_num][i] != KEY_RESERVED) 319 + return IQS269_SLIDER_KEY; 320 + 321 + return IQS269_SLIDER_RAW; 322 + } 329 323 330 324 static int iqs269_ati_mode_set(struct iqs269_private *iqs269, 331 325 unsigned int ch_num, unsigned int mode) ··· 583 525 if (fwnode_property_present(ch_node, "azoteq,slider0-select")) 584 526 iqs269->sys_reg.slider_select[0] |= BIT(reg); 585 527 586 - if (fwnode_property_present(ch_node, "azoteq,slider1-select")) 528 + if (fwnode_property_present(ch_node, "azoteq,slider1-select") && 529 + !(iqs269->otp_option & IQS269_OTP_OPTION_HOLD)) 587 530 iqs269->sys_reg.slider_select[1] |= BIT(reg); 588 531 589 532 ch_reg = &iqs269->sys_reg.ch_reg[reg]; ··· 1009 950 sys_reg->blocking = 0; 1010 951 1011 952 sys_reg->slider_select[0] = 0; 1012 - sys_reg->slider_select[1] = 0; 953 + 954 + /* 955 + * If configured via OTP to do so, the device asserts a pulse on the 956 + * GPIO4 pin for approximately 60 ms once a selected channel is held 957 + * in a state of touch for a configurable length of time. 958 + * 959 + * In that case, the register used for slider 1 channel selection is 960 + * repurposed for the touch-and-hold timer ceiling. 961 + */ 962 + if (iqs269->otp_option & IQS269_OTP_OPTION_HOLD) { 963 + if (!device_property_read_u32(&client->dev, 964 + "azoteq,touch-hold-ms", &val)) { 965 + if (val < IQS269_TOUCH_HOLD_MS_MIN || 966 + val > IQS269_TOUCH_HOLD_MS_MAX) { 967 + dev_err(&client->dev, 968 + "Invalid touch-and-hold ceiling: %u\n", 969 + val); 970 + return -EINVAL; 971 + } 972 + 973 + sys_reg->slider_select[1] = val / 256; 974 + } else if (iqs269->ver_info.fw_num < IQS269_VER_INFO_FW_NUM_3) { 975 + /* 976 + * The default touch-and-hold timer ceiling initially 977 + * read from early revisions of silicon is invalid if 978 + * the device experienced a soft reset between power- 979 + * on and the read operation. 980 + * 981 + * To protect against this case, explicitly cache the 982 + * default value so that it is restored each time the 983 + * device is re-initialized. 984 + */ 985 + sys_reg->slider_select[1] = IQS269_TOUCH_HOLD_DEFAULT; 986 + } 987 + } else { 988 + sys_reg->slider_select[1] = 0; 989 + } 1013 990 1014 991 sys_reg->event_mask = ~((u8)IQS269_EVENT_MASK_SYS); 1015 992 ··· 1099 1004 general |= (val << IQS269_SYS_SETTINGS_ULP_UPDATE_SHIFT); 1100 1005 } 1101 1006 1007 + if (device_property_present(&client->dev, "linux,keycodes")) { 1008 + int scale = 1; 1009 + int count = device_property_count_u32(&client->dev, 1010 + "linux,keycodes"); 1011 + if (count > IQS269_NUM_GESTURES * IQS269_NUM_SL) { 1012 + dev_err(&client->dev, "Too many keycodes present\n"); 1013 + return -EINVAL; 1014 + } else if (count < 0) { 1015 + dev_err(&client->dev, "Failed to count keycodes: %d\n", 1016 + count); 1017 + return count; 1018 + } 1019 + 1020 + error = device_property_read_u32_array(&client->dev, 1021 + "linux,keycodes", 1022 + *iqs269->sl_code, count); 1023 + if (error) { 1024 + dev_err(&client->dev, "Failed to read keycodes: %d\n", 1025 + error); 1026 + return error; 1027 + } 1028 + 1029 + if (device_property_present(&client->dev, 1030 + "azoteq,gesture-swipe")) 1031 + general |= IQS269_SYS_SETTINGS_SLIDER_SWIPE; 1032 + 1033 + /* 1034 + * Early revisions of silicon use a more granular step size for 1035 + * tap and swipe gesture timeouts; scale them appropriately. 1036 + */ 1037 + if (iqs269->ver_info.fw_num < IQS269_VER_INFO_FW_NUM_3) 1038 + scale = 4; 1039 + 1040 + if (!device_property_read_u32(&client->dev, 1041 + "azoteq,timeout-tap-ms", &val)) { 1042 + if (val > IQS269_TIMEOUT_TAP_MS_MAX / scale) { 1043 + dev_err(&client->dev, "Invalid timeout: %u\n", 1044 + val); 1045 + return -EINVAL; 1046 + } 1047 + 1048 + sys_reg->timeout_tap = val / (16 / scale); 1049 + } 1050 + 1051 + if (!device_property_read_u32(&client->dev, 1052 + "azoteq,timeout-swipe-ms", 1053 + &val)) { 1054 + if (val > IQS269_TIMEOUT_SWIPE_MS_MAX / scale) { 1055 + dev_err(&client->dev, "Invalid timeout: %u\n", 1056 + val); 1057 + return -EINVAL; 1058 + } 1059 + 1060 + sys_reg->timeout_swipe = val / (16 / scale); 1061 + } 1062 + 1063 + if (!device_property_read_u32(&client->dev, 1064 + "azoteq,thresh-swipe", &val)) { 1065 + if (val > IQS269_THRESH_SWIPE_MAX) { 1066 + dev_err(&client->dev, "Invalid threshold: %u\n", 1067 + val); 1068 + return -EINVAL; 1069 + } 1070 + 1071 + sys_reg->thresh_swipe = val; 1072 + } 1073 + 1074 + sys_reg->event_mask &= ~IQS269_EVENT_MASK_GESTURE; 1075 + } 1076 + 1102 1077 general &= ~IQS269_SYS_SETTINGS_RESEED_OFFSET; 1103 1078 if (device_property_present(&client->dev, "azoteq,reseed-offset")) 1104 1079 general |= IQS269_SYS_SETTINGS_RESEED_OFFSET; ··· 1177 1012 1178 1013 /* 1179 1014 * As per the datasheet, enable streaming during normal-power mode if 1180 - * either slider is in use. In that case, the device returns to event 1181 - * mode during low-power mode. 1015 + * raw coordinates will be read from either slider. In that case, the 1016 + * device returns to event mode during low-power mode. 1182 1017 */ 1183 - if (sys_reg->slider_select[0] || sys_reg->slider_select[1]) 1018 + if (iqs269_slider_type(iqs269, 0) == IQS269_SLIDER_RAW || 1019 + iqs269_slider_type(iqs269, 1) == IQS269_SLIDER_RAW) 1184 1020 general |= IQS269_SYS_SETTINGS_EVENT_MODE_LP; 1185 1021 1186 1022 general |= IQS269_SYS_SETTINGS_REDO_ATI; ··· 1192 1026 return 0; 1193 1027 } 1194 1028 1029 + static const struct reg_sequence iqs269_tws_init[] = { 1030 + { IQS269_TOUCH_HOLD_SLIDER_SEL, IQS269_TOUCH_HOLD_DEFAULT }, 1031 + { 0xF0, 0x580F }, 1032 + { 0xF0, 0x59EF }, 1033 + }; 1034 + 1195 1035 static int iqs269_dev_init(struct iqs269_private *iqs269) 1196 1036 { 1197 1037 int error; 1198 1038 1199 1039 mutex_lock(&iqs269->lock); 1040 + 1041 + /* 1042 + * Early revisions of silicon require the following workaround in order 1043 + * to restore any OTP-enabled functionality after a soft reset. 1044 + */ 1045 + if (iqs269->otp_option == IQS269_OTP_OPTION_TWS && 1046 + iqs269->ver_info.fw_num < IQS269_VER_INFO_FW_NUM_3) { 1047 + error = regmap_multi_reg_write(iqs269->regmap, iqs269_tws_init, 1048 + ARRAY_SIZE(iqs269_tws_init)); 1049 + if (error) 1050 + goto err_mutex; 1051 + } 1200 1052 1201 1053 error = regmap_update_bits(iqs269->regmap, IQS269_HALL_UI, 1202 1054 IQS269_HALL_UI_ENABLE, ··· 1290 1106 } 1291 1107 1292 1108 for (i = 0; i < IQS269_NUM_SL; i++) { 1293 - if (!iqs269->sys_reg.slider_select[i]) 1109 + if (iqs269_slider_type(iqs269, i) == IQS269_SLIDER_NONE) 1294 1110 continue; 1295 1111 1296 1112 iqs269->slider[i] = devm_input_allocate_device(&client->dev); 1297 1113 if (!iqs269->slider[i]) 1298 1114 return -ENOMEM; 1299 1115 1116 + iqs269->slider[i]->keycodemax = ARRAY_SIZE(iqs269->sl_code[i]); 1117 + iqs269->slider[i]->keycode = iqs269->sl_code[i]; 1118 + iqs269->slider[i]->keycodesize = sizeof(**iqs269->sl_code); 1119 + 1300 1120 iqs269->slider[i]->name = i ? "iqs269a_slider_1" 1301 1121 : "iqs269a_slider_0"; 1302 1122 iqs269->slider[i]->id.bustype = BUS_I2C; 1303 1123 1304 - input_set_capability(iqs269->slider[i], EV_KEY, BTN_TOUCH); 1305 - input_set_abs_params(iqs269->slider[i], ABS_X, 0, 255, 0, 0); 1124 + for (j = 0; j < IQS269_NUM_GESTURES; j++) 1125 + if (iqs269->sl_code[i][j] != KEY_RESERVED) 1126 + input_set_capability(iqs269->slider[i], EV_KEY, 1127 + iqs269->sl_code[i][j]); 1128 + 1129 + /* 1130 + * Present the slider as a narrow trackpad if one or more chan- 1131 + * nels have been selected to participate, but no gestures have 1132 + * been mapped to a keycode. 1133 + */ 1134 + if (iqs269_slider_type(iqs269, i) == IQS269_SLIDER_RAW) { 1135 + input_set_capability(iqs269->slider[i], 1136 + EV_KEY, BTN_TOUCH); 1137 + input_set_abs_params(iqs269->slider[i], 1138 + ABS_X, 0, 255, 0, 0); 1139 + } 1306 1140 1307 1141 error = input_register_device(iqs269->slider[i]); 1308 1142 if (error) { ··· 1369 1167 if (be16_to_cpu(flags.system) & IQS269_SYS_FLAGS_IN_ATI) 1370 1168 return 0; 1371 1169 1372 - error = regmap_raw_read(iqs269->regmap, IQS269_SLIDER_X, slider_x, 1373 - sizeof(slider_x)); 1374 - if (error) { 1375 - dev_err(&client->dev, "Failed to read slider position: %d\n", 1376 - error); 1377 - return error; 1170 + if (iqs269_slider_type(iqs269, 0) == IQS269_SLIDER_RAW || 1171 + iqs269_slider_type(iqs269, 1) == IQS269_SLIDER_RAW) { 1172 + error = regmap_raw_read(iqs269->regmap, IQS269_SLIDER_X, 1173 + slider_x, sizeof(slider_x)); 1174 + if (error) { 1175 + dev_err(&client->dev, 1176 + "Failed to read slider position: %d\n", error); 1177 + return error; 1178 + } 1378 1179 } 1379 1180 1380 1181 for (i = 0; i < IQS269_NUM_SL; i++) { 1381 - if (!iqs269->sys_reg.slider_select[i]) 1182 + flags.gesture >>= (i * IQS269_NUM_GESTURES); 1183 + 1184 + switch (iqs269_slider_type(iqs269, i)) { 1185 + case IQS269_SLIDER_NONE: 1382 1186 continue; 1383 1187 1384 - /* 1385 - * Report BTN_TOUCH if any channel that participates in the 1386 - * slider is in a state of touch. 1387 - */ 1388 - if (flags.states[IQS269_ST_OFFS_TOUCH] & 1389 - iqs269->sys_reg.slider_select[i]) { 1390 - input_report_key(iqs269->slider[i], BTN_TOUCH, 1); 1391 - input_report_abs(iqs269->slider[i], ABS_X, slider_x[i]); 1392 - } else { 1393 - input_report_key(iqs269->slider[i], BTN_TOUCH, 0); 1188 + case IQS269_SLIDER_KEY: 1189 + for (j = 0; j < IQS269_NUM_GESTURES; j++) 1190 + input_report_key(iqs269->slider[i], 1191 + iqs269->sl_code[i][j], 1192 + flags.gesture & BIT(j)); 1193 + 1194 + if (!(flags.gesture & (BIT(IQS269_GESTURE_FLICK_NEG) | 1195 + BIT(IQS269_GESTURE_FLICK_POS) | 1196 + BIT(IQS269_GESTURE_TAP)))) 1197 + break; 1198 + 1199 + input_sync(iqs269->slider[i]); 1200 + 1201 + /* 1202 + * Momentary gestures are followed by a complementary 1203 + * release cycle so as to emulate a full keystroke. 1204 + */ 1205 + for (j = 0; j < IQS269_NUM_GESTURES; j++) 1206 + if (j != IQS269_GESTURE_HOLD) 1207 + input_report_key(iqs269->slider[i], 1208 + iqs269->sl_code[i][j], 1209 + 0); 1210 + break; 1211 + 1212 + case IQS269_SLIDER_RAW: 1213 + /* 1214 + * The slider is considered to be in a state of touch 1215 + * if any selected channels are in a state of touch. 1216 + */ 1217 + state = flags.states[IQS269_ST_OFFS_TOUCH]; 1218 + state &= iqs269->sys_reg.slider_select[i]; 1219 + 1220 + input_report_key(iqs269->slider[i], BTN_TOUCH, state); 1221 + 1222 + if (state) 1223 + input_report_abs(iqs269->slider[i], 1224 + ABS_X, slider_x[i]); 1225 + break; 1394 1226 } 1395 1227 1396 1228 input_sync(iqs269->slider[i]); ··· 1522 1286 if (error) 1523 1287 return error; 1524 1288 1525 - return scnprintf(buf, PAGE_SIZE, "%u\n", le16_to_cpu(counts)); 1289 + return sysfs_emit(buf, "%u\n", le16_to_cpu(counts)); 1526 1290 } 1527 1291 1528 1292 static ssize_t hall_bin_show(struct device *dev, ··· 1560 1324 return -EINVAL; 1561 1325 } 1562 1326 1563 - return scnprintf(buf, PAGE_SIZE, "%u\n", val); 1327 + return sysfs_emit(buf, "%u\n", val); 1564 1328 } 1565 1329 1566 1330 static ssize_t hall_enable_show(struct device *dev, ··· 1568 1332 { 1569 1333 struct iqs269_private *iqs269 = dev_get_drvdata(dev); 1570 1334 1571 - return scnprintf(buf, PAGE_SIZE, "%u\n", iqs269->hall_enable); 1335 + return sysfs_emit(buf, "%u\n", iqs269->hall_enable); 1572 1336 } 1573 1337 1574 1338 static ssize_t hall_enable_store(struct device *dev, ··· 1598 1362 { 1599 1363 struct iqs269_private *iqs269 = dev_get_drvdata(dev); 1600 1364 1601 - return scnprintf(buf, PAGE_SIZE, "%u\n", iqs269->ch_num); 1365 + return sysfs_emit(buf, "%u\n", iqs269->ch_num); 1602 1366 } 1603 1367 1604 1368 static ssize_t ch_number_store(struct device *dev, ··· 1627 1391 struct iqs269_private *iqs269 = dev_get_drvdata(dev); 1628 1392 struct iqs269_ch_reg *ch_reg = iqs269->sys_reg.ch_reg; 1629 1393 1630 - return scnprintf(buf, PAGE_SIZE, "%u\n", 1631 - ch_reg[iqs269->ch_num].rx_enable); 1394 + return sysfs_emit(buf, "%u\n", ch_reg[iqs269->ch_num].rx_enable); 1632 1395 } 1633 1396 1634 1397 static ssize_t rx_enable_store(struct device *dev, ··· 1667 1432 if (error) 1668 1433 return error; 1669 1434 1670 - return scnprintf(buf, PAGE_SIZE, "%u\n", val); 1435 + return sysfs_emit(buf, "%u\n", val); 1671 1436 } 1672 1437 1673 1438 static ssize_t ati_mode_store(struct device *dev, ··· 1700 1465 if (error) 1701 1466 return error; 1702 1467 1703 - return scnprintf(buf, PAGE_SIZE, "%u\n", val); 1468 + return sysfs_emit(buf, "%u\n", val); 1704 1469 } 1705 1470 1706 1471 static ssize_t ati_base_store(struct device *dev, ··· 1733 1498 if (error) 1734 1499 return error; 1735 1500 1736 - return scnprintf(buf, PAGE_SIZE, "%u\n", val); 1501 + return sysfs_emit(buf, "%u\n", val); 1737 1502 } 1738 1503 1739 1504 static ssize_t ati_target_store(struct device *dev, ··· 1760 1525 { 1761 1526 struct iqs269_private *iqs269 = dev_get_drvdata(dev); 1762 1527 1763 - return scnprintf(buf, PAGE_SIZE, "%u\n", 1764 - iqs269->ati_current && 1765 - completion_done(&iqs269->ati_done)); 1528 + return sysfs_emit(buf, "%u\n", 1529 + iqs269->ati_current && 1530 + completion_done(&iqs269->ati_done)); 1766 1531 } 1767 1532 1768 1533 static ssize_t ati_trigger_store(struct device *dev, ··· 1831 1596 1832 1597 static int iqs269_probe(struct i2c_client *client) 1833 1598 { 1834 - struct iqs269_ver_info ver_info; 1835 1599 struct iqs269_private *iqs269; 1836 1600 int error; 1837 1601 ··· 1852 1618 mutex_init(&iqs269->lock); 1853 1619 init_completion(&iqs269->ati_done); 1854 1620 1855 - error = regmap_raw_read(iqs269->regmap, IQS269_VER_INFO, &ver_info, 1856 - sizeof(ver_info)); 1621 + iqs269->otp_option = (uintptr_t)device_get_match_data(&client->dev); 1622 + 1623 + error = regmap_raw_read(iqs269->regmap, IQS269_VER_INFO, 1624 + &iqs269->ver_info, sizeof(iqs269->ver_info)); 1857 1625 if (error) 1858 1626 return error; 1859 1627 1860 - if (ver_info.prod_num != IQS269_VER_INFO_PROD_NUM) { 1628 + if (iqs269->ver_info.prod_num != IQS269_VER_INFO_PROD_NUM) { 1861 1629 dev_err(&client->dev, "Unrecognized product number: 0x%02X\n", 1862 - ver_info.prod_num); 1630 + iqs269->ver_info.prod_num); 1863 1631 return -EINVAL; 1864 1632 } 1865 1633 ··· 1964 1728 static DEFINE_SIMPLE_DEV_PM_OPS(iqs269_pm, iqs269_suspend, iqs269_resume); 1965 1729 1966 1730 static const struct of_device_id iqs269_of_match[] = { 1967 - { .compatible = "azoteq,iqs269a" }, 1731 + { 1732 + .compatible = "azoteq,iqs269a", 1733 + .data = (void *)IQS269_OTP_OPTION_DEFAULT, 1734 + }, 1735 + { 1736 + .compatible = "azoteq,iqs269a-00", 1737 + .data = (void *)IQS269_OTP_OPTION_DEFAULT, 1738 + }, 1739 + { 1740 + .compatible = "azoteq,iqs269a-d0", 1741 + .data = (void *)IQS269_OTP_OPTION_TWS, 1742 + }, 1968 1743 { } 1969 1744 }; 1970 1745 MODULE_DEVICE_TABLE(of, iqs269_of_match);
+11 -3
drivers/input/misc/max77693-haptic.c
··· 307 307 haptic->suspend_state = false; 308 308 309 309 /* Variant-specific init */ 310 - haptic->dev_type = platform_get_device_id(pdev)->driver_data; 310 + haptic->dev_type = max77693->type; 311 311 switch (haptic->dev_type) { 312 312 case TYPE_MAX77693: 313 313 haptic->regmap_haptic = max77693->regmap_haptic; ··· 406 406 max77693_haptic_resume); 407 407 408 408 static const struct platform_device_id max77693_haptic_id[] = { 409 - { "max77693-haptic", TYPE_MAX77693 }, 410 - { "max77843-haptic", TYPE_MAX77843 }, 409 + { "max77693-haptic", }, 410 + { "max77843-haptic", }, 411 411 {}, 412 412 }; 413 413 MODULE_DEVICE_TABLE(platform, max77693_haptic_id); 414 + 415 + static const struct of_device_id of_max77693_haptic_dt_match[] = { 416 + { .compatible = "maxim,max77693-haptic", }, 417 + { .compatible = "maxim,max77843-haptic", }, 418 + { /* sentinel */ }, 419 + }; 420 + MODULE_DEVICE_TABLE(of, of_max77693_haptic_dt_match); 414 421 415 422 static struct platform_driver max77693_haptic_driver = { 416 423 .driver = { 417 424 .name = "max77693-haptic", 418 425 .pm = pm_sleep_ptr(&max77693_haptic_pm_ops), 426 + .of_match_table = of_max77693_haptic_dt_match, 419 427 }, 420 428 .probe = max77693_haptic_probe, 421 429 .id_table = max77693_haptic_id,
+11 -11
drivers/input/mouse/cyapa.c
··· 756 756 757 757 switch (pwr_cmd) { 758 758 case PWR_MODE_BTN_ONLY: 759 - len = scnprintf(buf, PAGE_SIZE, "%s\n", BTN_ONLY_MODE_NAME); 759 + len = sysfs_emit(buf, "%s\n", BTN_ONLY_MODE_NAME); 760 760 break; 761 761 762 762 case PWR_MODE_OFF: 763 - len = scnprintf(buf, PAGE_SIZE, "%s\n", OFF_MODE_NAME); 763 + len = sysfs_emit(buf, "%s\n", OFF_MODE_NAME); 764 764 break; 765 765 766 766 default: 767 - len = scnprintf(buf, PAGE_SIZE, "%u\n", 768 - cyapa->gen == CYAPA_GEN3 ? 767 + len = sysfs_emit(buf, "%u\n", 768 + cyapa->gen == CYAPA_GEN3 ? 769 769 cyapa_pwr_cmd_to_sleep_time(pwr_cmd) : 770 770 sleep_time); 771 771 break; ··· 877 877 878 878 mutex_unlock(&cyapa->state_sync_lock); 879 879 880 - return scnprintf(buf, PAGE_SIZE, "%u\n", 881 - cyapa->gen == CYAPA_GEN3 ? 880 + return sysfs_emit(buf, "%u\n", 881 + cyapa->gen == CYAPA_GEN3 ? 882 882 cyapa_pwr_cmd_to_sleep_time(pwr_cmd) : 883 883 sleep_time); 884 884 } ··· 988 988 error = mutex_lock_interruptible(&cyapa->state_sync_lock); 989 989 if (error) 990 990 return error; 991 - error = scnprintf(buf, PAGE_SIZE, "%d.%d\n", cyapa->fw_maj_ver, 992 - cyapa->fw_min_ver); 991 + error = sysfs_emit(buf, "%d.%d\n", 992 + cyapa->fw_maj_ver, cyapa->fw_min_ver); 993 993 mutex_unlock(&cyapa->state_sync_lock); 994 994 return error; 995 995 } ··· 1004 1004 error = mutex_lock_interruptible(&cyapa->state_sync_lock); 1005 1005 if (error) 1006 1006 return error; 1007 - size = scnprintf(buf, PAGE_SIZE, "%s\n", cyapa->product_id); 1007 + size = sysfs_emit(buf, "%s\n", cyapa->product_id); 1008 1008 mutex_unlock(&cyapa->state_sync_lock); 1009 1009 return size; 1010 1010 } ··· 1209 1209 if (error) 1210 1210 return error; 1211 1211 1212 - size = scnprintf(buf, PAGE_SIZE, "gen%d %s\n", 1213 - cyapa->gen, cyapa_state_to_string(cyapa)); 1212 + size = sysfs_emit(buf, "gen%d %s\n", 1213 + cyapa->gen, cyapa_state_to_string(cyapa)); 1214 1214 1215 1215 mutex_unlock(&cyapa->state_sync_lock); 1216 1216 return size;
+1 -1
drivers/input/mouse/cyapa_gen3.c
··· 860 860 861 861 dev_dbg(dev, "Baseline report successful. Max: %d Min: %d\n", 862 862 max_baseline, min_baseline); 863 - ret = scnprintf(buf, PAGE_SIZE, "%d %d\n", max_baseline, min_baseline); 863 + ret = sysfs_emit(buf, "%d %d\n", max_baseline, min_baseline); 864 864 865 865 out: 866 866 return ret;
+2 -2
drivers/input/mouse/cyapa_gen5.c
··· 2418 2418 return resume_error ? resume_error : error; 2419 2419 2420 2420 /* 12. Output data strings */ 2421 - size = scnprintf(buf, PAGE_SIZE, "%d %d %d %d %d %d %d %d %d %d %d ", 2421 + size = sysfs_emit(buf, "%d %d %d %d %d %d %d %d %d %d %d ", 2422 2422 gidac_mutual_min, gidac_mutual_max, gidac_mutual_ave, 2423 2423 lidac_mutual_min, lidac_mutual_max, lidac_mutual_ave, 2424 2424 gidac_self_rx, gidac_self_tx, 2425 2425 lidac_self_min, lidac_self_max, lidac_self_ave); 2426 - size += scnprintf(buf + size, PAGE_SIZE - size, 2426 + size += sysfs_emit_at(buf, size, 2427 2427 "%d %d %d %d %d %d %d %d %d %d %d %d %d %d %d %d %d %d\n", 2428 2428 raw_cap_mutual_min, raw_cap_mutual_max, raw_cap_mutual_ave, 2429 2429 raw_cap_self_min, raw_cap_self_max, raw_cap_self_ave,
+10 -10
drivers/input/mouse/cyapa_gen6.c
··· 629 629 if (error) 630 630 goto resume_scanning; 631 631 632 - size = scnprintf(buf, PAGE_SIZE, "%d %d %d %d %d %d ", 633 - data[0], /* RX Attenuator Mutual */ 634 - data[1], /* IDAC Mutual */ 635 - data[2], /* RX Attenuator Self RX */ 636 - data[3], /* IDAC Self RX */ 637 - data[4], /* RX Attenuator Self TX */ 638 - data[5] /* IDAC Self TX */ 639 - ); 632 + size = sysfs_emit(buf, "%d %d %d %d %d %d ", 633 + data[0], /* RX Attenuator Mutual */ 634 + data[1], /* IDAC Mutual */ 635 + data[2], /* RX Attenuator Self RX */ 636 + data[3], /* IDAC Self RX */ 637 + data[4], /* RX Attenuator Self TX */ 638 + data[5] /* IDAC Self TX */ 639 + ); 640 640 641 641 /* 3. Read Attenuator Trim. */ 642 642 data_len = sizeof(data); ··· 648 648 649 649 /* set attenuator trim values. */ 650 650 for (i = 0; i < data_len; i++) 651 - size += scnprintf(buf + size, PAGE_SIZE - size, "%d ", data[i]); 652 - size += scnprintf(buf + size, PAGE_SIZE - size, "\n"); 651 + size += sysfs_emit_at(buf, size, "%d ", data[i]); 652 + size += sysfs_emit_at(buf, size, "\n"); 653 653 654 654 resume_scanning: 655 655 /* 4. Resume Scanning*/
+9 -9
drivers/input/mouse/elan_i2c_core.c
··· 572 572 struct i2c_client *client = to_i2c_client(dev); 573 573 struct elan_tp_data *data = i2c_get_clientdata(client); 574 574 575 - return sprintf(buf, "0x%04x\n", data->fw_checksum); 575 + return sysfs_emit(buf, "0x%04x\n", data->fw_checksum); 576 576 } 577 577 578 578 static ssize_t elan_sysfs_read_product_id(struct device *dev, ··· 582 582 struct i2c_client *client = to_i2c_client(dev); 583 583 struct elan_tp_data *data = i2c_get_clientdata(client); 584 584 585 - return sprintf(buf, ETP_PRODUCT_ID_FORMAT_STRING "\n", 586 - data->product_id); 585 + return sysfs_emit(buf, ETP_PRODUCT_ID_FORMAT_STRING "\n", 586 + data->product_id); 587 587 } 588 588 589 589 static ssize_t elan_sysfs_read_fw_ver(struct device *dev, ··· 593 593 struct i2c_client *client = to_i2c_client(dev); 594 594 struct elan_tp_data *data = i2c_get_clientdata(client); 595 595 596 - return sprintf(buf, "%d.0\n", data->fw_version); 596 + return sysfs_emit(buf, "%d.0\n", data->fw_version); 597 597 } 598 598 599 599 static ssize_t elan_sysfs_read_sm_ver(struct device *dev, ··· 603 603 struct i2c_client *client = to_i2c_client(dev); 604 604 struct elan_tp_data *data = i2c_get_clientdata(client); 605 605 606 - return sprintf(buf, "%d.0\n", data->sm_version); 606 + return sysfs_emit(buf, "%d.0\n", data->sm_version); 607 607 } 608 608 609 609 static ssize_t elan_sysfs_read_iap_ver(struct device *dev, ··· 613 613 struct i2c_client *client = to_i2c_client(dev); 614 614 struct elan_tp_data *data = i2c_get_clientdata(client); 615 615 616 - return sprintf(buf, "%d.0\n", data->iap_version); 616 + return sysfs_emit(buf, "%d.0\n", data->iap_version); 617 617 } 618 618 619 619 static ssize_t elan_sysfs_update_fw(struct device *dev, ··· 754 754 if (error) 755 755 return error; 756 756 757 - return sprintf(buf, "%d\n", (int)mode); 757 + return sysfs_emit(buf, "%d\n", (int)mode); 758 758 } 759 759 760 760 static DEVICE_ATTR(product_id, S_IRUGO, elan_sysfs_read_product_id, NULL); ··· 858 858 goto out; 859 859 } 860 860 861 - retval = snprintf(buf, PAGE_SIZE, "%d", data->min_baseline); 861 + retval = sysfs_emit(buf, "%d", data->min_baseline); 862 862 863 863 out: 864 864 mutex_unlock(&data->sysfs_mutex); ··· 881 881 goto out; 882 882 } 883 883 884 - retval = snprintf(buf, PAGE_SIZE, "%d", data->max_baseline); 884 + retval = sysfs_emit(buf, "%d", data->max_baseline); 885 885 886 886 out: 887 887 mutex_unlock(&data->sysfs_mutex);
+15 -26
drivers/input/mouse/navpoint.c
··· 10 10 #include <linux/platform_device.h> 11 11 #include <linux/clk.h> 12 12 #include <linux/delay.h> 13 - #include <linux/gpio.h> 13 + #include <linux/gpio/consumer.h> 14 14 #include <linux/input.h> 15 15 #include <linux/input/navpoint.h> 16 16 #include <linux/interrupt.h> ··· 32 32 struct ssp_device *ssp; 33 33 struct input_dev *input; 34 34 struct device *dev; 35 - int gpio; 35 + struct gpio_desc *gpiod; 36 36 int index; 37 37 u8 data[1 + HEADER_LENGTH(0xff)]; 38 38 }; ··· 170 170 dev_err(navpoint->dev, 171 171 "timeout waiting for SSSR[CSS] to clear\n"); 172 172 173 - if (gpio_is_valid(navpoint->gpio)) 174 - gpio_set_value(navpoint->gpio, 1); 173 + gpiod_set_value(navpoint->gpiod, 1); 175 174 } 176 175 177 176 static void navpoint_down(struct navpoint *navpoint) 178 177 { 179 178 struct ssp_device *ssp = navpoint->ssp; 180 179 181 - if (gpio_is_valid(navpoint->gpio)) 182 - gpio_set_value(navpoint->gpio, 0); 180 + gpiod_set_value(navpoint->gpiod, 0); 183 181 184 182 pxa_ssp_write_reg(ssp, SSCR0, 0); 185 183 ··· 214 216 return -EINVAL; 215 217 } 216 218 217 - if (gpio_is_valid(pdata->gpio)) { 218 - error = gpio_request_one(pdata->gpio, GPIOF_OUT_INIT_LOW, 219 - "SYNAPTICS_ON"); 220 - if (error) 221 - return error; 222 - } 223 - 224 219 ssp = pxa_ssp_request(pdata->port, pdev->name); 225 - if (!ssp) { 226 - error = -ENODEV; 227 - goto err_free_gpio; 228 - } 220 + if (!ssp) 221 + return -ENODEV; 229 222 230 223 /* HaRET does not disable devices before jumping into Linux */ 231 224 if (pxa_ssp_read_reg(ssp, SSCR0) & SSCR0_SSE) { ··· 231 242 goto err_free_mem; 232 243 } 233 244 245 + navpoint->gpiod = gpiod_get_optional(&pdev->dev, 246 + NULL, GPIOD_OUT_LOW); 247 + if (IS_ERR(navpoint->gpiod)) { 248 + error = PTR_ERR(navpoint->gpiod); 249 + dev_err(&pdev->dev, "error getting GPIO\n"); 250 + goto err_free_mem; 251 + } 252 + gpiod_set_consumer_name(navpoint->gpiod, "SYNAPTICS_ON"); 253 + 234 254 navpoint->ssp = ssp; 235 255 navpoint->input = input; 236 256 navpoint->dev = &pdev->dev; 237 - navpoint->gpio = pdata->gpio; 238 257 239 258 input->name = pdev->name; 240 259 input->dev.parent = &pdev->dev; ··· 285 288 input_free_device(input); 286 289 kfree(navpoint); 287 290 pxa_ssp_free(ssp); 288 - err_free_gpio: 289 - if (gpio_is_valid(pdata->gpio)) 290 - gpio_free(pdata->gpio); 291 291 292 292 return error; 293 293 } 294 294 295 295 static void navpoint_remove(struct platform_device *pdev) 296 296 { 297 - const struct navpoint_platform_data *pdata = 298 - dev_get_platdata(&pdev->dev); 299 297 struct navpoint *navpoint = platform_get_drvdata(pdev); 300 298 struct ssp_device *ssp = navpoint->ssp; 301 299 ··· 300 308 kfree(navpoint); 301 309 302 310 pxa_ssp_free(ssp); 303 - 304 - if (gpio_is_valid(pdata->gpio)) 305 - gpio_free(pdata->gpio); 306 311 } 307 312 308 313 static int navpoint_suspend(struct device *dev)
+6 -7
drivers/input/rmi4/rmi_f01.c
··· 267 267 struct rmi_driver_data *data = dev_get_drvdata(dev); 268 268 struct f01_data *f01 = dev_get_drvdata(&data->f01_container->dev); 269 269 270 - return scnprintf(buf, PAGE_SIZE, "%d\n", 271 - f01->properties.manufacturer_id); 270 + return sysfs_emit(buf, "%d\n", f01->properties.manufacturer_id); 272 271 } 273 272 274 273 static DEVICE_ATTR(manufacturer_id, 0444, ··· 279 280 struct rmi_driver_data *data = dev_get_drvdata(dev); 280 281 struct f01_data *f01 = dev_get_drvdata(&data->f01_container->dev); 281 282 282 - return scnprintf(buf, PAGE_SIZE, "%s\n", f01->properties.dom); 283 + return sysfs_emit(buf, "%s\n", f01->properties.dom); 283 284 } 284 285 285 286 static DEVICE_ATTR(date_of_manufacture, 0444, rmi_driver_dom_show, NULL); ··· 291 292 struct rmi_driver_data *data = dev_get_drvdata(dev); 292 293 struct f01_data *f01 = dev_get_drvdata(&data->f01_container->dev); 293 294 294 - return scnprintf(buf, PAGE_SIZE, "%s\n", f01->properties.product_id); 295 + return sysfs_emit(buf, "%s\n", f01->properties.product_id); 295 296 } 296 297 297 298 static DEVICE_ATTR(product_id, 0444, rmi_driver_product_id_show, NULL); ··· 303 304 struct rmi_driver_data *data = dev_get_drvdata(dev); 304 305 struct f01_data *f01 = dev_get_drvdata(&data->f01_container->dev); 305 306 306 - return scnprintf(buf, PAGE_SIZE, "%d\n", f01->properties.firmware_id); 307 + return sysfs_emit(buf, "%d\n", f01->properties.firmware_id); 307 308 } 308 309 309 310 static DEVICE_ATTR(firmware_id, 0444, rmi_driver_firmware_id_show, NULL); ··· 317 318 318 319 u32 package_id = f01->properties.package_id; 319 320 320 - return scnprintf(buf, PAGE_SIZE, "%04x.%04x\n", 321 - package_id & 0xffff, (package_id >> 16) & 0xffff); 321 + return sysfs_emit(buf, "%04x.%04x\n", 322 + package_id & 0xffff, (package_id >> 16) & 0xffff); 322 323 } 323 324 324 325 static DEVICE_ATTR(package_id, 0444, rmi_driver_package_id_show, NULL);
+9 -12
drivers/input/touchscreen/atmel_mxt_ts.c
··· 2818 2818 { 2819 2819 struct mxt_data *data = dev_get_drvdata(dev); 2820 2820 struct mxt_info *info = data->info; 2821 - return scnprintf(buf, PAGE_SIZE, "%u.%u.%02X\n", 2822 - info->version >> 4, info->version & 0xf, info->build); 2821 + return sysfs_emit(buf, "%u.%u.%02X\n", 2822 + info->version >> 4, info->version & 0xf, info->build); 2823 2823 } 2824 2824 2825 2825 /* Hardware Version is returned as FamilyID.VariantID */ ··· 2828 2828 { 2829 2829 struct mxt_data *data = dev_get_drvdata(dev); 2830 2830 struct mxt_info *info = data->info; 2831 - return scnprintf(buf, PAGE_SIZE, "%u.%u\n", 2832 - info->family_id, info->variant_id); 2831 + return sysfs_emit(buf, "%u.%u\n", info->family_id, info->variant_id); 2833 2832 } 2834 2833 2835 2834 static ssize_t mxt_show_instance(char *buf, int count, ··· 2838 2839 int i; 2839 2840 2840 2841 if (mxt_obj_instances(object) > 1) 2841 - count += scnprintf(buf + count, PAGE_SIZE - count, 2842 - "Instance %u\n", instance); 2842 + count += sysfs_emit_at(buf, count, "Instance %u\n", instance); 2843 2843 2844 2844 for (i = 0; i < mxt_obj_size(object); i++) 2845 - count += scnprintf(buf + count, PAGE_SIZE - count, 2846 - "\t[%2u]: %02x (%d)\n", i, val[i], val[i]); 2847 - count += scnprintf(buf + count, PAGE_SIZE - count, "\n"); 2845 + count += sysfs_emit_at(buf, count, "\t[%2u]: %02x (%d)\n", 2846 + i, val[i], val[i]); 2847 + count += sysfs_emit_at(buf, count, "\n"); 2848 2848 2849 2849 return count; 2850 2850 } 2851 2851 2852 2852 static ssize_t mxt_object_show(struct device *dev, 2853 - struct device_attribute *attr, char *buf) 2853 + struct device_attribute *attr, char *buf) 2854 2854 { 2855 2855 struct mxt_data *data = dev_get_drvdata(dev); 2856 2856 struct mxt_object *object; ··· 2870 2872 if (!mxt_object_readable(object->type)) 2871 2873 continue; 2872 2874 2873 - count += scnprintf(buf + count, PAGE_SIZE - count, 2874 - "T%u:\n", object->type); 2875 + count += sysfs_emit_at(buf, count, "T%u:\n", object->type); 2875 2876 2876 2877 for (j = 0; j < mxt_obj_instances(object); j++) { 2877 2878 u16 size = mxt_obj_size(object);
+1 -1
drivers/input/touchscreen/edt-ft5x06.c
··· 431 431 *field = val; 432 432 } 433 433 434 - count = scnprintf(buf, PAGE_SIZE, "%d\n", val); 434 + count = sysfs_emit(buf, "%d\n", val); 435 435 out: 436 436 mutex_unlock(&tsdata->mutex); 437 437 return error ?: count;
+2 -4
drivers/input/touchscreen/hideep.c
··· 928 928 ssize_t len; 929 929 930 930 mutex_lock(&ts->dev_mutex); 931 - len = scnprintf(buf, PAGE_SIZE, "%04x\n", 932 - be16_to_cpu(ts->dwz_info.release_ver)); 931 + len = sysfs_emit(buf, "%04x\n", be16_to_cpu(ts->dwz_info.release_ver)); 933 932 mutex_unlock(&ts->dev_mutex); 934 933 935 934 return len; ··· 942 943 ssize_t len; 943 944 944 945 mutex_lock(&ts->dev_mutex); 945 - len = scnprintf(buf, PAGE_SIZE, "%04x\n", 946 - be16_to_cpu(ts->dwz_info.product_id)); 946 + len = sysfs_emit(buf, "%04x\n", be16_to_cpu(ts->dwz_info.product_id)); 947 947 mutex_unlock(&ts->dev_mutex); 948 948 949 949 return len;
+1 -1
drivers/input/touchscreen/hycon-hy46xx.c
··· 202 202 *field = val; 203 203 } 204 204 205 - count = scnprintf(buf, PAGE_SIZE, "%d\n", val); 205 + count = sysfs_emit(buf, "%d\n", val); 206 206 207 207 out: 208 208 mutex_unlock(&tsdata->mutex);
+8 -8
drivers/input/touchscreen/ilitek_ts_i2c.c
··· 512 512 struct i2c_client *client = to_i2c_client(dev); 513 513 struct ilitek_ts_data *ts = i2c_get_clientdata(client); 514 514 515 - return scnprintf(buf, PAGE_SIZE, 516 - "fw version: [%02X%02X.%02X%02X.%02X%02X.%02X%02X]\n", 517 - ts->firmware_ver[0], ts->firmware_ver[1], 518 - ts->firmware_ver[2], ts->firmware_ver[3], 519 - ts->firmware_ver[4], ts->firmware_ver[5], 520 - ts->firmware_ver[6], ts->firmware_ver[7]); 515 + return sysfs_emit(buf, 516 + "fw version: [%02X%02X.%02X%02X.%02X%02X.%02X%02X]\n", 517 + ts->firmware_ver[0], ts->firmware_ver[1], 518 + ts->firmware_ver[2], ts->firmware_ver[3], 519 + ts->firmware_ver[4], ts->firmware_ver[5], 520 + ts->firmware_ver[6], ts->firmware_ver[7]); 521 521 } 522 522 static DEVICE_ATTR_RO(firmware_version); 523 523 ··· 527 527 struct i2c_client *client = to_i2c_client(dev); 528 528 struct ilitek_ts_data *ts = i2c_get_clientdata(client); 529 529 530 - return scnprintf(buf, PAGE_SIZE, "product id: [%04X], module: [%s]\n", 531 - ts->mcu_ver, ts->product_id); 530 + return sysfs_emit(buf, "product id: [%04X], module: [%s]\n", 531 + ts->mcu_ver, ts->product_id); 532 532 } 533 533 static DEVICE_ATTR_RO(product_id); 534 534
+6 -6
drivers/input/touchscreen/iqs5xx.c
··· 943 943 if (!iqs5xx->dev_id_info.bl_status) 944 944 return -ENODATA; 945 945 946 - return scnprintf(buf, PAGE_SIZE, "%u.%u.%u.%u:%u.%u\n", 947 - be16_to_cpu(iqs5xx->dev_id_info.prod_num), 948 - be16_to_cpu(iqs5xx->dev_id_info.proj_num), 949 - iqs5xx->dev_id_info.major_ver, 950 - iqs5xx->dev_id_info.minor_ver, 951 - iqs5xx->exp_file[0], iqs5xx->exp_file[1]); 946 + return sysfs_emit(buf, "%u.%u.%u.%u:%u.%u\n", 947 + be16_to_cpu(iqs5xx->dev_id_info.prod_num), 948 + be16_to_cpu(iqs5xx->dev_id_info.proj_num), 949 + iqs5xx->dev_id_info.major_ver, 950 + iqs5xx->dev_id_info.minor_ver, 951 + iqs5xx->exp_file[0], iqs5xx->exp_file[1]); 952 952 } 953 953 954 954 static DEVICE_ATTR_WO(fw_file);
+6 -6
drivers/input/touchscreen/iqs7211.c
··· 2401 2401 { 2402 2402 struct iqs7211_private *iqs7211 = dev_get_drvdata(dev); 2403 2403 2404 - return scnprintf(buf, PAGE_SIZE, "%u.%u.%u.%u:%u.%u\n", 2405 - le16_to_cpu(iqs7211->ver_info.prod_num), 2406 - le32_to_cpu(iqs7211->ver_info.patch), 2407 - le16_to_cpu(iqs7211->ver_info.major), 2408 - le16_to_cpu(iqs7211->ver_info.minor), 2409 - iqs7211->exp_file[1], iqs7211->exp_file[0]); 2404 + return sysfs_emit(buf, "%u.%u.%u.%u:%u.%u\n", 2405 + le16_to_cpu(iqs7211->ver_info.prod_num), 2406 + le32_to_cpu(iqs7211->ver_info.patch), 2407 + le16_to_cpu(iqs7211->ver_info.major), 2408 + le16_to_cpu(iqs7211->ver_info.minor), 2409 + iqs7211->exp_file[1], iqs7211->exp_file[0]); 2410 2410 } 2411 2411 2412 2412 static DEVICE_ATTR_RO(fw_info);
+8 -8
drivers/input/touchscreen/melfas_mip4.c
··· 1336 1336 /* Take lock to prevent racing with firmware update */ 1337 1337 mutex_lock(&ts->input->mutex); 1338 1338 1339 - count = snprintf(buf, PAGE_SIZE, "%04X %04X %04X %04X\n", 1340 - ts->fw_version.boot, ts->fw_version.core, 1341 - ts->fw_version.app, ts->fw_version.param); 1339 + count = sysfs_emit(buf, "%04X %04X %04X %04X\n", 1340 + ts->fw_version.boot, ts->fw_version.core, 1341 + ts->fw_version.app, ts->fw_version.param); 1342 1342 1343 1343 mutex_unlock(&ts->input->mutex); 1344 1344 ··· 1362 1362 * product_name shows the name or version of the hardware 1363 1363 * paired with current firmware in the chip. 1364 1364 */ 1365 - count = snprintf(buf, PAGE_SIZE, "%.*s\n", 1366 - (int)sizeof(ts->product_name), ts->product_name); 1365 + count = sysfs_emit(buf, "%.*s\n", 1366 + (int)sizeof(ts->product_name), ts->product_name); 1367 1367 1368 1368 mutex_unlock(&ts->input->mutex); 1369 1369 ··· 1382 1382 1383 1383 mutex_lock(&ts->input->mutex); 1384 1384 1385 - count = snprintf(buf, PAGE_SIZE, "%04X\n", ts->product_id); 1385 + count = sysfs_emit(buf, "%04X\n", ts->product_id); 1386 1386 1387 1387 mutex_unlock(&ts->input->mutex); 1388 1388 ··· 1401 1401 1402 1402 mutex_lock(&ts->input->mutex); 1403 1403 1404 - count = snprintf(buf, PAGE_SIZE, "%.*s\n", 1405 - (int)sizeof(ts->ic_name), ts->ic_name); 1404 + count = sysfs_emit(buf, "%.*s\n", 1405 + (int)sizeof(ts->ic_name), ts->ic_name); 1406 1406 1407 1407 mutex_unlock(&ts->input->mutex); 1408 1408
+2 -2
drivers/input/touchscreen/usbtouchscreen.c
··· 456 456 struct usbtouch_usb *usbtouch = usb_get_intfdata(intf); 457 457 struct mtouch_priv *priv = usbtouch->priv; 458 458 459 - return scnprintf(output, PAGE_SIZE, "%1x.%1x\n", 460 - priv->fw_rev_major, priv->fw_rev_minor); 459 + return sysfs_emit(output, "%1x.%1x\n", 460 + priv->fw_rev_major, priv->fw_rev_minor); 461 461 } 462 462 static DEVICE_ATTR(firmware_rev, 0444, mtouch_firmware_rev_show, NULL); 463 463
+3 -3
drivers/input/touchscreen/wdt87xx_i2c.c
··· 887 887 cfg_csum = wdt->param.xmls_id1; 888 888 cfg_csum = (cfg_csum << 16) | wdt->param.xmls_id2; 889 889 890 - return scnprintf(buf, PAGE_SIZE, "%x\n", cfg_csum); 890 + return sysfs_emit(buf, "%x\n", cfg_csum); 891 891 } 892 892 893 893 static ssize_t fw_version_show(struct device *dev, ··· 896 896 struct i2c_client *client = to_i2c_client(dev); 897 897 struct wdt87xx_data *wdt = i2c_get_clientdata(client); 898 898 899 - return scnprintf(buf, PAGE_SIZE, "%x\n", wdt->param.fw_id); 899 + return sysfs_emit(buf, "%x\n", wdt->param.fw_id); 900 900 } 901 901 902 902 static ssize_t plat_id_show(struct device *dev, ··· 905 905 struct i2c_client *client = to_i2c_client(dev); 906 906 struct wdt87xx_data *wdt = i2c_get_clientdata(client); 907 907 908 - return scnprintf(buf, PAGE_SIZE, "%x\n", wdt->param.plat_id); 908 + return sysfs_emit(buf, "%x\n", wdt->param.plat_id); 909 909 } 910 910 911 911 static ssize_t update_config_store(struct device *dev,
+16 -18
drivers/input/touchscreen/zforce_ts.c
··· 20 20 #include <linux/device.h> 21 21 #include <linux/sysfs.h> 22 22 #include <linux/input/mt.h> 23 + #include <linux/input/touchscreen.h> 23 24 #include <linux/platform_data/zforce_ts.h> 24 25 #include <linux/regulator/consumer.h> 25 26 #include <linux/of.h> ··· 107 106 struct zforce_ts { 108 107 struct i2c_client *client; 109 108 struct input_dev *input; 109 + struct touchscreen_properties prop; 110 110 const struct zforce_ts_platdata *pdata; 111 111 char phys[32]; 112 112 ··· 268 266 static int zforce_start(struct zforce_ts *ts) 269 267 { 270 268 struct i2c_client *client = ts->client; 271 - const struct zforce_ts_platdata *pdata = ts->pdata; 272 269 int ret; 273 270 274 271 dev_dbg(&client->dev, "starting device\n"); ··· 278 277 return ret; 279 278 } 280 279 281 - ret = zforce_resolution(ts, pdata->x_max, pdata->y_max); 280 + ret = zforce_resolution(ts, ts->prop.max_x, ts->prop.max_y); 282 281 if (ret) { 283 282 dev_err(&client->dev, "Unable to set resolution, %d\n", ret); 284 283 goto error; ··· 338 337 static int zforce_touch_event(struct zforce_ts *ts, u8 *payload) 339 338 { 340 339 struct i2c_client *client = ts->client; 341 - const struct zforce_ts_platdata *pdata = ts->pdata; 342 340 struct zforce_point point; 343 341 int count, i, num = 0; 344 342 ··· 355 355 point.coord_y = 356 356 payload[9 * i + 4] << 8 | payload[9 * i + 3]; 357 357 358 - if (point.coord_x > pdata->x_max || 359 - point.coord_y > pdata->y_max) { 358 + if (point.coord_x > ts->prop.max_x || 359 + point.coord_y > ts->prop.max_y) { 360 360 dev_warn(&client->dev, "coordinates (%d,%d) invalid\n", 361 361 point.coord_x, point.coord_y); 362 362 point.coord_x = point.coord_y = 0; ··· 390 390 point.state != STATE_UP); 391 391 392 392 if (point.state != STATE_UP) { 393 - input_report_abs(ts->input, ABS_MT_POSITION_X, 394 - point.coord_x); 395 - input_report_abs(ts->input, ABS_MT_POSITION_Y, 396 - point.coord_y); 393 + touchscreen_report_pos(ts->input, &ts->prop, 394 + point.coord_x, point.coord_y, 395 + true); 397 396 input_report_abs(ts->input, ABS_MT_TOUCH_MAJOR, 398 397 point.area_major); 399 398 input_report_abs(ts->input, ABS_MT_TOUCH_MINOR, ··· 718 719 return ERR_PTR(-ENOMEM); 719 720 } 720 721 721 - if (of_property_read_u32(np, "x-size", &pdata->x_max)) { 722 - dev_err(dev, "failed to get x-size property\n"); 723 - return ERR_PTR(-EINVAL); 724 - } 725 - 726 - if (of_property_read_u32(np, "y-size", &pdata->y_max)) { 727 - dev_err(dev, "failed to get y-size property\n"); 728 - return ERR_PTR(-EINVAL); 729 - } 722 + of_property_read_u32(np, "x-size", &pdata->x_max); 723 + of_property_read_u32(np, "y-size", &pdata->y_max); 730 724 731 725 return pdata; 732 726 } ··· 847 855 pdata->x_max, 0, 0); 848 856 input_set_abs_params(input_dev, ABS_MT_POSITION_Y, 0, 849 857 pdata->y_max, 0, 0); 858 + 859 + touchscreen_parse_properties(input_dev, true, &ts->prop); 860 + if (ts->prop.max_x == 0 || ts->prop.max_y == 0) { 861 + dev_err(&client->dev, "no size specified\n"); 862 + return -EINVAL; 863 + } 850 864 851 865 input_set_abs_params(input_dev, ABS_MT_TOUCH_MAJOR, 0, 852 866 ZFORCE_MAX_AREA, 0, 0);
+3 -3
drivers/input/vivaldi-fmap.c
··· 27 27 return 0; 28 28 29 29 for (i = 0; i < data->num_function_row_keys; i++) 30 - size += scnprintf(buf + size, PAGE_SIZE - size, 31 - "%s%02X", size ? " " : "", physmap[i]); 30 + size += sysfs_emit_at(buf, size, 31 + "%s%02X", size ? " " : "", physmap[i]); 32 32 if (size) 33 - size += scnprintf(buf + size, PAGE_SIZE - size, "\n"); 33 + size += sysfs_emit_at(buf, size, "\n"); 34 34 35 35 return size; 36 36 }
+2
include/linux/gpio_keys.h
··· 21 21 * disable button via sysfs 22 22 * @value: axis value for %EV_ABS 23 23 * @irq: Irq number in case of interrupt keys 24 + * @wakeirq: Optional dedicated wake-up interrupt 24 25 */ 25 26 struct gpio_keys_button { 26 27 unsigned int code; ··· 35 34 bool can_disable; 36 35 int value; 37 36 unsigned int irq; 37 + unsigned int wakeirq; 38 38 }; 39 39 40 40 /**
-1
include/linux/input/as5011.h
··· 7 7 */ 8 8 9 9 struct as5011_platform_data { 10 - unsigned int button_gpio; 11 10 unsigned int axis_irq; /* irq number */ 12 11 unsigned long axis_irqflags; 13 12 char xp, xn; /* threshold for x axis */
-1
include/linux/input/navpoint.h
··· 5 5 6 6 struct navpoint_platform_data { 7 7 int port; /* PXA SSP port for pxa_ssp_request() */ 8 - int gpio; /* GPIO for power on/off */ 9 8 };
-3
include/linux/platform_data/keypad-omap.h
··· 19 19 bool rep; 20 20 unsigned long delay; 21 21 bool dbounce; 22 - /* specific to OMAP242x*/ 23 - unsigned int *row_gpios; 24 - unsigned int *col_gpios; 25 22 }; 26 23 27 24 /* Group (0..3) -- when multiple keys are pressed, only the