mirror of
https://github.com/linux-msm/laptops-kernel.git
synced 2026-08-13 14:19:53 -07:00
Merge tag 'input-for-v6.3-rc0' of git://git.kernel.org/pub/scm/linux/kernel/git/dtor/input
Pull input updates from Dmitry Torokhov: - a set of tweaks to iqs269a touch controller driver - a fix for ads7846 driver to properly handle 7845 chip - cap11xx driver will support cap1203, cap1293 and cap1298 models - xpad driver will support 8BitDo Pro 2 Wired Controller - input drivers have been switched to DEFINE_SIMPLE_DEV_PM_OPS() and pm_sleep_ptr() - other miscellaneous fixes and tweaks * tag 'input-for-v6.3-rc0' of git://git.kernel.org/pub/scm/linux/kernel/git/dtor/input: (113 commits) dt-bindings: input: iqs626a: Redefine trackpad property types Input: iqs626a - drop unused device node references dt-bindings: input: touchscreen: st,stmfts: convert to dtschema Input: cyttsp5 - fix bitmask for touch buttons Input: exc3000 - properly stop timer on shutdown Input: synaptics-rmi4 - fix SPI device ID Input: cap11xx - add support for cap1203, cap1293 and cap1298 dt-bindings: input: microchip,cap11xx: add cap1203, cap1293 and cap1298 Input: pmic8xxx-keypad - fix a Kconfig spelling mistake & hyphenation Input: edt-ft5x06 - fix typo in a comment Input: tegra-kbc - use devm_platform_get_and_ioremap_resource() Input: st-keyscan - use devm_platform_get_and_ioremap_resource() Input: spear-keyboard - use devm_platform_get_and_ioremap_resource() Input: olpc_apsp - use devm_platform_get_and_ioremap_resource() Input: arc_ps2 - use devm_platform_get_and_ioremap_resource() Input: apbps2 - use devm_platform_get_and_ioremap_resource() Input: altera_ps2 - use devm_platform_get_and_ioremap_resource() Input: ads7846 - don't check penirq immediately for 7845 Input: ads7846 - always set last command to PWRDOWN Input: ads7846 - don't report pressure for ads7845 ...
This commit is contained in:
@@ -564,16 +564,6 @@ patternProperties:
|
||||
2: Partial
|
||||
3: Full
|
||||
|
||||
azoteq,ati-base:
|
||||
$ref: /schemas/types.yaml#/definitions/uint32-array
|
||||
minItems: 6
|
||||
maxItems: 9
|
||||
items:
|
||||
minimum: 45
|
||||
maximum: 300
|
||||
default: [45, 45, 45, 45, 45, 45, 45, 45, 45]
|
||||
description: Specifies each individual trackpad channel's ATI base.
|
||||
|
||||
azoteq,ati-target:
|
||||
$ref: /schemas/types.yaml#/definitions/uint32
|
||||
multipleOf: 32
|
||||
@@ -620,17 +610,6 @@ patternProperties:
|
||||
description:
|
||||
Tightens the ATI band from 1/8 to 1/16 of the desired target.
|
||||
|
||||
azoteq,thresh:
|
||||
$ref: /schemas/types.yaml#/definitions/uint32-array
|
||||
minItems: 6
|
||||
maxItems: 9
|
||||
items:
|
||||
minimum: 0
|
||||
maximum: 255
|
||||
default: [0, 0, 0, 0, 0, 0, 0, 0, 0]
|
||||
description:
|
||||
Specifies each individual trackpad channel's touch threshold.
|
||||
|
||||
azoteq,hyst:
|
||||
$ref: /schemas/types.yaml#/definitions/uint32
|
||||
minimum: 0
|
||||
@@ -720,6 +699,28 @@ patternProperties:
|
||||
Specifies the number of points across which an axial gesture must
|
||||
travel in order to be interpreted as a flick or swipe.
|
||||
|
||||
patternProperties:
|
||||
"^channel-[0-8]$":
|
||||
type: object
|
||||
description: Represents a single trackpad channel.
|
||||
|
||||
properties:
|
||||
azoteq,thresh:
|
||||
$ref: /schemas/types.yaml#/definitions/uint32
|
||||
minimum: 0
|
||||
maximum: 255
|
||||
default: 0
|
||||
description: Specifies the threshold for the channel.
|
||||
|
||||
azoteq,ati-base:
|
||||
$ref: /schemas/types.yaml#/definitions/uint32
|
||||
minimum: 45
|
||||
maximum: 300
|
||||
default: 45
|
||||
description: Specifies the channel's ATI base.
|
||||
|
||||
additionalProperties: false
|
||||
|
||||
dependencies:
|
||||
azoteq,gesture-swipe: ["linux,keycodes"]
|
||||
azoteq,timeout-tap-ms: ["linux,keycodes"]
|
||||
@@ -780,14 +781,8 @@ examples:
|
||||
azoteq,filt-str-lp-cnt = <1>;
|
||||
|
||||
azoteq,hyst = <4>;
|
||||
azoteq,thresh = <35>, <40>, <40>,
|
||||
<38>, <33>, <38>,
|
||||
<35>, <35>, <35>;
|
||||
|
||||
azoteq,ati-mode = <3>;
|
||||
azoteq,ati-base = <195>, <195>, <195>,
|
||||
<195>, <195>, <195>,
|
||||
<195>, <195>, <195>;
|
||||
azoteq,ati-target = <512>;
|
||||
|
||||
azoteq,proj-bias = <1>;
|
||||
@@ -804,6 +799,51 @@ examples:
|
||||
azoteq,timeout-swipe-ms = <800>;
|
||||
azoteq,timeout-tap-ms = <400>;
|
||||
azoteq,thresh-swipe = <40>;
|
||||
|
||||
channel-0 {
|
||||
azoteq,thresh = <35>;
|
||||
azoteq,ati-base = <195>;
|
||||
};
|
||||
|
||||
channel-1 {
|
||||
azoteq,thresh = <40>;
|
||||
azoteq,ati-base = <195>;
|
||||
};
|
||||
|
||||
channel-2 {
|
||||
azoteq,thresh = <40>;
|
||||
azoteq,ati-base = <195>;
|
||||
};
|
||||
|
||||
channel-3 {
|
||||
azoteq,thresh = <38>;
|
||||
azoteq,ati-base = <195>;
|
||||
};
|
||||
|
||||
channel-4 {
|
||||
azoteq,thresh = <33>;
|
||||
azoteq,ati-base = <195>;
|
||||
};
|
||||
|
||||
channel-5 {
|
||||
azoteq,thresh = <38>;
|
||||
azoteq,ati-base = <195>;
|
||||
};
|
||||
|
||||
channel-6 {
|
||||
azoteq,thresh = <35>;
|
||||
azoteq,ati-base = <195>;
|
||||
};
|
||||
|
||||
channel-7 {
|
||||
azoteq,thresh = <35>;
|
||||
azoteq,ati-base = <195>;
|
||||
};
|
||||
|
||||
channel-8 {
|
||||
azoteq,thresh = <35>;
|
||||
azoteq,ati-base = <195>;
|
||||
};
|
||||
};
|
||||
|
||||
/*
|
||||
|
||||
@@ -19,7 +19,10 @@ properties:
|
||||
- microchip,cap1106
|
||||
- microchip,cap1126
|
||||
- microchip,cap1188
|
||||
- microchip,cap1203
|
||||
- microchip,cap1206
|
||||
- microchip,cap1293
|
||||
- microchip,cap1298
|
||||
|
||||
reg:
|
||||
maxItems: 1
|
||||
|
||||
@@ -1,41 +0,0 @@
|
||||
* ST-Microelectronics FingerTip touchscreen controller
|
||||
|
||||
The ST-Microelectronics FingerTip device provides a basic touchscreen
|
||||
functionality. Along with it the user can enable the touchkey which can work as
|
||||
a basic HOME and BACK key for phones.
|
||||
|
||||
The driver supports also hovering as an absolute single touch event with x, y, z
|
||||
coordinates.
|
||||
|
||||
Required properties:
|
||||
- compatible : must be "st,stmfts"
|
||||
- reg : I2C slave address, (e.g. 0x49)
|
||||
- interrupts : interrupt specification
|
||||
- avdd-supply : analogic power supply
|
||||
- vdd-supply : power supply
|
||||
- touchscreen-size-x : see touchscreen.txt
|
||||
- touchscreen-size-y : see touchscreen.txt
|
||||
|
||||
Optional properties:
|
||||
- touch-key-connected : specifies whether the touchkey feature is connected
|
||||
- ledvdd-supply : power supply to the touch key leds
|
||||
|
||||
Example:
|
||||
|
||||
i2c@00000000 {
|
||||
|
||||
/* ... */
|
||||
|
||||
touchscreen@49 {
|
||||
compatible = "st,stmfts";
|
||||
reg = <0x49>;
|
||||
interrupt-parent = <&gpa1>;
|
||||
interrupts = <1 IRQ_TYPE_NONE>;
|
||||
touchscreen-size-x = <1599>;
|
||||
touchscreen-size-y = <2559>;
|
||||
touch-key-connected;
|
||||
avdd-supply = <&ldo30_reg>;
|
||||
vdd-supply = <&ldo31_reg>;
|
||||
ledvdd-supply = <&ldo33_reg>;
|
||||
};
|
||||
};
|
||||
@@ -0,0 +1,72 @@
|
||||
# SPDX-License-Identifier: GPL-2.0-only OR BSD-2-Clause
|
||||
%YAML 1.2
|
||||
---
|
||||
$id: http://devicetree.org/schemas/input/touchscreen/st,stmfts.yaml#
|
||||
$schema: http://devicetree.org/meta-schemas/core.yaml#
|
||||
|
||||
title: ST-Microelectronics FingerTip touchscreen controller
|
||||
|
||||
maintainers:
|
||||
- Krzysztof Kozlowski <krzysztof.kozlowski@linaro.org>
|
||||
|
||||
description:
|
||||
The ST-Microelectronics FingerTip device provides a basic touchscreen
|
||||
functionality. Along with it the user can enable the touchkey which can work
|
||||
as a basic HOME and BACK key for phones.
|
||||
|
||||
allOf:
|
||||
- $ref: touchscreen.yaml#
|
||||
|
||||
properties:
|
||||
compatible:
|
||||
const: st,stmfts
|
||||
|
||||
reg:
|
||||
maxItems: 1
|
||||
|
||||
avdd-supply:
|
||||
description: Analogic power supply
|
||||
|
||||
interrupts:
|
||||
maxItems: 1
|
||||
|
||||
ledvdd-supply:
|
||||
description: Power supply to the touch key leds
|
||||
|
||||
touch-key-connected:
|
||||
type: boolean
|
||||
description: The touchkey feature is connected
|
||||
|
||||
vdd-supply:
|
||||
description: Power supply
|
||||
|
||||
required:
|
||||
- compatible
|
||||
- reg
|
||||
- avdd-supply
|
||||
- interrupts
|
||||
- vdd-supply
|
||||
|
||||
unevaluatedProperties: false
|
||||
|
||||
examples:
|
||||
- |
|
||||
#include <dt-bindings/interrupt-controller/irq.h>
|
||||
|
||||
i2c {
|
||||
#address-cells = <1>;
|
||||
#size-cells = <0>;
|
||||
|
||||
touchscreen@49 {
|
||||
compatible = "st,stmfts";
|
||||
reg = <0x49>;
|
||||
interrupt-parent = <&gpa1>;
|
||||
interrupts = <1 IRQ_TYPE_LEVEL_LOW>;
|
||||
touchscreen-size-x = <1599>;
|
||||
touchscreen-size-y = <2559>;
|
||||
touch-key-connected;
|
||||
avdd-supply = <&ldo30_reg>;
|
||||
vdd-supply = <&ldo31_reg>;
|
||||
ledvdd-supply = <&ldo33_reg>;
|
||||
};
|
||||
};
|
||||
@@ -19,6 +19,7 @@
|
||||
#include <linux/proc_fs.h>
|
||||
#include <linux/sched.h>
|
||||
#include <linux/seq_file.h>
|
||||
#include <linux/pm.h>
|
||||
#include <linux/poll.h>
|
||||
#include <linux/device.h>
|
||||
#include <linux/kstrtox.h>
|
||||
@@ -1828,7 +1829,6 @@ out:
|
||||
return ret;
|
||||
}
|
||||
|
||||
#ifdef CONFIG_PM_SLEEP
|
||||
static int input_dev_suspend(struct device *dev)
|
||||
{
|
||||
struct input_dev *input_dev = to_input_dev(dev);
|
||||
@@ -1903,15 +1903,12 @@ static const struct dev_pm_ops input_dev_pm_ops = {
|
||||
.poweroff = input_dev_poweroff,
|
||||
.restore = input_dev_resume,
|
||||
};
|
||||
#endif /* CONFIG_PM */
|
||||
|
||||
static const struct device_type input_dev_type = {
|
||||
.groups = input_dev_attr_groups,
|
||||
.release = input_dev_release,
|
||||
.uevent = input_dev_uevent,
|
||||
#ifdef CONFIG_PM_SLEEP
|
||||
.pm = &input_dev_pm_ops,
|
||||
#endif
|
||||
.pm = pm_sleep_ptr(&input_dev_pm_ops),
|
||||
};
|
||||
|
||||
static char *input_devnode(const struct device *dev, umode_t *mode)
|
||||
|
||||
@@ -359,6 +359,7 @@ static const struct xpad_device {
|
||||
{ 0x24c6, 0xfafe, "Rock Candy Gamepad for Xbox 360", 0, XTYPE_XBOX360 },
|
||||
{ 0x2563, 0x058d, "OneXPlayer Gamepad", 0, XTYPE_XBOX360 },
|
||||
{ 0x2dc8, 0x2000, "8BitDo Pro 2 Wired Controller fox Xbox", 0, XTYPE_XBOXONE },
|
||||
{ 0x2dc8, 0x3106, "8BitDo Pro 2 Wired Controller", 0, XTYPE_XBOX360 },
|
||||
{ 0x31e3, 0x1100, "Wooting One", 0, XTYPE_XBOX360 },
|
||||
{ 0x31e3, 0x1200, "Wooting Two", 0, XTYPE_XBOX360 },
|
||||
{ 0x31e3, 0x1210, "Wooting Lekker", 0, XTYPE_XBOX360 },
|
||||
@@ -492,6 +493,7 @@ static const struct usb_device_id xpad_table[] = {
|
||||
XPAD_XBOXONE_VENDOR(0x24c6), /* PowerA Controllers */
|
||||
XPAD_XBOX360_VENDOR(0x2563), /* OneXPlayer Gamepad */
|
||||
XPAD_XBOX360_VENDOR(0x260d), /* Dareu H101 */
|
||||
XPAD_XBOX360_VENDOR(0x2dc8), /* 8BitDo Pro 2 Wired Controller */
|
||||
XPAD_XBOXONE_VENDOR(0x2dc8), /* 8BitDo Pro 2 Wired Controller for Xbox */
|
||||
XPAD_XBOXONE_VENDOR(0x2e24), /* Hyperkin Duke X-Box One pad */
|
||||
XPAD_XBOX360_VENDOR(0x2f24), /* GameSir Controllers */
|
||||
|
||||
@@ -557,7 +557,7 @@ config KEYBOARD_PMIC8XXX
|
||||
help
|
||||
Say Y here if you want to enable the driver for the PMIC8XXX
|
||||
keypad provided as a reference design from Qualcomm. This is intended
|
||||
to support upto 18x8 matrix based keypad design.
|
||||
to support up to 18x8 matrix-based keypad design.
|
||||
|
||||
To compile this driver as a module, choose M here: the module will
|
||||
be called pmic8xxx-keypad.
|
||||
|
||||
@@ -1876,7 +1876,7 @@ static int applespi_poweroff_late(struct device *dev)
|
||||
return 0;
|
||||
}
|
||||
|
||||
static int __maybe_unused applespi_suspend(struct device *dev)
|
||||
static int applespi_suspend(struct device *dev)
|
||||
{
|
||||
struct spi_device *spi = to_spi_device(dev);
|
||||
struct applespi_data *applespi = spi_get_drvdata(spi);
|
||||
@@ -1903,7 +1903,7 @@ static int __maybe_unused applespi_suspend(struct device *dev)
|
||||
return 0;
|
||||
}
|
||||
|
||||
static int __maybe_unused applespi_resume(struct device *dev)
|
||||
static int applespi_resume(struct device *dev)
|
||||
{
|
||||
struct spi_device *spi = to_spi_device(dev);
|
||||
struct applespi_data *applespi = spi_get_drvdata(spi);
|
||||
@@ -1947,15 +1947,15 @@ static const struct acpi_device_id applespi_acpi_match[] = {
|
||||
MODULE_DEVICE_TABLE(acpi, applespi_acpi_match);
|
||||
|
||||
static const struct dev_pm_ops applespi_pm_ops = {
|
||||
SET_SYSTEM_SLEEP_PM_OPS(applespi_suspend, applespi_resume)
|
||||
.poweroff_late = applespi_poweroff_late,
|
||||
SYSTEM_SLEEP_PM_OPS(applespi_suspend, applespi_resume)
|
||||
.poweroff_late = pm_sleep_ptr(applespi_poweroff_late),
|
||||
};
|
||||
|
||||
static struct spi_driver applespi_driver = {
|
||||
.driver = {
|
||||
.name = "applespi",
|
||||
.acpi_match_table = applespi_acpi_match,
|
||||
.pm = &applespi_pm_ops,
|
||||
.pm = pm_sleep_ptr(&applespi_pm_ops),
|
||||
},
|
||||
.probe = applespi_probe,
|
||||
.remove = applespi_remove,
|
||||
|
||||
@@ -98,14 +98,20 @@ enum {
|
||||
CAP1106,
|
||||
CAP1126,
|
||||
CAP1188,
|
||||
CAP1203,
|
||||
CAP1206,
|
||||
CAP1293,
|
||||
CAP1298
|
||||
};
|
||||
|
||||
static const struct cap11xx_hw_model cap11xx_devices[] = {
|
||||
[CAP1106] = { .product_id = 0x55, .num_channels = 6, .num_leds = 0, .no_gain = false },
|
||||
[CAP1126] = { .product_id = 0x53, .num_channels = 6, .num_leds = 2, .no_gain = false },
|
||||
[CAP1188] = { .product_id = 0x50, .num_channels = 8, .num_leds = 8, .no_gain = false },
|
||||
[CAP1203] = { .product_id = 0x6d, .num_channels = 3, .num_leds = 0, .no_gain = true },
|
||||
[CAP1206] = { .product_id = 0x67, .num_channels = 6, .num_leds = 0, .no_gain = true },
|
||||
[CAP1293] = { .product_id = 0x6f, .num_channels = 3, .num_leds = 0, .no_gain = false },
|
||||
[CAP1298] = { .product_id = 0x71, .num_channels = 8, .num_leds = 0, .no_gain = false },
|
||||
};
|
||||
|
||||
static const struct reg_default cap11xx_reg_defaults[] = {
|
||||
@@ -377,7 +383,8 @@ static int cap11xx_i2c_probe(struct i2c_client *i2c_client)
|
||||
if (error < 0)
|
||||
return error;
|
||||
|
||||
dev_info(dev, "CAP11XX detected, revision 0x%02x\n", rev);
|
||||
dev_info(dev, "CAP11XX detected, model %s, revision 0x%02x\n",
|
||||
id->name, rev);
|
||||
node = dev->of_node;
|
||||
|
||||
if (!of_property_read_u32(node, "microchip,sensor-gain", &gain32)) {
|
||||
@@ -390,7 +397,9 @@ static int cap11xx_i2c_probe(struct i2c_client *i2c_client)
|
||||
dev_err(dev, "Invalid sensor-gain value %d\n", gain32);
|
||||
}
|
||||
|
||||
if (id->driver_data != CAP1206) {
|
||||
if (id->driver_data == CAP1106 ||
|
||||
id->driver_data == CAP1126 ||
|
||||
id->driver_data == CAP1188) {
|
||||
if (of_property_read_bool(node, "microchip,irq-active-high")) {
|
||||
error = regmap_update_bits(priv->regmap,
|
||||
CAP11XX_REG_CONFIG2,
|
||||
@@ -483,7 +492,10 @@ static const struct of_device_id cap11xx_dt_ids[] = {
|
||||
{ .compatible = "microchip,cap1106", },
|
||||
{ .compatible = "microchip,cap1126", },
|
||||
{ .compatible = "microchip,cap1188", },
|
||||
{ .compatible = "microchip,cap1203", },
|
||||
{ .compatible = "microchip,cap1206", },
|
||||
{ .compatible = "microchip,cap1293", },
|
||||
{ .compatible = "microchip,cap1298", },
|
||||
{}
|
||||
};
|
||||
MODULE_DEVICE_TABLE(of, cap11xx_dt_ids);
|
||||
@@ -492,7 +504,10 @@ static const struct i2c_device_id cap11xx_i2c_ids[] = {
|
||||
{ "cap1106", CAP1106 },
|
||||
{ "cap1126", CAP1126 },
|
||||
{ "cap1188", CAP1188 },
|
||||
{ "cap1203", CAP1203 },
|
||||
{ "cap1206", CAP1206 },
|
||||
{ "cap1293", CAP1293 },
|
||||
{ "cap1298", CAP1298 },
|
||||
{}
|
||||
};
|
||||
MODULE_DEVICE_TABLE(i2c, cap11xx_i2c_ids);
|
||||
|
||||
@@ -100,6 +100,21 @@ static const struct cros_ec_bs_map cros_ec_keyb_bs[] = {
|
||||
.code = KEY_VOLUMEDOWN,
|
||||
.bit = EC_MKBP_VOL_DOWN,
|
||||
},
|
||||
{
|
||||
.ev_type = EV_KEY,
|
||||
.code = KEY_BRIGHTNESSUP,
|
||||
.bit = EC_MKBP_BRI_UP,
|
||||
},
|
||||
{
|
||||
.ev_type = EV_KEY,
|
||||
.code = KEY_BRIGHTNESSDOWN,
|
||||
.bit = EC_MKBP_BRI_DOWN,
|
||||
},
|
||||
{
|
||||
.ev_type = EV_KEY,
|
||||
.code = KEY_SCREENLOCK,
|
||||
.bit = EC_MKBP_SCREEN_LOCK,
|
||||
},
|
||||
|
||||
/* Switches */
|
||||
{
|
||||
|
||||
@@ -310,7 +310,7 @@ static int omap4_keypad_check_revision(struct device *dev,
|
||||
* Interrupt may not happen for key-up events. We must clear stuck
|
||||
* key-up events after the keyboard hardware has auto-idled.
|
||||
*/
|
||||
static int __maybe_unused omap4_keypad_runtime_suspend(struct device *dev)
|
||||
static int omap4_keypad_runtime_suspend(struct device *dev)
|
||||
{
|
||||
struct platform_device *pdev = to_platform_device(dev);
|
||||
struct omap4_keypad *keypad_data = platform_get_drvdata(pdev);
|
||||
@@ -328,7 +328,7 @@ static int __maybe_unused omap4_keypad_runtime_suspend(struct device *dev)
|
||||
}
|
||||
|
||||
static const struct dev_pm_ops omap4_keypad_pm_ops = {
|
||||
SET_RUNTIME_PM_OPS(omap4_keypad_runtime_suspend, NULL, NULL)
|
||||
RUNTIME_PM_OPS(omap4_keypad_runtime_suspend, NULL, NULL)
|
||||
};
|
||||
|
||||
static void omap4_disable_pm(void *d)
|
||||
@@ -488,7 +488,7 @@ static struct platform_driver omap4_keypad_driver = {
|
||||
.driver = {
|
||||
.name = "omap4-keypad",
|
||||
.of_match_table = omap_keypad_dt_match,
|
||||
.pm = &omap4_keypad_pm_ops,
|
||||
.pm = pm_ptr(&omap4_keypad_pm_ops),
|
||||
},
|
||||
};
|
||||
module_platform_driver(omap4_keypad_driver);
|
||||
|
||||
@@ -458,7 +458,6 @@ static int samsung_keypad_remove(struct platform_device *pdev)
|
||||
return 0;
|
||||
}
|
||||
|
||||
#ifdef CONFIG_PM
|
||||
static int samsung_keypad_runtime_suspend(struct device *dev)
|
||||
{
|
||||
struct platform_device *pdev = to_platform_device(dev);
|
||||
@@ -503,9 +502,7 @@ static int samsung_keypad_runtime_resume(struct device *dev)
|
||||
|
||||
return 0;
|
||||
}
|
||||
#endif
|
||||
|
||||
#ifdef CONFIG_PM_SLEEP
|
||||
static void samsung_keypad_toggle_wakeup(struct samsung_keypad *keypad,
|
||||
bool enable)
|
||||
{
|
||||
@@ -563,12 +560,11 @@ static int samsung_keypad_resume(struct device *dev)
|
||||
|
||||
return 0;
|
||||
}
|
||||
#endif
|
||||
|
||||
static const struct dev_pm_ops samsung_keypad_pm_ops = {
|
||||
SET_SYSTEM_SLEEP_PM_OPS(samsung_keypad_suspend, samsung_keypad_resume)
|
||||
SET_RUNTIME_PM_OPS(samsung_keypad_runtime_suspend,
|
||||
samsung_keypad_runtime_resume, NULL)
|
||||
SYSTEM_SLEEP_PM_OPS(samsung_keypad_suspend, samsung_keypad_resume)
|
||||
RUNTIME_PM_OPS(samsung_keypad_runtime_suspend,
|
||||
samsung_keypad_runtime_resume, NULL)
|
||||
};
|
||||
|
||||
#ifdef CONFIG_OF
|
||||
@@ -598,7 +594,7 @@ static struct platform_driver samsung_keypad_driver = {
|
||||
.driver = {
|
||||
.name = "samsung-keypad",
|
||||
.of_match_table = of_match_ptr(samsung_keypad_dt_match),
|
||||
.pm = &samsung_keypad_pm_ops,
|
||||
.pm = pm_ptr(&samsung_keypad_pm_ops),
|
||||
},
|
||||
.id_table = samsung_keypad_driver_ids,
|
||||
};
|
||||
|
||||
@@ -186,7 +186,6 @@ static int spear_kbd_probe(struct platform_device *pdev)
|
||||
const struct matrix_keymap_data *keymap = pdata ? pdata->keymap : NULL;
|
||||
struct spear_kbd *kbd;
|
||||
struct input_dev *input_dev;
|
||||
struct resource *res;
|
||||
int irq;
|
||||
int error;
|
||||
|
||||
@@ -219,8 +218,7 @@ static int spear_kbd_probe(struct platform_device *pdev)
|
||||
kbd->suspended_rate = pdata->suspended_rate;
|
||||
}
|
||||
|
||||
res = platform_get_resource(pdev, IORESOURCE_MEM, 0);
|
||||
kbd->io_base = devm_ioremap_resource(&pdev->dev, res);
|
||||
kbd->io_base = devm_platform_get_and_ioremap_resource(pdev, 0, NULL);
|
||||
if (IS_ERR(kbd->io_base))
|
||||
return PTR_ERR(kbd->io_base);
|
||||
|
||||
|
||||
@@ -125,7 +125,6 @@ static int keyscan_probe(struct platform_device *pdev)
|
||||
{
|
||||
struct st_keyscan *keypad_data;
|
||||
struct input_dev *input_dev;
|
||||
struct resource *res;
|
||||
int error;
|
||||
|
||||
if (!pdev->dev.of_node) {
|
||||
@@ -169,8 +168,7 @@ static int keyscan_probe(struct platform_device *pdev)
|
||||
|
||||
input_set_drvdata(input_dev, keypad_data);
|
||||
|
||||
res = platform_get_resource(pdev, IORESOURCE_MEM, 0);
|
||||
keypad_data->base = devm_ioremap_resource(&pdev->dev, res);
|
||||
keypad_data->base = devm_platform_get_and_ioremap_resource(pdev, 0, NULL);
|
||||
if (IS_ERR(keypad_data->base))
|
||||
return PTR_ERR(keypad_data->base);
|
||||
|
||||
|
||||
@@ -598,7 +598,6 @@ MODULE_DEVICE_TABLE(of, tegra_kbc_of_match);
|
||||
static int tegra_kbc_probe(struct platform_device *pdev)
|
||||
{
|
||||
struct tegra_kbc *kbc;
|
||||
struct resource *res;
|
||||
int err;
|
||||
int num_rows = 0;
|
||||
unsigned int debounce_cnt;
|
||||
@@ -642,8 +641,7 @@ static int tegra_kbc_probe(struct platform_device *pdev)
|
||||
|
||||
timer_setup(&kbc->timer, tegra_kbc_keypress_timer, 0);
|
||||
|
||||
res = platform_get_resource(pdev, IORESOURCE_MEM, 0);
|
||||
kbc->mmio = devm_ioremap_resource(&pdev->dev, res);
|
||||
kbc->mmio = devm_platform_get_and_ioremap_resource(pdev, 0, NULL);
|
||||
if (IS_ERR(kbc->mmio))
|
||||
return PTR_ERR(kbc->mmio);
|
||||
|
||||
|
||||
@@ -110,7 +110,7 @@ static int pm860x_onkey_probe(struct platform_device *pdev)
|
||||
return 0;
|
||||
}
|
||||
|
||||
static int __maybe_unused pm860x_onkey_suspend(struct device *dev)
|
||||
static int pm860x_onkey_suspend(struct device *dev)
|
||||
{
|
||||
struct platform_device *pdev = to_platform_device(dev);
|
||||
struct pm860x_chip *chip = dev_get_drvdata(pdev->dev.parent);
|
||||
@@ -119,7 +119,7 @@ static int __maybe_unused pm860x_onkey_suspend(struct device *dev)
|
||||
chip->wakeup_flag |= 1 << PM8607_IRQ_ONKEY;
|
||||
return 0;
|
||||
}
|
||||
static int __maybe_unused pm860x_onkey_resume(struct device *dev)
|
||||
static int pm860x_onkey_resume(struct device *dev)
|
||||
{
|
||||
struct platform_device *pdev = to_platform_device(dev);
|
||||
struct pm860x_chip *chip = dev_get_drvdata(pdev->dev.parent);
|
||||
@@ -129,12 +129,13 @@ static int __maybe_unused pm860x_onkey_resume(struct device *dev)
|
||||
return 0;
|
||||
}
|
||||
|
||||
static SIMPLE_DEV_PM_OPS(pm860x_onkey_pm_ops, pm860x_onkey_suspend, pm860x_onkey_resume);
|
||||
static DEFINE_SIMPLE_DEV_PM_OPS(pm860x_onkey_pm_ops,
|
||||
pm860x_onkey_suspend, pm860x_onkey_resume);
|
||||
|
||||
static struct platform_driver pm860x_onkey_driver = {
|
||||
.driver = {
|
||||
.name = "88pm860x-onkey",
|
||||
.pm = &pm860x_onkey_pm_ops,
|
||||
.pm = pm_sleep_ptr(&pm860x_onkey_pm_ops),
|
||||
},
|
||||
.probe = pm860x_onkey_probe,
|
||||
};
|
||||
|
||||
@@ -12,18 +12,6 @@
|
||||
#include <linux/pm.h>
|
||||
#include "ad714x.h"
|
||||
|
||||
static int __maybe_unused ad714x_i2c_suspend(struct device *dev)
|
||||
{
|
||||
return ad714x_disable(i2c_get_clientdata(to_i2c_client(dev)));
|
||||
}
|
||||
|
||||
static int __maybe_unused ad714x_i2c_resume(struct device *dev)
|
||||
{
|
||||
return ad714x_enable(i2c_get_clientdata(to_i2c_client(dev)));
|
||||
}
|
||||
|
||||
static SIMPLE_DEV_PM_OPS(ad714x_i2c_pm, ad714x_i2c_suspend, ad714x_i2c_resume);
|
||||
|
||||
static int ad714x_i2c_write(struct ad714x_chip *chip,
|
||||
unsigned short reg, unsigned short data)
|
||||
{
|
||||
@@ -96,7 +84,7 @@ MODULE_DEVICE_TABLE(i2c, ad714x_id);
|
||||
static struct i2c_driver ad714x_i2c_driver = {
|
||||
.driver = {
|
||||
.name = "ad714x_captouch",
|
||||
.pm = &ad714x_i2c_pm,
|
||||
.pm = pm_sleep_ptr(&ad714x_pm),
|
||||
},
|
||||
.probe_new = ad714x_i2c_probe,
|
||||
.id_table = ad714x_id,
|
||||
|
||||
@@ -15,18 +15,6 @@
|
||||
#define AD714x_SPI_CMD_PREFIX 0xE000 /* bits 15:11 */
|
||||
#define AD714x_SPI_READ BIT(10)
|
||||
|
||||
static int __maybe_unused ad714x_spi_suspend(struct device *dev)
|
||||
{
|
||||
return ad714x_disable(spi_get_drvdata(to_spi_device(dev)));
|
||||
}
|
||||
|
||||
static int __maybe_unused ad714x_spi_resume(struct device *dev)
|
||||
{
|
||||
return ad714x_enable(spi_get_drvdata(to_spi_device(dev)));
|
||||
}
|
||||
|
||||
static SIMPLE_DEV_PM_OPS(ad714x_spi_pm, ad714x_spi_suspend, ad714x_spi_resume);
|
||||
|
||||
static int ad714x_spi_read(struct ad714x_chip *chip,
|
||||
unsigned short reg, unsigned short *data, size_t len)
|
||||
{
|
||||
@@ -103,7 +91,7 @@ static int ad714x_spi_probe(struct spi_device *spi)
|
||||
static struct spi_driver ad714x_spi_driver = {
|
||||
.driver = {
|
||||
.name = "ad714x_captouch",
|
||||
.pm = &ad714x_spi_pm,
|
||||
.pm = pm_sleep_ptr(&ad714x_pm),
|
||||
},
|
||||
.probe = ad714x_spi_probe,
|
||||
};
|
||||
|
||||
@@ -1162,9 +1162,9 @@ struct ad714x_chip *ad714x_probe(struct device *dev, u16 bus_type, int irq,
|
||||
}
|
||||
EXPORT_SYMBOL(ad714x_probe);
|
||||
|
||||
#ifdef CONFIG_PM
|
||||
int ad714x_disable(struct ad714x_chip *ad714x)
|
||||
static int ad714x_suspend(struct device *dev)
|
||||
{
|
||||
struct ad714x_chip *ad714x = dev_get_drvdata(dev);
|
||||
unsigned short data;
|
||||
|
||||
dev_dbg(ad714x->dev, "%s enter\n", __func__);
|
||||
@@ -1178,10 +1178,10 @@ int ad714x_disable(struct ad714x_chip *ad714x)
|
||||
|
||||
return 0;
|
||||
}
|
||||
EXPORT_SYMBOL(ad714x_disable);
|
||||
|
||||
int ad714x_enable(struct ad714x_chip *ad714x)
|
||||
static int ad714x_resume(struct device *dev)
|
||||
{
|
||||
struct ad714x_chip *ad714x = dev_get_drvdata(dev);
|
||||
dev_dbg(ad714x->dev, "%s enter\n", __func__);
|
||||
|
||||
mutex_lock(&ad714x->mutex);
|
||||
@@ -1201,8 +1201,8 @@ int ad714x_enable(struct ad714x_chip *ad714x)
|
||||
|
||||
return 0;
|
||||
}
|
||||
EXPORT_SYMBOL(ad714x_enable);
|
||||
#endif
|
||||
|
||||
EXPORT_SIMPLE_DEV_PM_OPS(ad714x_pm, ad714x_suspend, ad714x_resume);
|
||||
|
||||
MODULE_DESCRIPTION("Analog Devices AD714X Capacitance Touch Sensor Driver");
|
||||
MODULE_AUTHOR("Barry Song <21cnbao@gmail.com>");
|
||||
|
||||
@@ -8,6 +8,7 @@
|
||||
#ifndef _AD714X_H_
|
||||
#define _AD714X_H_
|
||||
|
||||
#include <linux/pm.h>
|
||||
#include <linux/types.h>
|
||||
|
||||
#define STAGE_NUM 12
|
||||
@@ -45,8 +46,7 @@ struct ad714x_chip {
|
||||
|
||||
};
|
||||
|
||||
int ad714x_disable(struct ad714x_chip *ad714x);
|
||||
int ad714x_enable(struct ad714x_chip *ad714x);
|
||||
extern const struct dev_pm_ops ad714x_pm;
|
||||
struct ad714x_chip *ad714x_probe(struct device *dev, u16 bus_type, int irq,
|
||||
ad714x_read_t read, ad714x_write_t write);
|
||||
|
||||
|
||||
Some files were not shown because too many files have changed in this diff Show More
Reference in New Issue
Block a user