提交 86a0b425 编写于 作者: L Linus Torvalds

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

Pull input updates from Dmitry Torokhov:

 - a new driver for Cypress Generation 5 touchscreens

 - a new driver for Hynitron cstxxx touchscreens

 - a new driver for Himax hx83112b touchscreen

 - I2C input devices have been converted to use i2c's probe_new()

 - a large number of input devices are now using
   DEFINE_SIMPLE_DEV_PM_OPS and pm_sleep_ptr() and no longer use
   __maybe_unused annotations

 - improvements to msg2638 touchscreen driver to also support msg2138

 - conversion of several input deevine bindings to yaml/DT schema

 - changes to select touch drivers to move handling of wake irqs to the
   PM core

 - other assorted fixes and improvements.

* tag 'input-for-v6.2-rc0' of git://git.kernel.org/pub/scm/linux/kernel/git/dtor/input: (165 commits)
  Input: elants_i2c - delay longer with reset asserted
  dt-bindings: input: Convert ti,drv260x to DT schema
  dt-bindings: input: gpio-beeper: Convert to yaml schema
  Input: pxspad - fix unused data warning when force feedback not enabled
  Input: lpc32xx - allow building with COMPILE_TEST
  Input: nomadik-ske-keypad - allow building with COMPILE_TEST
  Input: pxa27xx-keypad - allow build with COMPILE_TEST
  Input: spear-keyboard - improve build coverage using COMPILE_TEST
  Input: tegra-kbc - allow build with COMPILE_TEST
  Input: tegra-kbc - switch to DEFINE_SIMPLE_DEV_PM_OPS() and pm_sleep_ptr()
  Input: tca6416-keypad - switch to DEFINE_SIMPLE_DEV_PM_OPS() and pm_sleep_ptr()
  Input: tc3589x - switch to DEFINE_SIMPLE_DEV_PM_OPS() and pm_sleep_ptr()
  Input: st-keyscan - switch to DEFINE_SIMPLE_DEV_PM_OPS() and pm_sleep_ptr()
  Input: sh-keysc - switch to DEFINE_SIMPLE_DEV_PM_OPS() and pm_sleep_ptr()
  Input: qt1070 - switch to DEFINE_SIMPLE_DEV_PM_OPS() and pm_sleep_ptr()
  Input: pxa27x_keypad - switch to DEFINE_SIMPLE_DEV_PM_OPS() and pm_sleep_ptr()
  Input: pmic8xxx-keypad - switch to DEFINE_SIMPLE_DEV_PM_OPS() and pm_sleep_ptr()
  Input: nomadik-ske-keypad - switch to DEFINE_SIMPLE_DEV_PM_OPS() and pm_sleep_ptr()
  Input: mcs-touchkey - switch to DEFINE_SIMPLE_DEV_PM_OPS() and pm_sleep_ptr()
  Input: max7359-keypad - switch to DEFINE_SIMPLE_DEV_PM_OPS() and pm_sleep_ptr()
  ...
...@@ -16,7 +16,9 @@ properties: ...@@ -16,7 +16,9 @@ properties:
- const: allwinner,sun4i-a10-lradc-keys - const: allwinner,sun4i-a10-lradc-keys
- const: allwinner,sun8i-a83t-r-lradc - const: allwinner,sun8i-a83t-r-lradc
- items: - items:
- const: allwinner,sun50i-a64-lradc - enum:
- allwinner,suniv-f1c100s-lradc
- allwinner,sun50i-a64-lradc
- const: allwinner,sun8i-a83t-r-lradc - const: allwinner,sun8i-a83t-r-lradc
- const: allwinner,sun50i-r329-lradc - const: allwinner,sun50i-r329-lradc
- items: - items:
......
...@@ -473,9 +473,6 @@ patternProperties: ...@@ -473,9 +473,6 @@ patternProperties:
Specifies whether the event is to be interpreted as a key (1) Specifies whether the event is to be interpreted as a key (1)
or a switch (5). or a switch (5).
required:
- linux,code
additionalProperties: false additionalProperties: false
dependencies: dependencies:
...@@ -501,7 +498,7 @@ patternProperties: ...@@ -501,7 +498,7 @@ patternProperties:
azoteq,slider-size: azoteq,slider-size:
$ref: /schemas/types.yaml#/definitions/uint32 $ref: /schemas/types.yaml#/definitions/uint32
minimum: 0 minimum: 1
maximum: 65535 maximum: 65535
description: description:
Specifies the slider's one-dimensional resolution, equal to the Specifies the slider's one-dimensional resolution, equal to the
...@@ -575,9 +572,9 @@ patternProperties: ...@@ -575,9 +572,9 @@ patternProperties:
linux,code: true linux,code: true
azoteq,gesture-max-ms: azoteq,gesture-max-ms:
multipleOf: 4 multipleOf: 16
minimum: 0 minimum: 0
maximum: 1020 maximum: 4080
description: description:
Specifies the length of time (in ms) within which a tap, swipe Specifies the length of time (in ms) within which a tap, swipe
or flick gesture must be completed in order to be acknowledged or flick gesture must be completed in order to be acknowledged
...@@ -585,9 +582,9 @@ patternProperties: ...@@ -585,9 +582,9 @@ patternProperties:
gesture applies to all remaining swipe or flick gestures. gesture applies to all remaining swipe or flick gestures.
azoteq,gesture-min-ms: azoteq,gesture-min-ms:
multipleOf: 4 multipleOf: 16
minimum: 0 minimum: 0
maximum: 124 maximum: 496
description: description:
Specifies the length of time (in ms) for which a tap gesture must Specifies the length of time (in ms) for which a tap gesture must
be held in order to be acknowledged by the device. be held in order to be acknowledged by the device.
...@@ -620,9 +617,6 @@ patternProperties: ...@@ -620,9 +617,6 @@ patternProperties:
GPIO, they must all be of the same type (proximity, touch or GPIO, they must all be of the same type (proximity, touch or
slider gesture). slider gesture).
required:
- linux,code
additionalProperties: false additionalProperties: false
required: required:
...@@ -693,6 +687,7 @@ allOf: ...@@ -693,6 +687,7 @@ allOf:
properties: properties:
azoteq,slider-size: azoteq,slider-size:
multipleOf: 16 multipleOf: 16
minimum: 16
maximum: 4080 maximum: 4080
azoteq,top-speed: azoteq,top-speed:
...@@ -935,14 +930,14 @@ examples: ...@@ -935,14 +930,14 @@ examples:
event-tap { event-tap {
linux,code = <KEY_PLAYPAUSE>; linux,code = <KEY_PLAYPAUSE>;
azoteq,gesture-max-ms = <600>; azoteq,gesture-max-ms = <400>;
azoteq,gesture-min-ms = <24>; azoteq,gesture-min-ms = <32>;
}; };
event-flick-pos { event-flick-pos {
linux,code = <KEY_NEXTSONG>; linux,code = <KEY_NEXTSONG>;
azoteq,gesture-max-ms = <600>; azoteq,gesture-max-ms = <800>;
azoteq,gesture-dist = <816>; azoteq,gesture-dist = <800>;
}; };
event-flick-neg { event-flick-neg {
......
* GPIO beeper device tree bindings
Register a beeper connected to GPIO pin.
Required properties:
- compatible: Should be "gpio-beeper".
- gpios: From common gpio binding; gpio connection to beeper enable pin.
Example:
beeper: beeper {
compatible = "gpio-beeper";
gpios = <&gpio3 23 GPIO_ACTIVE_HIGH>;
};
# SPDX-License-Identifier: GPL-2.0-only OR BSD-2-Clause
%YAML 1.2
---
$id: http://devicetree.org/schemas/input/gpio-beeper.yaml#
$schema: http://devicetree.org/meta-schemas/core.yaml#
title: GPIO controlled beeper
maintainers:
- Fabio Estevam <festevam@denx.de>
properties:
compatible:
const: gpio-beeper
gpios:
maxItems: 1
description:
GPIO that drives the beeper.
required:
- compatible
- gpios
additionalProperties: false
examples:
- |
#include <dt-bindings/gpio/gpio.h>
beeper {
compatible = "gpio-beeper";
gpios = <&gpio3 23 GPIO_ACTIVE_HIGH>;
};
# SPDX-License-Identifier: (GPL-2.0 OR BSD-2-Clause)
%YAML 1.2
---
$id: http://devicetree.org/schemas/input/qcom,pm8921-pwrkey.yaml#
$schema: http://devicetree.org/meta-schemas/core.yaml#
title: Qualcomm PM8921 PMIC Power Key
maintainers:
- Bjorn Andersson <andersson@kernel.org>
allOf:
- $ref: input.yaml#
properties:
compatible:
oneOf:
- enum:
- qcom,pm8921-pwrkey
- qcom,pm8058-pwrkey
- items:
- enum:
- qcom,pm8018-pwrkey
- const: qcom,pm8921-pwrkey
reg:
maxItems: 1
interrupts:
items:
- description: key release
- description: key press
debounce:
description:
Time in microseconds that key must be pressed or
released for state change interrupt to trigger.
$ref: /schemas/types.yaml#/definitions/uint32
pull-up:
description:
Presence of this property indicates that the KPDPWR_N
pin should be configured for pull up.
$ref: /schemas/types.yaml#/definitions/flag
required:
- compatible
- reg
- interrupts
unevaluatedProperties: false
examples:
- |
#include <dt-bindings/interrupt-controller/irq.h>
ssbi {
#address-cells = <1>;
#size-cells = <0>;
pmic@0 {
reg = <0x0>;
#address-cells = <1>;
#size-cells = <0>;
pwrkey@1c {
compatible = "qcom,pm8921-pwrkey";
reg = <0x1c>;
interrupt-parent = <&pmicint>;
interrupts = <50 IRQ_TYPE_EDGE_RISING>, <51 IRQ_TYPE_EDGE_RISING>;
debounce = <15625>;
pull-up;
};
};
};
...
Qualcomm PM8xxx PMIC Power Key
PROPERTIES
- compatible:
Usage: required
Value type: <string>
Definition: must be one of:
"qcom,pm8058-pwrkey"
"qcom,pm8921-pwrkey"
- reg:
Usage: required
Value type: <prop-encoded-array>
Definition: address of power key control register
- interrupts:
Usage: required
Value type: <prop-encoded-array>
Definition: the first interrupt specifies the key release interrupt
and the second interrupt specifies the key press interrupt.
The format of the specifier is defined by the binding
document describing the node's interrupt parent.
- debounce:
Usage: optional
Value type: <u32>
Definition: time in microseconds that key must be pressed or release
for state change interrupt to trigger.
- pull-up:
Usage: optional
Value type: <empty>
Definition: presence of this property indicates that the KPDPWR_N pin
should be configured for pull up.
EXAMPLE
pwrkey@1c {
compatible = "qcom,pm8921-pwrkey";
reg = <0x1c>;
interrupt-parent = <&pmicintc>;
interrupts = <50 1>, <51 1>;
debounce = <15625>;
pull-up;
};
* Texas Instruments - drv260x Haptics driver family
Required properties:
- compatible - One of:
"ti,drv2604" - DRV2604
"ti,drv2605" - DRV2605
"ti,drv2605l" - DRV2605L
- reg - I2C slave address
- vbat-supply - Required supply regulator
- mode - Power up mode of the chip (defined in include/dt-bindings/input/ti-drv260x.h)
DRV260X_LRA_MODE - Linear Resonance Actuator mode (Piezoelectric)
DRV260X_LRA_NO_CAL_MODE - This is a LRA Mode but there is no calibration
sequence during init. And the device is configured for real
time playback mode (RTP mode).
DRV260X_ERM_MODE - Eccentric Rotating Mass mode (Rotary vibrator)
- library-sel - These are ROM based waveforms pre-programmed into the IC.
This should be set to set the library to use at power up.
(defined in include/dt-bindings/input/ti-drv260x.h)
DRV260X_LIB_EMPTY - Do not use a pre-programmed library
DRV260X_ERM_LIB_A - Pre-programmed Library
DRV260X_ERM_LIB_B - Pre-programmed Library
DRV260X_ERM_LIB_C - Pre-programmed Library
DRV260X_ERM_LIB_D - Pre-programmed Library
DRV260X_ERM_LIB_E - Pre-programmed Library
DRV260X_ERM_LIB_F - Pre-programmed Library
DRV260X_LIB_LRA - Pre-programmed LRA Library
Optional properties:
- enable-gpio - gpio pin to enable/disable the device.
- vib-rated-mv - The rated voltage of the actuator in millivolts.
If this is not set then the value will be defaulted to
3.2 v.
- vib-overdrive-mv - The overdrive voltage of the actuator in millivolts.
If this is not set then the value will be defaulted to
3.2 v.
Example:
haptics: haptics@5a {
compatible = "ti,drv2605l";
reg = <0x5a>;
vbat-supply = <&vbat>;
enable-gpio = <&gpio1 28 GPIO_ACTIVE_HIGH>;
mode = <DRV260X_LRA_MODE>;
library-sel = <DRV260X_LIB_LRA>;
vib-rated-mv = <3200>;
vib-overdrive-mv = <3200>;
}
For more product information please see the link below:
http://www.ti.com/product/drv2605
# SPDX-License-Identifier: (GPL-2.0 OR BSD-2-Clause)
%YAML 1.2
---
$id: http://devicetree.org/schemas/input/ti,drv260x.yaml#
$schema: http://devicetree.org/meta-schemas/core.yaml#
title: Texas Instruments - drv260x Haptics driver family
maintainers:
- Andrew Davis <afd@ti.com>
properties:
compatible:
enum:
- ti,drv2604
- ti,drv2605
- ti,drv2605l
reg:
maxItems: 1
vbat-supply:
description: Power supply to the haptic motor
# TODO: Deprecate 'mode' in favor of differently named property
mode:
$ref: /schemas/types.yaml#/definitions/uint32
description: |
Power up mode of the chip
(defined in include/dt-bindings/input/ti-drv260x.h)
DRV260X_LRA_MODE
Linear Resonance Actuator mode (Piezoelectric)
DRV260X_LRA_NO_CAL_MODE
This is a LRA Mode but there is no calibration sequence during init.
And the device is configured for real time playback mode (RTP mode).
DRV260X_ERM_MODE
Eccentric Rotating Mass mode (Rotary vibrator)
enum: [ 0, 1, 2 ]
library-sel:
$ref: /schemas/types.yaml#/definitions/uint32
description: |
These are ROM based waveforms pre-programmed into the IC.
This should be set to set the library to use at power up.
(defined in include/dt-bindings/input/ti-drv260x.h)
DRV260X_LIB_EMPTY - Do not use a pre-programmed library
DRV260X_ERM_LIB_A - Pre-programmed Library
DRV260X_ERM_LIB_B - Pre-programmed Library
DRV260X_ERM_LIB_C - Pre-programmed Library
DRV260X_ERM_LIB_D - Pre-programmed Library
DRV260X_ERM_LIB_E - Pre-programmed Library
DRV260X_ERM_LIB_F - Pre-programmed Library
DRV260X_LIB_LRA - Pre-programmed LRA Library
enum: [ 0, 1, 2, 3, 4, 5, 6, 7 ]
enable-gpio:
maxItems: 1
deprecated: true
enable-gpios:
maxItems: 1
vib-rated-mv:
$ref: /schemas/types.yaml#/definitions/uint32
description: |
The rated voltage of the actuator in millivolts.
If this is not set then the value will be defaulted to 3200 mV.
default: 3200
vib-overdrive-mv:
$ref: /schemas/types.yaml#/definitions/uint32
description: |
The overdrive voltage of the actuator in millivolts.
If this is not set then the value will be defaulted to 3200 mV.
default: 3200
required:
- compatible
- reg
- enable-gpios
- mode
- library-sel
additionalProperties: false
examples:
- |
#include <dt-bindings/gpio/gpio.h>
#include <dt-bindings/input/ti-drv260x.h>
i2c {
#address-cells = <1>;
#size-cells = <0>;
haptics@5a {
compatible = "ti,drv2605l";
reg = <0x5a>;
vbat-supply = <&vbat>;
enable-gpios = <&gpio1 28 GPIO_ACTIVE_HIGH>;
mode = <DRV260X_LRA_MODE>;
library-sel = <DRV260X_LIB_LRA>;
vib-rated-mv = <3200>;
vib-overdrive-mv = <3200>;
};
};
# SPDX-License-Identifier: GPL-2.0-only OR BSD-2-Clause
%YAML 1.2
---
$id: http://devicetree.org/schemas/input/touchscreen/cypress,tt21000.yaml#
$schema: http://devicetree.org/meta-schemas/core.yaml#
title: Cypress TT21000 touchscreen controller
description: The Cypress TT21000 series (also known as "CYTTSP5" after
the marketing name Cypress TrueTouch Standard Product series 5).
maintainers:
- Alistair Francis <alistair@alistair23.me>
allOf:
- $ref: touchscreen.yaml#
properties:
compatible:
const: cypress,tt21000
reg:
maxItems: 1
'#address-cells':
const: 1
'#size-cells':
const: 0
interrupts:
maxItems: 1
vdd-supply:
description: Regulator for voltage.
reset-gpios:
maxItems: 1
linux,keycodes:
description: EV_ABS specific event code generated by the axis.
patternProperties:
"^button@[0-9]+$":
type: object
$ref: ../input.yaml#
properties:
reg:
maxItems: 1
linux,keycodes:
description: Keycode to emit
required:
- reg
- linux,keycodes
additionalProperties: false
required:
- compatible
- reg
- interrupts
- vdd-supply
unevaluatedProperties: false
examples:
- |
#include <dt-bindings/interrupt-controller/irq.h>
#include <dt-bindings/gpio/gpio.h>
#include <dt-bindings/input/linux-event-codes.h>
i2c {
#address-cells = <1>;
#size-cells = <0>;
touchscreen@24 {
#address-cells = <1>;
#size-cells = <0>;
compatible = "cypress,tt21000";
reg = <0x24>;
pinctrl-names = "default";
pinctrl-0 = <&tp_reset_ds203>;
interrupt-parent = <&pio>;
interrupts = <1 5 IRQ_TYPE_LEVEL_LOW>;
reset-gpios = <&pio 7 1 GPIO_ACTIVE_LOW>;
vdd-supply = <&reg_touch>;
button@0 {
reg = <0>;
linux,keycodes = <KEY_HOMEPAGE>;
};
button@1 {
reg = <1>;
linux,keycodes = <KEY_MENU>;
};
button@2 {
reg = <2>;
linux,keycodes = <KEY_BACK>;
};
};
};
...
...@@ -13,6 +13,6 @@ Example: ...@@ -13,6 +13,6 @@ Example:
compatible = "eeti,egalax_ts"; compatible = "eeti,egalax_ts";
reg = <0x04>; reg = <0x04>;
interrupt-parent = <&gpio1>; interrupt-parent = <&gpio1>;
interrupts = <9 2>; interrupts = <9 IRQ_TYPE_LEVEL_LOW>;
wakeup-gpios = <&gpio1 9 0>; wakeup-gpios = <&gpio1 9 GPIO_ACTIVE_LOW>;
}; };
# SPDX-License-Identifier: (GPL-2.0-only OR BSD-2-Clause)
%YAML 1.2
---
$id: http://devicetree.org/schemas/input/touchscreen/himax,hx83112b.yaml#
$schema: http://devicetree.org/meta-schemas/core.yaml#
title: Himax hx83112b touchscreen controller bindings
maintainers:
- Job Noorman <job@noorman.info>
allOf:
- $ref: touchscreen.yaml#
properties:
compatible:
enum:
- himax,hx83112b
reg:
maxItems: 1
interrupts:
maxItems: 1
reset-gpios:
maxItems: 1
touchscreen-inverted-x: true
touchscreen-inverted-y: true
touchscreen-size-x: true
touchscreen-size-y: true
touchscreen-swapped-x-y: true
additionalProperties: false
required:
- compatible
- reg
- interrupts
- reset-gpios
- touchscreen-size-x
- touchscreen-size-y
examples:
- |
#include <dt-bindings/interrupt-controller/irq.h>
#include <dt-bindings/gpio/gpio.h>
i2c {
#address-cells = <1>;
#size-cells = <0>;
touchscreen@48 {
compatible = "himax,hx83112b";
reg = <0x48>;
interrupt-parent = <&tlmm>;
interrupts = <65 IRQ_TYPE_LEVEL_LOW>;
touchscreen-size-x = <1080>;
touchscreen-size-y = <2160>;
reset-gpios = <&tlmm 64 GPIO_ACTIVE_LOW>;
};
};
...
# SPDX-License-Identifier: (GPL-2.0-only OR BSD-2-Clause)
%YAML 1.2
---
$id: http://devicetree.org/schemas/input/touchscreen/hynitron,cstxxx.yaml#
$schema: http://devicetree.org/meta-schemas/core.yaml#
title: Hynitron cstxxx series touchscreen controller
description: |
Bindings for Hynitron cstxxx series multi-touch touchscreen
controllers.
maintainers:
- Chris Morgan <macromorgan@hotmail.com>
allOf:
- $ref: touchscreen.yaml#
properties:
compatible:
enum:
- hynitron,cst340
reg:
maxItems: 1
interrupts:
maxItems: 1
reset-gpios:
maxItems: 1
touchscreen-size-x: true
touchscreen-size-y: true
touchscreen-inverted-x: true
touchscreen-inverted-y: true
touchscreen-swapped-x-y: true
additionalProperties: false
required:
- compatible
- reg
- interrupts
- reset-gpios
examples:
- |
#include <dt-bindings/gpio/gpio.h>
#include <dt-bindings/interrupt-controller/arm-gic.h>
i2c {
#address-cells = <1>;
#size-cells = <0>;
touchscreen@1a {
compatible = "hynitron,cst340";
reg = <0x1a>;
interrupt-parent = <&gpio4>;
interrupts = <9 IRQ_TYPE_EDGE_FALLING>;
reset-gpios = <&gpio4 6 GPIO_ACTIVE_LOW>;
touchscreen-size-x = <640>;
touchscreen-size-y = <480>;
};
};
...
...@@ -14,7 +14,9 @@ allOf: ...@@ -14,7 +14,9 @@ allOf:
properties: properties:
compatible: compatible:
const: mstar,msg2638 enum:
- mstar,msg2138
- mstar,msg2638
reg: reg:
const: 0x26 const: 0x26
...@@ -34,6 +36,10 @@ properties: ...@@ -34,6 +36,10 @@ properties:
touchscreen-size-x: true touchscreen-size-x: true
touchscreen-size-y: true touchscreen-size-y: true
linux,keycodes:
minItems: 1
maxItems: 4
additionalProperties: false additionalProperties: false
required: required:
......
...@@ -573,6 +573,8 @@ patternProperties: ...@@ -573,6 +573,8 @@ patternProperties:
description: Hycon Technology Corp. description: Hycon Technology Corp.
"^hydis,.*": "^hydis,.*":
description: Hydis Technologies description: Hydis Technologies
"^hynitron,.*":
description: Shanghai Hynitron Microelectronics Co. Ltd.
"^hynix,.*": "^hynix,.*":
description: SK Hynix Inc. description: SK Hynix Inc.
"^hyundai,.*": "^hyundai,.*":
......
...@@ -9220,6 +9220,13 @@ W: http://www.highpoint-tech.com ...@@ -9220,6 +9220,13 @@ W: http://www.highpoint-tech.com
F: Documentation/scsi/hptiop.rst F: Documentation/scsi/hptiop.rst
F: drivers/scsi/hptiop.c F: drivers/scsi/hptiop.c
HIMAX HX83112B TOUCHSCREEN SUPPORT
M: Job Noorman <job@noorman.info>
L: linux-input@vger.kernel.org
S: Maintained
F: Documentation/devicetree/bindings/input/touchscreen/himax,hx83112b.yaml
F: drivers/input/touchscreen/himax_hx83112b.c
HIPPI HIPPI
M: Jes Sorensen <jes@trained-monkey.org> M: Jes Sorensen <jes@trained-monkey.org>
L: linux-hippi@sunsite.dk L: linux-hippi@sunsite.dk
...@@ -19024,7 +19031,7 @@ F: drivers/video/fbdev/sis/ ...@@ -19024,7 +19031,7 @@ F: drivers/video/fbdev/sis/
F: include/video/sisfb.h F: include/video/sisfb.h
SIS I2C TOUCHSCREEN DRIVER SIS I2C TOUCHSCREEN DRIVER
M: Mika Penttilä <mika.penttila@nextfour.com> M: Mika Penttilä <mpenttil@redhat.com>
L: linux-input@vger.kernel.org L: linux-input@vger.kernel.org
S: Maintained S: Maintained
F: Documentation/devicetree/bindings/input/touchscreen/sis_i2c.txt F: Documentation/devicetree/bindings/input/touchscreen/sis_i2c.txt
......
...@@ -452,8 +452,8 @@ ...@@ -452,8 +452,8 @@
pinctrl-names = "default"; pinctrl-names = "default";
pinctrl-0 = <&pinctrl_egalax_int>; pinctrl-0 = <&pinctrl_egalax_int>;
interrupt-parent = <&gpio2>; interrupt-parent = <&gpio2>;
interrupts = <28 IRQ_TYPE_EDGE_FALLING>; interrupts = <28 IRQ_TYPE_LEVEL_LOW>;
wakeup-gpios = <&gpio2 28 GPIO_ACTIVE_HIGH>; wakeup-gpios = <&gpio2 28 GPIO_ACTIVE_LOW>;
}; };
}; };
......
...@@ -311,8 +311,8 @@ ...@@ -311,8 +311,8 @@
pinctrl-names = "default"; pinctrl-names = "default";
pinctrl-0 = <&pinctrl_i2c2_egalax_int>; pinctrl-0 = <&pinctrl_i2c2_egalax_int>;
interrupt-parent = <&gpio6>; interrupt-parent = <&gpio6>;
interrupts = <8 IRQ_TYPE_EDGE_FALLING>; interrupts = <8 IRQ_TYPE_LEVEL_LOW>;
wakeup-gpios = <&gpio6 8 GPIO_ACTIVE_HIGH>; wakeup-gpios = <&gpio6 8 GPIO_ACTIVE_LOW>;
}; };
ov5640: camera@3c { ov5640: camera@3c {
...@@ -450,8 +450,8 @@ ...@@ -450,8 +450,8 @@
compatible = "eeti,egalax_ts"; compatible = "eeti,egalax_ts";
reg = <0x04>; reg = <0x04>;
interrupt-parent = <&gpio6>; interrupt-parent = <&gpio6>;
interrupts = <7 2>; interrupts = <7 IRQ_TYPE_LEVEL_LOW>;
wakeup-gpios = <&gpio6 7 0>; wakeup-gpios = <&gpio6 7 GPIO_ACTIVE_LOW>;
}; };
magnetometer@e { magnetometer@e {
......
...@@ -14,6 +14,7 @@ ...@@ -14,6 +14,7 @@
#include <linux/fb.h> #include <linux/fb.h>
#include <linux/io.h> #include <linux/io.h>
#include <linux/init.h> #include <linux/init.h>
#include <linux/input-event-codes.h>
#include <linux/gpio.h> #include <linux/gpio.h>
#include <linux/gpio/machine.h> #include <linux/gpio/machine.h>
#include <linux/leds.h> #include <linux/leds.h>
......
...@@ -971,6 +971,9 @@ static const char *keys[KEY_MAX + 1] = { ...@@ -971,6 +971,9 @@ static const char *keys[KEY_MAX + 1] = {
[KEY_ASSISTANT] = "Assistant", [KEY_ASSISTANT] = "Assistant",
[KEY_KBD_LAYOUT_NEXT] = "KbdLayoutNext", [KEY_KBD_LAYOUT_NEXT] = "KbdLayoutNext",
[KEY_EMOJI_PICKER] = "EmojiPicker", [KEY_EMOJI_PICKER] = "EmojiPicker",
[KEY_CAMERA_ACCESS_ENABLE] = "CameraAccessEnable",
[KEY_CAMERA_ACCESS_DISABLE] = "CameraAccessDisable",
[KEY_CAMERA_ACCESS_TOGGLE] = "CameraAccessToggle",
[KEY_DICTATE] = "Dictate", [KEY_DICTATE] = "Dictate",
[KEY_BRIGHTNESS_MIN] = "BrightnessMin", [KEY_BRIGHTNESS_MIN] = "BrightnessMin",
[KEY_BRIGHTNESS_MAX] = "BrightnessMax", [KEY_BRIGHTNESS_MAX] = "BrightnessMax",
......
...@@ -1086,6 +1086,9 @@ static void hidinput_configure_usage(struct hid_input *hidinput, struct hid_fiel ...@@ -1086,6 +1086,9 @@ static void hidinput_configure_usage(struct hid_input *hidinput, struct hid_fiel
case 0x0cd: map_key_clear(KEY_PLAYPAUSE); break; case 0x0cd: map_key_clear(KEY_PLAYPAUSE); break;
case 0x0cf: map_key_clear(KEY_VOICECOMMAND); break; case 0x0cf: map_key_clear(KEY_VOICECOMMAND); break;
case 0x0d5: map_key_clear(KEY_CAMERA_ACCESS_ENABLE); break;
case 0x0d6: map_key_clear(KEY_CAMERA_ACCESS_DISABLE); break;
case 0x0d7: map_key_clear(KEY_CAMERA_ACCESS_TOGGLE); break;
case 0x0d8: map_key_clear(KEY_DICTATE); break; case 0x0d8: map_key_clear(KEY_DICTATE); break;
case 0x0d9: map_key_clear(KEY_EMOJI_PICKER); break; case 0x0d9: map_key_clear(KEY_EMOJI_PICKER); break;
......
...@@ -105,11 +105,6 @@ static int i2c_hid_acpi_probe(struct i2c_client *client) ...@@ -105,11 +105,6 @@ static int i2c_hid_acpi_probe(struct i2c_client *client)
acpi_device_fix_up_power(adev); acpi_device_fix_up_power(adev);
if (acpi_gbl_FADT.flags & ACPI_FADT_LOW_POWER_S0) {
device_set_wakeup_capable(dev, true);
device_set_wakeup_enable(dev, false);
}
return i2c_hid_core_probe(client, &ihid_acpi->ops, return i2c_hid_core_probe(client, &ihid_acpi->ops,
hid_descriptor_address, 0); hid_descriptor_address, 0);
} }
......
...@@ -26,6 +26,7 @@ ...@@ -26,6 +26,7 @@
#include <linux/delay.h> #include <linux/delay.h>
#include <linux/slab.h> #include <linux/slab.h>
#include <linux/pm.h> #include <linux/pm.h>
#include <linux/pm_wakeirq.h>
#include <linux/device.h> #include <linux/device.h>
#include <linux/wait.h> #include <linux/wait.h>
#include <linux/err.h> #include <linux/err.h>
...@@ -112,7 +113,6 @@ struct i2c_hid { ...@@ -112,7 +113,6 @@ struct i2c_hid {
wait_queue_head_t wait; /* For waiting the interrupt */ wait_queue_head_t wait; /* For waiting the interrupt */
bool irq_wake_enabled;
struct mutex reset_lock; struct mutex reset_lock;
struct i2chid_ops *ops; struct i2chid_ops *ops;
...@@ -1099,7 +1099,6 @@ static int i2c_hid_core_suspend(struct device *dev) ...@@ -1099,7 +1099,6 @@ static int i2c_hid_core_suspend(struct device *dev)
struct i2c_hid *ihid = i2c_get_clientdata(client); struct i2c_hid *ihid = i2c_get_clientdata(client);
struct hid_device *hid = ihid->hid; struct hid_device *hid = ihid->hid;
int ret; int ret;
int wake_status;
ret = hid_driver_suspend(hid, PMSG_SUSPEND); ret = hid_driver_suspend(hid, PMSG_SUSPEND);
if (ret < 0) if (ret < 0)
...@@ -1110,16 +1109,8 @@ static int i2c_hid_core_suspend(struct device *dev) ...@@ -1110,16 +1109,8 @@ static int i2c_hid_core_suspend(struct device *dev)
disable_irq(client->irq); disable_irq(client->irq);
if (device_may_wakeup(&client->dev)) { if (!device_may_wakeup(&client->dev))
wake_status = enable_irq_wake(client->irq);
if (!wake_status)
ihid->irq_wake_enabled = true;
else
hid_warn(hid, "Failed to enable irq wake: %d\n",
wake_status);
} else {
i2c_hid_core_power_down(ihid); i2c_hid_core_power_down(ihid);
}
return 0; return 0;
} }
...@@ -1130,18 +1121,9 @@ static int i2c_hid_core_resume(struct device *dev) ...@@ -1130,18 +1121,9 @@ static int i2c_hid_core_resume(struct device *dev)
struct i2c_client *client = to_i2c_client(dev); struct i2c_client *client = to_i2c_client(dev);
struct i2c_hid *ihid = i2c_get_clientdata(client); struct i2c_hid *ihid = i2c_get_clientdata(client);
struct hid_device *hid = ihid->hid; struct hid_device *hid = ihid->hid;
int wake_status;
if (!device_may_wakeup(&client->dev)) { if (!device_may_wakeup(&client->dev))
i2c_hid_core_power_up(ihid); i2c_hid_core_power_up(ihid);
} else if (ihid->irq_wake_enabled) {
wake_status = disable_irq_wake(client->irq);
if (!wake_status)
ihid->irq_wake_enabled = false;
else
hid_warn(hid, "Failed to disable irq wake: %d\n",
wake_status);
}
enable_irq(client->irq); enable_irq(client->irq);
......
...@@ -30,6 +30,7 @@ ...@@ -30,6 +30,7 @@
#include <linux/types.h> #include <linux/types.h>
#include <linux/gfp.h> #include <linux/gfp.h>
#include <linux/err.h> #include <linux/err.h>
#include <linux/of.h>
#include <linux/regulator/consumer.h> #include <linux/regulator/consumer.h>
#include <linux/iio/iio.h> #include <linux/iio/iio.h>
......
...@@ -21,6 +21,7 @@ ...@@ -21,6 +21,7 @@
#include <linux/seq_file.h> #include <linux/seq_file.h>
#include <linux/poll.h> #include <linux/poll.h>
#include <linux/device.h> #include <linux/device.h>
#include <linux/kstrtox.h>
#include <linux/mutex.h> #include <linux/mutex.h>
#include <linux/rcupdate.h> #include <linux/rcupdate.h>
#include "input-compat.h" #include "input-compat.h"
...@@ -1465,7 +1466,7 @@ static ssize_t inhibited_store(struct device *dev, ...@@ -1465,7 +1466,7 @@ static ssize_t inhibited_store(struct device *dev,
ssize_t rv; ssize_t rv;
bool inhibited; bool inhibited;
if (strtobool(buf, &inhibited)) if (kstrtobool(buf, &inhibited))
return -EINVAL; return -EINVAL;
if (inhibited) if (inhibited)
......
...@@ -46,6 +46,7 @@ config JOYSTICK_A3D ...@@ -46,6 +46,7 @@ config JOYSTICK_A3D
config JOYSTICK_ADC config JOYSTICK_ADC
tristate "Simple joystick connected over ADC" tristate "Simple joystick connected over ADC"
depends on IIO depends on IIO
select IIO_BUFFER
select IIO_BUFFER_CB select IIO_BUFFER_CB
help help
Say Y here if you have a simple joystick connected over ADC. Say Y here if you have a simple joystick connected over ADC.
......
...@@ -212,8 +212,7 @@ static int as5011_configure_chip(struct as5011_device *as5011, ...@@ -212,8 +212,7 @@ static int as5011_configure_chip(struct as5011_device *as5011,
return 0; return 0;
} }
static int as5011_probe(struct i2c_client *client, static int as5011_probe(struct i2c_client *client)
const struct i2c_device_id *id)
{ {
const struct as5011_platform_data *plat_data; const struct as5011_platform_data *plat_data;
struct as5011_device *as5011; struct as5011_device *as5011;
...@@ -349,7 +348,7 @@ static struct i2c_driver as5011_driver = { ...@@ -349,7 +348,7 @@ static struct i2c_driver as5011_driver = {
.driver = { .driver = {
.name = "as5011", .name = "as5011",
}, },
.probe = as5011_probe, .probe_new = as5011_probe,
.remove = as5011_remove, .remove = as5011_remove,
.id_table = as5011_id, .id_table = as5011_id,
}; };
......
...@@ -44,6 +44,8 @@ static const u8 PSX_CMD_POLL[] = { ...@@ -44,6 +44,8 @@ static const u8 PSX_CMD_POLL[] = {
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00
}; };
#ifdef CONFIG_JOYSTICK_PSXPAD_SPI_FF
/* 0x01, 0x43, 0x00, 0x01, 0x00, 0x00, 0x00, 0x00, 0x00 */ /* 0x01, 0x43, 0x00, 0x01, 0x00, 0x00, 0x00, 0x00, 0x00 */
static const u8 PSX_CMD_ENTER_CFG[] = { static const u8 PSX_CMD_ENTER_CFG[] = {
0x80, 0xC2, 0x00, 0x80, 0x00, 0x00, 0x00, 0x00, 0x00 0x80, 0xC2, 0x00, 0x80, 0x00, 0x00, 0x00, 0x00, 0x00
...@@ -56,6 +58,7 @@ static const u8 PSX_CMD_EXIT_CFG[] = { ...@@ -56,6 +58,7 @@ static const u8 PSX_CMD_EXIT_CFG[] = {
static const u8 PSX_CMD_ENABLE_MOTOR[] = { static const u8 PSX_CMD_ENABLE_MOTOR[] = {
0x80, 0xB2, 0x00, 0x00, 0x80, 0xFF, 0xFF, 0xFF, 0xFF 0x80, 0xB2, 0x00, 0x00, 0x80, 0xFF, 0xFF, 0xFF, 0xFF
}; };
#endif /* CONFIG_JOYSTICK_PSXPAD_SPI_FF */
struct psxpad { struct psxpad {
struct spi_device *spi; struct spi_device *spi;
...@@ -371,7 +374,7 @@ static int psxpad_spi_probe(struct spi_device *spi) ...@@ -371,7 +374,7 @@ static int psxpad_spi_probe(struct spi_device *spi)
return 0; return 0;
} }
static int __maybe_unused psxpad_spi_suspend(struct device *dev) static int psxpad_spi_suspend(struct device *dev)
{ {
struct spi_device *spi = to_spi_device(dev); struct spi_device *spi = to_spi_device(dev);
struct psxpad *pad = spi_get_drvdata(spi); struct psxpad *pad = spi_get_drvdata(spi);
...@@ -381,7 +384,7 @@ static int __maybe_unused psxpad_spi_suspend(struct device *dev) ...@@ -381,7 +384,7 @@ static int __maybe_unused psxpad_spi_suspend(struct device *dev)
return 0; return 0;
} }
static SIMPLE_DEV_PM_OPS(psxpad_spi_pm, psxpad_spi_suspend, NULL); static DEFINE_SIMPLE_DEV_PM_OPS(psxpad_spi_pm, psxpad_spi_suspend, NULL);
static const struct spi_device_id psxpad_spi_id[] = { static const struct spi_device_id psxpad_spi_id[] = {
{ "psxpad-spi", 0 }, { "psxpad-spi", 0 },
...@@ -392,7 +395,7 @@ MODULE_DEVICE_TABLE(spi, psxpad_spi_id); ...@@ -392,7 +395,7 @@ MODULE_DEVICE_TABLE(spi, psxpad_spi_id);
static struct spi_driver psxpad_spi_driver = { static struct spi_driver psxpad_spi_driver = {
.driver = { .driver = {
.name = "psxpad-spi", .name = "psxpad-spi",
.pm = &psxpad_spi_pm, .pm = pm_sleep_ptr(&psxpad_spi_pm),
}, },
.id_table = psxpad_spi_id, .id_table = psxpad_spi_id,
.probe = psxpad_spi_probe, .probe = psxpad_spi_probe,
......
...@@ -390,7 +390,7 @@ config KEYBOARD_LOCOMO ...@@ -390,7 +390,7 @@ config KEYBOARD_LOCOMO
config KEYBOARD_LPC32XX config KEYBOARD_LPC32XX
tristate "LPC32XX matrix key scanner support" tristate "LPC32XX matrix key scanner support"
depends on ARCH_LPC32XX && OF depends on (ARCH_LPC32XX && OF) || COMPILE_TEST
select INPUT_MATRIXKMAP select INPUT_MATRIXKMAP
help help
Say Y here if you want to use NXP LPC32XX SoC key scanner interface, Say Y here if you want to use NXP LPC32XX SoC key scanner interface,
...@@ -487,7 +487,7 @@ config KEYBOARD_NEWTON ...@@ -487,7 +487,7 @@ config KEYBOARD_NEWTON
config KEYBOARD_NOMADIK config KEYBOARD_NOMADIK
tristate "ST-Ericsson Nomadik SKE keyboard" tristate "ST-Ericsson Nomadik SKE keyboard"
depends on (ARCH_NOMADIK || ARCH_U8500) depends on (ARCH_NOMADIK || ARCH_U8500 || COMPILE_TEST)
select INPUT_MATRIXKMAP select INPUT_MATRIXKMAP
help help
Say Y here if you want to use a keypad provided on the SKE controller Say Y here if you want to use a keypad provided on the SKE controller
...@@ -508,7 +508,7 @@ config KEYBOARD_NSPIRE ...@@ -508,7 +508,7 @@ config KEYBOARD_NSPIRE
config KEYBOARD_TEGRA config KEYBOARD_TEGRA
tristate "NVIDIA Tegra internal matrix keyboard controller support" tristate "NVIDIA Tegra internal matrix keyboard controller support"
depends on ARCH_TEGRA && OF depends on (ARCH_TEGRA && OF) || COMPILE_TEST
select INPUT_MATRIXKMAP select INPUT_MATRIXKMAP
help help
Say Y here if you want to use a matrix keyboard connected directly Say Y here if you want to use a matrix keyboard connected directly
...@@ -542,7 +542,7 @@ config KEYBOARD_PINEPHONE ...@@ -542,7 +542,7 @@ config KEYBOARD_PINEPHONE
config KEYBOARD_PXA27x config KEYBOARD_PXA27x
tristate "PXA27x/PXA3xx keypad support" tristate "PXA27x/PXA3xx keypad support"
depends on PXA27x || PXA3xx || ARCH_MMP depends on PXA27x || PXA3xx || ARCH_MMP || COMPILE_TEST
select INPUT_MATRIXKMAP select INPUT_MATRIXKMAP
help help
Enable support for PXA27x/PXA3xx keypad controller. Enable support for PXA27x/PXA3xx keypad controller.
...@@ -709,7 +709,7 @@ config KEYBOARD_OMAP4 ...@@ -709,7 +709,7 @@ config KEYBOARD_OMAP4
config KEYBOARD_SPEAR config KEYBOARD_SPEAR
tristate "ST SPEAR keyboard support" tristate "ST SPEAR keyboard support"
depends on PLAT_SPEAR depends on PLAT_SPEAR || COMPILE_TEST
select INPUT_MATRIXKMAP select INPUT_MATRIXKMAP
help help
Say Y here if you want to use the SPEAR keyboard. Say Y here if you want to use the SPEAR keyboard.
......
...@@ -718,8 +718,7 @@ static void adp5588_disable_regulator(void *reg) ...@@ -718,8 +718,7 @@ static void adp5588_disable_regulator(void *reg)
regulator_disable(reg); regulator_disable(reg);
} }
static int adp5588_probe(struct i2c_client *client, static int adp5588_probe(struct i2c_client *client)
const struct i2c_device_id *id)
{ {
struct adp5588_kpad *kpad; struct adp5588_kpad *kpad;
struct input_dev *input; struct input_dev *input;
...@@ -867,7 +866,7 @@ static struct i2c_driver adp5588_driver = { ...@@ -867,7 +866,7 @@ static struct i2c_driver adp5588_driver = {
.of_match_table = adp5588_of_match, .of_match_table = adp5588_of_match,
.pm = pm_sleep_ptr(&adp5588_dev_pm_ops), .pm = pm_sleep_ptr(&adp5588_dev_pm_ops),
}, },
.probe = adp5588_probe, .probe_new = adp5588_probe,
.remove = adp5588_remove, .remove = adp5588_remove,
.id_table = adp5588_id, .id_table = adp5588_id,
}; };
......
...@@ -942,9 +942,9 @@ static void adp5589_clear_config(void *data) ...@@ -942,9 +942,9 @@ static void adp5589_clear_config(void *data)
adp5589_write(client, kpad->var->reg(ADP5589_GENERAL_CFG), 0); adp5589_write(client, kpad->var->reg(ADP5589_GENERAL_CFG), 0);
} }
static int adp5589_probe(struct i2c_client *client, static int adp5589_probe(struct i2c_client *client)
const struct i2c_device_id *id)
{ {
const struct i2c_device_id *id = i2c_client_get_device_id(client);
struct adp5589_kpad *kpad; struct adp5589_kpad *kpad;
const struct adp5589_kpad_platform_data *pdata = const struct adp5589_kpad_platform_data *pdata =
dev_get_platdata(&client->dev); dev_get_platdata(&client->dev);
...@@ -1016,7 +1016,7 @@ static int adp5589_probe(struct i2c_client *client, ...@@ -1016,7 +1016,7 @@ static int adp5589_probe(struct i2c_client *client,
return 0; return 0;
} }
static int __maybe_unused adp5589_suspend(struct device *dev) static int adp5589_suspend(struct device *dev)
{ {
struct i2c_client *client = to_i2c_client(dev); struct i2c_client *client = to_i2c_client(dev);
struct adp5589_kpad *kpad = i2c_get_clientdata(client); struct adp5589_kpad *kpad = i2c_get_clientdata(client);
...@@ -1027,7 +1027,7 @@ static int __maybe_unused adp5589_suspend(struct device *dev) ...@@ -1027,7 +1027,7 @@ static int __maybe_unused adp5589_suspend(struct device *dev)
return 0; return 0;
} }
static int __maybe_unused adp5589_resume(struct device *dev) static int adp5589_resume(struct device *dev)
{ {
struct i2c_client *client = to_i2c_client(dev); struct i2c_client *client = to_i2c_client(dev);
struct adp5589_kpad *kpad = i2c_get_clientdata(client); struct adp5589_kpad *kpad = i2c_get_clientdata(client);
...@@ -1038,7 +1038,7 @@ static int __maybe_unused adp5589_resume(struct device *dev) ...@@ -1038,7 +1038,7 @@ static int __maybe_unused adp5589_resume(struct device *dev)
return 0; return 0;
} }
static SIMPLE_DEV_PM_OPS(adp5589_dev_pm_ops, adp5589_suspend, adp5589_resume); static DEFINE_SIMPLE_DEV_PM_OPS(adp5589_dev_pm_ops, adp5589_suspend, adp5589_resume);
static const struct i2c_device_id adp5589_id[] = { static const struct i2c_device_id adp5589_id[] = {
{"adp5589-keys", ADP5589}, {"adp5589-keys", ADP5589},
...@@ -1052,9 +1052,9 @@ MODULE_DEVICE_TABLE(i2c, adp5589_id); ...@@ -1052,9 +1052,9 @@ MODULE_DEVICE_TABLE(i2c, adp5589_id);
static struct i2c_driver adp5589_driver = { static struct i2c_driver adp5589_driver = {
.driver = { .driver = {
.name = KBUILD_MODNAME, .name = KBUILD_MODNAME,
.pm = &adp5589_dev_pm_ops, .pm = pm_sleep_ptr(&adp5589_dev_pm_ops),
}, },
.probe = adp5589_probe, .probe_new = adp5589_probe,
.id_table = adp5589_id, .id_table = adp5589_id,
}; };
......
...@@ -321,9 +321,9 @@ static int cap11xx_init_leds(struct device *dev, ...@@ -321,9 +321,9 @@ static int cap11xx_init_leds(struct device *dev,
} }
#endif #endif
static int cap11xx_i2c_probe(struct i2c_client *i2c_client, static int cap11xx_i2c_probe(struct i2c_client *i2c_client)
const struct i2c_device_id *id)
{ {
const struct i2c_device_id *id = i2c_client_get_device_id(i2c_client);
struct device *dev = &i2c_client->dev; struct device *dev = &i2c_client->dev;
struct cap11xx_priv *priv; struct cap11xx_priv *priv;
struct device_node *node; struct device_node *node;
...@@ -503,7 +503,7 @@ static struct i2c_driver cap11xx_i2c_driver = { ...@@ -503,7 +503,7 @@ static struct i2c_driver cap11xx_i2c_driver = {
.of_match_table = cap11xx_dt_ids, .of_match_table = cap11xx_dt_ids,
}, },
.id_table = cap11xx_i2c_ids, .id_table = cap11xx_i2c_ids,
.probe = cap11xx_i2c_probe, .probe_new = cap11xx_i2c_probe,
}; };
module_i2c_driver(cap11xx_i2c_driver); module_i2c_driver(cap11xx_i2c_driver);
......
...@@ -415,7 +415,7 @@ static int cros_ec_keyb_query_switches(struct cros_ec_keyb *ckdev) ...@@ -415,7 +415,7 @@ static int cros_ec_keyb_query_switches(struct cros_ec_keyb *ckdev)
* *
* Returns 0 if no error or -error upon error. * Returns 0 if no error or -error upon error.
*/ */
static __maybe_unused int cros_ec_keyb_resume(struct device *dev) static int cros_ec_keyb_resume(struct device *dev)
{ {
struct cros_ec_keyb *ckdev = dev_get_drvdata(dev); struct cros_ec_keyb *ckdev = dev_get_drvdata(dev);
...@@ -760,7 +760,7 @@ static const struct of_device_id cros_ec_keyb_of_match[] = { ...@@ -760,7 +760,7 @@ static const struct of_device_id cros_ec_keyb_of_match[] = {
MODULE_DEVICE_TABLE(of, cros_ec_keyb_of_match); MODULE_DEVICE_TABLE(of, cros_ec_keyb_of_match);
#endif #endif
static SIMPLE_DEV_PM_OPS(cros_ec_keyb_pm_ops, NULL, cros_ec_keyb_resume); static DEFINE_SIMPLE_DEV_PM_OPS(cros_ec_keyb_pm_ops, NULL, cros_ec_keyb_resume);
static struct platform_driver cros_ec_keyb_driver = { static struct platform_driver cros_ec_keyb_driver = {
.probe = cros_ec_keyb_probe, .probe = cros_ec_keyb_probe,
...@@ -769,7 +769,7 @@ static struct platform_driver cros_ec_keyb_driver = { ...@@ -769,7 +769,7 @@ static struct platform_driver cros_ec_keyb_driver = {
.name = "cros-ec-keyb", .name = "cros-ec-keyb",
.of_match_table = of_match_ptr(cros_ec_keyb_of_match), .of_match_table = of_match_ptr(cros_ec_keyb_of_match),
.acpi_match_table = ACPI_PTR(cros_ec_keyb_acpi_match), .acpi_match_table = ACPI_PTR(cros_ec_keyb_acpi_match),
.pm = &cros_ec_keyb_pm_ops, .pm = pm_sleep_ptr(&cros_ec_keyb_pm_ops),
}, },
}; };
......
...@@ -168,7 +168,7 @@ static int cypress_sf_probe(struct i2c_client *client) ...@@ -168,7 +168,7 @@ static int cypress_sf_probe(struct i2c_client *client)
return 0; return 0;
}; };
static int __maybe_unused cypress_sf_suspend(struct device *dev) static int cypress_sf_suspend(struct device *dev)
{ {
struct i2c_client *client = to_i2c_client(dev); struct i2c_client *client = to_i2c_client(dev);
struct cypress_sf_data *touchkey = i2c_get_clientdata(client); struct cypress_sf_data *touchkey = i2c_get_clientdata(client);
...@@ -187,7 +187,7 @@ static int __maybe_unused cypress_sf_suspend(struct device *dev) ...@@ -187,7 +187,7 @@ static int __maybe_unused cypress_sf_suspend(struct device *dev)
return 0; return 0;
} }
static int __maybe_unused cypress_sf_resume(struct device *dev) static int cypress_sf_resume(struct device *dev)
{ {
struct i2c_client *client = to_i2c_client(dev); struct i2c_client *client = to_i2c_client(dev);
struct cypress_sf_data *touchkey = i2c_get_clientdata(client); struct cypress_sf_data *touchkey = i2c_get_clientdata(client);
...@@ -205,8 +205,8 @@ static int __maybe_unused cypress_sf_resume(struct device *dev) ...@@ -205,8 +205,8 @@ static int __maybe_unused cypress_sf_resume(struct device *dev)
return 0; return 0;
} }
static SIMPLE_DEV_PM_OPS(cypress_sf_pm_ops, static DEFINE_SIMPLE_DEV_PM_OPS(cypress_sf_pm_ops,
cypress_sf_suspend, cypress_sf_resume); cypress_sf_suspend, cypress_sf_resume);
static struct i2c_device_id cypress_sf_id_table[] = { static struct i2c_device_id cypress_sf_id_table[] = {
{ CYPRESS_SF_DEV_NAME, 0 }, { CYPRESS_SF_DEV_NAME, 0 },
...@@ -225,7 +225,7 @@ MODULE_DEVICE_TABLE(of, cypress_sf_of_match); ...@@ -225,7 +225,7 @@ MODULE_DEVICE_TABLE(of, cypress_sf_of_match);
static struct i2c_driver cypress_sf_driver = { static struct i2c_driver cypress_sf_driver = {
.driver = { .driver = {
.name = CYPRESS_SF_DEV_NAME, .name = CYPRESS_SF_DEV_NAME,
.pm = &cypress_sf_pm_ops, .pm = pm_sleep_ptr(&cypress_sf_pm_ops),
.of_match_table = of_match_ptr(cypress_sf_of_match), .of_match_table = of_match_ptr(cypress_sf_of_match),
}, },
.id_table = cypress_sf_id_table, .id_table = cypress_sf_id_table,
......
...@@ -59,12 +59,11 @@ static irqreturn_t dir685_tk_irq_thread(int irq, void *data) ...@@ -59,12 +59,11 @@ static irqreturn_t dir685_tk_irq_thread(int irq, void *data)
return IRQ_HANDLED; return IRQ_HANDLED;
} }
static int dir685_tk_probe(struct i2c_client *client, static int dir685_tk_probe(struct i2c_client *client)
const struct i2c_device_id *id)
{ {
struct dir685_touchkeys *tk; static const u8 bl_data[] = { 0xa7, 0x40 };
struct device *dev = &client->dev; struct device *dev = &client->dev;
u8 bl_data[] = { 0xa7, 0x40 }; struct dir685_touchkeys *tk;
int err; int err;
int i; int i;
...@@ -146,7 +145,7 @@ static struct i2c_driver dir685_tk_i2c_driver = { ...@@ -146,7 +145,7 @@ static struct i2c_driver dir685_tk_i2c_driver = {
.name = "dlink-dir685-touchkeys", .name = "dlink-dir685-touchkeys",
.of_match_table = of_match_ptr(dir685_tk_of_match), .of_match_table = of_match_ptr(dir685_tk_of_match),
}, },
.probe = dir685_tk_probe, .probe_new = dir685_tk_probe,
.id_table = dir685_tk_id, .id_table = dir685_tk_id,
}; };
module_i2c_driver(dir685_tk_i2c_driver); module_i2c_driver(dir685_tk_i2c_driver);
......
...@@ -178,7 +178,7 @@ static void ep93xx_keypad_close(struct input_dev *pdev) ...@@ -178,7 +178,7 @@ static void ep93xx_keypad_close(struct input_dev *pdev)
} }
static int __maybe_unused ep93xx_keypad_suspend(struct device *dev) static int ep93xx_keypad_suspend(struct device *dev)
{ {
struct platform_device *pdev = to_platform_device(dev); struct platform_device *pdev = to_platform_device(dev);
struct ep93xx_keypad *keypad = platform_get_drvdata(pdev); struct ep93xx_keypad *keypad = platform_get_drvdata(pdev);
...@@ -196,7 +196,7 @@ static int __maybe_unused ep93xx_keypad_suspend(struct device *dev) ...@@ -196,7 +196,7 @@ static int __maybe_unused ep93xx_keypad_suspend(struct device *dev)
return 0; return 0;
} }
static int __maybe_unused ep93xx_keypad_resume(struct device *dev) static int ep93xx_keypad_resume(struct device *dev)
{ {
struct platform_device *pdev = to_platform_device(dev); struct platform_device *pdev = to_platform_device(dev);
struct ep93xx_keypad *keypad = platform_get_drvdata(pdev); struct ep93xx_keypad *keypad = platform_get_drvdata(pdev);
...@@ -217,8 +217,8 @@ static int __maybe_unused ep93xx_keypad_resume(struct device *dev) ...@@ -217,8 +217,8 @@ static int __maybe_unused ep93xx_keypad_resume(struct device *dev)
return 0; return 0;
} }
static SIMPLE_DEV_PM_OPS(ep93xx_keypad_pm_ops, static DEFINE_SIMPLE_DEV_PM_OPS(ep93xx_keypad_pm_ops,
ep93xx_keypad_suspend, ep93xx_keypad_resume); ep93xx_keypad_suspend, ep93xx_keypad_resume);
static void ep93xx_keypad_release_gpio_action(void *_pdev) static void ep93xx_keypad_release_gpio_action(void *_pdev)
{ {
...@@ -318,7 +318,7 @@ static int ep93xx_keypad_remove(struct platform_device *pdev) ...@@ -318,7 +318,7 @@ static int ep93xx_keypad_remove(struct platform_device *pdev)
static struct platform_driver ep93xx_keypad_driver = { static struct platform_driver ep93xx_keypad_driver = {
.driver = { .driver = {
.name = "ep93xx-keypad", .name = "ep93xx-keypad",
.pm = &ep93xx_keypad_pm_ops, .pm = pm_sleep_ptr(&ep93xx_keypad_pm_ops),
}, },
.probe = ep93xx_keypad_probe, .probe = ep93xx_keypad_probe,
.remove = ep93xx_keypad_remove, .remove = ep93xx_keypad_remove,
......
...@@ -992,7 +992,7 @@ gpio_keys_disable_wakeup(struct gpio_keys_drvdata *ddata) ...@@ -992,7 +992,7 @@ gpio_keys_disable_wakeup(struct gpio_keys_drvdata *ddata)
} }
} }
static int __maybe_unused gpio_keys_suspend(struct device *dev) static int gpio_keys_suspend(struct device *dev)
{ {
struct gpio_keys_drvdata *ddata = dev_get_drvdata(dev); struct gpio_keys_drvdata *ddata = dev_get_drvdata(dev);
struct input_dev *input = ddata->input; struct input_dev *input = ddata->input;
...@@ -1012,7 +1012,7 @@ static int __maybe_unused gpio_keys_suspend(struct device *dev) ...@@ -1012,7 +1012,7 @@ static int __maybe_unused gpio_keys_suspend(struct device *dev)
return 0; return 0;
} }
static int __maybe_unused gpio_keys_resume(struct device *dev) static int gpio_keys_resume(struct device *dev)
{ {
struct gpio_keys_drvdata *ddata = dev_get_drvdata(dev); struct gpio_keys_drvdata *ddata = dev_get_drvdata(dev);
struct input_dev *input = ddata->input; struct input_dev *input = ddata->input;
...@@ -1034,7 +1034,7 @@ static int __maybe_unused gpio_keys_resume(struct device *dev) ...@@ -1034,7 +1034,7 @@ static int __maybe_unused gpio_keys_resume(struct device *dev)
return 0; return 0;
} }
static SIMPLE_DEV_PM_OPS(gpio_keys_pm_ops, gpio_keys_suspend, gpio_keys_resume); static DEFINE_SIMPLE_DEV_PM_OPS(gpio_keys_pm_ops, gpio_keys_suspend, gpio_keys_resume);
static void gpio_keys_shutdown(struct platform_device *pdev) static void gpio_keys_shutdown(struct platform_device *pdev)
{ {
...@@ -1050,7 +1050,7 @@ static struct platform_driver gpio_keys_device_driver = { ...@@ -1050,7 +1050,7 @@ static struct platform_driver gpio_keys_device_driver = {
.shutdown = gpio_keys_shutdown, .shutdown = gpio_keys_shutdown,
.driver = { .driver = {
.name = "gpio-keys", .name = "gpio-keys",
.pm = &gpio_keys_pm_ops, .pm = pm_sleep_ptr(&gpio_keys_pm_ops),
.of_match_table = gpio_keys_of_match, .of_match_table = gpio_keys_of_match,
.dev_groups = gpio_keys_groups, .dev_groups = gpio_keys_groups,
} }
......
...@@ -124,7 +124,7 @@ static int micro_key_probe(struct platform_device *pdev) ...@@ -124,7 +124,7 @@ static int micro_key_probe(struct platform_device *pdev)
return 0; return 0;
} }
static int __maybe_unused micro_key_suspend(struct device *dev) static int micro_key_suspend(struct device *dev)
{ {
struct ipaq_micro_keys *keys = dev_get_drvdata(dev); struct ipaq_micro_keys *keys = dev_get_drvdata(dev);
...@@ -133,7 +133,7 @@ static int __maybe_unused micro_key_suspend(struct device *dev) ...@@ -133,7 +133,7 @@ static int __maybe_unused micro_key_suspend(struct device *dev)
return 0; return 0;
} }
static int __maybe_unused micro_key_resume(struct device *dev) static int micro_key_resume(struct device *dev)
{ {
struct ipaq_micro_keys *keys = dev_get_drvdata(dev); struct ipaq_micro_keys *keys = dev_get_drvdata(dev);
struct input_dev *input = keys->input; struct input_dev *input = keys->input;
...@@ -148,13 +148,13 @@ static int __maybe_unused micro_key_resume(struct device *dev) ...@@ -148,13 +148,13 @@ static int __maybe_unused micro_key_resume(struct device *dev)
return 0; return 0;
} }
static SIMPLE_DEV_PM_OPS(micro_key_dev_pm_ops, static DEFINE_SIMPLE_DEV_PM_OPS(micro_key_dev_pm_ops,
micro_key_suspend, micro_key_resume); micro_key_suspend, micro_key_resume);
static struct platform_driver micro_key_device_driver = { static struct platform_driver micro_key_device_driver = {
.driver = { .driver = {
.name = "ipaq-micro-keys", .name = "ipaq-micro-keys",
.pm = &micro_key_dev_pm_ops, .pm = pm_sleep_ptr(&micro_key_dev_pm_ops),
}, },
.probe = micro_key_probe, .probe = micro_key_probe,
}; };
......
...@@ -615,8 +615,7 @@ static ssize_t lm8323_set_disable(struct device *dev, ...@@ -615,8 +615,7 @@ static ssize_t lm8323_set_disable(struct device *dev,
} }
static DEVICE_ATTR(disable_kp, 0644, lm8323_show_disable, lm8323_set_disable); static DEVICE_ATTR(disable_kp, 0644, lm8323_show_disable, lm8323_set_disable);
static int lm8323_probe(struct i2c_client *client, static int lm8323_probe(struct i2c_client *client)
const struct i2c_device_id *id)
{ {
struct lm8323_platform_data *pdata = dev_get_platdata(&client->dev); struct lm8323_platform_data *pdata = dev_get_platdata(&client->dev);
struct input_dev *idev; struct input_dev *idev;
...@@ -771,7 +770,6 @@ static void lm8323_remove(struct i2c_client *client) ...@@ -771,7 +770,6 @@ static void lm8323_remove(struct i2c_client *client)
kfree(lm); kfree(lm);
} }
#ifdef CONFIG_PM_SLEEP
/* /*
* We don't need to explicitly suspend the chip, as it already switches off * We don't need to explicitly suspend the chip, as it already switches off
* when there's no activity. * when there's no activity.
...@@ -815,9 +813,8 @@ static int lm8323_resume(struct device *dev) ...@@ -815,9 +813,8 @@ static int lm8323_resume(struct device *dev)
return 0; return 0;
} }
#endif
static SIMPLE_DEV_PM_OPS(lm8323_pm_ops, lm8323_suspend, lm8323_resume); static DEFINE_SIMPLE_DEV_PM_OPS(lm8323_pm_ops, lm8323_suspend, lm8323_resume);
static const struct i2c_device_id lm8323_id[] = { static const struct i2c_device_id lm8323_id[] = {
{ "lm8323", 0 }, { "lm8323", 0 },
...@@ -827,9 +824,9 @@ static const struct i2c_device_id lm8323_id[] = { ...@@ -827,9 +824,9 @@ static const struct i2c_device_id lm8323_id[] = {
static struct i2c_driver lm8323_i2c_driver = { static struct i2c_driver lm8323_i2c_driver = {
.driver = { .driver = {
.name = "lm8323", .name = "lm8323",
.pm = &lm8323_pm_ops, .pm = pm_sleep_ptr(&lm8323_pm_ops),
}, },
.probe = lm8323_probe, .probe_new = lm8323_probe,
.remove = lm8323_remove, .remove = lm8323_remove,
.id_table = lm8323_id, .id_table = lm8323_id,
}; };
......
...@@ -125,8 +125,7 @@ static irqreturn_t lm8333_irq_thread(int irq, void *data) ...@@ -125,8 +125,7 @@ static irqreturn_t lm8333_irq_thread(int irq, void *data)
return IRQ_HANDLED; return IRQ_HANDLED;
} }
static int lm8333_probe(struct i2c_client *client, static int lm8333_probe(struct i2c_client *client)
const struct i2c_device_id *id)
{ {
const struct lm8333_platform_data *pdata = const struct lm8333_platform_data *pdata =
dev_get_platdata(&client->dev); dev_get_platdata(&client->dev);
...@@ -219,7 +218,7 @@ static struct i2c_driver lm8333_driver = { ...@@ -219,7 +218,7 @@ static struct i2c_driver lm8333_driver = {
.driver = { .driver = {
.name = "lm8333", .name = "lm8333",
}, },
.probe = lm8333_probe, .probe_new = lm8333_probe,
.remove = lm8333_remove, .remove = lm8333_remove,
.id_table = lm8333_id, .id_table = lm8333_id,
}; };
......
...@@ -264,7 +264,6 @@ static int lpc32xx_kscan_probe(struct platform_device *pdev) ...@@ -264,7 +264,6 @@ static int lpc32xx_kscan_probe(struct platform_device *pdev)
return 0; return 0;
} }
#ifdef CONFIG_PM_SLEEP
static int lpc32xx_kscan_suspend(struct device *dev) static int lpc32xx_kscan_suspend(struct device *dev)
{ {
struct platform_device *pdev = to_platform_device(dev); struct platform_device *pdev = to_platform_device(dev);
...@@ -302,10 +301,9 @@ static int lpc32xx_kscan_resume(struct device *dev) ...@@ -302,10 +301,9 @@ static int lpc32xx_kscan_resume(struct device *dev)
mutex_unlock(&input->mutex); mutex_unlock(&input->mutex);
return retval; return retval;
} }
#endif
static SIMPLE_DEV_PM_OPS(lpc32xx_kscan_pm_ops, lpc32xx_kscan_suspend, static DEFINE_SIMPLE_DEV_PM_OPS(lpc32xx_kscan_pm_ops, lpc32xx_kscan_suspend,
lpc32xx_kscan_resume); lpc32xx_kscan_resume);
static const struct of_device_id lpc32xx_kscan_match[] = { static const struct of_device_id lpc32xx_kscan_match[] = {
{ .compatible = "nxp,lpc3220-key" }, { .compatible = "nxp,lpc3220-key" },
...@@ -317,7 +315,7 @@ static struct platform_driver lpc32xx_kscan_driver = { ...@@ -317,7 +315,7 @@ static struct platform_driver lpc32xx_kscan_driver = {
.probe = lpc32xx_kscan_probe, .probe = lpc32xx_kscan_probe,
.driver = { .driver = {
.name = DRV_NAME, .name = DRV_NAME,
.pm = &lpc32xx_kscan_pm_ops, .pm = pm_sleep_ptr(&lpc32xx_kscan_pm_ops),
.of_match_table = lpc32xx_kscan_match, .of_match_table = lpc32xx_kscan_match,
} }
}; };
......
...@@ -127,6 +127,9 @@ static void matrix_keypad_scan(struct work_struct *work) ...@@ -127,6 +127,9 @@ static void matrix_keypad_scan(struct work_struct *work)
memset(new_state, 0, sizeof(new_state)); memset(new_state, 0, sizeof(new_state));
for (row = 0; row < pdata->num_row_gpios; row++)
gpio_direction_input(pdata->row_gpios[row]);
/* assert each column and read the row status out */ /* assert each column and read the row status out */
for (col = 0; col < pdata->num_col_gpios; col++) { for (col = 0; col < pdata->num_col_gpios; col++) {
...@@ -227,7 +230,6 @@ static void matrix_keypad_stop(struct input_dev *dev) ...@@ -227,7 +230,6 @@ static void matrix_keypad_stop(struct input_dev *dev)
disable_row_irqs(keypad); disable_row_irqs(keypad);
} }
#ifdef CONFIG_PM_SLEEP
static void matrix_keypad_enable_wakeup(struct matrix_keypad *keypad) static void matrix_keypad_enable_wakeup(struct matrix_keypad *keypad)
{ {
const struct matrix_keypad_platform_data *pdata = keypad->pdata; const struct matrix_keypad_platform_data *pdata = keypad->pdata;
...@@ -296,10 +298,9 @@ static int matrix_keypad_resume(struct device *dev) ...@@ -296,10 +298,9 @@ static int matrix_keypad_resume(struct device *dev)
return 0; return 0;
} }
#endif
static SIMPLE_DEV_PM_OPS(matrix_keypad_pm_ops, static DEFINE_SIMPLE_DEV_PM_OPS(matrix_keypad_pm_ops,
matrix_keypad_suspend, matrix_keypad_resume); matrix_keypad_suspend, matrix_keypad_resume);
static int matrix_keypad_init_gpio(struct platform_device *pdev, static int matrix_keypad_init_gpio(struct platform_device *pdev,
struct matrix_keypad *keypad) struct matrix_keypad *keypad)
...@@ -574,7 +575,7 @@ static struct platform_driver matrix_keypad_driver = { ...@@ -574,7 +575,7 @@ static struct platform_driver matrix_keypad_driver = {
.remove = matrix_keypad_remove, .remove = matrix_keypad_remove,
.driver = { .driver = {
.name = "matrix-keypad", .name = "matrix-keypad",
.pm = &matrix_keypad_pm_ops, .pm = pm_sleep_ptr(&matrix_keypad_pm_ops),
.of_match_table = of_match_ptr(matrix_keypad_dt_match), .of_match_table = of_match_ptr(matrix_keypad_dt_match),
}, },
}; };
......
...@@ -155,8 +155,7 @@ static void max7359_initialize(struct i2c_client *client) ...@@ -155,8 +155,7 @@ static void max7359_initialize(struct i2c_client *client)
max7359_fall_deepsleep(client); max7359_fall_deepsleep(client);
} }
static int max7359_probe(struct i2c_client *client, static int max7359_probe(struct i2c_client *client)
const struct i2c_device_id *id)
{ {
const struct matrix_keymap_data *keymap_data = const struct matrix_keymap_data *keymap_data =
dev_get_platdata(&client->dev); dev_get_platdata(&client->dev);
...@@ -243,7 +242,6 @@ static int max7359_probe(struct i2c_client *client, ...@@ -243,7 +242,6 @@ static int max7359_probe(struct i2c_client *client,
return 0; return 0;
} }
#ifdef CONFIG_PM_SLEEP
static int max7359_suspend(struct device *dev) static int max7359_suspend(struct device *dev)
{ {
struct i2c_client *client = to_i2c_client(dev); struct i2c_client *client = to_i2c_client(dev);
...@@ -268,9 +266,8 @@ static int max7359_resume(struct device *dev) ...@@ -268,9 +266,8 @@ static int max7359_resume(struct device *dev)
return 0; return 0;
} }
#endif
static SIMPLE_DEV_PM_OPS(max7359_pm, max7359_suspend, max7359_resume); static DEFINE_SIMPLE_DEV_PM_OPS(max7359_pm, max7359_suspend, max7359_resume);
static const struct i2c_device_id max7359_ids[] = { static const struct i2c_device_id max7359_ids[] = {
{ "max7359", 0 }, { "max7359", 0 },
...@@ -281,9 +278,9 @@ MODULE_DEVICE_TABLE(i2c, max7359_ids); ...@@ -281,9 +278,9 @@ MODULE_DEVICE_TABLE(i2c, max7359_ids);
static struct i2c_driver max7359_i2c_driver = { static struct i2c_driver max7359_i2c_driver = {
.driver = { .driver = {
.name = "max7359", .name = "max7359",
.pm = &max7359_pm, .pm = pm_sleep_ptr(&max7359_pm),
}, },
.probe = max7359_probe, .probe_new = max7359_probe,
.id_table = max7359_ids, .id_table = max7359_ids,
}; };
......
...@@ -92,9 +92,9 @@ static irqreturn_t mcs_touchkey_interrupt(int irq, void *dev_id) ...@@ -92,9 +92,9 @@ static irqreturn_t mcs_touchkey_interrupt(int irq, void *dev_id)
return IRQ_HANDLED; return IRQ_HANDLED;
} }
static int mcs_touchkey_probe(struct i2c_client *client, static int mcs_touchkey_probe(struct i2c_client *client)
const struct i2c_device_id *id)
{ {
const struct i2c_device_id *id = i2c_client_get_device_id(client);
const struct mcs_platform_data *pdata; const struct mcs_platform_data *pdata;
struct mcs_touchkey_data *data; struct mcs_touchkey_data *data;
struct input_dev *input_dev; struct input_dev *input_dev;
...@@ -213,7 +213,6 @@ static void mcs_touchkey_shutdown(struct i2c_client *client) ...@@ -213,7 +213,6 @@ static void mcs_touchkey_shutdown(struct i2c_client *client)
data->poweron(false); data->poweron(false);
} }
#ifdef CONFIG_PM_SLEEP
static int mcs_touchkey_suspend(struct device *dev) static int mcs_touchkey_suspend(struct device *dev)
{ {
struct mcs_touchkey_data *data = dev_get_drvdata(dev); struct mcs_touchkey_data *data = dev_get_drvdata(dev);
...@@ -243,10 +242,9 @@ static int mcs_touchkey_resume(struct device *dev) ...@@ -243,10 +242,9 @@ static int mcs_touchkey_resume(struct device *dev)
return 0; return 0;
} }
#endif
static SIMPLE_DEV_PM_OPS(mcs_touchkey_pm_ops, static DEFINE_SIMPLE_DEV_PM_OPS(mcs_touchkey_pm_ops,
mcs_touchkey_suspend, mcs_touchkey_resume); mcs_touchkey_suspend, mcs_touchkey_resume);
static const struct i2c_device_id mcs_touchkey_id[] = { static const struct i2c_device_id mcs_touchkey_id[] = {
{ "mcs5000_touchkey", MCS5000_TOUCHKEY }, { "mcs5000_touchkey", MCS5000_TOUCHKEY },
...@@ -258,9 +256,9 @@ MODULE_DEVICE_TABLE(i2c, mcs_touchkey_id); ...@@ -258,9 +256,9 @@ MODULE_DEVICE_TABLE(i2c, mcs_touchkey_id);
static struct i2c_driver mcs_touchkey_driver = { static struct i2c_driver mcs_touchkey_driver = {
.driver = { .driver = {
.name = "mcs_touchkey", .name = "mcs_touchkey",
.pm = &mcs_touchkey_pm_ops, .pm = pm_sleep_ptr(&mcs_touchkey_pm_ops),
}, },
.probe = mcs_touchkey_probe, .probe_new = mcs_touchkey_probe,
.remove = mcs_touchkey_remove, .remove = mcs_touchkey_remove,
.shutdown = mcs_touchkey_shutdown, .shutdown = mcs_touchkey_shutdown,
.id_table = mcs_touchkey_id, .id_table = mcs_touchkey_id,
......
...@@ -230,8 +230,7 @@ static int mpr121_phys_init(struct mpr121_touchkey *mpr121, ...@@ -230,8 +230,7 @@ static int mpr121_phys_init(struct mpr121_touchkey *mpr121,
return ret; return ret;
} }
static int mpr_touchkey_probe(struct i2c_client *client, static int mpr_touchkey_probe(struct i2c_client *client)
const struct i2c_device_id *id)
{ {
struct device *dev = &client->dev; struct device *dev = &client->dev;
struct regulator *vdd_supply; struct regulator *vdd_supply;
...@@ -341,7 +340,7 @@ static int mpr_touchkey_probe(struct i2c_client *client, ...@@ -341,7 +340,7 @@ static int mpr_touchkey_probe(struct i2c_client *client,
return 0; return 0;
} }
static int __maybe_unused mpr_suspend(struct device *dev) static int mpr_suspend(struct device *dev)
{ {
struct i2c_client *client = to_i2c_client(dev); struct i2c_client *client = to_i2c_client(dev);
...@@ -353,7 +352,7 @@ static int __maybe_unused mpr_suspend(struct device *dev) ...@@ -353,7 +352,7 @@ static int __maybe_unused mpr_suspend(struct device *dev)
return 0; return 0;
} }
static int __maybe_unused mpr_resume(struct device *dev) static int mpr_resume(struct device *dev)
{ {
struct i2c_client *client = to_i2c_client(dev); struct i2c_client *client = to_i2c_client(dev);
struct mpr121_touchkey *mpr121 = i2c_get_clientdata(client); struct mpr121_touchkey *mpr121 = i2c_get_clientdata(client);
...@@ -367,7 +366,7 @@ static int __maybe_unused mpr_resume(struct device *dev) ...@@ -367,7 +366,7 @@ static int __maybe_unused mpr_resume(struct device *dev)
return 0; return 0;
} }
static SIMPLE_DEV_PM_OPS(mpr121_touchkey_pm_ops, mpr_suspend, mpr_resume); static DEFINE_SIMPLE_DEV_PM_OPS(mpr121_touchkey_pm_ops, mpr_suspend, mpr_resume);
static const struct i2c_device_id mpr121_id[] = { static const struct i2c_device_id mpr121_id[] = {
{ "mpr121_touchkey", 0 }, { "mpr121_touchkey", 0 },
...@@ -386,11 +385,11 @@ MODULE_DEVICE_TABLE(of, mpr121_touchkey_dt_match_table); ...@@ -386,11 +385,11 @@ MODULE_DEVICE_TABLE(of, mpr121_touchkey_dt_match_table);
static struct i2c_driver mpr_touchkey_driver = { static struct i2c_driver mpr_touchkey_driver = {
.driver = { .driver = {
.name = "mpr121", .name = "mpr121",
.pm = &mpr121_touchkey_pm_ops, .pm = pm_sleep_ptr(&mpr121_touchkey_pm_ops),
.of_match_table = of_match_ptr(mpr121_touchkey_dt_match_table), .of_match_table = of_match_ptr(mpr121_touchkey_dt_match_table),
}, },
.id_table = mpr121_id, .id_table = mpr121_id,
.probe = mpr_touchkey_probe, .probe_new = mpr_touchkey_probe,
}; };
module_i2c_driver(mpr_touchkey_driver); module_i2c_driver(mpr_touchkey_driver);
......
...@@ -231,7 +231,7 @@ static int mtk_pmic_key_setup(struct mtk_pmic_keys *keys, ...@@ -231,7 +231,7 @@ static int mtk_pmic_key_setup(struct mtk_pmic_keys *keys,
return 0; return 0;
} }
static int __maybe_unused mtk_pmic_keys_suspend(struct device *dev) static int mtk_pmic_keys_suspend(struct device *dev)
{ {
struct mtk_pmic_keys *keys = dev_get_drvdata(dev); struct mtk_pmic_keys *keys = dev_get_drvdata(dev);
int index; int index;
...@@ -247,7 +247,7 @@ static int __maybe_unused mtk_pmic_keys_suspend(struct device *dev) ...@@ -247,7 +247,7 @@ static int __maybe_unused mtk_pmic_keys_suspend(struct device *dev)
return 0; return 0;
} }
static int __maybe_unused mtk_pmic_keys_resume(struct device *dev) static int mtk_pmic_keys_resume(struct device *dev)
{ {
struct mtk_pmic_keys *keys = dev_get_drvdata(dev); struct mtk_pmic_keys *keys = dev_get_drvdata(dev);
int index; int index;
...@@ -263,8 +263,8 @@ static int __maybe_unused mtk_pmic_keys_resume(struct device *dev) ...@@ -263,8 +263,8 @@ static int __maybe_unused mtk_pmic_keys_resume(struct device *dev)
return 0; return 0;
} }
static SIMPLE_DEV_PM_OPS(mtk_pmic_keys_pm_ops, mtk_pmic_keys_suspend, static DEFINE_SIMPLE_DEV_PM_OPS(mtk_pmic_keys_pm_ops, mtk_pmic_keys_suspend,
mtk_pmic_keys_resume); mtk_pmic_keys_resume);
static const struct of_device_id of_mtk_pmic_keys_match_tbl[] = { static const struct of_device_id of_mtk_pmic_keys_match_tbl[] = {
{ {
...@@ -387,7 +387,7 @@ static struct platform_driver pmic_keys_pdrv = { ...@@ -387,7 +387,7 @@ static struct platform_driver pmic_keys_pdrv = {
.driver = { .driver = {
.name = "mtk-pmic-keys", .name = "mtk-pmic-keys",
.of_match_table = of_mtk_pmic_keys_match_tbl, .of_match_table = of_mtk_pmic_keys_match_tbl,
.pm = &mtk_pmic_keys_pm_ops, .pm = pm_sleep_ptr(&mtk_pmic_keys_pm_ops),
}, },
}; };
......
...@@ -388,7 +388,6 @@ static int ske_keypad_remove(struct platform_device *pdev) ...@@ -388,7 +388,6 @@ static int ske_keypad_remove(struct platform_device *pdev)
return 0; return 0;
} }
#ifdef CONFIG_PM_SLEEP
static int ske_keypad_suspend(struct device *dev) static int ske_keypad_suspend(struct device *dev)
{ {
struct platform_device *pdev = to_platform_device(dev); struct platform_device *pdev = to_platform_device(dev);
...@@ -416,15 +415,14 @@ static int ske_keypad_resume(struct device *dev) ...@@ -416,15 +415,14 @@ static int ske_keypad_resume(struct device *dev)
return 0; return 0;
} }
#endif
static SIMPLE_DEV_PM_OPS(ske_keypad_dev_pm_ops, static DEFINE_SIMPLE_DEV_PM_OPS(ske_keypad_dev_pm_ops,
ske_keypad_suspend, ske_keypad_resume); ske_keypad_suspend, ske_keypad_resume);
static struct platform_driver ske_keypad_driver = { static struct platform_driver ske_keypad_driver = {
.driver = { .driver = {
.name = "nmk-ske-keypad", .name = "nmk-ske-keypad",
.pm = &ske_keypad_dev_pm_ops, .pm = pm_sleep_ptr(&ske_keypad_dev_pm_ops),
}, },
.remove = ske_keypad_remove, .remove = ske_keypad_remove,
}; };
......
...@@ -621,7 +621,6 @@ static int pmic8xxx_kp_probe(struct platform_device *pdev) ...@@ -621,7 +621,6 @@ static int pmic8xxx_kp_probe(struct platform_device *pdev)
return 0; return 0;
} }
#ifdef CONFIG_PM_SLEEP
static int pmic8xxx_kp_suspend(struct device *dev) static int pmic8xxx_kp_suspend(struct device *dev)
{ {
struct platform_device *pdev = to_platform_device(dev); struct platform_device *pdev = to_platform_device(dev);
...@@ -661,10 +660,9 @@ static int pmic8xxx_kp_resume(struct device *dev) ...@@ -661,10 +660,9 @@ static int pmic8xxx_kp_resume(struct device *dev)
return 0; return 0;
} }
#endif
static SIMPLE_DEV_PM_OPS(pm8xxx_kp_pm_ops, static DEFINE_SIMPLE_DEV_PM_OPS(pm8xxx_kp_pm_ops,
pmic8xxx_kp_suspend, pmic8xxx_kp_resume); pmic8xxx_kp_suspend, pmic8xxx_kp_resume);
static const struct of_device_id pm8xxx_match_table[] = { static const struct of_device_id pm8xxx_match_table[] = {
{ .compatible = "qcom,pm8058-keypad" }, { .compatible = "qcom,pm8058-keypad" },
...@@ -677,7 +675,7 @@ static struct platform_driver pmic8xxx_kp_driver = { ...@@ -677,7 +675,7 @@ static struct platform_driver pmic8xxx_kp_driver = {
.probe = pmic8xxx_kp_probe, .probe = pmic8xxx_kp_probe,
.driver = { .driver = {
.name = "pm8xxx-keypad", .name = "pm8xxx-keypad",
.pm = &pm8xxx_kp_pm_ops, .pm = pm_sleep_ptr(&pm8xxx_kp_pm_ops),
.of_match_table = pm8xxx_match_table, .of_match_table = pm8xxx_match_table,
}, },
}; };
......
...@@ -660,7 +660,6 @@ static void pxa27x_keypad_close(struct input_dev *dev) ...@@ -660,7 +660,6 @@ static void pxa27x_keypad_close(struct input_dev *dev)
clk_disable_unprepare(keypad->clk); clk_disable_unprepare(keypad->clk);
} }
#ifdef CONFIG_PM_SLEEP
static int pxa27x_keypad_suspend(struct device *dev) static int pxa27x_keypad_suspend(struct device *dev)
{ {
struct platform_device *pdev = to_platform_device(dev); struct platform_device *pdev = to_platform_device(dev);
...@@ -706,10 +705,9 @@ static int pxa27x_keypad_resume(struct device *dev) ...@@ -706,10 +705,9 @@ static int pxa27x_keypad_resume(struct device *dev)
return ret; return ret;
} }
#endif
static SIMPLE_DEV_PM_OPS(pxa27x_keypad_pm_ops, static DEFINE_SIMPLE_DEV_PM_OPS(pxa27x_keypad_pm_ops,
pxa27x_keypad_suspend, pxa27x_keypad_resume); pxa27x_keypad_suspend, pxa27x_keypad_resume);
static int pxa27x_keypad_probe(struct platform_device *pdev) static int pxa27x_keypad_probe(struct platform_device *pdev)
...@@ -830,7 +828,7 @@ static struct platform_driver pxa27x_keypad_driver = { ...@@ -830,7 +828,7 @@ static struct platform_driver pxa27x_keypad_driver = {
.driver = { .driver = {
.name = "pxa27x-keypad", .name = "pxa27x-keypad",
.of_match_table = of_match_ptr(pxa27x_keypad_dt_match), .of_match_table = of_match_ptr(pxa27x_keypad_dt_match),
.pm = &pxa27x_keypad_pm_ops, .pm = pm_sleep_ptr(&pxa27x_keypad_pm_ops),
}, },
}; };
module_platform_driver(pxa27x_keypad_driver); module_platform_driver(pxa27x_keypad_driver);
......
...@@ -547,7 +547,7 @@ static int qt1050_probe(struct i2c_client *client) ...@@ -547,7 +547,7 @@ static int qt1050_probe(struct i2c_client *client)
return 0; return 0;
} }
static int __maybe_unused qt1050_suspend(struct device *dev) static int qt1050_suspend(struct device *dev)
{ {
struct i2c_client *client = to_i2c_client(dev); struct i2c_client *client = to_i2c_client(dev);
struct qt1050_priv *ts = i2c_get_clientdata(client); struct qt1050_priv *ts = i2c_get_clientdata(client);
...@@ -563,7 +563,7 @@ static int __maybe_unused qt1050_suspend(struct device *dev) ...@@ -563,7 +563,7 @@ static int __maybe_unused qt1050_suspend(struct device *dev)
device_may_wakeup(dev) ? 125 : 0); device_may_wakeup(dev) ? 125 : 0);
} }
static int __maybe_unused qt1050_resume(struct device *dev) static int qt1050_resume(struct device *dev)
{ {
struct i2c_client *client = to_i2c_client(dev); struct i2c_client *client = to_i2c_client(dev);
struct qt1050_priv *ts = i2c_get_clientdata(client); struct qt1050_priv *ts = i2c_get_clientdata(client);
...@@ -574,7 +574,7 @@ static int __maybe_unused qt1050_resume(struct device *dev) ...@@ -574,7 +574,7 @@ static int __maybe_unused qt1050_resume(struct device *dev)
return regmap_write(ts->regmap, QT1050_LPMODE, 2); return regmap_write(ts->regmap, QT1050_LPMODE, 2);
} }
static SIMPLE_DEV_PM_OPS(qt1050_pm_ops, qt1050_suspend, qt1050_resume); static DEFINE_SIMPLE_DEV_PM_OPS(qt1050_pm_ops, qt1050_suspend, qt1050_resume);
static const struct of_device_id __maybe_unused qt1050_of_match[] = { static const struct of_device_id __maybe_unused qt1050_of_match[] = {
{ .compatible = "microchip,qt1050", }, { .compatible = "microchip,qt1050", },
...@@ -586,7 +586,7 @@ static struct i2c_driver qt1050_driver = { ...@@ -586,7 +586,7 @@ static struct i2c_driver qt1050_driver = {
.driver = { .driver = {
.name = "qt1050", .name = "qt1050",
.of_match_table = of_match_ptr(qt1050_of_match), .of_match_table = of_match_ptr(qt1050_of_match),
.pm = &qt1050_pm_ops, .pm = pm_sleep_ptr(&qt1050_pm_ops),
}, },
.probe_new = qt1050_probe, .probe_new = qt1050_probe,
}; };
......
...@@ -126,8 +126,7 @@ static irqreturn_t qt1070_interrupt(int irq, void *dev_id) ...@@ -126,8 +126,7 @@ static irqreturn_t qt1070_interrupt(int irq, void *dev_id)
return IRQ_HANDLED; return IRQ_HANDLED;
} }
static int qt1070_probe(struct i2c_client *client, static int qt1070_probe(struct i2c_client *client)
const struct i2c_device_id *id)
{ {
struct qt1070_data *data; struct qt1070_data *data;
struct input_dev *input; struct input_dev *input;
...@@ -227,7 +226,6 @@ static void qt1070_remove(struct i2c_client *client) ...@@ -227,7 +226,6 @@ static void qt1070_remove(struct i2c_client *client)
kfree(data); kfree(data);
} }
#ifdef CONFIG_PM_SLEEP
static int qt1070_suspend(struct device *dev) static int qt1070_suspend(struct device *dev)
{ {
struct i2c_client *client = to_i2c_client(dev); struct i2c_client *client = to_i2c_client(dev);
...@@ -249,9 +247,8 @@ static int qt1070_resume(struct device *dev) ...@@ -249,9 +247,8 @@ static int qt1070_resume(struct device *dev)
return 0; return 0;
} }
#endif
static SIMPLE_DEV_PM_OPS(qt1070_pm_ops, qt1070_suspend, qt1070_resume); static DEFINE_SIMPLE_DEV_PM_OPS(qt1070_pm_ops, qt1070_suspend, qt1070_resume);
static const struct i2c_device_id qt1070_id[] = { static const struct i2c_device_id qt1070_id[] = {
{ "qt1070", 0 }, { "qt1070", 0 },
...@@ -271,10 +268,10 @@ static struct i2c_driver qt1070_driver = { ...@@ -271,10 +268,10 @@ static struct i2c_driver qt1070_driver = {
.driver = { .driver = {
.name = "qt1070", .name = "qt1070",
.of_match_table = of_match_ptr(qt1070_of_match), .of_match_table = of_match_ptr(qt1070_of_match),
.pm = &qt1070_pm_ops, .pm = pm_sleep_ptr(&qt1070_pm_ops),
}, },
.id_table = qt1070_id, .id_table = qt1070_id,
.probe = qt1070_probe, .probe_new = qt1070_probe,
.remove = qt1070_remove, .remove = qt1070_remove,
}; };
......
...@@ -338,8 +338,7 @@ static bool qt2160_identify(struct i2c_client *client) ...@@ -338,8 +338,7 @@ static bool qt2160_identify(struct i2c_client *client)
return true; return true;
} }
static int qt2160_probe(struct i2c_client *client, static int qt2160_probe(struct i2c_client *client)
const struct i2c_device_id *id)
{ {
struct qt2160_data *qt2160; struct qt2160_data *qt2160;
struct input_dev *input; struct input_dev *input;
...@@ -461,7 +460,7 @@ static struct i2c_driver qt2160_driver = { ...@@ -461,7 +460,7 @@ static struct i2c_driver qt2160_driver = {
}, },
.id_table = qt2160_idtable, .id_table = qt2160_idtable,
.probe = qt2160_probe, .probe_new = qt2160_probe,
.remove = qt2160_remove, .remove = qt2160_remove,
}; };
......
...@@ -283,7 +283,6 @@ static int sh_keysc_remove(struct platform_device *pdev) ...@@ -283,7 +283,6 @@ static int sh_keysc_remove(struct platform_device *pdev)
return 0; return 0;
} }
#ifdef CONFIG_PM_SLEEP
static int sh_keysc_suspend(struct device *dev) static int sh_keysc_suspend(struct device *dev)
{ {
struct platform_device *pdev = to_platform_device(dev); struct platform_device *pdev = to_platform_device(dev);
...@@ -316,17 +315,16 @@ static int sh_keysc_resume(struct device *dev) ...@@ -316,17 +315,16 @@ static int sh_keysc_resume(struct device *dev)
return 0; return 0;
} }
#endif
static SIMPLE_DEV_PM_OPS(sh_keysc_dev_pm_ops, static DEFINE_SIMPLE_DEV_PM_OPS(sh_keysc_dev_pm_ops,
sh_keysc_suspend, sh_keysc_resume); sh_keysc_suspend, sh_keysc_resume);
static struct platform_driver sh_keysc_device_driver = { static struct platform_driver sh_keysc_device_driver = {
.probe = sh_keysc_probe, .probe = sh_keysc_probe,
.remove = sh_keysc_remove, .remove = sh_keysc_remove,
.driver = { .driver = {
.name = "sh_keysc", .name = "sh_keysc",
.pm = &sh_keysc_dev_pm_ops, .pm = pm_sleep_ptr(&sh_keysc_dev_pm_ops),
} }
}; };
module_platform_driver(sh_keysc_device_driver); module_platform_driver(sh_keysc_device_driver);
......
...@@ -284,7 +284,7 @@ static int spear_kbd_remove(struct platform_device *pdev) ...@@ -284,7 +284,7 @@ static int spear_kbd_remove(struct platform_device *pdev)
return 0; return 0;
} }
static int __maybe_unused spear_kbd_suspend(struct device *dev) static int spear_kbd_suspend(struct device *dev)
{ {
struct platform_device *pdev = to_platform_device(dev); struct platform_device *pdev = to_platform_device(dev);
struct spear_kbd *kbd = platform_get_drvdata(pdev); struct spear_kbd *kbd = platform_get_drvdata(pdev);
...@@ -337,7 +337,7 @@ static int __maybe_unused spear_kbd_suspend(struct device *dev) ...@@ -337,7 +337,7 @@ static int __maybe_unused spear_kbd_suspend(struct device *dev)
return 0; return 0;
} }
static int __maybe_unused spear_kbd_resume(struct device *dev) static int spear_kbd_resume(struct device *dev)
{ {
struct platform_device *pdev = to_platform_device(dev); struct platform_device *pdev = to_platform_device(dev);
struct spear_kbd *kbd = platform_get_drvdata(pdev); struct spear_kbd *kbd = platform_get_drvdata(pdev);
...@@ -364,7 +364,8 @@ static int __maybe_unused spear_kbd_resume(struct device *dev) ...@@ -364,7 +364,8 @@ static int __maybe_unused spear_kbd_resume(struct device *dev)
return 0; return 0;
} }
static SIMPLE_DEV_PM_OPS(spear_kbd_pm_ops, spear_kbd_suspend, spear_kbd_resume); static DEFINE_SIMPLE_DEV_PM_OPS(spear_kbd_pm_ops,
spear_kbd_suspend, spear_kbd_resume);
#ifdef CONFIG_OF #ifdef CONFIG_OF
static const struct of_device_id spear_kbd_id_table[] = { static const struct of_device_id spear_kbd_id_table[] = {
...@@ -379,7 +380,7 @@ static struct platform_driver spear_kbd_driver = { ...@@ -379,7 +380,7 @@ static struct platform_driver spear_kbd_driver = {
.remove = spear_kbd_remove, .remove = spear_kbd_remove,
.driver = { .driver = {
.name = "keyboard", .name = "keyboard",
.pm = &spear_kbd_pm_ops, .pm = pm_sleep_ptr(&spear_kbd_pm_ops),
.of_match_table = of_match_ptr(spear_kbd_id_table), .of_match_table = of_match_ptr(spear_kbd_id_table),
}, },
}; };
......
...@@ -212,7 +212,6 @@ static int keyscan_probe(struct platform_device *pdev) ...@@ -212,7 +212,6 @@ static int keyscan_probe(struct platform_device *pdev)
return 0; return 0;
} }
#ifdef CONFIG_PM_SLEEP
static int keyscan_suspend(struct device *dev) static int keyscan_suspend(struct device *dev)
{ {
struct platform_device *pdev = to_platform_device(dev); struct platform_device *pdev = to_platform_device(dev);
...@@ -247,9 +246,9 @@ static int keyscan_resume(struct device *dev) ...@@ -247,9 +246,9 @@ static int keyscan_resume(struct device *dev)
mutex_unlock(&input->mutex); mutex_unlock(&input->mutex);
return retval; return retval;
} }
#endif
static SIMPLE_DEV_PM_OPS(keyscan_dev_pm_ops, keyscan_suspend, keyscan_resume); static DEFINE_SIMPLE_DEV_PM_OPS(keyscan_dev_pm_ops,
keyscan_suspend, keyscan_resume);
static const struct of_device_id keyscan_of_match[] = { static const struct of_device_id keyscan_of_match[] = {
{ .compatible = "st,sti-keyscan" }, { .compatible = "st,sti-keyscan" },
...@@ -261,7 +260,7 @@ static struct platform_driver keyscan_device_driver = { ...@@ -261,7 +260,7 @@ static struct platform_driver keyscan_device_driver = {
.probe = keyscan_probe, .probe = keyscan_probe,
.driver = { .driver = {
.name = "st-keyscan", .name = "st-keyscan",
.pm = &keyscan_dev_pm_ops, .pm = pm_sleep_ptr(&keyscan_dev_pm_ops),
.of_match_table = of_match_ptr(keyscan_of_match), .of_match_table = of_match_ptr(keyscan_of_match),
} }
}; };
......
...@@ -9,6 +9,7 @@ ...@@ -9,6 +9,7 @@
#include <linux/slab.h> #include <linux/slab.h>
#include <linux/input.h> #include <linux/input.h>
#include <linux/interrupt.h> #include <linux/interrupt.h>
#include <linux/of.h>
#include <linux/platform_device.h> #include <linux/platform_device.h>
#include <linux/input/matrix_keypad.h> #include <linux/input/matrix_keypad.h>
#include <linux/mfd/stmpe.h> #include <linux/mfd/stmpe.h>
......
...@@ -455,7 +455,6 @@ static int tc3589x_keypad_probe(struct platform_device *pdev) ...@@ -455,7 +455,6 @@ static int tc3589x_keypad_probe(struct platform_device *pdev)
return 0; return 0;
} }
#ifdef CONFIG_PM_SLEEP
static int tc3589x_keypad_suspend(struct device *dev) static int tc3589x_keypad_suspend(struct device *dev)
{ {
struct platform_device *pdev = to_platform_device(dev); struct platform_device *pdev = to_platform_device(dev);
...@@ -492,15 +491,14 @@ static int tc3589x_keypad_resume(struct device *dev) ...@@ -492,15 +491,14 @@ static int tc3589x_keypad_resume(struct device *dev)
return 0; return 0;
} }
#endif
static SIMPLE_DEV_PM_OPS(tc3589x_keypad_dev_pm_ops, static DEFINE_SIMPLE_DEV_PM_OPS(tc3589x_keypad_dev_pm_ops,
tc3589x_keypad_suspend, tc3589x_keypad_resume); tc3589x_keypad_suspend, tc3589x_keypad_resume);
static struct platform_driver tc3589x_keypad_driver = { static struct platform_driver tc3589x_keypad_driver = {
.driver = { .driver = {
.name = "tc3589x-keypad", .name = "tc3589x-keypad",
.pm = &tc3589x_keypad_dev_pm_ops, .pm = pm_sleep_ptr(&tc3589x_keypad_dev_pm_ops),
}, },
.probe = tc3589x_keypad_probe, .probe = tc3589x_keypad_probe,
}; };
......
...@@ -194,9 +194,9 @@ static int tca6416_setup_registers(struct tca6416_keypad_chip *chip) ...@@ -194,9 +194,9 @@ static int tca6416_setup_registers(struct tca6416_keypad_chip *chip)
return 0; return 0;
} }
static int tca6416_keypad_probe(struct i2c_client *client, static int tca6416_keypad_probe(struct i2c_client *client)
const struct i2c_device_id *id)
{ {
const struct i2c_device_id *id = i2c_client_get_device_id(client);
struct tca6416_keys_platform_data *pdata; struct tca6416_keys_platform_data *pdata;
struct tca6416_keypad_chip *chip; struct tca6416_keypad_chip *chip;
struct input_dev *input; struct input_dev *input;
...@@ -320,7 +320,6 @@ static void tca6416_keypad_remove(struct i2c_client *client) ...@@ -320,7 +320,6 @@ static void tca6416_keypad_remove(struct i2c_client *client)
kfree(chip); kfree(chip);
} }
#ifdef CONFIG_PM_SLEEP
static int tca6416_keypad_suspend(struct device *dev) static int tca6416_keypad_suspend(struct device *dev)
{ {
struct i2c_client *client = to_i2c_client(dev); struct i2c_client *client = to_i2c_client(dev);
...@@ -342,17 +341,16 @@ static int tca6416_keypad_resume(struct device *dev) ...@@ -342,17 +341,16 @@ static int tca6416_keypad_resume(struct device *dev)
return 0; return 0;
} }
#endif
static SIMPLE_DEV_PM_OPS(tca6416_keypad_dev_pm_ops, static DEFINE_SIMPLE_DEV_PM_OPS(tca6416_keypad_dev_pm_ops,
tca6416_keypad_suspend, tca6416_keypad_resume); tca6416_keypad_suspend, tca6416_keypad_resume);
static struct i2c_driver tca6416_keypad_driver = { static struct i2c_driver tca6416_keypad_driver = {
.driver = { .driver = {
.name = "tca6416-keypad", .name = "tca6416-keypad",
.pm = &tca6416_keypad_dev_pm_ops, .pm = pm_sleep_ptr(&tca6416_keypad_dev_pm_ops),
}, },
.probe = tca6416_keypad_probe, .probe_new = tca6416_keypad_probe,
.remove = tca6416_keypad_remove, .remove = tca6416_keypad_remove,
.id_table = tca6416_id, .id_table = tca6416_id,
}; };
......
...@@ -259,8 +259,7 @@ static int tca8418_configure(struct tca8418_keypad *keypad_data, ...@@ -259,8 +259,7 @@ static int tca8418_configure(struct tca8418_keypad *keypad_data,
return error; return error;
} }
static int tca8418_keypad_probe(struct i2c_client *client, static int tca8418_keypad_probe(struct i2c_client *client)
const struct i2c_device_id *id)
{ {
struct device *dev = &client->dev; struct device *dev = &client->dev;
struct tca8418_keypad *keypad_data; struct tca8418_keypad *keypad_data;
...@@ -371,7 +370,7 @@ static struct i2c_driver tca8418_keypad_driver = { ...@@ -371,7 +370,7 @@ static struct i2c_driver tca8418_keypad_driver = {
.name = "tca8418_keypad", .name = "tca8418_keypad",
.of_match_table = tca8418_dt_ids, .of_match_table = tca8418_dt_ids,
}, },
.probe = tca8418_keypad_probe, .probe_new = tca8418_keypad_probe,
.id_table = tca8418_id, .id_table = tca8418_id,
}; };
......
...@@ -713,7 +713,6 @@ static int tegra_kbc_probe(struct platform_device *pdev) ...@@ -713,7 +713,6 @@ static int tegra_kbc_probe(struct platform_device *pdev)
return 0; return 0;
} }
#ifdef CONFIG_PM_SLEEP
static void tegra_kbc_set_keypress_interrupt(struct tegra_kbc *kbc, bool enable) static void tegra_kbc_set_keypress_interrupt(struct tegra_kbc *kbc, bool enable)
{ {
u32 val; u32 val;
...@@ -802,15 +801,15 @@ static int tegra_kbc_resume(struct device *dev) ...@@ -802,15 +801,15 @@ static int tegra_kbc_resume(struct device *dev)
return err; return err;
} }
#endif
static SIMPLE_DEV_PM_OPS(tegra_kbc_pm_ops, tegra_kbc_suspend, tegra_kbc_resume); static DEFINE_SIMPLE_DEV_PM_OPS(tegra_kbc_pm_ops,
tegra_kbc_suspend, tegra_kbc_resume);
static struct platform_driver tegra_kbc_driver = { static struct platform_driver tegra_kbc_driver = {
.probe = tegra_kbc_probe, .probe = tegra_kbc_probe,
.driver = { .driver = {
.name = "tegra-kbc", .name = "tegra-kbc",
.pm = &tegra_kbc_pm_ops, .pm = pm_sleep_ptr(&tegra_kbc_pm_ops),
.of_match_table = tegra_kbc_of_match, .of_match_table = tegra_kbc_of_match,
}, },
}; };
......
...@@ -181,8 +181,7 @@ static irqreturn_t tm2_touchkey_irq_handler(int irq, void *devid) ...@@ -181,8 +181,7 @@ static irqreturn_t tm2_touchkey_irq_handler(int irq, void *devid)
return IRQ_HANDLED; return IRQ_HANDLED;
} }
static int tm2_touchkey_probe(struct i2c_client *client, static int tm2_touchkey_probe(struct i2c_client *client)
const struct i2c_device_id *id)
{ {
struct device_node *np = client->dev.of_node; struct device_node *np = client->dev.of_node;
struct tm2_touchkey_data *touchkey; struct tm2_touchkey_data *touchkey;
...@@ -298,7 +297,7 @@ static int tm2_touchkey_probe(struct i2c_client *client, ...@@ -298,7 +297,7 @@ static int tm2_touchkey_probe(struct i2c_client *client,
return 0; return 0;
} }
static int __maybe_unused tm2_touchkey_suspend(struct device *dev) static int tm2_touchkey_suspend(struct device *dev)
{ {
struct i2c_client *client = to_i2c_client(dev); struct i2c_client *client = to_i2c_client(dev);
struct tm2_touchkey_data *touchkey = i2c_get_clientdata(client); struct tm2_touchkey_data *touchkey = i2c_get_clientdata(client);
...@@ -309,7 +308,7 @@ static int __maybe_unused tm2_touchkey_suspend(struct device *dev) ...@@ -309,7 +308,7 @@ static int __maybe_unused tm2_touchkey_suspend(struct device *dev)
return 0; return 0;
} }
static int __maybe_unused tm2_touchkey_resume(struct device *dev) static int tm2_touchkey_resume(struct device *dev)
{ {
struct i2c_client *client = to_i2c_client(dev); struct i2c_client *client = to_i2c_client(dev);
struct tm2_touchkey_data *touchkey = i2c_get_clientdata(client); struct tm2_touchkey_data *touchkey = i2c_get_clientdata(client);
...@@ -324,8 +323,8 @@ static int __maybe_unused tm2_touchkey_resume(struct device *dev) ...@@ -324,8 +323,8 @@ static int __maybe_unused tm2_touchkey_resume(struct device *dev)
return ret; return ret;
} }
static SIMPLE_DEV_PM_OPS(tm2_touchkey_pm_ops, static DEFINE_SIMPLE_DEV_PM_OPS(tm2_touchkey_pm_ops,
tm2_touchkey_suspend, tm2_touchkey_resume); tm2_touchkey_suspend, tm2_touchkey_resume);
static const struct i2c_device_id tm2_touchkey_id_table[] = { static const struct i2c_device_id tm2_touchkey_id_table[] = {
{ TM2_TOUCHKEY_DEV_NAME, 0 }, { TM2_TOUCHKEY_DEV_NAME, 0 },
...@@ -354,10 +353,10 @@ MODULE_DEVICE_TABLE(of, tm2_touchkey_of_match); ...@@ -354,10 +353,10 @@ MODULE_DEVICE_TABLE(of, tm2_touchkey_of_match);
static struct i2c_driver tm2_touchkey_driver = { static struct i2c_driver tm2_touchkey_driver = {
.driver = { .driver = {
.name = TM2_TOUCHKEY_DEV_NAME, .name = TM2_TOUCHKEY_DEV_NAME,
.pm = &tm2_touchkey_pm_ops, .pm = pm_sleep_ptr(&tm2_touchkey_pm_ops),
.of_match_table = of_match_ptr(tm2_touchkey_of_match), .of_match_table = of_match_ptr(tm2_touchkey_of_match),
}, },
.probe = tm2_touchkey_probe, .probe_new = tm2_touchkey_probe,
.id_table = tm2_touchkey_id_table, .id_table = tm2_touchkey_id_table,
}; };
module_i2c_driver(tm2_touchkey_driver); module_i2c_driver(tm2_touchkey_driver);
......
...@@ -107,7 +107,7 @@ config INPUT_ATC260X_ONKEY ...@@ -107,7 +107,7 @@ config INPUT_ATC260X_ONKEY
config INPUT_ATMEL_CAPTOUCH config INPUT_ATMEL_CAPTOUCH
tristate "Atmel Capacitive Touch Button Driver" tristate "Atmel Capacitive Touch Button Driver"
depends on OF || COMPILE_TEST depends on OF
depends on I2C depends on I2C
help help
Say Y here if an Atmel Capacitive Touch Button device which Say Y here if an Atmel Capacitive Touch Button device which
...@@ -330,7 +330,7 @@ config INPUT_CPCAP_PWRBUTTON ...@@ -330,7 +330,7 @@ config INPUT_CPCAP_PWRBUTTON
config INPUT_WISTRON_BTNS config INPUT_WISTRON_BTNS
tristate "x86 Wistron laptop button interface" tristate "x86 Wistron laptop button interface"
depends on X86_32 depends on X86_32 && !UML
select INPUT_SPARSEKMAP select INPUT_SPARSEKMAP
select NEW_LEDS select NEW_LEDS
select LEDS_CLASS select LEDS_CLASS
......
...@@ -69,8 +69,7 @@ static int ad714x_i2c_read(struct ad714x_chip *chip, ...@@ -69,8 +69,7 @@ static int ad714x_i2c_read(struct ad714x_chip *chip,
return 0; return 0;
} }
static int ad714x_i2c_probe(struct i2c_client *client, static int ad714x_i2c_probe(struct i2c_client *client)
const struct i2c_device_id *id)
{ {
struct ad714x_chip *chip; struct ad714x_chip *chip;
...@@ -99,7 +98,7 @@ static struct i2c_driver ad714x_i2c_driver = { ...@@ -99,7 +98,7 @@ static struct i2c_driver ad714x_i2c_driver = {
.name = "ad714x_captouch", .name = "ad714x_captouch",
.pm = &ad714x_i2c_pm, .pm = &ad714x_i2c_pm,
}, },
.probe = ad714x_i2c_probe, .probe_new = ad714x_i2c_probe,
.id_table = ad714x_id, .id_table = ad714x_id,
}; };
......
...@@ -74,8 +74,7 @@ static const struct adxl34x_bus_ops adxl34x_i2c_bops = { ...@@ -74,8 +74,7 @@ static const struct adxl34x_bus_ops adxl34x_i2c_bops = {
.read_block = adxl34x_i2c_read_block, .read_block = adxl34x_i2c_read_block,
}; };
static int adxl34x_i2c_probe(struct i2c_client *client, static int adxl34x_i2c_probe(struct i2c_client *client)
const struct i2c_device_id *id)
{ {
struct adxl34x *ac; struct adxl34x *ac;
int error; int error;
...@@ -159,7 +158,7 @@ static struct i2c_driver adxl34x_driver = { ...@@ -159,7 +158,7 @@ static struct i2c_driver adxl34x_driver = {
.pm = &adxl34x_i2c_pm, .pm = &adxl34x_i2c_pm,
.of_match_table = adxl34x_of_id, .of_match_table = adxl34x_of_id,
}, },
.probe = adxl34x_i2c_probe, .probe_new = adxl34x_i2c_probe,
.remove = adxl34x_i2c_remove, .remove = adxl34x_i2c_remove,
.id_table = adxl34x_id, .id_table = adxl34x_id,
}; };
......
...@@ -120,8 +120,7 @@ static int mail_led_set(struct led_classdev *led, ...@@ -120,8 +120,7 @@ static int mail_led_set(struct led_classdev *led,
return i2c_smbus_write_word_data(ap->client, 0x10, led_bits); return i2c_smbus_write_word_data(ap->client, 0x10, led_bits);
} }
static int apanel_probe(struct i2c_client *client, static int apanel_probe(struct i2c_client *client)
const struct i2c_device_id *id)
{ {
struct apanel *ap; struct apanel *ap;
struct input_dev *idev; struct input_dev *idev;
...@@ -202,7 +201,7 @@ static struct i2c_driver apanel_driver = { ...@@ -202,7 +201,7 @@ static struct i2c_driver apanel_driver = {
.driver = { .driver = {
.name = APANEL, .name = APANEL,
}, },
.probe = apanel_probe, .probe_new = apanel_probe,
.shutdown = apanel_shutdown, .shutdown = apanel_shutdown,
.id_table = apanel_id, .id_table = apanel_id,
}; };
......
...@@ -161,8 +161,7 @@ static irqreturn_t atmel_captouch_isr(int irq, void *data) ...@@ -161,8 +161,7 @@ static irqreturn_t atmel_captouch_isr(int irq, void *data)
/* /*
* Probe function to setup the device, input system and interrupt * Probe function to setup the device, input system and interrupt
*/ */
static int atmel_captouch_probe(struct i2c_client *client, static int atmel_captouch_probe(struct i2c_client *client)
const struct i2c_device_id *id)
{ {
struct atmel_captouch_device *capdev; struct atmel_captouch_device *capdev;
struct device *dev = &client->dev; struct device *dev = &client->dev;
...@@ -249,7 +248,6 @@ static int atmel_captouch_probe(struct i2c_client *client, ...@@ -249,7 +248,6 @@ static int atmel_captouch_probe(struct i2c_client *client,
return 0; return 0;
} }
#ifdef CONFIG_OF
static const struct of_device_id atmel_captouch_of_id[] = { static const struct of_device_id atmel_captouch_of_id[] = {
{ {
.compatible = "atmel,captouch", .compatible = "atmel,captouch",
...@@ -257,7 +255,6 @@ static const struct of_device_id atmel_captouch_of_id[] = { ...@@ -257,7 +255,6 @@ static const struct of_device_id atmel_captouch_of_id[] = {
{ /* sentinel */ } { /* sentinel */ }
}; };
MODULE_DEVICE_TABLE(of, atmel_captouch_of_id); MODULE_DEVICE_TABLE(of, atmel_captouch_of_id);
#endif
static const struct i2c_device_id atmel_captouch_id[] = { static const struct i2c_device_id atmel_captouch_id[] = {
{ "atmel_captouch", 0 }, { "atmel_captouch", 0 },
...@@ -266,11 +263,11 @@ static const struct i2c_device_id atmel_captouch_id[] = { ...@@ -266,11 +263,11 @@ static const struct i2c_device_id atmel_captouch_id[] = {
MODULE_DEVICE_TABLE(i2c, atmel_captouch_id); MODULE_DEVICE_TABLE(i2c, atmel_captouch_id);
static struct i2c_driver atmel_captouch_driver = { static struct i2c_driver atmel_captouch_driver = {
.probe = atmel_captouch_probe, .probe_new = atmel_captouch_probe,
.id_table = atmel_captouch_id, .id_table = atmel_captouch_id,
.driver = { .driver = {
.name = "atmel_captouch", .name = "atmel_captouch",
.of_match_table = of_match_ptr(atmel_captouch_of_id), .of_match_table = atmel_captouch_of_id,
}, },
}; };
module_i2c_driver(atmel_captouch_driver); module_i2c_driver(atmel_captouch_driver);
......
...@@ -414,8 +414,7 @@ static int bma150_initialize(struct bma150_data *bma150, ...@@ -414,8 +414,7 @@ static int bma150_initialize(struct bma150_data *bma150,
return bma150_set_mode(bma150, BMA150_MODE_SLEEP); return bma150_set_mode(bma150, BMA150_MODE_SLEEP);
} }
static int bma150_probe(struct i2c_client *client, static int bma150_probe(struct i2c_client *client)
const struct i2c_device_id *id)
{ {
const struct bma150_platform_data *pdata = const struct bma150_platform_data *pdata =
dev_get_platdata(&client->dev); dev_get_platdata(&client->dev);
...@@ -552,7 +551,7 @@ static struct i2c_driver bma150_driver = { ...@@ -552,7 +551,7 @@ static struct i2c_driver bma150_driver = {
}, },
.class = I2C_CLASS_HWMON, .class = I2C_CLASS_HWMON,
.id_table = bma150_id, .id_table = bma150_id,
.probe = bma150_probe, .probe_new = bma150_probe,
.remove = bma150_remove, .remove = bma150_remove,
}; };
......
...@@ -44,8 +44,7 @@ static const struct cma3000_bus_ops cma3000_i2c_bops = { ...@@ -44,8 +44,7 @@ static const struct cma3000_bus_ops cma3000_i2c_bops = {
.write = cma3000_i2c_set, .write = cma3000_i2c_set,
}; };
static int cma3000_i2c_probe(struct i2c_client *client, static int cma3000_i2c_probe(struct i2c_client *client)
const struct i2c_device_id *id)
{ {
struct cma3000_accl_data *data; struct cma3000_accl_data *data;
...@@ -100,7 +99,7 @@ static const struct i2c_device_id cma3000_i2c_id[] = { ...@@ -100,7 +99,7 @@ static const struct i2c_device_id cma3000_i2c_id[] = {
MODULE_DEVICE_TABLE(i2c, cma3000_i2c_id); MODULE_DEVICE_TABLE(i2c, cma3000_i2c_id);
static struct i2c_driver cma3000_i2c_driver = { static struct i2c_driver cma3000_i2c_driver = {
.probe = cma3000_i2c_probe, .probe_new = cma3000_i2c_probe,
.remove = cma3000_i2c_remove, .remove = cma3000_i2c_remove,
.id_table = cma3000_i2c_id, .id_table = cma3000_i2c_id,
.driver = { .driver = {
......
...@@ -1140,8 +1140,7 @@ static int da7280_init(struct da7280_haptic *haptics) ...@@ -1140,8 +1140,7 @@ static int da7280_init(struct da7280_haptic *haptics)
return error; return error;
} }
static int da7280_probe(struct i2c_client *client, static int da7280_probe(struct i2c_client *client)
const struct i2c_device_id *id)
{ {
struct device *dev = &client->dev; struct device *dev = &client->dev;
struct da7280_haptic *haptics; struct da7280_haptic *haptics;
...@@ -1322,7 +1321,7 @@ static struct i2c_driver da7280_driver = { ...@@ -1322,7 +1321,7 @@ static struct i2c_driver da7280_driver = {
.of_match_table = of_match_ptr(da7280_of_match), .of_match_table = of_match_ptr(da7280_of_match),
.pm = &da7280_pm_ops, .pm = &da7280_pm_ops,
}, },
.probe = da7280_probe, .probe_new = da7280_probe,
.id_table = da7280_i2c_id, .id_table = da7280_i2c_id,
}; };
module_i2c_driver(da7280_driver); module_i2c_driver(da7280_driver);
......
...@@ -457,8 +457,7 @@ static const struct regmap_config drv260x_regmap_config = { ...@@ -457,8 +457,7 @@ static const struct regmap_config drv260x_regmap_config = {
.cache_type = REGCACHE_NONE, .cache_type = REGCACHE_NONE,
}; };
static int drv260x_probe(struct i2c_client *client, static int drv260x_probe(struct i2c_client *client)
const struct i2c_device_id *id)
{ {
struct device *dev = &client->dev; struct device *dev = &client->dev;
struct drv260x_data *haptics; struct drv260x_data *haptics;
...@@ -654,7 +653,7 @@ static const struct of_device_id drv260x_of_match[] = { ...@@ -654,7 +653,7 @@ static const struct of_device_id drv260x_of_match[] = {
MODULE_DEVICE_TABLE(of, drv260x_of_match); MODULE_DEVICE_TABLE(of, drv260x_of_match);
static struct i2c_driver drv260x_driver = { static struct i2c_driver drv260x_driver = {
.probe = drv260x_probe, .probe_new = drv260x_probe,
.driver = { .driver = {
.name = "drv260x-haptics", .name = "drv260x-haptics",
.of_match_table = drv260x_of_match, .of_match_table = drv260x_of_match,
......
...@@ -156,8 +156,7 @@ static const struct regmap_config drv2665_regmap_config = { ...@@ -156,8 +156,7 @@ static const struct regmap_config drv2665_regmap_config = {
.cache_type = REGCACHE_NONE, .cache_type = REGCACHE_NONE,
}; };
static int drv2665_probe(struct i2c_client *client, static int drv2665_probe(struct i2c_client *client)
const struct i2c_device_id *id)
{ {
struct drv2665_data *haptics; struct drv2665_data *haptics;
int error; int error;
...@@ -298,7 +297,7 @@ MODULE_DEVICE_TABLE(of, drv2665_of_match); ...@@ -298,7 +297,7 @@ MODULE_DEVICE_TABLE(of, drv2665_of_match);
#endif #endif
static struct i2c_driver drv2665_driver = { static struct i2c_driver drv2665_driver = {
.probe = drv2665_probe, .probe_new = drv2665_probe,
.driver = { .driver = {
.name = "drv2665-haptics", .name = "drv2665-haptics",
.of_match_table = of_match_ptr(drv2665_of_match), .of_match_table = of_match_ptr(drv2665_of_match),
......
...@@ -333,8 +333,7 @@ static const struct regmap_config drv2667_regmap_config = { ...@@ -333,8 +333,7 @@ static const struct regmap_config drv2667_regmap_config = {
.cache_type = REGCACHE_NONE, .cache_type = REGCACHE_NONE,
}; };
static int drv2667_probe(struct i2c_client *client, static int drv2667_probe(struct i2c_client *client)
const struct i2c_device_id *id)
{ {
struct drv2667_data *haptics; struct drv2667_data *haptics;
int error; int error;
...@@ -475,7 +474,7 @@ MODULE_DEVICE_TABLE(of, drv2667_of_match); ...@@ -475,7 +474,7 @@ MODULE_DEVICE_TABLE(of, drv2667_of_match);
#endif #endif
static struct i2c_driver drv2667_driver = { static struct i2c_driver drv2667_driver = {
.probe = drv2667_probe, .probe_new = drv2667_probe,
.driver = { .driver = {
.name = "drv2667-haptics", .name = "drv2667-haptics",
.of_match_table = of_match_ptr(drv2667_of_match), .of_match_table = of_match_ptr(drv2667_of_match),
......
...@@ -119,8 +119,7 @@ static int ibm_panel_i2c_slave_cb(struct i2c_client *client, ...@@ -119,8 +119,7 @@ static int ibm_panel_i2c_slave_cb(struct i2c_client *client,
return 0; return 0;
} }
static int ibm_panel_probe(struct i2c_client *client, static int ibm_panel_probe(struct i2c_client *client)
const struct i2c_device_id *id)
{ {
struct ibm_panel *panel; struct ibm_panel *panel;
int i; int i;
...@@ -190,7 +189,7 @@ static struct i2c_driver ibm_panel_driver = { ...@@ -190,7 +189,7 @@ static struct i2c_driver ibm_panel_driver = {
.name = DEVICE_NAME, .name = DEVICE_NAME,
.of_match_table = ibm_panel_match, .of_match_table = ibm_panel_match,
}, },
.probe = ibm_panel_probe, .probe_new = ibm_panel_probe,
.remove = ibm_panel_remove, .remove = ibm_panel_remove,
}; };
module_i2c_driver(ibm_panel_driver); module_i2c_driver(ibm_panel_driver);
......
此差异已折叠。
...@@ -385,8 +385,7 @@ static int kxtj9_verify(struct kxtj9_data *tj9) ...@@ -385,8 +385,7 @@ static int kxtj9_verify(struct kxtj9_data *tj9)
return retval; return retval;
} }
static int kxtj9_probe(struct i2c_client *client, static int kxtj9_probe(struct i2c_client *client)
const struct i2c_device_id *id)
{ {
const struct kxtj9_platform_data *pdata = const struct kxtj9_platform_data *pdata =
dev_get_platdata(&client->dev); dev_get_platdata(&client->dev);
...@@ -539,7 +538,7 @@ static struct i2c_driver kxtj9_driver = { ...@@ -539,7 +538,7 @@ static struct i2c_driver kxtj9_driver = {
.name = NAME, .name = NAME,
.pm = &kxtj9_pm_ops, .pm = &kxtj9_pm_ops,
}, },
.probe = kxtj9_probe, .probe_new = kxtj9_probe,
.id_table = kxtj9_id, .id_table = kxtj9_id,
}; };
......
...@@ -278,8 +278,7 @@ static int max8997_haptic_probe(struct platform_device *pdev) ...@@ -278,8 +278,7 @@ static int max8997_haptic_probe(struct platform_device *pdev)
break; break;
case MAX8997_EXTERNAL_MODE: case MAX8997_EXTERNAL_MODE:
chip->pwm = pwm_request(haptic_pdata->pwm_channel_id, chip->pwm = pwm_get(&pdev->dev, NULL);
"max8997-haptic");
if (IS_ERR(chip->pwm)) { if (IS_ERR(chip->pwm)) {
error = PTR_ERR(chip->pwm); error = PTR_ERR(chip->pwm);
dev_err(&pdev->dev, dev_err(&pdev->dev,
...@@ -344,7 +343,7 @@ static int max8997_haptic_probe(struct platform_device *pdev) ...@@ -344,7 +343,7 @@ static int max8997_haptic_probe(struct platform_device *pdev)
regulator_put(chip->regulator); regulator_put(chip->regulator);
err_free_pwm: err_free_pwm:
if (chip->mode == MAX8997_EXTERNAL_MODE) if (chip->mode == MAX8997_EXTERNAL_MODE)
pwm_free(chip->pwm); pwm_put(chip->pwm);
err_free_mem: err_free_mem:
input_free_device(input_dev); input_free_device(input_dev);
kfree(chip); kfree(chip);
...@@ -360,7 +359,7 @@ static int max8997_haptic_remove(struct platform_device *pdev) ...@@ -360,7 +359,7 @@ static int max8997_haptic_remove(struct platform_device *pdev)
regulator_put(chip->regulator); regulator_put(chip->regulator);
if (chip->mode == MAX8997_EXTERNAL_MODE) if (chip->mode == MAX8997_EXTERNAL_MODE)
pwm_free(chip->pwm); pwm_put(chip->pwm);
kfree(chip); kfree(chip);
......
...@@ -146,8 +146,7 @@ static void mma8450_close(struct input_dev *input) ...@@ -146,8 +146,7 @@ static void mma8450_close(struct input_dev *input)
/* /*
* I2C init/probing/exit functions * I2C init/probing/exit functions
*/ */
static int mma8450_probe(struct i2c_client *c, static int mma8450_probe(struct i2c_client *c)
const struct i2c_device_id *id)
{ {
struct input_dev *input; struct input_dev *input;
int err; int err;
...@@ -203,7 +202,7 @@ static struct i2c_driver mma8450_driver = { ...@@ -203,7 +202,7 @@ static struct i2c_driver mma8450_driver = {
.name = MMA8450_DRV_NAME, .name = MMA8450_DRV_NAME,
.of_match_table = mma8450_dt_ids, .of_match_table = mma8450_dt_ids,
}, },
.probe = mma8450_probe, .probe_new = mma8450_probe,
.id_table = mma8450_id, .id_table = mma8450_id,
}; };
......
...@@ -80,7 +80,7 @@ static irqreturn_t pcf8574_kp_irq_handler(int irq, void *dev_id) ...@@ -80,7 +80,7 @@ static irqreturn_t pcf8574_kp_irq_handler(int irq, void *dev_id)
return IRQ_HANDLED; return IRQ_HANDLED;
} }
static int pcf8574_kp_probe(struct i2c_client *client, const struct i2c_device_id *id) static int pcf8574_kp_probe(struct i2c_client *client)
{ {
int i, ret; int i, ret;
struct input_dev *idev; struct input_dev *idev;
...@@ -209,7 +209,7 @@ static struct i2c_driver pcf8574_kp_driver = { ...@@ -209,7 +209,7 @@ static struct i2c_driver pcf8574_kp_driver = {
.pm = &pcf8574_kp_pm_ops, .pm = &pcf8574_kp_pm_ops,
#endif #endif
}, },
.probe = pcf8574_kp_probe, .probe_new = pcf8574_kp_probe,
.remove = pcf8574_kp_remove, .remove = pcf8574_kp_remove,
.id_table = pcf8574_kp_id, .id_table = pcf8574_kp_id,
}; };
......
...@@ -1244,8 +1244,7 @@ static void cyapa_disable_regulator(void *data) ...@@ -1244,8 +1244,7 @@ static void cyapa_disable_regulator(void *data)
regulator_disable(cyapa->vcc); regulator_disable(cyapa->vcc);
} }
static int cyapa_probe(struct i2c_client *client, static int cyapa_probe(struct i2c_client *client)
const struct i2c_device_id *dev_id)
{ {
struct device *dev = &client->dev; struct device *dev = &client->dev;
struct cyapa *cyapa; struct cyapa *cyapa;
...@@ -1490,7 +1489,7 @@ static struct i2c_driver cyapa_driver = { ...@@ -1490,7 +1489,7 @@ static struct i2c_driver cyapa_driver = {
.of_match_table = of_match_ptr(cyapa_of_match), .of_match_table = of_match_ptr(cyapa_of_match),
}, },
.probe = cyapa_probe, .probe_new = cyapa_probe,
.id_table = cyapa_id_table, .id_table = cyapa_id_table,
}; };
......
...@@ -33,6 +33,7 @@ ...@@ -33,6 +33,7 @@
#include <linux/jiffies.h> #include <linux/jiffies.h>
#include <linux/completion.h> #include <linux/completion.h>
#include <linux/of.h> #include <linux/of.h>
#include <linux/pm_wakeirq.h>
#include <linux/property.h> #include <linux/property.h>
#include <linux/regulator/consumer.h> #include <linux/regulator/consumer.h>
#include <asm/unaligned.h> #include <asm/unaligned.h>
...@@ -86,8 +87,6 @@ struct elan_tp_data { ...@@ -86,8 +87,6 @@ struct elan_tp_data {
u16 fw_page_size; u16 fw_page_size;
u32 fw_signature_address; u32 fw_signature_address;
bool irq_wake;
u8 min_baseline; u8 min_baseline;
u8 max_baseline; u8 max_baseline;
bool baseline_ready; bool baseline_ready;
...@@ -1188,8 +1187,7 @@ static void elan_disable_regulator(void *_data) ...@@ -1188,8 +1187,7 @@ static void elan_disable_regulator(void *_data)
regulator_disable(data->vcc); regulator_disable(data->vcc);
} }
static int elan_probe(struct i2c_client *client, static int elan_probe(struct i2c_client *client)
const struct i2c_device_id *dev_id)
{ {
const struct elan_transport_ops *transport_ops; const struct elan_transport_ops *transport_ops;
struct device *dev = &client->dev; struct device *dev = &client->dev;
...@@ -1327,13 +1325,6 @@ static int elan_probe(struct i2c_client *client, ...@@ -1327,13 +1325,6 @@ static int elan_probe(struct i2c_client *client,
} }
} }
/*
* Systems using device tree should set up wakeup via DTS,
* the rest will configure device as wakeup source by default.
*/
if (!dev->of_node)
device_init_wakeup(dev, true);
return 0; return 0;
} }
...@@ -1356,8 +1347,6 @@ static int __maybe_unused elan_suspend(struct device *dev) ...@@ -1356,8 +1347,6 @@ static int __maybe_unused elan_suspend(struct device *dev)
if (device_may_wakeup(dev)) { if (device_may_wakeup(dev)) {
ret = elan_sleep(data); ret = elan_sleep(data);
/* Enable wake from IRQ */
data->irq_wake = (enable_irq_wake(client->irq) == 0);
} else { } else {
ret = elan_set_power(data, false); ret = elan_set_power(data, false);
if (ret) if (ret)
...@@ -1388,9 +1377,6 @@ static int __maybe_unused elan_resume(struct device *dev) ...@@ -1388,9 +1377,6 @@ static int __maybe_unused elan_resume(struct device *dev)
dev_err(dev, "error %d enabling regulator\n", error); dev_err(dev, "error %d enabling regulator\n", error);
goto err; goto err;
} }
} else if (data->irq_wake) {
disable_irq_wake(client->irq);
data->irq_wake = false;
} }
error = elan_set_power(data, true); error = elan_set_power(data, true);
...@@ -1438,7 +1424,7 @@ static struct i2c_driver elan_driver = { ...@@ -1438,7 +1424,7 @@ static struct i2c_driver elan_driver = {
.probe_type = PROBE_PREFER_ASYNCHRONOUS, .probe_type = PROBE_PREFER_ASYNCHRONOUS,
.dev_groups = elan_sysfs_groups, .dev_groups = elan_sysfs_groups,
}, },
.probe = elan_probe, .probe_new = elan_probe,
.id_table = elan_id, .id_table = elan_id,
}; };
......
...@@ -521,8 +521,7 @@ static struct synaptics_i2c *synaptics_i2c_touch_create(struct i2c_client *clien ...@@ -521,8 +521,7 @@ static struct synaptics_i2c *synaptics_i2c_touch_create(struct i2c_client *clien
return touch; return touch;
} }
static int synaptics_i2c_probe(struct i2c_client *client, static int synaptics_i2c_probe(struct i2c_client *client)
const struct i2c_device_id *dev_id)
{ {
int ret; int ret;
struct synaptics_i2c *touch; struct synaptics_i2c *touch;
...@@ -651,7 +650,7 @@ static struct i2c_driver synaptics_i2c_driver = { ...@@ -651,7 +650,7 @@ static struct i2c_driver synaptics_i2c_driver = {
.pm = &synaptics_i2c_pm, .pm = &synaptics_i2c_pm,
}, },
.probe = synaptics_i2c_probe, .probe_new = synaptics_i2c_probe,
.remove = synaptics_i2c_remove, .remove = synaptics_i2c_remove,
.id_table = synaptics_i2c_id_table, .id_table = synaptics_i2c_id_table,
......
...@@ -198,8 +198,7 @@ static void rmi_i2c_unregister_transport(void *data) ...@@ -198,8 +198,7 @@ static void rmi_i2c_unregister_transport(void *data)
rmi_unregister_transport_device(&rmi_i2c->xport); rmi_unregister_transport_device(&rmi_i2c->xport);
} }
static int rmi_i2c_probe(struct i2c_client *client, static int rmi_i2c_probe(struct i2c_client *client)
const struct i2c_device_id *id)
{ {
struct rmi_device_platform_data *pdata; struct rmi_device_platform_data *pdata;
struct rmi_device_platform_data *client_pdata = struct rmi_device_platform_data *client_pdata =
...@@ -383,7 +382,7 @@ static struct i2c_driver rmi_i2c_driver = { ...@@ -383,7 +382,7 @@ static struct i2c_driver rmi_i2c_driver = {
.of_match_table = of_match_ptr(rmi_i2c_of_match), .of_match_table = of_match_ptr(rmi_i2c_of_match),
}, },
.id_table = rmi_id, .id_table = rmi_id,
.probe = rmi_i2c_probe, .probe_new = rmi_i2c_probe,
}; };
module_i2c_driver(rmi_i2c_driver); module_i2c_driver(rmi_i2c_driver);
......
...@@ -268,8 +268,7 @@ static const struct rmi_transport_ops rmi_smb_ops = { ...@@ -268,8 +268,7 @@ static const struct rmi_transport_ops rmi_smb_ops = {
.reset = rmi_smb_reset, .reset = rmi_smb_reset,
}; };
static int rmi_smb_probe(struct i2c_client *client, static int rmi_smb_probe(struct i2c_client *client)
const struct i2c_device_id *id)
{ {
struct rmi_device_platform_data *pdata = dev_get_platdata(&client->dev); struct rmi_device_platform_data *pdata = dev_get_platdata(&client->dev);
struct rmi_smb_xport *rmi_smb; struct rmi_smb_xport *rmi_smb;
...@@ -420,7 +419,7 @@ static struct i2c_driver rmi_smb_driver = { ...@@ -420,7 +419,7 @@ static struct i2c_driver rmi_smb_driver = {
.pm = &rmi_smb_pm, .pm = &rmi_smb_pm,
}, },
.id_table = rmi_id, .id_table = rmi_id,
.probe = rmi_smb_probe, .probe_new = rmi_smb_probe,
.remove = rmi_smb_remove, .remove = rmi_smb_remove,
}; };
......
...@@ -284,6 +284,22 @@ config TOUCHSCREEN_CYTTSP4_SPI ...@@ -284,6 +284,22 @@ config TOUCHSCREEN_CYTTSP4_SPI
To compile this driver as a module, choose M here: the To compile this driver as a module, choose M here: the
module will be called cyttsp4_spi. module will be called cyttsp4_spi.
config TOUCHSCREEN_CYTTSP5
tristate "Cypress TrueTouch Gen5 Touchscreen Driver"
depends on I2C
select REGMAP_I2C
select CRC_ITU_T
help
Driver for Parade TrueTouch Standard Product Generation 5
touchscreen controllers. I2C bus interface support only.
Say Y here if you have a Cypress Gen5 touchscreen.
If unsure, say N.
To compile this driver as a module, choose M here: the
module will be called cyttsp5.
config TOUCHSCREEN_DA9034 config TOUCHSCREEN_DA9034
tristate "Touchscreen support for Dialog Semiconductor DA9034" tristate "Touchscreen support for Dialog Semiconductor DA9034"
depends on PMIC_DA903X depends on PMIC_DA903X
...@@ -422,6 +438,18 @@ config TOUCHSCREEN_HYCON_HY46XX ...@@ -422,6 +438,18 @@ config TOUCHSCREEN_HYCON_HY46XX
To compile this driver as a module, choose M here: the To compile this driver as a module, choose M here: the
module will be called hycon-hy46xx. module will be called hycon-hy46xx.
config TOUCHSCREEN_HYNITRON_CSTXXX
tristate "Hynitron touchscreen support"
depends on I2C
help
Say Y here if you have a touchscreen using a Hynitron
touchscreen controller.
If unsure, say N.
To compile this driver as a module, choose M here: the
module will be called hynitron-cstxxx.
config TOUCHSCREEN_ILI210X config TOUCHSCREEN_ILI210X
tristate "Ilitek ILI210X based touchscreen" tristate "Ilitek ILI210X based touchscreen"
depends on I2C depends on I2C
...@@ -1241,7 +1269,7 @@ config TOUCHSCREEN_STMFTS ...@@ -1241,7 +1269,7 @@ config TOUCHSCREEN_STMFTS
config TOUCHSCREEN_STMPE config TOUCHSCREEN_STMPE
tristate "STMicroelectronics STMPE touchscreens" tristate "STMicroelectronics STMPE touchscreens"
depends on MFD_STMPE depends on MFD_STMPE
depends on (OF || COMPILE_TEST) depends on OF
help help
Say Y here if you want support for STMicroelectronics Say Y here if you want support for STMicroelectronics
STMPE touchscreen controllers. STMPE touchscreen controllers.
...@@ -1379,4 +1407,16 @@ config TOUCHSCREEN_ZINITIX ...@@ -1379,4 +1407,16 @@ config TOUCHSCREEN_ZINITIX
To compile this driver as a module, choose M here: the To compile this driver as a module, choose M here: the
module will be called zinitix. module will be called zinitix.
config TOUCHSCREEN_HIMAX_HX83112B
tristate "Himax hx83112b touchscreen driver"
depends on I2C
select REGMAP_I2C
help
Say Y here to enable support for Himax hx83112b touchscreens.
If unsure, say N.
To compile this driver as a module, choose M here: the
module will be called himax_hx83112b.
endif endif
...@@ -30,6 +30,7 @@ obj-$(CONFIG_TOUCHSCREEN_CYTTSP_SPI) += cyttsp_spi.o ...@@ -30,6 +30,7 @@ obj-$(CONFIG_TOUCHSCREEN_CYTTSP_SPI) += cyttsp_spi.o
obj-$(CONFIG_TOUCHSCREEN_CYTTSP4_CORE) += cyttsp4_core.o obj-$(CONFIG_TOUCHSCREEN_CYTTSP4_CORE) += cyttsp4_core.o
obj-$(CONFIG_TOUCHSCREEN_CYTTSP4_I2C) += cyttsp4_i2c.o cyttsp_i2c_common.o obj-$(CONFIG_TOUCHSCREEN_CYTTSP4_I2C) += cyttsp4_i2c.o cyttsp_i2c_common.o
obj-$(CONFIG_TOUCHSCREEN_CYTTSP4_SPI) += cyttsp4_spi.o obj-$(CONFIG_TOUCHSCREEN_CYTTSP4_SPI) += cyttsp4_spi.o
obj-$(CONFIG_TOUCHSCREEN_CYTTSP5) += cyttsp5.o
obj-$(CONFIG_TOUCHSCREEN_DA9034) += da9034-ts.o obj-$(CONFIG_TOUCHSCREEN_DA9034) += da9034-ts.o
obj-$(CONFIG_TOUCHSCREEN_DA9052) += da9052_tsi.o obj-$(CONFIG_TOUCHSCREEN_DA9052) += da9052_tsi.o
obj-$(CONFIG_TOUCHSCREEN_DYNAPRO) += dynapro.o obj-$(CONFIG_TOUCHSCREEN_DYNAPRO) += dynapro.o
...@@ -47,6 +48,7 @@ obj-$(CONFIG_TOUCHSCREEN_EXC3000) += exc3000.o ...@@ -47,6 +48,7 @@ obj-$(CONFIG_TOUCHSCREEN_EXC3000) += exc3000.o
obj-$(CONFIG_TOUCHSCREEN_FUJITSU) += fujitsu_ts.o obj-$(CONFIG_TOUCHSCREEN_FUJITSU) += fujitsu_ts.o
obj-$(CONFIG_TOUCHSCREEN_GOODIX) += goodix_ts.o obj-$(CONFIG_TOUCHSCREEN_GOODIX) += goodix_ts.o
obj-$(CONFIG_TOUCHSCREEN_HIDEEP) += hideep.o obj-$(CONFIG_TOUCHSCREEN_HIDEEP) += hideep.o
obj-$(CONFIG_TOUCHSCREEN_HYNITRON_CSTXXX) += hynitron_cstxxx.o
obj-$(CONFIG_TOUCHSCREEN_ILI210X) += ili210x.o obj-$(CONFIG_TOUCHSCREEN_ILI210X) += ili210x.o
obj-$(CONFIG_TOUCHSCREEN_ILITEK) += ilitek_ts_i2c.o obj-$(CONFIG_TOUCHSCREEN_ILITEK) += ilitek_ts_i2c.o
obj-$(CONFIG_TOUCHSCREEN_IMAGIS) += imagis.o obj-$(CONFIG_TOUCHSCREEN_IMAGIS) += imagis.o
...@@ -116,3 +118,4 @@ obj-$(CONFIG_TOUCHSCREEN_ROHM_BU21023) += rohm_bu21023.o ...@@ -116,3 +118,4 @@ obj-$(CONFIG_TOUCHSCREEN_ROHM_BU21023) += rohm_bu21023.o
obj-$(CONFIG_TOUCHSCREEN_RASPBERRYPI_FW) += raspberrypi-ts.o obj-$(CONFIG_TOUCHSCREEN_RASPBERRYPI_FW) += raspberrypi-ts.o
obj-$(CONFIG_TOUCHSCREEN_IQS5XX) += iqs5xx.o obj-$(CONFIG_TOUCHSCREEN_IQS5XX) += iqs5xx.o
obj-$(CONFIG_TOUCHSCREEN_ZINITIX) += zinitix.o obj-$(CONFIG_TOUCHSCREEN_ZINITIX) += zinitix.o
obj-$(CONFIG_TOUCHSCREEN_HIMAX_HX83112B) += himax_hx83112b.o
...@@ -23,8 +23,7 @@ static const struct regmap_config ad7879_i2c_regmap_config = { ...@@ -23,8 +23,7 @@ static const struct regmap_config ad7879_i2c_regmap_config = {
.max_register = 15, .max_register = 15,
}; };
static int ad7879_i2c_probe(struct i2c_client *client, static int ad7879_i2c_probe(struct i2c_client *client)
const struct i2c_device_id *id)
{ {
struct regmap *regmap; struct regmap *regmap;
...@@ -63,7 +62,7 @@ static struct i2c_driver ad7879_i2c_driver = { ...@@ -63,7 +62,7 @@ static struct i2c_driver ad7879_i2c_driver = {
.pm = &ad7879_pm_ops, .pm = &ad7879_pm_ops,
.of_match_table = of_match_ptr(ad7879_i2c_dt_ids), .of_match_table = of_match_ptr(ad7879_i2c_dt_ids),
}, },
.probe = ad7879_i2c_probe, .probe_new = ad7879_i2c_probe,
.id_table = ad7879_id, .id_table = ad7879_id,
}; };
......
...@@ -87,8 +87,7 @@ static void ar1021_i2c_close(struct input_dev *dev) ...@@ -87,8 +87,7 @@ static void ar1021_i2c_close(struct input_dev *dev)
disable_irq(client->irq); disable_irq(client->irq);
} }
static int ar1021_i2c_probe(struct i2c_client *client, static int ar1021_i2c_probe(struct i2c_client *client)
const struct i2c_device_id *id)
{ {
struct ar1021_i2c *ar1021; struct ar1021_i2c *ar1021;
struct input_dev *input; struct input_dev *input;
...@@ -182,7 +181,7 @@ static struct i2c_driver ar1021_i2c_driver = { ...@@ -182,7 +181,7 @@ static struct i2c_driver ar1021_i2c_driver = {
.of_match_table = ar1021_i2c_of_match, .of_match_table = ar1021_i2c_of_match,
}, },
.probe = ar1021_i2c_probe, .probe_new = ar1021_i2c_probe,
.id_table = ar1021_i2c_id, .id_table = ar1021_i2c_id,
}; };
module_i2c_driver(ar1021_i2c_driver); module_i2c_driver(ar1021_i2c_driver);
......
...@@ -3129,7 +3129,7 @@ static const struct dmi_system_id chromebook_T9_suspend_dmi[] = { ...@@ -3129,7 +3129,7 @@ static const struct dmi_system_id chromebook_T9_suspend_dmi[] = {
{ } { }
}; };
static int mxt_probe(struct i2c_client *client, const struct i2c_device_id *id) static int mxt_probe(struct i2c_client *client)
{ {
struct mxt_data *data; struct mxt_data *data;
int error; int error;
...@@ -3377,7 +3377,7 @@ static struct i2c_driver mxt_driver = { ...@@ -3377,7 +3377,7 @@ static struct i2c_driver mxt_driver = {
.acpi_match_table = ACPI_PTR(mxt_acpi_id), .acpi_match_table = ACPI_PTR(mxt_acpi_id),
.pm = &mxt_pm_ops, .pm = &mxt_pm_ops,
}, },
.probe = mxt_probe, .probe_new = mxt_probe,
.remove = mxt_remove, .remove = mxt_remove,
.id_table = mxt_id, .id_table = mxt_id,
}; };
......
...@@ -482,8 +482,7 @@ static void auo_pixcir_reset(void *data) ...@@ -482,8 +482,7 @@ static void auo_pixcir_reset(void *data)
gpiod_set_value_cansleep(ts->gpio_rst, 1); gpiod_set_value_cansleep(ts->gpio_rst, 1);
} }
static int auo_pixcir_probe(struct i2c_client *client, static int auo_pixcir_probe(struct i2c_client *client)
const struct i2c_device_id *id)
{ {
struct auo_pixcir_ts *ts; struct auo_pixcir_ts *ts;
struct input_dev *input_dev; struct input_dev *input_dev;
...@@ -637,7 +636,7 @@ static struct i2c_driver auo_pixcir_driver = { ...@@ -637,7 +636,7 @@ static struct i2c_driver auo_pixcir_driver = {
.pm = &auo_pixcir_pm_ops, .pm = &auo_pixcir_pm_ops,
.of_match_table = of_match_ptr(auo_pixcir_ts_dt_idtable), .of_match_table = of_match_ptr(auo_pixcir_ts_dt_idtable),
}, },
.probe = auo_pixcir_probe, .probe_new = auo_pixcir_probe,
.id_table = auo_pixcir_idtable, .id_table = auo_pixcir_idtable,
}; };
......
...@@ -404,8 +404,7 @@ static void bu21013_disable_chip(void *_ts) ...@@ -404,8 +404,7 @@ static void bu21013_disable_chip(void *_ts)
gpiod_set_value(ts->cs_gpiod, 0); gpiod_set_value(ts->cs_gpiod, 0);
} }
static int bu21013_probe(struct i2c_client *client, static int bu21013_probe(struct i2c_client *client)
const struct i2c_device_id *id)
{ {
struct bu21013_ts *ts; struct bu21013_ts *ts;
struct input_dev *in_dev; struct input_dev *in_dev;
...@@ -618,7 +617,7 @@ static struct i2c_driver bu21013_driver = { ...@@ -618,7 +617,7 @@ static struct i2c_driver bu21013_driver = {
.name = DRIVER_TP, .name = DRIVER_TP,
.pm = &bu21013_dev_pm_ops, .pm = &bu21013_dev_pm_ops,
}, },
.probe = bu21013_probe, .probe_new = bu21013_probe,
.remove = bu21013_remove, .remove = bu21013_remove,
.id_table = bu21013_id, .id_table = bu21013_id,
}; };
......
...@@ -331,8 +331,7 @@ static void bu21029_stop_chip(struct input_dev *dev) ...@@ -331,8 +331,7 @@ static void bu21029_stop_chip(struct input_dev *dev)
regulator_disable(bu21029->vdd); regulator_disable(bu21029->vdd);
} }
static int bu21029_probe(struct i2c_client *client, static int bu21029_probe(struct i2c_client *client)
const struct i2c_device_id *id)
{ {
struct bu21029_ts_data *bu21029; struct bu21029_ts_data *bu21029;
struct input_dev *in_dev; struct input_dev *in_dev;
...@@ -475,7 +474,7 @@ static struct i2c_driver bu21029_driver = { ...@@ -475,7 +474,7 @@ static struct i2c_driver bu21029_driver = {
.pm = &bu21029_pm_ops, .pm = &bu21029_pm_ops,
}, },
.id_table = bu21029_ids, .id_table = bu21029_ids,
.probe = bu21029_probe, .probe_new = bu21029_probe,
}; };
module_i2c_driver(bu21029_driver); module_i2c_driver(bu21029_driver);
......
...@@ -176,8 +176,7 @@ static int icn8318_resume(struct device *dev) ...@@ -176,8 +176,7 @@ static int icn8318_resume(struct device *dev)
static SIMPLE_DEV_PM_OPS(icn8318_pm_ops, icn8318_suspend, icn8318_resume); static SIMPLE_DEV_PM_OPS(icn8318_pm_ops, icn8318_suspend, icn8318_resume);
static int icn8318_probe(struct i2c_client *client, static int icn8318_probe(struct i2c_client *client)
const struct i2c_device_id *id)
{ {
struct device *dev = &client->dev; struct device *dev = &client->dev;
struct icn8318_data *data; struct icn8318_data *data;
...@@ -267,7 +266,7 @@ static struct i2c_driver icn8318_driver = { ...@@ -267,7 +266,7 @@ static struct i2c_driver icn8318_driver = {
.pm = &icn8318_pm_ops, .pm = &icn8318_pm_ops,
.of_match_table = icn8318_of_match, .of_match_table = icn8318_of_match,
}, },
.probe = icn8318_probe, .probe_new = icn8318_probe,
.id_table = icn8318_i2c_id, .id_table = icn8318_i2c_id,
}; };
......
...@@ -198,8 +198,7 @@ static void cy8ctma140_power_off_action(void *d) ...@@ -198,8 +198,7 @@ static void cy8ctma140_power_off_action(void *d)
cy8ctma140_power_down(ts); cy8ctma140_power_down(ts);
} }
static int cy8ctma140_probe(struct i2c_client *client, static int cy8ctma140_probe(struct i2c_client *client)
const struct i2c_device_id *id)
{ {
struct cy8ctma140 *ts; struct cy8ctma140 *ts;
struct input_dev *input; struct input_dev *input;
...@@ -344,7 +343,7 @@ static struct i2c_driver cy8ctma140_driver = { ...@@ -344,7 +343,7 @@ static struct i2c_driver cy8ctma140_driver = {
.of_match_table = cy8ctma140_of_match, .of_match_table = cy8ctma140_of_match,
}, },
.id_table = cy8ctma140_idtable, .id_table = cy8ctma140_idtable,
.probe = cy8ctma140_probe, .probe_new = cy8ctma140_probe,
}; };
module_i2c_driver(cy8ctma140_driver); module_i2c_driver(cy8ctma140_driver);
......
...@@ -168,8 +168,7 @@ static void cy8ctmg110_shut_off(void *_ts) ...@@ -168,8 +168,7 @@ static void cy8ctmg110_shut_off(void *_ts)
cy8ctmg110_power(ts, false); cy8ctmg110_power(ts, false);
} }
static int cy8ctmg110_probe(struct i2c_client *client, static int cy8ctmg110_probe(struct i2c_client *client)
const struct i2c_device_id *id)
{ {
struct cy8ctmg110 *ts; struct cy8ctmg110 *ts;
struct input_dev *input_dev; struct input_dev *input_dev;
...@@ -279,7 +278,7 @@ static struct i2c_driver cy8ctmg110_driver = { ...@@ -279,7 +278,7 @@ static struct i2c_driver cy8ctmg110_driver = {
.pm = &cy8ctmg110_pm, .pm = &cy8ctmg110_pm,
}, },
.id_table = cy8ctmg110_idtable, .id_table = cy8ctmg110_idtable,
.probe = cy8ctmg110_probe, .probe_new = cy8ctmg110_probe,
}; };
module_i2c_driver(cy8ctmg110_driver); module_i2c_driver(cy8ctmg110_driver);
......
...@@ -27,8 +27,7 @@ static const struct cyttsp4_bus_ops cyttsp4_i2c_bus_ops = { ...@@ -27,8 +27,7 @@ static const struct cyttsp4_bus_ops cyttsp4_i2c_bus_ops = {
.read = cyttsp_i2c_read_block_data, .read = cyttsp_i2c_read_block_data,
}; };
static int cyttsp4_i2c_probe(struct i2c_client *client, static int cyttsp4_i2c_probe(struct i2c_client *client)
const struct i2c_device_id *id)
{ {
struct cyttsp4 *ts; struct cyttsp4 *ts;
...@@ -61,7 +60,7 @@ static struct i2c_driver cyttsp4_i2c_driver = { ...@@ -61,7 +60,7 @@ static struct i2c_driver cyttsp4_i2c_driver = {
.name = CYTTSP4_I2C_NAME, .name = CYTTSP4_I2C_NAME,
.pm = &cyttsp4_pm_ops, .pm = &cyttsp4_pm_ops,
}, },
.probe = cyttsp4_i2c_probe, .probe_new = cyttsp4_i2c_probe,
.remove = cyttsp4_i2c_remove, .remove = cyttsp4_i2c_remove,
.id_table = cyttsp4_i2c_id, .id_table = cyttsp4_i2c_id,
}; };
......
此差异已折叠。
...@@ -28,8 +28,7 @@ static const struct cyttsp_bus_ops cyttsp_i2c_bus_ops = { ...@@ -28,8 +28,7 @@ static const struct cyttsp_bus_ops cyttsp_i2c_bus_ops = {
.read = cyttsp_i2c_read_block_data, .read = cyttsp_i2c_read_block_data,
}; };
static int cyttsp_i2c_probe(struct i2c_client *client, static int cyttsp_i2c_probe(struct i2c_client *client)
const struct i2c_device_id *id)
{ {
struct cyttsp *ts; struct cyttsp *ts;
...@@ -67,7 +66,7 @@ static struct i2c_driver cyttsp_i2c_driver = { ...@@ -67,7 +66,7 @@ static struct i2c_driver cyttsp_i2c_driver = {
.pm = &cyttsp_pm_ops, .pm = &cyttsp_pm_ops,
.of_match_table = cyttsp_of_i2c_match, .of_match_table = cyttsp_of_i2c_match,
}, },
.probe = cyttsp_i2c_probe, .probe_new = cyttsp_i2c_probe,
.id_table = cyttsp_i2c_id, .id_table = cyttsp_i2c_id,
}; };
......
...@@ -1131,9 +1131,9 @@ static void edt_ft5x06_disable_regulators(void *arg) ...@@ -1131,9 +1131,9 @@ static void edt_ft5x06_disable_regulators(void *arg)
regulator_disable(data->iovcc); regulator_disable(data->iovcc);
} }
static int edt_ft5x06_ts_probe(struct i2c_client *client, static int edt_ft5x06_ts_probe(struct i2c_client *client)
const struct i2c_device_id *id)
{ {
const struct i2c_device_id *id = i2c_client_get_device_id(client);
const struct edt_i2c_chip_data *chip_data; const struct edt_i2c_chip_data *chip_data;
struct edt_ft5x06_ts_data *tsdata; struct edt_ft5x06_ts_data *tsdata;
u8 buf[2] = { 0xfc, 0x00 }; u8 buf[2] = { 0xfc, 0x00 };
...@@ -1504,7 +1504,7 @@ static struct i2c_driver edt_ft5x06_ts_driver = { ...@@ -1504,7 +1504,7 @@ static struct i2c_driver edt_ft5x06_ts_driver = {
.probe_type = PROBE_PREFER_ASYNCHRONOUS, .probe_type = PROBE_PREFER_ASYNCHRONOUS,
}, },
.id_table = edt_ft5x06_ts_id, .id_table = edt_ft5x06_ts_id,
.probe = edt_ft5x06_ts_probe, .probe_new = edt_ft5x06_ts_probe,
.remove = edt_ft5x06_ts_remove, .remove = edt_ft5x06_ts_remove,
}; };
......
...@@ -158,8 +158,7 @@ static void eeti_ts_close(struct input_dev *dev) ...@@ -158,8 +158,7 @@ static void eeti_ts_close(struct input_dev *dev)
eeti_ts_stop(eeti); eeti_ts_stop(eeti);
} }
static int eeti_ts_probe(struct i2c_client *client, static int eeti_ts_probe(struct i2c_client *client)
const struct i2c_device_id *idp)
{ {
struct device *dev = &client->dev; struct device *dev = &client->dev;
struct eeti_ts *eeti; struct eeti_ts *eeti;
...@@ -292,7 +291,7 @@ static struct i2c_driver eeti_ts_driver = { ...@@ -292,7 +291,7 @@ static struct i2c_driver eeti_ts_driver = {
.pm = &eeti_ts_pm, .pm = &eeti_ts_pm,
.of_match_table = of_match_ptr(of_eeti_ts_match), .of_match_table = of_match_ptr(of_eeti_ts_match),
}, },
.probe = eeti_ts_probe, .probe_new = eeti_ts_probe,
.id_table = eeti_ts_id, .id_table = eeti_ts_id,
}; };
......
...@@ -14,17 +14,17 @@ ...@@ -14,17 +14,17 @@
- auto idle mode support - auto idle mode support
*/ */
#include <linux/err.h>
#include <linux/module.h> #include <linux/module.h>
#include <linux/i2c.h> #include <linux/i2c.h>
#include <linux/interrupt.h> #include <linux/interrupt.h>
#include <linux/input.h> #include <linux/input.h>
#include <linux/irq.h> #include <linux/irq.h>
#include <linux/gpio.h> #include <linux/gpio/consumer.h>
#include <linux/delay.h> #include <linux/delay.h>
#include <linux/slab.h> #include <linux/slab.h>
#include <linux/bitops.h> #include <linux/bitops.h>
#include <linux/input/mt.h> #include <linux/input/mt.h>
#include <linux/of_gpio.h>
/* /*
* Mouse Mode: some panel may configure the controller to mouse mode, * Mouse Mode: some panel may configure the controller to mouse mode,
...@@ -119,32 +119,26 @@ static irqreturn_t egalax_ts_interrupt(int irq, void *dev_id) ...@@ -119,32 +119,26 @@ static irqreturn_t egalax_ts_interrupt(int irq, void *dev_id)
/* wake up controller by an falling edge of interrupt gpio. */ /* wake up controller by an falling edge of interrupt gpio. */
static int egalax_wake_up_device(struct i2c_client *client) static int egalax_wake_up_device(struct i2c_client *client)
{ {
struct device_node *np = client->dev.of_node; struct gpio_desc *gpio;
int gpio;
int ret; int ret;
if (!np) /* wake up controller via an falling edge on IRQ gpio. */
return -ENODEV; gpio = gpiod_get(&client->dev, "wakeup", GPIOD_OUT_HIGH);
ret = PTR_ERR_OR_ZERO(gpio);
gpio = of_get_named_gpio(np, "wakeup-gpios", 0); if (ret) {
if (!gpio_is_valid(gpio)) if (ret != -EPROBE_DEFER)
return -ENODEV; dev_err(&client->dev,
"failed to request wakeup gpio, cannot wake up controller: %d\n",
ret = gpio_request(gpio, "egalax_irq"); ret);
if (ret < 0) {
dev_err(&client->dev,
"request gpio failed, cannot wake up controller: %d\n",
ret);
return ret; return ret;
} }
/* wake up controller via an falling edge on IRQ gpio. */ /* release the line */
gpio_direction_output(gpio, 0); gpiod_set_value_cansleep(gpio, 0);
gpio_set_value(gpio, 1);
/* controller should be waken up, return irq. */ /* controller should be woken up, return irq. */
gpio_direction_input(gpio); gpiod_direction_input(gpio);
gpio_free(gpio); gpiod_put(gpio);
return 0; return 0;
} }
...@@ -161,8 +155,7 @@ static int egalax_firmware_version(struct i2c_client *client) ...@@ -161,8 +155,7 @@ static int egalax_firmware_version(struct i2c_client *client)
return 0; return 0;
} }
static int egalax_ts_probe(struct i2c_client *client, static int egalax_ts_probe(struct i2c_client *client)
const struct i2c_device_id *id)
{ {
struct egalax_ts *ts; struct egalax_ts *ts;
struct input_dev *input_dev; struct input_dev *input_dev;
...@@ -185,10 +178,8 @@ static int egalax_ts_probe(struct i2c_client *client, ...@@ -185,10 +178,8 @@ static int egalax_ts_probe(struct i2c_client *client,
/* controller may be in sleep, wake it up. */ /* controller may be in sleep, wake it up. */
error = egalax_wake_up_device(client); error = egalax_wake_up_device(client);
if (error) { if (error)
dev_err(&client->dev, "Failed to wake up the controller\n");
return error; return error;
}
error = egalax_firmware_version(client); error = egalax_firmware_version(client);
if (error < 0) { if (error < 0) {
...@@ -211,10 +202,9 @@ static int egalax_ts_probe(struct i2c_client *client, ...@@ -211,10 +202,9 @@ static int egalax_ts_probe(struct i2c_client *client,
ABS_MT_POSITION_Y, 0, EGALAX_MAX_Y, 0, 0); ABS_MT_POSITION_Y, 0, EGALAX_MAX_Y, 0, 0);
input_mt_init_slots(input_dev, MAX_SUPPORT_POINTS, 0); input_mt_init_slots(input_dev, MAX_SUPPORT_POINTS, 0);
error = devm_request_threaded_irq(&client->dev, client->irq, NULL, error = devm_request_threaded_irq(&client->dev, client->irq,
egalax_ts_interrupt, NULL, egalax_ts_interrupt,
IRQF_TRIGGER_LOW | IRQF_ONESHOT, IRQF_ONESHOT, "egalax_ts", ts);
"egalax_ts", ts);
if (error < 0) { if (error < 0) {
dev_err(&client->dev, "Failed to register interrupt\n"); dev_err(&client->dev, "Failed to register interrupt\n");
return error; return error;
...@@ -273,7 +263,7 @@ static struct i2c_driver egalax_ts_driver = { ...@@ -273,7 +263,7 @@ static struct i2c_driver egalax_ts_driver = {
.of_match_table = egalax_ts_dt_ids, .of_match_table = egalax_ts_dt_ids,
}, },
.id_table = egalax_ts_id, .id_table = egalax_ts_id,
.probe = egalax_ts_probe, .probe_new = egalax_ts_probe,
}; };
module_i2c_driver(egalax_ts_driver); module_i2c_driver(egalax_ts_driver);
......
...@@ -244,8 +244,7 @@ static int ektf2127_query_dimension(struct i2c_client *client, bool width) ...@@ -244,8 +244,7 @@ static int ektf2127_query_dimension(struct i2c_client *client, bool width)
return (((buf[3] & 0xf0) << 4) | buf[2]) - 1; return (((buf[3] & 0xf0) << 4) | buf[2]) - 1;
} }
static int ektf2127_probe(struct i2c_client *client, static int ektf2127_probe(struct i2c_client *client)
const struct i2c_device_id *id)
{ {
struct device *dev = &client->dev; struct device *dev = &client->dev;
struct ektf2127_ts *ts; struct ektf2127_ts *ts;
...@@ -352,7 +351,7 @@ static struct i2c_driver ektf2127_driver = { ...@@ -352,7 +351,7 @@ static struct i2c_driver ektf2127_driver = {
.pm = &ektf2127_pm_ops, .pm = &ektf2127_pm_ops,
.of_match_table = of_match_ptr(ektf2127_of_match), .of_match_table = of_match_ptr(ektf2127_of_match),
}, },
.probe = ektf2127_probe, .probe_new = ektf2127_probe,
.id_table = ektf2127_i2c_id, .id_table = ektf2127_i2c_id,
}; };
module_i2c_driver(ektf2127_driver); module_i2c_driver(ektf2127_driver);
......
此差异已折叠。
此差异已折叠。
此差异已折叠。
此差异已折叠。
此差异已折叠。
此差异已折叠。
此差异已折叠。
此差异已折叠。
此差异已折叠。
此差异已折叠。
此差异已折叠。
此差异已折叠。
此差异已折叠。
此差异已折叠。
此差异已折叠。
此差异已折叠。
此差异已折叠。
此差异已折叠。
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册