Commit f20c86cd authored by Dmitry Torokhov's avatar Dmitry Torokhov

Merge branch 'next' into for-linus

Prepare input updates for 3.19.
parents a1f9a407 1d6a0136
Device tree bindings for Microchip CAP1106, 6 channel capacitive touch sensor Device tree bindings for Microchip CAP11xx based capacitive touch sensors
The node for this driver must be a child of a I2C controller node, as the The node for this device must be a child of a I2C controller node, as the
device communication via I2C only. device communication via I2C only.
Required properties: Required properties:
compatible: Must be "microchip,cap1106" compatible: Must contain one of:
"microchip,cap1106"
"microchip,cap1126"
"microchip,cap1188"
reg: The I2C slave address of the device. reg: The I2C slave address of the device.
Only 0x28 is valid.
interrupts: Property describing the interrupt line the interrupts: Property describing the interrupt line the
device's ALERT#/CM_IRQ# pin is connected to. device's ALERT#/CM_IRQ# pin is connected to.
...@@ -26,6 +28,10 @@ Optional properties: ...@@ -26,6 +28,10 @@ Optional properties:
Valid values are 1, 2, 4, and 8. Valid values are 1, 2, 4, and 8.
By default, a gain of 1 is set. By default, a gain of 1 is set.
microchip,irq-active-high: By default the interrupt pin is active low
open drain. This property allows using the active
high push-pull output.
linux,keycodes: Specifies an array of numeric keycode values to linux,keycodes: Specifies an array of numeric keycode values to
be used for the channels. If this property is be used for the channels. If this property is
omitted, KEY_A, KEY_B, etc are used as omitted, KEY_A, KEY_B, etc are used as
...@@ -43,11 +49,11 @@ i2c_controller { ...@@ -43,11 +49,11 @@ i2c_controller {
autorepeat; autorepeat;
microchip,sensor-gain = <2>; microchip,sensor-gain = <2>;
linux,keycodes = <103 /* KEY_UP */ linux,keycodes = <103>, /* KEY_UP */
106 /* KEY_RIGHT */ <106>, /* KEY_RIGHT */
108 /* KEY_DOWN */ <108>, /* KEY_DOWN */
105 /* KEY_LEFT */ <105>, /* KEY_LEFT */
109 /* KEY_PAGEDOWN */ <109>, /* KEY_PAGEDOWN */
104>; /* KEY_PAGEUP */ <104>; /* KEY_PAGEUP */
}; };
} }
Elantech I2C Touchpad
Required properties:
- compatible: must be "elan,ekth3000".
- reg: I2C address of the chip.
- interrupt-parent: a phandle for the interrupt controller (see interrupt
binding[0]).
- interrupts: interrupt to which the chip is connected (see interrupt
binding[0]).
Optional properties:
- wakeup-source: touchpad can be used as a wakeup source.
- pinctrl-names: should be "default" (see pinctrl binding [1]).
- pinctrl-0: a phandle pointing to the pin settings for the device (see
pinctrl binding [1]).
- vcc-supply: a phandle for the regulator supplying 3.3V power.
[0]: Documentation/devicetree/bindings/interrupt-controller/interrupts.txt
[1]: Documentation/devicetree/bindings/pinctrl/pinctrl-bindings.txt
Example:
&i2c1 {
/* ... */
touchpad@15 {
compatible = "elan,ekth3000";
reg = <0x15>;
interrupt-parent = <&gpio4>;
interrupts = <0x0 IRQ_TYPE_EDGE_FALLING>;
wakeup-source;
};
/* ... */
};
Elantech I2C Touchscreen
Required properties:
- compatible: must be "elan,ekth3500".
- reg: I2C address of the chip.
- interrupt-parent: a phandle for the interrupt controller (see interrupt
binding[0]).
- interrupts: interrupt to which the chip is connected (see interrupt
binding[0]).
Optional properties:
- wakeup-source: touchscreen can be used as a wakeup source.
- pinctrl-names: should be "default" (see pinctrl binding [1]).
- pinctrl-0: a phandle pointing to the pin settings for the device (see
pinctrl binding [1]).
[0]: Documentation/devicetree/bindings/interrupt-controller/interrupts.txt
[1]: Documentation/devicetree/bindings/pinctrl/pinctrl-bindings.txt
Example:
&i2c1 {
/* ... */
touchscreen@10 {
compatible = "elan,ekth3500";
reg = <0x10>;
interrupt-parent = <&gpio4>;
interrupts = <0x0 IRQ_TYPE_EDGE_FALLING>;
wakeup-source;
};
/* ... */
};
...@@ -10,10 +10,13 @@ Optional properties: ...@@ -10,10 +10,13 @@ Optional properties:
Each button (key) is represented as a sub-node of "gpio-keys": Each button (key) is represented as a sub-node of "gpio-keys":
Subnode properties: Subnode properties:
- gpios: OF device-tree gpio specification.
- label: Descriptive name of the key. - label: Descriptive name of the key.
- linux,code: Keycode to emit. - linux,code: Keycode to emit.
Required mutual exclusive subnode-properties:
- gpios: OF device-tree gpio specification.
- interrupts: the interrupt line for that input
Optional subnode-properties: Optional subnode-properties:
- linux,input-type: Specify event type this button/key generates. - linux,input-type: Specify event type this button/key generates.
If not specified defaults to <1> == EV_KEY. If not specified defaults to <1> == EV_KEY.
...@@ -33,4 +36,9 @@ Example nodes: ...@@ -33,4 +36,9 @@ Example nodes:
linux,code = <103>; linux,code = <103>;
gpios = <&gpio1 0 1>; gpios = <&gpio1 0 1>;
}; };
button@22 {
label = "GPIO Key DOWN";
linux,code = <108>;
interrupts = <1 IRQ_TYPE_LEVEL_HIGH 7>;
};
... ...
...@@ -42,6 +42,7 @@ dlink D-Link Corporation ...@@ -42,6 +42,7 @@ dlink D-Link Corporation
dmo Data Modul AG dmo Data Modul AG
ebv EBV Elektronik ebv EBV Elektronik
edt Emerging Display Technologies edt Emerging Display Technologies
elan Elan Microelectronic Corp.
emmicro EM Microelectronic emmicro EM Microelectronic
epcos EPCOS AG epcos EPCOS AG
epfl Ecole Polytechnique Fédérale de Lausanne epfl Ecole Polytechnique Fédérale de Lausanne
......
...@@ -4062,6 +4062,12 @@ L: linux-media@vger.kernel.org ...@@ -4062,6 +4062,12 @@ L: linux-media@vger.kernel.org
S: Maintained S: Maintained
F: drivers/media/usb/go7007/ F: drivers/media/usb/go7007/
GOODIX TOUCHSCREEN
M: Bastien Nocera <hadess@hadess.net>
L: linux-input@vger.kernel.org
S: Maintained
F: drivers/input/touchscreen/goodix.c
GPIO SUBSYSTEM GPIO SUBSYSTEM
M: Linus Walleij <linus.walleij@linaro.org> M: Linus Walleij <linus.walleij@linaro.org>
M: Alexandre Courbot <gnurou@gmail.com> M: Alexandre Courbot <gnurou@gmail.com>
......
...@@ -527,14 +527,14 @@ EXPORT_SYMBOL(gameport_set_phys); ...@@ -527,14 +527,14 @@ EXPORT_SYMBOL(gameport_set_phys);
*/ */
static void gameport_init_port(struct gameport *gameport) static void gameport_init_port(struct gameport *gameport)
{ {
static atomic_t gameport_no = ATOMIC_INIT(0); static atomic_t gameport_no = ATOMIC_INIT(-1);
__module_get(THIS_MODULE); __module_get(THIS_MODULE);
mutex_init(&gameport->drv_mutex); mutex_init(&gameport->drv_mutex);
device_initialize(&gameport->dev); device_initialize(&gameport->dev);
dev_set_name(&gameport->dev, "gameport%lu", dev_set_name(&gameport->dev, "gameport%lu",
(unsigned long)atomic_inc_return(&gameport_no) - 1); (unsigned long)atomic_inc_return(&gameport_no));
gameport->dev.bus = &gameport_bus; gameport->dev.bus = &gameport_bus;
gameport->dev.release = gameport_release_port; gameport->dev.release = gameport_release_port;
if (gameport->parent) if (gameport->parent)
......
...@@ -1775,7 +1775,7 @@ EXPORT_SYMBOL_GPL(input_class); ...@@ -1775,7 +1775,7 @@ EXPORT_SYMBOL_GPL(input_class);
*/ */
struct input_dev *input_allocate_device(void) struct input_dev *input_allocate_device(void)
{ {
static atomic_t input_no = ATOMIC_INIT(0); static atomic_t input_no = ATOMIC_INIT(-1);
struct input_dev *dev; struct input_dev *dev;
dev = kzalloc(sizeof(struct input_dev), GFP_KERNEL); dev = kzalloc(sizeof(struct input_dev), GFP_KERNEL);
...@@ -1790,7 +1790,7 @@ struct input_dev *input_allocate_device(void) ...@@ -1790,7 +1790,7 @@ struct input_dev *input_allocate_device(void)
INIT_LIST_HEAD(&dev->node); INIT_LIST_HEAD(&dev->node);
dev_set_name(&dev->dev, "input%lu", dev_set_name(&dev->dev, "input%lu",
(unsigned long) atomic_inc_return(&input_no) - 1); (unsigned long)atomic_inc_return(&input_no));
__module_get(THIS_MODULE); __module_get(THIS_MODULE);
} }
......
...@@ -886,8 +886,8 @@ static void xpad_led_set(struct led_classdev *led_cdev, ...@@ -886,8 +886,8 @@ static void xpad_led_set(struct led_classdev *led_cdev,
static int xpad_led_probe(struct usb_xpad *xpad) static int xpad_led_probe(struct usb_xpad *xpad)
{ {
static atomic_t led_seq = ATOMIC_INIT(0); static atomic_t led_seq = ATOMIC_INIT(-1);
long led_no; unsigned long led_no;
struct xpad_led *led; struct xpad_led *led;
struct led_classdev *led_cdev; struct led_classdev *led_cdev;
int error; int error;
...@@ -899,9 +899,9 @@ static int xpad_led_probe(struct usb_xpad *xpad) ...@@ -899,9 +899,9 @@ static int xpad_led_probe(struct usb_xpad *xpad)
if (!led) if (!led)
return -ENOMEM; return -ENOMEM;
led_no = (long)atomic_inc_return(&led_seq) - 1; led_no = atomic_inc_return(&led_seq);
snprintf(led->name, sizeof(led->name), "xpad%ld", led_no); snprintf(led->name, sizeof(led->name), "xpad%lu", led_no);
led->xpad = xpad; led->xpad = xpad;
led_cdev = &led->led_cdev; led_cdev = &led->led_cdev;
......
...@@ -665,14 +665,14 @@ config KEYBOARD_CROS_EC ...@@ -665,14 +665,14 @@ config KEYBOARD_CROS_EC
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 cros_ec_keyb. module will be called cros_ec_keyb.
config KEYBOARD_CAP1106 config KEYBOARD_CAP11XX
tristate "Microchip CAP1106 touch sensor" tristate "Microchip CAP11XX based touch sensors"
depends on OF && I2C depends on OF && I2C
select REGMAP_I2C select REGMAP_I2C
help help
Say Y here to enable the CAP1106 touch sensor driver. Say Y here to enable the CAP11XX touch sensor driver.
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 cap1106. module will be called cap11xx.
endif endif
...@@ -11,7 +11,7 @@ obj-$(CONFIG_KEYBOARD_AMIGA) += amikbd.o ...@@ -11,7 +11,7 @@ obj-$(CONFIG_KEYBOARD_AMIGA) += amikbd.o
obj-$(CONFIG_KEYBOARD_ATARI) += atakbd.o obj-$(CONFIG_KEYBOARD_ATARI) += atakbd.o
obj-$(CONFIG_KEYBOARD_ATKBD) += atkbd.o obj-$(CONFIG_KEYBOARD_ATKBD) += atkbd.o
obj-$(CONFIG_KEYBOARD_BFIN) += bf54x-keys.o obj-$(CONFIG_KEYBOARD_BFIN) += bf54x-keys.o
obj-$(CONFIG_KEYBOARD_CAP1106) += cap1106.o obj-$(CONFIG_KEYBOARD_CAP11XX) += cap11xx.o
obj-$(CONFIG_KEYBOARD_CLPS711X) += clps711x-keypad.o obj-$(CONFIG_KEYBOARD_CLPS711X) += clps711x-keypad.o
obj-$(CONFIG_KEYBOARD_CROS_EC) += cros_ec_keyb.o obj-$(CONFIG_KEYBOARD_CROS_EC) += cros_ec_keyb.o
obj-$(CONFIG_KEYBOARD_DAVINCI) += davinci_keyscan.o obj-$(CONFIG_KEYBOARD_DAVINCI) += davinci_keyscan.o
......
...@@ -45,6 +45,7 @@ MODULE_AUTHOR("Vojtech Pavlik <vojtech@ucw.cz>"); ...@@ -45,6 +45,7 @@ MODULE_AUTHOR("Vojtech Pavlik <vojtech@ucw.cz>");
MODULE_DESCRIPTION("Amiga keyboard driver"); MODULE_DESCRIPTION("Amiga keyboard driver");
MODULE_LICENSE("GPL"); MODULE_LICENSE("GPL");
#ifdef CONFIG_HW_CONSOLE
static unsigned char amikbd_keycode[0x78] __initdata = { static unsigned char amikbd_keycode[0x78] __initdata = {
[0] = KEY_GRAVE, [0] = KEY_GRAVE,
[1] = KEY_1, [1] = KEY_1,
...@@ -144,6 +145,32 @@ static unsigned char amikbd_keycode[0x78] __initdata = { ...@@ -144,6 +145,32 @@ static unsigned char amikbd_keycode[0x78] __initdata = {
[103] = KEY_RIGHTMETA [103] = KEY_RIGHTMETA
}; };
static void __init amikbd_init_console_keymaps(void)
{
/* We can spare 512 bytes on stack for temp_map in init path. */
unsigned short temp_map[NR_KEYS];
int i, j;
for (i = 0; i < MAX_NR_KEYMAPS; i++) {
if (!key_maps[i])
continue;
memset(temp_map, 0, sizeof(temp_map));
for (j = 0; j < 0x78; j++) {
if (!amikbd_keycode[j])
continue;
temp_map[j] = key_maps[i][amikbd_keycode[j]];
}
for (j = 0; j < NR_KEYS; j++) {
if (!temp_map[j])
temp_map[j] = 0xf200;
}
memcpy(key_maps[i], temp_map, sizeof(temp_map));
}
}
#else /* !CONFIG_HW_CONSOLE */
static inline void amikbd_init_console_keymaps(void) {}
#endif /* !CONFIG_HW_CONSOLE */
static const char *amikbd_messages[8] = { static const char *amikbd_messages[8] = {
[0] = KERN_ALERT "amikbd: Ctrl-Amiga-Amiga reset warning!!\n", [0] = KERN_ALERT "amikbd: Ctrl-Amiga-Amiga reset warning!!\n",
[1] = KERN_WARNING "amikbd: keyboard lost sync\n", [1] = KERN_WARNING "amikbd: keyboard lost sync\n",
...@@ -186,7 +213,7 @@ static irqreturn_t amikbd_interrupt(int irq, void *data) ...@@ -186,7 +213,7 @@ static irqreturn_t amikbd_interrupt(int irq, void *data)
static int __init amikbd_probe(struct platform_device *pdev) static int __init amikbd_probe(struct platform_device *pdev)
{ {
struct input_dev *dev; struct input_dev *dev;
int i, j, err; int i, err;
dev = input_allocate_device(); dev = input_allocate_device();
if (!dev) { if (!dev) {
...@@ -207,22 +234,8 @@ static int __init amikbd_probe(struct platform_device *pdev) ...@@ -207,22 +234,8 @@ static int __init amikbd_probe(struct platform_device *pdev)
for (i = 0; i < 0x78; i++) for (i = 0; i < 0x78; i++)
set_bit(i, dev->keybit); set_bit(i, dev->keybit);
for (i = 0; i < MAX_NR_KEYMAPS; i++) { amikbd_init_console_keymaps();
static u_short temp_map[NR_KEYS] __initdata;
if (!key_maps[i])
continue;
memset(temp_map, 0, sizeof(temp_map));
for (j = 0; j < 0x78; j++) {
if (!amikbd_keycode[j])
continue;
temp_map[j] = key_maps[i][amikbd_keycode[j]];
}
for (j = 0; j < NR_KEYS; j++) {
if (!temp_map[j])
temp_map[j] = 0xf200;
}
memcpy(key_maps[i], temp_map, sizeof(temp_map));
}
ciaa.cra &= ~0x41; /* serial data in, turn off TA */ ciaa.cra &= ~0x41; /* serial data in, turn off TA */
err = request_irq(IRQ_AMIGA_CIAA_SP, amikbd_interrupt, 0, "amikbd", err = request_irq(IRQ_AMIGA_CIAA_SP, amikbd_interrupt, 0, "amikbd",
dev); dev);
......
...@@ -456,6 +456,7 @@ static irqreturn_t atkbd_interrupt(struct serio *serio, unsigned char data, ...@@ -456,6 +456,7 @@ static irqreturn_t atkbd_interrupt(struct serio *serio, unsigned char data,
keycode = atkbd->keycode[code]; keycode = atkbd->keycode[code];
if (!(atkbd->release && test_bit(code, atkbd->force_release_mask)))
if (keycode != ATKBD_KEY_NULL) if (keycode != ATKBD_KEY_NULL)
input_event(dev, EV_MSC, MSC_SCAN, code); input_event(dev, EV_MSC, MSC_SCAN, code);
...@@ -511,6 +512,7 @@ static irqreturn_t atkbd_interrupt(struct serio *serio, unsigned char data, ...@@ -511,6 +512,7 @@ static irqreturn_t atkbd_interrupt(struct serio *serio, unsigned char data,
input_sync(dev); input_sync(dev);
if (value && test_bit(code, atkbd->force_release_mask)) { if (value && test_bit(code, atkbd->force_release_mask)) {
input_event(dev, EV_MSC, MSC_SCAN, code);
input_report_key(dev, keycode, 0); input_report_key(dev, keycode, 0);
input_sync(dev); input_sync(dev);
} }
......
...@@ -29,6 +29,7 @@ ...@@ -29,6 +29,7 @@
#include <linux/of.h> #include <linux/of.h>
#include <linux/of_platform.h> #include <linux/of_platform.h>
#include <linux/of_gpio.h> #include <linux/of_gpio.h>
#include <linux/of_irq.h>
#include <linux/spinlock.h> #include <linux/spinlock.h>
struct gpio_button_data { struct gpio_button_data {
...@@ -617,15 +618,20 @@ gpio_keys_get_devtree_pdata(struct device *dev) ...@@ -617,15 +618,20 @@ gpio_keys_get_devtree_pdata(struct device *dev)
i = 0; i = 0;
for_each_child_of_node(node, pp) { for_each_child_of_node(node, pp) {
int gpio; int gpio = -1;
enum of_gpio_flags flags; enum of_gpio_flags flags;
button = &pdata->buttons[i++];
if (!of_find_property(pp, "gpios", NULL)) { if (!of_find_property(pp, "gpios", NULL)) {
button->irq = irq_of_parse_and_map(pp, 0);
if (button->irq == 0) {
i--;
pdata->nbuttons--; pdata->nbuttons--;
dev_warn(dev, "Found button without gpios\n"); dev_warn(dev, "Found button without gpios or irqs\n");
continue; continue;
} }
} else {
gpio = of_get_gpio_flags(pp, 0, &flags); gpio = of_get_gpio_flags(pp, 0, &flags);
if (gpio < 0) { if (gpio < 0) {
error = gpio; error = gpio;
...@@ -635,8 +641,7 @@ gpio_keys_get_devtree_pdata(struct device *dev) ...@@ -635,8 +641,7 @@ gpio_keys_get_devtree_pdata(struct device *dev)
error); error);
return ERR_PTR(error); return ERR_PTR(error);
} }
}
button = &pdata->buttons[i++];
button->gpio = gpio; button->gpio = gpio;
button->active_low = flags & OF_GPIO_ACTIVE_LOW; button->active_low = flags & OF_GPIO_ACTIVE_LOW;
......
...@@ -616,6 +616,8 @@ static ssize_t lm8323_set_disable(struct device *dev, ...@@ -616,6 +616,8 @@ static ssize_t lm8323_set_disable(struct device *dev,
unsigned int i; unsigned int i;
ret = kstrtouint(buf, 10, &i); ret = kstrtouint(buf, 10, &i);
if (ret)
return ret;
mutex_lock(&lm->lock); mutex_lock(&lm->lock);
lm->kp_enabled = !i; lm->kp_enabled = !i;
......
...@@ -66,7 +66,6 @@ ...@@ -66,7 +66,6 @@
struct lpc32xx_kscan_drv { struct lpc32xx_kscan_drv {
struct input_dev *input; struct input_dev *input;
struct clk *clk; struct clk *clk;
struct resource *iores;
void __iomem *kscan_base; void __iomem *kscan_base;
unsigned int irq; unsigned int irq;
...@@ -188,32 +187,27 @@ static int lpc32xx_kscan_probe(struct platform_device *pdev) ...@@ -188,32 +187,27 @@ static int lpc32xx_kscan_probe(struct platform_device *pdev)
return -EINVAL; return -EINVAL;
} }
kscandat = kzalloc(sizeof(struct lpc32xx_kscan_drv), GFP_KERNEL); kscandat = devm_kzalloc(&pdev->dev, sizeof(*kscandat),
if (!kscandat) { GFP_KERNEL);
dev_err(&pdev->dev, "failed to allocate memory\n"); if (!kscandat)
return -ENOMEM; return -ENOMEM;
}
error = lpc32xx_parse_dt(&pdev->dev, kscandat); error = lpc32xx_parse_dt(&pdev->dev, kscandat);
if (error) { if (error) {
dev_err(&pdev->dev, "failed to parse device tree\n"); dev_err(&pdev->dev, "failed to parse device tree\n");
goto err_free_mem; return error;
} }
keymap_size = sizeof(kscandat->keymap[0]) * keymap_size = sizeof(kscandat->keymap[0]) *
(kscandat->matrix_sz << kscandat->row_shift); (kscandat->matrix_sz << kscandat->row_shift);
kscandat->keymap = kzalloc(keymap_size, GFP_KERNEL); kscandat->keymap = devm_kzalloc(&pdev->dev, keymap_size, GFP_KERNEL);
if (!kscandat->keymap) { if (!kscandat->keymap)
dev_err(&pdev->dev, "could not allocate memory for keymap\n"); return -ENOMEM;
error = -ENOMEM;
goto err_free_mem;
}
kscandat->input = input = input_allocate_device(); kscandat->input = input = devm_input_allocate_device(&pdev->dev);
if (!input) { if (!input) {
dev_err(&pdev->dev, "failed to allocate input device\n"); dev_err(&pdev->dev, "failed to allocate input device\n");
error = -ENOMEM; return -ENOMEM;
goto err_free_keymap;
} }
/* Setup key input */ /* Setup key input */
...@@ -234,39 +228,26 @@ static int lpc32xx_kscan_probe(struct platform_device *pdev) ...@@ -234,39 +228,26 @@ static int lpc32xx_kscan_probe(struct platform_device *pdev)
kscandat->keymap, kscandat->input); kscandat->keymap, kscandat->input);
if (error) { if (error) {
dev_err(&pdev->dev, "failed to build keymap\n"); dev_err(&pdev->dev, "failed to build keymap\n");
goto err_free_input; return error;
} }
input_set_drvdata(kscandat->input, kscandat); input_set_drvdata(kscandat->input, kscandat);
kscandat->iores = request_mem_region(res->start, resource_size(res), kscandat->kscan_base = devm_ioremap_resource(&pdev->dev, res);
pdev->name); if (IS_ERR(kscandat->kscan_base))
if (!kscandat->iores) { return PTR_ERR(kscandat->kscan_base);
dev_err(&pdev->dev, "failed to request I/O memory\n");
error = -EBUSY;
goto err_free_input;
}
kscandat->kscan_base = ioremap(kscandat->iores->start,
resource_size(kscandat->iores));
if (!kscandat->kscan_base) {
dev_err(&pdev->dev, "failed to remap I/O memory\n");
error = -EBUSY;
goto err_release_memregion;
}
/* Get the key scanner clock */ /* Get the key scanner clock */
kscandat->clk = clk_get(&pdev->dev, NULL); kscandat->clk = devm_clk_get(&pdev->dev, NULL);
if (IS_ERR(kscandat->clk)) { if (IS_ERR(kscandat->clk)) {
dev_err(&pdev->dev, "failed to get clock\n"); dev_err(&pdev->dev, "failed to get clock\n");
error = PTR_ERR(kscandat->clk); return PTR_ERR(kscandat->clk);
goto err_unmap;
} }
/* Configure the key scanner */ /* Configure the key scanner */
error = clk_prepare_enable(kscandat->clk); error = clk_prepare_enable(kscandat->clk);
if (error) if (error)
goto err_clk_put; return error;
writel(kscandat->deb_clks, LPC32XX_KS_DEB(kscandat->kscan_base)); writel(kscandat->deb_clks, LPC32XX_KS_DEB(kscandat->kscan_base));
writel(kscandat->scan_delay, LPC32XX_KS_SCAN_CTL(kscandat->kscan_base)); writel(kscandat->scan_delay, LPC32XX_KS_SCAN_CTL(kscandat->kscan_base));
...@@ -277,52 +258,20 @@ static int lpc32xx_kscan_probe(struct platform_device *pdev) ...@@ -277,52 +258,20 @@ static int lpc32xx_kscan_probe(struct platform_device *pdev)
writel(1, LPC32XX_KS_IRQ(kscandat->kscan_base)); writel(1, LPC32XX_KS_IRQ(kscandat->kscan_base));
clk_disable_unprepare(kscandat->clk); clk_disable_unprepare(kscandat->clk);
error = request_irq(irq, lpc32xx_kscan_irq, 0, pdev->name, kscandat); error = devm_request_irq(&pdev->dev, irq, lpc32xx_kscan_irq, 0,
pdev->name, kscandat);
if (error) { if (error) {
dev_err(&pdev->dev, "failed to request irq\n"); dev_err(&pdev->dev, "failed to request irq\n");
goto err_clk_put; return error;
} }
error = input_register_device(kscandat->input); error = input_register_device(kscandat->input);
if (error) { if (error) {
dev_err(&pdev->dev, "failed to register input device\n"); dev_err(&pdev->dev, "failed to register input device\n");
goto err_free_irq; return error;
} }
platform_set_drvdata(pdev, kscandat); platform_set_drvdata(pdev, kscandat);
return 0;
err_free_irq:
free_irq(irq, kscandat);
err_clk_put:
clk_put(kscandat->clk);
err_unmap:
iounmap(kscandat->kscan_base);
err_release_memregion:
release_mem_region(kscandat->iores->start,
resource_size(kscandat->iores));
err_free_input:
input_free_device(kscandat->input);
err_free_keymap:
kfree(kscandat->keymap);
err_free_mem:
kfree(kscandat);
return error;
}
static int lpc32xx_kscan_remove(struct platform_device *pdev)
{
struct lpc32xx_kscan_drv *kscandat = platform_get_drvdata(pdev);
free_irq(platform_get_irq(pdev, 0), kscandat);
clk_put(kscandat->clk);
iounmap(kscandat->kscan_base);
release_mem_region(kscandat->iores->start,
resource_size(kscandat->iores));
input_unregister_device(kscandat->input);
kfree(kscandat->keymap);
kfree(kscandat);
return 0; return 0;
} }
...@@ -378,7 +327,6 @@ MODULE_DEVICE_TABLE(of, lpc32xx_kscan_match); ...@@ -378,7 +327,6 @@ MODULE_DEVICE_TABLE(of, lpc32xx_kscan_match);
static struct platform_driver lpc32xx_kscan_driver = { static struct platform_driver lpc32xx_kscan_driver = {
.probe = lpc32xx_kscan_probe, .probe = lpc32xx_kscan_probe,
.remove = lpc32xx_kscan_remove,
.driver = { .driver = {
.name = DRV_NAME, .name = DRV_NAME,
.owner = THIS_MODULE, .owner = THIS_MODULE,
......
...@@ -214,13 +214,14 @@ static int mpr_touchkey_probe(struct i2c_client *client, ...@@ -214,13 +214,14 @@ static int mpr_touchkey_probe(struct i2c_client *client,
return -EINVAL; return -EINVAL;
} }
mpr121 = kzalloc(sizeof(struct mpr121_touchkey), GFP_KERNEL); mpr121 = devm_kzalloc(&client->dev, sizeof(*mpr121),
input_dev = input_allocate_device(); GFP_KERNEL);
if (!mpr121 || !input_dev) { if (!mpr121)
dev_err(&client->dev, "Failed to allocate memory\n"); return -ENOMEM;
error = -ENOMEM;
goto err_free_mem; input_dev = devm_input_allocate_device(&client->dev);
} if (!input_dev)
return -ENOMEM;
mpr121->client = client; mpr121->client = client;
mpr121->input_dev = input_dev; mpr121->input_dev = input_dev;
...@@ -243,43 +244,25 @@ static int mpr_touchkey_probe(struct i2c_client *client, ...@@ -243,43 +244,25 @@ static int mpr_touchkey_probe(struct i2c_client *client,
error = mpr121_phys_init(pdata, mpr121, client); error = mpr121_phys_init(pdata, mpr121, client);
if (error) { if (error) {
dev_err(&client->dev, "Failed to init register\n"); dev_err(&client->dev, "Failed to init register\n");
goto err_free_mem; return error;
} }
error = request_threaded_irq(client->irq, NULL, error = devm_request_threaded_irq(&client->dev, client->irq, NULL,
mpr_touchkey_interrupt, mpr_touchkey_interrupt,
IRQF_TRIGGER_FALLING | IRQF_ONESHOT, IRQF_TRIGGER_FALLING | IRQF_ONESHOT,
client->dev.driver->name, mpr121); client->dev.driver->name, mpr121);
if (error) { if (error) {
dev_err(&client->dev, "Failed to register interrupt\n"); dev_err(&client->dev, "Failed to register interrupt\n");
goto err_free_mem; return error;
} }
error = input_register_device(input_dev); error = input_register_device(input_dev);
if (error) if (error)
goto err_free_irq; return error;
i2c_set_clientdata(client, mpr121); i2c_set_clientdata(client, mpr121);
device_init_wakeup(&client->dev, pdata->wakeup); device_init_wakeup(&client->dev, pdata->wakeup);
return 0;
err_free_irq:
free_irq(client->irq, mpr121);
err_free_mem:
input_free_device(input_dev);
kfree(mpr121);
return error;
}
static int mpr_touchkey_remove(struct i2c_client *client)
{
struct mpr121_touchkey *mpr121 = i2c_get_clientdata(client);
free_irq(client->irq, mpr121);
input_unregister_device(mpr121->input_dev);
kfree(mpr121);
return 0; return 0;
} }
...@@ -327,7 +310,6 @@ static struct i2c_driver mpr_touchkey_driver = { ...@@ -327,7 +310,6 @@ static struct i2c_driver mpr_touchkey_driver = {
}, },
.id_table = mpr121_id, .id_table = mpr121_id,
.probe = mpr_touchkey_probe, .probe = mpr_touchkey_probe,
.remove = mpr_touchkey_remove,
}; };
module_i2c_driver(mpr_touchkey_driver); module_i2c_driver(mpr_touchkey_driver);
......
...@@ -741,37 +741,27 @@ static int pxa27x_keypad_probe(struct platform_device *pdev) ...@@ -741,37 +741,27 @@ static int pxa27x_keypad_probe(struct platform_device *pdev)
return -ENXIO; return -ENXIO;
} }
keypad = kzalloc(sizeof(struct pxa27x_keypad), GFP_KERNEL); keypad = devm_kzalloc(&pdev->dev, sizeof(*keypad),
input_dev = input_allocate_device(); GFP_KERNEL);
if (!keypad || !input_dev) { if (!keypad)
dev_err(&pdev->dev, "failed to allocate memory\n"); return -ENOMEM;
error = -ENOMEM;
goto failed_free; input_dev = devm_input_allocate_device(&pdev->dev);
} if (!input_dev)
return -ENOMEM;
keypad->pdata = pdata; keypad->pdata = pdata;
keypad->input_dev = input_dev; keypad->input_dev = input_dev;
keypad->irq = irq; keypad->irq = irq;
res = request_mem_region(res->start, resource_size(res), pdev->name); keypad->mmio_base = devm_ioremap_resource(&pdev->dev, res);
if (res == NULL) { if (IS_ERR(keypad->mmio_base))
dev_err(&pdev->dev, "failed to request I/O memory\n"); return PTR_ERR(keypad->mmio_base);
error = -EBUSY;
goto failed_free;
}
keypad->mmio_base = ioremap(res->start, resource_size(res));
if (keypad->mmio_base == NULL) {
dev_err(&pdev->dev, "failed to remap I/O memory\n");
error = -ENXIO;
goto failed_free_mem;
}
keypad->clk = clk_get(&pdev->dev, NULL); keypad->clk = devm_clk_get(&pdev->dev, NULL);
if (IS_ERR(keypad->clk)) { if (IS_ERR(keypad->clk)) {
dev_err(&pdev->dev, "failed to get keypad clock\n"); dev_err(&pdev->dev, "failed to get keypad clock\n");
error = PTR_ERR(keypad->clk); return PTR_ERR(keypad->clk);
goto failed_free_io;
} }
input_dev->name = pdev->name; input_dev->name = pdev->name;
...@@ -802,7 +792,7 @@ static int pxa27x_keypad_probe(struct platform_device *pdev) ...@@ -802,7 +792,7 @@ static int pxa27x_keypad_probe(struct platform_device *pdev)
} }
if (error) { if (error) {
dev_err(&pdev->dev, "failed to build keycode\n"); dev_err(&pdev->dev, "failed to build keycode\n");
goto failed_put_clk; return error;
} }
keypad->row_shift = get_count_order(pdata->matrix_key_cols); keypad->row_shift = get_count_order(pdata->matrix_key_cols);
...@@ -812,61 +802,26 @@ static int pxa27x_keypad_probe(struct platform_device *pdev) ...@@ -812,61 +802,26 @@ static int pxa27x_keypad_probe(struct platform_device *pdev)
input_dev->evbit[0] |= BIT_MASK(EV_REL); input_dev->evbit[0] |= BIT_MASK(EV_REL);
} }
error = request_irq(irq, pxa27x_keypad_irq_handler, 0, error = devm_request_irq(&pdev->dev, irq, pxa27x_keypad_irq_handler,
pdev->name, keypad); 0, pdev->name, keypad);
if (error) { if (error) {
dev_err(&pdev->dev, "failed to request IRQ\n"); dev_err(&pdev->dev, "failed to request IRQ\n");
goto failed_put_clk; return error;
} }
/* Register the input device */ /* Register the input device */
error = input_register_device(input_dev); error = input_register_device(input_dev);
if (error) { if (error) {
dev_err(&pdev->dev, "failed to register input device\n"); dev_err(&pdev->dev, "failed to register input device\n");
goto failed_free_irq; return error;
} }
platform_set_drvdata(pdev, keypad); platform_set_drvdata(pdev, keypad);
device_init_wakeup(&pdev->dev, 1); device_init_wakeup(&pdev->dev, 1);
return 0;
failed_free_irq:
free_irq(irq, keypad);
failed_put_clk:
clk_put(keypad->clk);
failed_free_io:
iounmap(keypad->mmio_base);
failed_free_mem:
release_mem_region(res->start, resource_size(res));
failed_free:
input_free_device(input_dev);
kfree(keypad);
return error;
}
static int pxa27x_keypad_remove(struct platform_device *pdev)
{
struct pxa27x_keypad *keypad = platform_get_drvdata(pdev);
struct resource *res;
free_irq(keypad->irq, keypad);
clk_put(keypad->clk);
input_unregister_device(keypad->input_dev);
iounmap(keypad->mmio_base);
res = platform_get_resource(pdev, IORESOURCE_MEM, 0);
release_mem_region(res->start, resource_size(res));
kfree(keypad);
return 0; return 0;
} }
/* work with hotplug and coldplug */
MODULE_ALIAS("platform:pxa27x-keypad");
#ifdef CONFIG_OF #ifdef CONFIG_OF
static const struct of_device_id pxa27x_keypad_dt_match[] = { static const struct of_device_id pxa27x_keypad_dt_match[] = {
{ .compatible = "marvell,pxa27x-keypad" }, { .compatible = "marvell,pxa27x-keypad" },
...@@ -877,7 +832,6 @@ MODULE_DEVICE_TABLE(of, pxa27x_keypad_dt_match); ...@@ -877,7 +832,6 @@ MODULE_DEVICE_TABLE(of, pxa27x_keypad_dt_match);
static struct platform_driver pxa27x_keypad_driver = { static struct platform_driver pxa27x_keypad_driver = {
.probe = pxa27x_keypad_probe, .probe = pxa27x_keypad_probe,
.remove = pxa27x_keypad_remove,
.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),
...@@ -889,3 +843,5 @@ module_platform_driver(pxa27x_keypad_driver); ...@@ -889,3 +843,5 @@ module_platform_driver(pxa27x_keypad_driver);
MODULE_DESCRIPTION("PXA27x Keypad Controller Driver"); MODULE_DESCRIPTION("PXA27x Keypad Controller Driver");
MODULE_LICENSE("GPL"); MODULE_LICENSE("GPL");
/* work with hotplug and coldplug */
MODULE_ALIAS("platform:pxa27x-keypad");
...@@ -112,8 +112,7 @@ static int pm860x_onkey_probe(struct platform_device *pdev) ...@@ -112,8 +112,7 @@ static int pm860x_onkey_probe(struct platform_device *pdev)
return 0; return 0;
} }
#ifdef CONFIG_PM_SLEEP 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 platform_device *pdev = to_platform_device(dev);
struct pm860x_chip *chip = dev_get_drvdata(pdev->dev.parent); struct pm860x_chip *chip = dev_get_drvdata(pdev->dev.parent);
...@@ -122,7 +121,7 @@ static int pm860x_onkey_suspend(struct device *dev) ...@@ -122,7 +121,7 @@ static int pm860x_onkey_suspend(struct device *dev)
chip->wakeup_flag |= 1 << PM8607_IRQ_ONKEY; chip->wakeup_flag |= 1 << PM8607_IRQ_ONKEY;
return 0; return 0;
} }
static int pm860x_onkey_resume(struct device *dev) static int __maybe_unused pm860x_onkey_resume(struct device *dev)
{ {
struct platform_device *pdev = to_platform_device(dev); struct platform_device *pdev = to_platform_device(dev);
struct pm860x_chip *chip = dev_get_drvdata(pdev->dev.parent); struct pm860x_chip *chip = dev_get_drvdata(pdev->dev.parent);
...@@ -131,7 +130,6 @@ static int pm860x_onkey_resume(struct device *dev) ...@@ -131,7 +130,6 @@ static int pm860x_onkey_resume(struct device *dev)
chip->wakeup_flag &= ~(1 << PM8607_IRQ_ONKEY); chip->wakeup_flag &= ~(1 << PM8607_IRQ_ONKEY);
return 0; return 0;
} }
#endif
static SIMPLE_DEV_PM_OPS(pm860x_onkey_pm_ops, pm860x_onkey_suspend, pm860x_onkey_resume); static SIMPLE_DEV_PM_OPS(pm860x_onkey_pm_ops, pm860x_onkey_suspend, pm860x_onkey_resume);
......
...@@ -13,17 +13,15 @@ ...@@ -13,17 +13,15 @@
#include <linux/pm.h> #include <linux/pm.h>
#include "ad714x.h" #include "ad714x.h"
#ifdef CONFIG_PM_SLEEP static int __maybe_unused ad714x_i2c_suspend(struct device *dev)
static int ad714x_i2c_suspend(struct device *dev)
{ {
return ad714x_disable(i2c_get_clientdata(to_i2c_client(dev))); return ad714x_disable(i2c_get_clientdata(to_i2c_client(dev)));
} }
static int ad714x_i2c_resume(struct device *dev) static int __maybe_unused ad714x_i2c_resume(struct device *dev)
{ {
return ad714x_enable(i2c_get_clientdata(to_i2c_client(dev))); return ad714x_enable(i2c_get_clientdata(to_i2c_client(dev)));
} }
#endif
static SIMPLE_DEV_PM_OPS(ad714x_i2c_pm, ad714x_i2c_suspend, ad714x_i2c_resume); static SIMPLE_DEV_PM_OPS(ad714x_i2c_pm, ad714x_i2c_suspend, ad714x_i2c_resume);
......
...@@ -16,17 +16,15 @@ ...@@ -16,17 +16,15 @@
#define AD714x_SPI_CMD_PREFIX 0xE000 /* bits 15:11 */ #define AD714x_SPI_CMD_PREFIX 0xE000 /* bits 15:11 */
#define AD714x_SPI_READ BIT(10) #define AD714x_SPI_READ BIT(10)
#ifdef CONFIG_PM_SLEEP static int __maybe_unused ad714x_spi_suspend(struct device *dev)
static int ad714x_spi_suspend(struct device *dev)
{ {
return ad714x_disable(spi_get_drvdata(to_spi_device(dev))); return ad714x_disable(spi_get_drvdata(to_spi_device(dev)));
} }
static int ad714x_spi_resume(struct device *dev) static int __maybe_unused ad714x_spi_resume(struct device *dev)
{ {
return ad714x_enable(spi_get_drvdata(to_spi_device(dev))); return ad714x_enable(spi_get_drvdata(to_spi_device(dev)));
} }
#endif
static SIMPLE_DEV_PM_OPS(ad714x_spi_pm, ad714x_spi_suspend, ad714x_spi_resume); static SIMPLE_DEV_PM_OPS(ad714x_spi_pm, ad714x_spi_suspend, ad714x_spi_resume);
......
...@@ -105,8 +105,7 @@ static int adxl34x_i2c_remove(struct i2c_client *client) ...@@ -105,8 +105,7 @@ static int adxl34x_i2c_remove(struct i2c_client *client)
return adxl34x_remove(ac); return adxl34x_remove(ac);
} }
#ifdef CONFIG_PM_SLEEP static int __maybe_unused adxl34x_i2c_suspend(struct device *dev)
static int adxl34x_i2c_suspend(struct device *dev)
{ {
struct i2c_client *client = to_i2c_client(dev); struct i2c_client *client = to_i2c_client(dev);
struct adxl34x *ac = i2c_get_clientdata(client); struct adxl34x *ac = i2c_get_clientdata(client);
...@@ -116,7 +115,7 @@ static int adxl34x_i2c_suspend(struct device *dev) ...@@ -116,7 +115,7 @@ static int adxl34x_i2c_suspend(struct device *dev)
return 0; return 0;
} }
static int adxl34x_i2c_resume(struct device *dev) static int __maybe_unused adxl34x_i2c_resume(struct device *dev)
{ {
struct i2c_client *client = to_i2c_client(dev); struct i2c_client *client = to_i2c_client(dev);
struct adxl34x *ac = i2c_get_clientdata(client); struct adxl34x *ac = i2c_get_clientdata(client);
...@@ -125,7 +124,6 @@ static int adxl34x_i2c_resume(struct device *dev) ...@@ -125,7 +124,6 @@ static int adxl34x_i2c_resume(struct device *dev)
return 0; return 0;
} }
#endif
static SIMPLE_DEV_PM_OPS(adxl34x_i2c_pm, adxl34x_i2c_suspend, static SIMPLE_DEV_PM_OPS(adxl34x_i2c_pm, adxl34x_i2c_suspend,
adxl34x_i2c_resume); adxl34x_i2c_resume);
......
...@@ -94,8 +94,7 @@ static int adxl34x_spi_remove(struct spi_device *spi) ...@@ -94,8 +94,7 @@ static int adxl34x_spi_remove(struct spi_device *spi)
return adxl34x_remove(ac); return adxl34x_remove(ac);
} }
#ifdef CONFIG_PM_SLEEP static int __maybe_unused adxl34x_spi_suspend(struct device *dev)
static int adxl34x_spi_suspend(struct device *dev)
{ {
struct spi_device *spi = to_spi_device(dev); struct spi_device *spi = to_spi_device(dev);
struct adxl34x *ac = spi_get_drvdata(spi); struct adxl34x *ac = spi_get_drvdata(spi);
...@@ -105,7 +104,7 @@ static int adxl34x_spi_suspend(struct device *dev) ...@@ -105,7 +104,7 @@ static int adxl34x_spi_suspend(struct device *dev)
return 0; return 0;
} }
static int adxl34x_spi_resume(struct device *dev) static int __maybe_unused adxl34x_spi_resume(struct device *dev)
{ {
struct spi_device *spi = to_spi_device(dev); struct spi_device *spi = to_spi_device(dev);
struct adxl34x *ac = spi_get_drvdata(spi); struct adxl34x *ac = spi_get_drvdata(spi);
...@@ -114,7 +113,6 @@ static int adxl34x_spi_resume(struct device *dev) ...@@ -114,7 +113,6 @@ static int adxl34x_spi_resume(struct device *dev)
return 0; return 0;
} }
#endif
static SIMPLE_DEV_PM_OPS(adxl34x_spi_pm, adxl34x_spi_suspend, static SIMPLE_DEV_PM_OPS(adxl34x_spi_pm, adxl34x_spi_suspend,
adxl34x_spi_resume); adxl34x_spi_resume);
......
...@@ -639,8 +639,7 @@ static int drv260x_probe(struct i2c_client *client, ...@@ -639,8 +639,7 @@ static int drv260x_probe(struct i2c_client *client,
return 0; return 0;
} }
#ifdef CONFIG_PM_SLEEP static int __maybe_unused drv260x_suspend(struct device *dev)
static int drv260x_suspend(struct device *dev)
{ {
struct drv260x_data *haptics = dev_get_drvdata(dev); struct drv260x_data *haptics = dev_get_drvdata(dev);
int ret = 0; int ret = 0;
...@@ -672,7 +671,7 @@ static int drv260x_suspend(struct device *dev) ...@@ -672,7 +671,7 @@ static int drv260x_suspend(struct device *dev)
return ret; return ret;
} }
static int drv260x_resume(struct device *dev) static int __maybe_unused drv260x_resume(struct device *dev)
{ {
struct drv260x_data *haptics = dev_get_drvdata(dev); struct drv260x_data *haptics = dev_get_drvdata(dev);
int ret = 0; int ret = 0;
...@@ -702,7 +701,6 @@ static int drv260x_resume(struct device *dev) ...@@ -702,7 +701,6 @@ static int drv260x_resume(struct device *dev)
mutex_unlock(&haptics->input_dev->mutex); mutex_unlock(&haptics->input_dev->mutex);
return ret; return ret;
} }
#endif
static SIMPLE_DEV_PM_OPS(drv260x_pm_ops, drv260x_suspend, drv260x_resume); static SIMPLE_DEV_PM_OPS(drv260x_pm_ops, drv260x_suspend, drv260x_resume);
......
...@@ -406,8 +406,7 @@ static int drv2667_probe(struct i2c_client *client, ...@@ -406,8 +406,7 @@ static int drv2667_probe(struct i2c_client *client,
return 0; return 0;
} }
#ifdef CONFIG_PM_SLEEP static int __maybe_unused drv2667_suspend(struct device *dev)
static int drv2667_suspend(struct device *dev)
{ {
struct drv2667_data *haptics = dev_get_drvdata(dev); struct drv2667_data *haptics = dev_get_drvdata(dev);
int ret = 0; int ret = 0;
...@@ -436,7 +435,7 @@ static int drv2667_suspend(struct device *dev) ...@@ -436,7 +435,7 @@ static int drv2667_suspend(struct device *dev)
return ret; return ret;
} }
static int drv2667_resume(struct device *dev) static int __maybe_unused drv2667_resume(struct device *dev)
{ {
struct drv2667_data *haptics = dev_get_drvdata(dev); struct drv2667_data *haptics = dev_get_drvdata(dev);
int ret = 0; int ret = 0;
...@@ -464,7 +463,6 @@ static int drv2667_resume(struct device *dev) ...@@ -464,7 +463,6 @@ static int drv2667_resume(struct device *dev)
mutex_unlock(&haptics->input_dev->mutex); mutex_unlock(&haptics->input_dev->mutex);
return ret; return ret;
} }
#endif
static SIMPLE_DEV_PM_OPS(drv2667_pm_ops, drv2667_suspend, drv2667_resume); static SIMPLE_DEV_PM_OPS(drv2667_pm_ops, drv2667_suspend, drv2667_resume);
......
...@@ -225,8 +225,7 @@ static int gp2a_remove(struct i2c_client *client) ...@@ -225,8 +225,7 @@ static int gp2a_remove(struct i2c_client *client)
return 0; return 0;
} }
#ifdef CONFIG_PM_SLEEP static int __maybe_unused gp2a_suspend(struct device *dev)
static int gp2a_suspend(struct device *dev)
{ {
struct i2c_client *client = to_i2c_client(dev); struct i2c_client *client = to_i2c_client(dev);
struct gp2a_data *dt = i2c_get_clientdata(client); struct gp2a_data *dt = i2c_get_clientdata(client);
...@@ -244,7 +243,7 @@ static int gp2a_suspend(struct device *dev) ...@@ -244,7 +243,7 @@ static int gp2a_suspend(struct device *dev)
return retval; return retval;
} }
static int gp2a_resume(struct device *dev) static int __maybe_unused gp2a_resume(struct device *dev)
{ {
struct i2c_client *client = to_i2c_client(dev); struct i2c_client *client = to_i2c_client(dev);
struct gp2a_data *dt = i2c_get_clientdata(client); struct gp2a_data *dt = i2c_get_clientdata(client);
...@@ -261,7 +260,6 @@ static int gp2a_resume(struct device *dev) ...@@ -261,7 +260,6 @@ static int gp2a_resume(struct device *dev)
return retval; return retval;
} }
#endif
static SIMPLE_DEV_PM_OPS(gp2a_pm, gp2a_suspend, gp2a_resume); static SIMPLE_DEV_PM_OPS(gp2a_pm, gp2a_suspend, gp2a_resume);
......
...@@ -1851,7 +1851,7 @@ static int ims_pcu_identify_type(struct ims_pcu *pcu, u8 *device_id) ...@@ -1851,7 +1851,7 @@ static int ims_pcu_identify_type(struct ims_pcu *pcu, u8 *device_id)
static int ims_pcu_init_application_mode(struct ims_pcu *pcu) static int ims_pcu_init_application_mode(struct ims_pcu *pcu)
{ {
static atomic_t device_no = ATOMIC_INIT(0); static atomic_t device_no = ATOMIC_INIT(-1);
const struct ims_pcu_device_info *info; const struct ims_pcu_device_info *info;
int error; int error;
...@@ -1882,7 +1882,7 @@ static int ims_pcu_init_application_mode(struct ims_pcu *pcu) ...@@ -1882,7 +1882,7 @@ static int ims_pcu_init_application_mode(struct ims_pcu *pcu)
} }
/* Device appears to be operable, complete initialization */ /* Device appears to be operable, complete initialization */
pcu->device_no = atomic_inc_return(&device_no) - 1; pcu->device_no = atomic_inc_return(&device_no);
/* /*
* PCU-B devices, both GEN_1 and GEN_2 do not have OFN sensor * PCU-B devices, both GEN_1 and GEN_2 do not have OFN sensor
......
...@@ -615,8 +615,7 @@ static int kxtj9_remove(struct i2c_client *client) ...@@ -615,8 +615,7 @@ static int kxtj9_remove(struct i2c_client *client)
return 0; return 0;
} }
#ifdef CONFIG_PM_SLEEP static int __maybe_unused kxtj9_suspend(struct device *dev)
static int kxtj9_suspend(struct device *dev)
{ {
struct i2c_client *client = to_i2c_client(dev); struct i2c_client *client = to_i2c_client(dev);
struct kxtj9_data *tj9 = i2c_get_clientdata(client); struct kxtj9_data *tj9 = i2c_get_clientdata(client);
...@@ -631,7 +630,7 @@ static int kxtj9_suspend(struct device *dev) ...@@ -631,7 +630,7 @@ static int kxtj9_suspend(struct device *dev)
return 0; return 0;
} }
static int kxtj9_resume(struct device *dev) static int __maybe_unused kxtj9_resume(struct device *dev)
{ {
struct i2c_client *client = to_i2c_client(dev); struct i2c_client *client = to_i2c_client(dev);
struct kxtj9_data *tj9 = i2c_get_clientdata(client); struct kxtj9_data *tj9 = i2c_get_clientdata(client);
...@@ -646,7 +645,6 @@ static int kxtj9_resume(struct device *dev) ...@@ -646,7 +645,6 @@ static int kxtj9_resume(struct device *dev)
mutex_unlock(&input_dev->mutex); mutex_unlock(&input_dev->mutex);
return retval; return retval;
} }
#endif
static SIMPLE_DEV_PM_OPS(kxtj9_pm_ops, kxtj9_suspend, kxtj9_resume); static SIMPLE_DEV_PM_OPS(kxtj9_pm_ops, kxtj9_suspend, kxtj9_resume);
......
...@@ -309,8 +309,7 @@ static int max77693_haptic_probe(struct platform_device *pdev) ...@@ -309,8 +309,7 @@ static int max77693_haptic_probe(struct platform_device *pdev)
return 0; return 0;
} }
#ifdef CONFIG_PM_SLEEP static int __maybe_unused max77693_haptic_suspend(struct device *dev)
static int max77693_haptic_suspend(struct device *dev)
{ {
struct platform_device *pdev = to_platform_device(dev); struct platform_device *pdev = to_platform_device(dev);
struct max77693_haptic *haptic = platform_get_drvdata(pdev); struct max77693_haptic *haptic = platform_get_drvdata(pdev);
...@@ -323,7 +322,7 @@ static int max77693_haptic_suspend(struct device *dev) ...@@ -323,7 +322,7 @@ static int max77693_haptic_suspend(struct device *dev)
return 0; return 0;
} }
static int max77693_haptic_resume(struct device *dev) static int __maybe_unused max77693_haptic_resume(struct device *dev)
{ {
struct platform_device *pdev = to_platform_device(dev); struct platform_device *pdev = to_platform_device(dev);
struct max77693_haptic *haptic = platform_get_drvdata(pdev); struct max77693_haptic *haptic = platform_get_drvdata(pdev);
...@@ -335,7 +334,6 @@ static int max77693_haptic_resume(struct device *dev) ...@@ -335,7 +334,6 @@ static int max77693_haptic_resume(struct device *dev)
return 0; return 0;
} }
#endif
static SIMPLE_DEV_PM_OPS(max77693_haptic_pm_ops, static SIMPLE_DEV_PM_OPS(max77693_haptic_pm_ops,
max77693_haptic_suspend, max77693_haptic_resume); max77693_haptic_suspend, max77693_haptic_resume);
......
...@@ -133,8 +133,7 @@ static int max8925_onkey_probe(struct platform_device *pdev) ...@@ -133,8 +133,7 @@ static int max8925_onkey_probe(struct platform_device *pdev)
return 0; return 0;
} }
#ifdef CONFIG_PM_SLEEP static int __maybe_unused max8925_onkey_suspend(struct device *dev)
static int max8925_onkey_suspend(struct device *dev)
{ {
struct platform_device *pdev = to_platform_device(dev); struct platform_device *pdev = to_platform_device(dev);
struct max8925_onkey_info *info = platform_get_drvdata(pdev); struct max8925_onkey_info *info = platform_get_drvdata(pdev);
...@@ -148,7 +147,7 @@ static int max8925_onkey_suspend(struct device *dev) ...@@ -148,7 +147,7 @@ static int max8925_onkey_suspend(struct device *dev)
return 0; return 0;
} }
static int max8925_onkey_resume(struct device *dev) static int __maybe_unused max8925_onkey_resume(struct device *dev)
{ {
struct platform_device *pdev = to_platform_device(dev); struct platform_device *pdev = to_platform_device(dev);
struct max8925_onkey_info *info = platform_get_drvdata(pdev); struct max8925_onkey_info *info = platform_get_drvdata(pdev);
...@@ -161,7 +160,6 @@ static int max8925_onkey_resume(struct device *dev) ...@@ -161,7 +160,6 @@ static int max8925_onkey_resume(struct device *dev)
return 0; return 0;
} }
#endif
static SIMPLE_DEV_PM_OPS(max8925_onkey_pm_ops, max8925_onkey_suspend, max8925_onkey_resume); static SIMPLE_DEV_PM_OPS(max8925_onkey_pm_ops, max8925_onkey_suspend, max8925_onkey_resume);
......
...@@ -378,8 +378,7 @@ static int max8997_haptic_remove(struct platform_device *pdev) ...@@ -378,8 +378,7 @@ static int max8997_haptic_remove(struct platform_device *pdev)
return 0; return 0;
} }
#ifdef CONFIG_PM_SLEEP static int __maybe_unused max8997_haptic_suspend(struct device *dev)
static int max8997_haptic_suspend(struct device *dev)
{ {
struct platform_device *pdev = to_platform_device(dev); struct platform_device *pdev = to_platform_device(dev);
struct max8997_haptic *chip = platform_get_drvdata(pdev); struct max8997_haptic *chip = platform_get_drvdata(pdev);
...@@ -388,7 +387,6 @@ static int max8997_haptic_suspend(struct device *dev) ...@@ -388,7 +387,6 @@ static int max8997_haptic_suspend(struct device *dev)
return 0; return 0;
} }
#endif
static SIMPLE_DEV_PM_OPS(max8997_haptic_pm_ops, max8997_haptic_suspend, NULL); static SIMPLE_DEV_PM_OPS(max8997_haptic_pm_ops, max8997_haptic_suspend, NULL);
......
...@@ -260,7 +260,6 @@ static int palmas_pwron_remove(struct platform_device *pdev) ...@@ -260,7 +260,6 @@ static int palmas_pwron_remove(struct platform_device *pdev)
return 0; return 0;
} }
#ifdef CONFIG_PM_SLEEP
/** /**
* palmas_pwron_suspend() - suspend handler * palmas_pwron_suspend() - suspend handler
* @dev: power button device * @dev: power button device
...@@ -269,7 +268,7 @@ static int palmas_pwron_remove(struct platform_device *pdev) ...@@ -269,7 +268,7 @@ static int palmas_pwron_remove(struct platform_device *pdev)
* *
* Return: 0 * Return: 0
*/ */
static int palmas_pwron_suspend(struct device *dev) static int __maybe_unused palmas_pwron_suspend(struct device *dev)
{ {
struct platform_device *pdev = to_platform_device(dev); struct platform_device *pdev = to_platform_device(dev);
struct palmas_pwron *pwron = platform_get_drvdata(pdev); struct palmas_pwron *pwron = platform_get_drvdata(pdev);
...@@ -290,7 +289,7 @@ static int palmas_pwron_suspend(struct device *dev) ...@@ -290,7 +289,7 @@ static int palmas_pwron_suspend(struct device *dev)
* *
* Return: 0 * Return: 0
*/ */
static int palmas_pwron_resume(struct device *dev) static int __maybe_unused palmas_pwron_resume(struct device *dev)
{ {
struct platform_device *pdev = to_platform_device(dev); struct platform_device *pdev = to_platform_device(dev);
struct palmas_pwron *pwron = platform_get_drvdata(pdev); struct palmas_pwron *pwron = platform_get_drvdata(pdev);
...@@ -300,7 +299,6 @@ static int palmas_pwron_resume(struct device *dev) ...@@ -300,7 +299,6 @@ static int palmas_pwron_resume(struct device *dev)
return 0; return 0;
} }
#endif
static SIMPLE_DEV_PM_OPS(palmas_pwron_pm, static SIMPLE_DEV_PM_OPS(palmas_pwron_pm,
palmas_pwron_suspend, palmas_pwron_resume); palmas_pwron_suspend, palmas_pwron_resume);
......
...@@ -199,8 +199,7 @@ static int pm8xxx_vib_probe(struct platform_device *pdev) ...@@ -199,8 +199,7 @@ static int pm8xxx_vib_probe(struct platform_device *pdev)
return 0; return 0;
} }
#ifdef CONFIG_PM_SLEEP static int __maybe_unused pm8xxx_vib_suspend(struct device *dev)
static int pm8xxx_vib_suspend(struct device *dev)
{ {
struct pm8xxx_vib *vib = dev_get_drvdata(dev); struct pm8xxx_vib *vib = dev_get_drvdata(dev);
...@@ -209,7 +208,6 @@ static int pm8xxx_vib_suspend(struct device *dev) ...@@ -209,7 +208,6 @@ static int pm8xxx_vib_suspend(struct device *dev)
return 0; return 0;
} }
#endif
static SIMPLE_DEV_PM_OPS(pm8xxx_vib_pm_ops, pm8xxx_vib_suspend, NULL); static SIMPLE_DEV_PM_OPS(pm8xxx_vib_pm_ops, pm8xxx_vib_suspend, NULL);
......
...@@ -53,8 +53,7 @@ static irqreturn_t pwrkey_release_irq(int irq, void *_pwr) ...@@ -53,8 +53,7 @@ static irqreturn_t pwrkey_release_irq(int irq, void *_pwr)
return IRQ_HANDLED; return IRQ_HANDLED;
} }
#ifdef CONFIG_PM_SLEEP static int __maybe_unused pmic8xxx_pwrkey_suspend(struct device *dev)
static int pmic8xxx_pwrkey_suspend(struct device *dev)
{ {
struct pmic8xxx_pwrkey *pwrkey = dev_get_drvdata(dev); struct pmic8xxx_pwrkey *pwrkey = dev_get_drvdata(dev);
...@@ -64,7 +63,7 @@ static int pmic8xxx_pwrkey_suspend(struct device *dev) ...@@ -64,7 +63,7 @@ static int pmic8xxx_pwrkey_suspend(struct device *dev)
return 0; return 0;
} }
static int pmic8xxx_pwrkey_resume(struct device *dev) static int __maybe_unused pmic8xxx_pwrkey_resume(struct device *dev)
{ {
struct pmic8xxx_pwrkey *pwrkey = dev_get_drvdata(dev); struct pmic8xxx_pwrkey *pwrkey = dev_get_drvdata(dev);
...@@ -73,7 +72,6 @@ static int pmic8xxx_pwrkey_resume(struct device *dev) ...@@ -73,7 +72,6 @@ static int pmic8xxx_pwrkey_resume(struct device *dev)
return 0; return 0;
} }
#endif
static SIMPLE_DEV_PM_OPS(pm8xxx_pwr_key_pm_ops, static SIMPLE_DEV_PM_OPS(pm8xxx_pwr_key_pm_ops,
pmic8xxx_pwrkey_suspend, pmic8xxx_pwrkey_resume); pmic8xxx_pwrkey_suspend, pmic8xxx_pwrkey_resume);
......
...@@ -144,8 +144,7 @@ static int pwm_beeper_remove(struct platform_device *pdev) ...@@ -144,8 +144,7 @@ static int pwm_beeper_remove(struct platform_device *pdev)
return 0; return 0;
} }
#ifdef CONFIG_PM_SLEEP static int __maybe_unused pwm_beeper_suspend(struct device *dev)
static int pwm_beeper_suspend(struct device *dev)
{ {
struct pwm_beeper *beeper = dev_get_drvdata(dev); struct pwm_beeper *beeper = dev_get_drvdata(dev);
...@@ -155,7 +154,7 @@ static int pwm_beeper_suspend(struct device *dev) ...@@ -155,7 +154,7 @@ static int pwm_beeper_suspend(struct device *dev)
return 0; return 0;
} }
static int pwm_beeper_resume(struct device *dev) static int __maybe_unused pwm_beeper_resume(struct device *dev)
{ {
struct pwm_beeper *beeper = dev_get_drvdata(dev); struct pwm_beeper *beeper = dev_get_drvdata(dev);
...@@ -170,6 +169,7 @@ static int pwm_beeper_resume(struct device *dev) ...@@ -170,6 +169,7 @@ static int pwm_beeper_resume(struct device *dev)
static SIMPLE_DEV_PM_OPS(pwm_beeper_pm_ops, static SIMPLE_DEV_PM_OPS(pwm_beeper_pm_ops,
pwm_beeper_suspend, pwm_beeper_resume); pwm_beeper_suspend, pwm_beeper_resume);
#ifdef CONFIG_PM_SLEEP
#define PWM_BEEPER_PM_OPS (&pwm_beeper_pm_ops) #define PWM_BEEPER_PM_OPS (&pwm_beeper_pm_ops)
#else #else
#define PWM_BEEPER_PM_OPS NULL #define PWM_BEEPER_PM_OPS NULL
......
...@@ -179,8 +179,7 @@ static int sirfsoc_pwrc_remove(struct platform_device *pdev) ...@@ -179,8 +179,7 @@ static int sirfsoc_pwrc_remove(struct platform_device *pdev)
return 0; return 0;
} }
#ifdef CONFIG_PM_SLEEP static int __maybe_unused sirfsoc_pwrc_resume(struct device *dev)
static int sirfsoc_pwrc_resume(struct device *dev)
{ {
struct sirfsoc_pwrc_drvdata *pwrcdrv = dev_get_drvdata(dev); struct sirfsoc_pwrc_drvdata *pwrcdrv = dev_get_drvdata(dev);
struct input_dev *input = pwrcdrv->input; struct input_dev *input = pwrcdrv->input;
...@@ -196,7 +195,6 @@ static int sirfsoc_pwrc_resume(struct device *dev) ...@@ -196,7 +195,6 @@ static int sirfsoc_pwrc_resume(struct device *dev)
return 0; return 0;
} }
#endif
static SIMPLE_DEV_PM_OPS(sirfsoc_pwrc_pm_ops, NULL, sirfsoc_pwrc_resume); static SIMPLE_DEV_PM_OPS(sirfsoc_pwrc_pm_ops, NULL, sirfsoc_pwrc_resume);
......
...@@ -157,8 +157,7 @@ static void twl4030_vibra_close(struct input_dev *input) ...@@ -157,8 +157,7 @@ static void twl4030_vibra_close(struct input_dev *input)
} }
/*** Module ***/ /*** Module ***/
#ifdef CONFIG_PM_SLEEP static int __maybe_unused twl4030_vibra_suspend(struct device *dev)
static int twl4030_vibra_suspend(struct device *dev)
{ {
struct platform_device *pdev = to_platform_device(dev); struct platform_device *pdev = to_platform_device(dev);
struct vibra_info *info = platform_get_drvdata(pdev); struct vibra_info *info = platform_get_drvdata(pdev);
...@@ -169,12 +168,11 @@ static int twl4030_vibra_suspend(struct device *dev) ...@@ -169,12 +168,11 @@ static int twl4030_vibra_suspend(struct device *dev)
return 0; return 0;
} }
static int twl4030_vibra_resume(struct device *dev) static int __maybe_unused twl4030_vibra_resume(struct device *dev)
{ {
vibra_disable_leds(); vibra_disable_leds();
return 0; return 0;
} }
#endif
static SIMPLE_DEV_PM_OPS(twl4030_vibra_pm_ops, static SIMPLE_DEV_PM_OPS(twl4030_vibra_pm_ops,
twl4030_vibra_suspend, twl4030_vibra_resume); twl4030_vibra_suspend, twl4030_vibra_resume);
......
...@@ -236,8 +236,7 @@ static void twl6040_vibra_close(struct input_dev *input) ...@@ -236,8 +236,7 @@ static void twl6040_vibra_close(struct input_dev *input)
mutex_unlock(&info->mutex); mutex_unlock(&info->mutex);
} }
#ifdef CONFIG_PM_SLEEP static int __maybe_unused twl6040_vibra_suspend(struct device *dev)
static int twl6040_vibra_suspend(struct device *dev)
{ {
struct platform_device *pdev = to_platform_device(dev); struct platform_device *pdev = to_platform_device(dev);
struct vibra_info *info = platform_get_drvdata(pdev); struct vibra_info *info = platform_get_drvdata(pdev);
...@@ -251,7 +250,6 @@ static int twl6040_vibra_suspend(struct device *dev) ...@@ -251,7 +250,6 @@ static int twl6040_vibra_suspend(struct device *dev)
return 0; return 0;
} }
#endif
static SIMPLE_DEV_PM_OPS(twl6040_vibra_pm_ops, twl6040_vibra_suspend, NULL); static SIMPLE_DEV_PM_OPS(twl6040_vibra_pm_ops, twl6040_vibra_suspend, NULL);
......
...@@ -215,6 +215,36 @@ config MOUSE_CYAPA ...@@ -215,6 +215,36 @@ config MOUSE_CYAPA
To compile this driver as a module, choose M here: the module will be To compile this driver as a module, choose M here: the module will be
called cyapa. called cyapa.
config MOUSE_ELAN_I2C
tristate "ELAN I2C Touchpad support"
depends on I2C
help
This driver adds support for Elan I2C/SMbus Trackpads.
Say Y here if you have a ELAN I2C/SMbus Touchpad.
To compile this driver as a module, choose M here: the module will be
called elan_i2c.
config MOUSE_ELAN_I2C_I2C
bool "Enable I2C support"
depends on MOUSE_ELAN_I2C
default y
help
Say Y here if Elan Touchpad in your system is connected to
a standard I2C controller.
If unsure, say Y.
config MOUSE_ELAN_I2C_SMBUS
bool "Enable SMbus support"
depends on MOUSE_ELAN_I2C
help
Say Y here if Elan Touchpad in your system is connected to
a SMbus adapter.
If unsure, say Y.
config MOUSE_INPORT config MOUSE_INPORT
tristate "InPort/MS/ATIXL busmouse" tristate "InPort/MS/ATIXL busmouse"
depends on ISA depends on ISA
......
...@@ -9,6 +9,7 @@ obj-$(CONFIG_MOUSE_APPLETOUCH) += appletouch.o ...@@ -9,6 +9,7 @@ obj-$(CONFIG_MOUSE_APPLETOUCH) += appletouch.o
obj-$(CONFIG_MOUSE_ATARI) += atarimouse.o obj-$(CONFIG_MOUSE_ATARI) += atarimouse.o
obj-$(CONFIG_MOUSE_BCM5974) += bcm5974.o obj-$(CONFIG_MOUSE_BCM5974) += bcm5974.o
obj-$(CONFIG_MOUSE_CYAPA) += cyapa.o obj-$(CONFIG_MOUSE_CYAPA) += cyapa.o
obj-$(CONFIG_MOUSE_ELAN_I2C) += elan_i2c.o
obj-$(CONFIG_MOUSE_GPIO) += gpio_mouse.o obj-$(CONFIG_MOUSE_GPIO) += gpio_mouse.o
obj-$(CONFIG_MOUSE_INPORT) += inport.o obj-$(CONFIG_MOUSE_INPORT) += inport.o
obj-$(CONFIG_MOUSE_LOGIBM) += logibm.o obj-$(CONFIG_MOUSE_LOGIBM) += logibm.o
...@@ -34,3 +35,7 @@ psmouse-$(CONFIG_MOUSE_PS2_SENTELIC) += sentelic.o ...@@ -34,3 +35,7 @@ psmouse-$(CONFIG_MOUSE_PS2_SENTELIC) += sentelic.o
psmouse-$(CONFIG_MOUSE_PS2_TRACKPOINT) += trackpoint.o psmouse-$(CONFIG_MOUSE_PS2_TRACKPOINT) += trackpoint.o
psmouse-$(CONFIG_MOUSE_PS2_TOUCHKIT) += touchkit_ps2.o psmouse-$(CONFIG_MOUSE_PS2_TOUCHKIT) += touchkit_ps2.o
psmouse-$(CONFIG_MOUSE_PS2_CYPRESS) += cypress_ps2.o psmouse-$(CONFIG_MOUSE_PS2_CYPRESS) += cypress_ps2.o
elan_i2c-objs := elan_i2c_core.o
elan_i2c-$(CONFIG_MOUSE_ELAN_I2C_I2C) += elan_i2c_i2c.o
elan_i2c-$(CONFIG_MOUSE_ELAN_I2C_SMBUS) += elan_i2c_smbus.o
This diff is collapsed.
/*
* Elan I2C/SMBus Touchpad driver
*
* Copyright (c) 2013 ELAN Microelectronics Corp.
*
* Author: 林政維 (Duson Lin) <dusonlin@emc.com.tw>
* Version: 1.5.5
*
* Based on cyapa driver:
* copyright (c) 2011-2012 Cypress Semiconductor, Inc.
* copyright (c) 2011-2012 Google, Inc.
*
* This program is free software; you can redistribute it and/or modify it
* under the terms of the GNU General Public License version 2 as published
* by the Free Software Foundation.
*
* Trademarks are the property of their respective owners.
*/
#ifndef _ELAN_I2C_H
#define _ELAN_i2C_H
#include <linux/types.h>
#define ETP_ENABLE_ABS 0x0001
#define ETP_ENABLE_CALIBRATE 0x0002
#define ETP_DISABLE_CALIBRATE 0x0000
#define ETP_DISABLE_POWER 0x0001
/* IAP Firmware handling */
#define ETP_FW_NAME "elan_i2c.bin"
#define ETP_IAP_START_ADDR 0x0083
#define ETP_FW_IAP_PAGE_ERR (1 << 5)
#define ETP_FW_IAP_INTF_ERR (1 << 4)
#define ETP_FW_PAGE_SIZE 64
#define ETP_FW_PAGE_COUNT 768
#define ETP_FW_SIZE (ETP_FW_PAGE_SIZE * ETP_FW_PAGE_COUNT)
struct i2c_client;
struct completion;
enum tp_mode {
IAP_MODE = 1,
MAIN_MODE
};
struct elan_transport_ops {
int (*initialize)(struct i2c_client *client);
int (*sleep_control)(struct i2c_client *, bool sleep);
int (*power_control)(struct i2c_client *, bool enable);
int (*set_mode)(struct i2c_client *client, u8 mode);
int (*calibrate)(struct i2c_client *client);
int (*calibrate_result)(struct i2c_client *client, u8 *val);
int (*get_baseline_data)(struct i2c_client *client,
bool max_baseliune, u8 *value);
int (*get_version)(struct i2c_client *client, bool iap, u8 *version);
int (*get_sm_version)(struct i2c_client *client, u8 *version);
int (*get_checksum)(struct i2c_client *client, bool iap, u16 *csum);
int (*get_product_id)(struct i2c_client *client, u8 *id);
int (*get_max)(struct i2c_client *client,
unsigned int *max_x, unsigned int *max_y);
int (*get_resolution)(struct i2c_client *client,
u8 *hw_res_x, u8 *hw_res_y);
int (*get_num_traces)(struct i2c_client *client,
unsigned int *x_tracenum,
unsigned int *y_tracenum);
int (*iap_get_mode)(struct i2c_client *client, enum tp_mode *mode);
int (*iap_reset)(struct i2c_client *client);
int (*prepare_fw_update)(struct i2c_client *client);
int (*write_fw_block)(struct i2c_client *client,
const u8 *page, u16 checksum, int idx);
int (*finish_fw_update)(struct i2c_client *client,
struct completion *reset_done);
int (*get_report)(struct i2c_client *client, u8 *report);
};
extern const struct elan_transport_ops elan_smbus_ops, elan_i2c_ops;
#endif /* _ELAN_I2C_H */
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
...@@ -16,14 +16,14 @@ void lifebook_module_init(void); ...@@ -16,14 +16,14 @@ void lifebook_module_init(void);
int lifebook_detect(struct psmouse *psmouse, bool set_properties); int lifebook_detect(struct psmouse *psmouse, bool set_properties);
int lifebook_init(struct psmouse *psmouse); int lifebook_init(struct psmouse *psmouse);
#else #else
inline void lifebook_module_init(void) static inline void lifebook_module_init(void)
{ {
} }
inline int lifebook_detect(struct psmouse *psmouse, bool set_properties) static inline int lifebook_detect(struct psmouse *psmouse, bool set_properties)
{ {
return -ENOSYS; return -ENOSYS;
} }
inline int lifebook_init(struct psmouse *psmouse) static inline int lifebook_init(struct psmouse *psmouse)
{ {
return -ENOSYS; return -ENOSYS;
} }
......
...@@ -318,8 +318,7 @@ static int navpoint_remove(struct platform_device *pdev) ...@@ -318,8 +318,7 @@ static int navpoint_remove(struct platform_device *pdev)
return 0; return 0;
} }
#ifdef CONFIG_PM_SLEEP static int __maybe_unused navpoint_suspend(struct device *dev)
static int navpoint_suspend(struct device *dev)
{ {
struct platform_device *pdev = to_platform_device(dev); struct platform_device *pdev = to_platform_device(dev);
struct navpoint *navpoint = platform_get_drvdata(pdev); struct navpoint *navpoint = platform_get_drvdata(pdev);
...@@ -333,7 +332,7 @@ static int navpoint_suspend(struct device *dev) ...@@ -333,7 +332,7 @@ static int navpoint_suspend(struct device *dev)
return 0; return 0;
} }
static int navpoint_resume(struct device *dev) static int __maybe_unused navpoint_resume(struct device *dev)
{ {
struct platform_device *pdev = to_platform_device(dev); struct platform_device *pdev = to_platform_device(dev);
struct navpoint *navpoint = platform_get_drvdata(pdev); struct navpoint *navpoint = platform_get_drvdata(pdev);
...@@ -346,7 +345,6 @@ static int navpoint_resume(struct device *dev) ...@@ -346,7 +345,6 @@ static int navpoint_resume(struct device *dev)
return 0; return 0;
} }
#endif
static SIMPLE_DEV_PM_OPS(navpoint_pm_ops, navpoint_suspend, navpoint_resume); static SIMPLE_DEV_PM_OPS(navpoint_pm_ops, navpoint_suspend, navpoint_resume);
......
...@@ -614,8 +614,7 @@ static int synaptics_i2c_remove(struct i2c_client *client) ...@@ -614,8 +614,7 @@ static int synaptics_i2c_remove(struct i2c_client *client)
return 0; return 0;
} }
#ifdef CONFIG_PM_SLEEP static int __maybe_unused synaptics_i2c_suspend(struct device *dev)
static int synaptics_i2c_suspend(struct device *dev)
{ {
struct i2c_client *client = to_i2c_client(dev); struct i2c_client *client = to_i2c_client(dev);
struct synaptics_i2c *touch = i2c_get_clientdata(client); struct synaptics_i2c *touch = i2c_get_clientdata(client);
...@@ -628,7 +627,7 @@ static int synaptics_i2c_suspend(struct device *dev) ...@@ -628,7 +627,7 @@ static int synaptics_i2c_suspend(struct device *dev)
return 0; return 0;
} }
static int synaptics_i2c_resume(struct device *dev) static int __maybe_unused synaptics_i2c_resume(struct device *dev)
{ {
int ret; int ret;
struct i2c_client *client = to_i2c_client(dev); struct i2c_client *client = to_i2c_client(dev);
...@@ -643,7 +642,6 @@ static int synaptics_i2c_resume(struct device *dev) ...@@ -643,7 +642,6 @@ static int synaptics_i2c_resume(struct device *dev)
return 0; return 0;
} }
#endif
static SIMPLE_DEV_PM_OPS(synaptics_i2c_pm, synaptics_i2c_suspend, static SIMPLE_DEV_PM_OPS(synaptics_i2c_pm, synaptics_i2c_suspend,
synaptics_i2c_resume); synaptics_i2c_resume);
......
...@@ -24,9 +24,7 @@ ...@@ -24,9 +24,7 @@
struct ps2if { struct ps2if {
struct serio *io; struct serio *io;
struct resource *iomem_res;
void __iomem *base; void __iomem *base;
unsigned irq;
}; };
/* /*
...@@ -83,16 +81,34 @@ static void altera_ps2_close(struct serio *io) ...@@ -83,16 +81,34 @@ static void altera_ps2_close(struct serio *io)
static int altera_ps2_probe(struct platform_device *pdev) static int altera_ps2_probe(struct platform_device *pdev)
{ {
struct ps2if *ps2if; struct ps2if *ps2if;
struct resource *res;
struct serio *serio; struct serio *serio;
int error, irq; int error, irq;
ps2if = kzalloc(sizeof(struct ps2if), GFP_KERNEL); ps2if = devm_kzalloc(&pdev->dev, sizeof(struct ps2if), GFP_KERNEL);
serio = kzalloc(sizeof(struct serio), GFP_KERNEL); if (!ps2if)
if (!ps2if || !serio) { return -ENOMEM;
error = -ENOMEM;
goto err_free_mem; res = platform_get_resource(pdev, IORESOURCE_MEM, 0);
ps2if->base = devm_ioremap_resource(&pdev->dev, res);
if (IS_ERR(ps2if->base))
return PTR_ERR(ps2if->base);
irq = platform_get_irq(pdev, 0);
if (irq < 0)
return -ENXIO;
error = devm_request_irq(&pdev->dev, irq, altera_ps2_rxint, 0,
pdev->name, ps2if);
if (error) {
dev_err(&pdev->dev, "could not request IRQ %d\n", irq);
return error;
} }
serio = kzalloc(sizeof(struct serio), GFP_KERNEL);
if (!serio)
return -ENOMEM;
serio->id.type = SERIO_8042; serio->id.type = SERIO_8042;
serio->write = altera_ps2_write; serio->write = altera_ps2_write;
serio->open = altera_ps2_open; serio->open = altera_ps2_open;
...@@ -103,56 +119,12 @@ static int altera_ps2_probe(struct platform_device *pdev) ...@@ -103,56 +119,12 @@ static int altera_ps2_probe(struct platform_device *pdev)
serio->dev.parent = &pdev->dev; serio->dev.parent = &pdev->dev;
ps2if->io = serio; ps2if->io = serio;
ps2if->iomem_res = platform_get_resource(pdev, IORESOURCE_MEM, 0); dev_info(&pdev->dev, "base %p, irq %d\n", ps2if->base, irq);
if (ps2if->iomem_res == NULL) {
error = -ENOENT;
goto err_free_mem;
}
irq = platform_get_irq(pdev, 0);
if (irq < 0) {
error = -ENXIO;
goto err_free_mem;
}
ps2if->irq = irq;
if (!request_mem_region(ps2if->iomem_res->start,
resource_size(ps2if->iomem_res), pdev->name)) {
error = -EBUSY;
goto err_free_mem;
}
ps2if->base = ioremap(ps2if->iomem_res->start,
resource_size(ps2if->iomem_res));
if (!ps2if->base) {
error = -ENOMEM;
goto err_free_res;
}
error = request_irq(ps2if->irq, altera_ps2_rxint, 0, pdev->name, ps2if);
if (error) {
dev_err(&pdev->dev, "could not allocate IRQ %d: %d\n",
ps2if->irq, error);
goto err_unmap;
}
dev_info(&pdev->dev, "base %p, irq %d\n", ps2if->base, ps2if->irq);
serio_register_port(ps2if->io); serio_register_port(ps2if->io);
platform_set_drvdata(pdev, ps2if); platform_set_drvdata(pdev, ps2if);
return 0; return 0;
err_unmap:
iounmap(ps2if->base);
err_free_res:
release_mem_region(ps2if->iomem_res->start,
resource_size(ps2if->iomem_res));
err_free_mem:
kfree(ps2if);
kfree(serio);
return error;
} }
/* /*
...@@ -163,11 +135,6 @@ static int altera_ps2_remove(struct platform_device *pdev) ...@@ -163,11 +135,6 @@ static int altera_ps2_remove(struct platform_device *pdev)
struct ps2if *ps2if = platform_get_drvdata(pdev); struct ps2if *ps2if = platform_get_drvdata(pdev);
serio_unregister_port(ps2if->io); serio_unregister_port(ps2if->io);
free_irq(ps2if->irq, ps2if);
iounmap(ps2if->base);
release_mem_region(ps2if->iomem_res->start,
resource_size(ps2if->iomem_res));
kfree(ps2if);
return 0; return 0;
} }
......
...@@ -578,6 +578,16 @@ static const struct dmi_system_id __initconst i8042_dmi_nopnp_table[] = { ...@@ -578,6 +578,16 @@ static const struct dmi_system_id __initconst i8042_dmi_nopnp_table[] = {
DMI_MATCH(DMI_BOARD_VENDOR, "Intel Corporation"), DMI_MATCH(DMI_BOARD_VENDOR, "Intel Corporation"),
}, },
}, },
{
/*
* Intel NUC D54250WYK - does not have i8042 controller but
* declares PS/2 devices in DSDT.
*/
.matches = {
DMI_MATCH(DMI_BOARD_NAME, "D54250WYK"),
DMI_MATCH(DMI_BOARD_VENDOR, "Intel Corporation"),
},
},
{ {
/* MSI Wind U-100 */ /* MSI Wind U-100 */
.matches = { .matches = {
......
...@@ -514,7 +514,7 @@ static void serio_release_port(struct device *dev) ...@@ -514,7 +514,7 @@ static void serio_release_port(struct device *dev)
*/ */
static void serio_init_port(struct serio *serio) static void serio_init_port(struct serio *serio)
{ {
static atomic_t serio_no = ATOMIC_INIT(0); static atomic_t serio_no = ATOMIC_INIT(-1);
__module_get(THIS_MODULE); __module_get(THIS_MODULE);
...@@ -525,7 +525,7 @@ static void serio_init_port(struct serio *serio) ...@@ -525,7 +525,7 @@ static void serio_init_port(struct serio *serio)
mutex_init(&serio->drv_mutex); mutex_init(&serio->drv_mutex);
device_initialize(&serio->dev); device_initialize(&serio->dev);
dev_set_name(&serio->dev, "serio%lu", dev_set_name(&serio->dev, "serio%lu",
(unsigned long)atomic_inc_return(&serio_no) - 1); (unsigned long)atomic_inc_return(&serio_no));
serio->dev.bus = &serio_bus; serio->dev.bus = &serio_bus;
serio->dev.release = serio_release_port; serio->dev.release = serio_release_port;
serio->dev.groups = serio_device_attr_groups; serio->dev.groups = serio_device_attr_groups;
......
...@@ -292,7 +292,7 @@ static irqreturn_t serio_raw_interrupt(struct serio *serio, unsigned char data, ...@@ -292,7 +292,7 @@ static irqreturn_t serio_raw_interrupt(struct serio *serio, unsigned char data,
static int serio_raw_connect(struct serio *serio, struct serio_driver *drv) static int serio_raw_connect(struct serio *serio, struct serio_driver *drv)
{ {
static atomic_t serio_raw_no = ATOMIC_INIT(0); static atomic_t serio_raw_no = ATOMIC_INIT(-1);
struct serio_raw *serio_raw; struct serio_raw *serio_raw;
int err; int err;
...@@ -303,7 +303,7 @@ static int serio_raw_connect(struct serio *serio, struct serio_driver *drv) ...@@ -303,7 +303,7 @@ static int serio_raw_connect(struct serio *serio, struct serio_driver *drv)
} }
snprintf(serio_raw->name, sizeof(serio_raw->name), snprintf(serio_raw->name, sizeof(serio_raw->name),
"serio_raw%ld", (long)atomic_inc_return(&serio_raw_no) - 1); "serio_raw%ld", (long)atomic_inc_return(&serio_raw_no));
kref_init(&serio_raw->kref); kref_init(&serio_raw->kref);
INIT_LIST_HEAD(&serio_raw->client_list); INIT_LIST_HEAD(&serio_raw->client_list);
init_waitqueue_head(&serio_raw->wait); init_waitqueue_head(&serio_raw->wait);
......
...@@ -295,6 +295,19 @@ config TOUCHSCREEN_FUJITSU ...@@ -295,6 +295,19 @@ config TOUCHSCREEN_FUJITSU
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 fujitsu-ts. module will be called fujitsu-ts.
config TOUCHSCREEN_GOODIX
tristate "Goodix I2C touchscreen"
depends on I2C && ACPI
help
Say Y here if you have the Goodix touchscreen (such as one
installed in Onda v975w tablets) connected to your
system.
If unsure, say N.
To compile this driver as a module, choose M here: the
module will be called goodix.
config TOUCHSCREEN_ILI210X config TOUCHSCREEN_ILI210X
tristate "Ilitek ILI210X based touchscreen" tristate "Ilitek ILI210X based touchscreen"
depends on I2C depends on I2C
...@@ -334,6 +347,18 @@ config TOUCHSCREEN_GUNZE ...@@ -334,6 +347,18 @@ config TOUCHSCREEN_GUNZE
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 gunze. module will be called gunze.
config TOUCHSCREEN_ELAN
tristate "Elan eKTH I2C touchscreen"
depends on I2C
help
Say Y here if you have an Elan eKTH I2C touchscreen
connected to your system.
If unsure, say N.
To compile this driver as a module, choose M here: the
module will be called elants_i2c.
config TOUCHSCREEN_ELO config TOUCHSCREEN_ELO
tristate "Elo serial touchscreens" tristate "Elo serial touchscreens"
select SERIO select SERIO
......
...@@ -31,9 +31,11 @@ obj-$(CONFIG_TOUCHSCREEN_EDT_FT5X06) += edt-ft5x06.o ...@@ -31,9 +31,11 @@ obj-$(CONFIG_TOUCHSCREEN_EDT_FT5X06) += edt-ft5x06.o
obj-$(CONFIG_TOUCHSCREEN_HAMPSHIRE) += hampshire.o obj-$(CONFIG_TOUCHSCREEN_HAMPSHIRE) += hampshire.o
obj-$(CONFIG_TOUCHSCREEN_GUNZE) += gunze.o obj-$(CONFIG_TOUCHSCREEN_GUNZE) += gunze.o
obj-$(CONFIG_TOUCHSCREEN_EETI) += eeti_ts.o obj-$(CONFIG_TOUCHSCREEN_EETI) += eeti_ts.o
obj-$(CONFIG_TOUCHSCREEN_ELAN) += elants_i2c.o
obj-$(CONFIG_TOUCHSCREEN_ELO) += elo.o obj-$(CONFIG_TOUCHSCREEN_ELO) += elo.o
obj-$(CONFIG_TOUCHSCREEN_EGALAX) += egalax_ts.o obj-$(CONFIG_TOUCHSCREEN_EGALAX) += egalax_ts.o
obj-$(CONFIG_TOUCHSCREEN_FUJITSU) += fujitsu_ts.o obj-$(CONFIG_TOUCHSCREEN_FUJITSU) += fujitsu_ts.o
obj-$(CONFIG_TOUCHSCREEN_GOODIX) += goodix.o
obj-$(CONFIG_TOUCHSCREEN_ILI210X) += ili210x.o obj-$(CONFIG_TOUCHSCREEN_ILI210X) += ili210x.o
obj-$(CONFIG_TOUCHSCREEN_INEXIO) += inexio.o obj-$(CONFIG_TOUCHSCREEN_INEXIO) += inexio.o
obj-$(CONFIG_TOUCHSCREEN_INTEL_MID) += intel-mid-touch.o obj-$(CONFIG_TOUCHSCREEN_INTEL_MID) += intel-mid-touch.o
......
...@@ -820,8 +820,7 @@ static int ad7877_remove(struct spi_device *spi) ...@@ -820,8 +820,7 @@ static int ad7877_remove(struct spi_device *spi)
return 0; return 0;
} }
#ifdef CONFIG_PM_SLEEP static int __maybe_unused ad7877_suspend(struct device *dev)
static int ad7877_suspend(struct device *dev)
{ {
struct ad7877 *ts = dev_get_drvdata(dev); struct ad7877 *ts = dev_get_drvdata(dev);
...@@ -830,7 +829,7 @@ static int ad7877_suspend(struct device *dev) ...@@ -830,7 +829,7 @@ static int ad7877_suspend(struct device *dev)
return 0; return 0;
} }
static int ad7877_resume(struct device *dev) static int __maybe_unused ad7877_resume(struct device *dev)
{ {
struct ad7877 *ts = dev_get_drvdata(dev); struct ad7877 *ts = dev_get_drvdata(dev);
...@@ -838,7 +837,6 @@ static int ad7877_resume(struct device *dev) ...@@ -838,7 +837,6 @@ static int ad7877_resume(struct device *dev)
return 0; return 0;
} }
#endif
static SIMPLE_DEV_PM_OPS(ad7877_pm, ad7877_suspend, ad7877_resume); static SIMPLE_DEV_PM_OPS(ad7877_pm, ad7877_suspend, ad7877_resume);
......
...@@ -284,8 +284,7 @@ static void ad7879_close(struct input_dev* input) ...@@ -284,8 +284,7 @@ static void ad7879_close(struct input_dev* input)
__ad7879_disable(ts); __ad7879_disable(ts);
} }
#ifdef CONFIG_PM_SLEEP static int __maybe_unused ad7879_suspend(struct device *dev)
static int ad7879_suspend(struct device *dev)
{ {
struct ad7879 *ts = dev_get_drvdata(dev); struct ad7879 *ts = dev_get_drvdata(dev);
...@@ -301,7 +300,7 @@ static int ad7879_suspend(struct device *dev) ...@@ -301,7 +300,7 @@ static int ad7879_suspend(struct device *dev)
return 0; return 0;
} }
static int ad7879_resume(struct device *dev) static int __maybe_unused ad7879_resume(struct device *dev)
{ {
struct ad7879 *ts = dev_get_drvdata(dev); struct ad7879 *ts = dev_get_drvdata(dev);
...@@ -316,7 +315,6 @@ static int ad7879_resume(struct device *dev) ...@@ -316,7 +315,6 @@ static int ad7879_resume(struct device *dev)
return 0; return 0;
} }
#endif
SIMPLE_DEV_PM_OPS(ad7879_pm_ops, ad7879_suspend, ad7879_resume); SIMPLE_DEV_PM_OPS(ad7879_pm_ops, ad7879_suspend, ad7879_resume);
EXPORT_SYMBOL(ad7879_pm_ops); EXPORT_SYMBOL(ad7879_pm_ops);
......
...@@ -883,8 +883,7 @@ static irqreturn_t ads7846_irq(int irq, void *handle) ...@@ -883,8 +883,7 @@ static irqreturn_t ads7846_irq(int irq, void *handle)
return IRQ_HANDLED; return IRQ_HANDLED;
} }
#ifdef CONFIG_PM_SLEEP static int __maybe_unused ads7846_suspend(struct device *dev)
static int ads7846_suspend(struct device *dev)
{ {
struct ads7846 *ts = dev_get_drvdata(dev); struct ads7846 *ts = dev_get_drvdata(dev);
...@@ -906,7 +905,7 @@ static int ads7846_suspend(struct device *dev) ...@@ -906,7 +905,7 @@ static int ads7846_suspend(struct device *dev)
return 0; return 0;
} }
static int ads7846_resume(struct device *dev) static int __maybe_unused ads7846_resume(struct device *dev)
{ {
struct ads7846 *ts = dev_get_drvdata(dev); struct ads7846 *ts = dev_get_drvdata(dev);
...@@ -927,7 +926,6 @@ static int ads7846_resume(struct device *dev) ...@@ -927,7 +926,6 @@ static int ads7846_resume(struct device *dev)
return 0; return 0;
} }
#endif
static SIMPLE_DEV_PM_OPS(ads7846_pm, ads7846_suspend, ads7846_resume); static SIMPLE_DEV_PM_OPS(ads7846_pm, ads7846_suspend, ads7846_resume);
......
...@@ -2244,8 +2244,7 @@ static int mxt_remove(struct i2c_client *client) ...@@ -2244,8 +2244,7 @@ static int mxt_remove(struct i2c_client *client)
return 0; return 0;
} }
#ifdef CONFIG_PM_SLEEP static int __maybe_unused mxt_suspend(struct device *dev)
static int mxt_suspend(struct device *dev)
{ {
struct i2c_client *client = to_i2c_client(dev); struct i2c_client *client = to_i2c_client(dev);
struct mxt_data *data = i2c_get_clientdata(client); struct mxt_data *data = i2c_get_clientdata(client);
...@@ -2261,7 +2260,7 @@ static int mxt_suspend(struct device *dev) ...@@ -2261,7 +2260,7 @@ static int mxt_suspend(struct device *dev)
return 0; return 0;
} }
static int mxt_resume(struct device *dev) static int __maybe_unused mxt_resume(struct device *dev)
{ {
struct i2c_client *client = to_i2c_client(dev); struct i2c_client *client = to_i2c_client(dev);
struct mxt_data *data = i2c_get_clientdata(client); struct mxt_data *data = i2c_get_clientdata(client);
...@@ -2276,7 +2275,6 @@ static int mxt_resume(struct device *dev) ...@@ -2276,7 +2275,6 @@ static int mxt_resume(struct device *dev)
return 0; return 0;
} }
#endif
static SIMPLE_DEV_PM_OPS(mxt_pm_ops, mxt_suspend, mxt_resume); static SIMPLE_DEV_PM_OPS(mxt_pm_ops, mxt_suspend, mxt_resume);
......
...@@ -417,8 +417,7 @@ static void auo_pixcir_input_close(struct input_dev *dev) ...@@ -417,8 +417,7 @@ static void auo_pixcir_input_close(struct input_dev *dev)
return; return;
} }
#ifdef CONFIG_PM_SLEEP static int __maybe_unused auo_pixcir_suspend(struct device *dev)
static int auo_pixcir_suspend(struct device *dev)
{ {
struct i2c_client *client = to_i2c_client(dev); struct i2c_client *client = to_i2c_client(dev);
struct auo_pixcir_ts *ts = i2c_get_clientdata(client); struct auo_pixcir_ts *ts = i2c_get_clientdata(client);
...@@ -450,7 +449,7 @@ static int auo_pixcir_suspend(struct device *dev) ...@@ -450,7 +449,7 @@ static int auo_pixcir_suspend(struct device *dev)
return ret; return ret;
} }
static int auo_pixcir_resume(struct device *dev) static int __maybe_unused auo_pixcir_resume(struct device *dev)
{ {
struct i2c_client *client = to_i2c_client(dev); struct i2c_client *client = to_i2c_client(dev);
struct auo_pixcir_ts *ts = i2c_get_clientdata(client); struct auo_pixcir_ts *ts = i2c_get_clientdata(client);
...@@ -479,7 +478,6 @@ static int auo_pixcir_resume(struct device *dev) ...@@ -479,7 +478,6 @@ static int auo_pixcir_resume(struct device *dev)
return ret; return ret;
} }
#endif
static SIMPLE_DEV_PM_OPS(auo_pixcir_pm_ops, static SIMPLE_DEV_PM_OPS(auo_pixcir_pm_ops,
auo_pixcir_suspend, auo_pixcir_resume); auo_pixcir_suspend, auo_pixcir_resume);
......
...@@ -291,8 +291,7 @@ static int cy8ctmg110_probe(struct i2c_client *client, ...@@ -291,8 +291,7 @@ static int cy8ctmg110_probe(struct i2c_client *client,
return err; return err;
} }
#ifdef CONFIG_PM_SLEEP static int __maybe_unused cy8ctmg110_suspend(struct device *dev)
static int cy8ctmg110_suspend(struct device *dev)
{ {
struct i2c_client *client = to_i2c_client(dev); struct i2c_client *client = to_i2c_client(dev);
struct cy8ctmg110 *ts = i2c_get_clientdata(client); struct cy8ctmg110 *ts = i2c_get_clientdata(client);
...@@ -306,7 +305,7 @@ static int cy8ctmg110_suspend(struct device *dev) ...@@ -306,7 +305,7 @@ static int cy8ctmg110_suspend(struct device *dev)
return 0; return 0;
} }
static int cy8ctmg110_resume(struct device *dev) static int __maybe_unused cy8ctmg110_resume(struct device *dev)
{ {
struct i2c_client *client = to_i2c_client(dev); struct i2c_client *client = to_i2c_client(dev);
struct cy8ctmg110 *ts = i2c_get_clientdata(client); struct cy8ctmg110 *ts = i2c_get_clientdata(client);
...@@ -319,7 +318,6 @@ static int cy8ctmg110_resume(struct device *dev) ...@@ -319,7 +318,6 @@ static int cy8ctmg110_resume(struct device *dev)
} }
return 0; return 0;
} }
#endif
static SIMPLE_DEV_PM_OPS(cy8ctmg110_pm, cy8ctmg110_suspend, cy8ctmg110_resume); static SIMPLE_DEV_PM_OPS(cy8ctmg110_pm, cy8ctmg110_suspend, cy8ctmg110_resume);
......
...@@ -472,8 +472,7 @@ static int cyttsp_disable(struct cyttsp *ts) ...@@ -472,8 +472,7 @@ static int cyttsp_disable(struct cyttsp *ts)
return 0; return 0;
} }
#ifdef CONFIG_PM_SLEEP static int __maybe_unused cyttsp_suspend(struct device *dev)
static int cyttsp_suspend(struct device *dev)
{ {
struct cyttsp *ts = dev_get_drvdata(dev); struct cyttsp *ts = dev_get_drvdata(dev);
int retval = 0; int retval = 0;
...@@ -491,7 +490,7 @@ static int cyttsp_suspend(struct device *dev) ...@@ -491,7 +490,7 @@ static int cyttsp_suspend(struct device *dev)
return retval; return retval;
} }
static int cyttsp_resume(struct device *dev) static int __maybe_unused cyttsp_resume(struct device *dev)
{ {
struct cyttsp *ts = dev_get_drvdata(dev); struct cyttsp *ts = dev_get_drvdata(dev);
...@@ -507,8 +506,6 @@ static int cyttsp_resume(struct device *dev) ...@@ -507,8 +506,6 @@ static int cyttsp_resume(struct device *dev)
return 0; return 0;
} }
#endif
SIMPLE_DEV_PM_OPS(cyttsp_pm_ops, cyttsp_suspend, cyttsp_resume); SIMPLE_DEV_PM_OPS(cyttsp_pm_ops, cyttsp_suspend, cyttsp_resume);
EXPORT_SYMBOL_GPL(cyttsp_pm_ops); EXPORT_SYMBOL_GPL(cyttsp_pm_ops);
......
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment