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

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

Pull input updates from Dmitry Torokhov:

- changes to input core to properly queue synthetic events (such as
autorepeat) and to release multitouch contacts when an input device
is inhibited or suspended

- reworked quirk handling in i8042 driver that consolidates multiple
DMI tables into one and adds several quirks for TUXEDO line of
laptops

- update to mt6779 keypad to better reflect organization of the
hardware

- changes to mtk-pmic-keys driver preparing it to handle more variants

- facelift of adp5588-keys driver

- improvements to iqs7222 driver

- adjustments to various DT binding documents for input devices

- other assorted driver fixes.

* tag 'input-for-v5.20-rc0' of git://git.kernel.org/pub/scm/linux/kernel/git/dtor/input: (54 commits)
Input: adc-joystick - fix ordering in adc_joystick_probe()
dt-bindings: input: ariel-pwrbutton: use spi-peripheral-props.yaml
Input: deactivate MT slots when inhibiting or suspending devices
Input: properly queue synthetic events
dt-bindings: input: iqs7222: Use central 'linux,code' definition
Input: i8042 - add dritek quirk for Acer Aspire One AO532
dt-bindings: input: gpio-keys: accept also interrupt-extended
dt-bindings: input: gpio-keys: reference input.yaml and document properties
dt-bindings: input: gpio-keys: enforce node names to match all properties
dt-bindings: input: Convert adc-keys to DT schema
dt-bindings: input: Centralize 'linux,input-type' definition
dt-bindings: input: Use common 'linux,keycodes' definition
dt-bindings: input: Centralize 'linux,code' definition
dt-bindings: input: Increase maximum keycode value to 0x2ff
Input: mt6779-keypad - implement row/column selection
Input: mt6779-keypad - match hardware matrix organization
Input: i8042 - add additional TUXEDO devices to i8042 quirk tables
Input: goodix - switch use of acpi_gpio_get_*_resource() APIs
Input: i8042 - add TUXEDO devices to i8042 quirk tables
Input: i8042 - add debug output for quirks
...

+2064 -1489
+1 -1
Documentation/devicetree/bindings/input/adc-joystick.yaml
··· 45 45 patternProperties: 46 46 "^axis@[0-9a-f]+$": 47 47 type: object 48 + $ref: input.yaml# 48 49 description: > 49 50 Represents a joystick axis bound to the given ADC channel. 50 51 For each entry in the io-channels list, one axis subnode with a matching ··· 58 57 description: Index of an io-channels list entry bound to this axis. 59 58 60 59 linux,code: 61 - $ref: /schemas/types.yaml#/definitions/uint32 62 60 description: EV_ABS specific event code generated by the axis. 63 61 64 62 abs-range:
-67
Documentation/devicetree/bindings/input/adc-keys.txt
··· 1 - ADC attached resistor ladder buttons 2 - ------------------------------------ 3 - 4 - Required properties: 5 - - compatible: "adc-keys" 6 - - io-channels: Phandle to an ADC channel 7 - - io-channel-names = "buttons"; 8 - - keyup-threshold-microvolt: Voltage above or equal to which all the keys are 9 - considered up. 10 - 11 - Optional properties: 12 - - poll-interval: Poll interval time in milliseconds 13 - - autorepeat: Boolean, Enable auto repeat feature of Linux input 14 - subsystem. 15 - 16 - Each button (key) is represented as a sub-node of "adc-keys": 17 - 18 - Required subnode-properties: 19 - - label: Descriptive name of the key. 20 - - linux,code: Keycode to emit. 21 - - press-threshold-microvolt: voltage above or equal to which this key is 22 - considered pressed. 23 - 24 - No two values of press-threshold-microvolt may be the same. 25 - All values of press-threshold-microvolt must be less than 26 - keyup-threshold-microvolt. 27 - 28 - Example: 29 - 30 - #include <dt-bindings/input/input.h> 31 - 32 - adc-keys { 33 - compatible = "adc-keys"; 34 - io-channels = <&lradc 0>; 35 - io-channel-names = "buttons"; 36 - keyup-threshold-microvolt = <2000000>; 37 - 38 - button-up { 39 - label = "Volume Up"; 40 - linux,code = <KEY_VOLUMEUP>; 41 - press-threshold-microvolt = <1500000>; 42 - }; 43 - 44 - button-down { 45 - label = "Volume Down"; 46 - linux,code = <KEY_VOLUMEDOWN>; 47 - press-threshold-microvolt = <1000000>; 48 - }; 49 - 50 - button-enter { 51 - label = "Enter"; 52 - linux,code = <KEY_ENTER>; 53 - press-threshold-microvolt = <500000>; 54 - }; 55 - }; 56 - 57 - +--------------------------------+------------------------+ 58 - | 2.000.000 <= value | no key pressed | 59 - +--------------------------------+------------------------+ 60 - | 1.500.000 <= value < 2.000.000 | KEY_VOLUMEUP pressed | 61 - +--------------------------------+------------------------+ 62 - | 1.000.000 <= value < 1.500.000 | KEY_VOLUMEDOWN pressed | 63 - +--------------------------------+------------------------+ 64 - | 500.000 <= value < 1.000.000 | KEY_ENTER pressed | 65 - +--------------------------------+------------------------+ 66 - | value < 500.000 | no key pressed | 67 - +--------------------------------+------------------------+
+103
Documentation/devicetree/bindings/input/adc-keys.yaml
··· 1 + # SPDX-License-Identifier: GPL-2.0 2 + %YAML 1.2 3 + --- 4 + $id: http://devicetree.org/schemas/input/adc-keys.yaml# 5 + $schema: http://devicetree.org/meta-schemas/core.yaml# 6 + 7 + title: ADC attached resistor ladder buttons 8 + 9 + maintainers: 10 + - Alexandre Belloni <alexandre.belloni@bootlin.com> 11 + 12 + allOf: 13 + - $ref: input.yaml# 14 + 15 + properties: 16 + compatible: 17 + const: adc-keys 18 + 19 + io-channels: 20 + maxItems: 1 21 + 22 + io-channel-names: 23 + const: buttons 24 + 25 + keyup-threshold-microvolt: 26 + description: 27 + Voltage above or equal to which all the keys are considered up. 28 + 29 + poll-interval: true 30 + autorepeat: true 31 + 32 + patternProperties: 33 + '^button-': 34 + type: object 35 + $ref: input.yaml# 36 + additionalProperties: false 37 + description: 38 + Each button (key) is represented as a sub-node. 39 + 40 + properties: 41 + label: true 42 + 43 + linux,code: true 44 + 45 + press-threshold-microvolt: 46 + description: 47 + Voltage above or equal to which this key is considered pressed. No 48 + two values of press-threshold-microvolt may be the same. All values 49 + of press-threshold-microvolt must be less than 50 + keyup-threshold-microvolt. 51 + 52 + required: 53 + - linux,code 54 + - press-threshold-microvolt 55 + 56 + required: 57 + - compatible 58 + - io-channels 59 + - io-channel-names 60 + - keyup-threshold-microvolt 61 + 62 + additionalProperties: false 63 + 64 + examples: 65 + - | 66 + #include <dt-bindings/input/input.h> 67 + // +--------------------------------+------------------------+ 68 + // | 2.000.000 <= value | no key pressed | 69 + // +--------------------------------+------------------------+ 70 + // | 1.500.000 <= value < 2.000.000 | KEY_VOLUMEUP pressed | 71 + // +--------------------------------+------------------------+ 72 + // | 1.000.000 <= value < 1.500.000 | KEY_VOLUMEDOWN pressed | 73 + // +--------------------------------+------------------------+ 74 + // | 500.000 <= value < 1.000.000 | KEY_ENTER pressed | 75 + // +--------------------------------+------------------------+ 76 + // | value < 500.000 | no key pressed | 77 + // +--------------------------------+------------------------+ 78 + 79 + adc-keys { 80 + compatible = "adc-keys"; 81 + io-channels = <&lradc 0>; 82 + io-channel-names = "buttons"; 83 + keyup-threshold-microvolt = <2000000>; 84 + 85 + button-up { 86 + label = "Volume Up"; 87 + linux,code = <KEY_VOLUMEUP>; 88 + press-threshold-microvolt = <1500000>; 89 + }; 90 + 91 + button-down { 92 + label = "Volume Down"; 93 + linux,code = <KEY_VOLUMEDOWN>; 94 + press-threshold-microvolt = <1000000>; 95 + }; 96 + 97 + button-enter { 98 + label = "Enter"; 99 + linux,code = <KEY_ENTER>; 100 + press-threshold-microvolt = <500000>; 101 + }; 102 + }; 103 + ...
+2 -3
Documentation/devicetree/bindings/input/allwinner,sun4i-a10-lradc-keys.yaml
··· 44 44 patternProperties: 45 45 "^button-[0-9]+$": 46 46 type: object 47 + $ref: input.yaml# 47 48 properties: 48 49 label: 49 50 $ref: /schemas/types.yaml#/definitions/string 50 51 description: Descriptive name of the key 51 52 52 - linux,code: 53 - $ref: /schemas/types.yaml#/definitions/uint32 54 - description: Keycode to emit 53 + linux,code: true 55 54 56 55 channel: 57 56 $ref: /schemas/types.yaml#/definitions/uint32
+1
Documentation/devicetree/bindings/input/ariel-pwrbutton.yaml
··· 17 17 18 18 allOf: 19 19 - $ref: input.yaml# 20 + - $ref: /schemas/spi/spi-peripheral-props.yaml# 20 21 21 22 properties: 22 23 compatible:
+18 -23
Documentation/devicetree/bindings/input/azoteq,iqs7222.yaml
··· 37 37 device is temporarily held in hardware reset prior to initialization if 38 38 this property is present. 39 39 40 - azoteq,rf-filt-enable: 41 - type: boolean 42 - description: Enables the device's internal RF filter. 43 - 44 40 azoteq,max-counts: 45 41 $ref: /schemas/types.yaml#/definitions/uint32 46 42 enum: [0, 1, 2, 3] ··· 417 421 patternProperties: 418 422 "^event-(prox|touch)$": 419 423 type: object 424 + $ref: input.yaml# 420 425 description: 421 426 Represents a proximity or touch event reported by the channel. 422 427 ··· 464 467 The IQS7222B does not feature channel-specific timeouts; the time- 465 468 out specified for any one channel applies to all channels. 466 469 467 - linux,code: 468 - $ref: /schemas/types.yaml#/definitions/uint32 469 - description: 470 - Numeric key or switch code associated with the event. Specify 471 - KEY_RESERVED (0) to opt out of event reporting. 470 + linux,code: true 472 471 473 472 linux,input-type: 474 - $ref: /schemas/types.yaml#/definitions/uint32 475 473 enum: [1, 5] 476 474 default: 1 477 475 description: ··· 529 537 530 538 azoteq,bottom-speed: 531 539 $ref: /schemas/types.yaml#/definitions/uint32 532 - multipleOf: 4 533 540 minimum: 0 534 - maximum: 1020 541 + maximum: 255 535 542 description: 536 543 Specifies the speed of movement after which coordinate filtering is 537 544 linearly reduced. ··· 566 575 patternProperties: 567 576 "^event-(press|tap|(swipe|flick)-(pos|neg))$": 568 577 type: object 578 + $ref: input.yaml# 569 579 description: 570 580 Represents a press or gesture (IQS7222A only) event reported by 571 581 the slider. 572 582 573 583 properties: 574 - linux,code: 575 - $ref: /schemas/types.yaml#/definitions/uint32 576 - description: Numeric key code associated with the event. 584 + linux,code: true 577 585 578 586 azoteq,gesture-max-ms: 579 587 multipleOf: 4 ··· 606 616 azoteq,gpio-select: 607 617 $ref: /schemas/types.yaml#/definitions/uint32-array 608 618 minItems: 1 609 - maxItems: 1 619 + maxItems: 3 610 620 items: 611 621 minimum: 0 612 - maximum: 0 622 + maximum: 2 613 623 description: | 614 - Specifies an individual GPIO mapped to a tap, swipe or flick 615 - gesture as follows: 624 + Specifies one or more GPIO mapped to the event as follows: 616 625 0: GPIO0 617 - 1: GPIO3 (reserved) 618 - 2: GPIO4 (reserved) 626 + 1: GPIO3 (IQS7222C only) 627 + 2: GPIO4 (IQS7222C only) 619 628 620 629 Note that although multiple events can be mapped to a single 621 630 GPIO, they must all be of the same type (proximity, touch or ··· 699 710 multipleOf: 4 700 711 maximum: 1020 701 712 713 + patternProperties: 714 + "^event-(press|tap|(swipe|flick)-(pos|neg))$": 715 + properties: 716 + azoteq,gpio-select: 717 + maxItems: 1 718 + items: 719 + maximum: 0 720 + 702 721 else: 703 722 patternProperties: 704 723 "^channel-([0-9]|1[0-9])$": ··· 722 725 azoteq,gesture-min-ms: false 723 726 724 727 azoteq,gesture-dist: false 725 - 726 - azoteq,gpio-select: false 727 728 728 729 required: 729 730 - compatible
+2 -2
Documentation/devicetree/bindings/input/fsl,mpr121-touchkey.yaml
··· 57 57 #address-cells = <1>; 58 58 #size-cells = <0>; 59 59 60 - mpr121@5a { 60 + touchkey@5a { 61 61 compatible = "fsl,mpr121-touchkey"; 62 62 reg = <0x5a>; 63 63 interrupt-parent = <&gpio1>; ··· 77 77 #address-cells = <1>; 78 78 #size-cells = <0>; 79 79 80 - mpr121@5a { 80 + touchkey@5a { 81 81 compatible = "fsl,mpr121-touchkey"; 82 82 reg = <0x5a>; 83 83 poll-interval = <20>;
+98 -99
Documentation/devicetree/bindings/input/gpio-keys.yaml
··· 15 15 - gpio-keys 16 16 - gpio-keys-polled 17 17 18 + autorepeat: true 19 + 20 + label: 21 + description: Name of entire device 22 + 23 + poll-interval: true 24 + 18 25 patternProperties: 19 - ".*": 20 - if: 21 - type: object 22 - then: 23 - $ref: input.yaml# 26 + "^(button|event|key|switch|(button|event|key|switch)-[a-z0-9-]+|[a-z0-9-]+-(button|event|key|switch))$": 27 + $ref: input.yaml# 24 28 29 + properties: 30 + gpios: 31 + maxItems: 1 32 + 33 + interrupts: 34 + maxItems: 1 35 + 36 + label: 37 + description: Descriptive name of the key. 38 + 39 + linux,code: 40 + description: Key / Axis code to emit. 41 + 42 + linux,input-type: 43 + default: 1 # EV_KEY 44 + 45 + linux,input-value: 46 + description: | 47 + If linux,input-type is EV_ABS or EV_REL then this 48 + value is sent for events this button generates when pressed. 49 + EV_ABS/EV_REL axis will generate an event with a value of 0 50 + when all buttons with linux,input-type == type and 51 + linux,code == axis are released. This value is interpreted 52 + as a signed 32 bit value, e.g. to make a button generate a 53 + value of -1 use: 54 + 55 + linux,input-value = <0xffffffff>; /* -1 */ 56 + 57 + $ref: /schemas/types.yaml#/definitions/uint32 58 + 59 + debounce-interval: 60 + description: 61 + Debouncing interval time in milliseconds. If not specified defaults to 5. 62 + $ref: /schemas/types.yaml#/definitions/uint32 63 + 64 + default: 5 65 + 66 + wakeup-source: 67 + description: Button can wake-up the system. 68 + 69 + wakeup-event-action: 70 + description: | 71 + Specifies whether the key should wake the system when asserted, when 72 + deasserted, or both. This property is only valid for keys that wake up the 73 + system (e.g., when the "wakeup-source" property is also provided). 74 + 75 + Supported values are defined in linux-event-codes.h: 76 + 77 + EV_ACT_ANY - both asserted and deasserted 78 + EV_ACT_ASSERTED - asserted 79 + EV_ACT_DEASSERTED - deasserted 80 + $ref: /schemas/types.yaml#/definitions/uint32 81 + enum: [0, 1, 2] 82 + 83 + linux,can-disable: 84 + description: 85 + Indicates that button is connected to dedicated (not shared) interrupt 86 + which can be disabled to suppress events from the button. 87 + type: boolean 88 + 89 + required: 90 + - linux,code 91 + 92 + anyOf: 93 + - required: 94 + - interrupts 95 + - required: 96 + - interrupts-extended 97 + - required: 98 + - gpios 99 + 100 + dependencies: 101 + wakeup-event-action: [ wakeup-source ] 102 + linux,input-value: [ gpios ] 103 + 104 + unevaluatedProperties: false 105 + 106 + allOf: 107 + - $ref: input.yaml# 108 + - if: 25 109 properties: 26 - gpios: 27 - maxItems: 1 28 - 29 - interrupts: 30 - maxItems: 1 31 - 32 - label: 33 - description: Descriptive name of the key. 34 - 35 - linux,code: 36 - description: Key / Axis code to emit. 37 - $ref: /schemas/types.yaml#/definitions/uint32 38 - 39 - linux,input-type: 40 - description: 41 - Specify event type this button/key generates. If not specified defaults to 42 - <1> == EV_KEY. 43 - $ref: /schemas/types.yaml#/definitions/uint32 44 - 45 - default: 1 46 - 47 - linux,input-value: 48 - description: | 49 - If linux,input-type is EV_ABS or EV_REL then this 50 - value is sent for events this button generates when pressed. 51 - EV_ABS/EV_REL axis will generate an event with a value of 0 52 - when all buttons with linux,input-type == type and 53 - linux,code == axis are released. This value is interpreted 54 - as a signed 32 bit value, e.g. to make a button generate a 55 - value of -1 use: 56 - 57 - linux,input-value = <0xffffffff>; /* -1 */ 58 - 59 - $ref: /schemas/types.yaml#/definitions/uint32 60 - 61 - debounce-interval: 62 - description: 63 - Debouncing interval time in milliseconds. If not specified defaults to 5. 64 - $ref: /schemas/types.yaml#/definitions/uint32 65 - 66 - default: 5 67 - 68 - wakeup-source: 69 - description: Button can wake-up the system. 70 - 71 - wakeup-event-action: 72 - description: | 73 - Specifies whether the key should wake the system when asserted, when 74 - deasserted, or both. This property is only valid for keys that wake up the 75 - system (e.g., when the "wakeup-source" property is also provided). 76 - 77 - Supported values are defined in linux-event-codes.h: 78 - 79 - EV_ACT_ANY - both asserted and deasserted 80 - EV_ACT_ASSERTED - asserted 81 - EV_ACT_DEASSERTED - deasserted 82 - $ref: /schemas/types.yaml#/definitions/uint32 83 - enum: [0, 1, 2] 84 - 85 - linux,can-disable: 86 - description: 87 - Indicates that button is connected to dedicated (not shared) interrupt 88 - which can be disabled to suppress events from the button. 89 - type: boolean 90 - 110 + compatible: 111 + const: gpio-keys-polled 112 + then: 91 113 required: 92 - - linux,code 93 - 94 - anyOf: 95 - - required: 96 - - interrupts 97 - - required: 98 - - gpios 99 - 100 - dependencies: 101 - wakeup-event-action: [ wakeup-source ] 102 - linux,input-value: [ gpios ] 103 - 104 - unevaluatedProperties: false 105 - 106 - if: 107 - properties: 108 - compatible: 109 - const: gpio-keys-polled 110 - then: 111 - properties: 112 - poll-interval: 113 - description: 114 - Poll interval time in milliseconds 115 - $ref: /schemas/types.yaml#/definitions/uint32 116 - 117 - required: 118 - - poll-interval 114 + - poll-interval 115 + else: 116 + properties: 117 + poll-interval: false 119 118 120 119 additionalProperties: false 121 120 ··· 126 127 compatible = "gpio-keys"; 127 128 autorepeat; 128 129 129 - up { 130 + key-up { 130 131 label = "GPIO Key UP"; 131 132 linux,code = <103>; 132 133 gpios = <&gpio1 0 1>; 133 134 }; 134 135 135 - down { 136 + key-down { 136 137 label = "GPIO Key DOWN"; 137 138 linux,code = <108>; 138 139 interrupts = <1 IRQ_TYPE_EDGE_FALLING>;
+23 -1
Documentation/devicetree/bindings/input/input.yaml
··· 21 21 $ref: /schemas/types.yaml#/definitions/uint32-array 22 22 items: 23 23 minimum: 0 24 - maximum: 0xff 24 + maximum: 0x2ff 25 + 26 + linux,code: 27 + description: 28 + Specifies a single numeric keycode value to be used for reporting 29 + button/switch events. Specify KEY_RESERVED (0) to opt out of event 30 + reporting. 31 + $ref: /schemas/types.yaml#/definitions/uint32 32 + maximum: 0x2ff 33 + 34 + linux,input-type: 35 + $ref: /schemas/types.yaml#/definitions/uint32 36 + enum: 37 + - 1 # EV_KEY 38 + - 2 # EV_REL 39 + - 3 # EV_ABS 40 + - 5 # EV_SW 41 + description: 42 + Specifies whether the event is to be interpreted as a key, relative, 43 + absolute, or switch. 25 44 26 45 poll-interval: 27 46 description: Poll interval time in milliseconds. ··· 57 38 Duration in seconds which the key should be kept pressed for device to 58 39 reset automatically. Device with key pressed reset feature can specify 59 40 this property. 41 + 42 + dependencies: 43 + linux,input-type: [ "linux,code" ] 60 44 61 45 additionalProperties: true
+7 -10
Documentation/devicetree/bindings/input/iqs269a.yaml
··· 370 370 patternProperties: 371 371 "^event-prox(-alt)?$": 372 372 type: object 373 + $ref: input.yaml# 373 374 description: 374 375 Represents a proximity event reported by the channel in response to 375 376 a decrease in counts. Node names suffixed with '-alt' instead corre- ··· 397 396 default: 10 398 397 description: Specifies the threshold for the event. 399 398 400 - linux,code: 401 - $ref: /schemas/types.yaml#/definitions/uint32 402 - description: Numeric key or switch code associated with the event. 399 + linux,code: true 403 400 404 401 additionalProperties: false 405 402 406 403 "^event-touch(-alt)?$": 407 404 type: object 405 + $ref: input.yaml# 408 406 description: Represents a touch event reported by the channel. 409 407 410 408 properties: ··· 421 421 default: 4 422 422 description: Specifies the hysteresis for the event. 423 423 424 - linux,code: 425 - $ref: /schemas/types.yaml#/definitions/uint32 426 - description: Numeric key or switch code associated with the event. 424 + linux,code: true 427 425 428 426 additionalProperties: false 429 427 430 428 "^event-deep(-alt)?$": 431 429 type: object 430 + $ref: input.yaml# 432 431 description: Represents a deep-touch event reported by the channel. 433 432 434 433 properties: ··· 445 446 default: 0 446 447 description: Specifies the hysteresis for the event. 447 448 448 - linux,code: 449 - $ref: /schemas/types.yaml#/definitions/uint32 450 - description: Numeric key or switch code associated with the event. 449 + linux,code: true 451 450 452 451 additionalProperties: false 453 452 ··· 472 475 #address-cells = <1>; 473 476 #size-cells = <0>; 474 477 475 - iqs269a@44 { 478 + touch@44 { 476 479 #address-cells = <1>; 477 480 #size-cells = <0>; 478 481
+4 -9
Documentation/devicetree/bindings/input/iqs626a.yaml
··· 449 449 patternProperties: 450 450 "^event-(prox|touch|deep)(-alt)?$": 451 451 type: object 452 + $ref: input.yaml# 452 453 description: 453 454 Represents a proximity, touch or deep-touch event reported by the 454 455 channel in response to a decrease in counts. Node names suffixed with ··· 488 487 Specifies the hysteresis for the event (touch and deep-touch 489 488 events only). 490 489 491 - linux,code: 492 - $ref: /schemas/types.yaml#/definitions/uint32 493 - description: Numeric key or switch code associated with the event. 490 + linux,code: true 494 491 495 492 linux,input-type: 496 - $ref: /schemas/types.yaml#/definitions/uint32 497 493 enum: [1, 5] 498 494 description: 499 495 Specifies whether the event is to be interpreted as a key (1) or 500 496 a switch (5). By default, Hall-channel events are interpreted as 501 497 switches and all others are interpreted as keys. 502 - 503 - dependencies: 504 - linux,input-type: ["linux,code"] 505 498 506 499 additionalProperties: false 507 500 ··· 506 511 507 512 "^trackpad-3x[2-3]$": 508 513 type: object 514 + $ref: input.yaml# 509 515 description: 510 516 Represents all channels associated with the trackpad. The channels are 511 517 collectively active if the trackpad is defined and inactive otherwise. ··· 675 679 Specifies the raw count filter strength during low-power mode. 676 680 677 681 linux,keycodes: 678 - $ref: /schemas/types.yaml#/definitions/uint32-array 679 682 minItems: 1 680 683 maxItems: 6 681 684 description: | ··· 746 751 #address-cells = <1>; 747 752 #size-cells = <0>; 748 753 749 - iqs626a@44 { 754 + touch@44 { 750 755 #address-cells = <1>; 751 756 #size-cells = <0>; 752 757
+5 -4
Documentation/devicetree/bindings/input/iqs62x-keys.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 IQS620A, IQS621, IQS622, IQS624 and IQS625 multi-function sensors 14 17 feature a variety of self-capacitive, mutual-inductive and Hall-effect sens- ··· 33 30 - azoteq,iqs625-keys 34 31 35 32 linux,keycodes: 36 - $ref: /schemas/types.yaml#/definitions/uint32-array 37 33 minItems: 1 38 34 maxItems: 16 39 35 description: | ··· 91 89 patternProperties: 92 90 "^hall-switch-(north|south)$": 93 91 type: object 92 + $ref: input.yaml# 94 93 description: 95 94 Represents north/south-field Hall-effect sensor touch or proximity 96 95 events. Note that north/south-field orientation is reversed on the 97 96 IQS620AXzCSR device due to its flip-chip package. 98 97 99 98 properties: 100 - linux,code: 101 - $ref: /schemas/types.yaml#/definitions/uint32 102 - description: Numeric switch code associated with the event. 99 + linux,code: true 103 100 104 101 azoteq,use-prox: 105 102 $ref: /schemas/types.yaml#/definitions/flag
+4 -4
Documentation/devicetree/bindings/input/max77650-onkey.yaml
··· 16 16 The onkey controller is represented as a sub-node of the PMIC node on 17 17 the device tree. 18 18 19 + allOf: 20 + - $ref: input.yaml# 21 + 19 22 properties: 20 23 compatible: 21 24 const: maxim,max77650-onkey 22 25 23 26 linux,code: 24 - $ref: /schemas/types.yaml#/definitions/uint32 25 - description: 26 - The key-code to be reported when the key is pressed. Defaults 27 - to KEY_POWER. 27 + default: 116 # KEY_POWER 28 28 29 29 maxim,onkey-slide: 30 30 $ref: /schemas/types.yaml#/definitions/flag
+1 -1
Documentation/devicetree/bindings/input/microchip,cap11xx.yaml
··· 112 112 #address-cells = <1>; 113 113 #size-cells = <0>; 114 114 115 - cap1188@28 { 115 + touch@28 { 116 116 compatible = "microchip,cap1188"; 117 117 interrupt-parent = <&gpio1>; 118 118 interrupts = <0 0>;
+8
Documentation/devicetree/bindings/input/touchscreen/edt-ft5x06.yaml
··· 85 85 minimum: 0 86 86 maximum: 80 87 87 88 + report-rate-hz: 89 + description: | 90 + Allows setting the scan rate in Hertz. 91 + M06 supports range from 30 to 140 Hz. 92 + M12 supports range from 1 to 255 Hz. 93 + minimum: 1 94 + maximum: 255 95 + 88 96 touchscreen-size-x: true 89 97 touchscreen-size-y: true 90 98 touchscreen-fuzz-x: true
+16
drivers/input/input-core-private.h
··· 1 + /* SPDX-License-Identifier: GPL-2.0-only */ 2 + #ifndef _INPUT_CORE_PRIVATE_H 3 + #define _INPUT_CORE_PRIVATE_H 4 + 5 + /* 6 + * Functions and definitions that are private to input core, 7 + * should not be used by input drivers or handlers. 8 + */ 9 + 10 + struct input_dev; 11 + 12 + void input_mt_release_slots(struct input_dev *dev); 13 + void input_handle_event(struct input_dev *dev, 14 + unsigned int type, unsigned int code, int value); 15 + 16 + #endif /* _INPUT_CORE_PRIVATE_H */
+44 -4
drivers/input/input-mt.c
··· 8 8 #include <linux/input/mt.h> 9 9 #include <linux/export.h> 10 10 #include <linux/slab.h> 11 + #include "input-core-private.h" 11 12 12 13 #define TRKID_SGN ((TRKID_MAX + 1) >> 1) 13 14 ··· 260 259 { 261 260 int i; 262 261 262 + lockdep_assert_held(&dev->event_lock); 263 + 263 264 for (i = 0; i < mt->num_slots; i++) { 264 - if (!input_mt_is_used(mt, &mt->slots[i])) { 265 - input_mt_slot(dev, i); 266 - input_event(dev, EV_ABS, ABS_MT_TRACKING_ID, -1); 265 + if (input_mt_is_active(&mt->slots[i]) && 266 + !input_mt_is_used(mt, &mt->slots[i])) { 267 + input_handle_event(dev, EV_ABS, ABS_MT_SLOT, i); 268 + input_handle_event(dev, EV_ABS, ABS_MT_TRACKING_ID, -1); 267 269 } 268 270 } 269 271 } ··· 282 278 struct input_mt *mt = dev->mt; 283 279 284 280 if (mt) { 281 + unsigned long flags; 282 + 283 + spin_lock_irqsave(&dev->event_lock, flags); 284 + 285 285 __input_mt_drop_unused(dev, mt); 286 286 mt->frame++; 287 + 288 + spin_unlock_irqrestore(&dev->event_lock, flags); 287 289 } 288 290 } 289 291 EXPORT_SYMBOL(input_mt_drop_unused); 292 + 293 + /** 294 + * input_mt_release_slots() - Deactivate all slots 295 + * @dev: input device with allocated MT slots 296 + * 297 + * Lift all active slots. 298 + */ 299 + void input_mt_release_slots(struct input_dev *dev) 300 + { 301 + struct input_mt *mt = dev->mt; 302 + 303 + lockdep_assert_held(&dev->event_lock); 304 + 305 + if (mt) { 306 + /* This will effectively mark all slots unused. */ 307 + mt->frame++; 308 + 309 + __input_mt_drop_unused(dev, mt); 310 + 311 + if (test_bit(ABS_PRESSURE, dev->absbit)) 312 + input_handle_event(dev, EV_ABS, ABS_PRESSURE, 0); 313 + 314 + mt->frame++; 315 + } 316 + } 290 317 291 318 /** 292 319 * input_mt_sync_frame() - synchronize mt frame ··· 335 300 if (!mt) 336 301 return; 337 302 338 - if (mt->flags & INPUT_MT_DROP_UNUSED) 303 + if (mt->flags & INPUT_MT_DROP_UNUSED) { 304 + unsigned long flags; 305 + 306 + spin_lock_irqsave(&dev->event_lock, flags); 339 307 __input_mt_drop_unused(dev, mt); 308 + spin_unlock_irqrestore(&dev->event_lock, flags); 309 + } 340 310 341 311 if ((mt->flags & INPUT_MT_POINTER) && !(mt->flags & INPUT_MT_SEMI_MT)) 342 312 use_count = true;
+80 -69
drivers/input/input.c
··· 24 24 #include <linux/mutex.h> 25 25 #include <linux/rcupdate.h> 26 26 #include "input-compat.h" 27 + #include "input-core-private.h" 27 28 #include "input-poller.h" 28 29 29 30 MODULE_AUTHOR("Vojtech Pavlik <vojtech@suse.cz>"); ··· 143 142 struct input_handle *handle; 144 143 struct input_value *v; 145 144 145 + lockdep_assert_held(&dev->event_lock); 146 + 146 147 if (!count) 147 148 return; 148 149 ··· 175 172 } 176 173 } 177 174 } 178 - } 179 - 180 - static void input_pass_event(struct input_dev *dev, 181 - unsigned int type, unsigned int code, int value) 182 - { 183 - struct input_value vals[] = { { type, code, value } }; 184 - 185 - input_pass_values(dev, vals, ARRAY_SIZE(vals)); 186 - } 187 - 188 - /* 189 - * Generate software autorepeat event. Note that we take 190 - * dev->event_lock here to avoid racing with input_event 191 - * which may cause keys get "stuck". 192 - */ 193 - static void input_repeat_key(struct timer_list *t) 194 - { 195 - struct input_dev *dev = from_timer(dev, t, timer); 196 - unsigned long flags; 197 - 198 - spin_lock_irqsave(&dev->event_lock, flags); 199 - 200 - if (test_bit(dev->repeat_key, dev->key) && 201 - is_event_supported(dev->repeat_key, dev->keybit, KEY_MAX)) { 202 - struct input_value vals[] = { 203 - { EV_KEY, dev->repeat_key, 2 }, 204 - input_value_sync 205 - }; 206 - 207 - input_set_timestamp(dev, ktime_get()); 208 - input_pass_values(dev, vals, ARRAY_SIZE(vals)); 209 - 210 - if (dev->rep[REP_PERIOD]) 211 - mod_timer(&dev->timer, jiffies + 212 - msecs_to_jiffies(dev->rep[REP_PERIOD])); 213 - } 214 - 215 - spin_unlock_irqrestore(&dev->event_lock, flags); 216 175 } 217 176 218 177 #define INPUT_IGNORE_EVENT 0 ··· 239 274 { 240 275 int disposition = INPUT_IGNORE_EVENT; 241 276 int value = *pval; 277 + 278 + /* filter-out events from inhibited devices */ 279 + if (dev->inhibited) 280 + return INPUT_IGNORE_EVENT; 242 281 243 282 switch (type) { 244 283 ··· 344 375 return disposition; 345 376 } 346 377 347 - static void input_handle_event(struct input_dev *dev, 348 - unsigned int type, unsigned int code, int value) 378 + static void input_event_dispose(struct input_dev *dev, int disposition, 379 + unsigned int type, unsigned int code, int value) 349 380 { 350 - int disposition; 351 - 352 - /* filter-out events from inhibited devices */ 353 - if (dev->inhibited) 354 - return; 355 - 356 - disposition = input_get_disposition(dev, type, code, &value); 357 - if (disposition != INPUT_IGNORE_EVENT && type != EV_SYN) 358 - add_input_randomness(type, code, value); 359 - 360 381 if ((disposition & INPUT_PASS_TO_DEVICE) && dev->event) 361 382 dev->event(dev, type, code, value); 362 383 ··· 385 426 input_pass_values(dev, dev->vals, dev->num_vals); 386 427 dev->num_vals = 0; 387 428 } 429 + } 388 430 431 + void input_handle_event(struct input_dev *dev, 432 + unsigned int type, unsigned int code, int value) 433 + { 434 + int disposition; 435 + 436 + lockdep_assert_held(&dev->event_lock); 437 + 438 + disposition = input_get_disposition(dev, type, code, &value); 439 + if (disposition != INPUT_IGNORE_EVENT) { 440 + if (type != EV_SYN) 441 + add_input_randomness(type, code, value); 442 + 443 + input_event_dispose(dev, disposition, type, code, value); 444 + } 389 445 } 390 446 391 447 /** ··· 587 613 lockdep_is_held(&dev->mutex)); 588 614 if (grabber == handle) { 589 615 rcu_assign_pointer(dev->grab, NULL); 590 - /* Make sure input_pass_event() notices that grab is gone */ 616 + /* Make sure input_pass_values() notices that grab is gone */ 591 617 synchronize_rcu(); 592 618 593 619 list_for_each_entry(handle, &dev->h_list, d_node) ··· 710 736 711 737 if (!--handle->open) { 712 738 /* 713 - * synchronize_rcu() makes sure that input_pass_event() 739 + * synchronize_rcu() makes sure that input_pass_values() 714 740 * completed and that no more input events are delivered 715 741 * through this handle 716 742 */ ··· 725 751 * Simulate keyup events for all keys that are marked as pressed. 726 752 * The function must be called with dev->event_lock held. 727 753 */ 728 - static void input_dev_release_keys(struct input_dev *dev) 754 + static bool input_dev_release_keys(struct input_dev *dev) 729 755 { 730 756 bool need_sync = false; 731 757 int code; 732 758 759 + lockdep_assert_held(&dev->event_lock); 760 + 733 761 if (is_event_supported(EV_KEY, dev->evbit, EV_MAX)) { 734 762 for_each_set_bit(code, dev->key, KEY_CNT) { 735 - input_pass_event(dev, EV_KEY, code, 0); 763 + input_handle_event(dev, EV_KEY, code, 0); 736 764 need_sync = true; 737 765 } 738 - 739 - if (need_sync) 740 - input_pass_event(dev, EV_SYN, SYN_REPORT, 1); 741 - 742 - memset(dev->key, 0, sizeof(dev->key)); 743 766 } 767 + 768 + return need_sync; 744 769 } 745 770 746 771 /* ··· 766 793 * generate events even after we done here but they will not 767 794 * reach any handlers. 768 795 */ 769 - input_dev_release_keys(dev); 796 + if (input_dev_release_keys(dev)) 797 + input_handle_event(dev, EV_SYN, SYN_REPORT, 1); 770 798 771 799 list_for_each_entry(handle, &dev->h_list, d_node) 772 800 handle->open = 0; ··· 978 1004 } else if (test_bit(EV_KEY, dev->evbit) && 979 1005 !is_event_supported(old_keycode, dev->keybit, KEY_MAX) && 980 1006 __test_and_clear_bit(old_keycode, dev->key)) { 981 - struct input_value vals[] = { 982 - { EV_KEY, old_keycode, 0 }, 983 - input_value_sync 984 - }; 985 - 986 - input_pass_values(dev, vals, ARRAY_SIZE(vals)); 1007 + /* 1008 + * We have to use input_event_dispose() here directly instead 1009 + * of input_handle_event() because the key we want to release 1010 + * here is considered no longer supported by the device and 1011 + * input_handle_event() will ignore it. 1012 + */ 1013 + input_event_dispose(dev, INPUT_PASS_TO_HANDLERS, 1014 + EV_KEY, old_keycode, 0); 1015 + input_event_dispose(dev, INPUT_PASS_TO_HANDLERS | INPUT_FLUSH, 1016 + EV_SYN, SYN_REPORT, 1); 987 1017 } 988 1018 989 1019 out: ··· 1762 1784 spin_lock_irqsave(&dev->event_lock, flags); 1763 1785 1764 1786 input_dev_toggle(dev, true); 1765 - input_dev_release_keys(dev); 1787 + if (input_dev_release_keys(dev)) 1788 + input_handle_event(dev, EV_SYN, SYN_REPORT, 1); 1766 1789 1767 1790 spin_unlock_irqrestore(&dev->event_lock, flags); 1768 1791 mutex_unlock(&dev->mutex); ··· 1785 1806 } 1786 1807 1787 1808 spin_lock_irq(&dev->event_lock); 1809 + input_mt_release_slots(dev); 1788 1810 input_dev_release_keys(dev); 1811 + input_handle_event(dev, EV_SYN, SYN_REPORT, 1); 1789 1812 input_dev_toggle(dev, false); 1790 1813 spin_unlock_irq(&dev->event_lock); 1791 1814 ··· 1838 1857 * Keys that are pressed now are unlikely to be 1839 1858 * still pressed when we resume. 1840 1859 */ 1841 - input_dev_release_keys(input_dev); 1860 + if (input_dev_release_keys(input_dev)) 1861 + input_handle_event(input_dev, EV_SYN, SYN_REPORT, 1); 1842 1862 1843 1863 /* Turn off LEDs and sounds, if any are active. */ 1844 1864 input_dev_toggle(input_dev, false); ··· 1873 1891 * Keys that are pressed now are unlikely to be 1874 1892 * still pressed when we resume. 1875 1893 */ 1876 - input_dev_release_keys(input_dev); 1894 + if (input_dev_release_keys(input_dev)) 1895 + input_handle_event(input_dev, EV_SYN, SYN_REPORT, 1); 1877 1896 1878 1897 spin_unlock_irq(&input_dev->event_lock); 1879 1898 ··· 2240 2257 dev_dbg(dev, "%s: unregistering device %s\n", 2241 2258 __func__, dev_name(&input->dev)); 2242 2259 __input_unregister_device(input); 2260 + } 2261 + 2262 + /* 2263 + * Generate software autorepeat event. Note that we take 2264 + * dev->event_lock here to avoid racing with input_event 2265 + * which may cause keys get "stuck". 2266 + */ 2267 + static void input_repeat_key(struct timer_list *t) 2268 + { 2269 + struct input_dev *dev = from_timer(dev, t, timer); 2270 + unsigned long flags; 2271 + 2272 + spin_lock_irqsave(&dev->event_lock, flags); 2273 + 2274 + if (!dev->inhibited && 2275 + test_bit(dev->repeat_key, dev->key) && 2276 + is_event_supported(dev->repeat_key, dev->keybit, KEY_MAX)) { 2277 + 2278 + input_set_timestamp(dev, ktime_get()); 2279 + input_handle_event(dev, EV_KEY, dev->repeat_key, 2); 2280 + input_handle_event(dev, EV_SYN, SYN_REPORT, 1); 2281 + 2282 + if (dev->rep[REP_PERIOD]) 2283 + mod_timer(&dev->timer, jiffies + 2284 + msecs_to_jiffies(dev->rep[REP_PERIOD])); 2285 + } 2286 + 2287 + spin_unlock_irqrestore(&dev->event_lock, flags); 2243 2288 } 2244 2289 2245 2290 /**
+8 -7
drivers/input/joystick/adc-joystick.c
··· 222 222 if (error) 223 223 return error; 224 224 225 - input_set_drvdata(input, joy); 226 - error = input_register_device(input); 227 - if (error) { 228 - dev_err(dev, "Unable to register input device\n"); 229 - return error; 230 - } 231 - 232 225 joy->buffer = iio_channel_get_all_cb(dev, adc_joystick_handle, joy); 233 226 if (IS_ERR(joy->buffer)) { 234 227 dev_err(dev, "Unable to allocate callback buffer\n"); ··· 231 238 error = devm_add_action_or_reset(dev, adc_joystick_cleanup, joy->buffer); 232 239 if (error) { 233 240 dev_err(dev, "Unable to add action\n"); 241 + return error; 242 + } 243 + 244 + input_set_drvdata(input, joy); 245 + 246 + error = input_register_device(input); 247 + if (error) { 248 + dev_err(dev, "Unable to register input device\n"); 234 249 return error; 235 250 } 236 251
+1 -3
drivers/input/joystick/sensehat-joystick.c
··· 98 98 } 99 99 100 100 irq = platform_get_irq(pdev, 0); 101 - if (irq < 0) { 102 - dev_err(&pdev->dev, "Could not retrieve interrupt request"); 101 + if (irq < 0) 103 102 return irq; 104 - } 105 103 106 104 error = devm_request_threaded_irq(&pdev->dev, irq, 107 105 NULL, sensehat_joystick_report,
+1 -1
drivers/input/keyboard/Kconfig
··· 795 795 796 796 config KEYBOARD_MTK_PMIC 797 797 tristate "MediaTek PMIC keys support" 798 - depends on MFD_MT6397 798 + depends on MFD_MT6397 || COMPILE_TEST 799 799 help 800 800 Say Y here if you want to use the pmic keys (powerkey/homekey). 801 801
+91 -119
drivers/input/keyboard/adp5588-keys.c
··· 8 8 * Copyright (C) 2008-2010 Analog Devices Inc. 9 9 */ 10 10 11 - #include <linux/module.h> 11 + #include <linux/delay.h> 12 + #include <linux/errno.h> 13 + #include <linux/gpio/driver.h> 14 + #include <linux/i2c.h> 15 + #include <linux/input.h> 12 16 #include <linux/interrupt.h> 13 17 #include <linux/irq.h> 14 - #include <linux/workqueue.h> 15 - #include <linux/errno.h> 16 - #include <linux/pm.h> 18 + #include <linux/ktime.h> 19 + #include <linux/module.h> 17 20 #include <linux/platform_device.h> 18 - #include <linux/input.h> 19 - #include <linux/i2c.h> 20 - #include <linux/gpio/driver.h> 21 + #include <linux/pm.h> 21 22 #include <linux/slab.h> 23 + #include <linux/timekeeping.h> 22 24 23 25 #include <linux/platform_data/adp5588.h> 24 26 ··· 38 36 * asserted. 39 37 */ 40 38 #define WA_DELAYED_READOUT_REVID(rev) ((rev) < 4) 39 + #define WA_DELAYED_READOUT_TIME 25 41 40 42 41 struct adp5588_kpad { 43 42 struct i2c_client *client; 44 43 struct input_dev *input; 45 - struct delayed_work work; 44 + ktime_t irq_time; 46 45 unsigned long delay; 47 46 unsigned short keycode[ADP5588_KEYMAPSIZE]; 48 47 const struct adp5588_gpi_map *gpimap; 49 48 unsigned short gpimapsize; 50 49 #ifdef CONFIG_GPIOLIB 51 50 unsigned char gpiomap[ADP5588_MAXGPIO]; 52 - bool export_gpio; 53 51 struct gpio_chip gc; 54 52 struct mutex gpio_lock; /* Protect cached dir, dat_out */ 55 53 u8 dat_out[3]; ··· 181 179 return n_unused; 182 180 } 183 181 182 + static void adp5588_gpio_do_teardown(void *_kpad) 183 + { 184 + struct adp5588_kpad *kpad = _kpad; 185 + struct device *dev = &kpad->client->dev; 186 + const struct adp5588_kpad_platform_data *pdata = dev_get_platdata(dev); 187 + const struct adp5588_gpio_platform_data *gpio_data = pdata->gpio_data; 188 + int error; 189 + 190 + error = gpio_data->teardown(kpad->client, 191 + kpad->gc.base, kpad->gc.ngpio, 192 + gpio_data->context); 193 + if (error) 194 + dev_warn(&kpad->client->dev, "teardown failed %d\n", error); 195 + } 196 + 184 197 static int adp5588_gpio_add(struct adp5588_kpad *kpad) 185 198 { 186 199 struct device *dev = &kpad->client->dev; ··· 212 195 return 0; 213 196 } 214 197 215 - kpad->export_gpio = true; 216 - 217 198 kpad->gc.direction_input = adp5588_gpio_direction_input; 218 199 kpad->gc.direction_output = adp5588_gpio_direction_output; 219 200 kpad->gc.get = adp5588_gpio_get_value; ··· 225 210 226 211 mutex_init(&kpad->gpio_lock); 227 212 228 - error = gpiochip_add_data(&kpad->gc, kpad); 213 + error = devm_gpiochip_add_data(dev, &kpad->gc, kpad); 229 214 if (error) { 230 - dev_err(dev, "gpiochip_add failed, err: %d\n", error); 215 + dev_err(dev, "gpiochip_add failed: %d\n", error); 231 216 return error; 232 217 } 233 218 ··· 242 227 kpad->gc.base, kpad->gc.ngpio, 243 228 gpio_data->context); 244 229 if (error) 245 - dev_warn(dev, "setup failed, %d\n", error); 230 + dev_warn(dev, "setup failed: %d\n", error); 231 + } 232 + 233 + if (gpio_data->teardown) { 234 + error = devm_add_action(dev, adp5588_gpio_do_teardown, kpad); 235 + if (error) 236 + dev_warn(dev, "failed to schedule teardown: %d\n", 237 + error); 246 238 } 247 239 248 240 return 0; 249 241 } 250 242 251 - static void adp5588_gpio_remove(struct adp5588_kpad *kpad) 252 - { 253 - struct device *dev = &kpad->client->dev; 254 - const struct adp5588_kpad_platform_data *pdata = dev_get_platdata(dev); 255 - const struct adp5588_gpio_platform_data *gpio_data = pdata->gpio_data; 256 - int error; 257 - 258 - if (!kpad->export_gpio) 259 - return; 260 - 261 - if (gpio_data->teardown) { 262 - error = gpio_data->teardown(kpad->client, 263 - kpad->gc.base, kpad->gc.ngpio, 264 - gpio_data->context); 265 - if (error) 266 - dev_warn(dev, "teardown failed %d\n", error); 267 - } 268 - 269 - gpiochip_remove(&kpad->gc); 270 - } 271 243 #else 272 244 static inline int adp5588_gpio_add(struct adp5588_kpad *kpad) 273 245 { 274 246 return 0; 275 - } 276 - 277 - static inline void adp5588_gpio_remove(struct adp5588_kpad *kpad) 278 - { 279 247 } 280 248 #endif 281 249 ··· 287 289 } 288 290 } 289 291 290 - static void adp5588_work(struct work_struct *work) 292 + static irqreturn_t adp5588_hard_irq(int irq, void *handle) 291 293 { 292 - struct adp5588_kpad *kpad = container_of(work, 293 - struct adp5588_kpad, work.work); 294 + struct adp5588_kpad *kpad = handle; 295 + 296 + kpad->irq_time = ktime_get(); 297 + 298 + return IRQ_WAKE_THREAD; 299 + } 300 + 301 + static irqreturn_t adp5588_thread_irq(int irq, void *handle) 302 + { 303 + struct adp5588_kpad *kpad = handle; 294 304 struct i2c_client *client = kpad->client; 305 + ktime_t target_time, now; 306 + unsigned long delay; 295 307 int status, ev_cnt; 308 + 309 + /* 310 + * Readout needs to wait for at least 25ms after the notification 311 + * for REVID < 4. 312 + */ 313 + if (kpad->delay) { 314 + target_time = ktime_add_ms(kpad->irq_time, kpad->delay); 315 + now = ktime_get(); 316 + if (ktime_before(now, target_time)) { 317 + delay = ktime_to_us(ktime_sub(target_time, now)); 318 + usleep_range(delay, delay + 1000); 319 + } 320 + } 296 321 297 322 status = adp5588_read(client, INT_STAT); 298 323 ··· 329 308 input_sync(kpad->input); 330 309 } 331 310 } 311 + 332 312 adp5588_write(client, INT_STAT, status); /* Status is W1C */ 333 - } 334 - 335 - static irqreturn_t adp5588_irq(int irq, void *handle) 336 - { 337 - struct adp5588_kpad *kpad = handle; 338 - 339 - /* 340 - * use keventd context to read the event fifo registers 341 - * Schedule readout at least 25ms after notification for 342 - * REVID < 4 343 - */ 344 - 345 - schedule_delayed_work(&kpad->work, kpad->delay); 346 313 347 314 return IRQ_HANDLED; 348 315 } ··· 505 496 return -EINVAL; 506 497 } 507 498 508 - kpad = kzalloc(sizeof(*kpad), GFP_KERNEL); 509 - input = input_allocate_device(); 510 - if (!kpad || !input) { 511 - error = -ENOMEM; 512 - goto err_free_mem; 513 - } 499 + kpad = devm_kzalloc(&client->dev, sizeof(*kpad), GFP_KERNEL); 500 + if (!kpad) 501 + return -ENOMEM; 502 + 503 + input = devm_input_allocate_device(&client->dev); 504 + if (!input) 505 + return -ENOMEM; 514 506 515 507 kpad->client = client; 516 508 kpad->input = input; 517 - INIT_DELAYED_WORK(&kpad->work, adp5588_work); 518 509 519 510 ret = adp5588_read(client, DEV_ID); 520 - if (ret < 0) { 521 - error = ret; 522 - goto err_free_mem; 523 - } 511 + if (ret < 0) 512 + return ret; 524 513 525 514 revid = (u8) ret & ADP5588_DEVICE_ID_MASK; 526 515 if (WA_DELAYED_READOUT_REVID(revid)) 527 - kpad->delay = msecs_to_jiffies(30); 516 + kpad->delay = msecs_to_jiffies(WA_DELAYED_READOUT_TIME); 528 517 529 518 input->name = client->name; 530 519 input->phys = "adp5588-keys/input0"; 531 - input->dev.parent = &client->dev; 532 520 533 521 input_set_drvdata(input, kpad); 534 522 ··· 562 556 563 557 error = input_register_device(input); 564 558 if (error) { 565 - dev_err(&client->dev, "unable to register input device\n"); 566 - goto err_free_mem; 559 + dev_err(&client->dev, "unable to register input device: %d\n", 560 + error); 561 + return error; 567 562 } 568 563 569 - error = request_irq(client->irq, adp5588_irq, 570 - IRQF_TRIGGER_FALLING, 571 - client->dev.driver->name, kpad); 564 + error = devm_request_threaded_irq(&client->dev, client->irq, 565 + adp5588_hard_irq, adp5588_thread_irq, 566 + IRQF_TRIGGER_FALLING | IRQF_ONESHOT, 567 + client->dev.driver->name, kpad); 572 568 if (error) { 573 - dev_err(&client->dev, "irq %d busy?\n", client->irq); 574 - goto err_unreg_dev; 569 + dev_err(&client->dev, "failed to request irq %d: %d\n", 570 + client->irq, error); 571 + return error; 575 572 } 576 573 577 574 error = adp5588_setup(client); 578 575 if (error) 579 - goto err_free_irq; 576 + return error; 580 577 581 578 if (kpad->gpimapsize) 582 579 adp5588_report_switch_state(kpad); 583 580 584 581 error = adp5588_gpio_add(kpad); 585 582 if (error) 586 - goto err_free_irq; 587 - 588 - device_init_wakeup(&client->dev, 1); 589 - i2c_set_clientdata(client, kpad); 583 + return error; 590 584 591 585 dev_info(&client->dev, "Rev.%d keypad, irq %d\n", revid, client->irq); 592 586 return 0; 593 - 594 - err_free_irq: 595 - free_irq(client->irq, kpad); 596 - cancel_delayed_work_sync(&kpad->work); 597 - err_unreg_dev: 598 - input_unregister_device(input); 599 - input = NULL; 600 - err_free_mem: 601 - input_free_device(input); 602 - kfree(kpad); 603 - 604 - return error; 605 587 } 606 588 607 589 static int adp5588_remove(struct i2c_client *client) 608 590 { 609 - struct adp5588_kpad *kpad = i2c_get_clientdata(client); 610 - 611 591 adp5588_write(client, CFG, 0); 612 - free_irq(client->irq, kpad); 613 - cancel_delayed_work_sync(&kpad->work); 614 - input_unregister_device(kpad->input); 615 - adp5588_gpio_remove(kpad); 616 - kfree(kpad); 617 592 593 + /* all resources will be freed by devm */ 618 594 return 0; 619 595 } 620 596 621 - #ifdef CONFIG_PM 622 - static int adp5588_suspend(struct device *dev) 597 + static int __maybe_unused adp5588_suspend(struct device *dev) 623 598 { 624 - struct adp5588_kpad *kpad = dev_get_drvdata(dev); 625 - struct i2c_client *client = kpad->client; 599 + struct i2c_client *client = to_i2c_client(dev); 626 600 627 601 disable_irq(client->irq); 628 - cancel_delayed_work_sync(&kpad->work); 629 - 630 - if (device_may_wakeup(&client->dev)) 631 - enable_irq_wake(client->irq); 632 602 633 603 return 0; 634 604 } 635 605 636 - static int adp5588_resume(struct device *dev) 606 + static int __maybe_unused adp5588_resume(struct device *dev) 637 607 { 638 - struct adp5588_kpad *kpad = dev_get_drvdata(dev); 639 - struct i2c_client *client = kpad->client; 640 - 641 - if (device_may_wakeup(&client->dev)) 642 - disable_irq_wake(client->irq); 608 + struct i2c_client *client = to_i2c_client(dev); 643 609 644 610 enable_irq(client->irq); 645 611 646 612 return 0; 647 613 } 648 614 649 - static const struct dev_pm_ops adp5588_dev_pm_ops = { 650 - .suspend = adp5588_suspend, 651 - .resume = adp5588_resume, 652 - }; 653 - #endif 615 + static SIMPLE_DEV_PM_OPS(adp5588_dev_pm_ops, adp5588_suspend, adp5588_resume); 654 616 655 617 static const struct i2c_device_id adp5588_id[] = { 656 618 { "adp5588-keys", 0 }, ··· 630 656 static struct i2c_driver adp5588_driver = { 631 657 .driver = { 632 658 .name = KBUILD_MODNAME, 633 - #ifdef CONFIG_PM 634 659 .pm = &adp5588_dev_pm_ops, 635 - #endif 636 660 }, 637 661 .probe = adp5588_probe, 638 662 .remove = adp5588_remove,
+64 -25
drivers/input/keyboard/cros_ec_keyb.c
··· 12 12 // expensive. 13 13 14 14 #include <linux/module.h> 15 + #include <linux/acpi.h> 15 16 #include <linux/bitops.h> 16 17 #include <linux/i2c.h> 17 18 #include <linux/input.h> ··· 519 518 return 0; 520 519 } 521 520 521 + static void cros_ec_keyb_parse_vivaldi_physmap(struct cros_ec_keyb *ckdev) 522 + { 523 + u32 *physmap = ckdev->vdata.function_row_physmap; 524 + unsigned int row, col, scancode; 525 + int n_physmap; 526 + int error; 527 + int i; 528 + 529 + n_physmap = device_property_count_u32(ckdev->dev, 530 + "function-row-physmap"); 531 + if (n_physmap <= 0) 532 + return; 533 + 534 + if (n_physmap >= VIVALDI_MAX_FUNCTION_ROW_KEYS) { 535 + dev_warn(ckdev->dev, 536 + "only up to %d top row keys is supported (%d specified)\n", 537 + VIVALDI_MAX_FUNCTION_ROW_KEYS, n_physmap); 538 + n_physmap = VIVALDI_MAX_FUNCTION_ROW_KEYS; 539 + } 540 + 541 + error = device_property_read_u32_array(ckdev->dev, 542 + "function-row-physmap", 543 + physmap, n_physmap); 544 + if (error) { 545 + dev_warn(ckdev->dev, 546 + "failed to parse function-row-physmap property: %d\n", 547 + error); 548 + return; 549 + } 550 + 551 + /* 552 + * Convert (in place) from row/column encoding to matrix "scancode" 553 + * used by the driver. 554 + */ 555 + for (i = 0; i < n_physmap; i++) { 556 + row = KEY_ROW(physmap[i]); 557 + col = KEY_COL(physmap[i]); 558 + scancode = MATRIX_SCAN_CODE(row, col, ckdev->row_shift); 559 + physmap[i] = scancode; 560 + } 561 + 562 + ckdev->vdata.num_function_row_keys = n_physmap; 563 + } 564 + 522 565 /** 523 566 * cros_ec_keyb_register_matrix - Register matrix keys 524 567 * ··· 579 534 struct input_dev *idev; 580 535 const char *phys; 581 536 int err; 582 - struct property *prop; 583 - const __be32 *p; 584 - u32 *physmap; 585 - u32 key_pos; 586 - unsigned int row, col, scancode, n_physmap; 587 537 588 538 err = matrix_keypad_parse_properties(dev, &ckdev->rows, &ckdev->cols); 589 539 if (err) ··· 613 573 idev->id.product = 0; 614 574 idev->dev.parent = dev; 615 575 616 - ckdev->ghost_filter = of_property_read_bool(dev->of_node, 576 + ckdev->ghost_filter = device_property_read_bool(dev, 617 577 "google,needs-ghost-filter"); 618 578 619 579 err = matrix_keypad_build_keymap(NULL, NULL, ckdev->rows, ckdev->cols, ··· 629 589 input_set_drvdata(idev, ckdev); 630 590 ckdev->idev = idev; 631 591 cros_ec_keyb_compute_valid_keys(ckdev); 632 - 633 - physmap = ckdev->vdata.function_row_physmap; 634 - n_physmap = 0; 635 - of_property_for_each_u32(dev->of_node, "function-row-physmap", 636 - prop, p, key_pos) { 637 - if (n_physmap == VIVALDI_MAX_FUNCTION_ROW_KEYS) { 638 - dev_warn(dev, "Only support up to %d top row keys\n", 639 - VIVALDI_MAX_FUNCTION_ROW_KEYS); 640 - break; 641 - } 642 - row = KEY_ROW(key_pos); 643 - col = KEY_COL(key_pos); 644 - scancode = MATRIX_SCAN_CODE(row, col, ckdev->row_shift); 645 - physmap[n_physmap++] = scancode; 646 - } 647 - ckdev->vdata.num_function_row_keys = n_physmap; 592 + cros_ec_keyb_parse_vivaldi_physmap(ckdev); 648 593 649 594 err = input_register_device(ckdev->idev); 650 595 if (err) { ··· 678 653 679 654 static int cros_ec_keyb_probe(struct platform_device *pdev) 680 655 { 681 - struct cros_ec_device *ec = dev_get_drvdata(pdev->dev.parent); 656 + struct cros_ec_device *ec; 682 657 struct device *dev = &pdev->dev; 683 658 struct cros_ec_keyb *ckdev; 684 659 bool buttons_switches_only = device_get_match_data(dev); 685 660 int err; 686 661 687 - if (!dev->of_node) 688 - return -ENODEV; 662 + /* 663 + * If the parent ec device has not been probed yet, defer the probe of 664 + * this keyboard/button driver until later. 665 + */ 666 + ec = dev_get_drvdata(pdev->dev.parent); 667 + if (!ec) 668 + return -EPROBE_DEFER; 689 669 690 670 ckdev = devm_kzalloc(dev, sizeof(*ckdev), GFP_KERNEL); 691 671 if (!ckdev) ··· 743 713 return 0; 744 714 } 745 715 716 + #ifdef CONFIG_ACPI 717 + static const struct acpi_device_id cros_ec_keyb_acpi_match[] = { 718 + { "GOOG0007", true }, 719 + { } 720 + }; 721 + MODULE_DEVICE_TABLE(acpi, cros_ec_keyb_acpi_match); 722 + #endif 723 + 746 724 #ifdef CONFIG_OF 747 725 static const struct of_device_id cros_ec_keyb_of_match[] = { 748 726 { .compatible = "google,cros-ec-keyb" }, ··· 768 730 .driver = { 769 731 .name = "cros-ec-keyb", 770 732 .of_match_table = of_match_ptr(cros_ec_keyb_of_match), 733 + .acpi_match_table = ACPI_PTR(cros_ec_keyb_acpi_match), 771 734 .pm = &cros_ec_keyb_pm_ops, 772 735 }, 773 736 };
+15 -3
drivers/input/keyboard/mt6779-keypad.c
··· 17 17 #define MTK_KPD_DEBOUNCE 0x0018 18 18 #define MTK_KPD_DEBOUNCE_MASK GENMASK(13, 0) 19 19 #define MTK_KPD_DEBOUNCE_MAX_MS 256 20 + #define MTK_KPD_SEL 0x0020 21 + #define MTK_KPD_SEL_COL GENMASK(15, 10) 22 + #define MTK_KPD_SEL_ROW GENMASK(9, 4) 23 + #define MTK_KPD_SEL_COLMASK(c) GENMASK((c) + 9, 10) 24 + #define MTK_KPD_SEL_ROWMASK(r) GENMASK((r) + 3, 4) 20 25 #define MTK_KPD_NUM_MEMS 5 21 26 #define MTK_KPD_NUM_BITS 136 /* 4*32+8 MEM5 only use 8 BITS */ 22 27 ··· 47 42 const unsigned short *keycode = keypad->input_dev->keycode; 48 43 DECLARE_BITMAP(new_state, MTK_KPD_NUM_BITS); 49 44 DECLARE_BITMAP(change, MTK_KPD_NUM_BITS); 50 - unsigned int bit_nr; 45 + unsigned int bit_nr, key; 51 46 unsigned int row, col; 52 47 unsigned int scancode; 53 48 unsigned int row_shift = get_count_order(keypad->n_cols); ··· 66 61 if (bit_nr % 32 >= 16) 67 62 continue; 68 63 69 - row = bit_nr / 32; 70 - col = bit_nr % 32; 64 + key = bit_nr / 32 * 16 + bit_nr % 32; 65 + row = key / 9; 66 + col = key % 9; 67 + 71 68 scancode = MATRIX_SCAN_CODE(row, col, row_shift); 72 69 /* 1: not pressed, 0: pressed */ 73 70 pressed = !test_bit(bit_nr, new_state); ··· 165 158 166 159 regmap_write(keypad->regmap, MTK_KPD_DEBOUNCE, 167 160 (debounce * (1 << 5)) & MTK_KPD_DEBOUNCE_MASK); 161 + 162 + regmap_update_bits(keypad->regmap, MTK_KPD_SEL, MTK_KPD_SEL_ROW, 163 + MTK_KPD_SEL_ROWMASK(keypad->n_rows)); 164 + regmap_update_bits(keypad->regmap, MTK_KPD_SEL, MTK_KPD_SEL_COL, 165 + MTK_KPD_SEL_COLMASK(keypad->n_cols)); 168 166 169 167 keypad->clk = devm_clk_get(&pdev->dev, "kpd"); 170 168 if (IS_ERR(keypad->clk))
+47 -51
drivers/input/keyboard/mtk-pmic-keys.c
··· 18 18 #include <linux/platform_device.h> 19 19 #include <linux/regmap.h> 20 20 21 - #define MTK_PMIC_PWRKEY_RST_EN_MASK 0x1 22 - #define MTK_PMIC_PWRKEY_RST_EN_SHIFT 6 23 - #define MTK_PMIC_HOMEKEY_RST_EN_MASK 0x1 24 - #define MTK_PMIC_HOMEKEY_RST_EN_SHIFT 5 25 - #define MTK_PMIC_RST_DU_MASK 0x3 26 - #define MTK_PMIC_RST_DU_SHIFT 8 27 - 28 - #define MTK_PMIC_PWRKEY_RST \ 29 - (MTK_PMIC_PWRKEY_RST_EN_MASK << MTK_PMIC_PWRKEY_RST_EN_SHIFT) 30 - #define MTK_PMIC_HOMEKEY_RST \ 31 - (MTK_PMIC_HOMEKEY_RST_EN_MASK << MTK_PMIC_HOMEKEY_RST_EN_SHIFT) 21 + #define MTK_PMIC_RST_DU_MASK GENMASK(9, 8) 22 + #define MTK_PMIC_PWRKEY_RST BIT(6) 23 + #define MTK_PMIC_HOMEKEY_RST BIT(5) 32 24 33 25 #define MTK_PMIC_PWRKEY_INDEX 0 34 26 #define MTK_PMIC_HOMEKEY_INDEX 1 ··· 31 39 u32 deb_mask; 32 40 u32 intsel_reg; 33 41 u32 intsel_mask; 42 + u32 rst_en_mask; 34 43 }; 35 44 36 45 #define MTK_PMIC_KEYS_REGS(_deb_reg, _deb_mask, \ 37 - _intsel_reg, _intsel_mask) \ 46 + _intsel_reg, _intsel_mask, _rst_mask) \ 38 47 { \ 39 48 .deb_reg = _deb_reg, \ 40 49 .deb_mask = _deb_mask, \ 41 50 .intsel_reg = _intsel_reg, \ 42 51 .intsel_mask = _intsel_mask, \ 52 + .rst_en_mask = _rst_mask, \ 43 53 } 44 54 45 55 struct mtk_pmic_regs { 46 56 const struct mtk_pmic_keys_regs keys_regs[MTK_PMIC_MAX_KEY_COUNT]; 47 57 u32 pmic_rst_reg; 58 + u32 rst_lprst_mask; /* Long-press reset timeout bitmask */ 48 59 }; 49 60 50 61 static const struct mtk_pmic_regs mt6397_regs = { 51 62 .keys_regs[MTK_PMIC_PWRKEY_INDEX] = 52 63 MTK_PMIC_KEYS_REGS(MT6397_CHRSTATUS, 53 - 0x8, MT6397_INT_RSV, 0x10), 64 + 0x8, MT6397_INT_RSV, 0x10, MTK_PMIC_PWRKEY_RST), 54 65 .keys_regs[MTK_PMIC_HOMEKEY_INDEX] = 55 66 MTK_PMIC_KEYS_REGS(MT6397_OCSTATUS2, 56 - 0x10, MT6397_INT_RSV, 0x8), 67 + 0x10, MT6397_INT_RSV, 0x8, MTK_PMIC_HOMEKEY_RST), 57 68 .pmic_rst_reg = MT6397_TOP_RST_MISC, 69 + .rst_lprst_mask = MTK_PMIC_RST_DU_MASK, 58 70 }; 59 71 60 72 static const struct mtk_pmic_regs mt6323_regs = { 61 73 .keys_regs[MTK_PMIC_PWRKEY_INDEX] = 62 74 MTK_PMIC_KEYS_REGS(MT6323_CHRSTATUS, 63 - 0x2, MT6323_INT_MISC_CON, 0x10), 75 + 0x2, MT6323_INT_MISC_CON, 0x10, MTK_PMIC_PWRKEY_RST), 64 76 .keys_regs[MTK_PMIC_HOMEKEY_INDEX] = 65 77 MTK_PMIC_KEYS_REGS(MT6323_CHRSTATUS, 66 - 0x4, MT6323_INT_MISC_CON, 0x8), 78 + 0x4, MT6323_INT_MISC_CON, 0x8, MTK_PMIC_HOMEKEY_RST), 67 79 .pmic_rst_reg = MT6323_TOP_RST_MISC, 80 + .rst_lprst_mask = MTK_PMIC_RST_DU_MASK, 68 81 }; 69 82 70 83 static const struct mtk_pmic_regs mt6358_regs = { 71 84 .keys_regs[MTK_PMIC_PWRKEY_INDEX] = 72 85 MTK_PMIC_KEYS_REGS(MT6358_TOPSTATUS, 73 - 0x2, MT6358_PSC_TOP_INT_CON0, 0x5), 86 + 0x2, MT6358_PSC_TOP_INT_CON0, 0x5, 87 + MTK_PMIC_PWRKEY_RST), 74 88 .keys_regs[MTK_PMIC_HOMEKEY_INDEX] = 75 89 MTK_PMIC_KEYS_REGS(MT6358_TOPSTATUS, 76 - 0x8, MT6358_PSC_TOP_INT_CON0, 0xa), 90 + 0x8, MT6358_PSC_TOP_INT_CON0, 0xa, 91 + MTK_PMIC_HOMEKEY_RST), 77 92 .pmic_rst_reg = MT6358_TOP_RST_MISC, 93 + .rst_lprst_mask = MTK_PMIC_RST_DU_MASK, 78 94 }; 79 95 80 96 struct mtk_pmic_keys_info { ··· 108 108 }; 109 109 110 110 static void mtk_pmic_keys_lp_reset_setup(struct mtk_pmic_keys *keys, 111 - u32 pmic_rst_reg) 111 + const struct mtk_pmic_regs *regs) 112 112 { 113 - int ret; 113 + const struct mtk_pmic_keys_regs *kregs_home, *kregs_pwr; 114 114 u32 long_press_mode, long_press_debounce; 115 + u32 value, mask; 116 + int error; 115 117 116 - ret = of_property_read_u32(keys->dev->of_node, 117 - "power-off-time-sec", &long_press_debounce); 118 - if (ret) 118 + kregs_home = keys->keys[MTK_PMIC_HOMEKEY_INDEX].regs; 119 + kregs_pwr = keys->keys[MTK_PMIC_PWRKEY_INDEX].regs; 120 + 121 + error = of_property_read_u32(keys->dev->of_node, "power-off-time-sec", 122 + &long_press_debounce); 123 + if (error) 119 124 long_press_debounce = 0; 120 125 121 - regmap_update_bits(keys->regmap, pmic_rst_reg, 122 - MTK_PMIC_RST_DU_MASK << MTK_PMIC_RST_DU_SHIFT, 123 - long_press_debounce << MTK_PMIC_RST_DU_SHIFT); 126 + mask = regs->rst_lprst_mask; 127 + value = long_press_debounce << (ffs(regs->rst_lprst_mask) - 1); 124 128 125 - ret = of_property_read_u32(keys->dev->of_node, 126 - "mediatek,long-press-mode", &long_press_mode); 127 - if (ret) 129 + error = of_property_read_u32(keys->dev->of_node, 130 + "mediatek,long-press-mode", 131 + &long_press_mode); 132 + if (error) 128 133 long_press_mode = LP_DISABLE; 129 134 130 135 switch (long_press_mode) { 131 - case LP_ONEKEY: 132 - regmap_update_bits(keys->regmap, pmic_rst_reg, 133 - MTK_PMIC_PWRKEY_RST, 134 - MTK_PMIC_PWRKEY_RST); 135 - regmap_update_bits(keys->regmap, pmic_rst_reg, 136 - MTK_PMIC_HOMEKEY_RST, 137 - 0); 138 - break; 139 136 case LP_TWOKEY: 140 - regmap_update_bits(keys->regmap, pmic_rst_reg, 141 - MTK_PMIC_PWRKEY_RST, 142 - MTK_PMIC_PWRKEY_RST); 143 - regmap_update_bits(keys->regmap, pmic_rst_reg, 144 - MTK_PMIC_HOMEKEY_RST, 145 - MTK_PMIC_HOMEKEY_RST); 146 - break; 137 + value |= kregs_home->rst_en_mask; 138 + fallthrough; 139 + 140 + case LP_ONEKEY: 141 + value |= kregs_pwr->rst_en_mask; 142 + fallthrough; 143 + 147 144 case LP_DISABLE: 148 - regmap_update_bits(keys->regmap, pmic_rst_reg, 149 - MTK_PMIC_PWRKEY_RST, 150 - 0); 151 - regmap_update_bits(keys->regmap, pmic_rst_reg, 152 - MTK_PMIC_HOMEKEY_RST, 153 - 0); 145 + mask |= kregs_home->rst_en_mask; 146 + mask |= kregs_pwr->rst_en_mask; 154 147 break; 148 + 155 149 default: 156 150 break; 157 151 } 152 + 153 + regmap_update_bits(keys->regmap, regs->pmic_rst_reg, mask, value); 158 154 } 159 155 160 156 static irqreturn_t mtk_pmic_keys_irq_handler_thread(int irq, void *data) ··· 354 358 return error; 355 359 } 356 360 357 - mtk_pmic_keys_lp_reset_setup(keys, mtk_pmic_regs->pmic_rst_reg); 361 + mtk_pmic_keys_lp_reset_setup(keys, mtk_pmic_regs); 358 362 359 363 platform_set_drvdata(pdev, keys); 360 364
+11 -15
drivers/input/keyboard/omap4-keypad.c
··· 179 179 int error; 180 180 u64 keys; 181 181 182 - error = pm_runtime_get_sync(dev); 183 - if (error < 0) { 184 - pm_runtime_put_noidle(dev); 182 + error = pm_runtime_resume_and_get(dev); 183 + if (error) 185 184 return IRQ_NONE; 186 - } 187 185 188 186 low = kbd_readl(keypad_data, OMAP4_KBD_FULLCODE31_0); 189 187 high = kbd_readl(keypad_data, OMAP4_KBD_FULLCODE63_32); ··· 205 207 struct device *dev = input->dev.parent; 206 208 int error; 207 209 208 - error = pm_runtime_get_sync(dev); 209 - if (error < 0) { 210 - pm_runtime_put_noidle(dev); 210 + error = pm_runtime_resume_and_get(dev); 211 + if (error) 211 212 return error; 212 - } 213 213 214 214 disable_irq(keypad_data->irq); 215 215 ··· 250 254 struct device *dev = input->dev.parent; 251 255 int error; 252 256 253 - error = pm_runtime_get_sync(dev); 254 - if (error < 0) 255 - pm_runtime_put_noidle(dev); 257 + error = pm_runtime_resume_and_get(dev); 258 + if (error) 259 + dev_err(dev, "%s: pm_runtime_resume_and_get() failed: %d\n", 260 + __func__, error); 256 261 257 262 disable_irq(keypad_data->irq); 258 263 omap4_keypad_stop(keypad_data); ··· 389 392 * Enable clocks for the keypad module so that we can read 390 393 * revision register. 391 394 */ 392 - error = pm_runtime_get_sync(dev); 393 - if (error < 0) { 394 - dev_err(dev, "pm_runtime_get_sync() failed\n"); 395 - pm_runtime_put_noidle(dev); 395 + error = pm_runtime_resume_and_get(dev); 396 + if (error) { 397 + dev_err(dev, "pm_runtime_resume_and_get() failed\n"); 396 398 return error; 397 399 } 398 400
+116 -62
drivers/input/misc/iqs7222.c
··· 40 40 #define IQS7222_SLDR_SETUP_2_RES_MASK GENMASK(15, 8) 41 41 #define IQS7222_SLDR_SETUP_2_RES_SHIFT 8 42 42 #define IQS7222_SLDR_SETUP_2_TOP_SPEED_MASK GENMASK(7, 0) 43 - #define IQS7222_SLDR_SETUP_3_CHAN_SEL_MASK GENMASK(9, 0) 44 43 45 44 #define IQS7222_GPIO_SETUP_0_GPIO_EN BIT(0) 46 45 ··· 53 54 #define IQS7222_SYS_SETUP_ACK_RESET BIT(0) 54 55 55 56 #define IQS7222_EVENT_MASK_ATI BIT(12) 57 + #define IQS7222_EVENT_MASK_SLDR BIT(10) 58 + #define IQS7222_EVENT_MASK_TOUCH BIT(1) 59 + #define IQS7222_EVENT_MASK_PROX BIT(0) 56 60 57 61 #define IQS7222_COMMS_HOLD BIT(0) 58 62 #define IQS7222_COMMS_ERROR 0xEEEE ··· 94 92 95 93 enum iqs7222_reg_grp_id { 96 94 IQS7222_REG_GRP_STAT, 95 + IQS7222_REG_GRP_FILT, 97 96 IQS7222_REG_GRP_CYCLE, 98 97 IQS7222_REG_GRP_GLBL, 99 98 IQS7222_REG_GRP_BTN, 100 99 IQS7222_REG_GRP_CHAN, 101 - IQS7222_REG_GRP_FILT, 102 100 IQS7222_REG_GRP_SLDR, 103 101 IQS7222_REG_GRP_GPIO, 104 102 IQS7222_REG_GRP_SYS, ··· 137 135 static const struct iqs7222_event_desc iqs7222_kp_events[] = { 138 136 { 139 137 .name = "event-prox", 140 - .enable = BIT(0), 138 + .enable = IQS7222_EVENT_MASK_PROX, 141 139 .reg_key = IQS7222_REG_KEY_PROX, 142 140 }, 143 141 { 144 142 .name = "event-touch", 145 - .enable = BIT(1), 143 + .enable = IQS7222_EVENT_MASK_TOUCH, 146 144 .reg_key = IQS7222_REG_KEY_TOUCH, 147 145 }, 148 146 }; ··· 556 554 .reg_shift = 0, 557 555 .reg_width = 4, 558 556 .label = "current reference trim", 559 - }, 560 - { 561 - .name = "azoteq,rf-filt-enable", 562 - .reg_grp = IQS7222_REG_GRP_GLBL, 563 - .reg_offset = 0, 564 - .reg_shift = 15, 565 - .reg_width = 1, 566 557 }, 567 558 { 568 559 .name = "azoteq,max-counts", ··· 1267 1272 struct i2c_client *client = iqs7222->client; 1268 1273 ktime_t ati_timeout; 1269 1274 u16 sys_status = 0; 1270 - u16 sys_setup = iqs7222->sys_setup[0] & ~IQS7222_SYS_SETUP_ACK_RESET; 1275 + u16 sys_setup; 1271 1276 int error, i; 1277 + 1278 + /* 1279 + * The reserved fields of the system setup register may have changed 1280 + * as a result of other registers having been written. As such, read 1281 + * the register's latest value to avoid unexpected behavior when the 1282 + * register is written in the loop that follows. 1283 + */ 1284 + error = iqs7222_read_word(iqs7222, IQS7222_SYS_SETUP, &sys_setup); 1285 + if (error) 1286 + return error; 1287 + 1288 + sys_setup &= ~IQS7222_SYS_SETUP_INTF_MODE_MASK; 1289 + sys_setup &= ~IQS7222_SYS_SETUP_PWR_MODE_MASK; 1272 1290 1273 1291 for (i = 0; i < IQS7222_NUM_RETRIES; i++) { 1274 1292 /* ··· 1307 1299 if (error) 1308 1300 return error; 1309 1301 1310 - if (sys_status & IQS7222_SYS_STATUS_ATI_ACTIVE) 1311 - continue; 1302 + if (sys_status & IQS7222_SYS_STATUS_RESET) 1303 + return 0; 1312 1304 1313 1305 if (sys_status & IQS7222_SYS_STATUS_ATI_ERROR) 1314 1306 break; 1307 + 1308 + if (sys_status & IQS7222_SYS_STATUS_ATI_ACTIVE) 1309 + continue; 1315 1310 1316 1311 /* 1317 1312 * Use stream-in-touch mode if either slider reports ··· 1332 1321 dev_err(&client->dev, 1333 1322 "ATI attempt %d of %d failed with status 0x%02X, %s\n", 1334 1323 i + 1, IQS7222_NUM_RETRIES, (u8)sys_status, 1335 - i < IQS7222_NUM_RETRIES ? "retrying..." : "stopping"); 1324 + i + 1 < IQS7222_NUM_RETRIES ? "retrying" : "stopping"); 1336 1325 } 1337 1326 1338 1327 return -ETIMEDOUT; ··· 1343 1332 const struct iqs7222_dev_desc *dev_desc = iqs7222->dev_desc; 1344 1333 int comms_offset = dev_desc->comms_offset; 1345 1334 int error, i, j, k; 1335 + 1336 + /* 1337 + * Acknowledge reset before writing any registers in case the device 1338 + * suffers a spurious reset during initialization. Because this step 1339 + * may change the reserved fields of the second filter beta register, 1340 + * its cache must be updated. 1341 + * 1342 + * Writing the second filter beta register, in turn, may clobber the 1343 + * system status register. As such, the filter beta register pair is 1344 + * written first to protect against this hazard. 1345 + */ 1346 + if (dir == WRITE) { 1347 + u16 reg = dev_desc->reg_grps[IQS7222_REG_GRP_FILT].base + 1; 1348 + u16 filt_setup; 1349 + 1350 + error = iqs7222_write_word(iqs7222, IQS7222_SYS_SETUP, 1351 + iqs7222->sys_setup[0] | 1352 + IQS7222_SYS_SETUP_ACK_RESET); 1353 + if (error) 1354 + return error; 1355 + 1356 + error = iqs7222_read_word(iqs7222, reg, &filt_setup); 1357 + if (error) 1358 + return error; 1359 + 1360 + iqs7222->filt_setup[1] &= GENMASK(7, 0); 1361 + iqs7222->filt_setup[1] |= (filt_setup & ~GENMASK(7, 0)); 1362 + } 1346 1363 1347 1364 /* 1348 1365 * Take advantage of the stop-bit disable function, if available, to ··· 1996 1957 int num_chan = dev_desc->reg_grps[IQS7222_REG_GRP_CHAN].num_row; 1997 1958 int ext_chan = rounddown(num_chan, 10); 1998 1959 int count, error, reg_offset, i; 1960 + u16 *event_mask = &iqs7222->sys_setup[dev_desc->event_offset]; 1999 1961 u16 *sldr_setup = iqs7222->sldr_setup[sldr_index]; 2000 - u16 *sys_setup = iqs7222->sys_setup; 2001 1962 unsigned int chan_sel[4], val; 2002 1963 2003 1964 error = iqs7222_parse_props(iqs7222, &sldr_node, sldr_index, ··· 2042 2003 reg_offset = dev_desc->sldr_res < U16_MAX ? 0 : 1; 2043 2004 2044 2005 sldr_setup[0] |= count; 2045 - sldr_setup[3 + reg_offset] &= ~IQS7222_SLDR_SETUP_3_CHAN_SEL_MASK; 2006 + sldr_setup[3 + reg_offset] &= ~GENMASK(ext_chan - 1, 0); 2046 2007 2047 2008 for (i = 0; i < ARRAY_SIZE(chan_sel); i++) { 2048 2009 sldr_setup[5 + reg_offset + i] = 0; ··· 2120 2081 sldr_setup[0] |= dev_desc->wheel_enable; 2121 2082 } 2122 2083 2084 + /* 2085 + * The absence of a register offset makes it safe to assume the device 2086 + * supports gestures, each of which is first disabled until explicitly 2087 + * enabled. 2088 + */ 2089 + if (!reg_offset) 2090 + for (i = 0; i < ARRAY_SIZE(iqs7222_sl_events); i++) 2091 + sldr_setup[9] &= ~iqs7222_sl_events[i].enable; 2092 + 2123 2093 for (i = 0; i < ARRAY_SIZE(iqs7222_sl_events); i++) { 2124 2094 const char *event_name = iqs7222_sl_events[i].name; 2125 2095 struct fwnode_handle *event_node; 2126 - 2127 - /* 2128 - * The absence of a register offset means the remaining fields 2129 - * in the group represent gesture settings. 2130 - */ 2131 - if (iqs7222_sl_events[i].enable && !reg_offset) 2132 - sldr_setup[9] &= ~iqs7222_sl_events[i].enable; 2133 2096 2134 2097 event_node = fwnode_get_named_child_node(sldr_node, event_name); 2135 2098 if (!event_node) ··· 2145 2104 if (error) 2146 2105 return error; 2147 2106 2107 + /* 2108 + * The press/release event does not expose a direct GPIO link, 2109 + * but one can be emulated by tying each of the participating 2110 + * channels to the same GPIO. 2111 + */ 2112 + error = iqs7222_gpio_select(iqs7222, event_node, 2113 + i ? iqs7222_sl_events[i].enable 2114 + : sldr_setup[3 + reg_offset], 2115 + i ? 1568 + sldr_index * 30 2116 + : sldr_setup[4 + reg_offset]); 2117 + if (error) 2118 + return error; 2119 + 2120 + if (!reg_offset) 2121 + sldr_setup[9] |= iqs7222_sl_events[i].enable; 2122 + 2148 2123 error = fwnode_property_read_u32(event_node, "linux,code", 2149 2124 &val); 2150 2125 if (error) { ··· 2172 2115 iqs7222->sl_code[sldr_index][i] = val; 2173 2116 input_set_capability(iqs7222->keypad, EV_KEY, val); 2174 2117 2175 - /* 2176 - * The press/release event is determined based on whether the 2177 - * coordinate field reports 0xFFFF and has no explicit enable 2178 - * control. 2179 - */ 2180 - if (!iqs7222_sl_events[i].enable || reg_offset) 2181 - continue; 2182 - 2183 - sldr_setup[9] |= iqs7222_sl_events[i].enable; 2184 - 2185 - error = iqs7222_gpio_select(iqs7222, event_node, 2186 - iqs7222_sl_events[i].enable, 2187 - 1568 + sldr_index * 30); 2188 - if (error) 2189 - return error; 2190 - 2191 2118 if (!dev_desc->event_offset) 2192 2119 continue; 2193 2120 2194 - sys_setup[dev_desc->event_offset] |= BIT(10 + sldr_index); 2121 + /* 2122 + * The press/release event is determined based on whether the 2123 + * coordinate field reports 0xFFFF and solely relies on touch 2124 + * or proximity interrupts to be unmasked. 2125 + */ 2126 + if (i && !reg_offset) 2127 + *event_mask |= (IQS7222_EVENT_MASK_SLDR << sldr_index); 2128 + else if (sldr_setup[4 + reg_offset] == dev_desc->touch_link) 2129 + *event_mask |= IQS7222_EVENT_MASK_TOUCH; 2130 + else 2131 + *event_mask |= IQS7222_EVENT_MASK_PROX; 2195 2132 } 2196 2133 2197 2134 /* ··· 2278 2227 return error; 2279 2228 } 2280 2229 2281 - sys_setup[0] &= ~IQS7222_SYS_SETUP_INTF_MODE_MASK; 2282 - sys_setup[0] &= ~IQS7222_SYS_SETUP_PWR_MODE_MASK; 2283 - 2284 - sys_setup[0] |= IQS7222_SYS_SETUP_ACK_RESET; 2285 - 2286 2230 return iqs7222_parse_props(iqs7222, NULL, 0, IQS7222_REG_GRP_SYS, 2287 2231 IQS7222_REG_KEY_NONE); 2288 2232 } ··· 2345 2299 input_report_abs(iqs7222->keypad, iqs7222->sl_axis[i], 2346 2300 sldr_pos); 2347 2301 2348 - for (j = 0; j < ARRAY_SIZE(iqs7222_sl_events); j++) { 2302 + input_report_key(iqs7222->keypad, iqs7222->sl_code[i][0], 2303 + sldr_pos < dev_desc->sldr_res); 2304 + 2305 + /* 2306 + * A maximum resolution indicates the device does not support 2307 + * gestures, in which case the remaining fields are ignored. 2308 + */ 2309 + if (dev_desc->sldr_res == U16_MAX) 2310 + continue; 2311 + 2312 + if (!(le16_to_cpu(status[1]) & IQS7222_EVENT_MASK_SLDR << i)) 2313 + continue; 2314 + 2315 + /* 2316 + * Skip the press/release event, as it does not have separate 2317 + * status fields and is handled separately. 2318 + */ 2319 + for (j = 1; j < ARRAY_SIZE(iqs7222_sl_events); j++) { 2349 2320 u16 mask = iqs7222_sl_events[j].mask; 2350 2321 u16 val = iqs7222_sl_events[j].val; 2351 - 2352 - if (!iqs7222_sl_events[j].enable) { 2353 - input_report_key(iqs7222->keypad, 2354 - iqs7222->sl_code[i][j], 2355 - sldr_pos < dev_desc->sldr_res); 2356 - continue; 2357 - } 2358 - 2359 - /* 2360 - * The remaining offsets represent gesture state, and 2361 - * are discarded in the case of IQS7222C because only 2362 - * absolute position is reported. 2363 - */ 2364 - if (num_stat < IQS7222_MAX_COLS_STAT) 2365 - continue; 2366 2322 2367 2323 input_report_key(iqs7222->keypad, 2368 2324 iqs7222->sl_code[i][j], 2369 2325 (state & mask) == val); 2370 2326 } 2327 + 2328 + input_sync(iqs7222->keypad); 2329 + 2330 + for (j = 1; j < ARRAY_SIZE(iqs7222_sl_events); j++) 2331 + input_report_key(iqs7222->keypad, 2332 + iqs7222->sl_code[i][j], 0); 2371 2333 } 2372 2334 2373 2335 input_sync(iqs7222->keypad);
+1 -1
drivers/input/mouse/cyapa_gen6.c
··· 57 57 * The value of data_status can be the first byte of data or 58 58 * the command status or the unsupported command code depending on the 59 59 * requested command code. 60 - */ 60 + */ 61 61 u8 data_status; 62 62 } __packed; 63 63
+1 -1
drivers/input/mouse/gpio_mouse.c
··· 41 41 42 42 /* 43 43 * Timer function which is run every scan_ms ms when the device is opened. 44 - * The dev input variable is set to the the input_dev pointer. 44 + * The dev input variable is set to the input_dev pointer. 45 45 */ 46 46 static void gpio_mouse_scan(struct input_dev *input) 47 47 {
+1135 -823
drivers/input/serio/i8042-x86ia64io.h
··· 67 67 68 68 #include <linux/dmi.h> 69 69 70 - static const struct dmi_system_id __initconst i8042_dmi_noloop_table[] = { 70 + #define SERIO_QUIRK_NOKBD BIT(0) 71 + #define SERIO_QUIRK_NOAUX BIT(1) 72 + #define SERIO_QUIRK_NOMUX BIT(2) 73 + #define SERIO_QUIRK_FORCEMUX BIT(3) 74 + #define SERIO_QUIRK_UNLOCK BIT(4) 75 + #define SERIO_QUIRK_PROBE_DEFER BIT(5) 76 + #define SERIO_QUIRK_RESET_ALWAYS BIT(6) 77 + #define SERIO_QUIRK_RESET_NEVER BIT(7) 78 + #define SERIO_QUIRK_DIECT BIT(8) 79 + #define SERIO_QUIRK_DUMBKBD BIT(9) 80 + #define SERIO_QUIRK_NOLOOP BIT(10) 81 + #define SERIO_QUIRK_NOTIMEOUT BIT(11) 82 + #define SERIO_QUIRK_KBDRESET BIT(12) 83 + #define SERIO_QUIRK_DRITEK BIT(13) 84 + #define SERIO_QUIRK_NOPNP BIT(14) 85 + 86 + /* Quirk table for different mainboards. Options similar or identical to i8042 87 + * module parameters. 88 + * ORDERING IS IMPORTANT! The first match will be apllied and the rest ignored. 89 + * This allows entries to overwrite vendor wide quirks on a per device basis. 90 + * Where this is irrelevant, entries are sorted case sensitive by DMI_SYS_VENDOR 91 + * and/or DMI_BOARD_VENDOR to make it easier to avoid dublicate entries. 92 + */ 93 + static const struct dmi_system_id i8042_dmi_quirk_table[] __initconst = { 71 94 { 72 - /* 73 - * Arima-Rioworks HDAMB - 74 - * AUX LOOP command does not raise AUX IRQ 75 - */ 76 95 .matches = { 77 - DMI_MATCH(DMI_BOARD_VENDOR, "RIOWORKS"), 78 - DMI_MATCH(DMI_BOARD_NAME, "HDAMB"), 79 - DMI_MATCH(DMI_BOARD_VERSION, "Rev E"), 96 + DMI_MATCH(DMI_SYS_VENDOR, "ALIENWARE"), 97 + DMI_MATCH(DMI_PRODUCT_NAME, "Sentia"), 80 98 }, 99 + .driver_data = (void *)(SERIO_QUIRK_NOMUX) 81 100 }, 82 101 { 83 - /* ASUS G1S */ 84 102 .matches = { 85 - DMI_MATCH(DMI_BOARD_VENDOR, "ASUSTeK Computer Inc."), 86 - DMI_MATCH(DMI_BOARD_NAME, "G1S"), 87 - DMI_MATCH(DMI_BOARD_VERSION, "1.0"), 103 + DMI_MATCH(DMI_SYS_VENDOR, "ASUSTeK COMPUTER INC."), 104 + DMI_MATCH(DMI_PRODUCT_NAME, "X750LN"), 88 105 }, 106 + .driver_data = (void *)(SERIO_QUIRK_NOLOOP) 107 + }, 108 + { 109 + /* Asus X450LCP */ 110 + .matches = { 111 + DMI_MATCH(DMI_SYS_VENDOR, "ASUSTeK COMPUTER INC."), 112 + DMI_MATCH(DMI_PRODUCT_NAME, "X450LCP"), 113 + }, 114 + .driver_data = (void *)(SERIO_QUIRK_NOMUX | SERIO_QUIRK_RESET_NEVER) 115 + }, 116 + { 117 + /* ASUS ZenBook UX425UA */ 118 + .matches = { 119 + DMI_MATCH(DMI_SYS_VENDOR, "ASUSTeK COMPUTER INC."), 120 + DMI_MATCH(DMI_PRODUCT_NAME, "ZenBook UX425UA"), 121 + }, 122 + .driver_data = (void *)(SERIO_QUIRK_PROBE_DEFER | SERIO_QUIRK_RESET_NEVER) 123 + }, 124 + { 125 + /* ASUS ZenBook UM325UA */ 126 + .matches = { 127 + DMI_MATCH(DMI_SYS_VENDOR, "ASUSTeK COMPUTER INC."), 128 + DMI_MATCH(DMI_PRODUCT_NAME, "ZenBook UX325UA_UM325UA"), 129 + }, 130 + .driver_data = (void *)(SERIO_QUIRK_PROBE_DEFER | SERIO_QUIRK_RESET_NEVER) 131 + }, 132 + /* 133 + * On some Asus laptops, just running self tests cause problems. 134 + */ 135 + { 136 + .matches = { 137 + DMI_MATCH(DMI_SYS_VENDOR, "ASUSTeK COMPUTER INC."), 138 + DMI_MATCH(DMI_CHASSIS_TYPE, "10"), /* Notebook */ 139 + }, 140 + .driver_data = (void *)(SERIO_QUIRK_RESET_NEVER) 141 + }, 142 + { 143 + .matches = { 144 + DMI_MATCH(DMI_SYS_VENDOR, "ASUSTeK COMPUTER INC."), 145 + DMI_MATCH(DMI_CHASSIS_TYPE, "31"), /* Convertible Notebook */ 146 + }, 147 + .driver_data = (void *)(SERIO_QUIRK_RESET_NEVER) 89 148 }, 90 149 { 91 150 /* ASUS P65UP5 - AUX LOOP command does not raise AUX IRQ */ ··· 153 94 DMI_MATCH(DMI_BOARD_NAME, "P/I-P65UP5"), 154 95 DMI_MATCH(DMI_BOARD_VERSION, "REV 2.X"), 155 96 }, 97 + .driver_data = (void *)(SERIO_QUIRK_NOLOOP) 156 98 }, 157 99 { 100 + /* ASUS G1S */ 158 101 .matches = { 159 - DMI_MATCH(DMI_SYS_VENDOR, "ASUSTeK COMPUTER INC."), 160 - DMI_MATCH(DMI_PRODUCT_NAME, "X750LN"), 102 + DMI_MATCH(DMI_BOARD_VENDOR, "ASUSTeK Computer Inc."), 103 + DMI_MATCH(DMI_BOARD_NAME, "G1S"), 104 + DMI_MATCH(DMI_BOARD_VERSION, "1.0"), 161 105 }, 162 - }, 163 - { 164 - .matches = { 165 - DMI_MATCH(DMI_SYS_VENDOR, "Compaq"), 166 - DMI_MATCH(DMI_PRODUCT_NAME , "ProLiant"), 167 - DMI_MATCH(DMI_PRODUCT_VERSION, "8500"), 168 - }, 169 - }, 170 - { 171 - .matches = { 172 - DMI_MATCH(DMI_SYS_VENDOR, "Compaq"), 173 - DMI_MATCH(DMI_PRODUCT_NAME , "ProLiant"), 174 - DMI_MATCH(DMI_PRODUCT_VERSION, "DL760"), 175 - }, 176 - }, 177 - { 178 - /* Dell Embedded Box PC 3000 */ 179 - .matches = { 180 - DMI_MATCH(DMI_SYS_VENDOR, "Dell Inc."), 181 - DMI_MATCH(DMI_PRODUCT_NAME, "Embedded Box PC 3000"), 182 - }, 183 - }, 184 - { 185 - /* OQO Model 01 */ 186 - .matches = { 187 - DMI_MATCH(DMI_SYS_VENDOR, "OQO"), 188 - DMI_MATCH(DMI_PRODUCT_NAME, "ZEPTO"), 189 - DMI_MATCH(DMI_PRODUCT_VERSION, "00"), 190 - }, 191 - }, 192 - { 193 - /* ULI EV4873 - AUX LOOP does not work properly */ 194 - .matches = { 195 - DMI_MATCH(DMI_SYS_VENDOR, "ULI"), 196 - DMI_MATCH(DMI_PRODUCT_NAME, "EV4873"), 197 - DMI_MATCH(DMI_PRODUCT_VERSION, "5a"), 198 - }, 199 - }, 200 - { 201 - /* Microsoft Virtual Machine */ 202 - .matches = { 203 - DMI_MATCH(DMI_SYS_VENDOR, "Microsoft Corporation"), 204 - DMI_MATCH(DMI_PRODUCT_NAME, "Virtual Machine"), 205 - DMI_MATCH(DMI_PRODUCT_VERSION, "VS2005R2"), 206 - }, 207 - }, 208 - { 209 - /* Medion MAM 2070 */ 210 - .matches = { 211 - DMI_MATCH(DMI_SYS_VENDOR, "Notebook"), 212 - DMI_MATCH(DMI_PRODUCT_NAME, "MAM 2070"), 213 - DMI_MATCH(DMI_PRODUCT_VERSION, "5a"), 214 - }, 215 - }, 216 - { 217 - /* Medion Akoya E7225 */ 218 - .matches = { 219 - DMI_MATCH(DMI_SYS_VENDOR, "Medion"), 220 - DMI_MATCH(DMI_PRODUCT_NAME, "Akoya E7225"), 221 - DMI_MATCH(DMI_PRODUCT_VERSION, "1.0"), 222 - }, 223 - }, 224 - { 225 - /* Blue FB5601 */ 226 - .matches = { 227 - DMI_MATCH(DMI_SYS_VENDOR, "blue"), 228 - DMI_MATCH(DMI_PRODUCT_NAME, "FB5601"), 229 - DMI_MATCH(DMI_PRODUCT_VERSION, "M606"), 230 - }, 231 - }, 232 - { 233 - /* Gigabyte M912 */ 234 - .matches = { 235 - DMI_MATCH(DMI_SYS_VENDOR, "GIGABYTE"), 236 - DMI_MATCH(DMI_PRODUCT_NAME, "M912"), 237 - DMI_MATCH(DMI_PRODUCT_VERSION, "01"), 238 - }, 239 - }, 240 - { 241 - /* Gigabyte M1022M netbook */ 242 - .matches = { 243 - DMI_MATCH(DMI_BOARD_VENDOR, "Gigabyte Technology Co.,Ltd."), 244 - DMI_MATCH(DMI_BOARD_NAME, "M1022E"), 245 - DMI_MATCH(DMI_BOARD_VERSION, "1.02"), 246 - }, 247 - }, 248 - { 249 - /* Gigabyte Spring Peak - defines wrong chassis type */ 250 - .matches = { 251 - DMI_MATCH(DMI_SYS_VENDOR, "GIGABYTE"), 252 - DMI_MATCH(DMI_PRODUCT_NAME, "Spring Peak"), 253 - }, 254 - }, 255 - { 256 - /* Gigabyte T1005 - defines wrong chassis type ("Other") */ 257 - .matches = { 258 - DMI_MATCH(DMI_SYS_VENDOR, "GIGABYTE"), 259 - DMI_MATCH(DMI_PRODUCT_NAME, "T1005"), 260 - }, 261 - }, 262 - { 263 - /* Gigabyte T1005M/P - defines wrong chassis type ("Other") */ 264 - .matches = { 265 - DMI_MATCH(DMI_SYS_VENDOR, "GIGABYTE"), 266 - DMI_MATCH(DMI_PRODUCT_NAME, "T1005M/P"), 267 - }, 268 - }, 269 - { 270 - .matches = { 271 - DMI_MATCH(DMI_SYS_VENDOR, "Hewlett-Packard"), 272 - DMI_MATCH(DMI_PRODUCT_NAME, "HP Pavilion dv9700"), 273 - DMI_MATCH(DMI_PRODUCT_VERSION, "Rev 1"), 274 - }, 275 - }, 276 - { 277 - .matches = { 278 - DMI_MATCH(DMI_SYS_VENDOR, "PEGATRON CORPORATION"), 279 - DMI_MATCH(DMI_PRODUCT_NAME, "C15B"), 280 - }, 281 - }, 282 - { 283 - .matches = { 284 - DMI_MATCH(DMI_SYS_VENDOR, "ByteSpeed LLC"), 285 - DMI_MATCH(DMI_PRODUCT_NAME, "ByteSpeed Laptop C15B"), 286 - }, 287 - }, 288 - { } 289 - }; 290 - 291 - /* 292 - * Some Fujitsu notebooks are having trouble with touchpads if 293 - * active multiplexing mode is activated. Luckily they don't have 294 - * external PS/2 ports so we can safely disable it. 295 - * ... apparently some Toshibas don't like MUX mode either and 296 - * die horrible death on reboot. 297 - */ 298 - static const struct dmi_system_id __initconst i8042_dmi_nomux_table[] = { 299 - { 300 - /* Fujitsu Lifebook P7010/P7010D */ 301 - .matches = { 302 - DMI_MATCH(DMI_SYS_VENDOR, "FUJITSU"), 303 - DMI_MATCH(DMI_PRODUCT_NAME, "P7010"), 304 - }, 305 - }, 306 - { 307 - /* Fujitsu Lifebook P7010 */ 308 - .matches = { 309 - DMI_MATCH(DMI_SYS_VENDOR, "FUJITSU SIEMENS"), 310 - DMI_MATCH(DMI_PRODUCT_NAME, "0000000000"), 311 - }, 312 - }, 313 - { 314 - /* Fujitsu Lifebook P5020D */ 315 - .matches = { 316 - DMI_MATCH(DMI_SYS_VENDOR, "FUJITSU"), 317 - DMI_MATCH(DMI_PRODUCT_NAME, "LifeBook P Series"), 318 - }, 319 - }, 320 - { 321 - /* Fujitsu Lifebook S2000 */ 322 - .matches = { 323 - DMI_MATCH(DMI_SYS_VENDOR, "FUJITSU"), 324 - DMI_MATCH(DMI_PRODUCT_NAME, "LifeBook S Series"), 325 - }, 326 - }, 327 - { 328 - /* Fujitsu Lifebook S6230 */ 329 - .matches = { 330 - DMI_MATCH(DMI_SYS_VENDOR, "FUJITSU"), 331 - DMI_MATCH(DMI_PRODUCT_NAME, "LifeBook S6230"), 332 - }, 333 - }, 334 - { 335 - /* Fujitsu Lifebook T725 laptop */ 336 - .matches = { 337 - DMI_MATCH(DMI_SYS_VENDOR, "FUJITSU"), 338 - DMI_MATCH(DMI_PRODUCT_NAME, "LIFEBOOK T725"), 339 - }, 340 - }, 341 - { 342 - /* Fujitsu Lifebook U745 */ 343 - .matches = { 344 - DMI_MATCH(DMI_SYS_VENDOR, "FUJITSU"), 345 - DMI_MATCH(DMI_PRODUCT_NAME, "LIFEBOOK U745"), 346 - }, 347 - }, 348 - { 349 - /* Fujitsu T70H */ 350 - .matches = { 351 - DMI_MATCH(DMI_SYS_VENDOR, "FUJITSU"), 352 - DMI_MATCH(DMI_PRODUCT_NAME, "FMVLT70H"), 353 - }, 354 - }, 355 - { 356 - /* Fujitsu-Siemens Lifebook T3010 */ 357 - .matches = { 358 - DMI_MATCH(DMI_SYS_VENDOR, "FUJITSU SIEMENS"), 359 - DMI_MATCH(DMI_PRODUCT_NAME, "LIFEBOOK T3010"), 360 - }, 361 - }, 362 - { 363 - /* Fujitsu-Siemens Lifebook E4010 */ 364 - .matches = { 365 - DMI_MATCH(DMI_SYS_VENDOR, "FUJITSU SIEMENS"), 366 - DMI_MATCH(DMI_PRODUCT_NAME, "LIFEBOOK E4010"), 367 - }, 368 - }, 369 - { 370 - /* Fujitsu-Siemens Amilo Pro 2010 */ 371 - .matches = { 372 - DMI_MATCH(DMI_SYS_VENDOR, "FUJITSU SIEMENS"), 373 - DMI_MATCH(DMI_PRODUCT_NAME, "AMILO Pro V2010"), 374 - }, 375 - }, 376 - { 377 - /* Fujitsu-Siemens Amilo Pro 2030 */ 378 - .matches = { 379 - DMI_MATCH(DMI_SYS_VENDOR, "FUJITSU SIEMENS"), 380 - DMI_MATCH(DMI_PRODUCT_NAME, "AMILO PRO V2030"), 381 - }, 382 - }, 383 - { 384 - /* 385 - * No data is coming from the touchscreen unless KBC 386 - * is in legacy mode. 387 - */ 388 - /* Panasonic CF-29 */ 389 - .matches = { 390 - DMI_MATCH(DMI_SYS_VENDOR, "Matsushita"), 391 - DMI_MATCH(DMI_PRODUCT_NAME, "CF-29"), 392 - }, 393 - }, 394 - { 395 - /* 396 - * HP Pavilion DV4017EA - 397 - * errors on MUX ports are reported without raising AUXDATA 398 - * causing "spurious NAK" messages. 399 - */ 400 - .matches = { 401 - DMI_MATCH(DMI_SYS_VENDOR, "Hewlett-Packard"), 402 - DMI_MATCH(DMI_PRODUCT_NAME, "Pavilion dv4000 (EA032EA#ABF)"), 403 - }, 404 - }, 405 - { 406 - /* 407 - * HP Pavilion ZT1000 - 408 - * like DV4017EA does not raise AUXERR for errors on MUX ports. 409 - */ 410 - .matches = { 411 - DMI_MATCH(DMI_SYS_VENDOR, "Hewlett-Packard"), 412 - DMI_MATCH(DMI_PRODUCT_NAME, "HP Pavilion Notebook PC"), 413 - DMI_MATCH(DMI_PRODUCT_VERSION, "HP Pavilion Notebook ZT1000"), 414 - }, 415 - }, 416 - { 417 - /* 418 - * HP Pavilion DV4270ca - 419 - * like DV4017EA does not raise AUXERR for errors on MUX ports. 420 - */ 421 - .matches = { 422 - DMI_MATCH(DMI_SYS_VENDOR, "Hewlett-Packard"), 423 - DMI_MATCH(DMI_PRODUCT_NAME, "Pavilion dv4000 (EH476UA#ABL)"), 424 - }, 425 - }, 426 - { 427 - .matches = { 428 - DMI_MATCH(DMI_SYS_VENDOR, "TOSHIBA"), 429 - DMI_MATCH(DMI_PRODUCT_NAME, "Satellite P10"), 430 - }, 431 - }, 432 - { 433 - .matches = { 434 - DMI_MATCH(DMI_SYS_VENDOR, "TOSHIBA"), 435 - DMI_MATCH(DMI_PRODUCT_NAME, "EQUIUM A110"), 436 - }, 437 - }, 438 - { 439 - .matches = { 440 - DMI_MATCH(DMI_SYS_VENDOR, "TOSHIBA"), 441 - DMI_MATCH(DMI_PRODUCT_NAME, "SATELLITE C850D"), 442 - }, 443 - }, 444 - { 445 - .matches = { 446 - DMI_MATCH(DMI_SYS_VENDOR, "ALIENWARE"), 447 - DMI_MATCH(DMI_PRODUCT_NAME, "Sentia"), 448 - }, 449 - }, 450 - { 451 - /* Sharp Actius MM20 */ 452 - .matches = { 453 - DMI_MATCH(DMI_SYS_VENDOR, "SHARP"), 454 - DMI_MATCH(DMI_PRODUCT_NAME, "PC-MM20 Series"), 455 - }, 456 - }, 457 - { 458 - /* Sony Vaio FS-115b */ 459 - .matches = { 460 - DMI_MATCH(DMI_SYS_VENDOR, "Sony Corporation"), 461 - DMI_MATCH(DMI_PRODUCT_NAME, "VGN-FS115B"), 462 - }, 463 - }, 464 - { 465 - /* 466 - * Sony Vaio FZ-240E - 467 - * reset and GET ID commands issued via KBD port are 468 - * sometimes being delivered to AUX3. 469 - */ 470 - .matches = { 471 - DMI_MATCH(DMI_SYS_VENDOR, "Sony Corporation"), 472 - DMI_MATCH(DMI_PRODUCT_NAME, "VGN-FZ240E"), 473 - }, 474 - }, 475 - { 476 - /* 477 - * Most (all?) VAIOs do not have external PS/2 ports nor 478 - * they implement active multiplexing properly, and 479 - * MUX discovery usually messes up keyboard/touchpad. 480 - */ 481 - .matches = { 482 - DMI_MATCH(DMI_SYS_VENDOR, "Sony Corporation"), 483 - DMI_MATCH(DMI_BOARD_NAME, "VAIO"), 484 - }, 485 - }, 486 - { 487 - /* Amoi M636/A737 */ 488 - .matches = { 489 - DMI_MATCH(DMI_SYS_VENDOR, "Amoi Electronics CO.,LTD."), 490 - DMI_MATCH(DMI_PRODUCT_NAME, "M636/A737 platform"), 491 - }, 492 - }, 493 - { 494 - /* Lenovo 3000 n100 */ 495 - .matches = { 496 - DMI_MATCH(DMI_SYS_VENDOR, "LENOVO"), 497 - DMI_MATCH(DMI_PRODUCT_NAME, "076804U"), 498 - }, 499 - }, 500 - { 501 - /* Lenovo XiaoXin Air 12 */ 502 - .matches = { 503 - DMI_MATCH(DMI_SYS_VENDOR, "LENOVO"), 504 - DMI_MATCH(DMI_PRODUCT_NAME, "80UN"), 505 - }, 106 + .driver_data = (void *)(SERIO_QUIRK_NOLOOP) 506 107 }, 507 108 { 508 109 .matches = { 509 110 DMI_MATCH(DMI_SYS_VENDOR, "Acer"), 510 111 DMI_MATCH(DMI_PRODUCT_NAME, "Aspire 1360"), 511 112 }, 113 + .driver_data = (void *)(SERIO_QUIRK_NOMUX) 512 114 }, 513 115 { 514 116 /* Acer Aspire 5710 */ ··· 177 457 DMI_MATCH(DMI_SYS_VENDOR, "Acer"), 178 458 DMI_MATCH(DMI_PRODUCT_NAME, "Aspire 5710"), 179 459 }, 460 + .driver_data = (void *)(SERIO_QUIRK_NOMUX) 180 461 }, 181 462 { 182 463 /* Acer Aspire 7738 */ ··· 185 464 DMI_MATCH(DMI_SYS_VENDOR, "Acer"), 186 465 DMI_MATCH(DMI_PRODUCT_NAME, "Aspire 7738"), 187 466 }, 188 - }, 189 - { 190 - /* Gericom Bellagio */ 191 - .matches = { 192 - DMI_MATCH(DMI_SYS_VENDOR, "Gericom"), 193 - DMI_MATCH(DMI_PRODUCT_NAME, "N34AS6"), 194 - }, 195 - }, 196 - { 197 - /* IBM 2656 */ 198 - .matches = { 199 - DMI_MATCH(DMI_SYS_VENDOR, "IBM"), 200 - DMI_MATCH(DMI_PRODUCT_NAME, "2656"), 201 - }, 202 - }, 203 - { 204 - /* Dell XPS M1530 */ 205 - .matches = { 206 - DMI_MATCH(DMI_SYS_VENDOR, "Dell Inc."), 207 - DMI_MATCH(DMI_PRODUCT_NAME, "XPS M1530"), 208 - }, 209 - }, 210 - { 211 - /* Compal HEL80I */ 212 - .matches = { 213 - DMI_MATCH(DMI_SYS_VENDOR, "COMPAL"), 214 - DMI_MATCH(DMI_PRODUCT_NAME, "HEL80I"), 215 - }, 216 - }, 217 - { 218 - /* Dell Vostro 1510 */ 219 - .matches = { 220 - DMI_MATCH(DMI_SYS_VENDOR, "Dell Inc."), 221 - DMI_MATCH(DMI_PRODUCT_NAME, "Vostro1510"), 222 - }, 467 + .driver_data = (void *)(SERIO_QUIRK_NOMUX) 223 468 }, 224 469 { 225 470 /* Acer Aspire 5536 */ ··· 194 507 DMI_MATCH(DMI_PRODUCT_NAME, "Aspire 5536"), 195 508 DMI_MATCH(DMI_PRODUCT_VERSION, "0100"), 196 509 }, 197 - }, 198 - { 199 - /* Dell Vostro V13 */ 200 - .matches = { 201 - DMI_MATCH(DMI_SYS_VENDOR, "Dell Inc."), 202 - DMI_MATCH(DMI_PRODUCT_NAME, "Vostro V13"), 203 - }, 204 - }, 205 - { 206 - /* Newer HP Pavilion dv4 models */ 207 - .matches = { 208 - DMI_MATCH(DMI_SYS_VENDOR, "Hewlett-Packard"), 209 - DMI_MATCH(DMI_PRODUCT_NAME, "HP Pavilion dv4 Notebook PC"), 210 - }, 211 - }, 212 - { 213 - /* Asus X450LCP */ 214 - .matches = { 215 - DMI_MATCH(DMI_SYS_VENDOR, "ASUSTeK COMPUTER INC."), 216 - DMI_MATCH(DMI_PRODUCT_NAME, "X450LCP"), 217 - }, 218 - }, 219 - { 220 - /* Avatar AVIU-145A6 */ 221 - .matches = { 222 - DMI_MATCH(DMI_SYS_VENDOR, "Intel"), 223 - DMI_MATCH(DMI_PRODUCT_NAME, "IC4I"), 224 - }, 225 - }, 226 - { 227 - /* TUXEDO BU1406 */ 228 - .matches = { 229 - DMI_MATCH(DMI_SYS_VENDOR, "Notebook"), 230 - DMI_MATCH(DMI_PRODUCT_NAME, "N24_25BU"), 231 - }, 232 - }, 233 - { 234 - /* Lenovo LaVie Z */ 235 - .matches = { 236 - DMI_MATCH(DMI_SYS_VENDOR, "LENOVO"), 237 - DMI_MATCH(DMI_PRODUCT_VERSION, "Lenovo LaVie Z"), 238 - }, 510 + .driver_data = (void *)(SERIO_QUIRK_NOMUX) 239 511 }, 240 512 { 241 513 /* ··· 206 560 DMI_MATCH(DMI_SYS_VENDOR, "Acer"), 207 561 DMI_MATCH(DMI_PRODUCT_NAME, "Aspire 5738"), 208 562 }, 563 + .driver_data = (void *)(SERIO_QUIRK_NOMUX) 564 + }, 565 + { 566 + /* Acer Aspire One 150 */ 567 + .matches = { 568 + DMI_MATCH(DMI_SYS_VENDOR, "Acer"), 569 + DMI_MATCH(DMI_PRODUCT_NAME, "AOA150"), 570 + }, 571 + .driver_data = (void *)(SERIO_QUIRK_RESET_ALWAYS) 572 + }, 573 + { 574 + /* Acer Aspire One 532h */ 575 + .matches = { 576 + DMI_MATCH(DMI_SYS_VENDOR, "Acer"), 577 + DMI_MATCH(DMI_PRODUCT_NAME, "AO532h"), 578 + }, 579 + .driver_data = (void *)(SERIO_QUIRK_DRITEK) 580 + }, 581 + { 582 + .matches = { 583 + DMI_MATCH(DMI_SYS_VENDOR, "Acer"), 584 + DMI_MATCH(DMI_PRODUCT_NAME, "Aspire A114-31"), 585 + }, 586 + .driver_data = (void *)(SERIO_QUIRK_RESET_ALWAYS) 587 + }, 588 + { 589 + .matches = { 590 + DMI_MATCH(DMI_SYS_VENDOR, "Acer"), 591 + DMI_MATCH(DMI_PRODUCT_NAME, "Aspire A314-31"), 592 + }, 593 + .driver_data = (void *)(SERIO_QUIRK_RESET_ALWAYS) 594 + }, 595 + { 596 + .matches = { 597 + DMI_MATCH(DMI_SYS_VENDOR, "Acer"), 598 + DMI_MATCH(DMI_PRODUCT_NAME, "Aspire A315-31"), 599 + }, 600 + .driver_data = (void *)(SERIO_QUIRK_RESET_ALWAYS) 601 + }, 602 + { 603 + .matches = { 604 + DMI_MATCH(DMI_SYS_VENDOR, "Acer"), 605 + DMI_MATCH(DMI_PRODUCT_NAME, "Aspire ES1-132"), 606 + }, 607 + .driver_data = (void *)(SERIO_QUIRK_RESET_ALWAYS) 608 + }, 609 + { 610 + .matches = { 611 + DMI_MATCH(DMI_SYS_VENDOR, "Acer"), 612 + DMI_MATCH(DMI_PRODUCT_NAME, "Aspire ES1-332"), 613 + }, 614 + .driver_data = (void *)(SERIO_QUIRK_RESET_ALWAYS) 615 + }, 616 + { 617 + .matches = { 618 + DMI_MATCH(DMI_SYS_VENDOR, "Acer"), 619 + DMI_MATCH(DMI_PRODUCT_NAME, "Aspire ES1-432"), 620 + }, 621 + .driver_data = (void *)(SERIO_QUIRK_RESET_ALWAYS) 622 + }, 623 + { 624 + .matches = { 625 + DMI_MATCH(DMI_SYS_VENDOR, "Acer"), 626 + DMI_MATCH(DMI_PRODUCT_NAME, "TravelMate Spin B118-RN"), 627 + }, 628 + .driver_data = (void *)(SERIO_QUIRK_RESET_ALWAYS) 629 + }, 630 + /* 631 + * Some Wistron based laptops need us to explicitly enable the 'Dritek 632 + * keyboard extension' to make their extra keys start generating scancodes. 633 + * Originally, this was just confined to older laptops, but a few Acer laptops 634 + * have turned up in 2007 that also need this again. 635 + */ 636 + { 637 + /* Acer Aspire 5100 */ 638 + .matches = { 639 + DMI_MATCH(DMI_SYS_VENDOR, "Acer"), 640 + DMI_MATCH(DMI_PRODUCT_NAME, "Aspire 5100"), 641 + }, 642 + .driver_data = (void *)(SERIO_QUIRK_DRITEK) 643 + }, 644 + { 645 + /* Acer Aspire 5610 */ 646 + .matches = { 647 + DMI_MATCH(DMI_SYS_VENDOR, "Acer"), 648 + DMI_MATCH(DMI_PRODUCT_NAME, "Aspire 5610"), 649 + }, 650 + .driver_data = (void *)(SERIO_QUIRK_DRITEK) 651 + }, 652 + { 653 + /* Acer Aspire 5630 */ 654 + .matches = { 655 + DMI_MATCH(DMI_SYS_VENDOR, "Acer"), 656 + DMI_MATCH(DMI_PRODUCT_NAME, "Aspire 5630"), 657 + }, 658 + .driver_data = (void *)(SERIO_QUIRK_DRITEK) 659 + }, 660 + { 661 + /* Acer Aspire 5650 */ 662 + .matches = { 663 + DMI_MATCH(DMI_SYS_VENDOR, "Acer"), 664 + DMI_MATCH(DMI_PRODUCT_NAME, "Aspire 5650"), 665 + }, 666 + .driver_data = (void *)(SERIO_QUIRK_DRITEK) 667 + }, 668 + { 669 + /* Acer Aspire 5680 */ 670 + .matches = { 671 + DMI_MATCH(DMI_SYS_VENDOR, "Acer"), 672 + DMI_MATCH(DMI_PRODUCT_NAME, "Aspire 5680"), 673 + }, 674 + .driver_data = (void *)(SERIO_QUIRK_DRITEK) 675 + }, 676 + { 677 + /* Acer Aspire 5720 */ 678 + .matches = { 679 + DMI_MATCH(DMI_SYS_VENDOR, "Acer"), 680 + DMI_MATCH(DMI_PRODUCT_NAME, "Aspire 5720"), 681 + }, 682 + .driver_data = (void *)(SERIO_QUIRK_DRITEK) 683 + }, 684 + { 685 + /* Acer Aspire 9110 */ 686 + .matches = { 687 + DMI_MATCH(DMI_SYS_VENDOR, "Acer"), 688 + DMI_MATCH(DMI_PRODUCT_NAME, "Aspire 9110"), 689 + }, 690 + .driver_data = (void *)(SERIO_QUIRK_DRITEK) 691 + }, 692 + { 693 + /* Acer TravelMate 660 */ 694 + .matches = { 695 + DMI_MATCH(DMI_SYS_VENDOR, "Acer"), 696 + DMI_MATCH(DMI_PRODUCT_NAME, "TravelMate 660"), 697 + }, 698 + .driver_data = (void *)(SERIO_QUIRK_DRITEK) 699 + }, 700 + { 701 + /* Acer TravelMate 2490 */ 702 + .matches = { 703 + DMI_MATCH(DMI_SYS_VENDOR, "Acer"), 704 + DMI_MATCH(DMI_PRODUCT_NAME, "TravelMate 2490"), 705 + }, 706 + .driver_data = (void *)(SERIO_QUIRK_DRITEK) 707 + }, 708 + { 709 + /* Acer TravelMate 4280 */ 710 + .matches = { 711 + DMI_MATCH(DMI_SYS_VENDOR, "Acer"), 712 + DMI_MATCH(DMI_PRODUCT_NAME, "TravelMate 4280"), 713 + }, 714 + .driver_data = (void *)(SERIO_QUIRK_DRITEK) 715 + }, 716 + { 717 + /* Amoi M636/A737 */ 718 + .matches = { 719 + DMI_MATCH(DMI_SYS_VENDOR, "Amoi Electronics CO.,LTD."), 720 + DMI_MATCH(DMI_PRODUCT_NAME, "M636/A737 platform"), 721 + }, 722 + .driver_data = (void *)(SERIO_QUIRK_NOMUX) 723 + }, 724 + { 725 + .matches = { 726 + DMI_MATCH(DMI_SYS_VENDOR, "ByteSpeed LLC"), 727 + DMI_MATCH(DMI_PRODUCT_NAME, "ByteSpeed Laptop C15B"), 728 + }, 729 + .driver_data = (void *)(SERIO_QUIRK_NOLOOP) 730 + }, 731 + { 732 + /* Compal HEL80I */ 733 + .matches = { 734 + DMI_MATCH(DMI_SYS_VENDOR, "COMPAL"), 735 + DMI_MATCH(DMI_PRODUCT_NAME, "HEL80I"), 736 + }, 737 + .driver_data = (void *)(SERIO_QUIRK_NOMUX) 738 + }, 739 + { 740 + .matches = { 741 + DMI_MATCH(DMI_SYS_VENDOR, "Compaq"), 742 + DMI_MATCH(DMI_PRODUCT_NAME, "ProLiant"), 743 + DMI_MATCH(DMI_PRODUCT_VERSION, "8500"), 744 + }, 745 + .driver_data = (void *)(SERIO_QUIRK_NOLOOP) 746 + }, 747 + { 748 + .matches = { 749 + DMI_MATCH(DMI_SYS_VENDOR, "Compaq"), 750 + DMI_MATCH(DMI_PRODUCT_NAME, "ProLiant"), 751 + DMI_MATCH(DMI_PRODUCT_VERSION, "DL760"), 752 + }, 753 + .driver_data = (void *)(SERIO_QUIRK_NOLOOP) 754 + }, 755 + { 756 + /* Advent 4211 */ 757 + .matches = { 758 + DMI_MATCH(DMI_SYS_VENDOR, "DIXONSXP"), 759 + DMI_MATCH(DMI_PRODUCT_NAME, "Advent 4211"), 760 + }, 761 + .driver_data = (void *)(SERIO_QUIRK_RESET_ALWAYS) 762 + }, 763 + { 764 + /* Dell Embedded Box PC 3000 */ 765 + .matches = { 766 + DMI_MATCH(DMI_SYS_VENDOR, "Dell Inc."), 767 + DMI_MATCH(DMI_PRODUCT_NAME, "Embedded Box PC 3000"), 768 + }, 769 + .driver_data = (void *)(SERIO_QUIRK_NOLOOP) 770 + }, 771 + { 772 + /* Dell XPS M1530 */ 773 + .matches = { 774 + DMI_MATCH(DMI_SYS_VENDOR, "Dell Inc."), 775 + DMI_MATCH(DMI_PRODUCT_NAME, "XPS M1530"), 776 + }, 777 + .driver_data = (void *)(SERIO_QUIRK_NOMUX) 778 + }, 779 + { 780 + /* Dell Vostro 1510 */ 781 + .matches = { 782 + DMI_MATCH(DMI_SYS_VENDOR, "Dell Inc."), 783 + DMI_MATCH(DMI_PRODUCT_NAME, "Vostro1510"), 784 + }, 785 + .driver_data = (void *)(SERIO_QUIRK_NOMUX) 786 + }, 787 + { 788 + /* Dell Vostro V13 */ 789 + .matches = { 790 + DMI_MATCH(DMI_SYS_VENDOR, "Dell Inc."), 791 + DMI_MATCH(DMI_PRODUCT_NAME, "Vostro V13"), 792 + }, 793 + .driver_data = (void *)(SERIO_QUIRK_NOMUX | SERIO_QUIRK_NOTIMEOUT) 794 + }, 795 + { 796 + /* Dell Vostro 1320 */ 797 + .matches = { 798 + DMI_MATCH(DMI_SYS_VENDOR, "Dell Inc."), 799 + DMI_MATCH(DMI_PRODUCT_NAME, "Vostro 1320"), 800 + }, 801 + .driver_data = (void *)(SERIO_QUIRK_RESET_ALWAYS) 802 + }, 803 + { 804 + /* Dell Vostro 1520 */ 805 + .matches = { 806 + DMI_MATCH(DMI_SYS_VENDOR, "Dell Inc."), 807 + DMI_MATCH(DMI_PRODUCT_NAME, "Vostro 1520"), 808 + }, 809 + .driver_data = (void *)(SERIO_QUIRK_RESET_ALWAYS) 810 + }, 811 + { 812 + /* Dell Vostro 1720 */ 813 + .matches = { 814 + DMI_MATCH(DMI_SYS_VENDOR, "Dell Inc."), 815 + DMI_MATCH(DMI_PRODUCT_NAME, "Vostro 1720"), 816 + }, 817 + .driver_data = (void *)(SERIO_QUIRK_RESET_ALWAYS) 209 818 }, 210 819 { 211 820 /* Entroware Proteus */ ··· 469 568 DMI_MATCH(DMI_PRODUCT_NAME, "Proteus"), 470 569 DMI_MATCH(DMI_PRODUCT_VERSION, "EL07R4"), 471 570 }, 571 + .driver_data = (void *)(SERIO_QUIRK_NOMUX | SERIO_QUIRK_RESET_ALWAYS) 472 572 }, 473 - { } 474 - }; 475 - 476 - static const struct dmi_system_id i8042_dmi_forcemux_table[] __initconst = { 573 + /* 574 + * Some Fujitsu notebooks are having trouble with touchpads if 575 + * active multiplexing mode is activated. Luckily they don't have 576 + * external PS/2 ports so we can safely disable it. 577 + * ... apparently some Toshibas don't like MUX mode either and 578 + * die horrible death on reboot. 579 + */ 580 + { 581 + /* Fujitsu Lifebook P7010/P7010D */ 582 + .matches = { 583 + DMI_MATCH(DMI_SYS_VENDOR, "FUJITSU"), 584 + DMI_MATCH(DMI_PRODUCT_NAME, "P7010"), 585 + }, 586 + .driver_data = (void *)(SERIO_QUIRK_NOMUX) 587 + }, 588 + { 589 + /* Fujitsu Lifebook P5020D */ 590 + .matches = { 591 + DMI_MATCH(DMI_SYS_VENDOR, "FUJITSU"), 592 + DMI_MATCH(DMI_PRODUCT_NAME, "LifeBook P Series"), 593 + }, 594 + .driver_data = (void *)(SERIO_QUIRK_NOMUX) 595 + }, 596 + { 597 + /* Fujitsu Lifebook S2000 */ 598 + .matches = { 599 + DMI_MATCH(DMI_SYS_VENDOR, "FUJITSU"), 600 + DMI_MATCH(DMI_PRODUCT_NAME, "LifeBook S Series"), 601 + }, 602 + .driver_data = (void *)(SERIO_QUIRK_NOMUX) 603 + }, 604 + { 605 + /* Fujitsu Lifebook S6230 */ 606 + .matches = { 607 + DMI_MATCH(DMI_SYS_VENDOR, "FUJITSU"), 608 + DMI_MATCH(DMI_PRODUCT_NAME, "LifeBook S6230"), 609 + }, 610 + .driver_data = (void *)(SERIO_QUIRK_NOMUX) 611 + }, 612 + { 613 + /* Fujitsu Lifebook T725 laptop */ 614 + .matches = { 615 + DMI_MATCH(DMI_SYS_VENDOR, "FUJITSU"), 616 + DMI_MATCH(DMI_PRODUCT_NAME, "LIFEBOOK T725"), 617 + }, 618 + .driver_data = (void *)(SERIO_QUIRK_NOMUX | SERIO_QUIRK_NOTIMEOUT) 619 + }, 620 + { 621 + /* Fujitsu Lifebook U745 */ 622 + .matches = { 623 + DMI_MATCH(DMI_SYS_VENDOR, "FUJITSU"), 624 + DMI_MATCH(DMI_PRODUCT_NAME, "LIFEBOOK U745"), 625 + }, 626 + .driver_data = (void *)(SERIO_QUIRK_NOMUX) 627 + }, 628 + { 629 + /* Fujitsu T70H */ 630 + .matches = { 631 + DMI_MATCH(DMI_SYS_VENDOR, "FUJITSU"), 632 + DMI_MATCH(DMI_PRODUCT_NAME, "FMVLT70H"), 633 + }, 634 + .driver_data = (void *)(SERIO_QUIRK_NOMUX) 635 + }, 636 + { 637 + /* Fujitsu A544 laptop */ 638 + /* https://bugzilla.redhat.com/show_bug.cgi?id=1111138 */ 639 + .matches = { 640 + DMI_MATCH(DMI_SYS_VENDOR, "FUJITSU"), 641 + DMI_MATCH(DMI_PRODUCT_NAME, "LIFEBOOK A544"), 642 + }, 643 + .driver_data = (void *)(SERIO_QUIRK_NOTIMEOUT) 644 + }, 645 + { 646 + /* Fujitsu AH544 laptop */ 647 + /* https://bugzilla.kernel.org/show_bug.cgi?id=69731 */ 648 + .matches = { 649 + DMI_MATCH(DMI_SYS_VENDOR, "FUJITSU"), 650 + DMI_MATCH(DMI_PRODUCT_NAME, "LIFEBOOK AH544"), 651 + }, 652 + .driver_data = (void *)(SERIO_QUIRK_NOTIMEOUT) 653 + }, 654 + { 655 + /* Fujitsu U574 laptop */ 656 + /* https://bugzilla.kernel.org/show_bug.cgi?id=69731 */ 657 + .matches = { 658 + DMI_MATCH(DMI_SYS_VENDOR, "FUJITSU"), 659 + DMI_MATCH(DMI_PRODUCT_NAME, "LIFEBOOK U574"), 660 + }, 661 + .driver_data = (void *)(SERIO_QUIRK_NOTIMEOUT) 662 + }, 663 + { 664 + /* Fujitsu UH554 laptop */ 665 + .matches = { 666 + DMI_MATCH(DMI_SYS_VENDOR, "FUJITSU"), 667 + DMI_MATCH(DMI_PRODUCT_NAME, "LIFEBOOK UH544"), 668 + }, 669 + .driver_data = (void *)(SERIO_QUIRK_NOTIMEOUT) 670 + }, 671 + { 672 + /* Fujitsu Lifebook P7010 */ 673 + .matches = { 674 + DMI_MATCH(DMI_SYS_VENDOR, "FUJITSU SIEMENS"), 675 + DMI_MATCH(DMI_PRODUCT_NAME, "0000000000"), 676 + }, 677 + .driver_data = (void *)(SERIO_QUIRK_NOMUX) 678 + }, 679 + { 680 + /* Fujitsu-Siemens Lifebook T3010 */ 681 + .matches = { 682 + DMI_MATCH(DMI_SYS_VENDOR, "FUJITSU SIEMENS"), 683 + DMI_MATCH(DMI_PRODUCT_NAME, "LIFEBOOK T3010"), 684 + }, 685 + .driver_data = (void *)(SERIO_QUIRK_NOMUX) 686 + }, 687 + { 688 + /* Fujitsu-Siemens Lifebook E4010 */ 689 + .matches = { 690 + DMI_MATCH(DMI_SYS_VENDOR, "FUJITSU SIEMENS"), 691 + DMI_MATCH(DMI_PRODUCT_NAME, "LIFEBOOK E4010"), 692 + }, 693 + .driver_data = (void *)(SERIO_QUIRK_NOMUX) 694 + }, 695 + { 696 + /* Fujitsu-Siemens Amilo Pro 2010 */ 697 + .matches = { 698 + DMI_MATCH(DMI_SYS_VENDOR, "FUJITSU SIEMENS"), 699 + DMI_MATCH(DMI_PRODUCT_NAME, "AMILO Pro V2010"), 700 + }, 701 + .driver_data = (void *)(SERIO_QUIRK_NOMUX) 702 + }, 703 + { 704 + /* Fujitsu-Siemens Amilo Pro 2030 */ 705 + .matches = { 706 + DMI_MATCH(DMI_SYS_VENDOR, "FUJITSU SIEMENS"), 707 + DMI_MATCH(DMI_PRODUCT_NAME, "AMILO PRO V2030"), 708 + }, 709 + .driver_data = (void *)(SERIO_QUIRK_NOMUX) 710 + }, 711 + { 712 + /* Gigabyte M912 */ 713 + .matches = { 714 + DMI_MATCH(DMI_SYS_VENDOR, "GIGABYTE"), 715 + DMI_MATCH(DMI_PRODUCT_NAME, "M912"), 716 + DMI_MATCH(DMI_PRODUCT_VERSION, "01"), 717 + }, 718 + .driver_data = (void *)(SERIO_QUIRK_NOLOOP) 719 + }, 720 + { 721 + /* Gigabyte Spring Peak - defines wrong chassis type */ 722 + .matches = { 723 + DMI_MATCH(DMI_SYS_VENDOR, "GIGABYTE"), 724 + DMI_MATCH(DMI_PRODUCT_NAME, "Spring Peak"), 725 + }, 726 + .driver_data = (void *)(SERIO_QUIRK_NOLOOP) 727 + }, 728 + { 729 + /* Gigabyte T1005 - defines wrong chassis type ("Other") */ 730 + .matches = { 731 + DMI_MATCH(DMI_SYS_VENDOR, "GIGABYTE"), 732 + DMI_MATCH(DMI_PRODUCT_NAME, "T1005"), 733 + }, 734 + .driver_data = (void *)(SERIO_QUIRK_NOLOOP) 735 + }, 736 + { 737 + /* Gigabyte T1005M/P - defines wrong chassis type ("Other") */ 738 + .matches = { 739 + DMI_MATCH(DMI_SYS_VENDOR, "GIGABYTE"), 740 + DMI_MATCH(DMI_PRODUCT_NAME, "T1005M/P"), 741 + }, 742 + .driver_data = (void *)(SERIO_QUIRK_NOLOOP) 743 + }, 744 + /* 745 + * Some laptops need keyboard reset before probing for the trackpad to get 746 + * it detected, initialised & finally work. 747 + */ 748 + { 749 + /* Gigabyte P35 v2 - Elantech touchpad */ 750 + .matches = { 751 + DMI_MATCH(DMI_SYS_VENDOR, "GIGABYTE"), 752 + DMI_MATCH(DMI_PRODUCT_NAME, "P35V2"), 753 + }, 754 + .driver_data = (void *)(SERIO_QUIRK_KBDRESET) 755 + }, 756 + { 757 + /* Aorus branded Gigabyte X3 Plus - Elantech touchpad */ 758 + .matches = { 759 + DMI_MATCH(DMI_SYS_VENDOR, "GIGABYTE"), 760 + DMI_MATCH(DMI_PRODUCT_NAME, "X3"), 761 + }, 762 + .driver_data = (void *)(SERIO_QUIRK_KBDRESET) 763 + }, 764 + { 765 + /* Gigabyte P34 - Elantech touchpad */ 766 + .matches = { 767 + DMI_MATCH(DMI_SYS_VENDOR, "GIGABYTE"), 768 + DMI_MATCH(DMI_PRODUCT_NAME, "P34"), 769 + }, 770 + .driver_data = (void *)(SERIO_QUIRK_KBDRESET) 771 + }, 772 + { 773 + /* Gigabyte P57 - Elantech touchpad */ 774 + .matches = { 775 + DMI_MATCH(DMI_SYS_VENDOR, "GIGABYTE"), 776 + DMI_MATCH(DMI_PRODUCT_NAME, "P57"), 777 + }, 778 + .driver_data = (void *)(SERIO_QUIRK_KBDRESET) 779 + }, 780 + { 781 + /* Gericom Bellagio */ 782 + .matches = { 783 + DMI_MATCH(DMI_SYS_VENDOR, "Gericom"), 784 + DMI_MATCH(DMI_PRODUCT_NAME, "N34AS6"), 785 + }, 786 + .driver_data = (void *)(SERIO_QUIRK_NOMUX) 787 + }, 788 + { 789 + /* Gigabyte M1022M netbook */ 790 + .matches = { 791 + DMI_MATCH(DMI_BOARD_VENDOR, "Gigabyte Technology Co.,Ltd."), 792 + DMI_MATCH(DMI_BOARD_NAME, "M1022E"), 793 + DMI_MATCH(DMI_BOARD_VERSION, "1.02"), 794 + }, 795 + .driver_data = (void *)(SERIO_QUIRK_NOLOOP) 796 + }, 797 + { 798 + .matches = { 799 + DMI_MATCH(DMI_SYS_VENDOR, "Hewlett-Packard"), 800 + DMI_MATCH(DMI_PRODUCT_NAME, "HP Pavilion dv9700"), 801 + DMI_MATCH(DMI_PRODUCT_VERSION, "Rev 1"), 802 + }, 803 + .driver_data = (void *)(SERIO_QUIRK_NOLOOP) 804 + }, 805 + { 806 + /* 807 + * HP Pavilion DV4017EA - 808 + * errors on MUX ports are reported without raising AUXDATA 809 + * causing "spurious NAK" messages. 810 + */ 811 + .matches = { 812 + DMI_MATCH(DMI_SYS_VENDOR, "Hewlett-Packard"), 813 + DMI_MATCH(DMI_PRODUCT_NAME, "Pavilion dv4000 (EA032EA#ABF)"), 814 + }, 815 + .driver_data = (void *)(SERIO_QUIRK_NOMUX) 816 + }, 817 + { 818 + /* 819 + * HP Pavilion ZT1000 - 820 + * like DV4017EA does not raise AUXERR for errors on MUX ports. 821 + */ 822 + .matches = { 823 + DMI_MATCH(DMI_SYS_VENDOR, "Hewlett-Packard"), 824 + DMI_MATCH(DMI_PRODUCT_NAME, "HP Pavilion Notebook PC"), 825 + DMI_MATCH(DMI_PRODUCT_VERSION, "HP Pavilion Notebook ZT1000"), 826 + }, 827 + .driver_data = (void *)(SERIO_QUIRK_NOMUX) 828 + }, 829 + { 830 + /* 831 + * HP Pavilion DV4270ca - 832 + * like DV4017EA does not raise AUXERR for errors on MUX ports. 833 + */ 834 + .matches = { 835 + DMI_MATCH(DMI_SYS_VENDOR, "Hewlett-Packard"), 836 + DMI_MATCH(DMI_PRODUCT_NAME, "Pavilion dv4000 (EH476UA#ABL)"), 837 + }, 838 + .driver_data = (void *)(SERIO_QUIRK_NOMUX) 839 + }, 840 + { 841 + /* Newer HP Pavilion dv4 models */ 842 + .matches = { 843 + DMI_MATCH(DMI_SYS_VENDOR, "Hewlett-Packard"), 844 + DMI_MATCH(DMI_PRODUCT_NAME, "HP Pavilion dv4 Notebook PC"), 845 + }, 846 + .driver_data = (void *)(SERIO_QUIRK_NOMUX | SERIO_QUIRK_NOTIMEOUT) 847 + }, 848 + { 849 + /* IBM 2656 */ 850 + .matches = { 851 + DMI_MATCH(DMI_SYS_VENDOR, "IBM"), 852 + DMI_MATCH(DMI_PRODUCT_NAME, "2656"), 853 + }, 854 + .driver_data = (void *)(SERIO_QUIRK_NOMUX) 855 + }, 856 + { 857 + /* Avatar AVIU-145A6 */ 858 + .matches = { 859 + DMI_MATCH(DMI_SYS_VENDOR, "Intel"), 860 + DMI_MATCH(DMI_PRODUCT_NAME, "IC4I"), 861 + }, 862 + .driver_data = (void *)(SERIO_QUIRK_NOMUX) 863 + }, 864 + { 865 + /* Intel MBO Desktop D845PESV */ 866 + .matches = { 867 + DMI_MATCH(DMI_BOARD_VENDOR, "Intel Corporation"), 868 + DMI_MATCH(DMI_BOARD_NAME, "D845PESV"), 869 + }, 870 + .driver_data = (void *)(SERIO_QUIRK_NOPNP) 871 + }, 872 + { 873 + /* 874 + * Intel NUC D54250WYK - does not have i8042 controller but 875 + * declares PS/2 devices in DSDT. 876 + */ 877 + .matches = { 878 + DMI_MATCH(DMI_BOARD_VENDOR, "Intel Corporation"), 879 + DMI_MATCH(DMI_BOARD_NAME, "D54250WYK"), 880 + }, 881 + .driver_data = (void *)(SERIO_QUIRK_NOPNP) 882 + }, 883 + { 884 + /* Lenovo 3000 n100 */ 885 + .matches = { 886 + DMI_MATCH(DMI_SYS_VENDOR, "LENOVO"), 887 + DMI_MATCH(DMI_PRODUCT_NAME, "076804U"), 888 + }, 889 + .driver_data = (void *)(SERIO_QUIRK_NOMUX) 890 + }, 891 + { 892 + /* Lenovo XiaoXin Air 12 */ 893 + .matches = { 894 + DMI_MATCH(DMI_SYS_VENDOR, "LENOVO"), 895 + DMI_MATCH(DMI_PRODUCT_NAME, "80UN"), 896 + }, 897 + .driver_data = (void *)(SERIO_QUIRK_NOMUX) 898 + }, 899 + { 900 + /* Lenovo LaVie Z */ 901 + .matches = { 902 + DMI_MATCH(DMI_SYS_VENDOR, "LENOVO"), 903 + DMI_MATCH(DMI_PRODUCT_VERSION, "Lenovo LaVie Z"), 904 + }, 905 + .driver_data = (void *)(SERIO_QUIRK_NOMUX) 906 + }, 907 + { 908 + /* Lenovo Ideapad U455 */ 909 + .matches = { 910 + DMI_MATCH(DMI_SYS_VENDOR, "LENOVO"), 911 + DMI_MATCH(DMI_PRODUCT_NAME, "20046"), 912 + }, 913 + .driver_data = (void *)(SERIO_QUIRK_RESET_ALWAYS) 914 + }, 915 + { 916 + /* Lenovo ThinkPad L460 */ 917 + .matches = { 918 + DMI_MATCH(DMI_SYS_VENDOR, "LENOVO"), 919 + DMI_MATCH(DMI_PRODUCT_VERSION, "ThinkPad L460"), 920 + }, 921 + .driver_data = (void *)(SERIO_QUIRK_RESET_ALWAYS) 922 + }, 923 + { 924 + /* Lenovo ThinkPad Twist S230u */ 925 + .matches = { 926 + DMI_MATCH(DMI_SYS_VENDOR, "LENOVO"), 927 + DMI_MATCH(DMI_PRODUCT_NAME, "33474HU"), 928 + }, 929 + .driver_data = (void *)(SERIO_QUIRK_RESET_ALWAYS) 930 + }, 931 + { 932 + /* LG Electronics X110 */ 933 + .matches = { 934 + DMI_MATCH(DMI_BOARD_VENDOR, "LG Electronics Inc."), 935 + DMI_MATCH(DMI_BOARD_NAME, "X110"), 936 + }, 937 + .driver_data = (void *)(SERIO_QUIRK_RESET_ALWAYS) 938 + }, 939 + { 940 + /* Medion Akoya Mini E1210 */ 941 + .matches = { 942 + DMI_MATCH(DMI_SYS_VENDOR, "MEDION"), 943 + DMI_MATCH(DMI_PRODUCT_NAME, "E1210"), 944 + }, 945 + .driver_data = (void *)(SERIO_QUIRK_RESET_ALWAYS) 946 + }, 947 + { 948 + /* Medion Akoya E1222 */ 949 + .matches = { 950 + DMI_MATCH(DMI_SYS_VENDOR, "MEDION"), 951 + DMI_MATCH(DMI_PRODUCT_NAME, "E122X"), 952 + }, 953 + .driver_data = (void *)(SERIO_QUIRK_RESET_ALWAYS) 954 + }, 955 + { 956 + /* MSI Wind U-100 */ 957 + .matches = { 958 + DMI_MATCH(DMI_BOARD_VENDOR, "MICRO-STAR INTERNATIONAL CO., LTD"), 959 + DMI_MATCH(DMI_BOARD_NAME, "U-100"), 960 + }, 961 + .driver_data = (void *)(SERIO_QUIRK_RESET_ALWAYS | SERIO_QUIRK_NOPNP) 962 + }, 963 + { 964 + /* 965 + * No data is coming from the touchscreen unless KBC 966 + * is in legacy mode. 967 + */ 968 + /* Panasonic CF-29 */ 969 + .matches = { 970 + DMI_MATCH(DMI_SYS_VENDOR, "Matsushita"), 971 + DMI_MATCH(DMI_PRODUCT_NAME, "CF-29"), 972 + }, 973 + .driver_data = (void *)(SERIO_QUIRK_NOMUX) 974 + }, 975 + { 976 + /* Medion Akoya E7225 */ 977 + .matches = { 978 + DMI_MATCH(DMI_SYS_VENDOR, "Medion"), 979 + DMI_MATCH(DMI_PRODUCT_NAME, "Akoya E7225"), 980 + DMI_MATCH(DMI_PRODUCT_VERSION, "1.0"), 981 + }, 982 + .driver_data = (void *)(SERIO_QUIRK_NOLOOP) 983 + }, 984 + { 985 + /* Microsoft Virtual Machine */ 986 + .matches = { 987 + DMI_MATCH(DMI_SYS_VENDOR, "Microsoft Corporation"), 988 + DMI_MATCH(DMI_PRODUCT_NAME, "Virtual Machine"), 989 + DMI_MATCH(DMI_PRODUCT_VERSION, "VS2005R2"), 990 + }, 991 + .driver_data = (void *)(SERIO_QUIRK_NOLOOP) 992 + }, 993 + { 994 + /* Medion MAM 2070 */ 995 + .matches = { 996 + DMI_MATCH(DMI_SYS_VENDOR, "Notebook"), 997 + DMI_MATCH(DMI_PRODUCT_NAME, "MAM 2070"), 998 + DMI_MATCH(DMI_PRODUCT_VERSION, "5a"), 999 + }, 1000 + .driver_data = (void *)(SERIO_QUIRK_NOLOOP) 1001 + }, 1002 + { 1003 + /* TUXEDO BU1406 */ 1004 + .matches = { 1005 + DMI_MATCH(DMI_SYS_VENDOR, "Notebook"), 1006 + DMI_MATCH(DMI_PRODUCT_NAME, "N24_25BU"), 1007 + }, 1008 + .driver_data = (void *)(SERIO_QUIRK_NOMUX) 1009 + }, 1010 + { 1011 + /* OQO Model 01 */ 1012 + .matches = { 1013 + DMI_MATCH(DMI_SYS_VENDOR, "OQO"), 1014 + DMI_MATCH(DMI_PRODUCT_NAME, "ZEPTO"), 1015 + DMI_MATCH(DMI_PRODUCT_VERSION, "00"), 1016 + }, 1017 + .driver_data = (void *)(SERIO_QUIRK_NOLOOP) 1018 + }, 1019 + { 1020 + .matches = { 1021 + DMI_MATCH(DMI_SYS_VENDOR, "PEGATRON CORPORATION"), 1022 + DMI_MATCH(DMI_PRODUCT_NAME, "C15B"), 1023 + }, 1024 + .driver_data = (void *)(SERIO_QUIRK_NOLOOP) 1025 + }, 1026 + { 1027 + /* Acer Aspire 5 A515 */ 1028 + .matches = { 1029 + DMI_MATCH(DMI_BOARD_VENDOR, "PK"), 1030 + DMI_MATCH(DMI_BOARD_NAME, "Grumpy_PK"), 1031 + }, 1032 + .driver_data = (void *)(SERIO_QUIRK_NOPNP) 1033 + }, 1034 + { 1035 + /* ULI EV4873 - AUX LOOP does not work properly */ 1036 + .matches = { 1037 + DMI_MATCH(DMI_SYS_VENDOR, "ULI"), 1038 + DMI_MATCH(DMI_PRODUCT_NAME, "EV4873"), 1039 + DMI_MATCH(DMI_PRODUCT_VERSION, "5a"), 1040 + }, 1041 + .driver_data = (void *)(SERIO_QUIRK_NOLOOP) 1042 + }, 1043 + { 1044 + /* 1045 + * Arima-Rioworks HDAMB - 1046 + * AUX LOOP command does not raise AUX IRQ 1047 + */ 1048 + .matches = { 1049 + DMI_MATCH(DMI_BOARD_VENDOR, "RIOWORKS"), 1050 + DMI_MATCH(DMI_BOARD_NAME, "HDAMB"), 1051 + DMI_MATCH(DMI_BOARD_VERSION, "Rev E"), 1052 + }, 1053 + .driver_data = (void *)(SERIO_QUIRK_NOLOOP) 1054 + }, 1055 + { 1056 + /* Sharp Actius MM20 */ 1057 + .matches = { 1058 + DMI_MATCH(DMI_SYS_VENDOR, "SHARP"), 1059 + DMI_MATCH(DMI_PRODUCT_NAME, "PC-MM20 Series"), 1060 + }, 1061 + .driver_data = (void *)(SERIO_QUIRK_NOMUX) 1062 + }, 1063 + { 1064 + /* 1065 + * Sony Vaio FZ-240E - 1066 + * reset and GET ID commands issued via KBD port are 1067 + * sometimes being delivered to AUX3. 1068 + */ 1069 + .matches = { 1070 + DMI_MATCH(DMI_SYS_VENDOR, "Sony Corporation"), 1071 + DMI_MATCH(DMI_PRODUCT_NAME, "VGN-FZ240E"), 1072 + }, 1073 + .driver_data = (void *)(SERIO_QUIRK_NOMUX) 1074 + }, 1075 + { 1076 + /* 1077 + * Most (all?) VAIOs do not have external PS/2 ports nor 1078 + * they implement active multiplexing properly, and 1079 + * MUX discovery usually messes up keyboard/touchpad. 1080 + */ 1081 + .matches = { 1082 + DMI_MATCH(DMI_SYS_VENDOR, "Sony Corporation"), 1083 + DMI_MATCH(DMI_BOARD_NAME, "VAIO"), 1084 + }, 1085 + .driver_data = (void *)(SERIO_QUIRK_NOMUX) 1086 + }, 1087 + { 1088 + /* Sony Vaio FS-115b */ 1089 + .matches = { 1090 + DMI_MATCH(DMI_SYS_VENDOR, "Sony Corporation"), 1091 + DMI_MATCH(DMI_PRODUCT_NAME, "VGN-FS115B"), 1092 + }, 1093 + .driver_data = (void *)(SERIO_QUIRK_NOMUX) 1094 + }, 477 1095 { 478 1096 /* 479 1097 * Sony Vaio VGN-CS series require MUX or the touch sensor ··· 1002 582 DMI_MATCH(DMI_SYS_VENDOR, "Sony Corporation"), 1003 583 DMI_MATCH(DMI_PRODUCT_NAME, "VGN-CS"), 1004 584 }, 1005 - }, 1006 - { } 1007 - }; 1008 - 1009 - /* 1010 - * On some Asus laptops, just running self tests cause problems. 1011 - */ 1012 - static const struct dmi_system_id i8042_dmi_noselftest_table[] = { 1013 - { 1014 - .matches = { 1015 - DMI_MATCH(DMI_SYS_VENDOR, "ASUSTeK COMPUTER INC."), 1016 - DMI_MATCH(DMI_CHASSIS_TYPE, "10"), /* Notebook */ 1017 - }, 1018 - }, { 1019 - .matches = { 1020 - DMI_MATCH(DMI_SYS_VENDOR, "ASUSTeK COMPUTER INC."), 1021 - DMI_MATCH(DMI_CHASSIS_TYPE, "31"), /* Convertible Notebook */ 1022 - }, 1023 - }, 1024 - { } 1025 - }; 1026 - static const struct dmi_system_id __initconst i8042_dmi_reset_table[] = { 1027 - { 1028 - /* MSI Wind U-100 */ 1029 - .matches = { 1030 - DMI_MATCH(DMI_BOARD_NAME, "U-100"), 1031 - DMI_MATCH(DMI_BOARD_VENDOR, "MICRO-STAR INTERNATIONAL CO., LTD"), 1032 - }, 1033 - }, 1034 - { 1035 - /* LG Electronics X110 */ 1036 - .matches = { 1037 - DMI_MATCH(DMI_BOARD_NAME, "X110"), 1038 - DMI_MATCH(DMI_BOARD_VENDOR, "LG Electronics Inc."), 1039 - }, 1040 - }, 1041 - { 1042 - /* Acer Aspire One 150 */ 1043 - .matches = { 1044 - DMI_MATCH(DMI_SYS_VENDOR, "Acer"), 1045 - DMI_MATCH(DMI_PRODUCT_NAME, "AOA150"), 1046 - }, 585 + .driver_data = (void *)(SERIO_QUIRK_FORCEMUX) 1047 586 }, 1048 587 { 1049 588 .matches = { 1050 - DMI_MATCH(DMI_SYS_VENDOR, "Acer"), 1051 - DMI_MATCH(DMI_PRODUCT_NAME, "Aspire A114-31"), 589 + DMI_MATCH(DMI_SYS_VENDOR, "TOSHIBA"), 590 + DMI_MATCH(DMI_PRODUCT_NAME, "Satellite P10"), 1052 591 }, 592 + .driver_data = (void *)(SERIO_QUIRK_NOMUX) 1053 593 }, 1054 594 { 1055 595 .matches = { 1056 - DMI_MATCH(DMI_SYS_VENDOR, "Acer"), 1057 - DMI_MATCH(DMI_PRODUCT_NAME, "Aspire A314-31"), 596 + DMI_MATCH(DMI_SYS_VENDOR, "TOSHIBA"), 597 + DMI_MATCH(DMI_PRODUCT_NAME, "EQUIUM A110"), 1058 598 }, 599 + .driver_data = (void *)(SERIO_QUIRK_NOMUX) 1059 600 }, 1060 601 { 1061 602 .matches = { 1062 - DMI_MATCH(DMI_SYS_VENDOR, "Acer"), 1063 - DMI_MATCH(DMI_PRODUCT_NAME, "Aspire A315-31"), 603 + DMI_MATCH(DMI_SYS_VENDOR, "TOSHIBA"), 604 + DMI_MATCH(DMI_PRODUCT_NAME, "SATELLITE C850D"), 1064 605 }, 606 + .driver_data = (void *)(SERIO_QUIRK_NOMUX) 607 + }, 608 + /* 609 + * A lot of modern Clevo barebones have touchpad and/or keyboard issues 610 + * after suspend fixable with nomux + reset + noloop + nopnp. Luckily, 611 + * none of them have an external PS/2 port so this can safely be set for 612 + * all of them. These two are based on a Clevo design, but have the 613 + * board_name changed. 614 + */ 615 + { 616 + .matches = { 617 + DMI_MATCH(DMI_BOARD_VENDOR, "TUXEDO"), 618 + DMI_MATCH(DMI_BOARD_NAME, "AURA1501"), 619 + }, 620 + .driver_data = (void *)(SERIO_QUIRK_NOMUX | SERIO_QUIRK_RESET_ALWAYS | 621 + SERIO_QUIRK_NOLOOP | SERIO_QUIRK_NOPNP) 1065 622 }, 1066 623 { 1067 624 .matches = { 1068 - DMI_MATCH(DMI_SYS_VENDOR, "Acer"), 1069 - DMI_MATCH(DMI_PRODUCT_NAME, "Aspire ES1-132"), 625 + DMI_MATCH(DMI_BOARD_VENDOR, "TUXEDO"), 626 + DMI_MATCH(DMI_BOARD_NAME, "EDUBOOK1502"), 1070 627 }, 1071 - }, 1072 - { 1073 - .matches = { 1074 - DMI_MATCH(DMI_SYS_VENDOR, "Acer"), 1075 - DMI_MATCH(DMI_PRODUCT_NAME, "Aspire ES1-332"), 1076 - }, 1077 - }, 1078 - { 1079 - .matches = { 1080 - DMI_MATCH(DMI_SYS_VENDOR, "Acer"), 1081 - DMI_MATCH(DMI_PRODUCT_NAME, "Aspire ES1-432"), 1082 - }, 1083 - }, 1084 - { 1085 - .matches = { 1086 - DMI_MATCH(DMI_SYS_VENDOR, "Acer"), 1087 - DMI_MATCH(DMI_PRODUCT_NAME, "TravelMate Spin B118-RN"), 1088 - }, 1089 - }, 1090 - { 1091 - /* Advent 4211 */ 1092 - .matches = { 1093 - DMI_MATCH(DMI_SYS_VENDOR, "DIXONSXP"), 1094 - DMI_MATCH(DMI_PRODUCT_NAME, "Advent 4211"), 1095 - }, 1096 - }, 1097 - { 1098 - /* Medion Akoya Mini E1210 */ 1099 - .matches = { 1100 - DMI_MATCH(DMI_SYS_VENDOR, "MEDION"), 1101 - DMI_MATCH(DMI_PRODUCT_NAME, "E1210"), 1102 - }, 1103 - }, 1104 - { 1105 - /* Medion Akoya E1222 */ 1106 - .matches = { 1107 - DMI_MATCH(DMI_SYS_VENDOR, "MEDION"), 1108 - DMI_MATCH(DMI_PRODUCT_NAME, "E122X"), 1109 - }, 628 + .driver_data = (void *)(SERIO_QUIRK_NOMUX | SERIO_QUIRK_RESET_ALWAYS | 629 + SERIO_QUIRK_NOLOOP | SERIO_QUIRK_NOPNP) 1110 630 }, 1111 631 { 1112 632 /* Mivvy M310 */ ··· 1054 694 DMI_MATCH(DMI_SYS_VENDOR, "VIOOO"), 1055 695 DMI_MATCH(DMI_PRODUCT_NAME, "N10"), 1056 696 }, 697 + .driver_data = (void *)(SERIO_QUIRK_RESET_ALWAYS) 698 + }, 699 + /* 700 + * Some laptops need keyboard reset before probing for the trackpad to get 701 + * it detected, initialised & finally work. 702 + */ 703 + { 704 + /* Schenker XMG C504 - Elantech touchpad */ 705 + .matches = { 706 + DMI_MATCH(DMI_SYS_VENDOR, "XMG"), 707 + DMI_MATCH(DMI_PRODUCT_NAME, "C504"), 708 + }, 709 + .driver_data = (void *)(SERIO_QUIRK_KBDRESET) 1057 710 }, 1058 711 { 1059 - /* Dell Vostro 1320 */ 712 + /* Blue FB5601 */ 1060 713 .matches = { 1061 - DMI_MATCH(DMI_SYS_VENDOR, "Dell Inc."), 1062 - DMI_MATCH(DMI_PRODUCT_NAME, "Vostro 1320"), 714 + DMI_MATCH(DMI_SYS_VENDOR, "blue"), 715 + DMI_MATCH(DMI_PRODUCT_NAME, "FB5601"), 716 + DMI_MATCH(DMI_PRODUCT_VERSION, "M606"), 1063 717 }, 718 + .driver_data = (void *)(SERIO_QUIRK_NOLOOP) 719 + }, 720 + /* 721 + * A lot of modern Clevo barebones have touchpad and/or keyboard issues 722 + * after suspend fixable with nomux + reset + noloop + nopnp. Luckily, 723 + * none of them have an external PS/2 port so this can safely be set for 724 + * all of them. 725 + * Clevo barebones come with board_vendor and/or system_vendor set to 726 + * either the very generic string "Notebook" and/or a different value 727 + * for each individual reseller. The only somewhat universal way to 728 + * identify them is by board_name. 729 + */ 730 + { 731 + .matches = { 732 + DMI_MATCH(DMI_BOARD_NAME, "LAPQC71A"), 733 + }, 734 + .driver_data = (void *)(SERIO_QUIRK_NOMUX | SERIO_QUIRK_RESET_ALWAYS | 735 + SERIO_QUIRK_NOLOOP | SERIO_QUIRK_NOPNP) 1064 736 }, 1065 737 { 1066 - /* Dell Vostro 1520 */ 1067 738 .matches = { 1068 - DMI_MATCH(DMI_SYS_VENDOR, "Dell Inc."), 1069 - DMI_MATCH(DMI_PRODUCT_NAME, "Vostro 1520"), 739 + DMI_MATCH(DMI_BOARD_NAME, "LAPQC71B"), 1070 740 }, 741 + .driver_data = (void *)(SERIO_QUIRK_NOMUX | SERIO_QUIRK_RESET_ALWAYS | 742 + SERIO_QUIRK_NOLOOP | SERIO_QUIRK_NOPNP) 1071 743 }, 1072 744 { 1073 - /* Dell Vostro 1720 */ 1074 745 .matches = { 1075 - DMI_MATCH(DMI_SYS_VENDOR, "Dell Inc."), 1076 - DMI_MATCH(DMI_PRODUCT_NAME, "Vostro 1720"), 746 + DMI_MATCH(DMI_BOARD_NAME, "N140CU"), 1077 747 }, 748 + .driver_data = (void *)(SERIO_QUIRK_NOMUX | SERIO_QUIRK_RESET_ALWAYS | 749 + SERIO_QUIRK_NOLOOP | SERIO_QUIRK_NOPNP) 1078 750 }, 1079 751 { 1080 - /* Lenovo Ideapad U455 */ 1081 752 .matches = { 1082 - DMI_MATCH(DMI_SYS_VENDOR, "LENOVO"), 1083 - DMI_MATCH(DMI_PRODUCT_NAME, "20046"), 753 + DMI_MATCH(DMI_BOARD_NAME, "N141CU"), 1084 754 }, 755 + .driver_data = (void *)(SERIO_QUIRK_NOMUX | SERIO_QUIRK_RESET_ALWAYS | 756 + SERIO_QUIRK_NOLOOP | SERIO_QUIRK_NOPNP) 1085 757 }, 1086 758 { 1087 - /* Lenovo ThinkPad L460 */ 1088 759 .matches = { 1089 - DMI_MATCH(DMI_SYS_VENDOR, "LENOVO"), 1090 - DMI_MATCH(DMI_PRODUCT_VERSION, "ThinkPad L460"), 760 + DMI_MATCH(DMI_BOARD_NAME, "NH5xAx"), 1091 761 }, 762 + .driver_data = (void *)(SERIO_QUIRK_NOMUX | SERIO_QUIRK_RESET_ALWAYS | 763 + SERIO_QUIRK_NOLOOP | SERIO_QUIRK_NOPNP) 764 + }, 765 + { 766 + .matches = { 767 + DMI_MATCH(DMI_BOARD_NAME, "NL5xRU"), 768 + }, 769 + .driver_data = (void *)(SERIO_QUIRK_NOMUX | SERIO_QUIRK_RESET_ALWAYS | 770 + SERIO_QUIRK_NOLOOP | SERIO_QUIRK_NOPNP) 771 + }, 772 + /* 773 + * At least one modern Clevo barebone has the touchpad connected both 774 + * via PS/2 and i2c interface. This causes a race condition between the 775 + * psmouse and i2c-hid driver. Since the full capability of the touchpad 776 + * is available via the i2c interface and the device has no external 777 + * PS/2 port, it is safe to just ignore all ps2 mouses here to avoid 778 + * this issue. The known affected device is the 779 + * TUXEDO InfinityBook S17 Gen6 / Clevo NS70MU which comes with one of 780 + * the two different dmi strings below. NS50MU is not a typo! 781 + */ 782 + { 783 + .matches = { 784 + DMI_MATCH(DMI_BOARD_NAME, "NS50MU"), 785 + }, 786 + .driver_data = (void *)(SERIO_QUIRK_NOAUX | SERIO_QUIRK_NOMUX | 787 + SERIO_QUIRK_RESET_ALWAYS | SERIO_QUIRK_NOLOOP | 788 + SERIO_QUIRK_NOPNP) 789 + }, 790 + { 791 + .matches = { 792 + DMI_MATCH(DMI_BOARD_NAME, "NS50_70MU"), 793 + }, 794 + .driver_data = (void *)(SERIO_QUIRK_NOAUX | SERIO_QUIRK_NOMUX | 795 + SERIO_QUIRK_RESET_ALWAYS | SERIO_QUIRK_NOLOOP | 796 + SERIO_QUIRK_NOPNP) 797 + }, 798 + { 799 + .matches = { 800 + DMI_MATCH(DMI_BOARD_NAME, "NJ50_70CU"), 801 + }, 802 + .driver_data = (void *)(SERIO_QUIRK_NOMUX | SERIO_QUIRK_RESET_ALWAYS | 803 + SERIO_QUIRK_NOLOOP | SERIO_QUIRK_NOPNP) 804 + }, 805 + { 806 + /* 807 + * This is only a partial board_name and might be followed by 808 + * another letter or number. DMI_MATCH however does do partial 809 + * matching. 810 + */ 811 + .matches = { 812 + DMI_MATCH(DMI_PRODUCT_NAME, "P65xH"), 813 + }, 814 + .driver_data = (void *)(SERIO_QUIRK_NOMUX | SERIO_QUIRK_RESET_ALWAYS | 815 + SERIO_QUIRK_NOLOOP | SERIO_QUIRK_NOPNP) 1092 816 }, 1093 817 { 1094 818 /* Clevo P650RS, 650RP6, Sager NP8152-S, and others */ 1095 819 .matches = { 1096 - DMI_MATCH(DMI_SYS_VENDOR, "Notebook"), 1097 820 DMI_MATCH(DMI_PRODUCT_NAME, "P65xRP"), 1098 821 }, 822 + .driver_data = (void *)(SERIO_QUIRK_NOMUX | SERIO_QUIRK_RESET_ALWAYS | 823 + SERIO_QUIRK_NOLOOP | SERIO_QUIRK_NOPNP) 1099 824 }, 1100 825 { 1101 - /* Lenovo ThinkPad Twist S230u */ 826 + /* 827 + * This is only a partial board_name and might be followed by 828 + * another letter or number. DMI_MATCH however does do partial 829 + * matching. 830 + */ 1102 831 .matches = { 1103 - DMI_MATCH(DMI_SYS_VENDOR, "LENOVO"), 1104 - DMI_MATCH(DMI_PRODUCT_NAME, "33474HU"), 832 + DMI_MATCH(DMI_PRODUCT_NAME, "P65_P67H"), 1105 833 }, 834 + .driver_data = (void *)(SERIO_QUIRK_NOMUX | SERIO_QUIRK_RESET_ALWAYS | 835 + SERIO_QUIRK_NOLOOP | SERIO_QUIRK_NOPNP) 1106 836 }, 1107 837 { 1108 - /* Entroware Proteus */ 838 + /* 839 + * This is only a partial board_name and might be followed by 840 + * another letter or number. DMI_MATCH however does do partial 841 + * matching. 842 + */ 1109 843 .matches = { 1110 - DMI_MATCH(DMI_SYS_VENDOR, "Entroware"), 1111 - DMI_MATCH(DMI_PRODUCT_NAME, "Proteus"), 1112 - DMI_MATCH(DMI_PRODUCT_VERSION, "EL07R4"), 844 + DMI_MATCH(DMI_PRODUCT_NAME, "P65_67RP"), 1113 845 }, 846 + .driver_data = (void *)(SERIO_QUIRK_NOMUX | SERIO_QUIRK_RESET_ALWAYS | 847 + SERIO_QUIRK_NOLOOP | SERIO_QUIRK_NOPNP) 848 + }, 849 + { 850 + /* 851 + * This is only a partial board_name and might be followed by 852 + * another letter or number. DMI_MATCH however does do partial 853 + * matching. 854 + */ 855 + .matches = { 856 + DMI_MATCH(DMI_PRODUCT_NAME, "P65_67RS"), 857 + }, 858 + .driver_data = (void *)(SERIO_QUIRK_NOMUX | SERIO_QUIRK_RESET_ALWAYS | 859 + SERIO_QUIRK_NOLOOP | SERIO_QUIRK_NOPNP) 860 + }, 861 + { 862 + /* 863 + * This is only a partial board_name and might be followed by 864 + * another letter or number. DMI_MATCH however does do partial 865 + * matching. 866 + */ 867 + .matches = { 868 + DMI_MATCH(DMI_PRODUCT_NAME, "P67xRP"), 869 + }, 870 + .driver_data = (void *)(SERIO_QUIRK_NOMUX | SERIO_QUIRK_RESET_ALWAYS | 871 + SERIO_QUIRK_NOLOOP | SERIO_QUIRK_NOPNP) 872 + }, 873 + { 874 + .matches = { 875 + DMI_MATCH(DMI_BOARD_NAME, "PB50_70DFx,DDx"), 876 + }, 877 + .driver_data = (void *)(SERIO_QUIRK_NOMUX | SERIO_QUIRK_RESET_ALWAYS | 878 + SERIO_QUIRK_NOLOOP | SERIO_QUIRK_NOPNP) 879 + }, 880 + { 881 + .matches = { 882 + DMI_MATCH(DMI_BOARD_NAME, "X170SM"), 883 + }, 884 + .driver_data = (void *)(SERIO_QUIRK_NOMUX | SERIO_QUIRK_RESET_ALWAYS | 885 + SERIO_QUIRK_NOLOOP | SERIO_QUIRK_NOPNP) 886 + }, 887 + { 888 + .matches = { 889 + DMI_MATCH(DMI_BOARD_NAME, "X170KM-G"), 890 + }, 891 + .driver_data = (void *)(SERIO_QUIRK_NOMUX | SERIO_QUIRK_RESET_ALWAYS | 892 + SERIO_QUIRK_NOLOOP | SERIO_QUIRK_NOPNP) 1114 893 }, 1115 894 { } 1116 895 }; 1117 896 1118 897 #ifdef CONFIG_PNP 1119 - static const struct dmi_system_id __initconst i8042_dmi_nopnp_table[] = { 1120 - { 1121 - /* Intel MBO Desktop D845PESV */ 1122 - .matches = { 1123 - DMI_MATCH(DMI_BOARD_NAME, "D845PESV"), 1124 - DMI_MATCH(DMI_BOARD_VENDOR, "Intel Corporation"), 1125 - }, 1126 - }, 1127 - { 1128 - /* 1129 - * Intel NUC D54250WYK - does not have i8042 controller but 1130 - * declares PS/2 devices in DSDT. 1131 - */ 1132 - .matches = { 1133 - DMI_MATCH(DMI_BOARD_NAME, "D54250WYK"), 1134 - DMI_MATCH(DMI_BOARD_VENDOR, "Intel Corporation"), 1135 - }, 1136 - }, 1137 - { 1138 - /* MSI Wind U-100 */ 1139 - .matches = { 1140 - DMI_MATCH(DMI_BOARD_NAME, "U-100"), 1141 - DMI_MATCH(DMI_BOARD_VENDOR, "MICRO-STAR INTERNATIONAL CO., LTD"), 1142 - }, 1143 - }, 1144 - { 1145 - /* Acer Aspire 5 A515 */ 1146 - .matches = { 1147 - DMI_MATCH(DMI_BOARD_NAME, "Grumpy_PK"), 1148 - DMI_MATCH(DMI_BOARD_VENDOR, "PK"), 1149 - }, 1150 - }, 1151 - { } 1152 - }; 1153 - 1154 - static const struct dmi_system_id __initconst i8042_dmi_laptop_table[] = { 898 + static const struct dmi_system_id i8042_dmi_laptop_table[] __initconst = { 1155 899 { 1156 900 .matches = { 1157 901 DMI_MATCH(DMI_CHASSIS_TYPE, "8"), /* Portable */ ··· 1279 815 { } 1280 816 }; 1281 817 #endif 1282 - 1283 - static const struct dmi_system_id __initconst i8042_dmi_notimeout_table[] = { 1284 - { 1285 - /* Dell Vostro V13 */ 1286 - .matches = { 1287 - DMI_MATCH(DMI_SYS_VENDOR, "Dell Inc."), 1288 - DMI_MATCH(DMI_PRODUCT_NAME, "Vostro V13"), 1289 - }, 1290 - }, 1291 - { 1292 - /* Newer HP Pavilion dv4 models */ 1293 - .matches = { 1294 - DMI_MATCH(DMI_SYS_VENDOR, "Hewlett-Packard"), 1295 - DMI_MATCH(DMI_PRODUCT_NAME, "HP Pavilion dv4 Notebook PC"), 1296 - }, 1297 - }, 1298 - { 1299 - /* Fujitsu A544 laptop */ 1300 - /* https://bugzilla.redhat.com/show_bug.cgi?id=1111138 */ 1301 - .matches = { 1302 - DMI_MATCH(DMI_SYS_VENDOR, "FUJITSU"), 1303 - DMI_MATCH(DMI_PRODUCT_NAME, "LIFEBOOK A544"), 1304 - }, 1305 - }, 1306 - { 1307 - /* Fujitsu AH544 laptop */ 1308 - /* https://bugzilla.kernel.org/show_bug.cgi?id=69731 */ 1309 - .matches = { 1310 - DMI_MATCH(DMI_SYS_VENDOR, "FUJITSU"), 1311 - DMI_MATCH(DMI_PRODUCT_NAME, "LIFEBOOK AH544"), 1312 - }, 1313 - }, 1314 - { 1315 - /* Fujitsu Lifebook T725 laptop */ 1316 - .matches = { 1317 - DMI_MATCH(DMI_SYS_VENDOR, "FUJITSU"), 1318 - DMI_MATCH(DMI_PRODUCT_NAME, "LIFEBOOK T725"), 1319 - }, 1320 - }, 1321 - { 1322 - /* Fujitsu U574 laptop */ 1323 - /* https://bugzilla.kernel.org/show_bug.cgi?id=69731 */ 1324 - .matches = { 1325 - DMI_MATCH(DMI_SYS_VENDOR, "FUJITSU"), 1326 - DMI_MATCH(DMI_PRODUCT_NAME, "LIFEBOOK U574"), 1327 - }, 1328 - }, 1329 - { 1330 - /* Fujitsu UH554 laptop */ 1331 - .matches = { 1332 - DMI_MATCH(DMI_SYS_VENDOR, "FUJITSU"), 1333 - DMI_MATCH(DMI_PRODUCT_NAME, "LIFEBOOK UH544"), 1334 - }, 1335 - }, 1336 - { } 1337 - }; 1338 - 1339 - /* 1340 - * Some Wistron based laptops need us to explicitly enable the 'Dritek 1341 - * keyboard extension' to make their extra keys start generating scancodes. 1342 - * Originally, this was just confined to older laptops, but a few Acer laptops 1343 - * have turned up in 2007 that also need this again. 1344 - */ 1345 - static const struct dmi_system_id __initconst i8042_dmi_dritek_table[] = { 1346 - { 1347 - /* Acer Aspire 5100 */ 1348 - .matches = { 1349 - DMI_MATCH(DMI_SYS_VENDOR, "Acer"), 1350 - DMI_MATCH(DMI_PRODUCT_NAME, "Aspire 5100"), 1351 - }, 1352 - }, 1353 - { 1354 - /* Acer Aspire 5610 */ 1355 - .matches = { 1356 - DMI_MATCH(DMI_SYS_VENDOR, "Acer"), 1357 - DMI_MATCH(DMI_PRODUCT_NAME, "Aspire 5610"), 1358 - }, 1359 - }, 1360 - { 1361 - /* Acer Aspire 5630 */ 1362 - .matches = { 1363 - DMI_MATCH(DMI_SYS_VENDOR, "Acer"), 1364 - DMI_MATCH(DMI_PRODUCT_NAME, "Aspire 5630"), 1365 - }, 1366 - }, 1367 - { 1368 - /* Acer Aspire 5650 */ 1369 - .matches = { 1370 - DMI_MATCH(DMI_SYS_VENDOR, "Acer"), 1371 - DMI_MATCH(DMI_PRODUCT_NAME, "Aspire 5650"), 1372 - }, 1373 - }, 1374 - { 1375 - /* Acer Aspire 5680 */ 1376 - .matches = { 1377 - DMI_MATCH(DMI_SYS_VENDOR, "Acer"), 1378 - DMI_MATCH(DMI_PRODUCT_NAME, "Aspire 5680"), 1379 - }, 1380 - }, 1381 - { 1382 - /* Acer Aspire 5720 */ 1383 - .matches = { 1384 - DMI_MATCH(DMI_SYS_VENDOR, "Acer"), 1385 - DMI_MATCH(DMI_PRODUCT_NAME, "Aspire 5720"), 1386 - }, 1387 - }, 1388 - { 1389 - /* Acer Aspire 9110 */ 1390 - .matches = { 1391 - DMI_MATCH(DMI_SYS_VENDOR, "Acer"), 1392 - DMI_MATCH(DMI_PRODUCT_NAME, "Aspire 9110"), 1393 - }, 1394 - }, 1395 - { 1396 - /* Acer TravelMate 660 */ 1397 - .matches = { 1398 - DMI_MATCH(DMI_SYS_VENDOR, "Acer"), 1399 - DMI_MATCH(DMI_PRODUCT_NAME, "TravelMate 660"), 1400 - }, 1401 - }, 1402 - { 1403 - /* Acer TravelMate 2490 */ 1404 - .matches = { 1405 - DMI_MATCH(DMI_SYS_VENDOR, "Acer"), 1406 - DMI_MATCH(DMI_PRODUCT_NAME, "TravelMate 2490"), 1407 - }, 1408 - }, 1409 - { 1410 - /* Acer TravelMate 4280 */ 1411 - .matches = { 1412 - DMI_MATCH(DMI_SYS_VENDOR, "Acer"), 1413 - DMI_MATCH(DMI_PRODUCT_NAME, "TravelMate 4280"), 1414 - }, 1415 - }, 1416 - { } 1417 - }; 1418 - 1419 - /* 1420 - * Some laptops need keyboard reset before probing for the trackpad to get 1421 - * it detected, initialised & finally work. 1422 - */ 1423 - static const struct dmi_system_id __initconst i8042_dmi_kbdreset_table[] = { 1424 - { 1425 - /* Gigabyte P35 v2 - Elantech touchpad */ 1426 - .matches = { 1427 - DMI_MATCH(DMI_SYS_VENDOR, "GIGABYTE"), 1428 - DMI_MATCH(DMI_PRODUCT_NAME, "P35V2"), 1429 - }, 1430 - }, 1431 - { 1432 - /* Aorus branded Gigabyte X3 Plus - Elantech touchpad */ 1433 - .matches = { 1434 - DMI_MATCH(DMI_SYS_VENDOR, "GIGABYTE"), 1435 - DMI_MATCH(DMI_PRODUCT_NAME, "X3"), 1436 - }, 1437 - }, 1438 - { 1439 - /* Gigabyte P34 - Elantech touchpad */ 1440 - .matches = { 1441 - DMI_MATCH(DMI_SYS_VENDOR, "GIGABYTE"), 1442 - DMI_MATCH(DMI_PRODUCT_NAME, "P34"), 1443 - }, 1444 - }, 1445 - { 1446 - /* Gigabyte P57 - Elantech touchpad */ 1447 - .matches = { 1448 - DMI_MATCH(DMI_SYS_VENDOR, "GIGABYTE"), 1449 - DMI_MATCH(DMI_PRODUCT_NAME, "P57"), 1450 - }, 1451 - }, 1452 - { 1453 - /* Schenker XMG C504 - Elantech touchpad */ 1454 - .matches = { 1455 - DMI_MATCH(DMI_SYS_VENDOR, "XMG"), 1456 - DMI_MATCH(DMI_PRODUCT_NAME, "C504"), 1457 - }, 1458 - }, 1459 - { } 1460 - }; 1461 - 1462 - static const struct dmi_system_id i8042_dmi_probe_defer_table[] __initconst = { 1463 - { 1464 - /* ASUS ZenBook UX425UA */ 1465 - .matches = { 1466 - DMI_MATCH(DMI_SYS_VENDOR, "ASUSTeK COMPUTER INC."), 1467 - DMI_MATCH(DMI_PRODUCT_NAME, "ZenBook UX425UA"), 1468 - }, 1469 - }, 1470 - { 1471 - /* ASUS ZenBook UM325UA */ 1472 - .matches = { 1473 - DMI_MATCH(DMI_SYS_VENDOR, "ASUSTeK COMPUTER INC."), 1474 - DMI_MATCH(DMI_PRODUCT_NAME, "ZenBook UX325UA_UM325UA"), 1475 - }, 1476 - }, 1477 - { } 1478 - }; 1479 818 1480 819 #endif /* CONFIG_X86 */ 1481 820 ··· 1434 1167 bool pnp_data_busted = false; 1435 1168 int err; 1436 1169 1437 - #ifdef CONFIG_X86 1438 - if (dmi_check_system(i8042_dmi_nopnp_table)) 1439 - i8042_nopnp = true; 1440 - #endif 1441 - 1442 1170 if (i8042_nopnp) { 1443 1171 pr_info("PNP detection disabled\n"); 1444 1172 return 0; ··· 1537 1275 static inline void i8042_pnp_exit(void) { } 1538 1276 #endif /* CONFIG_PNP */ 1539 1277 1278 + 1279 + #ifdef CONFIG_X86 1280 + static void __init i8042_check_quirks(void) 1281 + { 1282 + const struct dmi_system_id *device_quirk_info; 1283 + uintptr_t quirks; 1284 + 1285 + device_quirk_info = dmi_first_match(i8042_dmi_quirk_table); 1286 + if (!device_quirk_info) 1287 + return; 1288 + 1289 + quirks = (uintptr_t)device_quirk_info->driver_data; 1290 + 1291 + if (quirks & SERIO_QUIRK_NOKBD) 1292 + i8042_nokbd = true; 1293 + if (quirks & SERIO_QUIRK_NOAUX) 1294 + i8042_noaux = true; 1295 + if (quirks & SERIO_QUIRK_NOMUX) 1296 + i8042_nomux = true; 1297 + if (quirks & SERIO_QUIRK_FORCEMUX) 1298 + i8042_nomux = false; 1299 + if (quirks & SERIO_QUIRK_UNLOCK) 1300 + i8042_unlock = true; 1301 + if (quirks & SERIO_QUIRK_PROBE_DEFER) 1302 + i8042_probe_defer = true; 1303 + /* Honor module parameter when value is not default */ 1304 + if (i8042_reset == I8042_RESET_DEFAULT) { 1305 + if (quirks & SERIO_QUIRK_RESET_ALWAYS) 1306 + i8042_reset = I8042_RESET_ALWAYS; 1307 + if (quirks & SERIO_QUIRK_RESET_NEVER) 1308 + i8042_reset = I8042_RESET_NEVER; 1309 + } 1310 + if (quirks & SERIO_QUIRK_DIECT) 1311 + i8042_direct = true; 1312 + if (quirks & SERIO_QUIRK_DUMBKBD) 1313 + i8042_dumbkbd = true; 1314 + if (quirks & SERIO_QUIRK_NOLOOP) 1315 + i8042_noloop = true; 1316 + if (quirks & SERIO_QUIRK_NOTIMEOUT) 1317 + i8042_notimeout = true; 1318 + if (quirks & SERIO_QUIRK_KBDRESET) 1319 + i8042_kbdreset = true; 1320 + if (quirks & SERIO_QUIRK_DRITEK) 1321 + i8042_dritek = true; 1322 + #ifdef CONFIG_PNP 1323 + if (quirks & SERIO_QUIRK_NOPNP) 1324 + i8042_nopnp = true; 1325 + #endif 1326 + } 1327 + #else 1328 + static inline void i8042_check_quirks(void) {} 1329 + #endif 1330 + 1540 1331 static int __init i8042_platform_init(void) 1541 1332 { 1542 1333 int retval; ··· 1612 1297 i8042_kbd_irq = I8042_MAP_IRQ(1); 1613 1298 i8042_aux_irq = I8042_MAP_IRQ(12); 1614 1299 1300 + #if defined(__ia64__) 1301 + i8042_reset = I8042_RESET_ALWAYS; 1302 + #endif 1303 + 1304 + i8042_check_quirks(); 1305 + 1306 + pr_debug("Active quirks (empty means none):%s%s%s%s%s%s%s%s%s%s%s%s%s\n", 1307 + i8042_nokbd ? " nokbd" : "", 1308 + i8042_noaux ? " noaux" : "", 1309 + i8042_nomux ? " nomux" : "", 1310 + i8042_unlock ? " unlock" : "", 1311 + i8042_probe_defer ? "probe_defer" : "", 1312 + i8042_reset == I8042_RESET_DEFAULT ? 1313 + "" : i8042_reset == I8042_RESET_ALWAYS ? 1314 + " reset_always" : " reset_never", 1315 + i8042_direct ? " direct" : "", 1316 + i8042_dumbkbd ? " dumbkbd" : "", 1317 + i8042_noloop ? " noloop" : "", 1318 + i8042_notimeout ? " notimeout" : "", 1319 + i8042_kbdreset ? " kbdreset" : "", 1320 + #ifdef CONFIG_X86 1321 + i8042_dritek ? " dritek" : "", 1322 + #else 1323 + "", 1324 + #endif 1325 + #ifdef CONFIG_PNP 1326 + i8042_nopnp ? " nopnp" : ""); 1327 + #else 1328 + ""); 1329 + #endif 1330 + 1615 1331 retval = i8042_pnp_init(); 1616 1332 if (retval) 1617 1333 return retval; 1618 1334 1619 - #if defined(__ia64__) 1620 - i8042_reset = I8042_RESET_ALWAYS; 1621 - #endif 1622 - 1623 1335 #ifdef CONFIG_X86 1624 - /* Honor module parameter when value is not default */ 1625 - if (i8042_reset == I8042_RESET_DEFAULT) { 1626 - if (dmi_check_system(i8042_dmi_reset_table)) 1627 - i8042_reset = I8042_RESET_ALWAYS; 1628 - 1629 - if (dmi_check_system(i8042_dmi_noselftest_table)) 1630 - i8042_reset = I8042_RESET_NEVER; 1631 - } 1632 - 1633 - if (dmi_check_system(i8042_dmi_noloop_table)) 1634 - i8042_noloop = true; 1635 - 1636 - if (dmi_check_system(i8042_dmi_nomux_table)) 1637 - i8042_nomux = true; 1638 - 1639 - if (dmi_check_system(i8042_dmi_forcemux_table)) 1640 - i8042_nomux = false; 1641 - 1642 - if (dmi_check_system(i8042_dmi_notimeout_table)) 1643 - i8042_notimeout = true; 1644 - 1645 - if (dmi_check_system(i8042_dmi_dritek_table)) 1646 - i8042_dritek = true; 1647 - 1648 - if (dmi_check_system(i8042_dmi_kbdreset_table)) 1649 - i8042_kbdreset = true; 1650 - 1651 - if (dmi_check_system(i8042_dmi_probe_defer_table)) 1652 - i8042_probe_defer = true; 1653 - 1654 1336 /* 1655 1337 * A20 was already enabled during early kernel init. But some buggy 1656 1338 * BIOSes (in MSI Laptops) require A20 to be enabled using 8042 to
+88 -8
drivers/input/touchscreen/edt-ft5x06.c
··· 24 24 #include <linux/irq.h> 25 25 #include <linux/kernel.h> 26 26 #include <linux/module.h> 27 + #include <linux/property.h> 27 28 #include <linux/ratelimit.h> 28 29 #include <linux/regulator/consumer.h> 29 30 #include <linux/slab.h> ··· 47 46 #define M09_REGISTER_OFFSET 0x93 48 47 #define M09_REGISTER_NUM_X 0x94 49 48 #define M09_REGISTER_NUM_Y 0x95 49 + 50 + #define M12_REGISTER_REPORT_RATE 0x88 50 51 51 52 #define EV_REGISTER_THRESHOLD 0x40 52 53 #define EV_REGISTER_GAIN 0x41 ··· 130 127 int max_support_points; 131 128 132 129 char name[EDT_NAME_LEN]; 130 + char fw_version[EDT_NAME_LEN]; 133 131 134 132 struct edt_reg_addr reg_addr; 135 133 enum edt_ver version; 134 + unsigned int crc_errors; 135 + unsigned int header_errors; 136 136 }; 137 137 138 138 struct edt_i2c_chip_data { ··· 184 178 crc ^= buf[i]; 185 179 186 180 if (crc != buf[buflen-1]) { 181 + tsdata->crc_errors++; 187 182 dev_err_ratelimited(&tsdata->client->dev, 188 183 "crc error: 0x%02x expected, got 0x%02x\n", 189 184 crc, buf[buflen-1]); ··· 242 235 if (tsdata->version == EDT_M06) { 243 236 if (rdbuf[0] != 0xaa || rdbuf[1] != 0xaa || 244 237 rdbuf[2] != datalen) { 238 + tsdata->header_errors++; 245 239 dev_err_ratelimited(dev, 246 240 "Unexpected header: %02x%02x%02x!\n", 247 241 rdbuf[0], rdbuf[1], rdbuf[2]); ··· 531 523 /* m06: range 20 to 80, m09: range 0 to 30, m12: range 1 to 255... */ 532 524 static EDT_ATTR(threshold, S_IWUSR | S_IRUGO, WORK_REGISTER_THRESHOLD, 533 525 M09_REGISTER_THRESHOLD, EV_REGISTER_THRESHOLD, 0, 255); 534 - /* m06: range 3 to 14, m12: (0x64: 100Hz) */ 526 + /* m06: range 3 to 14, m12: range 1 to 255 */ 535 527 static EDT_ATTR(report_rate, S_IWUSR | S_IRUGO, WORK_REGISTER_REPORT_RATE, 536 - NO_REGISTER, NO_REGISTER, 0, 255); 528 + M12_REGISTER_REPORT_RATE, NO_REGISTER, 0, 255); 529 + 530 + static ssize_t model_show(struct device *dev, struct device_attribute *attr, 531 + char *buf) 532 + { 533 + struct i2c_client *client = to_i2c_client(dev); 534 + struct edt_ft5x06_ts_data *tsdata = i2c_get_clientdata(client); 535 + 536 + return sysfs_emit(buf, "%s\n", tsdata->name); 537 + } 538 + 539 + static DEVICE_ATTR_RO(model); 540 + 541 + static ssize_t fw_version_show(struct device *dev, 542 + struct device_attribute *attr, char *buf) 543 + { 544 + struct i2c_client *client = to_i2c_client(dev); 545 + struct edt_ft5x06_ts_data *tsdata = i2c_get_clientdata(client); 546 + 547 + return sysfs_emit(buf, "%s\n", tsdata->fw_version); 548 + } 549 + 550 + static DEVICE_ATTR_RO(fw_version); 551 + 552 + /* m06 only */ 553 + static ssize_t header_errors_show(struct device *dev, 554 + struct device_attribute *attr, char *buf) 555 + { 556 + struct i2c_client *client = to_i2c_client(dev); 557 + struct edt_ft5x06_ts_data *tsdata = i2c_get_clientdata(client); 558 + 559 + return sysfs_emit(buf, "%d\n", tsdata->header_errors); 560 + } 561 + 562 + static DEVICE_ATTR_RO(header_errors); 563 + 564 + /* m06 only */ 565 + static ssize_t crc_errors_show(struct device *dev, 566 + struct device_attribute *attr, char *buf) 567 + { 568 + struct i2c_client *client = to_i2c_client(dev); 569 + struct edt_ft5x06_ts_data *tsdata = i2c_get_clientdata(client); 570 + 571 + return sysfs_emit(buf, "%d\n", tsdata->crc_errors); 572 + } 573 + 574 + static DEVICE_ATTR_RO(crc_errors); 537 575 538 576 static struct attribute *edt_ft5x06_attrs[] = { 539 577 &edt_ft5x06_attr_gain.dattr.attr, ··· 588 534 &edt_ft5x06_attr_offset_y.dattr.attr, 589 535 &edt_ft5x06_attr_threshold.dattr.attr, 590 536 &edt_ft5x06_attr_report_rate.dattr.attr, 537 + &dev_attr_model.attr, 538 + &dev_attr_fw_version.attr, 539 + &dev_attr_header_errors.attr, 540 + &dev_attr_crc_errors.attr, 591 541 NULL 592 542 }; 593 543 ··· 878 820 #endif /* CONFIG_DEBUGFS */ 879 821 880 822 static int edt_ft5x06_ts_identify(struct i2c_client *client, 881 - struct edt_ft5x06_ts_data *tsdata, 882 - char *fw_version) 823 + struct edt_ft5x06_ts_data *tsdata) 883 824 { 884 825 u8 rdbuf[EDT_NAME_LEN]; 885 826 char *p; 886 827 int error; 887 828 char *model_name = tsdata->name; 829 + char *fw_version = tsdata->fw_version; 888 830 889 831 /* see what we find if we assume it is a M06 * 890 832 * if we get less than EDT_NAME_LEN, we don't want ··· 1088 1030 case EDT_M09: 1089 1031 case EDT_M12: 1090 1032 reg_addr->reg_threshold = M09_REGISTER_THRESHOLD; 1091 - reg_addr->reg_report_rate = NO_REGISTER; 1033 + reg_addr->reg_report_rate = tsdata->version == EDT_M12 ? 1034 + M12_REGISTER_REPORT_RATE : NO_REGISTER; 1092 1035 reg_addr->reg_gain = M09_REGISTER_GAIN; 1093 1036 reg_addr->reg_offset = M09_REGISTER_OFFSET; 1094 1037 reg_addr->reg_offset_x = NO_REGISTER; ··· 1140 1081 struct input_dev *input; 1141 1082 unsigned long irq_flags; 1142 1083 int error; 1143 - char fw_version[EDT_NAME_LEN]; 1084 + u32 report_rate; 1144 1085 1145 1086 dev_dbg(&client->dev, "probing for EDT FT5x06 I2C\n"); 1146 1087 ··· 1253 1194 tsdata->input = input; 1254 1195 tsdata->factory_mode = false; 1255 1196 1256 - error = edt_ft5x06_ts_identify(client, tsdata, fw_version); 1197 + error = edt_ft5x06_ts_identify(client, tsdata); 1257 1198 if (error) { 1258 1199 dev_err(&client->dev, "touchscreen probe failed\n"); 1259 1200 return error; ··· 1269 1210 edt_ft5x06_ts_get_defaults(&client->dev, tsdata); 1270 1211 edt_ft5x06_ts_get_parameters(tsdata); 1271 1212 1213 + if (tsdata->reg_addr.reg_report_rate != NO_REGISTER && 1214 + !device_property_read_u32(&client->dev, 1215 + "report-rate-hz", &report_rate)) { 1216 + if (tsdata->version == EDT_M06) 1217 + tsdata->report_rate = clamp_val(report_rate, 30, 140); 1218 + else 1219 + tsdata->report_rate = clamp_val(report_rate, 1, 255); 1220 + 1221 + if (report_rate != tsdata->report_rate) 1222 + dev_warn(&client->dev, 1223 + "report-rate %dHz is unsupported, use %dHz\n", 1224 + report_rate, tsdata->report_rate); 1225 + 1226 + if (tsdata->version == EDT_M06) 1227 + tsdata->report_rate /= 10; 1228 + 1229 + edt_ft5x06_register_write(tsdata, 1230 + tsdata->reg_addr.reg_report_rate, 1231 + tsdata->report_rate); 1232 + } 1233 + 1272 1234 dev_dbg(&client->dev, 1273 1235 "Model \"%s\", Rev. \"%s\", %dx%d sensors\n", 1274 - tsdata->name, fw_version, tsdata->num_x, tsdata->num_y); 1236 + tsdata->name, tsdata->fw_version, tsdata->num_x, tsdata->num_y); 1275 1237 1276 1238 input->name = tsdata->name; 1277 1239 input->id.bustype = BUS_I2C;
+4 -3
drivers/input/touchscreen/exc3000.c
··· 220 220 { 221 221 u8 buf[EXC3000_LEN_VENDOR_REQUEST] = { 0x67, 0x00, 0x42, 0x00, 0x03 }; 222 222 int ret; 223 + unsigned long time_left; 223 224 224 225 mutex_lock(&data->query_lock); 225 226 ··· 234 233 goto out_unlock; 235 234 236 235 if (response) { 237 - ret = wait_for_completion_timeout(&data->wait_event, 238 - timeout * HZ); 239 - if (ret <= 0) { 236 + time_left = wait_for_completion_timeout(&data->wait_event, 237 + timeout * HZ); 238 + if (time_left == 0) { 240 239 ret = -ETIMEDOUT; 241 240 goto out_unlock; 242 241 }
+8 -14
drivers/input/touchscreen/goodix.c
··· 822 822 struct device *dev = &ts->client->dev; 823 823 struct acpi_resource_gpio *gpio; 824 824 825 - switch (ares->type) { 826 - case ACPI_RESOURCE_TYPE_GPIO: 827 - gpio = &ares->data.gpio; 828 - if (gpio->connection_type == ACPI_RESOURCE_GPIO_TYPE_INT) { 829 - if (ts->gpio_int_idx == -1) { 830 - ts->gpio_int_idx = ts->gpio_count; 831 - } else { 832 - dev_err(dev, "More then one GpioInt resource, ignoring ACPI GPIO resources\n"); 833 - ts->gpio_int_idx = -2; 834 - } 825 + if (acpi_gpio_get_irq_resource(ares, &gpio)) { 826 + if (ts->gpio_int_idx == -1) { 827 + ts->gpio_int_idx = ts->gpio_count; 828 + } else { 829 + dev_err(dev, "More then one GpioInt resource, ignoring ACPI GPIO resources\n"); 830 + ts->gpio_int_idx = -2; 835 831 } 836 832 ts->gpio_count++; 837 - break; 838 - default: 839 - break; 840 - } 833 + } else if (acpi_gpio_get_io_resource(ares, &gpio)) 834 + ts->gpio_count++; 841 835 842 836 return 0; 843 837 }
+56 -56
drivers/input/touchscreen/zinitix.c
··· 15 15 16 16 /* Register Map */ 17 17 18 - #define BT541_SWRESET_CMD 0x0000 19 - #define BT541_WAKEUP_CMD 0x0001 18 + #define ZINITIX_SWRESET_CMD 0x0000 19 + #define ZINITIX_WAKEUP_CMD 0x0001 20 20 21 - #define BT541_IDLE_CMD 0x0004 22 - #define BT541_SLEEP_CMD 0x0005 21 + #define ZINITIX_IDLE_CMD 0x0004 22 + #define ZINITIX_SLEEP_CMD 0x0005 23 23 24 - #define BT541_CLEAR_INT_STATUS_CMD 0x0003 25 - #define BT541_CALIBRATE_CMD 0x0006 26 - #define BT541_SAVE_STATUS_CMD 0x0007 27 - #define BT541_SAVE_CALIBRATION_CMD 0x0008 28 - #define BT541_RECALL_FACTORY_CMD 0x000f 24 + #define ZINITIX_CLEAR_INT_STATUS_CMD 0x0003 25 + #define ZINITIX_CALIBRATE_CMD 0x0006 26 + #define ZINITIX_SAVE_STATUS_CMD 0x0007 27 + #define ZINITIX_SAVE_CALIBRATION_CMD 0x0008 28 + #define ZINITIX_RECALL_FACTORY_CMD 0x000f 29 29 30 - #define BT541_THRESHOLD 0x0020 30 + #define ZINITIX_THRESHOLD 0x0020 31 31 32 - #define BT541_LARGE_PALM_REJECT_AREA_TH 0x003F 32 + #define ZINITIX_LARGE_PALM_REJECT_AREA_TH 0x003F 33 33 34 - #define BT541_DEBUG_REG 0x0115 /* 0~7 */ 34 + #define ZINITIX_DEBUG_REG 0x0115 /* 0~7 */ 35 35 36 - #define BT541_TOUCH_MODE 0x0010 37 - #define BT541_CHIP_REVISION 0x0011 38 - #define BT541_FIRMWARE_VERSION 0x0012 36 + #define ZINITIX_TOUCH_MODE 0x0010 37 + #define ZINITIX_CHIP_REVISION 0x0011 38 + #define ZINITIX_FIRMWARE_VERSION 0x0012 39 39 40 40 #define ZINITIX_USB_DETECT 0x116 41 41 42 - #define BT541_MINOR_FW_VERSION 0x0121 42 + #define ZINITIX_MINOR_FW_VERSION 0x0121 43 43 44 - #define BT541_VENDOR_ID 0x001C 45 - #define BT541_HW_ID 0x0014 44 + #define ZINITIX_VENDOR_ID 0x001C 45 + #define ZINITIX_HW_ID 0x0014 46 46 47 - #define BT541_DATA_VERSION_REG 0x0013 48 - #define BT541_SUPPORTED_FINGER_NUM 0x0015 49 - #define BT541_EEPROM_INFO 0x0018 50 - #define BT541_INITIAL_TOUCH_MODE 0x0019 47 + #define ZINITIX_DATA_VERSION_REG 0x0013 48 + #define ZINITIX_SUPPORTED_FINGER_NUM 0x0015 49 + #define ZINITIX_EEPROM_INFO 0x0018 50 + #define ZINITIX_INITIAL_TOUCH_MODE 0x0019 51 51 52 - #define BT541_TOTAL_NUMBER_OF_X 0x0060 53 - #define BT541_TOTAL_NUMBER_OF_Y 0x0061 52 + #define ZINITIX_TOTAL_NUMBER_OF_X 0x0060 53 + #define ZINITIX_TOTAL_NUMBER_OF_Y 0x0061 54 54 55 - #define BT541_DELAY_RAW_FOR_HOST 0x007f 55 + #define ZINITIX_DELAY_RAW_FOR_HOST 0x007f 56 56 57 - #define BT541_BUTTON_SUPPORTED_NUM 0x00B0 58 - #define BT541_BUTTON_SENSITIVITY 0x00B2 59 - #define BT541_DUMMY_BUTTON_SENSITIVITY 0X00C8 57 + #define ZINITIX_BUTTON_SUPPORTED_NUM 0x00B0 58 + #define ZINITIX_BUTTON_SENSITIVITY 0x00B2 59 + #define ZINITIX_DUMMY_BUTTON_SENSITIVITY 0X00C8 60 60 61 - #define BT541_X_RESOLUTION 0x00C0 62 - #define BT541_Y_RESOLUTION 0x00C1 61 + #define ZINITIX_X_RESOLUTION 0x00C0 62 + #define ZINITIX_Y_RESOLUTION 0x00C1 63 63 64 - #define BT541_POINT_STATUS_REG 0x0080 65 - #define BT541_ICON_STATUS_REG 0x00AA 64 + #define ZINITIX_POINT_STATUS_REG 0x0080 65 + #define ZINITIX_ICON_STATUS_REG 0x00AA 66 66 67 - #define BT541_POINT_COORD_REG (BT541_POINT_STATUS_REG + 2) 67 + #define ZINITIX_POINT_COORD_REG (ZINITIX_POINT_STATUS_REG + 2) 68 68 69 - #define BT541_AFE_FREQUENCY 0x0100 70 - #define BT541_DND_N_COUNT 0x0122 71 - #define BT541_DND_U_COUNT 0x0135 69 + #define ZINITIX_AFE_FREQUENCY 0x0100 70 + #define ZINITIX_DND_N_COUNT 0x0122 71 + #define ZINITIX_DND_U_COUNT 0x0135 72 72 73 - #define BT541_RAWDATA_REG 0x0200 73 + #define ZINITIX_RAWDATA_REG 0x0200 74 74 75 - #define BT541_EEPROM_INFO_REG 0x0018 75 + #define ZINITIX_EEPROM_INFO_REG 0x0018 76 76 77 - #define BT541_INT_ENABLE_FLAG 0x00f0 78 - #define BT541_PERIODICAL_INTERRUPT_INTERVAL 0x00f1 77 + #define ZINITIX_INT_ENABLE_FLAG 0x00f0 78 + #define ZINITIX_PERIODICAL_INTERRUPT_INTERVAL 0x00f1 79 79 80 - #define BT541_BTN_WIDTH 0x016d 80 + #define ZINITIX_BTN_WIDTH 0x016d 81 81 82 - #define BT541_CHECKSUM_RESULT 0x012c 82 + #define ZINITIX_CHECKSUM_RESULT 0x012c 83 83 84 - #define BT541_INIT_FLASH 0x01d0 85 - #define BT541_WRITE_FLASH 0x01d1 86 - #define BT541_READ_FLASH 0x01d2 84 + #define ZINITIX_INIT_FLASH 0x01d0 85 + #define ZINITIX_WRITE_FLASH 0x01d1 86 + #define ZINITIX_READ_FLASH 0x01d2 87 87 88 88 #define ZINITIX_INTERNAL_FLAG_02 0x011e 89 89 #define ZINITIX_INTERNAL_FLAG_03 0x011f ··· 196 196 int i; 197 197 int error; 198 198 199 - error = zinitix_write_cmd(client, BT541_SWRESET_CMD); 199 + error = zinitix_write_cmd(client, ZINITIX_SWRESET_CMD); 200 200 if (error) { 201 201 dev_err(&client->dev, "Failed to write reset command\n"); 202 202 return error; 203 203 } 204 204 205 - error = zinitix_write_u16(client, BT541_INT_ENABLE_FLAG, 0x0); 205 + error = zinitix_write_u16(client, ZINITIX_INT_ENABLE_FLAG, 0x0); 206 206 if (error) { 207 207 dev_err(&client->dev, 208 208 "Failed to reset interrupt enable flag\n"); ··· 210 210 } 211 211 212 212 /* initialize */ 213 - error = zinitix_write_u16(client, BT541_X_RESOLUTION, 213 + error = zinitix_write_u16(client, ZINITIX_X_RESOLUTION, 214 214 bt541->prop.max_x); 215 215 if (error) 216 216 return error; 217 217 218 - error = zinitix_write_u16(client, BT541_Y_RESOLUTION, 218 + error = zinitix_write_u16(client, ZINITIX_Y_RESOLUTION, 219 219 bt541->prop.max_y); 220 220 if (error) 221 221 return error; 222 222 223 - error = zinitix_write_u16(client, BT541_SUPPORTED_FINGER_NUM, 223 + error = zinitix_write_u16(client, ZINITIX_SUPPORTED_FINGER_NUM, 224 224 MAX_SUPPORTED_FINGER_NUM); 225 225 if (error) 226 226 return error; 227 227 228 - error = zinitix_write_u16(client, BT541_INITIAL_TOUCH_MODE, 228 + error = zinitix_write_u16(client, ZINITIX_INITIAL_TOUCH_MODE, 229 229 bt541->zinitix_mode); 230 230 if (error) 231 231 return error; 232 232 233 - error = zinitix_write_u16(client, BT541_TOUCH_MODE, 233 + error = zinitix_write_u16(client, ZINITIX_TOUCH_MODE, 234 234 bt541->zinitix_mode); 235 235 if (error) 236 236 return error; 237 237 238 - error = zinitix_write_u16(client, BT541_INT_ENABLE_FLAG, 238 + error = zinitix_write_u16(client, ZINITIX_INT_ENABLE_FLAG, 239 239 BIT_PT_CNT_CHANGE | BIT_DOWN | BIT_MOVE | 240 240 BIT_UP); 241 241 if (error) ··· 243 243 244 244 /* clear queue */ 245 245 for (i = 0; i < 10; i++) { 246 - zinitix_write_cmd(client, BT541_CLEAR_INT_STATUS_CMD); 246 + zinitix_write_cmd(client, ZINITIX_CLEAR_INT_STATUS_CMD); 247 247 udelay(10); 248 248 } 249 249 ··· 361 361 362 362 memset(&touch_event, 0, sizeof(struct touch_event)); 363 363 364 - error = zinitix_read_data(bt541->client, BT541_POINT_STATUS_REG, 364 + error = zinitix_read_data(bt541->client, ZINITIX_POINT_STATUS_REG, 365 365 &touch_event, sizeof(struct touch_event)); 366 366 if (error) { 367 367 dev_err(&client->dev, "Failed to read in touchpoint struct\n"); ··· 381 381 input_sync(bt541->input_dev); 382 382 383 383 out: 384 - zinitix_write_cmd(bt541->client, BT541_CLEAR_INT_STATUS_CMD); 384 + zinitix_write_cmd(bt541->client, ZINITIX_CLEAR_INT_STATUS_CMD); 385 385 return IRQ_HANDLED; 386 386 } 387 387