aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--Documentation/devicetree/bindings/input/gpio-matrix-keypad.txt46
-rw-r--r--Documentation/devicetree/bindings/input/pwm-beeper.txt7
-rw-r--r--Documentation/devicetree/bindings/input/stmpe-keypad.txt39
-rw-r--r--Documentation/devicetree/bindings/input/tca8418_keypad.txt8
-rw-r--r--Documentation/devicetree/bindings/input/touchscreen/mms114.txt34
-rw-r--r--Documentation/devicetree/bindings/input/touchscreen/stmpe.txt43
-rw-r--r--arch/arm/mach-omap1/board-nokia770.c14
-rw-r--r--arch/arm/mach-ux500/board-mop500-stuib.c71
-rw-r--r--drivers/input/gameport/emu10k1-gp.c6
-rw-r--r--drivers/input/gameport/fm801-gp.c6
-rw-r--r--drivers/input/input-mt.c2
-rw-r--r--drivers/input/input.c181
-rw-r--r--drivers/input/joystick/as5011.c29
-rw-r--r--drivers/input/joystick/maplecontrol.c6
-rw-r--r--drivers/input/joystick/walkera0701.c7
-rw-r--r--drivers/input/joystick/xpad.c33
-rw-r--r--drivers/input/keyboard/Kconfig2
-rw-r--r--drivers/input/keyboard/adp5520-keys.c6
-rw-r--r--drivers/input/keyboard/adp5588-keys.c18
-rw-r--r--drivers/input/keyboard/adp5589-keys.c21
-rw-r--r--drivers/input/keyboard/bf54x-keys.c6
-rw-r--r--drivers/input/keyboard/davinci_keyscan.c4
-rw-r--r--drivers/input/keyboard/ep93xx_keypad.c6
-rw-r--r--drivers/input/keyboard/gpio_keys.c90
-rw-r--r--drivers/input/keyboard/gpio_keys_polled.c26
-rw-r--r--drivers/input/keyboard/hilkbd.c10
-rw-r--r--drivers/input/keyboard/imx_keypad.c9
-rw-r--r--drivers/input/keyboard/jornada680_kbd.c6
-rw-r--r--drivers/input/keyboard/jornada720_kbd.c6
-rw-r--r--drivers/input/keyboard/lm8323.c6
-rw-r--r--drivers/input/keyboard/lm8333.c6
-rw-r--r--drivers/input/keyboard/locomokbd.c8
-rw-r--r--drivers/input/keyboard/lpc32xx-keys.c8
-rw-r--r--drivers/input/keyboard/matrix_keypad.c129
-rw-r--r--drivers/input/keyboard/max7359_keypad.c6
-rw-r--r--drivers/input/keyboard/mcs_touchkey.c6
-rw-r--r--drivers/input/keyboard/mpr121_touchkey.c12
-rw-r--r--drivers/input/keyboard/nomadik-ske-keypad.c38
-rw-r--r--drivers/input/keyboard/omap-keypad.c6
-rw-r--r--drivers/input/keyboard/omap4-keypad.c10
-rw-r--r--drivers/input/keyboard/opencores-kbd.c6
-rw-r--r--drivers/input/keyboard/pmic8xxx-keypad.c10
-rw-r--r--drivers/input/keyboard/pxa27x_keypad.c6
-rw-r--r--drivers/input/keyboard/pxa930_rotary.c6
-rw-r--r--drivers/input/keyboard/qt1070.c8
-rw-r--r--drivers/input/keyboard/qt2160.c31
-rw-r--r--drivers/input/keyboard/samsung-keypad.c109
-rw-r--r--drivers/input/keyboard/sh_keysc.c6
-rw-r--r--drivers/input/keyboard/spear-keyboard.c98
-rw-r--r--drivers/input/keyboard/stmpe-keypad.c142
-rw-r--r--drivers/input/keyboard/tc3589x-keypad.c6
-rw-r--r--drivers/input/keyboard/tca6416-keypad.c8
-rw-r--r--drivers/input/keyboard/tca8418_keypad.c179
-rw-r--r--drivers/input/keyboard/tegra-kbc.c16
-rw-r--r--drivers/input/keyboard/tnetv107x-keypad.c6
-rw-r--r--drivers/input/keyboard/twl4030_keypad.c8
-rw-r--r--drivers/input/keyboard/w90p910_keypad.c6
-rw-r--r--drivers/input/matrix-keymap.c23
-rw-r--r--drivers/input/misc/88pm80x_onkey.c6
-rw-r--r--drivers/input/misc/88pm860x_onkey.c6
-rw-r--r--drivers/input/misc/Kconfig29
-rw-r--r--drivers/input/misc/Makefile2
-rw-r--r--drivers/input/misc/ab8500-ponkey.c6
-rw-r--r--drivers/input/misc/ad714x-i2c.c6
-rw-r--r--drivers/input/misc/ad714x-spi.c6
-rw-r--r--drivers/input/misc/adxl34x-i2c.c6
-rw-r--r--drivers/input/misc/adxl34x-spi.c6
-rw-r--r--drivers/input/misc/bfin_rotary.c6
-rw-r--r--drivers/input/misc/bma150.c28
-rw-r--r--drivers/input/misc/cma3000_d0x_i2c.c6
-rw-r--r--drivers/input/misc/cobalt_btns.c6
-rw-r--r--drivers/input/misc/da9052_onkey.c6
-rw-r--r--drivers/input/misc/da9055_onkey.c171
-rw-r--r--drivers/input/misc/dm355evm_keys.c6
-rw-r--r--drivers/input/misc/gp2ap002a00f.c8
-rw-r--r--drivers/input/misc/gpio_tilt_polled.c6
-rw-r--r--drivers/input/misc/ixp4xx-beeper.c6
-rw-r--r--drivers/input/misc/kxtj9.c16
-rw-r--r--drivers/input/misc/m68kspkr.c6
-rw-r--r--drivers/input/misc/max8925_onkey.c6
-rw-r--r--drivers/input/misc/max8997_haptic.c6
-rw-r--r--drivers/input/misc/mc13783-pwrbutton.c6
-rw-r--r--drivers/input/misc/mma8450.c6
-rw-r--r--drivers/input/misc/mpu3050.c8
-rw-r--r--drivers/input/misc/pcap_keys.c6
-rw-r--r--drivers/input/misc/pcf50633-input.c6
-rw-r--r--drivers/input/misc/pcf8574_keypad.c6
-rw-r--r--drivers/input/misc/pcspkr.c6
-rw-r--r--drivers/input/misc/pm8xxx-vibrator.c6
-rw-r--r--drivers/input/misc/pmic8xxx-pwrkey.c6
-rw-r--r--drivers/input/misc/pwm-beeper.c20
-rw-r--r--drivers/input/misc/rb532_button.c6
-rw-r--r--drivers/input/misc/retu-pwrbutton.c99
-rw-r--r--drivers/input/misc/rotary_encoder.c9
-rw-r--r--drivers/input/misc/sgi_btns.c6
-rw-r--r--drivers/input/misc/sparcspkr.c14
-rw-r--r--drivers/input/misc/twl4030-pwrbutton.c3
-rw-r--r--drivers/input/misc/twl4030-vibra.c6
-rw-r--r--drivers/input/misc/twl6040-vibra.c6
-rw-r--r--drivers/input/misc/wistron_btns.c20
-rw-r--r--drivers/input/misc/wm831x-on.c11
-rw-r--r--drivers/input/misc/xen-kbdfront.c2
-rw-r--r--drivers/input/mouse/alps.c10
-rw-r--r--drivers/input/mouse/gpio_mouse.c6
-rw-r--r--drivers/input/mouse/maplemouse.c6
-rw-r--r--drivers/input/mouse/navpoint.c6
-rw-r--r--drivers/input/mouse/pxa930_trkball.c6
-rw-r--r--drivers/input/mouse/synaptics_i2c.c6
-rw-r--r--drivers/input/serio/Kconfig9
-rw-r--r--drivers/input/serio/Makefile1
-rw-r--r--drivers/input/serio/altera_ps2.c6
-rw-r--r--drivers/input/serio/ambakmi.c6
-rw-r--r--drivers/input/serio/arc_ps2.c274
-rw-r--r--drivers/input/serio/ct82c710.c6
-rw-r--r--drivers/input/serio/gscps2.c6
-rw-r--r--drivers/input/serio/hil_mlc.c13
-rw-r--r--drivers/input/serio/i8042-io.h2
-rw-r--r--drivers/input/serio/i8042-sparcio.h6
-rw-r--r--drivers/input/serio/i8042.c6
-rw-r--r--drivers/input/serio/maceps2.c8
-rw-r--r--drivers/input/serio/pcips2.c6
-rw-r--r--drivers/input/serio/q40kbd.c6
-rw-r--r--drivers/input/serio/rpckbd.c6
-rw-r--r--drivers/input/serio/sa1111ps2.c12
-rw-r--r--drivers/input/serio/serio.c11
-rw-r--r--drivers/input/serio/xilinx_ps2.c8
-rw-r--r--drivers/input/tablet/wacom_sys.c58
-rw-r--r--drivers/input/tablet/wacom_wac.c32
-rw-r--r--drivers/input/tablet/wacom_wac.h2
-rw-r--r--drivers/input/touchscreen/88pm860x-ts.c8
-rw-r--r--drivers/input/touchscreen/Kconfig12
-rw-r--r--drivers/input/touchscreen/Makefile1
-rw-r--r--drivers/input/touchscreen/ad7877.c6
-rw-r--r--drivers/input/touchscreen/ad7879-i2c.c6
-rw-r--r--drivers/input/touchscreen/ad7879-spi.c6
-rw-r--r--drivers/input/touchscreen/ads7846.c10
-rw-r--r--drivers/input/touchscreen/atmel_mxt_ts.c6
-rw-r--r--drivers/input/touchscreen/atmel_tsadcc.c6
-rw-r--r--drivers/input/touchscreen/auo-pixcir-ts.c8
-rw-r--r--drivers/input/touchscreen/bu21013_ts.c125
-rw-r--r--drivers/input/touchscreen/cy8ctmg110_ts.c19
-rw-r--r--drivers/input/touchscreen/cyttsp_i2c.c6
-rw-r--r--drivers/input/touchscreen/cyttsp_spi.c6
-rw-r--r--drivers/input/touchscreen/da9034-ts.c6
-rw-r--r--drivers/input/touchscreen/da9052_tsi.c10
-rw-r--r--drivers/input/touchscreen/edt-ft5x06.c28
-rw-r--r--drivers/input/touchscreen/eeti_ts.c6
-rw-r--r--drivers/input/touchscreen/egalax_ts.c8
-rw-r--r--drivers/input/touchscreen/h3600_ts_input.c479
-rw-r--r--drivers/input/touchscreen/htcpen.c6
-rw-r--r--drivers/input/touchscreen/ili210x.c6
-rw-r--r--drivers/input/touchscreen/intel-mid-touch.c14
-rw-r--r--drivers/input/touchscreen/jornada720_ts.c6
-rw-r--r--drivers/input/touchscreen/lpc32xx_ts.c6
-rw-r--r--drivers/input/touchscreen/max11801_ts.c8
-rw-r--r--drivers/input/touchscreen/mc13783_ts.c4
-rw-r--r--drivers/input/touchscreen/mcs5000_ts.c6
-rw-r--r--drivers/input/touchscreen/mms114.c68
-rw-r--r--drivers/input/touchscreen/pcap_ts.c6
-rw-r--r--drivers/input/touchscreen/pixcir_i2c_ts.c6
-rw-r--r--drivers/input/touchscreen/s3c2410_ts.c6
-rw-r--r--drivers/input/touchscreen/st1232.c8
-rw-r--r--drivers/input/touchscreen/stmpe-ts.c133
-rw-r--r--drivers/input/touchscreen/ti_am335x_tsc.c6
-rw-r--r--drivers/input/touchscreen/tnetv107x-ts.c6
-rw-r--r--drivers/input/touchscreen/tps6507x-ts.c4
-rw-r--r--drivers/input/touchscreen/tsc2005.c8
-rw-r--r--drivers/input/touchscreen/tsc2007.c6
-rw-r--r--drivers/input/touchscreen/ucb1400_ts.c8
-rw-r--r--drivers/input/touchscreen/w90p910_ts.c6
-rw-r--r--drivers/input/touchscreen/wacom_i2c.c6
-rw-r--r--drivers/input/touchscreen/wm831x-ts.c12
-rw-r--r--drivers/mfd/stmpe.c2
-rw-r--r--include/linux/input.h10
-rw-r--r--include/linux/input/bu21013.h10
175 files changed, 2256 insertions, 1662 deletions
diff --git a/Documentation/devicetree/bindings/input/gpio-matrix-keypad.txt b/Documentation/devicetree/bindings/input/gpio-matrix-keypad.txt
new file mode 100644
index 000000000000..ead641c65e0a
--- /dev/null
+++ b/Documentation/devicetree/bindings/input/gpio-matrix-keypad.txt
@@ -0,0 +1,46 @@
1* GPIO driven matrix keypad device tree bindings
2
3GPIO driven matrix keypad is used to interface a SoC with a matrix keypad.
4The matrix keypad supports multiple row and column lines, a key can be
5placed at each intersection of a unique row and a unique column. The matrix
6keypad can sense a key-press and key-release by means of GPIO lines and
7report the event using GPIO interrupts to the cpu.
8
9Required Properties:
10- compatible: Should be "gpio-matrix-keypad"
11- row-gpios: List of gpios used as row lines. The gpio specifier
12 for this property depends on the gpio controller to
13 which these row lines are connected.
14- col-gpios: List of gpios used as column lines. The gpio specifier
15 for this property depends on the gpio controller to
16 which these column lines are connected.
17- linux,keymap: The definition can be found at
18 bindings/input/matrix-keymap.txt
19
20Optional Properties:
21- linux,no-autorepeat: do no enable autorepeat feature.
22- linux,wakeup: use any event on keypad as wakeup event.
23- debounce-delay-ms: debounce interval in milliseconds
24- col-scan-delay-us: delay, measured in microseconds, that is needed
25 before we can scan keypad after activating column gpio
26
27Example:
28 matrix-keypad {
29 compatible = "gpio-matrix-keypad";
30 debounce-delay-ms = <5>;
31 col-scan-delay-us = <2>;
32
33 row-gpios = <&gpio2 25 0
34 &gpio2 26 0
35 &gpio2 27 0>;
36
37 col-gpios = <&gpio2 21 0
38 &gpio2 22 0>;
39
40 linux,keymap = <0x0000008B
41 0x0100009E
42 0x02000069
43 0x0001006A
44 0x0101001C
45 0x0201006C>;
46 };
diff --git a/Documentation/devicetree/bindings/input/pwm-beeper.txt b/Documentation/devicetree/bindings/input/pwm-beeper.txt
new file mode 100644
index 000000000000..be332ae4f2d6
--- /dev/null
+++ b/Documentation/devicetree/bindings/input/pwm-beeper.txt
@@ -0,0 +1,7 @@
1* PWM beeper device tree bindings
2
3Registers a PWM device as beeper.
4
5Required properties:
6- compatible: should be "pwm-beeper"
7- pwms: phandle to the physical PWM device
diff --git a/Documentation/devicetree/bindings/input/stmpe-keypad.txt b/Documentation/devicetree/bindings/input/stmpe-keypad.txt
new file mode 100644
index 000000000000..1b97222e8a0b
--- /dev/null
+++ b/Documentation/devicetree/bindings/input/stmpe-keypad.txt
@@ -0,0 +1,39 @@
1* STMPE Keypad
2
3Required properties:
4 - compatible : "st,stmpe-keypad"
5 - linux,keymap : See ./matrix-keymap.txt
6
7Optional properties:
8 - debounce-interval : Debouncing interval time in milliseconds
9 - st,scan-count : Scanning cycles elapsed before key data is updated
10 - st,no-autorepeat : If specified device will not autorepeat
11
12Example:
13
14 stmpe_keypad {
15 compatible = "st,stmpe-keypad";
16
17 debounce-interval = <64>;
18 st,scan-count = <8>;
19 st,no-autorepeat;
20
21 linux,keymap = <0x205006b
22 0x4010074
23 0x3050072
24 0x1030004
25 0x502006a
26 0x500000a
27 0x5008b
28 0x706001c
29 0x405000b
30 0x6070003
31 0x3040067
32 0x303006c
33 0x60400e7
34 0x602009e
35 0x4020073
36 0x5050002
37 0x4030069
38 0x3020008>;
39 };
diff --git a/Documentation/devicetree/bindings/input/tca8418_keypad.txt b/Documentation/devicetree/bindings/input/tca8418_keypad.txt
new file mode 100644
index 000000000000..2a1538f0053f
--- /dev/null
+++ b/Documentation/devicetree/bindings/input/tca8418_keypad.txt
@@ -0,0 +1,8 @@
1
2Required properties:
3- compatible: "ti,tca8418"
4- reg: the I2C address
5- interrupts: IRQ line number, should trigger on falling edge
6- keypad,num-rows: The number of rows
7- keypad,num-columns: The number of columns
8- linux,keymap: Keys definitions, see keypad-matrix.
diff --git a/Documentation/devicetree/bindings/input/touchscreen/mms114.txt b/Documentation/devicetree/bindings/input/touchscreen/mms114.txt
new file mode 100644
index 000000000000..89d4c56c5671
--- /dev/null
+++ b/Documentation/devicetree/bindings/input/touchscreen/mms114.txt
@@ -0,0 +1,34 @@
1* MELFAS MMS114 touchscreen controller
2
3Required properties:
4- compatible: must be "melfas,mms114"
5- reg: I2C address of the chip
6- interrupts: interrupt to which the chip is connected
7- x-size: horizontal resolution of touchscreen
8- y-size: vertical resolution of touchscreen
9
10Optional properties:
11- contact-threshold:
12- moving-threshold:
13- x-invert: invert X axis
14- y-invert: invert Y axis
15
16Example:
17
18 i2c@00000000 {
19 /* ... */
20
21 touchscreen@48 {
22 compatible = "melfas,mms114";
23 reg = <0x48>;
24 interrupts = <39 0>;
25 x-size = <720>;
26 y-size = <1280>;
27 contact-threshold = <10>;
28 moving-threshold = <10>;
29 x-invert;
30 y-invert;
31 };
32
33 /* ... */
34 };
diff --git a/Documentation/devicetree/bindings/input/touchscreen/stmpe.txt b/Documentation/devicetree/bindings/input/touchscreen/stmpe.txt
new file mode 100644
index 000000000000..127baa31a77a
--- /dev/null
+++ b/Documentation/devicetree/bindings/input/touchscreen/stmpe.txt
@@ -0,0 +1,43 @@
1STMPE Touchscreen
2----------------
3
4Required properties:
5 - compatible: "st,stmpe-ts"
6
7Optional properties:
8- st,sample-time: ADC converstion time in number of clock. (0 -> 36 clocks, 1 ->
9 44 clocks, 2 -> 56 clocks, 3 -> 64 clocks, 4 -> 80 clocks, 5 -> 96 clocks, 6
10 -> 144 clocks), recommended is 4.
11- st,mod-12b: ADC Bit mode (0 -> 10bit ADC, 1 -> 12bit ADC)
12- st,ref-sel: ADC reference source (0 -> internal reference, 1 -> external
13 reference)
14- st,adc-freq: ADC Clock speed (0 -> 1.625 MHz, 1 -> 3.25 MHz, 2 || 3 -> 6.5 MHz)
15- st,ave-ctrl: Sample average control (0 -> 1 sample, 1 -> 2 samples, 2 -> 4
16 samples, 3 -> 8 samples)
17- st,touch-det-delay: Touch detect interrupt delay (0 -> 10 us, 1 -> 50 us, 2 ->
18 100 us, 3 -> 500 us, 4-> 1 ms, 5 -> 5 ms, 6 -> 10 ms, 7 -> 50 ms) recommended
19 is 3
20- st,settling: Panel driver settling time (0 -> 10 us, 1 -> 100 us, 2 -> 500 us, 3
21 -> 1 ms, 4 -> 5 ms, 5 -> 10 ms, 6 for 50 ms, 7 -> 100 ms) recommended is 2
22- st,fraction-z: Length of the fractional part in z (fraction-z ([0..7]) = Count of
23 the fractional part) recommended is 7
24- st,i-drive: current limit value of the touchscreen drivers (0 -> 20 mA typical 35
25 mA max, 1 -> 50 mA typical 80 mA max)
26
27Node name must be stmpe_touchscreen and should be child node of stmpe node to
28which it belongs.
29
30Example:
31
32 stmpe_touchscreen {
33 compatible = "st,stmpe-ts";
34 st,sample-time = <4>;
35 st,mod-12b = <1>;
36 st,ref-sel = <0>;
37 st,adc-freq = <1>;
38 st,ave-ctrl = <1>;
39 st,touch-det-delay = <2>;
40 st,settling = <2>;
41 st,fraction-z = <7>;
42 st,i-drive = <1>;
43 };
diff --git a/arch/arm/mach-omap1/board-nokia770.c b/arch/arm/mach-omap1/board-nokia770.c
index 3e8ead67e459..24d2f2df11a0 100644
--- a/arch/arm/mach-omap1/board-nokia770.c
+++ b/arch/arm/mach-omap1/board-nokia770.c
@@ -112,17 +112,6 @@ static void __init mipid_dev_init(void)
112 omapfb_set_lcd_config(&nokia770_lcd_config); 112 omapfb_set_lcd_config(&nokia770_lcd_config);
113} 113}
114 114
115static void __init ads7846_dev_init(void)
116{
117 if (gpio_request(ADS7846_PENDOWN_GPIO, "ADS7846 pendown") < 0)
118 printk(KERN_ERR "can't get ads7846 pen down GPIO\n");
119}
120
121static int ads7846_get_pendown_state(void)
122{
123 return !gpio_get_value(ADS7846_PENDOWN_GPIO);
124}
125
126static struct ads7846_platform_data nokia770_ads7846_platform_data __initdata = { 115static struct ads7846_platform_data nokia770_ads7846_platform_data __initdata = {
127 .x_max = 0x0fff, 116 .x_max = 0x0fff,
128 .y_max = 0x0fff, 117 .y_max = 0x0fff,
@@ -131,7 +120,7 @@ static struct ads7846_platform_data nokia770_ads7846_platform_data __initdata =
131 .debounce_max = 10, 120 .debounce_max = 10,
132 .debounce_tol = 3, 121 .debounce_tol = 3,
133 .debounce_rep = 1, 122 .debounce_rep = 1,
134 .get_pendown_state = ads7846_get_pendown_state, 123 .gpio_pendown = ADS7846_PENDOWN_GPIO,
135}; 124};
136 125
137static struct spi_board_info nokia770_spi_board_info[] __initdata = { 126static struct spi_board_info nokia770_spi_board_info[] __initdata = {
@@ -241,7 +230,6 @@ static void __init omap_nokia770_init(void)
241 omap_serial_init(); 230 omap_serial_init();
242 omap_register_i2c_bus(1, 100, NULL, 0); 231 omap_register_i2c_bus(1, 100, NULL, 0);
243 hwa742_dev_init(); 232 hwa742_dev_init();
244 ads7846_dev_init();
245 mipid_dev_init(); 233 mipid_dev_init();
246 omap1_usb_init(&nokia770_usb_config); 234 omap1_usb_init(&nokia770_usb_config);
247 nokia770_mmc_init(); 235 nokia770_mmc_init();
diff --git a/arch/arm/mach-ux500/board-mop500-stuib.c b/arch/arm/mach-ux500/board-mop500-stuib.c
index 564f57d5d8a7..7e1f294f0434 100644
--- a/arch/arm/mach-ux500/board-mop500-stuib.c
+++ b/arch/arm/mach-ux500/board-mop500-stuib.c
@@ -77,9 +77,6 @@ static struct i2c_board_info __initdata mop500_i2c0_devices_stuib[] = {
77 * BU21013 ROHM touchscreen interface on the STUIBs 77 * BU21013 ROHM touchscreen interface on the STUIBs
78 */ 78 */
79 79
80/* tracks number of bu21013 devices being enabled */
81static int bu21013_devices;
82
83#define TOUCH_GPIO_PIN 84 80#define TOUCH_GPIO_PIN 84
84 81
85#define TOUCH_XMAX 384 82#define TOUCH_XMAX 384
@@ -88,73 +85,8 @@ static int bu21013_devices;
88#define PRCMU_CLOCK_OCR 0x1CC 85#define PRCMU_CLOCK_OCR 0x1CC
89#define TSC_EXT_CLOCK_9_6MHZ 0x840000 86#define TSC_EXT_CLOCK_9_6MHZ 0x840000
90 87
91/**
92 * bu21013_gpio_board_init : configures the touch panel.
93 * @reset_pin: reset pin number
94 * This function can be used to configures
95 * the voltage and reset the touch panel controller.
96 */
97static int bu21013_gpio_board_init(int reset_pin)
98{
99 int retval = 0;
100
101 bu21013_devices++;
102 if (bu21013_devices == 1) {
103 retval = gpio_request(reset_pin, "touchp_reset");
104 if (retval) {
105 printk(KERN_ERR "Unable to request gpio reset_pin");
106 return retval;
107 }
108 retval = gpio_direction_output(reset_pin, 1);
109 if (retval < 0) {
110 printk(KERN_ERR "%s: gpio direction failed\n",
111 __func__);
112 return retval;
113 }
114 }
115
116 return retval;
117}
118
119/**
120 * bu21013_gpio_board_exit : deconfigures the touch panel controller
121 * @reset_pin: reset pin number
122 * This function can be used to deconfigures the chip selection
123 * for touch panel controller.
124 */
125static int bu21013_gpio_board_exit(int reset_pin)
126{
127 int retval = 0;
128
129 if (bu21013_devices == 1) {
130 retval = gpio_direction_output(reset_pin, 0);
131 if (retval < 0) {
132 printk(KERN_ERR "%s: gpio direction failed\n",
133 __func__);
134 return retval;
135 }
136 gpio_set_value(reset_pin, 0);
137 }
138 bu21013_devices--;
139
140 return retval;
141}
142
143/**
144 * bu21013_read_pin_val : get the interrupt pin value
145 * This function can be used to get the interrupt pin value for touch panel
146 * controller.
147 */
148static int bu21013_read_pin_val(void)
149{
150 return gpio_get_value(TOUCH_GPIO_PIN);
151}
152
153static struct bu21013_platform_device tsc_plat_device = { 88static struct bu21013_platform_device tsc_plat_device = {
154 .cs_en = bu21013_gpio_board_init, 89 .touch_pin = TOUCH_GPIO_PIN,
155 .cs_dis = bu21013_gpio_board_exit,
156 .irq_read_val = bu21013_read_pin_val,
157 .irq = NOMADIK_GPIO_TO_IRQ(TOUCH_GPIO_PIN),
158 .touch_x_max = TOUCH_XMAX, 90 .touch_x_max = TOUCH_XMAX,
159 .touch_y_max = TOUCH_YMAX, 91 .touch_y_max = TOUCH_YMAX,
160 .ext_clk = false, 92 .ext_clk = false,
@@ -171,7 +103,6 @@ static struct i2c_board_info __initdata u8500_i2c3_devices_stuib[] = {
171 I2C_BOARD_INFO("bu21013_tp", 0x5D), 103 I2C_BOARD_INFO("bu21013_tp", 0x5D),
172 .platform_data = &tsc_plat_device, 104 .platform_data = &tsc_plat_device,
173 }, 105 },
174
175}; 106};
176 107
177void __init mop500_stuib_init(void) 108void __init mop500_stuib_init(void)
diff --git a/drivers/input/gameport/emu10k1-gp.c b/drivers/input/gameport/emu10k1-gp.c
index daceafe7ee7d..fa7a95c1da0e 100644
--- a/drivers/input/gameport/emu10k1-gp.c
+++ b/drivers/input/gameport/emu10k1-gp.c
@@ -57,7 +57,7 @@ static const struct pci_device_id emu_tbl[] = {
57 57
58MODULE_DEVICE_TABLE(pci, emu_tbl); 58MODULE_DEVICE_TABLE(pci, emu_tbl);
59 59
60static int __devinit emu_probe(struct pci_dev *pdev, const struct pci_device_id *ent) 60static int emu_probe(struct pci_dev *pdev, const struct pci_device_id *ent)
61{ 61{
62 struct emu *emu; 62 struct emu *emu;
63 struct gameport *port; 63 struct gameport *port;
@@ -107,7 +107,7 @@ static int __devinit emu_probe(struct pci_dev *pdev, const struct pci_device_id
107 return error; 107 return error;
108} 108}
109 109
110static void __devexit emu_remove(struct pci_dev *pdev) 110static void emu_remove(struct pci_dev *pdev)
111{ 111{
112 struct emu *emu = pci_get_drvdata(pdev); 112 struct emu *emu = pci_get_drvdata(pdev);
113 113
@@ -122,7 +122,7 @@ static struct pci_driver emu_driver = {
122 .name = "Emu10k1_gameport", 122 .name = "Emu10k1_gameport",
123 .id_table = emu_tbl, 123 .id_table = emu_tbl,
124 .probe = emu_probe, 124 .probe = emu_probe,
125 .remove = __devexit_p(emu_remove), 125 .remove = emu_remove,
126}; 126};
127 127
128module_pci_driver(emu_driver); 128module_pci_driver(emu_driver);
diff --git a/drivers/input/gameport/fm801-gp.c b/drivers/input/gameport/fm801-gp.c
index 48ad3829ff20..ae912d3aee4e 100644
--- a/drivers/input/gameport/fm801-gp.c
+++ b/drivers/input/gameport/fm801-gp.c
@@ -78,7 +78,7 @@ static int fm801_gp_open(struct gameport *gameport, int mode)
78 return 0; 78 return 0;
79} 79}
80 80
81static int __devinit fm801_gp_probe(struct pci_dev *pci, const struct pci_device_id *id) 81static int fm801_gp_probe(struct pci_dev *pci, const struct pci_device_id *id)
82{ 82{
83 struct fm801_gp *gp; 83 struct fm801_gp *gp;
84 struct gameport *port; 84 struct gameport *port;
@@ -129,7 +129,7 @@ static int __devinit fm801_gp_probe(struct pci_dev *pci, const struct pci_device
129 return error; 129 return error;
130} 130}
131 131
132static void __devexit fm801_gp_remove(struct pci_dev *pci) 132static void fm801_gp_remove(struct pci_dev *pci)
133{ 133{
134 struct fm801_gp *gp = pci_get_drvdata(pci); 134 struct fm801_gp *gp = pci_get_drvdata(pci);
135 135
@@ -150,7 +150,7 @@ static struct pci_driver fm801_gp_driver = {
150 .name = "FM801_gameport", 150 .name = "FM801_gameport",
151 .id_table = fm801_gp_id_table, 151 .id_table = fm801_gp_id_table,
152 .probe = fm801_gp_probe, 152 .probe = fm801_gp_probe,
153 .remove = __devexit_p(fm801_gp_remove), 153 .remove = fm801_gp_remove,
154}; 154};
155 155
156module_pci_driver(fm801_gp_driver); 156module_pci_driver(fm801_gp_driver);
diff --git a/drivers/input/input-mt.c b/drivers/input/input-mt.c
index 8c4b50fd9a79..47a6009dbf43 100644
--- a/drivers/input/input-mt.c
+++ b/drivers/input/input-mt.c
@@ -194,7 +194,7 @@ void input_mt_report_pointer_emulation(struct input_dev *dev, bool use_count)
194 if (!mt) 194 if (!mt)
195 return; 195 return;
196 196
197 oldest = 0; 197 oldest = NULL;
198 oldid = mt->trkid; 198 oldid = mt->trkid;
199 count = 0; 199 count = 0;
200 200
diff --git a/drivers/input/input.c b/drivers/input/input.c
index 53a0ddee7872..ce01332f7b3a 100644
--- a/drivers/input/input.c
+++ b/drivers/input/input.c
@@ -534,8 +534,11 @@ EXPORT_SYMBOL(input_grab_device);
534static void __input_release_device(struct input_handle *handle) 534static void __input_release_device(struct input_handle *handle)
535{ 535{
536 struct input_dev *dev = handle->dev; 536 struct input_dev *dev = handle->dev;
537 struct input_handle *grabber;
537 538
538 if (dev->grab == handle) { 539 grabber = rcu_dereference_protected(dev->grab,
540 lockdep_is_held(&dev->mutex));
541 if (grabber == handle) {
539 rcu_assign_pointer(dev->grab, NULL); 542 rcu_assign_pointer(dev->grab, NULL);
540 /* Make sure input_pass_event() notices that grab is gone */ 543 /* Make sure input_pass_event() notices that grab is gone */
541 synchronize_rcu(); 544 synchronize_rcu();
@@ -1723,7 +1726,7 @@ EXPORT_SYMBOL_GPL(input_class);
1723/** 1726/**
1724 * input_allocate_device - allocate memory for new input device 1727 * input_allocate_device - allocate memory for new input device
1725 * 1728 *
1726 * Returns prepared struct input_dev or NULL. 1729 * Returns prepared struct input_dev or %NULL.
1727 * 1730 *
1728 * NOTE: Use input_free_device() to free devices that have not been 1731 * NOTE: Use input_free_device() to free devices that have not been
1729 * registered; input_unregister_device() should be used for already 1732 * registered; input_unregister_device() should be used for already
@@ -1750,6 +1753,70 @@ struct input_dev *input_allocate_device(void)
1750} 1753}
1751EXPORT_SYMBOL(input_allocate_device); 1754EXPORT_SYMBOL(input_allocate_device);
1752 1755
1756struct input_devres {
1757 struct input_dev *input;
1758};
1759
1760static int devm_input_device_match(struct device *dev, void *res, void *data)
1761{
1762 struct input_devres *devres = res;
1763
1764 return devres->input == data;
1765}
1766
1767static void devm_input_device_release(struct device *dev, void *res)
1768{
1769 struct input_devres *devres = res;
1770 struct input_dev *input = devres->input;
1771
1772 dev_dbg(dev, "%s: dropping reference to %s\n",
1773 __func__, dev_name(&input->dev));
1774 input_put_device(input);
1775}
1776
1777/**
1778 * devm_input_allocate_device - allocate managed input device
1779 * @dev: device owning the input device being created
1780 *
1781 * Returns prepared struct input_dev or %NULL.
1782 *
1783 * Managed input devices do not need to be explicitly unregistered or
1784 * freed as it will be done automatically when owner device unbinds from
1785 * its driver (or binding fails). Once managed input device is allocated,
1786 * it is ready to be set up and registered in the same fashion as regular
1787 * input device. There are no special devm_input_device_[un]register()
1788 * variants, regular ones work with both managed and unmanaged devices.
1789 *
1790 * NOTE: the owner device is set up as parent of input device and users
1791 * should not override it.
1792 */
1793
1794struct input_dev *devm_input_allocate_device(struct device *dev)
1795{
1796 struct input_dev *input;
1797 struct input_devres *devres;
1798
1799 devres = devres_alloc(devm_input_device_release,
1800 sizeof(struct input_devres), GFP_KERNEL);
1801 if (!devres)
1802 return NULL;
1803
1804 input = input_allocate_device();
1805 if (!input) {
1806 devres_free(devres);
1807 return NULL;
1808 }
1809
1810 input->dev.parent = dev;
1811 input->devres_managed = true;
1812
1813 devres->input = input;
1814 devres_add(dev, devres);
1815
1816 return input;
1817}
1818EXPORT_SYMBOL(devm_input_allocate_device);
1819
1753/** 1820/**
1754 * input_free_device - free memory occupied by input_dev structure 1821 * input_free_device - free memory occupied by input_dev structure
1755 * @dev: input device to free 1822 * @dev: input device to free
@@ -1766,8 +1833,14 @@ EXPORT_SYMBOL(input_allocate_device);
1766 */ 1833 */
1767void input_free_device(struct input_dev *dev) 1834void input_free_device(struct input_dev *dev)
1768{ 1835{
1769 if (dev) 1836 if (dev) {
1837 if (dev->devres_managed)
1838 WARN_ON(devres_destroy(dev->dev.parent,
1839 devm_input_device_release,
1840 devm_input_device_match,
1841 dev));
1770 input_put_device(dev); 1842 input_put_device(dev);
1843 }
1771} 1844}
1772EXPORT_SYMBOL(input_free_device); 1845EXPORT_SYMBOL(input_free_device);
1773 1846
@@ -1888,6 +1961,38 @@ static void input_cleanse_bitmasks(struct input_dev *dev)
1888 INPUT_CLEANSE_BITMASK(dev, SW, sw); 1961 INPUT_CLEANSE_BITMASK(dev, SW, sw);
1889} 1962}
1890 1963
1964static void __input_unregister_device(struct input_dev *dev)
1965{
1966 struct input_handle *handle, *next;
1967
1968 input_disconnect_device(dev);
1969
1970 mutex_lock(&input_mutex);
1971
1972 list_for_each_entry_safe(handle, next, &dev->h_list, d_node)
1973 handle->handler->disconnect(handle);
1974 WARN_ON(!list_empty(&dev->h_list));
1975
1976 del_timer_sync(&dev->timer);
1977 list_del_init(&dev->node);
1978
1979 input_wakeup_procfs_readers();
1980
1981 mutex_unlock(&input_mutex);
1982
1983 device_del(&dev->dev);
1984}
1985
1986static void devm_input_device_unregister(struct device *dev, void *res)
1987{
1988 struct input_devres *devres = res;
1989 struct input_dev *input = devres->input;
1990
1991 dev_dbg(dev, "%s: unregistering device %s\n",
1992 __func__, dev_name(&input->dev));
1993 __input_unregister_device(input);
1994}
1995
1891/** 1996/**
1892 * input_register_device - register device with input core 1997 * input_register_device - register device with input core
1893 * @dev: device to be registered 1998 * @dev: device to be registered
@@ -1903,11 +2008,21 @@ static void input_cleanse_bitmasks(struct input_dev *dev)
1903int input_register_device(struct input_dev *dev) 2008int input_register_device(struct input_dev *dev)
1904{ 2009{
1905 static atomic_t input_no = ATOMIC_INIT(0); 2010 static atomic_t input_no = ATOMIC_INIT(0);
2011 struct input_devres *devres = NULL;
1906 struct input_handler *handler; 2012 struct input_handler *handler;
1907 unsigned int packet_size; 2013 unsigned int packet_size;
1908 const char *path; 2014 const char *path;
1909 int error; 2015 int error;
1910 2016
2017 if (dev->devres_managed) {
2018 devres = devres_alloc(devm_input_device_unregister,
2019 sizeof(struct input_devres), GFP_KERNEL);
2020 if (!devres)
2021 return -ENOMEM;
2022
2023 devres->input = dev;
2024 }
2025
1911 /* Every input device generates EV_SYN/SYN_REPORT events. */ 2026 /* Every input device generates EV_SYN/SYN_REPORT events. */
1912 __set_bit(EV_SYN, dev->evbit); 2027 __set_bit(EV_SYN, dev->evbit);
1913 2028
@@ -1923,8 +2038,10 @@ int input_register_device(struct input_dev *dev)
1923 2038
1924 dev->max_vals = max(dev->hint_events_per_packet, packet_size) + 2; 2039 dev->max_vals = max(dev->hint_events_per_packet, packet_size) + 2;
1925 dev->vals = kcalloc(dev->max_vals, sizeof(*dev->vals), GFP_KERNEL); 2040 dev->vals = kcalloc(dev->max_vals, sizeof(*dev->vals), GFP_KERNEL);
1926 if (!dev->vals) 2041 if (!dev->vals) {
1927 return -ENOMEM; 2042 error = -ENOMEM;
2043 goto err_devres_free;
2044 }
1928 2045
1929 /* 2046 /*
1930 * If delay and period are pre-set by the driver, then autorepeating 2047 * If delay and period are pre-set by the driver, then autorepeating
@@ -1949,7 +2066,7 @@ int input_register_device(struct input_dev *dev)
1949 2066
1950 error = device_add(&dev->dev); 2067 error = device_add(&dev->dev);
1951 if (error) 2068 if (error)
1952 return error; 2069 goto err_free_vals;
1953 2070
1954 path = kobject_get_path(&dev->dev.kobj, GFP_KERNEL); 2071 path = kobject_get_path(&dev->dev.kobj, GFP_KERNEL);
1955 pr_info("%s as %s\n", 2072 pr_info("%s as %s\n",
@@ -1958,10 +2075,8 @@ int input_register_device(struct input_dev *dev)
1958 kfree(path); 2075 kfree(path);
1959 2076
1960 error = mutex_lock_interruptible(&input_mutex); 2077 error = mutex_lock_interruptible(&input_mutex);
1961 if (error) { 2078 if (error)
1962 device_del(&dev->dev); 2079 goto err_device_del;
1963 return error;
1964 }
1965 2080
1966 list_add_tail(&dev->node, &input_dev_list); 2081 list_add_tail(&dev->node, &input_dev_list);
1967 2082
@@ -1972,7 +2087,21 @@ int input_register_device(struct input_dev *dev)
1972 2087
1973 mutex_unlock(&input_mutex); 2088 mutex_unlock(&input_mutex);
1974 2089
2090 if (dev->devres_managed) {
2091 dev_dbg(dev->dev.parent, "%s: registering %s with devres.\n",
2092 __func__, dev_name(&dev->dev));
2093 devres_add(dev->dev.parent, devres);
2094 }
1975 return 0; 2095 return 0;
2096
2097err_device_del:
2098 device_del(&dev->dev);
2099err_free_vals:
2100 kfree(dev->vals);
2101 dev->vals = NULL;
2102err_devres_free:
2103 devres_free(devres);
2104 return error;
1976} 2105}
1977EXPORT_SYMBOL(input_register_device); 2106EXPORT_SYMBOL(input_register_device);
1978 2107
@@ -1985,24 +2114,20 @@ EXPORT_SYMBOL(input_register_device);
1985 */ 2114 */
1986void input_unregister_device(struct input_dev *dev) 2115void input_unregister_device(struct input_dev *dev)
1987{ 2116{
1988 struct input_handle *handle, *next; 2117 if (dev->devres_managed) {
1989 2118 WARN_ON(devres_destroy(dev->dev.parent,
1990 input_disconnect_device(dev); 2119 devm_input_device_unregister,
1991 2120 devm_input_device_match,
1992 mutex_lock(&input_mutex); 2121 dev));
1993 2122 __input_unregister_device(dev);
1994 list_for_each_entry_safe(handle, next, &dev->h_list, d_node) 2123 /*
1995 handle->handler->disconnect(handle); 2124 * We do not do input_put_device() here because it will be done
1996 WARN_ON(!list_empty(&dev->h_list)); 2125 * when 2nd devres fires up.
1997 2126 */
1998 del_timer_sync(&dev->timer); 2127 } else {
1999 list_del_init(&dev->node); 2128 __input_unregister_device(dev);
2000 2129 input_put_device(dev);
2001 input_wakeup_procfs_readers(); 2130 }
2002
2003 mutex_unlock(&input_mutex);
2004
2005 device_unregister(&dev->dev);
2006} 2131}
2007EXPORT_SYMBOL(input_unregister_device); 2132EXPORT_SYMBOL(input_unregister_device);
2008 2133
diff --git a/drivers/input/joystick/as5011.c b/drivers/input/joystick/as5011.c
index c96653b58867..121cd63d3334 100644
--- a/drivers/input/joystick/as5011.c
+++ b/drivers/input/joystick/as5011.c
@@ -85,7 +85,10 @@ static int as5011_i2c_write(struct i2c_client *client,
85{ 85{
86 uint8_t data[2] = { aregaddr, avalue }; 86 uint8_t data[2] = { aregaddr, avalue };
87 struct i2c_msg msg = { 87 struct i2c_msg msg = {
88 client->addr, I2C_M_IGNORE_NAK, 2, (uint8_t *)data 88 .addr = client->addr,
89 .flags = I2C_M_IGNORE_NAK,
90 .len = 2,
91 .buf = (uint8_t *)data
89 }; 92 };
90 int error; 93 int error;
91 94
@@ -98,8 +101,18 @@ static int as5011_i2c_read(struct i2c_client *client,
98{ 101{
99 uint8_t data[2] = { aregaddr }; 102 uint8_t data[2] = { aregaddr };
100 struct i2c_msg msg_set[2] = { 103 struct i2c_msg msg_set[2] = {
101 { client->addr, I2C_M_REV_DIR_ADDR, 1, (uint8_t *)data }, 104 {
102 { client->addr, I2C_M_RD | I2C_M_NOSTART, 1, (uint8_t *)data } 105 .addr = client->addr,
106 .flags = I2C_M_REV_DIR_ADDR,
107 .len = 1,
108 .buf = (uint8_t *)data
109 },
110 {
111 .addr = client->addr,
112 .flags = I2C_M_RD | I2C_M_NOSTART,
113 .len = 1,
114 .buf = (uint8_t *)data
115 }
103 }; 116 };
104 int error; 117 int error;
105 118
@@ -144,7 +157,7 @@ out:
144 return IRQ_HANDLED; 157 return IRQ_HANDLED;
145} 158}
146 159
147static int __devinit as5011_configure_chip(struct as5011_device *as5011, 160static int as5011_configure_chip(struct as5011_device *as5011,
148 const struct as5011_platform_data *plat_dat) 161 const struct as5011_platform_data *plat_dat)
149{ 162{
150 struct i2c_client *client = as5011->i2c_client; 163 struct i2c_client *client = as5011->i2c_client;
@@ -212,8 +225,8 @@ static int __devinit as5011_configure_chip(struct as5011_device *as5011,
212 return 0; 225 return 0;
213} 226}
214 227
215static int __devinit as5011_probe(struct i2c_client *client, 228static int as5011_probe(struct i2c_client *client,
216 const struct i2c_device_id *id) 229 const struct i2c_device_id *id)
217{ 230{
218 const struct as5011_platform_data *plat_data; 231 const struct as5011_platform_data *plat_data;
219 struct as5011_device *as5011; 232 struct as5011_device *as5011;
@@ -328,7 +341,7 @@ err_free_mem:
328 return error; 341 return error;
329} 342}
330 343
331static int __devexit as5011_remove(struct i2c_client *client) 344static int as5011_remove(struct i2c_client *client)
332{ 345{
333 struct as5011_device *as5011 = i2c_get_clientdata(client); 346 struct as5011_device *as5011 = i2c_get_clientdata(client);
334 347
@@ -353,7 +366,7 @@ static struct i2c_driver as5011_driver = {
353 .name = "as5011", 366 .name = "as5011",
354 }, 367 },
355 .probe = as5011_probe, 368 .probe = as5011_probe,
356 .remove = __devexit_p(as5011_remove), 369 .remove = as5011_remove,
357 .id_table = as5011_id, 370 .id_table = as5011_id,
358}; 371};
359 372
diff --git a/drivers/input/joystick/maplecontrol.c b/drivers/input/joystick/maplecontrol.c
index 77cfde571bd9..59c10ec5a2a1 100644
--- a/drivers/input/joystick/maplecontrol.c
+++ b/drivers/input/joystick/maplecontrol.c
@@ -78,7 +78,7 @@ static void dc_pad_close(struct input_dev *dev)
78} 78}
79 79
80/* allow the controller to be used */ 80/* allow the controller to be used */
81static int __devinit probe_maple_controller(struct device *dev) 81static int probe_maple_controller(struct device *dev)
82{ 82{
83 static const short btn_bit[32] = { 83 static const short btn_bit[32] = {
84 BTN_C, BTN_B, BTN_A, BTN_START, -1, -1, -1, -1, 84 BTN_C, BTN_B, BTN_A, BTN_START, -1, -1, -1, -1,
@@ -157,7 +157,7 @@ fail:
157 return error; 157 return error;
158} 158}
159 159
160static int __devexit remove_maple_controller(struct device *dev) 160static int remove_maple_controller(struct device *dev)
161{ 161{
162 struct maple_device *mdev = to_maple_dev(dev); 162 struct maple_device *mdev = to_maple_dev(dev);
163 struct dc_pad *pad = maple_get_drvdata(mdev); 163 struct dc_pad *pad = maple_get_drvdata(mdev);
@@ -175,7 +175,7 @@ static struct maple_driver dc_pad_driver = {
175 .drv = { 175 .drv = {
176 .name = "Dreamcast_controller", 176 .name = "Dreamcast_controller",
177 .probe = probe_maple_controller, 177 .probe = probe_maple_controller,
178 .remove = __devexit_p(remove_maple_controller), 178 .remove = remove_maple_controller,
179 }, 179 },
180}; 180};
181 181
diff --git a/drivers/input/joystick/walkera0701.c b/drivers/input/joystick/walkera0701.c
index 4dfa1eed4b7c..f8f892b076e8 100644
--- a/drivers/input/joystick/walkera0701.c
+++ b/drivers/input/joystick/walkera0701.c
@@ -196,6 +196,7 @@ static void walkera0701_close(struct input_dev *dev)
196 struct walkera_dev *w = input_get_drvdata(dev); 196 struct walkera_dev *w = input_get_drvdata(dev);
197 197
198 parport_disable_irq(w->parport); 198 parport_disable_irq(w->parport);
199 hrtimer_cancel(&w->timer);
199} 200}
200 201
201static int walkera0701_connect(struct walkera_dev *w, int parport) 202static int walkera0701_connect(struct walkera_dev *w, int parport)
@@ -224,6 +225,9 @@ static int walkera0701_connect(struct walkera_dev *w, int parport)
224 if (parport_claim(w->pardevice)) 225 if (parport_claim(w->pardevice))
225 goto init_err1; 226 goto init_err1;
226 227
228 hrtimer_init(&w->timer, CLOCK_MONOTONIC, HRTIMER_MODE_REL);
229 w->timer.function = timer_handler;
230
227 w->input_dev = input_allocate_device(); 231 w->input_dev = input_allocate_device();
228 if (!w->input_dev) 232 if (!w->input_dev)
229 goto init_err2; 233 goto init_err2;
@@ -254,8 +258,6 @@ static int walkera0701_connect(struct walkera_dev *w, int parport)
254 if (err) 258 if (err)
255 goto init_err3; 259 goto init_err3;
256 260
257 hrtimer_init(&w->timer, CLOCK_MONOTONIC, HRTIMER_MODE_REL);
258 w->timer.function = timer_handler;
259 return 0; 261 return 0;
260 262
261 init_err3: 263 init_err3:
@@ -271,7 +273,6 @@ static int walkera0701_connect(struct walkera_dev *w, int parport)
271 273
272static void walkera0701_disconnect(struct walkera_dev *w) 274static void walkera0701_disconnect(struct walkera_dev *w)
273{ 275{
274 hrtimer_cancel(&w->timer);
275 input_unregister_device(w->input_dev); 276 input_unregister_device(w->input_dev);
276 parport_release(w->pardevice); 277 parport_release(w->pardevice);
277 parport_unregister_device(w->pardevice); 278 parport_unregister_device(w->pardevice);
diff --git a/drivers/input/joystick/xpad.c b/drivers/input/joystick/xpad.c
index 83811e45d633..d6cbfe9df218 100644
--- a/drivers/input/joystick/xpad.c
+++ b/drivers/input/joystick/xpad.c
@@ -118,11 +118,12 @@ static const struct xpad_device {
118 u8 xtype; 118 u8 xtype;
119} xpad_device[] = { 119} xpad_device[] = {
120 { 0x045e, 0x0202, "Microsoft X-Box pad v1 (US)", 0, XTYPE_XBOX }, 120 { 0x045e, 0x0202, "Microsoft X-Box pad v1 (US)", 0, XTYPE_XBOX },
121 { 0x045e, 0x0289, "Microsoft X-Box pad v2 (US)", 0, XTYPE_XBOX },
122 { 0x045e, 0x0285, "Microsoft X-Box pad (Japan)", 0, XTYPE_XBOX }, 121 { 0x045e, 0x0285, "Microsoft X-Box pad (Japan)", 0, XTYPE_XBOX },
123 { 0x045e, 0x0287, "Microsoft Xbox Controller S", 0, XTYPE_XBOX }, 122 { 0x045e, 0x0287, "Microsoft Xbox Controller S", 0, XTYPE_XBOX },
123 { 0x045e, 0x0289, "Microsoft X-Box pad v2 (US)", 0, XTYPE_XBOX },
124 { 0x045e, 0x028e, "Microsoft X-Box 360 pad", 0, XTYPE_XBOX360 },
125 { 0x045e, 0x0291, "Xbox 360 Wireless Receiver (XBOX)", MAP_DPAD_TO_BUTTONS, XTYPE_XBOX360W },
124 { 0x045e, 0x0719, "Xbox 360 Wireless Receiver", MAP_DPAD_TO_BUTTONS, XTYPE_XBOX360W }, 126 { 0x045e, 0x0719, "Xbox 360 Wireless Receiver", MAP_DPAD_TO_BUTTONS, XTYPE_XBOX360W },
125 { 0x0c12, 0x8809, "RedOctane Xbox Dance Pad", DANCEPAD_MAP_CONFIG, XTYPE_XBOX },
126 { 0x044f, 0x0f07, "Thrustmaster, Inc. Controller", 0, XTYPE_XBOX }, 127 { 0x044f, 0x0f07, "Thrustmaster, Inc. Controller", 0, XTYPE_XBOX },
127 { 0x046d, 0xc242, "Logitech Chillstream Controller", 0, XTYPE_XBOX360 }, 128 { 0x046d, 0xc242, "Logitech Chillstream Controller", 0, XTYPE_XBOX360 },
128 { 0x046d, 0xca84, "Logitech Xbox Cordless Controller", 0, XTYPE_XBOX }, 129 { 0x046d, 0xca84, "Logitech Xbox Cordless Controller", 0, XTYPE_XBOX },
@@ -136,9 +137,12 @@ static const struct xpad_device {
136 { 0x0738, 0x4540, "Mad Catz Beat Pad", MAP_DPAD_TO_BUTTONS, XTYPE_XBOX }, 137 { 0x0738, 0x4540, "Mad Catz Beat Pad", MAP_DPAD_TO_BUTTONS, XTYPE_XBOX },
137 { 0x0738, 0x4556, "Mad Catz Lynx Wireless Controller", 0, XTYPE_XBOX }, 138 { 0x0738, 0x4556, "Mad Catz Lynx Wireless Controller", 0, XTYPE_XBOX },
138 { 0x0738, 0x4716, "Mad Catz Wired Xbox 360 Controller", 0, XTYPE_XBOX360 }, 139 { 0x0738, 0x4716, "Mad Catz Wired Xbox 360 Controller", 0, XTYPE_XBOX360 },
140 { 0x0738, 0x4728, "Mad Catz Street Fighter IV FightPad", XTYPE_XBOX360 },
139 { 0x0738, 0x4738, "Mad Catz Wired Xbox 360 Controller (SFIV)", MAP_TRIGGERS_TO_BUTTONS, XTYPE_XBOX360 }, 141 { 0x0738, 0x4738, "Mad Catz Wired Xbox 360 Controller (SFIV)", MAP_TRIGGERS_TO_BUTTONS, XTYPE_XBOX360 },
140 { 0x0738, 0x6040, "Mad Catz Beat Pad Pro", MAP_DPAD_TO_BUTTONS, XTYPE_XBOX }, 142 { 0x0738, 0x6040, "Mad Catz Beat Pad Pro", MAP_DPAD_TO_BUTTONS, XTYPE_XBOX },
143 { 0x0738, 0xbeef, "Mad Catz JOYTECH NEO SE Advanced GamePad", XTYPE_XBOX360 },
141 { 0x0c12, 0x8802, "Zeroplus Xbox Controller", 0, XTYPE_XBOX }, 144 { 0x0c12, 0x8802, "Zeroplus Xbox Controller", 0, XTYPE_XBOX },
145 { 0x0c12, 0x8809, "RedOctane Xbox Dance Pad", DANCEPAD_MAP_CONFIG, XTYPE_XBOX },
142 { 0x0c12, 0x880a, "Pelican Eclipse PL-2023", 0, XTYPE_XBOX }, 146 { 0x0c12, 0x880a, "Pelican Eclipse PL-2023", 0, XTYPE_XBOX },
143 { 0x0c12, 0x8810, "Zeroplus Xbox Controller", 0, XTYPE_XBOX }, 147 { 0x0c12, 0x8810, "Zeroplus Xbox Controller", 0, XTYPE_XBOX },
144 { 0x0c12, 0x9902, "HAMA VibraX - *FAULTY HARDWARE*", 0, XTYPE_XBOX }, 148 { 0x0c12, 0x9902, "HAMA VibraX - *FAULTY HARDWARE*", 0, XTYPE_XBOX },
@@ -148,24 +152,28 @@ static const struct xpad_device {
148 { 0x0e6f, 0x0003, "Logic3 Freebird wireless Controller", 0, XTYPE_XBOX }, 152 { 0x0e6f, 0x0003, "Logic3 Freebird wireless Controller", 0, XTYPE_XBOX },
149 { 0x0e6f, 0x0005, "Eclipse wireless Controller", 0, XTYPE_XBOX }, 153 { 0x0e6f, 0x0005, "Eclipse wireless Controller", 0, XTYPE_XBOX },
150 { 0x0e6f, 0x0006, "Edge wireless Controller", 0, XTYPE_XBOX }, 154 { 0x0e6f, 0x0006, "Edge wireless Controller", 0, XTYPE_XBOX },
151 { 0x0e6f, 0x0006, "Pelican 'TSZ' Wired Xbox 360 Controller", 0, XTYPE_XBOX360 }, 155 { 0x0e6f, 0x0105, "HSM3 Xbox360 dancepad", MAP_DPAD_TO_BUTTONS, XTYPE_XBOX360 },
152 { 0x0e6f, 0x0201, "Pelican PL-3601 'TSZ' Wired Xbox 360 Controller", 0, XTYPE_XBOX360 }, 156 { 0x0e6f, 0x0201, "Pelican PL-3601 'TSZ' Wired Xbox 360 Controller", 0, XTYPE_XBOX360 },
157 { 0x0e6f, 0x0213, "Afterglow Gamepad for Xbox 360", 0, XTYPE_XBOX360 },
153 { 0x0e8f, 0x0201, "SmartJoy Frag Xpad/PS2 adaptor", 0, XTYPE_XBOX }, 158 { 0x0e8f, 0x0201, "SmartJoy Frag Xpad/PS2 adaptor", 0, XTYPE_XBOX },
159 { 0x0f0d, 0x000d, "Hori Fighting Stick EX2", MAP_TRIGGERS_TO_BUTTONS, XTYPE_XBOX360 },
160 { 0x0f0d, 0x0016, "Hori Real Arcade Pro.EX", MAP_TRIGGERS_TO_BUTTONS, XTYPE_XBOX360 },
154 { 0x0f30, 0x0202, "Joytech Advanced Controller", 0, XTYPE_XBOX }, 161 { 0x0f30, 0x0202, "Joytech Advanced Controller", 0, XTYPE_XBOX },
155 { 0x0f30, 0x8888, "BigBen XBMiniPad Controller", 0, XTYPE_XBOX }, 162 { 0x0f30, 0x8888, "BigBen XBMiniPad Controller", 0, XTYPE_XBOX },
156 { 0x102c, 0xff0c, "Joytech Wireless Advanced Controller", 0, XTYPE_XBOX }, 163 { 0x102c, 0xff0c, "Joytech Wireless Advanced Controller", 0, XTYPE_XBOX },
157 { 0x12ab, 0x8809, "Xbox DDR dancepad", MAP_DPAD_TO_BUTTONS, XTYPE_XBOX },
158 { 0x12ab, 0x0004, "Honey Bee Xbox360 dancepad", MAP_DPAD_TO_BUTTONS, XTYPE_XBOX360 }, 164 { 0x12ab, 0x0004, "Honey Bee Xbox360 dancepad", MAP_DPAD_TO_BUTTONS, XTYPE_XBOX360 },
159 { 0x0e6f, 0x0105, "HSM3 Xbox360 dancepad", MAP_DPAD_TO_BUTTONS, XTYPE_XBOX360 }, 165 { 0x12ab, 0x8809, "Xbox DDR dancepad", MAP_DPAD_TO_BUTTONS, XTYPE_XBOX },
160 { 0x1430, 0x4748, "RedOctane Guitar Hero X-plorer", 0, XTYPE_XBOX360 }, 166 { 0x1430, 0x4748, "RedOctane Guitar Hero X-plorer", 0, XTYPE_XBOX360 },
161 { 0x1430, 0x8888, "TX6500+ Dance Pad (first generation)", MAP_DPAD_TO_BUTTONS, XTYPE_XBOX }, 167 { 0x1430, 0x8888, "TX6500+ Dance Pad (first generation)", MAP_DPAD_TO_BUTTONS, XTYPE_XBOX },
162 { 0x146b, 0x0601, "BigBen Interactive XBOX 360 Controller", 0, XTYPE_XBOX360 }, 168 { 0x146b, 0x0601, "BigBen Interactive XBOX 360 Controller", 0, XTYPE_XBOX360 },
163 { 0x045e, 0x028e, "Microsoft X-Box 360 pad", 0, XTYPE_XBOX360 }, 169 { 0x1689, 0xfd00, "Razer Onza Tournament Edition", MAP_DPAD_TO_BUTTONS, XTYPE_XBOX360 },
164 { 0x1bad, 0x0002, "Harmonix Rock Band Guitar", 0, XTYPE_XBOX360 }, 170 { 0x1bad, 0x0002, "Harmonix Rock Band Guitar", 0, XTYPE_XBOX360 },
165 { 0x1bad, 0x0003, "Harmonix Rock Band Drumkit", MAP_DPAD_TO_BUTTONS, XTYPE_XBOX360 }, 171 { 0x1bad, 0x0003, "Harmonix Rock Band Drumkit", MAP_DPAD_TO_BUTTONS, XTYPE_XBOX360 },
166 { 0x0f0d, 0x0016, "Hori Real Arcade Pro.EX", MAP_TRIGGERS_TO_BUTTONS, XTYPE_XBOX360 }, 172 { 0x1bad, 0xf016, "Mad Catz Xbox 360 Controller", 0, XTYPE_XBOX360 },
167 { 0x0f0d, 0x000d, "Hori Fighting Stick EX2", MAP_TRIGGERS_TO_BUTTONS, XTYPE_XBOX360 }, 173 { 0x1bad, 0xf028, "Street Fighter IV FightPad", 0, XTYPE_XBOX360 },
168 { 0x1689, 0xfd00, "Razer Onza Tournament Edition", MAP_DPAD_TO_BUTTONS, XTYPE_XBOX360 }, 174 { 0x1bad, 0xf901, "Gamestop Xbox 360 Controller", 0, XTYPE_XBOX360 },
175 { 0x1bad, 0xf903, "Tron Xbox 360 controller", 0, XTYPE_XBOX360 },
176 { 0x24c6, 0x5300, "PowerA MINI PROEX Controller", 0, XTYPE_XBOX360 },
169 { 0xffff, 0xffff, "Chinese-made Xbox Controller", 0, XTYPE_XBOX }, 177 { 0xffff, 0xffff, "Chinese-made Xbox Controller", 0, XTYPE_XBOX },
170 { 0x0000, 0x0000, "Generic X-Box pad", 0, XTYPE_UNKNOWN } 178 { 0x0000, 0x0000, "Generic X-Box pad", 0, XTYPE_UNKNOWN }
171}; 179};
@@ -235,7 +243,7 @@ static const signed short xpad_abs_triggers[] = {
235 { XPAD_XBOX360_VENDOR_PROTOCOL(vend,1) }, \ 243 { XPAD_XBOX360_VENDOR_PROTOCOL(vend,1) }, \
236 { XPAD_XBOX360_VENDOR_PROTOCOL(vend,129) } 244 { XPAD_XBOX360_VENDOR_PROTOCOL(vend,129) }
237 245
238static struct usb_device_id xpad_table [] = { 246static struct usb_device_id xpad_table[] = {
239 { USB_INTERFACE_INFO('X', 'B', 0) }, /* X-Box USB-IF not approved class */ 247 { USB_INTERFACE_INFO('X', 'B', 0) }, /* X-Box USB-IF not approved class */
240 XPAD_XBOX360_VENDOR(0x045e), /* Microsoft X-Box 360 controllers */ 248 XPAD_XBOX360_VENDOR(0x045e), /* Microsoft X-Box 360 controllers */
241 XPAD_XBOX360_VENDOR(0x046d), /* Logitech X-Box 360 style controllers */ 249 XPAD_XBOX360_VENDOR(0x046d), /* Logitech X-Box 360 style controllers */
@@ -248,10 +256,11 @@ static struct usb_device_id xpad_table [] = {
248 XPAD_XBOX360_VENDOR(0x1bad), /* Harminix Rock Band Guitar and Drums */ 256 XPAD_XBOX360_VENDOR(0x1bad), /* Harminix Rock Band Guitar and Drums */
249 XPAD_XBOX360_VENDOR(0x0f0d), /* Hori Controllers */ 257 XPAD_XBOX360_VENDOR(0x0f0d), /* Hori Controllers */
250 XPAD_XBOX360_VENDOR(0x1689), /* Razer Onza */ 258 XPAD_XBOX360_VENDOR(0x1689), /* Razer Onza */
259 XPAD_XBOX360_VENDOR(0x24c6), /* PowerA Controllers */
251 { } 260 { }
252}; 261};
253 262
254MODULE_DEVICE_TABLE (usb, xpad_table); 263MODULE_DEVICE_TABLE(usb, xpad_table);
255 264
256struct usb_xpad { 265struct usb_xpad {
257 struct input_dev *dev; /* input device interface */ 266 struct input_dev *dev; /* input device interface */
@@ -783,7 +792,7 @@ static int xpad_open(struct input_dev *dev)
783 struct usb_xpad *xpad = input_get_drvdata(dev); 792 struct usb_xpad *xpad = input_get_drvdata(dev);
784 793
785 /* URB was submitted in probe */ 794 /* URB was submitted in probe */
786 if(xpad->xtype == XTYPE_XBOX360W) 795 if (xpad->xtype == XTYPE_XBOX360W)
787 return 0; 796 return 0;
788 797
789 xpad->irq_in->dev = xpad->udev; 798 xpad->irq_in->dev = xpad->udev;
diff --git a/drivers/input/keyboard/Kconfig b/drivers/input/keyboard/Kconfig
index febead4bf8a5..5a240c60342d 100644
--- a/drivers/input/keyboard/Kconfig
+++ b/drivers/input/keyboard/Kconfig
@@ -134,7 +134,7 @@ config KEYBOARD_QT1070
134 134
135config KEYBOARD_QT2160 135config KEYBOARD_QT2160
136 tristate "Atmel AT42QT2160 Touch Sensor Chip" 136 tristate "Atmel AT42QT2160 Touch Sensor Chip"
137 depends on I2C && EXPERIMENTAL 137 depends on I2C
138 help 138 help
139 If you say yes here you get support for Atmel AT42QT2160 Touch 139 If you say yes here you get support for Atmel AT42QT2160 Touch
140 Sensor chip as a keyboard input. 140 Sensor chip as a keyboard input.
diff --git a/drivers/input/keyboard/adp5520-keys.c b/drivers/input/keyboard/adp5520-keys.c
index e9e8674dfda1..ef26b17fb159 100644
--- a/drivers/input/keyboard/adp5520-keys.c
+++ b/drivers/input/keyboard/adp5520-keys.c
@@ -69,7 +69,7 @@ static int adp5520_keys_notifier(struct notifier_block *nb,
69 return 0; 69 return 0;
70} 70}
71 71
72static int __devinit adp5520_keys_probe(struct platform_device *pdev) 72static int adp5520_keys_probe(struct platform_device *pdev)
73{ 73{
74 struct adp5520_keys_platform_data *pdata = pdev->dev.platform_data; 74 struct adp5520_keys_platform_data *pdata = pdev->dev.platform_data;
75 struct input_dev *input; 75 struct input_dev *input;
@@ -182,7 +182,7 @@ err:
182 return ret; 182 return ret;
183} 183}
184 184
185static int __devexit adp5520_keys_remove(struct platform_device *pdev) 185static int adp5520_keys_remove(struct platform_device *pdev)
186{ 186{
187 struct adp5520_keys *dev = platform_get_drvdata(pdev); 187 struct adp5520_keys *dev = platform_get_drvdata(pdev);
188 188
@@ -200,7 +200,7 @@ static struct platform_driver adp5520_keys_driver = {
200 .owner = THIS_MODULE, 200 .owner = THIS_MODULE,
201 }, 201 },
202 .probe = adp5520_keys_probe, 202 .probe = adp5520_keys_probe,
203 .remove = __devexit_p(adp5520_keys_remove), 203 .remove = adp5520_keys_remove,
204}; 204};
205module_platform_driver(adp5520_keys_driver); 205module_platform_driver(adp5520_keys_driver);
206 206
diff --git a/drivers/input/keyboard/adp5588-keys.c b/drivers/input/keyboard/adp5588-keys.c
index b083bf10f139..dbd2047f1641 100644
--- a/drivers/input/keyboard/adp5588-keys.c
+++ b/drivers/input/keyboard/adp5588-keys.c
@@ -145,7 +145,7 @@ static int adp5588_gpio_direction_output(struct gpio_chip *chip,
145 return ret; 145 return ret;
146} 146}
147 147
148static int __devinit adp5588_build_gpiomap(struct adp5588_kpad *kpad, 148static int adp5588_build_gpiomap(struct adp5588_kpad *kpad,
149 const struct adp5588_kpad_platform_data *pdata) 149 const struct adp5588_kpad_platform_data *pdata)
150{ 150{
151 bool pin_used[ADP5588_MAXGPIO]; 151 bool pin_used[ADP5588_MAXGPIO];
@@ -170,7 +170,7 @@ static int __devinit adp5588_build_gpiomap(struct adp5588_kpad *kpad,
170 return n_unused; 170 return n_unused;
171} 171}
172 172
173static int __devinit adp5588_gpio_add(struct adp5588_kpad *kpad) 173static int adp5588_gpio_add(struct adp5588_kpad *kpad)
174{ 174{
175 struct device *dev = &kpad->client->dev; 175 struct device *dev = &kpad->client->dev;
176 const struct adp5588_kpad_platform_data *pdata = dev->platform_data; 176 const struct adp5588_kpad_platform_data *pdata = dev->platform_data;
@@ -224,7 +224,7 @@ static int __devinit adp5588_gpio_add(struct adp5588_kpad *kpad)
224 return 0; 224 return 0;
225} 225}
226 226
227static void __devexit adp5588_gpio_remove(struct adp5588_kpad *kpad) 227static void adp5588_gpio_remove(struct adp5588_kpad *kpad)
228{ 228{
229 struct device *dev = &kpad->client->dev; 229 struct device *dev = &kpad->client->dev;
230 const struct adp5588_kpad_platform_data *pdata = dev->platform_data; 230 const struct adp5588_kpad_platform_data *pdata = dev->platform_data;
@@ -319,7 +319,7 @@ static irqreturn_t adp5588_irq(int irq, void *handle)
319 return IRQ_HANDLED; 319 return IRQ_HANDLED;
320} 320}
321 321
322static int __devinit adp5588_setup(struct i2c_client *client) 322static int adp5588_setup(struct i2c_client *client)
323{ 323{
324 const struct adp5588_kpad_platform_data *pdata = client->dev.platform_data; 324 const struct adp5588_kpad_platform_data *pdata = client->dev.platform_data;
325 const struct adp5588_gpio_platform_data *gpio_data = pdata->gpio_data; 325 const struct adp5588_gpio_platform_data *gpio_data = pdata->gpio_data;
@@ -382,7 +382,7 @@ static int __devinit adp5588_setup(struct i2c_client *client)
382 return 0; 382 return 0;
383} 383}
384 384
385static void __devinit adp5588_report_switch_state(struct adp5588_kpad *kpad) 385static void adp5588_report_switch_state(struct adp5588_kpad *kpad)
386{ 386{
387 int gpi_stat1 = adp5588_read(kpad->client, GPIO_DAT_STAT1); 387 int gpi_stat1 = adp5588_read(kpad->client, GPIO_DAT_STAT1);
388 int gpi_stat2 = adp5588_read(kpad->client, GPIO_DAT_STAT2); 388 int gpi_stat2 = adp5588_read(kpad->client, GPIO_DAT_STAT2);
@@ -420,8 +420,8 @@ static void __devinit adp5588_report_switch_state(struct adp5588_kpad *kpad)
420} 420}
421 421
422 422
423static int __devinit adp5588_probe(struct i2c_client *client, 423static int adp5588_probe(struct i2c_client *client,
424 const struct i2c_device_id *id) 424 const struct i2c_device_id *id)
425{ 425{
426 struct adp5588_kpad *kpad; 426 struct adp5588_kpad *kpad;
427 const struct adp5588_kpad_platform_data *pdata = client->dev.platform_data; 427 const struct adp5588_kpad_platform_data *pdata = client->dev.platform_data;
@@ -587,7 +587,7 @@ static int __devinit adp5588_probe(struct i2c_client *client,
587 return error; 587 return error;
588} 588}
589 589
590static int __devexit adp5588_remove(struct i2c_client *client) 590static int adp5588_remove(struct i2c_client *client)
591{ 591{
592 struct adp5588_kpad *kpad = i2c_get_clientdata(client); 592 struct adp5588_kpad *kpad = i2c_get_clientdata(client);
593 593
@@ -650,7 +650,7 @@ static struct i2c_driver adp5588_driver = {
650#endif 650#endif
651 }, 651 },
652 .probe = adp5588_probe, 652 .probe = adp5588_probe,
653 .remove = __devexit_p(adp5588_remove), 653 .remove = adp5588_remove,
654 .id_table = adp5588_id, 654 .id_table = adp5588_id,
655}; 655};
656 656
diff --git a/drivers/input/keyboard/adp5589-keys.c b/drivers/input/keyboard/adp5589-keys.c
index 74e603213386..67d12b3427c9 100644
--- a/drivers/input/keyboard/adp5589-keys.c
+++ b/drivers/input/keyboard/adp5589-keys.c
@@ -464,7 +464,7 @@ static int adp5589_gpio_direction_output(struct gpio_chip *chip,
464 return ret; 464 return ret;
465} 465}
466 466
467static int __devinit adp5589_build_gpiomap(struct adp5589_kpad *kpad, 467static int adp5589_build_gpiomap(struct adp5589_kpad *kpad,
468 const struct adp5589_kpad_platform_data *pdata) 468 const struct adp5589_kpad_platform_data *pdata)
469{ 469{
470 bool pin_used[ADP5589_MAXGPIO]; 470 bool pin_used[ADP5589_MAXGPIO];
@@ -496,7 +496,7 @@ static int __devinit adp5589_build_gpiomap(struct adp5589_kpad *kpad,
496 return n_unused; 496 return n_unused;
497} 497}
498 498
499static int __devinit adp5589_gpio_add(struct adp5589_kpad *kpad) 499static int adp5589_gpio_add(struct adp5589_kpad *kpad)
500{ 500{
501 struct device *dev = &kpad->client->dev; 501 struct device *dev = &kpad->client->dev;
502 const struct adp5589_kpad_platform_data *pdata = dev->platform_data; 502 const struct adp5589_kpad_platform_data *pdata = dev->platform_data;
@@ -550,7 +550,7 @@ static int __devinit adp5589_gpio_add(struct adp5589_kpad *kpad)
550 return 0; 550 return 0;
551} 551}
552 552
553static void __devexit adp5589_gpio_remove(struct adp5589_kpad *kpad) 553static void adp5589_gpio_remove(struct adp5589_kpad *kpad)
554{ 554{
555 struct device *dev = &kpad->client->dev; 555 struct device *dev = &kpad->client->dev;
556 const struct adp5589_kpad_platform_data *pdata = dev->platform_data; 556 const struct adp5589_kpad_platform_data *pdata = dev->platform_data;
@@ -641,8 +641,7 @@ static irqreturn_t adp5589_irq(int irq, void *handle)
641 return IRQ_HANDLED; 641 return IRQ_HANDLED;
642} 642}
643 643
644static int __devinit adp5589_get_evcode(struct adp5589_kpad *kpad, 644static int adp5589_get_evcode(struct adp5589_kpad *kpad, unsigned short key)
645 unsigned short key)
646{ 645{
647 int i; 646 int i;
648 647
@@ -655,7 +654,7 @@ static int __devinit adp5589_get_evcode(struct adp5589_kpad *kpad,
655 return -EINVAL; 654 return -EINVAL;
656} 655}
657 656
658static int __devinit adp5589_setup(struct adp5589_kpad *kpad) 657static int adp5589_setup(struct adp5589_kpad *kpad)
659{ 658{
660 struct i2c_client *client = kpad->client; 659 struct i2c_client *client = kpad->client;
661 const struct adp5589_kpad_platform_data *pdata = 660 const struct adp5589_kpad_platform_data *pdata =
@@ -820,7 +819,7 @@ static int __devinit adp5589_setup(struct adp5589_kpad *kpad)
820 return 0; 819 return 0;
821} 820}
822 821
823static void __devinit adp5589_report_switch_state(struct adp5589_kpad *kpad) 822static void adp5589_report_switch_state(struct adp5589_kpad *kpad)
824{ 823{
825 int gpi_stat_tmp, pin_loc; 824 int gpi_stat_tmp, pin_loc;
826 int i; 825 int i;
@@ -860,8 +859,8 @@ static void __devinit adp5589_report_switch_state(struct adp5589_kpad *kpad)
860 input_sync(kpad->input); 859 input_sync(kpad->input);
861} 860}
862 861
863static int __devinit adp5589_probe(struct i2c_client *client, 862static int adp5589_probe(struct i2c_client *client,
864 const struct i2c_device_id *id) 863 const struct i2c_device_id *id)
865{ 864{
866 struct adp5589_kpad *kpad; 865 struct adp5589_kpad *kpad;
867 const struct adp5589_kpad_platform_data *pdata = 866 const struct adp5589_kpad_platform_data *pdata =
@@ -1045,7 +1044,7 @@ err_free_mem:
1045 return error; 1044 return error;
1046} 1045}
1047 1046
1048static int __devexit adp5589_remove(struct i2c_client *client) 1047static int adp5589_remove(struct i2c_client *client)
1049{ 1048{
1050 struct adp5589_kpad *kpad = i2c_get_clientdata(client); 1049 struct adp5589_kpad *kpad = i2c_get_clientdata(client);
1051 1050
@@ -1104,7 +1103,7 @@ static struct i2c_driver adp5589_driver = {
1104 .pm = &adp5589_dev_pm_ops, 1103 .pm = &adp5589_dev_pm_ops,
1105 }, 1104 },
1106 .probe = adp5589_probe, 1105 .probe = adp5589_probe,
1107 .remove = __devexit_p(adp5589_remove), 1106 .remove = adp5589_remove,
1108 .id_table = adp5589_id, 1107 .id_table = adp5589_id,
1109}; 1108};
1110 1109
diff --git a/drivers/input/keyboard/bf54x-keys.c b/drivers/input/keyboard/bf54x-keys.c
index 8eb9116e0a5f..20b9fa91fb9e 100644
--- a/drivers/input/keyboard/bf54x-keys.c
+++ b/drivers/input/keyboard/bf54x-keys.c
@@ -177,7 +177,7 @@ static irqreturn_t bfin_kpad_isr(int irq, void *dev_id)
177 return IRQ_HANDLED; 177 return IRQ_HANDLED;
178} 178}
179 179
180static int __devinit bfin_kpad_probe(struct platform_device *pdev) 180static int bfin_kpad_probe(struct platform_device *pdev)
181{ 181{
182 struct bf54x_kpad *bf54x_kpad; 182 struct bf54x_kpad *bf54x_kpad;
183 struct bfin_kpad_platform_data *pdata = pdev->dev.platform_data; 183 struct bfin_kpad_platform_data *pdata = pdev->dev.platform_data;
@@ -331,7 +331,7 @@ out:
331 return error; 331 return error;
332} 332}
333 333
334static int __devexit bfin_kpad_remove(struct platform_device *pdev) 334static int bfin_kpad_remove(struct platform_device *pdev)
335{ 335{
336 struct bfin_kpad_platform_data *pdata = pdev->dev.platform_data; 336 struct bfin_kpad_platform_data *pdata = pdev->dev.platform_data;
337 struct bf54x_kpad *bf54x_kpad = platform_get_drvdata(pdev); 337 struct bf54x_kpad *bf54x_kpad = platform_get_drvdata(pdev);
@@ -390,7 +390,7 @@ static struct platform_driver bfin_kpad_device_driver = {
390 .owner = THIS_MODULE, 390 .owner = THIS_MODULE,
391 }, 391 },
392 .probe = bfin_kpad_probe, 392 .probe = bfin_kpad_probe,
393 .remove = __devexit_p(bfin_kpad_remove), 393 .remove = bfin_kpad_remove,
394 .suspend = bfin_kpad_suspend, 394 .suspend = bfin_kpad_suspend,
395 .resume = bfin_kpad_resume, 395 .resume = bfin_kpad_resume,
396}; 396};
diff --git a/drivers/input/keyboard/davinci_keyscan.c b/drivers/input/keyboard/davinci_keyscan.c
index d5bacbb479b0..4e4e453ea15e 100644
--- a/drivers/input/keyboard/davinci_keyscan.c
+++ b/drivers/input/keyboard/davinci_keyscan.c
@@ -303,7 +303,7 @@ fail1:
303 return error; 303 return error;
304} 304}
305 305
306static int __devexit davinci_ks_remove(struct platform_device *pdev) 306static int davinci_ks_remove(struct platform_device *pdev)
307{ 307{
308 struct davinci_ks *davinci_ks = platform_get_drvdata(pdev); 308 struct davinci_ks *davinci_ks = platform_get_drvdata(pdev);
309 309
@@ -326,7 +326,7 @@ static struct platform_driver davinci_ks_driver = {
326 .name = "davinci_keyscan", 326 .name = "davinci_keyscan",
327 .owner = THIS_MODULE, 327 .owner = THIS_MODULE,
328 }, 328 },
329 .remove = __devexit_p(davinci_ks_remove), 329 .remove = davinci_ks_remove,
330}; 330};
331 331
332static int __init davinci_ks_init(void) 332static int __init davinci_ks_init(void)
diff --git a/drivers/input/keyboard/ep93xx_keypad.c b/drivers/input/keyboard/ep93xx_keypad.c
index 7363402de8d4..9857e8fd0987 100644
--- a/drivers/input/keyboard/ep93xx_keypad.c
+++ b/drivers/input/keyboard/ep93xx_keypad.c
@@ -232,7 +232,7 @@ static int ep93xx_keypad_resume(struct device *dev)
232static SIMPLE_DEV_PM_OPS(ep93xx_keypad_pm_ops, 232static SIMPLE_DEV_PM_OPS(ep93xx_keypad_pm_ops,
233 ep93xx_keypad_suspend, ep93xx_keypad_resume); 233 ep93xx_keypad_suspend, ep93xx_keypad_resume);
234 234
235static int __devinit ep93xx_keypad_probe(struct platform_device *pdev) 235static int ep93xx_keypad_probe(struct platform_device *pdev)
236{ 236{
237 struct ep93xx_keypad *keypad; 237 struct ep93xx_keypad *keypad;
238 const struct matrix_keymap_data *keymap_data; 238 const struct matrix_keymap_data *keymap_data;
@@ -346,7 +346,7 @@ failed_free:
346 return err; 346 return err;
347} 347}
348 348
349static int __devexit ep93xx_keypad_remove(struct platform_device *pdev) 349static int ep93xx_keypad_remove(struct platform_device *pdev)
350{ 350{
351 struct ep93xx_keypad *keypad = platform_get_drvdata(pdev); 351 struct ep93xx_keypad *keypad = platform_get_drvdata(pdev);
352 struct resource *res; 352 struct resource *res;
@@ -380,7 +380,7 @@ static struct platform_driver ep93xx_keypad_driver = {
380 .pm = &ep93xx_keypad_pm_ops, 380 .pm = &ep93xx_keypad_pm_ops,
381 }, 381 },
382 .probe = ep93xx_keypad_probe, 382 .probe = ep93xx_keypad_probe,
383 .remove = __devexit_p(ep93xx_keypad_remove), 383 .remove = ep93xx_keypad_remove,
384}; 384};
385module_platform_driver(ep93xx_keypad_driver); 385module_platform_driver(ep93xx_keypad_driver);
386 386
diff --git a/drivers/input/keyboard/gpio_keys.c b/drivers/input/keyboard/gpio_keys.c
index 6a68041c261d..d327f5a2bb0e 100644
--- a/drivers/input/keyboard/gpio_keys.c
+++ b/drivers/input/keyboard/gpio_keys.c
@@ -423,10 +423,10 @@ out:
423 return IRQ_HANDLED; 423 return IRQ_HANDLED;
424} 424}
425 425
426static int __devinit gpio_keys_setup_key(struct platform_device *pdev, 426static int gpio_keys_setup_key(struct platform_device *pdev,
427 struct input_dev *input, 427 struct input_dev *input,
428 struct gpio_button_data *bdata, 428 struct gpio_button_data *bdata,
429 const struct gpio_keys_button *button) 429 const struct gpio_keys_button *button)
430{ 430{
431 const char *desc = button->desc ? button->desc : "gpio_keys"; 431 const char *desc = button->desc ? button->desc : "gpio_keys";
432 struct device *dev = &pdev->dev; 432 struct device *dev = &pdev->dev;
@@ -440,21 +440,13 @@ static int __devinit gpio_keys_setup_key(struct platform_device *pdev,
440 440
441 if (gpio_is_valid(button->gpio)) { 441 if (gpio_is_valid(button->gpio)) {
442 442
443 error = gpio_request(button->gpio, desc); 443 error = gpio_request_one(button->gpio, GPIOF_IN, desc);
444 if (error < 0) { 444 if (error < 0) {
445 dev_err(dev, "Failed to request GPIO %d, error %d\n", 445 dev_err(dev, "Failed to request GPIO %d, error %d\n",
446 button->gpio, error); 446 button->gpio, error);
447 return error; 447 return error;
448 } 448 }
449 449
450 error = gpio_direction_input(button->gpio);
451 if (error < 0) {
452 dev_err(dev,
453 "Failed to configure direction for GPIO %d, error %d\n",
454 button->gpio, error);
455 goto fail;
456 }
457
458 if (button->debounce_interval) { 450 if (button->debounce_interval) {
459 error = gpio_set_debounce(button->gpio, 451 error = gpio_set_debounce(button->gpio,
460 button->debounce_interval * 1000); 452 button->debounce_interval * 1000);
@@ -526,12 +518,35 @@ fail:
526 return error; 518 return error;
527} 519}
528 520
521static void gpio_keys_report_state(struct gpio_keys_drvdata *ddata)
522{
523 struct input_dev *input = ddata->input;
524 int i;
525
526 for (i = 0; i < ddata->pdata->nbuttons; i++) {
527 struct gpio_button_data *bdata = &ddata->data[i];
528 if (gpio_is_valid(bdata->button->gpio))
529 gpio_keys_gpio_report_event(bdata);
530 }
531 input_sync(input);
532}
533
529static int gpio_keys_open(struct input_dev *input) 534static int gpio_keys_open(struct input_dev *input)
530{ 535{
531 struct gpio_keys_drvdata *ddata = input_get_drvdata(input); 536 struct gpio_keys_drvdata *ddata = input_get_drvdata(input);
532 const struct gpio_keys_platform_data *pdata = ddata->pdata; 537 const struct gpio_keys_platform_data *pdata = ddata->pdata;
538 int error;
539
540 if (pdata->enable) {
541 error = pdata->enable(input->dev.parent);
542 if (error)
543 return error;
544 }
545
546 /* Report current state of buttons that are connected to GPIOs */
547 gpio_keys_report_state(ddata);
533 548
534 return pdata->enable ? pdata->enable(input->dev.parent) : 0; 549 return 0;
535} 550}
536 551
537static void gpio_keys_close(struct input_dev *input) 552static void gpio_keys_close(struct input_dev *input)
@@ -551,7 +566,7 @@ static void gpio_keys_close(struct input_dev *input)
551/* 566/*
552 * Translate OpenFirmware node properties into platform_data 567 * Translate OpenFirmware node properties into platform_data
553 */ 568 */
554static struct gpio_keys_platform_data * __devinit 569static struct gpio_keys_platform_data *
555gpio_keys_get_devtree_pdata(struct device *dev) 570gpio_keys_get_devtree_pdata(struct device *dev)
556{ 571{
557 struct device_node *node, *pp; 572 struct device_node *node, *pp;
@@ -658,7 +673,7 @@ static void gpio_remove_key(struct gpio_button_data *bdata)
658 gpio_free(bdata->button->gpio); 673 gpio_free(bdata->button->gpio);
659} 674}
660 675
661static int __devinit gpio_keys_probe(struct platform_device *pdev) 676static int gpio_keys_probe(struct platform_device *pdev)
662{ 677{
663 struct device *dev = &pdev->dev; 678 struct device *dev = &pdev->dev;
664 const struct gpio_keys_platform_data *pdata = dev_get_platdata(dev); 679 const struct gpio_keys_platform_data *pdata = dev_get_platdata(dev);
@@ -731,14 +746,6 @@ static int __devinit gpio_keys_probe(struct platform_device *pdev)
731 goto fail3; 746 goto fail3;
732 } 747 }
733 748
734 /* get current state of buttons that are connected to GPIOs */
735 for (i = 0; i < pdata->nbuttons; i++) {
736 struct gpio_button_data *bdata = &ddata->data[i];
737 if (gpio_is_valid(bdata->button->gpio))
738 gpio_keys_gpio_report_event(bdata);
739 }
740 input_sync(input);
741
742 device_init_wakeup(&pdev->dev, wakeup); 749 device_init_wakeup(&pdev->dev, wakeup);
743 750
744 return 0; 751 return 0;
@@ -760,7 +767,7 @@ static int __devinit gpio_keys_probe(struct platform_device *pdev)
760 return error; 767 return error;
761} 768}
762 769
763static int __devexit gpio_keys_remove(struct platform_device *pdev) 770static int gpio_keys_remove(struct platform_device *pdev)
764{ 771{
765 struct gpio_keys_drvdata *ddata = platform_get_drvdata(pdev); 772 struct gpio_keys_drvdata *ddata = platform_get_drvdata(pdev);
766 struct input_dev *input = ddata->input; 773 struct input_dev *input = ddata->input;
@@ -788,6 +795,7 @@ static int __devexit gpio_keys_remove(struct platform_device *pdev)
788static int gpio_keys_suspend(struct device *dev) 795static int gpio_keys_suspend(struct device *dev)
789{ 796{
790 struct gpio_keys_drvdata *ddata = dev_get_drvdata(dev); 797 struct gpio_keys_drvdata *ddata = dev_get_drvdata(dev);
798 struct input_dev *input = ddata->input;
791 int i; 799 int i;
792 800
793 if (device_may_wakeup(dev)) { 801 if (device_may_wakeup(dev)) {
@@ -796,6 +804,11 @@ static int gpio_keys_suspend(struct device *dev)
796 if (bdata->button->wakeup) 804 if (bdata->button->wakeup)
797 enable_irq_wake(bdata->irq); 805 enable_irq_wake(bdata->irq);
798 } 806 }
807 } else {
808 mutex_lock(&input->mutex);
809 if (input->users)
810 gpio_keys_close(input);
811 mutex_unlock(&input->mutex);
799 } 812 }
800 813
801 return 0; 814 return 0;
@@ -804,18 +817,27 @@ static int gpio_keys_suspend(struct device *dev)
804static int gpio_keys_resume(struct device *dev) 817static int gpio_keys_resume(struct device *dev)
805{ 818{
806 struct gpio_keys_drvdata *ddata = dev_get_drvdata(dev); 819 struct gpio_keys_drvdata *ddata = dev_get_drvdata(dev);
820 struct input_dev *input = ddata->input;
821 int error = 0;
807 int i; 822 int i;
808 823
809 for (i = 0; i < ddata->pdata->nbuttons; i++) { 824 if (device_may_wakeup(dev)) {
810 struct gpio_button_data *bdata = &ddata->data[i]; 825 for (i = 0; i < ddata->pdata->nbuttons; i++) {
811 if (bdata->button->wakeup && device_may_wakeup(dev)) 826 struct gpio_button_data *bdata = &ddata->data[i];
812 disable_irq_wake(bdata->irq); 827 if (bdata->button->wakeup)
813 828 disable_irq_wake(bdata->irq);
814 if (gpio_is_valid(bdata->button->gpio)) 829 }
815 gpio_keys_gpio_report_event(bdata); 830 } else {
831 mutex_lock(&input->mutex);
832 if (input->users)
833 error = gpio_keys_open(input);
834 mutex_unlock(&input->mutex);
816 } 835 }
817 input_sync(ddata->input);
818 836
837 if (error)
838 return error;
839
840 gpio_keys_report_state(ddata);
819 return 0; 841 return 0;
820} 842}
821#endif 843#endif
@@ -824,7 +846,7 @@ static SIMPLE_DEV_PM_OPS(gpio_keys_pm_ops, gpio_keys_suspend, gpio_keys_resume);
824 846
825static struct platform_driver gpio_keys_device_driver = { 847static struct platform_driver gpio_keys_device_driver = {
826 .probe = gpio_keys_probe, 848 .probe = gpio_keys_probe,
827 .remove = __devexit_p(gpio_keys_remove), 849 .remove = gpio_keys_remove,
828 .driver = { 850 .driver = {
829 .name = "gpio-keys", 851 .name = "gpio-keys",
830 .owner = THIS_MODULE, 852 .owner = THIS_MODULE,
diff --git a/drivers/input/keyboard/gpio_keys_polled.c b/drivers/input/keyboard/gpio_keys_polled.c
index f2142de789e7..f686fd970553 100644
--- a/drivers/input/keyboard/gpio_keys_polled.c
+++ b/drivers/input/keyboard/gpio_keys_polled.c
@@ -103,8 +103,7 @@ static void gpio_keys_polled_close(struct input_polled_dev *dev)
103} 103}
104 104
105#ifdef CONFIG_OF 105#ifdef CONFIG_OF
106static struct gpio_keys_platform_data * __devinit 106static struct gpio_keys_platform_data *gpio_keys_polled_get_devtree_pdata(struct device *dev)
107gpio_keys_polled_get_devtree_pdata(struct device *dev)
108{ 107{
109 struct device_node *node, *pp; 108 struct device_node *node, *pp;
110 struct gpio_keys_platform_data *pdata; 109 struct gpio_keys_platform_data *pdata;
@@ -196,7 +195,7 @@ gpio_keys_polled_get_devtree_pdata(struct device *dev)
196} 195}
197#endif 196#endif
198 197
199static int __devinit gpio_keys_polled_probe(struct platform_device *pdev) 198static int gpio_keys_polled_probe(struct platform_device *pdev)
200{ 199{
201 struct device *dev = &pdev->dev; 200 struct device *dev = &pdev->dev;
202 const struct gpio_keys_platform_data *pdata = dev_get_platdata(dev); 201 const struct gpio_keys_platform_data *pdata = dev_get_platdata(dev);
@@ -246,7 +245,6 @@ static int __devinit gpio_keys_polled_probe(struct platform_device *pdev)
246 245
247 input = poll_dev->input; 246 input = poll_dev->input;
248 247
249 input->evbit[0] = BIT(EV_KEY);
250 input->name = pdev->name; 248 input->name = pdev->name;
251 input->phys = DRV_NAME"/input0"; 249 input->phys = DRV_NAME"/input0";
252 input->dev.parent = &pdev->dev; 250 input->dev.parent = &pdev->dev;
@@ -256,6 +254,10 @@ static int __devinit gpio_keys_polled_probe(struct platform_device *pdev)
256 input->id.product = 0x0001; 254 input->id.product = 0x0001;
257 input->id.version = 0x0100; 255 input->id.version = 0x0100;
258 256
257 __set_bit(EV_KEY, input->evbit);
258 if (pdata->rep)
259 __set_bit(EV_REP, input->evbit);
260
259 for (i = 0; i < pdata->nbuttons; i++) { 261 for (i = 0; i < pdata->nbuttons; i++) {
260 struct gpio_keys_button *button = &pdata->buttons[i]; 262 struct gpio_keys_button *button = &pdata->buttons[i];
261 struct gpio_keys_button_data *bdata = &bdev->data[i]; 263 struct gpio_keys_button_data *bdata = &bdev->data[i];
@@ -268,22 +270,14 @@ static int __devinit gpio_keys_polled_probe(struct platform_device *pdev)
268 goto err_free_gpio; 270 goto err_free_gpio;
269 } 271 }
270 272
271 error = gpio_request(gpio, 273 error = gpio_request_one(gpio, GPIOF_IN,
272 button->desc ? button->desc : DRV_NAME); 274 button->desc ?: DRV_NAME);
273 if (error) { 275 if (error) {
274 dev_err(dev, "unable to claim gpio %u, err=%d\n", 276 dev_err(dev, "unable to claim gpio %u, err=%d\n",
275 gpio, error); 277 gpio, error);
276 goto err_free_gpio; 278 goto err_free_gpio;
277 } 279 }
278 280
279 error = gpio_direction_input(gpio);
280 if (error) {
281 dev_err(dev,
282 "unable to set direction on gpio %u, err=%d\n",
283 gpio, error);
284 goto err_free_gpio;
285 }
286
287 bdata->can_sleep = gpio_cansleep(gpio); 281 bdata->can_sleep = gpio_cansleep(gpio);
288 bdata->last_state = -1; 282 bdata->last_state = -1;
289 bdata->threshold = DIV_ROUND_UP(button->debounce_interval, 283 bdata->threshold = DIV_ROUND_UP(button->debounce_interval,
@@ -329,7 +323,7 @@ err_free_pdata:
329 return error; 323 return error;
330} 324}
331 325
332static int __devexit gpio_keys_polled_remove(struct platform_device *pdev) 326static int gpio_keys_polled_remove(struct platform_device *pdev)
333{ 327{
334 struct gpio_keys_polled_dev *bdev = platform_get_drvdata(pdev); 328 struct gpio_keys_polled_dev *bdev = platform_get_drvdata(pdev);
335 const struct gpio_keys_platform_data *pdata = bdev->pdata; 329 const struct gpio_keys_platform_data *pdata = bdev->pdata;
@@ -357,7 +351,7 @@ static int __devexit gpio_keys_polled_remove(struct platform_device *pdev)
357 351
358static struct platform_driver gpio_keys_polled_driver = { 352static struct platform_driver gpio_keys_polled_driver = {
359 .probe = gpio_keys_polled_probe, 353 .probe = gpio_keys_polled_probe,
360 .remove = __devexit_p(gpio_keys_polled_remove), 354 .remove = gpio_keys_polled_remove,
361 .driver = { 355 .driver = {
362 .name = DRV_NAME, 356 .name = DRV_NAME,
363 .owner = THIS_MODULE, 357 .owner = THIS_MODULE,
diff --git a/drivers/input/keyboard/hilkbd.c b/drivers/input/keyboard/hilkbd.c
index 5f72440b50c8..198dc07a1be5 100644
--- a/drivers/input/keyboard/hilkbd.c
+++ b/drivers/input/keyboard/hilkbd.c
@@ -200,7 +200,7 @@ static void hil_do(unsigned char cmd, unsigned char *data, unsigned int len)
200 200
201 201
202/* initialize HIL */ 202/* initialize HIL */
203static int __devinit hil_keyb_init(void) 203static int hil_keyb_init(void)
204{ 204{
205 unsigned char c; 205 unsigned char c;
206 unsigned int i, kbid; 206 unsigned int i, kbid;
@@ -286,7 +286,7 @@ err1:
286 return err; 286 return err;
287} 287}
288 288
289static void __devexit hil_keyb_exit(void) 289static void hil_keyb_exit(void)
290{ 290{
291 if (HIL_IRQ) 291 if (HIL_IRQ)
292 free_irq(HIL_IRQ, hil_dev.dev_id); 292 free_irq(HIL_IRQ, hil_dev.dev_id);
@@ -299,7 +299,7 @@ static void __devexit hil_keyb_exit(void)
299} 299}
300 300
301#if defined(CONFIG_PARISC) 301#if defined(CONFIG_PARISC)
302static int __devinit hil_probe_chip(struct parisc_device *dev) 302static int hil_probe_chip(struct parisc_device *dev)
303{ 303{
304 /* Only allow one HIL keyboard */ 304 /* Only allow one HIL keyboard */
305 if (hil_dev.dev) 305 if (hil_dev.dev)
@@ -320,7 +320,7 @@ static int __devinit hil_probe_chip(struct parisc_device *dev)
320 return hil_keyb_init(); 320 return hil_keyb_init();
321} 321}
322 322
323static int __devexit hil_remove_chip(struct parisc_device *dev) 323static int hil_remove_chip(struct parisc_device *dev)
324{ 324{
325 hil_keyb_exit(); 325 hil_keyb_exit();
326 326
@@ -341,7 +341,7 @@ static struct parisc_driver hil_driver = {
341 .name = "hil", 341 .name = "hil",
342 .id_table = hil_tbl, 342 .id_table = hil_tbl,
343 .probe = hil_probe_chip, 343 .probe = hil_probe_chip,
344 .remove = __devexit_p(hil_remove_chip), 344 .remove = hil_remove_chip,
345}; 345};
346 346
347static int __init hil_init(void) 347static int __init hil_init(void)
diff --git a/drivers/input/keyboard/imx_keypad.c b/drivers/input/keyboard/imx_keypad.c
index cdc252612c0b..6d150e3e1f55 100644
--- a/drivers/input/keyboard/imx_keypad.c
+++ b/drivers/input/keyboard/imx_keypad.c
@@ -362,7 +362,8 @@ static void imx_keypad_inhibit(struct imx_keypad *keypad)
362 writew(reg_val, keypad->mmio_base + KPSR); 362 writew(reg_val, keypad->mmio_base + KPSR);
363 363
364 /* Colums as open drain and disable all rows */ 364 /* Colums as open drain and disable all rows */
365 writew(0xff00, keypad->mmio_base + KPCR); 365 reg_val = (keypad->cols_en_mask & 0xff) << 8;
366 writew(reg_val, keypad->mmio_base + KPCR);
366} 367}
367 368
368static void imx_keypad_close(struct input_dev *dev) 369static void imx_keypad_close(struct input_dev *dev)
@@ -413,7 +414,7 @@ open_err:
413 return -EIO; 414 return -EIO;
414} 415}
415 416
416static int __devinit imx_keypad_probe(struct platform_device *pdev) 417static int imx_keypad_probe(struct platform_device *pdev)
417{ 418{
418 const struct matrix_keymap_data *keymap_data = pdev->dev.platform_data; 419 const struct matrix_keymap_data *keymap_data = pdev->dev.platform_data;
419 struct imx_keypad *keypad; 420 struct imx_keypad *keypad;
@@ -554,7 +555,7 @@ failed_rel_mem:
554 return error; 555 return error;
555} 556}
556 557
557static int __devexit imx_keypad_remove(struct platform_device *pdev) 558static int imx_keypad_remove(struct platform_device *pdev)
558{ 559{
559 struct imx_keypad *keypad = platform_get_drvdata(pdev); 560 struct imx_keypad *keypad = platform_get_drvdata(pdev);
560 struct resource *res; 561 struct resource *res;
@@ -632,7 +633,7 @@ static struct platform_driver imx_keypad_driver = {
632 .pm = &imx_kbd_pm_ops, 633 .pm = &imx_kbd_pm_ops,
633 }, 634 },
634 .probe = imx_keypad_probe, 635 .probe = imx_keypad_probe,
635 .remove = __devexit_p(imx_keypad_remove), 636 .remove = imx_keypad_remove,
636}; 637};
637module_platform_driver(imx_keypad_driver); 638module_platform_driver(imx_keypad_driver);
638 639
diff --git a/drivers/input/keyboard/jornada680_kbd.c b/drivers/input/keyboard/jornada680_kbd.c
index 24f3ea01c4d5..74e75a6e8deb 100644
--- a/drivers/input/keyboard/jornada680_kbd.c
+++ b/drivers/input/keyboard/jornada680_kbd.c
@@ -179,7 +179,7 @@ static void jornadakbd680_poll(struct input_polled_dev *dev)
179 memcpy(jornadakbd->old_scan, jornadakbd->new_scan, JORNADA_SCAN_SIZE); 179 memcpy(jornadakbd->old_scan, jornadakbd->new_scan, JORNADA_SCAN_SIZE);
180} 180}
181 181
182static int __devinit jornada680kbd_probe(struct platform_device *pdev) 182static int jornada680kbd_probe(struct platform_device *pdev)
183{ 183{
184 struct jornadakbd *jornadakbd; 184 struct jornadakbd *jornadakbd;
185 struct input_polled_dev *poll_dev; 185 struct input_polled_dev *poll_dev;
@@ -240,7 +240,7 @@ static int __devinit jornada680kbd_probe(struct platform_device *pdev)
240 240
241} 241}
242 242
243static int __devexit jornada680kbd_remove(struct platform_device *pdev) 243static int jornada680kbd_remove(struct platform_device *pdev)
244{ 244{
245 struct jornadakbd *jornadakbd = platform_get_drvdata(pdev); 245 struct jornadakbd *jornadakbd = platform_get_drvdata(pdev);
246 246
@@ -258,7 +258,7 @@ static struct platform_driver jornada680kbd_driver = {
258 .owner = THIS_MODULE, 258 .owner = THIS_MODULE,
259 }, 259 },
260 .probe = jornada680kbd_probe, 260 .probe = jornada680kbd_probe,
261 .remove = __devexit_p(jornada680kbd_remove), 261 .remove = jornada680kbd_remove,
262}; 262};
263module_platform_driver(jornada680kbd_driver); 263module_platform_driver(jornada680kbd_driver);
264 264
diff --git a/drivers/input/keyboard/jornada720_kbd.c b/drivers/input/keyboard/jornada720_kbd.c
index 9d639fa1afbd..5ceef636df2f 100644
--- a/drivers/input/keyboard/jornada720_kbd.c
+++ b/drivers/input/keyboard/jornada720_kbd.c
@@ -94,7 +94,7 @@ static irqreturn_t jornada720_kbd_interrupt(int irq, void *dev_id)
94 return IRQ_HANDLED; 94 return IRQ_HANDLED;
95}; 95};
96 96
97static int __devinit jornada720_kbd_probe(struct platform_device *pdev) 97static int jornada720_kbd_probe(struct platform_device *pdev)
98{ 98{
99 struct jornadakbd *jornadakbd; 99 struct jornadakbd *jornadakbd;
100 struct input_dev *input_dev; 100 struct input_dev *input_dev;
@@ -152,7 +152,7 @@ static int __devinit jornada720_kbd_probe(struct platform_device *pdev)
152 return err; 152 return err;
153}; 153};
154 154
155static int __devexit jornada720_kbd_remove(struct platform_device *pdev) 155static int jornada720_kbd_remove(struct platform_device *pdev)
156{ 156{
157 struct jornadakbd *jornadakbd = platform_get_drvdata(pdev); 157 struct jornadakbd *jornadakbd = platform_get_drvdata(pdev);
158 158
@@ -173,6 +173,6 @@ static struct platform_driver jornada720_kbd_driver = {
173 .owner = THIS_MODULE, 173 .owner = THIS_MODULE,
174 }, 174 },
175 .probe = jornada720_kbd_probe, 175 .probe = jornada720_kbd_probe,
176 .remove = __devexit_p(jornada720_kbd_remove), 176 .remove = jornada720_kbd_remove,
177}; 177};
178module_platform_driver(jornada720_kbd_driver); 178module_platform_driver(jornada720_kbd_driver);
diff --git a/drivers/input/keyboard/lm8323.c b/drivers/input/keyboard/lm8323.c
index 39ac2787e275..93c812662134 100644
--- a/drivers/input/keyboard/lm8323.c
+++ b/drivers/input/keyboard/lm8323.c
@@ -624,7 +624,7 @@ static ssize_t lm8323_set_disable(struct device *dev,
624} 624}
625static DEVICE_ATTR(disable_kp, 0644, lm8323_show_disable, lm8323_set_disable); 625static DEVICE_ATTR(disable_kp, 0644, lm8323_show_disable, lm8323_set_disable);
626 626
627static int __devinit lm8323_probe(struct i2c_client *client, 627static int lm8323_probe(struct i2c_client *client,
628 const struct i2c_device_id *id) 628 const struct i2c_device_id *id)
629{ 629{
630 struct lm8323_platform_data *pdata = client->dev.platform_data; 630 struct lm8323_platform_data *pdata = client->dev.platform_data;
@@ -764,7 +764,7 @@ fail1:
764 return err; 764 return err;
765} 765}
766 766
767static int __devexit lm8323_remove(struct i2c_client *client) 767static int lm8323_remove(struct i2c_client *client)
768{ 768{
769 struct lm8323_chip *lm = i2c_get_clientdata(client); 769 struct lm8323_chip *lm = i2c_get_clientdata(client);
770 int i; 770 int i;
@@ -846,7 +846,7 @@ static struct i2c_driver lm8323_i2c_driver = {
846 .pm = &lm8323_pm_ops, 846 .pm = &lm8323_pm_ops,
847 }, 847 },
848 .probe = lm8323_probe, 848 .probe = lm8323_probe,
849 .remove = __devexit_p(lm8323_remove), 849 .remove = lm8323_remove,
850 .id_table = lm8323_id, 850 .id_table = lm8323_id,
851}; 851};
852MODULE_DEVICE_TABLE(i2c, lm8323_id); 852MODULE_DEVICE_TABLE(i2c, lm8323_id);
diff --git a/drivers/input/keyboard/lm8333.c b/drivers/input/keyboard/lm8333.c
index 081fd9effa8c..5a8ca35dc9af 100644
--- a/drivers/input/keyboard/lm8333.c
+++ b/drivers/input/keyboard/lm8333.c
@@ -128,7 +128,7 @@ static irqreturn_t lm8333_irq_thread(int irq, void *data)
128 return IRQ_HANDLED; 128 return IRQ_HANDLED;
129} 129}
130 130
131static int __devinit lm8333_probe(struct i2c_client *client, 131static int lm8333_probe(struct i2c_client *client,
132 const struct i2c_device_id *id) 132 const struct i2c_device_id *id)
133{ 133{
134 const struct lm8333_platform_data *pdata = client->dev.platform_data; 134 const struct lm8333_platform_data *pdata = client->dev.platform_data;
@@ -202,7 +202,7 @@ static int __devinit lm8333_probe(struct i2c_client *client,
202 return err; 202 return err;
203} 203}
204 204
205static int __devexit lm8333_remove(struct i2c_client *client) 205static int lm8333_remove(struct i2c_client *client)
206{ 206{
207 struct lm8333 *lm8333 = i2c_get_clientdata(client); 207 struct lm8333 *lm8333 = i2c_get_clientdata(client);
208 208
@@ -225,7 +225,7 @@ static struct i2c_driver lm8333_driver = {
225 .owner = THIS_MODULE, 225 .owner = THIS_MODULE,
226 }, 226 },
227 .probe = lm8333_probe, 227 .probe = lm8333_probe,
228 .remove = __devexit_p(lm8333_remove), 228 .remove = lm8333_remove,
229 .id_table = lm8333_id, 229 .id_table = lm8333_id,
230}; 230};
231module_i2c_driver(lm8333_driver); 231module_i2c_driver(lm8333_driver);
diff --git a/drivers/input/keyboard/locomokbd.c b/drivers/input/keyboard/locomokbd.c
index b1ab29861e1c..c94d610b9d78 100644
--- a/drivers/input/keyboard/locomokbd.c
+++ b/drivers/input/keyboard/locomokbd.c
@@ -46,7 +46,7 @@ MODULE_LICENSE("GPL");
46#define KEY_CENTER KEY_F15 46#define KEY_CENTER KEY_F15
47 47
48static const unsigned char 48static const unsigned char
49locomokbd_keycode[LOCOMOKBD_NUMKEYS] __devinitconst = { 49locomokbd_keycode[LOCOMOKBD_NUMKEYS] = {
50 0, KEY_ESC, KEY_ACTIVITY, 0, 0, 0, 0, 0, 0, 0, /* 0 - 9 */ 50 0, KEY_ESC, KEY_ACTIVITY, 0, 0, 0, 0, 0, 0, 0, /* 0 - 9 */
51 0, 0, 0, 0, 0, 0, 0, KEY_MENU, KEY_HOME, KEY_CONTACT, /* 10 - 19 */ 51 0, 0, 0, 0, 0, 0, 0, KEY_MENU, KEY_HOME, KEY_CONTACT, /* 10 - 19 */
52 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, /* 20 - 29 */ 52 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, /* 20 - 29 */
@@ -236,7 +236,7 @@ static void locomokbd_close(struct input_dev *dev)
236 locomo_writel(r, locomokbd->base + LOCOMO_KIC); 236 locomo_writel(r, locomokbd->base + LOCOMO_KIC);
237} 237}
238 238
239static int __devinit locomokbd_probe(struct locomo_dev *dev) 239static int locomokbd_probe(struct locomo_dev *dev)
240{ 240{
241 struct locomokbd *locomokbd; 241 struct locomokbd *locomokbd;
242 struct input_dev *input_dev; 242 struct input_dev *input_dev;
@@ -321,7 +321,7 @@ static int __devinit locomokbd_probe(struct locomo_dev *dev)
321 return err; 321 return err;
322} 322}
323 323
324static int __devexit locomokbd_remove(struct locomo_dev *dev) 324static int locomokbd_remove(struct locomo_dev *dev)
325{ 325{
326 struct locomokbd *locomokbd = locomo_get_drvdata(dev); 326 struct locomokbd *locomokbd = locomo_get_drvdata(dev);
327 327
@@ -345,7 +345,7 @@ static struct locomo_driver keyboard_driver = {
345 }, 345 },
346 .devid = LOCOMO_DEVID_KEYBOARD, 346 .devid = LOCOMO_DEVID_KEYBOARD,
347 .probe = locomokbd_probe, 347 .probe = locomokbd_probe,
348 .remove = __devexit_p(locomokbd_remove), 348 .remove = locomokbd_remove,
349}; 349};
350 350
351static int __init locomokbd_init(void) 351static int __init locomokbd_init(void)
diff --git a/drivers/input/keyboard/lpc32xx-keys.c b/drivers/input/keyboard/lpc32xx-keys.c
index dd786c8a7584..1b8add6cfb9d 100644
--- a/drivers/input/keyboard/lpc32xx-keys.c
+++ b/drivers/input/keyboard/lpc32xx-keys.c
@@ -139,7 +139,7 @@ static void lpc32xx_kscan_close(struct input_dev *dev)
139 clk_disable_unprepare(kscandat->clk); 139 clk_disable_unprepare(kscandat->clk);
140} 140}
141 141
142static int __devinit lpc32xx_parse_dt(struct device *dev, 142static int lpc32xx_parse_dt(struct device *dev,
143 struct lpc32xx_kscan_drv *kscandat) 143 struct lpc32xx_kscan_drv *kscandat)
144{ 144{
145 struct device_node *np = dev->of_node; 145 struct device_node *np = dev->of_node;
@@ -166,7 +166,7 @@ static int __devinit lpc32xx_parse_dt(struct device *dev,
166 return 0; 166 return 0;
167} 167}
168 168
169static int __devinit lpc32xx_kscan_probe(struct platform_device *pdev) 169static int lpc32xx_kscan_probe(struct platform_device *pdev)
170{ 170{
171 struct lpc32xx_kscan_drv *kscandat; 171 struct lpc32xx_kscan_drv *kscandat;
172 struct input_dev *input; 172 struct input_dev *input;
@@ -310,7 +310,7 @@ err_free_mem:
310 return error; 310 return error;
311} 311}
312 312
313static int __devexit lpc32xx_kscan_remove(struct platform_device *pdev) 313static int lpc32xx_kscan_remove(struct platform_device *pdev)
314{ 314{
315 struct lpc32xx_kscan_drv *kscandat = platform_get_drvdata(pdev); 315 struct lpc32xx_kscan_drv *kscandat = platform_get_drvdata(pdev);
316 316
@@ -377,7 +377,7 @@ MODULE_DEVICE_TABLE(of, lpc32xx_kscan_match);
377 377
378static struct platform_driver lpc32xx_kscan_driver = { 378static struct platform_driver lpc32xx_kscan_driver = {
379 .probe = lpc32xx_kscan_probe, 379 .probe = lpc32xx_kscan_probe,
380 .remove = __devexit_p(lpc32xx_kscan_remove), 380 .remove = lpc32xx_kscan_remove,
381 .driver = { 381 .driver = {
382 .name = DRV_NAME, 382 .name = DRV_NAME,
383 .owner = THIS_MODULE, 383 .owner = THIS_MODULE,
diff --git a/drivers/input/keyboard/matrix_keypad.c b/drivers/input/keyboard/matrix_keypad.c
index 18b72372028a..f4ff0dda7597 100644
--- a/drivers/input/keyboard/matrix_keypad.c
+++ b/drivers/input/keyboard/matrix_keypad.c
@@ -23,6 +23,9 @@
23#include <linux/gpio.h> 23#include <linux/gpio.h>
24#include <linux/input/matrix_keypad.h> 24#include <linux/input/matrix_keypad.h>
25#include <linux/slab.h> 25#include <linux/slab.h>
26#include <linux/of.h>
27#include <linux/of_gpio.h>
28#include <linux/of_platform.h>
26 29
27struct matrix_keypad { 30struct matrix_keypad {
28 const struct matrix_keypad_platform_data *pdata; 31 const struct matrix_keypad_platform_data *pdata;
@@ -37,8 +40,6 @@ struct matrix_keypad {
37 bool scan_pending; 40 bool scan_pending;
38 bool stopped; 41 bool stopped;
39 bool gpio_all_disabled; 42 bool gpio_all_disabled;
40
41 unsigned short keycodes[];
42}; 43};
43 44
44/* 45/*
@@ -118,6 +119,7 @@ static void matrix_keypad_scan(struct work_struct *work)
118 struct matrix_keypad *keypad = 119 struct matrix_keypad *keypad =
119 container_of(work, struct matrix_keypad, work.work); 120 container_of(work, struct matrix_keypad, work.work);
120 struct input_dev *input_dev = keypad->input_dev; 121 struct input_dev *input_dev = keypad->input_dev;
122 const unsigned short *keycodes = input_dev->keycode;
121 const struct matrix_keypad_platform_data *pdata = keypad->pdata; 123 const struct matrix_keypad_platform_data *pdata = keypad->pdata;
122 uint32_t new_state[MATRIX_MAX_COLS]; 124 uint32_t new_state[MATRIX_MAX_COLS];
123 int row, col, code; 125 int row, col, code;
@@ -153,7 +155,7 @@ static void matrix_keypad_scan(struct work_struct *work)
153 code = MATRIX_SCAN_CODE(row, col, keypad->row_shift); 155 code = MATRIX_SCAN_CODE(row, col, keypad->row_shift);
154 input_event(input_dev, EV_MSC, MSC_SCAN, code); 156 input_event(input_dev, EV_MSC, MSC_SCAN, code);
155 input_report_key(input_dev, 157 input_report_key(input_dev,
156 keypad->keycodes[code], 158 keycodes[code],
157 new_state[col] & (1 << row)); 159 new_state[col] & (1 << row));
158 } 160 }
159 } 161 }
@@ -299,8 +301,8 @@ static int matrix_keypad_resume(struct device *dev)
299static SIMPLE_DEV_PM_OPS(matrix_keypad_pm_ops, 301static SIMPLE_DEV_PM_OPS(matrix_keypad_pm_ops,
300 matrix_keypad_suspend, matrix_keypad_resume); 302 matrix_keypad_suspend, matrix_keypad_resume);
301 303
302static int __devinit matrix_keypad_init_gpio(struct platform_device *pdev, 304static int matrix_keypad_init_gpio(struct platform_device *pdev,
303 struct matrix_keypad *keypad) 305 struct matrix_keypad *keypad)
304{ 306{
305 const struct matrix_keypad_platform_data *pdata = keypad->pdata; 307 const struct matrix_keypad_platform_data *pdata = keypad->pdata;
306 int i, err; 308 int i, err;
@@ -394,33 +396,95 @@ static void matrix_keypad_free_gpio(struct matrix_keypad *keypad)
394 gpio_free(pdata->col_gpios[i]); 396 gpio_free(pdata->col_gpios[i]);
395} 397}
396 398
397static int __devinit matrix_keypad_probe(struct platform_device *pdev) 399#ifdef CONFIG_OF
400static struct matrix_keypad_platform_data *
401matrix_keypad_parse_dt(struct device *dev)
402{
403 struct matrix_keypad_platform_data *pdata;
404 struct device_node *np = dev->of_node;
405 unsigned int *gpios;
406 int i;
407
408 if (!np) {
409 dev_err(dev, "device lacks DT data\n");
410 return ERR_PTR(-ENODEV);
411 }
412
413 pdata = devm_kzalloc(dev, sizeof(*pdata), GFP_KERNEL);
414 if (!pdata) {
415 dev_err(dev, "could not allocate memory for platform data\n");
416 return ERR_PTR(-ENOMEM);
417 }
418
419 pdata->num_row_gpios = of_gpio_named_count(np, "row-gpios");
420 pdata->num_col_gpios = of_gpio_named_count(np, "col-gpios");
421 if (!pdata->num_row_gpios || !pdata->num_col_gpios) {
422 dev_err(dev, "number of keypad rows/columns not specified\n");
423 return ERR_PTR(-EINVAL);
424 }
425
426 if (of_get_property(np, "linux,no-autorepeat", NULL))
427 pdata->no_autorepeat = true;
428 if (of_get_property(np, "linux,wakeup", NULL))
429 pdata->wakeup = true;
430 if (of_get_property(np, "gpio-activelow", NULL))
431 pdata->active_low = true;
432
433 of_property_read_u32(np, "debounce-delay-ms", &pdata->debounce_ms);
434 of_property_read_u32(np, "col-scan-delay-us",
435 &pdata->col_scan_delay_us);
436
437 gpios = devm_kzalloc(dev,
438 sizeof(unsigned int) *
439 (pdata->num_row_gpios + pdata->num_col_gpios),
440 GFP_KERNEL);
441 if (!gpios) {
442 dev_err(dev, "could not allocate memory for gpios\n");
443 return ERR_PTR(-ENOMEM);
444 }
445
446 for (i = 0; i < pdata->num_row_gpios; i++)
447 gpios[i] = of_get_named_gpio(np, "row-gpios", i);
448
449 for (i = 0; i < pdata->num_col_gpios; i++)
450 gpios[pdata->num_row_gpios + i] =
451 of_get_named_gpio(np, "col-gpios", i);
452
453 pdata->row_gpios = gpios;
454 pdata->col_gpios = &gpios[pdata->num_row_gpios];
455
456 return pdata;
457}
458#else
459static inline struct matrix_keypad_platform_data *
460matrix_keypad_parse_dt(struct device *dev)
461{
462 dev_err(dev, "no platform data defined\n");
463
464 return ERR_PTR(-EINVAL);
465}
466#endif
467
468static int matrix_keypad_probe(struct platform_device *pdev)
398{ 469{
399 const struct matrix_keypad_platform_data *pdata; 470 const struct matrix_keypad_platform_data *pdata;
400 const struct matrix_keymap_data *keymap_data;
401 struct matrix_keypad *keypad; 471 struct matrix_keypad *keypad;
402 struct input_dev *input_dev; 472 struct input_dev *input_dev;
403 unsigned int row_shift;
404 size_t keymap_size;
405 int err; 473 int err;
406 474
407 pdata = pdev->dev.platform_data; 475 pdata = dev_get_platdata(&pdev->dev);
408 if (!pdata) { 476 if (!pdata) {
409 dev_err(&pdev->dev, "no platform data defined\n"); 477 pdata = matrix_keypad_parse_dt(&pdev->dev);
410 return -EINVAL; 478 if (IS_ERR(pdata)) {
411 } 479 dev_err(&pdev->dev, "no platform data defined\n");
412 480 return PTR_ERR(pdata);
413 keymap_data = pdata->keymap_data; 481 }
414 if (!keymap_data) { 482 } else if (!pdata->keymap_data) {
415 dev_err(&pdev->dev, "no keymap data defined\n"); 483 dev_err(&pdev->dev, "no keymap data defined\n");
416 return -EINVAL; 484 return -EINVAL;
417 } 485 }
418 486
419 row_shift = get_count_order(pdata->num_col_gpios); 487 keypad = kzalloc(sizeof(struct matrix_keypad), GFP_KERNEL);
420 keymap_size = (pdata->num_row_gpios << row_shift) *
421 sizeof(keypad->keycodes[0]);
422 keypad = kzalloc(sizeof(struct matrix_keypad) + keymap_size,
423 GFP_KERNEL);
424 input_dev = input_allocate_device(); 488 input_dev = input_allocate_device();
425 if (!keypad || !input_dev) { 489 if (!keypad || !input_dev) {
426 err = -ENOMEM; 490 err = -ENOMEM;
@@ -429,7 +493,7 @@ static int __devinit matrix_keypad_probe(struct platform_device *pdev)
429 493
430 keypad->input_dev = input_dev; 494 keypad->input_dev = input_dev;
431 keypad->pdata = pdata; 495 keypad->pdata = pdata;
432 keypad->row_shift = row_shift; 496 keypad->row_shift = get_count_order(pdata->num_col_gpios);
433 keypad->stopped = true; 497 keypad->stopped = true;
434 INIT_DELAYED_WORK(&keypad->work, matrix_keypad_scan); 498 INIT_DELAYED_WORK(&keypad->work, matrix_keypad_scan);
435 spin_lock_init(&keypad->lock); 499 spin_lock_init(&keypad->lock);
@@ -440,12 +504,14 @@ static int __devinit matrix_keypad_probe(struct platform_device *pdev)
440 input_dev->open = matrix_keypad_start; 504 input_dev->open = matrix_keypad_start;
441 input_dev->close = matrix_keypad_stop; 505 input_dev->close = matrix_keypad_stop;
442 506
443 err = matrix_keypad_build_keymap(keymap_data, NULL, 507 err = matrix_keypad_build_keymap(pdata->keymap_data, NULL,
444 pdata->num_row_gpios, 508 pdata->num_row_gpios,
445 pdata->num_col_gpios, 509 pdata->num_col_gpios,
446 keypad->keycodes, input_dev); 510 NULL, input_dev);
447 if (err) 511 if (err) {
512 dev_err(&pdev->dev, "failed to build keymap\n");
448 goto err_free_mem; 513 goto err_free_mem;
514 }
449 515
450 if (!pdata->no_autorepeat) 516 if (!pdata->no_autorepeat)
451 __set_bit(EV_REP, input_dev->evbit); 517 __set_bit(EV_REP, input_dev->evbit);
@@ -473,7 +539,7 @@ err_free_mem:
473 return err; 539 return err;
474} 540}
475 541
476static int __devexit matrix_keypad_remove(struct platform_device *pdev) 542static int matrix_keypad_remove(struct platform_device *pdev)
477{ 543{
478 struct matrix_keypad *keypad = platform_get_drvdata(pdev); 544 struct matrix_keypad *keypad = platform_get_drvdata(pdev);
479 545
@@ -488,13 +554,22 @@ static int __devexit matrix_keypad_remove(struct platform_device *pdev)
488 return 0; 554 return 0;
489} 555}
490 556
557#ifdef CONFIG_OF
558static const struct of_device_id matrix_keypad_dt_match[] = {
559 { .compatible = "gpio-matrix-keypad" },
560 { }
561};
562MODULE_DEVICE_TABLE(of, matrix_keypad_dt_match);
563#endif
564
491static struct platform_driver matrix_keypad_driver = { 565static struct platform_driver matrix_keypad_driver = {
492 .probe = matrix_keypad_probe, 566 .probe = matrix_keypad_probe,
493 .remove = __devexit_p(matrix_keypad_remove), 567 .remove = matrix_keypad_remove,
494 .driver = { 568 .driver = {
495 .name = "matrix-keypad", 569 .name = "matrix-keypad",
496 .owner = THIS_MODULE, 570 .owner = THIS_MODULE,
497 .pm = &matrix_keypad_pm_ops, 571 .pm = &matrix_keypad_pm_ops,
572 .of_match_table = of_match_ptr(matrix_keypad_dt_match),
498 }, 573 },
499}; 574};
500module_platform_driver(matrix_keypad_driver); 575module_platform_driver(matrix_keypad_driver);
diff --git a/drivers/input/keyboard/max7359_keypad.c b/drivers/input/keyboard/max7359_keypad.c
index 8edada8ae712..7c7af2b01e65 100644
--- a/drivers/input/keyboard/max7359_keypad.c
+++ b/drivers/input/keyboard/max7359_keypad.c
@@ -179,7 +179,7 @@ static void max7359_initialize(struct i2c_client *client)
179 max7359_fall_deepsleep(client); 179 max7359_fall_deepsleep(client);
180} 180}
181 181
182static int __devinit max7359_probe(struct i2c_client *client, 182static int max7359_probe(struct i2c_client *client,
183 const struct i2c_device_id *id) 183 const struct i2c_device_id *id)
184{ 184{
185 const struct matrix_keymap_data *keymap_data = client->dev.platform_data; 185 const struct matrix_keymap_data *keymap_data = client->dev.platform_data;
@@ -260,7 +260,7 @@ failed_free_mem:
260 return error; 260 return error;
261} 261}
262 262
263static int __devexit max7359_remove(struct i2c_client *client) 263static int max7359_remove(struct i2c_client *client)
264{ 264{
265 struct max7359_keypad *keypad = i2c_get_clientdata(client); 265 struct max7359_keypad *keypad = i2c_get_clientdata(client);
266 266
@@ -312,7 +312,7 @@ static struct i2c_driver max7359_i2c_driver = {
312 .pm = &max7359_pm, 312 .pm = &max7359_pm,
313 }, 313 },
314 .probe = max7359_probe, 314 .probe = max7359_probe,
315 .remove = __devexit_p(max7359_remove), 315 .remove = max7359_remove,
316 .id_table = max7359_ids, 316 .id_table = max7359_ids,
317}; 317};
318 318
diff --git a/drivers/input/keyboard/mcs_touchkey.c b/drivers/input/keyboard/mcs_touchkey.c
index 0d77f6c84950..7c236f9c6a51 100644
--- a/drivers/input/keyboard/mcs_touchkey.c
+++ b/drivers/input/keyboard/mcs_touchkey.c
@@ -97,7 +97,7 @@ static irqreturn_t mcs_touchkey_interrupt(int irq, void *dev_id)
97 return IRQ_HANDLED; 97 return IRQ_HANDLED;
98} 98}
99 99
100static int __devinit mcs_touchkey_probe(struct i2c_client *client, 100static int mcs_touchkey_probe(struct i2c_client *client,
101 const struct i2c_device_id *id) 101 const struct i2c_device_id *id)
102{ 102{
103 const struct mcs_platform_data *pdata; 103 const struct mcs_platform_data *pdata;
@@ -200,7 +200,7 @@ err_free_mem:
200 return error; 200 return error;
201} 201}
202 202
203static int __devexit mcs_touchkey_remove(struct i2c_client *client) 203static int mcs_touchkey_remove(struct i2c_client *client)
204{ 204{
205 struct mcs_touchkey_data *data = i2c_get_clientdata(client); 205 struct mcs_touchkey_data *data = i2c_get_clientdata(client);
206 206
@@ -270,7 +270,7 @@ static struct i2c_driver mcs_touchkey_driver = {
270 .pm = &mcs_touchkey_pm_ops, 270 .pm = &mcs_touchkey_pm_ops,
271 }, 271 },
272 .probe = mcs_touchkey_probe, 272 .probe = mcs_touchkey_probe,
273 .remove = __devexit_p(mcs_touchkey_remove), 273 .remove = mcs_touchkey_remove,
274 .shutdown = mcs_touchkey_shutdown, 274 .shutdown = mcs_touchkey_shutdown,
275 .id_table = mcs_touchkey_id, 275 .id_table = mcs_touchkey_id,
276}; 276};
diff --git a/drivers/input/keyboard/mpr121_touchkey.c b/drivers/input/keyboard/mpr121_touchkey.c
index 7613f1cac951..f7f3e9a9fd3f 100644
--- a/drivers/input/keyboard/mpr121_touchkey.c
+++ b/drivers/input/keyboard/mpr121_touchkey.c
@@ -71,7 +71,7 @@ struct mpr121_init_register {
71 u8 val; 71 u8 val;
72}; 72};
73 73
74static const struct mpr121_init_register init_reg_table[] __devinitconst = { 74static const struct mpr121_init_register init_reg_table[] = {
75 { MHD_RISING_ADDR, 0x1 }, 75 { MHD_RISING_ADDR, 0x1 },
76 { NHD_RISING_ADDR, 0x1 }, 76 { NHD_RISING_ADDR, 0x1 },
77 { MHD_FALLING_ADDR, 0x1 }, 77 { MHD_FALLING_ADDR, 0x1 },
@@ -123,7 +123,7 @@ out:
123 return IRQ_HANDLED; 123 return IRQ_HANDLED;
124} 124}
125 125
126static int __devinit mpr121_phys_init(const struct mpr121_platform_data *pdata, 126static int mpr121_phys_init(const struct mpr121_platform_data *pdata,
127 struct mpr121_touchkey *mpr121, 127 struct mpr121_touchkey *mpr121,
128 struct i2c_client *client) 128 struct i2c_client *client)
129{ 129{
@@ -185,8 +185,8 @@ err_i2c_write:
185 return ret; 185 return ret;
186} 186}
187 187
188static int __devinit mpr_touchkey_probe(struct i2c_client *client, 188static int mpr_touchkey_probe(struct i2c_client *client,
189 const struct i2c_device_id *id) 189 const struct i2c_device_id *id)
190{ 190{
191 const struct mpr121_platform_data *pdata = client->dev.platform_data; 191 const struct mpr121_platform_data *pdata = client->dev.platform_data;
192 struct mpr121_touchkey *mpr121; 192 struct mpr121_touchkey *mpr121;
@@ -272,7 +272,7 @@ err_free_mem:
272 return error; 272 return error;
273} 273}
274 274
275static int __devexit mpr_touchkey_remove(struct i2c_client *client) 275static int mpr_touchkey_remove(struct i2c_client *client)
276{ 276{
277 struct mpr121_touchkey *mpr121 = i2c_get_clientdata(client); 277 struct mpr121_touchkey *mpr121 = i2c_get_clientdata(client);
278 278
@@ -327,7 +327,7 @@ static struct i2c_driver mpr_touchkey_driver = {
327 }, 327 },
328 .id_table = mpr121_id, 328 .id_table = mpr121_id,
329 .probe = mpr_touchkey_probe, 329 .probe = mpr_touchkey_probe,
330 .remove = __devexit_p(mpr_touchkey_remove), 330 .remove = mpr_touchkey_remove,
331}; 331};
332 332
333module_i2c_driver(mpr_touchkey_driver); 333module_i2c_driver(mpr_touchkey_driver);
diff --git a/drivers/input/keyboard/nomadik-ske-keypad.c b/drivers/input/keyboard/nomadik-ske-keypad.c
index 49f5fa64e0b1..0e6a8151fee3 100644
--- a/drivers/input/keyboard/nomadik-ske-keypad.c
+++ b/drivers/input/keyboard/nomadik-ske-keypad.c
@@ -67,6 +67,7 @@ struct ske_keypad {
67 const struct ske_keypad_platform_data *board; 67 const struct ske_keypad_platform_data *board;
68 unsigned short keymap[SKE_KPD_NUM_ROWS * SKE_KPD_NUM_COLS]; 68 unsigned short keymap[SKE_KPD_NUM_ROWS * SKE_KPD_NUM_COLS];
69 struct clk *clk; 69 struct clk *clk;
70 struct clk *pclk;
70 spinlock_t ske_keypad_lock; 71 spinlock_t ske_keypad_lock;
71}; 72};
72 73
@@ -271,11 +272,18 @@ static int __init ske_keypad_probe(struct platform_device *pdev)
271 goto err_free_mem_region; 272 goto err_free_mem_region;
272 } 273 }
273 274
275 keypad->pclk = clk_get(&pdev->dev, "apb_pclk");
276 if (IS_ERR(keypad->pclk)) {
277 dev_err(&pdev->dev, "failed to get pclk\n");
278 error = PTR_ERR(keypad->pclk);
279 goto err_iounmap;
280 }
281
274 keypad->clk = clk_get(&pdev->dev, NULL); 282 keypad->clk = clk_get(&pdev->dev, NULL);
275 if (IS_ERR(keypad->clk)) { 283 if (IS_ERR(keypad->clk)) {
276 dev_err(&pdev->dev, "failed to get clk\n"); 284 dev_err(&pdev->dev, "failed to get clk\n");
277 error = PTR_ERR(keypad->clk); 285 error = PTR_ERR(keypad->clk);
278 goto err_iounmap; 286 goto err_pclk;
279 } 287 }
280 288
281 input->id.bustype = BUS_HOST; 289 input->id.bustype = BUS_HOST;
@@ -287,14 +295,25 @@ static int __init ske_keypad_probe(struct platform_device *pdev)
287 keypad->keymap, input); 295 keypad->keymap, input);
288 if (error) { 296 if (error) {
289 dev_err(&pdev->dev, "Failed to build keymap\n"); 297 dev_err(&pdev->dev, "Failed to build keymap\n");
290 goto err_iounmap; 298 goto err_clk;
291 } 299 }
292 300
293 input_set_capability(input, EV_MSC, MSC_SCAN); 301 input_set_capability(input, EV_MSC, MSC_SCAN);
294 if (!plat->no_autorepeat) 302 if (!plat->no_autorepeat)
295 __set_bit(EV_REP, input->evbit); 303 __set_bit(EV_REP, input->evbit);
296 304
297 clk_enable(keypad->clk); 305 error = clk_prepare_enable(keypad->pclk);
306 if (error) {
307 dev_err(&pdev->dev, "Failed to prepare/enable pclk\n");
308 goto err_clk;
309 }
310
311 error = clk_prepare_enable(keypad->clk);
312 if (error) {
313 dev_err(&pdev->dev, "Failed to prepare/enable clk\n");
314 goto err_pclk_disable;
315 }
316
298 317
299 /* go through board initialization helpers */ 318 /* go through board initialization helpers */
300 if (keypad->board->init) 319 if (keypad->board->init)
@@ -330,8 +349,13 @@ static int __init ske_keypad_probe(struct platform_device *pdev)
330err_free_irq: 349err_free_irq:
331 free_irq(keypad->irq, keypad); 350 free_irq(keypad->irq, keypad);
332err_clk_disable: 351err_clk_disable:
333 clk_disable(keypad->clk); 352 clk_disable_unprepare(keypad->clk);
353err_pclk_disable:
354 clk_disable_unprepare(keypad->pclk);
355err_clk:
334 clk_put(keypad->clk); 356 clk_put(keypad->clk);
357err_pclk:
358 clk_put(keypad->pclk);
335err_iounmap: 359err_iounmap:
336 iounmap(keypad->reg_base); 360 iounmap(keypad->reg_base);
337err_free_mem_region: 361err_free_mem_region:
@@ -342,7 +366,7 @@ err_free_mem:
342 return error; 366 return error;
343} 367}
344 368
345static int __devexit ske_keypad_remove(struct platform_device *pdev) 369static int ske_keypad_remove(struct platform_device *pdev)
346{ 370{
347 struct ske_keypad *keypad = platform_get_drvdata(pdev); 371 struct ske_keypad *keypad = platform_get_drvdata(pdev);
348 struct resource *res = platform_get_resource(pdev, IORESOURCE_MEM, 0); 372 struct resource *res = platform_get_resource(pdev, IORESOURCE_MEM, 0);
@@ -351,7 +375,7 @@ static int __devexit ske_keypad_remove(struct platform_device *pdev)
351 375
352 input_unregister_device(keypad->input); 376 input_unregister_device(keypad->input);
353 377
354 clk_disable(keypad->clk); 378 clk_disable_unprepare(keypad->clk);
355 clk_put(keypad->clk); 379 clk_put(keypad->clk);
356 380
357 if (keypad->board->exit) 381 if (keypad->board->exit)
@@ -403,7 +427,7 @@ static struct platform_driver ske_keypad_driver = {
403 .owner = THIS_MODULE, 427 .owner = THIS_MODULE,
404 .pm = &ske_keypad_dev_pm_ops, 428 .pm = &ske_keypad_dev_pm_ops,
405 }, 429 },
406 .remove = __devexit_p(ske_keypad_remove), 430 .remove = ske_keypad_remove,
407}; 431};
408 432
409static int __init ske_keypad_init(void) 433static int __init ske_keypad_init(void)
diff --git a/drivers/input/keyboard/omap-keypad.c b/drivers/input/keyboard/omap-keypad.c
index 4a5fcc8026f5..d0d5226d9cd4 100644
--- a/drivers/input/keyboard/omap-keypad.c
+++ b/drivers/input/keyboard/omap-keypad.c
@@ -244,7 +244,7 @@ static int omap_kp_resume(struct platform_device *dev)
244#define omap_kp_resume NULL 244#define omap_kp_resume NULL
245#endif 245#endif
246 246
247static int __devinit omap_kp_probe(struct platform_device *pdev) 247static int omap_kp_probe(struct platform_device *pdev)
248{ 248{
249 struct omap_kp *omap_kp; 249 struct omap_kp *omap_kp;
250 struct input_dev *input_dev; 250 struct input_dev *input_dev;
@@ -357,7 +357,7 @@ err2:
357 return -EINVAL; 357 return -EINVAL;
358} 358}
359 359
360static int __devexit omap_kp_remove(struct platform_device *pdev) 360static int omap_kp_remove(struct platform_device *pdev)
361{ 361{
362 struct omap_kp *omap_kp = platform_get_drvdata(pdev); 362 struct omap_kp *omap_kp = platform_get_drvdata(pdev);
363 363
@@ -379,7 +379,7 @@ static int __devexit omap_kp_remove(struct platform_device *pdev)
379 379
380static struct platform_driver omap_kp_driver = { 380static struct platform_driver omap_kp_driver = {
381 .probe = omap_kp_probe, 381 .probe = omap_kp_probe,
382 .remove = __devexit_p(omap_kp_remove), 382 .remove = omap_kp_remove,
383 .suspend = omap_kp_suspend, 383 .suspend = omap_kp_suspend,
384 .resume = omap_kp_resume, 384 .resume = omap_kp_resume,
385 .driver = { 385 .driver = {
diff --git a/drivers/input/keyboard/omap4-keypad.c b/drivers/input/keyboard/omap4-keypad.c
index c05f98c41410..e25b022692cd 100644
--- a/drivers/input/keyboard/omap4-keypad.c
+++ b/drivers/input/keyboard/omap4-keypad.c
@@ -211,8 +211,8 @@ static void omap4_keypad_close(struct input_dev *input)
211} 211}
212 212
213#ifdef CONFIG_OF 213#ifdef CONFIG_OF
214static int __devinit omap4_keypad_parse_dt(struct device *dev, 214static int omap4_keypad_parse_dt(struct device *dev,
215 struct omap4_keypad *keypad_data) 215 struct omap4_keypad *keypad_data)
216{ 216{
217 struct device_node *np = dev->of_node; 217 struct device_node *np = dev->of_node;
218 218
@@ -241,7 +241,7 @@ static inline int omap4_keypad_parse_dt(struct device *dev,
241} 241}
242#endif 242#endif
243 243
244static int __devinit omap4_keypad_probe(struct platform_device *pdev) 244static int omap4_keypad_probe(struct platform_device *pdev)
245{ 245{
246 const struct omap4_keypad_platform_data *pdata = 246 const struct omap4_keypad_platform_data *pdata =
247 dev_get_platdata(&pdev->dev); 247 dev_get_platdata(&pdev->dev);
@@ -406,7 +406,7 @@ err_free_keypad:
406 return error; 406 return error;
407} 407}
408 408
409static int __devexit omap4_keypad_remove(struct platform_device *pdev) 409static int omap4_keypad_remove(struct platform_device *pdev)
410{ 410{
411 struct omap4_keypad *keypad_data = platform_get_drvdata(pdev); 411 struct omap4_keypad *keypad_data = platform_get_drvdata(pdev);
412 struct resource *res; 412 struct resource *res;
@@ -440,7 +440,7 @@ MODULE_DEVICE_TABLE(of, omap_keypad_dt_match);
440 440
441static struct platform_driver omap4_keypad_driver = { 441static struct platform_driver omap4_keypad_driver = {
442 .probe = omap4_keypad_probe, 442 .probe = omap4_keypad_probe,
443 .remove = __devexit_p(omap4_keypad_remove), 443 .remove = omap4_keypad_remove,
444 .driver = { 444 .driver = {
445 .name = "omap4-keypad", 445 .name = "omap4-keypad",
446 .owner = THIS_MODULE, 446 .owner = THIS_MODULE,
diff --git a/drivers/input/keyboard/opencores-kbd.c b/drivers/input/keyboard/opencores-kbd.c
index abe728c7b88e..7ac5f174c6f7 100644
--- a/drivers/input/keyboard/opencores-kbd.c
+++ b/drivers/input/keyboard/opencores-kbd.c
@@ -37,7 +37,7 @@ static irqreturn_t opencores_kbd_isr(int irq, void *dev_id)
37 return IRQ_HANDLED; 37 return IRQ_HANDLED;
38} 38}
39 39
40static int __devinit opencores_kbd_probe(struct platform_device *pdev) 40static int opencores_kbd_probe(struct platform_device *pdev)
41{ 41{
42 struct input_dev *input; 42 struct input_dev *input;
43 struct opencores_kbd *opencores_kbd; 43 struct opencores_kbd *opencores_kbd;
@@ -139,7 +139,7 @@ static int __devinit opencores_kbd_probe(struct platform_device *pdev)
139 return error; 139 return error;
140} 140}
141 141
142static int __devexit opencores_kbd_remove(struct platform_device *pdev) 142static int opencores_kbd_remove(struct platform_device *pdev)
143{ 143{
144 struct opencores_kbd *opencores_kbd = platform_get_drvdata(pdev); 144 struct opencores_kbd *opencores_kbd = platform_get_drvdata(pdev);
145 145
@@ -158,7 +158,7 @@ static int __devexit opencores_kbd_remove(struct platform_device *pdev)
158 158
159static struct platform_driver opencores_kbd_device_driver = { 159static struct platform_driver opencores_kbd_device_driver = {
160 .probe = opencores_kbd_probe, 160 .probe = opencores_kbd_probe,
161 .remove = __devexit_p(opencores_kbd_remove), 161 .remove = opencores_kbd_remove,
162 .driver = { 162 .driver = {
163 .name = "opencores-kbd", 163 .name = "opencores-kbd",
164 }, 164 },
diff --git a/drivers/input/keyboard/pmic8xxx-keypad.c b/drivers/input/keyboard/pmic8xxx-keypad.c
index 52c34657d301..74339e139d43 100644
--- a/drivers/input/keyboard/pmic8xxx-keypad.c
+++ b/drivers/input/keyboard/pmic8xxx-keypad.c
@@ -397,7 +397,7 @@ static irqreturn_t pmic8xxx_kp_irq(int irq, void *data)
397 return IRQ_HANDLED; 397 return IRQ_HANDLED;
398} 398}
399 399
400static int __devinit pmic8xxx_kpd_init(struct pmic8xxx_kp *kp) 400static int pmic8xxx_kpd_init(struct pmic8xxx_kp *kp)
401{ 401{
402 int bits, rc, cycles; 402 int bits, rc, cycles;
403 u8 scan_val = 0, ctrl_val = 0; 403 u8 scan_val = 0, ctrl_val = 0;
@@ -447,7 +447,7 @@ static int __devinit pmic8xxx_kpd_init(struct pmic8xxx_kp *kp)
447 447
448} 448}
449 449
450static int __devinit pmic8xxx_kp_config_gpio(int gpio_start, int num_gpios, 450static int pmic8xxx_kp_config_gpio(int gpio_start, int num_gpios,
451 struct pmic8xxx_kp *kp, struct pm_gpio *gpio_config) 451 struct pmic8xxx_kp *kp, struct pm_gpio *gpio_config)
452{ 452{
453 int rc, i; 453 int rc, i;
@@ -518,7 +518,7 @@ static void pmic8xxx_kp_close(struct input_dev *dev)
518 * - set irq edge type. 518 * - set irq edge type.
519 * - enable the keypad controller. 519 * - enable the keypad controller.
520 */ 520 */
521static int __devinit pmic8xxx_kp_probe(struct platform_device *pdev) 521static int pmic8xxx_kp_probe(struct platform_device *pdev)
522{ 522{
523 const struct pm8xxx_keypad_platform_data *pdata = 523 const struct pm8xxx_keypad_platform_data *pdata =
524 dev_get_platdata(&pdev->dev); 524 dev_get_platdata(&pdev->dev);
@@ -712,7 +712,7 @@ err_alloc_device:
712 return rc; 712 return rc;
713} 713}
714 714
715static int __devexit pmic8xxx_kp_remove(struct platform_device *pdev) 715static int pmic8xxx_kp_remove(struct platform_device *pdev)
716{ 716{
717 struct pmic8xxx_kp *kp = platform_get_drvdata(pdev); 717 struct pmic8xxx_kp *kp = platform_get_drvdata(pdev);
718 718
@@ -773,7 +773,7 @@ static SIMPLE_DEV_PM_OPS(pm8xxx_kp_pm_ops,
773 773
774static struct platform_driver pmic8xxx_kp_driver = { 774static struct platform_driver pmic8xxx_kp_driver = {
775 .probe = pmic8xxx_kp_probe, 775 .probe = pmic8xxx_kp_probe,
776 .remove = __devexit_p(pmic8xxx_kp_remove), 776 .remove = pmic8xxx_kp_remove,
777 .driver = { 777 .driver = {
778 .name = PM8XXX_KEYPAD_DEV_NAME, 778 .name = PM8XXX_KEYPAD_DEV_NAME,
779 .owner = THIS_MODULE, 779 .owner = THIS_MODULE,
diff --git a/drivers/input/keyboard/pxa27x_keypad.c b/drivers/input/keyboard/pxa27x_keypad.c
index cad9d5dd5973..5330d8fbf6c0 100644
--- a/drivers/input/keyboard/pxa27x_keypad.c
+++ b/drivers/input/keyboard/pxa27x_keypad.c
@@ -482,7 +482,7 @@ static const struct dev_pm_ops pxa27x_keypad_pm_ops = {
482}; 482};
483#endif 483#endif
484 484
485static int __devinit pxa27x_keypad_probe(struct platform_device *pdev) 485static int pxa27x_keypad_probe(struct platform_device *pdev)
486{ 486{
487 struct pxa27x_keypad_platform_data *pdata = pdev->dev.platform_data; 487 struct pxa27x_keypad_platform_data *pdata = pdev->dev.platform_data;
488 struct pxa27x_keypad *keypad; 488 struct pxa27x_keypad *keypad;
@@ -595,7 +595,7 @@ failed_free:
595 return error; 595 return error;
596} 596}
597 597
598static int __devexit pxa27x_keypad_remove(struct platform_device *pdev) 598static int pxa27x_keypad_remove(struct platform_device *pdev)
599{ 599{
600 struct pxa27x_keypad *keypad = platform_get_drvdata(pdev); 600 struct pxa27x_keypad *keypad = platform_get_drvdata(pdev);
601 struct resource *res; 601 struct resource *res;
@@ -620,7 +620,7 @@ MODULE_ALIAS("platform:pxa27x-keypad");
620 620
621static struct platform_driver pxa27x_keypad_driver = { 621static struct platform_driver pxa27x_keypad_driver = {
622 .probe = pxa27x_keypad_probe, 622 .probe = pxa27x_keypad_probe,
623 .remove = __devexit_p(pxa27x_keypad_remove), 623 .remove = pxa27x_keypad_remove,
624 .driver = { 624 .driver = {
625 .name = "pxa27x-keypad", 625 .name = "pxa27x-keypad",
626 .owner = THIS_MODULE, 626 .owner = THIS_MODULE,
diff --git a/drivers/input/keyboard/pxa930_rotary.c b/drivers/input/keyboard/pxa930_rotary.c
index 41488f9add20..bcad95be73aa 100644
--- a/drivers/input/keyboard/pxa930_rotary.c
+++ b/drivers/input/keyboard/pxa930_rotary.c
@@ -82,7 +82,7 @@ static void pxa930_rotary_close(struct input_dev *dev)
82 clear_sbcr(r); 82 clear_sbcr(r);
83} 83}
84 84
85static int __devinit pxa930_rotary_probe(struct platform_device *pdev) 85static int pxa930_rotary_probe(struct platform_device *pdev)
86{ 86{
87 struct pxa930_rotary_platform_data *pdata = pdev->dev.platform_data; 87 struct pxa930_rotary_platform_data *pdata = pdev->dev.platform_data;
88 struct pxa930_rotary *r; 88 struct pxa930_rotary *r;
@@ -174,7 +174,7 @@ failed_free:
174 return err; 174 return err;
175} 175}
176 176
177static int __devexit pxa930_rotary_remove(struct platform_device *pdev) 177static int pxa930_rotary_remove(struct platform_device *pdev)
178{ 178{
179 struct pxa930_rotary *r = platform_get_drvdata(pdev); 179 struct pxa930_rotary *r = platform_get_drvdata(pdev);
180 180
@@ -193,7 +193,7 @@ static struct platform_driver pxa930_rotary_driver = {
193 .owner = THIS_MODULE, 193 .owner = THIS_MODULE,
194 }, 194 },
195 .probe = pxa930_rotary_probe, 195 .probe = pxa930_rotary_probe,
196 .remove = __devexit_p(pxa930_rotary_remove), 196 .remove = pxa930_rotary_remove,
197}; 197};
198module_platform_driver(pxa930_rotary_driver); 198module_platform_driver(pxa930_rotary_driver);
199 199
diff --git a/drivers/input/keyboard/qt1070.c b/drivers/input/keyboard/qt1070.c
index ca68f2992d72..42b773b3125a 100644
--- a/drivers/input/keyboard/qt1070.c
+++ b/drivers/input/keyboard/qt1070.c
@@ -91,7 +91,7 @@ static int qt1070_write(struct i2c_client *client, u8 reg, u8 data)
91 return ret; 91 return ret;
92} 92}
93 93
94static bool __devinit qt1070_identify(struct i2c_client *client) 94static bool qt1070_identify(struct i2c_client *client)
95{ 95{
96 int id, ver; 96 int id, ver;
97 97
@@ -140,7 +140,7 @@ static irqreturn_t qt1070_interrupt(int irq, void *dev_id)
140 return IRQ_HANDLED; 140 return IRQ_HANDLED;
141} 141}
142 142
143static int __devinit qt1070_probe(struct i2c_client *client, 143static int qt1070_probe(struct i2c_client *client,
144 const struct i2c_device_id *id) 144 const struct i2c_device_id *id)
145{ 145{
146 struct qt1070_data *data; 146 struct qt1070_data *data;
@@ -230,7 +230,7 @@ err_free_mem:
230 return err; 230 return err;
231} 231}
232 232
233static int __devexit qt1070_remove(struct i2c_client *client) 233static int qt1070_remove(struct i2c_client *client)
234{ 234{
235 struct qt1070_data *data = i2c_get_clientdata(client); 235 struct qt1070_data *data = i2c_get_clientdata(client);
236 236
@@ -256,7 +256,7 @@ static struct i2c_driver qt1070_driver = {
256 }, 256 },
257 .id_table = qt1070_id, 257 .id_table = qt1070_id,
258 .probe = qt1070_probe, 258 .probe = qt1070_probe,
259 .remove = __devexit_p(qt1070_remove), 259 .remove = qt1070_remove,
260}; 260};
261 261
262module_i2c_driver(qt1070_driver); 262module_i2c_driver(qt1070_driver);
diff --git a/drivers/input/keyboard/qt2160.c b/drivers/input/keyboard/qt2160.c
index 76b7d430d03a..3dc2b0f27b0c 100644
--- a/drivers/input/keyboard/qt2160.c
+++ b/drivers/input/keyboard/qt2160.c
@@ -183,7 +183,7 @@ static void qt2160_worker(struct work_struct *work)
183 qt2160_schedule_read(qt2160); 183 qt2160_schedule_read(qt2160);
184} 184}
185 185
186static int __devinit qt2160_read(struct i2c_client *client, u8 reg) 186static int qt2160_read(struct i2c_client *client, u8 reg)
187{ 187{
188 int ret; 188 int ret;
189 189
@@ -204,29 +204,20 @@ static int __devinit qt2160_read(struct i2c_client *client, u8 reg)
204 return ret; 204 return ret;
205} 205}
206 206
207static int __devinit qt2160_write(struct i2c_client *client, u8 reg, u8 data) 207static int qt2160_write(struct i2c_client *client, u8 reg, u8 data)
208{ 208{
209 int error; 209 int ret;
210
211 error = i2c_smbus_write_byte(client, reg);
212 if (error) {
213 dev_err(&client->dev,
214 "couldn't send request. Returned %d\n", error);
215 return error;
216 }
217 210
218 error = i2c_smbus_write_byte(client, data); 211 ret = i2c_smbus_write_byte_data(client, reg, data);
219 if (error) { 212 if (ret < 0)
220 dev_err(&client->dev, 213 dev_err(&client->dev,
221 "couldn't write data. Returned %d\n", error); 214 "couldn't write data. Returned %d\n", ret);
222 return error;
223 }
224 215
225 return error; 216 return ret;
226} 217}
227 218
228 219
229static bool __devinit qt2160_identify(struct i2c_client *client) 220static bool qt2160_identify(struct i2c_client *client)
230{ 221{
231 int id, ver, rev; 222 int id, ver, rev;
232 223
@@ -257,7 +248,7 @@ static bool __devinit qt2160_identify(struct i2c_client *client)
257 return true; 248 return true;
258} 249}
259 250
260static int __devinit qt2160_probe(struct i2c_client *client, 251static int qt2160_probe(struct i2c_client *client,
261 const struct i2c_device_id *id) 252 const struct i2c_device_id *id)
262{ 253{
263 struct qt2160_data *qt2160; 254 struct qt2160_data *qt2160;
@@ -344,7 +335,7 @@ err_free_mem:
344 return error; 335 return error;
345} 336}
346 337
347static int __devexit qt2160_remove(struct i2c_client *client) 338static int qt2160_remove(struct i2c_client *client)
348{ 339{
349 struct qt2160_data *qt2160 = i2c_get_clientdata(client); 340 struct qt2160_data *qt2160 = i2c_get_clientdata(client);
350 341
@@ -375,7 +366,7 @@ static struct i2c_driver qt2160_driver = {
375 366
376 .id_table = qt2160_idtable, 367 .id_table = qt2160_idtable,
377 .probe = qt2160_probe, 368 .probe = qt2160_probe,
378 .remove = __devexit_p(qt2160_remove), 369 .remove = qt2160_remove,
379}; 370};
380 371
381module_i2c_driver(qt2160_driver); 372module_i2c_driver(qt2160_driver);
diff --git a/drivers/input/keyboard/samsung-keypad.c b/drivers/input/keyboard/samsung-keypad.c
index 9d7a111486f7..22e357b51024 100644
--- a/drivers/input/keyboard/samsung-keypad.c
+++ b/drivers/input/keyboard/samsung-keypad.c
@@ -309,7 +309,7 @@ static void samsung_keypad_parse_dt_gpio(struct device *dev,
309 struct samsung_keypad *keypad) 309 struct samsung_keypad *keypad)
310{ 310{
311 struct device_node *np = dev->of_node; 311 struct device_node *np = dev->of_node;
312 int gpio, ret, row, col; 312 int gpio, error, row, col;
313 313
314 for (row = 0; row < keypad->rows; row++) { 314 for (row = 0; row < keypad->rows; row++) {
315 gpio = of_get_named_gpio(np, "row-gpios", row); 315 gpio = of_get_named_gpio(np, "row-gpios", row);
@@ -320,10 +320,11 @@ static void samsung_keypad_parse_dt_gpio(struct device *dev,
320 continue; 320 continue;
321 } 321 }
322 322
323 ret = gpio_request(gpio, "keypad-row"); 323 error = devm_gpio_request(dev, gpio, "keypad-row");
324 if (ret) 324 if (error)
325 dev_err(dev, "keypad row[%d] gpio request failed\n", 325 dev_err(dev,
326 row); 326 "keypad row[%d] gpio request failed: %d\n",
327 row, error);
327 } 328 }
328 329
329 for (col = 0; col < keypad->cols; col++) { 330 for (col = 0; col < keypad->cols; col++) {
@@ -335,38 +336,22 @@ static void samsung_keypad_parse_dt_gpio(struct device *dev,
335 continue; 336 continue;
336 } 337 }
337 338
338 ret = gpio_request(gpio, "keypad-col"); 339 error = devm_gpio_request(dev, gpio, "keypad-col");
339 if (ret) 340 if (error)
340 dev_err(dev, "keypad column[%d] gpio request failed\n", 341 dev_err(dev,
341 col); 342 "keypad column[%d] gpio request failed: %d\n",
343 col, error);
342 } 344 }
343} 345}
344
345static void samsung_keypad_dt_gpio_free(struct samsung_keypad *keypad)
346{
347 int cnt;
348
349 for (cnt = 0; cnt < keypad->rows; cnt++)
350 if (gpio_is_valid(keypad->row_gpios[cnt]))
351 gpio_free(keypad->row_gpios[cnt]);
352
353 for (cnt = 0; cnt < keypad->cols; cnt++)
354 if (gpio_is_valid(keypad->col_gpios[cnt]))
355 gpio_free(keypad->col_gpios[cnt]);
356}
357#else 346#else
358static 347static
359struct samsung_keypad_platdata *samsung_keypad_parse_dt(struct device *dev) 348struct samsung_keypad_platdata *samsung_keypad_parse_dt(struct device *dev)
360{ 349{
361 return NULL; 350 return NULL;
362} 351}
363
364static void samsung_keypad_dt_gpio_free(struct samsung_keypad *keypad)
365{
366}
367#endif 352#endif
368 353
369static int __devinit samsung_keypad_probe(struct platform_device *pdev) 354static int samsung_keypad_probe(struct platform_device *pdev)
370{ 355{
371 const struct samsung_keypad_platdata *pdata; 356 const struct samsung_keypad_platdata *pdata;
372 const struct matrix_keymap_data *keymap_data; 357 const struct matrix_keymap_data *keymap_data;
@@ -405,36 +390,30 @@ static int __devinit samsung_keypad_probe(struct platform_device *pdev)
405 row_shift = get_count_order(pdata->cols); 390 row_shift = get_count_order(pdata->cols);
406 keymap_size = (pdata->rows << row_shift) * sizeof(keypad->keycodes[0]); 391 keymap_size = (pdata->rows << row_shift) * sizeof(keypad->keycodes[0]);
407 392
408 keypad = kzalloc(sizeof(*keypad) + keymap_size, GFP_KERNEL); 393 keypad = devm_kzalloc(&pdev->dev, sizeof(*keypad) + keymap_size,
409 input_dev = input_allocate_device(); 394 GFP_KERNEL);
410 if (!keypad || !input_dev) { 395 input_dev = devm_input_allocate_device(&pdev->dev);
411 error = -ENOMEM; 396 if (!keypad || !input_dev)
412 goto err_free_mem; 397 return -ENOMEM;
413 }
414 398
415 res = platform_get_resource(pdev, IORESOURCE_MEM, 0); 399 res = platform_get_resource(pdev, IORESOURCE_MEM, 0);
416 if (!res) { 400 if (!res)
417 error = -ENODEV; 401 return -ENODEV;
418 goto err_free_mem;
419 }
420 402
421 keypad->base = ioremap(res->start, resource_size(res)); 403 keypad->base = devm_ioremap(&pdev->dev, res->start, resource_size(res));
422 if (!keypad->base) { 404 if (!keypad->base)
423 error = -EBUSY; 405 return -EBUSY;
424 goto err_free_mem;
425 }
426 406
427 keypad->clk = clk_get(&pdev->dev, "keypad"); 407 keypad->clk = devm_clk_get(&pdev->dev, "keypad");
428 if (IS_ERR(keypad->clk)) { 408 if (IS_ERR(keypad->clk)) {
429 dev_err(&pdev->dev, "failed to get keypad clk\n"); 409 dev_err(&pdev->dev, "failed to get keypad clk\n");
430 error = PTR_ERR(keypad->clk); 410 return PTR_ERR(keypad->clk);
431 goto err_unmap_base;
432 } 411 }
433 412
434 error = clk_prepare(keypad->clk); 413 error = clk_prepare(keypad->clk);
435 if (error) { 414 if (error) {
436 dev_err(&pdev->dev, "keypad clock prepare failed\n"); 415 dev_err(&pdev->dev, "keypad clock prepare failed\n");
437 goto err_put_clk; 416 return error;
438 } 417 }
439 418
440 keypad->input_dev = input_dev; 419 keypad->input_dev = input_dev;
@@ -479,14 +458,15 @@ static int __devinit samsung_keypad_probe(struct platform_device *pdev)
479 keypad->irq = platform_get_irq(pdev, 0); 458 keypad->irq = platform_get_irq(pdev, 0);
480 if (keypad->irq < 0) { 459 if (keypad->irq < 0) {
481 error = keypad->irq; 460 error = keypad->irq;
482 goto err_put_clk; 461 goto err_unprepare_clk;
483 } 462 }
484 463
485 error = request_threaded_irq(keypad->irq, NULL, samsung_keypad_irq, 464 error = devm_request_threaded_irq(&pdev->dev, keypad->irq, NULL,
486 IRQF_ONESHOT, dev_name(&pdev->dev), keypad); 465 samsung_keypad_irq, IRQF_ONESHOT,
466 dev_name(&pdev->dev), keypad);
487 if (error) { 467 if (error) {
488 dev_err(&pdev->dev, "failed to register keypad interrupt\n"); 468 dev_err(&pdev->dev, "failed to register keypad interrupt\n");
489 goto err_put_clk; 469 goto err_unprepare_clk;
490 } 470 }
491 471
492 device_init_wakeup(&pdev->dev, pdata->wakeup); 472 device_init_wakeup(&pdev->dev, pdata->wakeup);
@@ -495,7 +475,7 @@ static int __devinit samsung_keypad_probe(struct platform_device *pdev)
495 475
496 error = input_register_device(keypad->input_dev); 476 error = input_register_device(keypad->input_dev);
497 if (error) 477 if (error)
498 goto err_free_irq; 478 goto err_disable_runtime_pm;
499 479
500 if (pdev->dev.of_node) { 480 if (pdev->dev.of_node) {
501 devm_kfree(&pdev->dev, (void *)pdata->keymap_data->keymap); 481 devm_kfree(&pdev->dev, (void *)pdata->keymap_data->keymap);
@@ -504,26 +484,16 @@ static int __devinit samsung_keypad_probe(struct platform_device *pdev)
504 } 484 }
505 return 0; 485 return 0;
506 486
507err_free_irq: 487err_disable_runtime_pm:
508 free_irq(keypad->irq, keypad);
509 pm_runtime_disable(&pdev->dev); 488 pm_runtime_disable(&pdev->dev);
510 device_init_wakeup(&pdev->dev, 0); 489 device_init_wakeup(&pdev->dev, 0);
511 platform_set_drvdata(pdev, NULL); 490 platform_set_drvdata(pdev, NULL);
512err_unprepare_clk: 491err_unprepare_clk:
513 clk_unprepare(keypad->clk); 492 clk_unprepare(keypad->clk);
514err_put_clk:
515 clk_put(keypad->clk);
516 samsung_keypad_dt_gpio_free(keypad);
517err_unmap_base:
518 iounmap(keypad->base);
519err_free_mem:
520 input_free_device(input_dev);
521 kfree(keypad);
522
523 return error; 493 return error;
524} 494}
525 495
526static int __devexit samsung_keypad_remove(struct platform_device *pdev) 496static int samsung_keypad_remove(struct platform_device *pdev)
527{ 497{
528 struct samsung_keypad *keypad = platform_get_drvdata(pdev); 498 struct samsung_keypad *keypad = platform_get_drvdata(pdev);
529 499
@@ -533,18 +503,7 @@ static int __devexit samsung_keypad_remove(struct platform_device *pdev)
533 503
534 input_unregister_device(keypad->input_dev); 504 input_unregister_device(keypad->input_dev);
535 505
536 /*
537 * It is safe to free IRQ after unregistering device because
538 * samsung_keypad_close will shut off interrupts.
539 */
540 free_irq(keypad->irq, keypad);
541
542 clk_unprepare(keypad->clk); 506 clk_unprepare(keypad->clk);
543 clk_put(keypad->clk);
544 samsung_keypad_dt_gpio_free(keypad);
545
546 iounmap(keypad->base);
547 kfree(keypad);
548 507
549 return 0; 508 return 0;
550} 509}
@@ -685,7 +644,7 @@ MODULE_DEVICE_TABLE(platform, samsung_keypad_driver_ids);
685 644
686static struct platform_driver samsung_keypad_driver = { 645static struct platform_driver samsung_keypad_driver = {
687 .probe = samsung_keypad_probe, 646 .probe = samsung_keypad_probe,
688 .remove = __devexit_p(samsung_keypad_remove), 647 .remove = samsung_keypad_remove,
689 .driver = { 648 .driver = {
690 .name = "samsung-keypad", 649 .name = "samsung-keypad",
691 .owner = THIS_MODULE, 650 .owner = THIS_MODULE,
diff --git a/drivers/input/keyboard/sh_keysc.c b/drivers/input/keyboard/sh_keysc.c
index da54ad5db154..fdb9eb2df380 100644
--- a/drivers/input/keyboard/sh_keysc.c
+++ b/drivers/input/keyboard/sh_keysc.c
@@ -162,7 +162,7 @@ static irqreturn_t sh_keysc_isr(int irq, void *dev_id)
162 return IRQ_HANDLED; 162 return IRQ_HANDLED;
163} 163}
164 164
165static int __devinit sh_keysc_probe(struct platform_device *pdev) 165static int sh_keysc_probe(struct platform_device *pdev)
166{ 166{
167 struct sh_keysc_priv *priv; 167 struct sh_keysc_priv *priv;
168 struct sh_keysc_info *pdata; 168 struct sh_keysc_info *pdata;
@@ -272,7 +272,7 @@ static int __devinit sh_keysc_probe(struct platform_device *pdev)
272 return error; 272 return error;
273} 273}
274 274
275static int __devexit sh_keysc_remove(struct platform_device *pdev) 275static int sh_keysc_remove(struct platform_device *pdev)
276{ 276{
277 struct sh_keysc_priv *priv = platform_get_drvdata(pdev); 277 struct sh_keysc_priv *priv = platform_get_drvdata(pdev);
278 278
@@ -331,7 +331,7 @@ static SIMPLE_DEV_PM_OPS(sh_keysc_dev_pm_ops,
331 331
332static struct platform_driver sh_keysc_device_driver = { 332static struct platform_driver sh_keysc_device_driver = {
333 .probe = sh_keysc_probe, 333 .probe = sh_keysc_probe,
334 .remove = __devexit_p(sh_keysc_remove), 334 .remove = sh_keysc_remove,
335 .driver = { 335 .driver = {
336 .name = "sh_keysc", 336 .name = "sh_keysc",
337 .pm = &sh_keysc_dev_pm_ops, 337 .pm = &sh_keysc_dev_pm_ops,
diff --git a/drivers/input/keyboard/spear-keyboard.c b/drivers/input/keyboard/spear-keyboard.c
index c7ca97f44bfb..695d237417d6 100644
--- a/drivers/input/keyboard/spear-keyboard.c
+++ b/drivers/input/keyboard/spear-keyboard.c
@@ -55,15 +55,15 @@
55 55
56struct spear_kbd { 56struct spear_kbd {
57 struct input_dev *input; 57 struct input_dev *input;
58 struct resource *res;
59 void __iomem *io_base; 58 void __iomem *io_base;
60 struct clk *clk; 59 struct clk *clk;
61 unsigned int irq; 60 unsigned int irq;
62 unsigned int mode; 61 unsigned int mode;
62 unsigned int suspended_rate;
63 unsigned short last_key; 63 unsigned short last_key;
64 unsigned short keycodes[NUM_ROWS * NUM_COLS]; 64 unsigned short keycodes[NUM_ROWS * NUM_COLS];
65 bool rep; 65 bool rep;
66 unsigned int suspended_rate; 66 bool irq_wake_enabled;
67 u32 mode_ctl_reg; 67 u32 mode_ctl_reg;
68}; 68};
69 69
@@ -146,7 +146,7 @@ static void spear_kbd_close(struct input_dev *dev)
146} 146}
147 147
148#ifdef CONFIG_OF 148#ifdef CONFIG_OF
149static int __devinit spear_kbd_parse_dt(struct platform_device *pdev, 149static int spear_kbd_parse_dt(struct platform_device *pdev,
150 struct spear_kbd *kbd) 150 struct spear_kbd *kbd)
151{ 151{
152 struct device_node *np = pdev->dev.of_node; 152 struct device_node *np = pdev->dev.of_node;
@@ -181,7 +181,7 @@ static inline int spear_kbd_parse_dt(struct platform_device *pdev,
181} 181}
182#endif 182#endif
183 183
184static int __devinit spear_kbd_probe(struct platform_device *pdev) 184static int spear_kbd_probe(struct platform_device *pdev)
185{ 185{
186 struct kbd_platform_data *pdata = dev_get_platdata(&pdev->dev); 186 struct kbd_platform_data *pdata = dev_get_platdata(&pdev->dev);
187 const struct matrix_keymap_data *keymap = pdata ? pdata->keymap : NULL; 187 const struct matrix_keymap_data *keymap = pdata ? pdata->keymap : NULL;
@@ -203,12 +203,16 @@ static int __devinit spear_kbd_probe(struct platform_device *pdev)
203 return irq; 203 return irq;
204 } 204 }
205 205
206 kbd = kzalloc(sizeof(*kbd), GFP_KERNEL); 206 kbd = devm_kzalloc(&pdev->dev, sizeof(*kbd), GFP_KERNEL);
207 input_dev = input_allocate_device(); 207 if (!kbd) {
208 if (!kbd || !input_dev) { 208 dev_err(&pdev->dev, "not enough memory for driver data\n");
209 dev_err(&pdev->dev, "out of memory\n"); 209 return -ENOMEM;
210 error = -ENOMEM; 210 }
211 goto err_free_mem; 211
212 input_dev = devm_input_allocate_device(&pdev->dev);
213 if (!input_dev) {
214 dev_err(&pdev->dev, "unable to allocate input device\n");
215 return -ENOMEM;
212 } 216 }
213 217
214 kbd->input = input_dev; 218 kbd->input = input_dev;
@@ -217,37 +221,25 @@ static int __devinit spear_kbd_probe(struct platform_device *pdev)
217 if (!pdata) { 221 if (!pdata) {
218 error = spear_kbd_parse_dt(pdev, kbd); 222 error = spear_kbd_parse_dt(pdev, kbd);
219 if (error) 223 if (error)
220 goto err_free_mem; 224 return error;
221 } else { 225 } else {
222 kbd->mode = pdata->mode; 226 kbd->mode = pdata->mode;
223 kbd->rep = pdata->rep; 227 kbd->rep = pdata->rep;
224 kbd->suspended_rate = pdata->suspended_rate; 228 kbd->suspended_rate = pdata->suspended_rate;
225 } 229 }
226 230
227 kbd->res = request_mem_region(res->start, resource_size(res), 231 kbd->io_base = devm_request_and_ioremap(&pdev->dev, res);
228 pdev->name);
229 if (!kbd->res) {
230 dev_err(&pdev->dev, "keyboard region already claimed\n");
231 error = -EBUSY;
232 goto err_free_mem;
233 }
234
235 kbd->io_base = ioremap(res->start, resource_size(res));
236 if (!kbd->io_base) { 232 if (!kbd->io_base) {
237 dev_err(&pdev->dev, "ioremap failed for kbd_region\n"); 233 dev_err(&pdev->dev, "request-ioremap failed for kbd_region\n");
238 error = -ENOMEM; 234 return -ENOMEM;
239 goto err_release_mem_region;
240 } 235 }
241 236
242 kbd->clk = clk_get(&pdev->dev, NULL); 237 kbd->clk = devm_clk_get(&pdev->dev, NULL);
243 if (IS_ERR(kbd->clk)) { 238 if (IS_ERR(kbd->clk))
244 error = PTR_ERR(kbd->clk); 239 return PTR_ERR(kbd->clk);
245 goto err_iounmap;
246 }
247 240
248 input_dev->name = "Spear Keyboard"; 241 input_dev->name = "Spear Keyboard";
249 input_dev->phys = "keyboard/input0"; 242 input_dev->phys = "keyboard/input0";
250 input_dev->dev.parent = &pdev->dev;
251 input_dev->id.bustype = BUS_HOST; 243 input_dev->id.bustype = BUS_HOST;
252 input_dev->id.vendor = 0x0001; 244 input_dev->id.vendor = 0x0001;
253 input_dev->id.product = 0x0001; 245 input_dev->id.product = 0x0001;
@@ -259,7 +251,7 @@ static int __devinit spear_kbd_probe(struct platform_device *pdev)
259 kbd->keycodes, input_dev); 251 kbd->keycodes, input_dev);
260 if (error) { 252 if (error) {
261 dev_err(&pdev->dev, "Failed to build keymap\n"); 253 dev_err(&pdev->dev, "Failed to build keymap\n");
262 goto err_put_clk; 254 return error;
263 } 255 }
264 256
265 if (kbd->rep) 257 if (kbd->rep)
@@ -268,48 +260,36 @@ static int __devinit spear_kbd_probe(struct platform_device *pdev)
268 260
269 input_set_drvdata(input_dev, kbd); 261 input_set_drvdata(input_dev, kbd);
270 262
271 error = request_irq(irq, spear_kbd_interrupt, 0, "keyboard", kbd); 263 error = devm_request_irq(&pdev->dev, irq, spear_kbd_interrupt, 0,
264 "keyboard", kbd);
272 if (error) { 265 if (error) {
273 dev_err(&pdev->dev, "request_irq fail\n"); 266 dev_err(&pdev->dev, "request_irq failed\n");
274 goto err_put_clk; 267 return error;
275 } 268 }
276 269
270 error = clk_prepare(kbd->clk);
271 if (error)
272 return error;
273
277 error = input_register_device(input_dev); 274 error = input_register_device(input_dev);
278 if (error) { 275 if (error) {
279 dev_err(&pdev->dev, "Unable to register keyboard device\n"); 276 dev_err(&pdev->dev, "Unable to register keyboard device\n");
280 goto err_free_irq; 277 clk_unprepare(kbd->clk);
278 return error;
281 } 279 }
282 280
283 device_init_wakeup(&pdev->dev, 1); 281 device_init_wakeup(&pdev->dev, 1);
284 platform_set_drvdata(pdev, kbd); 282 platform_set_drvdata(pdev, kbd);
285 283
286 return 0; 284 return 0;
287
288err_free_irq:
289 free_irq(kbd->irq, kbd);
290err_put_clk:
291 clk_put(kbd->clk);
292err_iounmap:
293 iounmap(kbd->io_base);
294err_release_mem_region:
295 release_mem_region(res->start, resource_size(res));
296err_free_mem:
297 input_free_device(input_dev);
298 kfree(kbd);
299
300 return error;
301} 285}
302 286
303static int __devexit spear_kbd_remove(struct platform_device *pdev) 287static int spear_kbd_remove(struct platform_device *pdev)
304{ 288{
305 struct spear_kbd *kbd = platform_get_drvdata(pdev); 289 struct spear_kbd *kbd = platform_get_drvdata(pdev);
306 290
307 free_irq(kbd->irq, kbd);
308 input_unregister_device(kbd->input); 291 input_unregister_device(kbd->input);
309 clk_put(kbd->clk); 292 clk_unprepare(kbd->clk);
310 iounmap(kbd->io_base);
311 release_mem_region(kbd->res->start, resource_size(kbd->res));
312 kfree(kbd);
313 293
314 device_init_wakeup(&pdev->dev, 0); 294 device_init_wakeup(&pdev->dev, 0);
315 platform_set_drvdata(pdev, NULL); 295 platform_set_drvdata(pdev, NULL);
@@ -333,7 +313,8 @@ static int spear_kbd_suspend(struct device *dev)
333 mode_ctl_reg = readl_relaxed(kbd->io_base + MODE_CTL_REG); 313 mode_ctl_reg = readl_relaxed(kbd->io_base + MODE_CTL_REG);
334 314
335 if (device_may_wakeup(&pdev->dev)) { 315 if (device_may_wakeup(&pdev->dev)) {
336 enable_irq_wake(kbd->irq); 316 if (!enable_irq_wake(kbd->irq))
317 kbd->irq_wake_enabled = true;
337 318
338 /* 319 /*
339 * reprogram the keyboard operating frequency as on some 320 * reprogram the keyboard operating frequency as on some
@@ -379,7 +360,10 @@ static int spear_kbd_resume(struct device *dev)
379 mutex_lock(&input_dev->mutex); 360 mutex_lock(&input_dev->mutex);
380 361
381 if (device_may_wakeup(&pdev->dev)) { 362 if (device_may_wakeup(&pdev->dev)) {
382 disable_irq_wake(kbd->irq); 363 if (kbd->irq_wake_enabled) {
364 kbd->irq_wake_enabled = false;
365 disable_irq_wake(kbd->irq);
366 }
383 } else { 367 } else {
384 if (input_dev->users) 368 if (input_dev->users)
385 clk_enable(kbd->clk); 369 clk_enable(kbd->clk);
@@ -407,7 +391,7 @@ MODULE_DEVICE_TABLE(of, spear_kbd_id_table);
407 391
408static struct platform_driver spear_kbd_driver = { 392static struct platform_driver spear_kbd_driver = {
409 .probe = spear_kbd_probe, 393 .probe = spear_kbd_probe,
410 .remove = __devexit_p(spear_kbd_remove), 394 .remove = spear_kbd_remove,
411 .driver = { 395 .driver = {
412 .name = "keyboard", 396 .name = "keyboard",
413 .owner = THIS_MODULE, 397 .owner = THIS_MODULE,
diff --git a/drivers/input/keyboard/stmpe-keypad.c b/drivers/input/keyboard/stmpe-keypad.c
index 470a8778dec1..5cbec56f7720 100644
--- a/drivers/input/keyboard/stmpe-keypad.c
+++ b/drivers/input/keyboard/stmpe-keypad.c
@@ -166,7 +166,7 @@ static irqreturn_t stmpe_keypad_irq(int irq, void *dev)
166 return IRQ_HANDLED; 166 return IRQ_HANDLED;
167} 167}
168 168
169static int __devinit stmpe_keypad_altfunc_init(struct stmpe_keypad *keypad) 169static int stmpe_keypad_altfunc_init(struct stmpe_keypad *keypad)
170{ 170{
171 const struct stmpe_keypad_variant *variant = keypad->variant; 171 const struct stmpe_keypad_variant *variant = keypad->variant;
172 unsigned int col_gpios = variant->col_gpios; 172 unsigned int col_gpios = variant->col_gpios;
@@ -207,7 +207,7 @@ static int __devinit stmpe_keypad_altfunc_init(struct stmpe_keypad *keypad)
207 return stmpe_set_altfunc(stmpe, pins, STMPE_BLOCK_KEYPAD); 207 return stmpe_set_altfunc(stmpe, pins, STMPE_BLOCK_KEYPAD);
208} 208}
209 209
210static int __devinit stmpe_keypad_chip_init(struct stmpe_keypad *keypad) 210static int stmpe_keypad_chip_init(struct stmpe_keypad *keypad)
211{ 211{
212 const struct stmpe_keypad_platform_data *plat = keypad->plat; 212 const struct stmpe_keypad_platform_data *plat = keypad->plat;
213 const struct stmpe_keypad_variant *variant = keypad->variant; 213 const struct stmpe_keypad_variant *variant = keypad->variant;
@@ -257,105 +257,131 @@ static int __devinit stmpe_keypad_chip_init(struct stmpe_keypad *keypad)
257 (plat->debounce_ms << 1)); 257 (plat->debounce_ms << 1));
258} 258}
259 259
260static int __devinit stmpe_keypad_probe(struct platform_device *pdev) 260static void stmpe_keypad_fill_used_pins(struct stmpe_keypad *keypad)
261{ 261{
262 struct stmpe *stmpe = dev_get_drvdata(pdev->dev.parent); 262 int row, col;
263
264 for (row = 0; row < STMPE_KEYPAD_MAX_ROWS; row++) {
265 for (col = 0; col < STMPE_KEYPAD_MAX_COLS; col++) {
266 int code = MATRIX_SCAN_CODE(row, col,
267 STMPE_KEYPAD_ROW_SHIFT);
268 if (keypad->keymap[code] != KEY_RESERVED) {
269 keypad->rows |= 1 << row;
270 keypad->cols |= 1 << col;
271 }
272 }
273 }
274}
275
276#ifdef CONFIG_OF
277static const struct stmpe_keypad_platform_data *
278stmpe_keypad_of_probe(struct device *dev)
279{
280 struct device_node *np = dev->of_node;
263 struct stmpe_keypad_platform_data *plat; 281 struct stmpe_keypad_platform_data *plat;
282
283 if (!np)
284 return ERR_PTR(-ENODEV);
285
286 plat = devm_kzalloc(dev, sizeof(*plat), GFP_KERNEL);
287 if (!plat)
288 return ERR_PTR(-ENOMEM);
289
290 of_property_read_u32(np, "debounce-interval", &plat->debounce_ms);
291 of_property_read_u32(np, "st,scan-count", &plat->scan_count);
292
293 plat->no_autorepeat = of_property_read_bool(np, "st,no-autorepeat");
294
295 return plat;
296}
297#else
298static inline const struct stmpe_keypad_platform_data *
299stmpe_keypad_of_probe(struct device *dev)
300{
301 return ERR_PTR(-EINVAL);
302}
303#endif
304
305static int stmpe_keypad_probe(struct platform_device *pdev)
306{
307 struct stmpe *stmpe = dev_get_drvdata(pdev->dev.parent);
308 const struct stmpe_keypad_platform_data *plat;
264 struct stmpe_keypad *keypad; 309 struct stmpe_keypad *keypad;
265 struct input_dev *input; 310 struct input_dev *input;
266 int ret; 311 int error;
267 int irq; 312 int irq;
268 int i;
269 313
270 plat = stmpe->pdata->keypad; 314 plat = stmpe->pdata->keypad;
271 if (!plat) 315 if (!plat) {
272 return -ENODEV; 316 plat = stmpe_keypad_of_probe(&pdev->dev);
317 if (IS_ERR(plat))
318 return PTR_ERR(plat);
319 }
273 320
274 irq = platform_get_irq(pdev, 0); 321 irq = platform_get_irq(pdev, 0);
275 if (irq < 0) 322 if (irq < 0)
276 return irq; 323 return irq;
277 324
278 keypad = kzalloc(sizeof(struct stmpe_keypad), GFP_KERNEL); 325 keypad = devm_kzalloc(&pdev->dev, sizeof(struct stmpe_keypad),
326 GFP_KERNEL);
279 if (!keypad) 327 if (!keypad)
280 return -ENOMEM; 328 return -ENOMEM;
281 329
282 input = input_allocate_device(); 330 input = devm_input_allocate_device(&pdev->dev);
283 if (!input) { 331 if (!input)
284 ret = -ENOMEM; 332 return -ENOMEM;
285 goto out_freekeypad;
286 }
287 333
288 input->name = "STMPE keypad"; 334 input->name = "STMPE keypad";
289 input->id.bustype = BUS_I2C; 335 input->id.bustype = BUS_I2C;
290 input->dev.parent = &pdev->dev; 336 input->dev.parent = &pdev->dev;
291 337
292 ret = matrix_keypad_build_keymap(plat->keymap_data, NULL, 338 error = matrix_keypad_build_keymap(plat->keymap_data, NULL,
293 STMPE_KEYPAD_MAX_ROWS, 339 STMPE_KEYPAD_MAX_ROWS,
294 STMPE_KEYPAD_MAX_COLS, 340 STMPE_KEYPAD_MAX_COLS,
295 keypad->keymap, input); 341 keypad->keymap, input);
296 if (ret) 342 if (error)
297 goto out_freeinput; 343 return error;
298 344
299 input_set_capability(input, EV_MSC, MSC_SCAN); 345 input_set_capability(input, EV_MSC, MSC_SCAN);
300 if (!plat->no_autorepeat) 346 if (!plat->no_autorepeat)
301 __set_bit(EV_REP, input->evbit); 347 __set_bit(EV_REP, input->evbit);
302 348
303 for (i = 0; i < plat->keymap_data->keymap_size; i++) { 349 stmpe_keypad_fill_used_pins(keypad);
304 unsigned int key = plat->keymap_data->keymap[i];
305
306 keypad->cols |= 1 << KEY_COL(key);
307 keypad->rows |= 1 << KEY_ROW(key);
308 }
309 350
310 keypad->stmpe = stmpe; 351 keypad->stmpe = stmpe;
311 keypad->plat = plat; 352 keypad->plat = plat;
312 keypad->input = input; 353 keypad->input = input;
313 keypad->variant = &stmpe_keypad_variants[stmpe->partnum]; 354 keypad->variant = &stmpe_keypad_variants[stmpe->partnum];
314 355
315 ret = stmpe_keypad_chip_init(keypad); 356 error = stmpe_keypad_chip_init(keypad);
316 if (ret < 0) 357 if (error < 0)
317 goto out_freeinput; 358 return error;
318 359
319 ret = input_register_device(input); 360 error = devm_request_threaded_irq(&pdev->dev, irq,
320 if (ret) { 361 NULL, stmpe_keypad_irq,
321 dev_err(&pdev->dev, 362 IRQF_ONESHOT, "stmpe-keypad", keypad);
322 "unable to register input device: %d\n", ret); 363 if (error) {
323 goto out_freeinput; 364 dev_err(&pdev->dev, "unable to get irq: %d\n", error);
365 return error;
324 } 366 }
325 367
326 ret = request_threaded_irq(irq, NULL, stmpe_keypad_irq, IRQF_ONESHOT, 368 error = input_register_device(input);
327 "stmpe-keypad", keypad); 369 if (error) {
328 if (ret) { 370 dev_err(&pdev->dev,
329 dev_err(&pdev->dev, "unable to get irq: %d\n", ret); 371 "unable to register input device: %d\n", error);
330 goto out_unregisterinput; 372 return error;
331 } 373 }
332 374
333 platform_set_drvdata(pdev, keypad); 375 platform_set_drvdata(pdev, keypad);
334 376
335 return 0; 377 return 0;
336
337out_unregisterinput:
338 input_unregister_device(input);
339 input = NULL;
340out_freeinput:
341 input_free_device(input);
342out_freekeypad:
343 kfree(keypad);
344 return ret;
345} 378}
346 379
347static int __devexit stmpe_keypad_remove(struct platform_device *pdev) 380static int stmpe_keypad_remove(struct platform_device *pdev)
348{ 381{
349 struct stmpe_keypad *keypad = platform_get_drvdata(pdev); 382 struct stmpe_keypad *keypad = platform_get_drvdata(pdev);
350 struct stmpe *stmpe = keypad->stmpe;
351 int irq = platform_get_irq(pdev, 0);
352
353 stmpe_disable(stmpe, STMPE_BLOCK_KEYPAD);
354 383
355 free_irq(irq, keypad); 384 stmpe_disable(keypad->stmpe, STMPE_BLOCK_KEYPAD);
356 input_unregister_device(keypad->input);
357 platform_set_drvdata(pdev, NULL);
358 kfree(keypad);
359 385
360 return 0; 386 return 0;
361} 387}
@@ -364,7 +390,7 @@ static struct platform_driver stmpe_keypad_driver = {
364 .driver.name = "stmpe-keypad", 390 .driver.name = "stmpe-keypad",
365 .driver.owner = THIS_MODULE, 391 .driver.owner = THIS_MODULE,
366 .probe = stmpe_keypad_probe, 392 .probe = stmpe_keypad_probe,
367 .remove = __devexit_p(stmpe_keypad_remove), 393 .remove = stmpe_keypad_remove,
368}; 394};
369module_platform_driver(stmpe_keypad_driver); 395module_platform_driver(stmpe_keypad_driver);
370 396
diff --git a/drivers/input/keyboard/tc3589x-keypad.c b/drivers/input/keyboard/tc3589x-keypad.c
index 7d498e698508..2fb0d76a04c4 100644
--- a/drivers/input/keyboard/tc3589x-keypad.c
+++ b/drivers/input/keyboard/tc3589x-keypad.c
@@ -299,7 +299,7 @@ static void tc3589x_keypad_close(struct input_dev *input)
299 tc3589x_keypad_disable(keypad); 299 tc3589x_keypad_disable(keypad);
300} 300}
301 301
302static int __devinit tc3589x_keypad_probe(struct platform_device *pdev) 302static int tc3589x_keypad_probe(struct platform_device *pdev)
303{ 303{
304 struct tc3589x *tc3589x = dev_get_drvdata(pdev->dev.parent); 304 struct tc3589x *tc3589x = dev_get_drvdata(pdev->dev.parent);
305 struct tc_keypad *keypad; 305 struct tc_keypad *keypad;
@@ -382,7 +382,7 @@ err_free_mem:
382 return error; 382 return error;
383} 383}
384 384
385static int __devexit tc3589x_keypad_remove(struct platform_device *pdev) 385static int tc3589x_keypad_remove(struct platform_device *pdev)
386{ 386{
387 struct tc_keypad *keypad = platform_get_drvdata(pdev); 387 struct tc_keypad *keypad = platform_get_drvdata(pdev);
388 int irq = platform_get_irq(pdev, 0); 388 int irq = platform_get_irq(pdev, 0);
@@ -448,7 +448,7 @@ static struct platform_driver tc3589x_keypad_driver = {
448 .pm = &tc3589x_keypad_dev_pm_ops, 448 .pm = &tc3589x_keypad_dev_pm_ops,
449 }, 449 },
450 .probe = tc3589x_keypad_probe, 450 .probe = tc3589x_keypad_probe,
451 .remove = __devexit_p(tc3589x_keypad_remove), 451 .remove = tc3589x_keypad_remove,
452}; 452};
453module_platform_driver(tc3589x_keypad_driver); 453module_platform_driver(tc3589x_keypad_driver);
454 454
diff --git a/drivers/input/keyboard/tca6416-keypad.c b/drivers/input/keyboard/tca6416-keypad.c
index c355cdde8d22..bfc832c35a7c 100644
--- a/drivers/input/keyboard/tca6416-keypad.c
+++ b/drivers/input/keyboard/tca6416-keypad.c
@@ -166,7 +166,7 @@ static void tca6416_keys_close(struct input_dev *dev)
166 disable_irq(chip->irqnum); 166 disable_irq(chip->irqnum);
167} 167}
168 168
169static int __devinit tca6416_setup_registers(struct tca6416_keypad_chip *chip) 169static int tca6416_setup_registers(struct tca6416_keypad_chip *chip)
170{ 170{
171 int error; 171 int error;
172 172
@@ -197,7 +197,7 @@ static int __devinit tca6416_setup_registers(struct tca6416_keypad_chip *chip)
197 return 0; 197 return 0;
198} 198}
199 199
200static int __devinit tca6416_keypad_probe(struct i2c_client *client, 200static int tca6416_keypad_probe(struct i2c_client *client,
201 const struct i2c_device_id *id) 201 const struct i2c_device_id *id)
202{ 202{
203 struct tca6416_keys_platform_data *pdata; 203 struct tca6416_keys_platform_data *pdata;
@@ -313,7 +313,7 @@ fail1:
313 return error; 313 return error;
314} 314}
315 315
316static int __devexit tca6416_keypad_remove(struct i2c_client *client) 316static int tca6416_keypad_remove(struct i2c_client *client)
317{ 317{
318 struct tca6416_keypad_chip *chip = i2c_get_clientdata(client); 318 struct tca6416_keypad_chip *chip = i2c_get_clientdata(client);
319 319
@@ -361,7 +361,7 @@ static struct i2c_driver tca6416_keypad_driver = {
361 .pm = &tca6416_keypad_dev_pm_ops, 361 .pm = &tca6416_keypad_dev_pm_ops,
362 }, 362 },
363 .probe = tca6416_keypad_probe, 363 .probe = tca6416_keypad_probe,
364 .remove = __devexit_p(tca6416_keypad_remove), 364 .remove = tca6416_keypad_remove,
365 .id_table = tca6416_id, 365 .id_table = tca6416_id,
366}; 366};
367 367
diff --git a/drivers/input/keyboard/tca8418_keypad.c b/drivers/input/keyboard/tca8418_keypad.c
index 893869b29ed9..50e9c5e195e1 100644
--- a/drivers/input/keyboard/tca8418_keypad.c
+++ b/drivers/input/keyboard/tca8418_keypad.c
@@ -35,6 +35,7 @@
35#include <linux/i2c.h> 35#include <linux/i2c.h>
36#include <linux/input.h> 36#include <linux/input.h>
37#include <linux/input/tca8418_keypad.h> 37#include <linux/input/tca8418_keypad.h>
38#include <linux/of.h>
38 39
39/* TCA8418 hardware limits */ 40/* TCA8418 hardware limits */
40#define TCA8418_MAX_ROWS 8 41#define TCA8418_MAX_ROWS 8
@@ -109,25 +110,11 @@
109#define KEY_EVENT_CODE 0x7f 110#define KEY_EVENT_CODE 0x7f
110#define KEY_EVENT_VALUE 0x80 111#define KEY_EVENT_VALUE 0x80
111 112
112
113static const struct i2c_device_id tca8418_id[] = {
114 { TCA8418_NAME, 8418, },
115 { }
116};
117MODULE_DEVICE_TABLE(i2c, tca8418_id);
118
119struct tca8418_keypad { 113struct tca8418_keypad {
120 unsigned int rows;
121 unsigned int cols;
122 unsigned int keypad_mask; /* Mask for keypad col/rol regs */
123 unsigned int irq;
124 unsigned int row_shift;
125
126 struct i2c_client *client; 114 struct i2c_client *client;
127 struct input_dev *input; 115 struct input_dev *input;
128 116
129 /* Flexible array member, must be at end of struct */ 117 unsigned int row_shift;
130 unsigned short keymap[];
131}; 118};
132 119
133/* 120/*
@@ -172,6 +159,8 @@ static int tca8418_read_byte(struct tca8418_keypad *keypad_data,
172 159
173static void tca8418_read_keypad(struct tca8418_keypad *keypad_data) 160static void tca8418_read_keypad(struct tca8418_keypad *keypad_data)
174{ 161{
162 struct input_dev *input = keypad_data->input;
163 unsigned short *keymap = input->keycode;
175 int error, col, row; 164 int error, col, row;
176 u8 reg, state, code; 165 u8 reg, state, code;
177 166
@@ -190,9 +179,8 @@ static void tca8418_read_keypad(struct tca8418_keypad *keypad_data)
190 col = (col) ? col - 1 : TCA8418_MAX_COLS - 1; 179 col = (col) ? col - 1 : TCA8418_MAX_COLS - 1;
191 180
192 code = MATRIX_SCAN_CODE(row, col, keypad_data->row_shift); 181 code = MATRIX_SCAN_CODE(row, col, keypad_data->row_shift);
193 input_event(keypad_data->input, EV_MSC, MSC_SCAN, code); 182 input_event(input, EV_MSC, MSC_SCAN, code);
194 input_report_key(keypad_data->input, 183 input_report_key(input, keymap[code], state);
195 keypad_data->keymap[code], state);
196 184
197 /* Read for next loop */ 185 /* Read for next loop */
198 error = tca8418_read_byte(keypad_data, REG_KEY_EVENT_A, &reg); 186 error = tca8418_read_byte(keypad_data, REG_KEY_EVENT_A, &reg);
@@ -202,7 +190,7 @@ static void tca8418_read_keypad(struct tca8418_keypad *keypad_data)
202 dev_err(&keypad_data->client->dev, 190 dev_err(&keypad_data->client->dev,
203 "unable to read REG_KEY_EVENT_A\n"); 191 "unable to read REG_KEY_EVENT_A\n");
204 192
205 input_sync(keypad_data->input); 193 input_sync(input);
206} 194}
207 195
208/* 196/*
@@ -218,16 +206,18 @@ static irqreturn_t tca8418_irq_handler(int irq, void *dev_id)
218 if (error) { 206 if (error) {
219 dev_err(&keypad_data->client->dev, 207 dev_err(&keypad_data->client->dev,
220 "unable to read REG_INT_STAT\n"); 208 "unable to read REG_INT_STAT\n");
221 goto exit; 209 return IRQ_NONE;
222 } 210 }
223 211
212 if (!reg)
213 return IRQ_NONE;
214
224 if (reg & INT_STAT_OVR_FLOW_INT) 215 if (reg & INT_STAT_OVR_FLOW_INT)
225 dev_warn(&keypad_data->client->dev, "overflow occurred\n"); 216 dev_warn(&keypad_data->client->dev, "overflow occurred\n");
226 217
227 if (reg & INT_STAT_K_INT) 218 if (reg & INT_STAT_K_INT)
228 tca8418_read_keypad(keypad_data); 219 tca8418_read_keypad(keypad_data);
229 220
230exit:
231 /* Clear all interrupts, even IRQs we didn't check (GPI, CAD, LCK) */ 221 /* Clear all interrupts, even IRQs we didn't check (GPI, CAD, LCK) */
232 reg = 0xff; 222 reg = 0xff;
233 error = tca8418_write_byte(keypad_data, REG_INT_STAT, reg); 223 error = tca8418_write_byte(keypad_data, REG_INT_STAT, reg);
@@ -241,7 +231,8 @@ exit:
241/* 231/*
242 * Configure the TCA8418 for keypad operation 232 * Configure the TCA8418 for keypad operation
243 */ 233 */
244static int __devinit tca8418_configure(struct tca8418_keypad *keypad_data) 234static int tca8418_configure(struct tca8418_keypad *keypad_data,
235 u32 rows, u32 cols)
245{ 236{
246 int reg, error; 237 int reg, error;
247 238
@@ -253,9 +244,8 @@ static int __devinit tca8418_configure(struct tca8418_keypad *keypad_data)
253 244
254 245
255 /* Assemble a mask for row and column registers */ 246 /* Assemble a mask for row and column registers */
256 reg = ~(~0 << keypad_data->rows); 247 reg = ~(~0 << rows);
257 reg += (~(~0 << keypad_data->cols)) << 8; 248 reg += (~(~0 << cols)) << 8;
258 keypad_data->keypad_mask = reg;
259 249
260 /* Set registers to keypad mode */ 250 /* Set registers to keypad mode */
261 error |= tca8418_write_byte(keypad_data, REG_KP_GPIO1, reg); 251 error |= tca8418_write_byte(keypad_data, REG_KP_GPIO1, reg);
@@ -270,145 +260,144 @@ static int __devinit tca8418_configure(struct tca8418_keypad *keypad_data)
270 return error; 260 return error;
271} 261}
272 262
273static int __devinit tca8418_keypad_probe(struct i2c_client *client, 263static int tca8418_keypad_probe(struct i2c_client *client,
274 const struct i2c_device_id *id) 264 const struct i2c_device_id *id)
275{ 265{
266 struct device *dev = &client->dev;
276 const struct tca8418_keypad_platform_data *pdata = 267 const struct tca8418_keypad_platform_data *pdata =
277 client->dev.platform_data; 268 dev_get_platdata(dev);
278 struct tca8418_keypad *keypad_data; 269 struct tca8418_keypad *keypad_data;
279 struct input_dev *input; 270 struct input_dev *input;
271 const struct matrix_keymap_data *keymap_data = NULL;
272 u32 rows = 0, cols = 0;
273 bool rep = false;
274 bool irq_is_gpio = false;
275 int irq;
280 int error, row_shift, max_keys; 276 int error, row_shift, max_keys;
281 277
282 /* Copy the platform data */ 278 /* Copy the platform data */
283 if (!pdata) { 279 if (pdata) {
284 dev_dbg(&client->dev, "no platform data\n"); 280 if (!pdata->keymap_data) {
285 return -EINVAL; 281 dev_err(dev, "no keymap data defined\n");
286 } 282 return -EINVAL;
287 283 }
288 if (!pdata->keymap_data) { 284 keymap_data = pdata->keymap_data;
289 dev_err(&client->dev, "no keymap data defined\n"); 285 rows = pdata->rows;
290 return -EINVAL; 286 cols = pdata->cols;
287 rep = pdata->rep;
288 irq_is_gpio = pdata->irq_is_gpio;
289 } else {
290 struct device_node *np = dev->of_node;
291 of_property_read_u32(np, "keypad,num-rows", &rows);
292 of_property_read_u32(np, "keypad,num-columns", &cols);
293 rep = of_property_read_bool(np, "keypad,autorepeat");
291 } 294 }
292 295
293 if (!pdata->rows || pdata->rows > TCA8418_MAX_ROWS) { 296 if (!rows || rows > TCA8418_MAX_ROWS) {
294 dev_err(&client->dev, "invalid rows\n"); 297 dev_err(dev, "invalid rows\n");
295 return -EINVAL; 298 return -EINVAL;
296 } 299 }
297 300
298 if (!pdata->cols || pdata->cols > TCA8418_MAX_COLS) { 301 if (!cols || cols > TCA8418_MAX_COLS) {
299 dev_err(&client->dev, "invalid columns\n"); 302 dev_err(dev, "invalid columns\n");
300 return -EINVAL; 303 return -EINVAL;
301 } 304 }
302 305
303 /* Check i2c driver capabilities */ 306 /* Check i2c driver capabilities */
304 if (!i2c_check_functionality(client->adapter, I2C_FUNC_SMBUS_BYTE)) { 307 if (!i2c_check_functionality(client->adapter, I2C_FUNC_SMBUS_BYTE)) {
305 dev_err(&client->dev, "%s adapter not supported\n", 308 dev_err(dev, "%s adapter not supported\n",
306 dev_driver_string(&client->adapter->dev)); 309 dev_driver_string(&client->adapter->dev));
307 return -ENODEV; 310 return -ENODEV;
308 } 311 }
309 312
310 row_shift = get_count_order(pdata->cols); 313 row_shift = get_count_order(cols);
311 max_keys = pdata->rows << row_shift; 314 max_keys = rows << row_shift;
312 315
313 /* Allocate memory for keypad_data, keymap and input device */ 316 /* Allocate memory for keypad_data and input device */
314 keypad_data = kzalloc(sizeof(*keypad_data) + 317 keypad_data = devm_kzalloc(dev, sizeof(*keypad_data), GFP_KERNEL);
315 max_keys * sizeof(keypad_data->keymap[0]), GFP_KERNEL);
316 if (!keypad_data) 318 if (!keypad_data)
317 return -ENOMEM; 319 return -ENOMEM;
318 320
319 keypad_data->rows = pdata->rows;
320 keypad_data->cols = pdata->cols;
321 keypad_data->client = client; 321 keypad_data->client = client;
322 keypad_data->row_shift = row_shift; 322 keypad_data->row_shift = row_shift;
323 323
324 /* Initialize the chip or fail if chip isn't present */ 324 /* Initialize the chip or fail if chip isn't present */
325 error = tca8418_configure(keypad_data); 325 error = tca8418_configure(keypad_data, rows, cols);
326 if (error < 0) 326 if (error < 0)
327 goto fail1; 327 return error;
328 328
329 /* Configure input device */ 329 /* Configure input device */
330 input = input_allocate_device(); 330 input = devm_input_allocate_device(dev);
331 if (!input) { 331 if (!input)
332 error = -ENOMEM; 332 return -ENOMEM;
333 goto fail1; 333
334 }
335 keypad_data->input = input; 334 keypad_data->input = input;
336 335
337 input->name = client->name; 336 input->name = client->name;
338 input->dev.parent = &client->dev;
339
340 input->id.bustype = BUS_I2C; 337 input->id.bustype = BUS_I2C;
341 input->id.vendor = 0x0001; 338 input->id.vendor = 0x0001;
342 input->id.product = 0x001; 339 input->id.product = 0x001;
343 input->id.version = 0x0001; 340 input->id.version = 0x0001;
344 341
345 error = matrix_keypad_build_keymap(pdata->keymap_data, NULL, 342 error = matrix_keypad_build_keymap(keymap_data, NULL, rows, cols,
346 pdata->rows, pdata->cols, 343 NULL, input);
347 keypad_data->keymap, input);
348 if (error) { 344 if (error) {
349 dev_dbg(&client->dev, "Failed to build keymap\n"); 345 dev_err(dev, "Failed to build keymap\n");
350 goto fail2; 346 return error;
351 } 347 }
352 348
353 if (pdata->rep) 349 if (rep)
354 __set_bit(EV_REP, input->evbit); 350 __set_bit(EV_REP, input->evbit);
355 input_set_capability(input, EV_MSC, MSC_SCAN); 351 input_set_capability(input, EV_MSC, MSC_SCAN);
356 352
357 input_set_drvdata(input, keypad_data); 353 input_set_drvdata(input, keypad_data);
358 354
359 if (pdata->irq_is_gpio) 355 irq = client->irq;
360 client->irq = gpio_to_irq(client->irq); 356 if (irq_is_gpio)
357 irq = gpio_to_irq(irq);
361 358
362 error = request_threaded_irq(client->irq, NULL, tca8418_irq_handler, 359 error = devm_request_threaded_irq(dev, irq, NULL, tca8418_irq_handler,
363 IRQF_TRIGGER_FALLING | IRQF_ONESHOT, 360 IRQF_TRIGGER_FALLING |
364 client->name, keypad_data); 361 IRQF_SHARED |
362 IRQF_ONESHOT,
363 client->name, keypad_data);
365 if (error) { 364 if (error) {
366 dev_dbg(&client->dev, 365 dev_err(dev, "Unable to claim irq %d; error %d\n",
367 "Unable to claim irq %d; error %d\n",
368 client->irq, error); 366 client->irq, error);
369 goto fail2; 367 return error;
370 } 368 }
371 369
372 error = input_register_device(input); 370 error = input_register_device(input);
373 if (error) { 371 if (error) {
374 dev_dbg(&client->dev, 372 dev_err(dev, "Unable to register input device, error: %d\n",
375 "Unable to register input device, error: %d\n", error); 373 error);
376 goto fail3; 374 return error;
377 } 375 }
378 376
379 i2c_set_clientdata(client, keypad_data);
380 return 0; 377 return 0;
381
382fail3:
383 free_irq(client->irq, keypad_data);
384fail2:
385 input_free_device(input);
386fail1:
387 kfree(keypad_data);
388 return error;
389} 378}
390 379
391static int __devexit tca8418_keypad_remove(struct i2c_client *client) 380static const struct i2c_device_id tca8418_id[] = {
392{ 381 { TCA8418_NAME, 8418, },
393 struct tca8418_keypad *keypad_data = i2c_get_clientdata(client); 382 { }
394 383};
395 free_irq(keypad_data->client->irq, keypad_data); 384MODULE_DEVICE_TABLE(i2c, tca8418_id);
396
397 input_unregister_device(keypad_data->input);
398
399 kfree(keypad_data);
400
401 return 0;
402}
403 385
386#ifdef CONFIG_OF
387static const struct of_device_id tca8418_dt_ids[] __devinitconst = {
388 { .compatible = "ti,tca8418", },
389 { }
390};
391MODULE_DEVICE_TABLE(of, tca8418_dt_ids);
392#endif
404 393
405static struct i2c_driver tca8418_keypad_driver = { 394static struct i2c_driver tca8418_keypad_driver = {
406 .driver = { 395 .driver = {
407 .name = TCA8418_NAME, 396 .name = TCA8418_NAME,
408 .owner = THIS_MODULE, 397 .owner = THIS_MODULE,
398 .of_match_table = of_match_ptr(tca8418_dt_ids),
409 }, 399 },
410 .probe = tca8418_keypad_probe, 400 .probe = tca8418_keypad_probe,
411 .remove = __devexit_p(tca8418_keypad_remove),
412 .id_table = tca8418_id, 401 .id_table = tca8418_id,
413}; 402};
414 403
diff --git a/drivers/input/keyboard/tegra-kbc.c b/drivers/input/keyboard/tegra-kbc.c
index 5faaf2553e33..c76f96872d31 100644
--- a/drivers/input/keyboard/tegra-kbc.c
+++ b/drivers/input/keyboard/tegra-kbc.c
@@ -87,7 +87,7 @@ struct tegra_kbc {
87 struct clk *clk; 87 struct clk *clk;
88}; 88};
89 89
90static const u32 tegra_kbc_default_keymap[] __devinitdata = { 90static const u32 tegra_kbc_default_keymap[] = {
91 KEY(0, 2, KEY_W), 91 KEY(0, 2, KEY_W),
92 KEY(0, 3, KEY_S), 92 KEY(0, 3, KEY_S),
93 KEY(0, 4, KEY_A), 93 KEY(0, 4, KEY_A),
@@ -223,7 +223,7 @@ static const u32 tegra_kbc_default_keymap[] __devinitdata = {
223}; 223};
224 224
225static const 225static const
226struct matrix_keymap_data tegra_kbc_default_keymap_data __devinitdata = { 226struct matrix_keymap_data tegra_kbc_default_keymap_data = {
227 .keymap = tegra_kbc_default_keymap, 227 .keymap = tegra_kbc_default_keymap,
228 .keymap_size = ARRAY_SIZE(tegra_kbc_default_keymap), 228 .keymap_size = ARRAY_SIZE(tegra_kbc_default_keymap),
229}; 229};
@@ -573,7 +573,7 @@ static void tegra_kbc_close(struct input_dev *dev)
573 return tegra_kbc_stop(kbc); 573 return tegra_kbc_stop(kbc);
574} 574}
575 575
576static bool __devinit 576static bool
577tegra_kbc_check_pin_cfg(const struct tegra_kbc_platform_data *pdata, 577tegra_kbc_check_pin_cfg(const struct tegra_kbc_platform_data *pdata,
578 struct device *dev, unsigned int *num_rows) 578 struct device *dev, unsigned int *num_rows)
579{ 579{
@@ -619,7 +619,7 @@ tegra_kbc_check_pin_cfg(const struct tegra_kbc_platform_data *pdata,
619} 619}
620 620
621#ifdef CONFIG_OF 621#ifdef CONFIG_OF
622static struct tegra_kbc_platform_data * __devinit tegra_kbc_dt_parse_pdata( 622static struct tegra_kbc_platform_data *tegra_kbc_dt_parse_pdata(
623 struct platform_device *pdev) 623 struct platform_device *pdev)
624{ 624{
625 struct tegra_kbc_platform_data *pdata; 625 struct tegra_kbc_platform_data *pdata;
@@ -670,7 +670,7 @@ static inline struct tegra_kbc_platform_data *tegra_kbc_dt_parse_pdata(
670} 670}
671#endif 671#endif
672 672
673static int __devinit tegra_kbd_setup_keymap(struct tegra_kbc *kbc) 673static int tegra_kbd_setup_keymap(struct tegra_kbc *kbc)
674{ 674{
675 const struct tegra_kbc_platform_data *pdata = kbc->pdata; 675 const struct tegra_kbc_platform_data *pdata = kbc->pdata;
676 const struct matrix_keymap_data *keymap_data = pdata->keymap_data; 676 const struct matrix_keymap_data *keymap_data = pdata->keymap_data;
@@ -697,7 +697,7 @@ static int __devinit tegra_kbd_setup_keymap(struct tegra_kbc *kbc)
697 return retval; 697 return retval;
698} 698}
699 699
700static int __devinit tegra_kbc_probe(struct platform_device *pdev) 700static int tegra_kbc_probe(struct platform_device *pdev)
701{ 701{
702 const struct tegra_kbc_platform_data *pdata = pdev->dev.platform_data; 702 const struct tegra_kbc_platform_data *pdata = pdev->dev.platform_data;
703 struct tegra_kbc *kbc; 703 struct tegra_kbc *kbc;
@@ -838,7 +838,7 @@ err_free_pdata:
838 return err; 838 return err;
839} 839}
840 840
841static int __devexit tegra_kbc_remove(struct platform_device *pdev) 841static int tegra_kbc_remove(struct platform_device *pdev)
842{ 842{
843 struct tegra_kbc *kbc = platform_get_drvdata(pdev); 843 struct tegra_kbc *kbc = platform_get_drvdata(pdev);
844 struct resource *res; 844 struct resource *res;
@@ -954,7 +954,7 @@ MODULE_DEVICE_TABLE(of, tegra_kbc_of_match);
954 954
955static struct platform_driver tegra_kbc_driver = { 955static struct platform_driver tegra_kbc_driver = {
956 .probe = tegra_kbc_probe, 956 .probe = tegra_kbc_probe,
957 .remove = __devexit_p(tegra_kbc_remove), 957 .remove = tegra_kbc_remove,
958 .driver = { 958 .driver = {
959 .name = "tegra-kbc", 959 .name = "tegra-kbc",
960 .owner = THIS_MODULE, 960 .owner = THIS_MODULE,
diff --git a/drivers/input/keyboard/tnetv107x-keypad.c b/drivers/input/keyboard/tnetv107x-keypad.c
index 4c34f21fbe2d..ee1635011292 100644
--- a/drivers/input/keyboard/tnetv107x-keypad.c
+++ b/drivers/input/keyboard/tnetv107x-keypad.c
@@ -153,7 +153,7 @@ static void keypad_stop(struct input_dev *dev)
153 clk_disable(kp->clk); 153 clk_disable(kp->clk);
154} 154}
155 155
156static int __devinit keypad_probe(struct platform_device *pdev) 156static int keypad_probe(struct platform_device *pdev)
157{ 157{
158 const struct matrix_keypad_platform_data *pdata; 158 const struct matrix_keypad_platform_data *pdata;
159 const struct matrix_keymap_data *keymap_data; 159 const struct matrix_keymap_data *keymap_data;
@@ -301,7 +301,7 @@ error_res:
301 return error; 301 return error;
302} 302}
303 303
304static int __devexit keypad_remove(struct platform_device *pdev) 304static int keypad_remove(struct platform_device *pdev)
305{ 305{
306 struct keypad_data *kp = platform_get_drvdata(pdev); 306 struct keypad_data *kp = platform_get_drvdata(pdev);
307 307
@@ -319,7 +319,7 @@ static int __devexit keypad_remove(struct platform_device *pdev)
319 319
320static struct platform_driver keypad_driver = { 320static struct platform_driver keypad_driver = {
321 .probe = keypad_probe, 321 .probe = keypad_probe,
322 .remove = __devexit_p(keypad_remove), 322 .remove = keypad_remove,
323 .driver.name = "tnetv107x-keypad", 323 .driver.name = "tnetv107x-keypad",
324 .driver.owner = THIS_MODULE, 324 .driver.owner = THIS_MODULE,
325}; 325};
diff --git a/drivers/input/keyboard/twl4030_keypad.c b/drivers/input/keyboard/twl4030_keypad.c
index a2c6f79aa101..04f84fd57173 100644
--- a/drivers/input/keyboard/twl4030_keypad.c
+++ b/drivers/input/keyboard/twl4030_keypad.c
@@ -271,7 +271,7 @@ static irqreturn_t do_kp_irq(int irq, void *_kp)
271 return IRQ_HANDLED; 271 return IRQ_HANDLED;
272} 272}
273 273
274static int __devinit twl4030_kp_program(struct twl4030_keypad *kp) 274static int twl4030_kp_program(struct twl4030_keypad *kp)
275{ 275{
276 u8 reg; 276 u8 reg;
277 int i; 277 int i;
@@ -328,7 +328,7 @@ static int __devinit twl4030_kp_program(struct twl4030_keypad *kp)
328 * Registers keypad device with input subsystem 328 * Registers keypad device with input subsystem
329 * and configures TWL4030 keypad registers 329 * and configures TWL4030 keypad registers
330 */ 330 */
331static int __devinit twl4030_kp_probe(struct platform_device *pdev) 331static int twl4030_kp_probe(struct platform_device *pdev)
332{ 332{
333 struct twl4030_keypad_data *pdata = pdev->dev.platform_data; 333 struct twl4030_keypad_data *pdata = pdev->dev.platform_data;
334 const struct matrix_keymap_data *keymap_data; 334 const struct matrix_keymap_data *keymap_data;
@@ -432,7 +432,7 @@ err1:
432 return error; 432 return error;
433} 433}
434 434
435static int __devexit twl4030_kp_remove(struct platform_device *pdev) 435static int twl4030_kp_remove(struct platform_device *pdev)
436{ 436{
437 struct twl4030_keypad *kp = platform_get_drvdata(pdev); 437 struct twl4030_keypad *kp = platform_get_drvdata(pdev);
438 438
@@ -452,7 +452,7 @@ static int __devexit twl4030_kp_remove(struct platform_device *pdev)
452 452
453static struct platform_driver twl4030_kp_driver = { 453static struct platform_driver twl4030_kp_driver = {
454 .probe = twl4030_kp_probe, 454 .probe = twl4030_kp_probe,
455 .remove = __devexit_p(twl4030_kp_remove), 455 .remove = twl4030_kp_remove,
456 .driver = { 456 .driver = {
457 .name = "twl4030_keypad", 457 .name = "twl4030_keypad",
458 .owner = THIS_MODULE, 458 .owner = THIS_MODULE,
diff --git a/drivers/input/keyboard/w90p910_keypad.c b/drivers/input/keyboard/w90p910_keypad.c
index e0f6cd1ad0fd..ee163bee8cce 100644
--- a/drivers/input/keyboard/w90p910_keypad.c
+++ b/drivers/input/keyboard/w90p910_keypad.c
@@ -118,7 +118,7 @@ static void w90p910_keypad_close(struct input_dev *dev)
118 clk_disable(keypad->clk); 118 clk_disable(keypad->clk);
119} 119}
120 120
121static int __devinit w90p910_keypad_probe(struct platform_device *pdev) 121static int w90p910_keypad_probe(struct platform_device *pdev)
122{ 122{
123 const struct w90p910_keypad_platform_data *pdata = 123 const struct w90p910_keypad_platform_data *pdata =
124 pdev->dev.platform_data; 124 pdev->dev.platform_data;
@@ -234,7 +234,7 @@ failed_free:
234 return error; 234 return error;
235} 235}
236 236
237static int __devexit w90p910_keypad_remove(struct platform_device *pdev) 237static int w90p910_keypad_remove(struct platform_device *pdev)
238{ 238{
239 struct w90p910_keypad *keypad = platform_get_drvdata(pdev); 239 struct w90p910_keypad *keypad = platform_get_drvdata(pdev);
240 struct resource *res; 240 struct resource *res;
@@ -257,7 +257,7 @@ static int __devexit w90p910_keypad_remove(struct platform_device *pdev)
257 257
258static struct platform_driver w90p910_keypad_driver = { 258static struct platform_driver w90p910_keypad_driver = {
259 .probe = w90p910_keypad_probe, 259 .probe = w90p910_keypad_probe,
260 .remove = __devexit_p(w90p910_keypad_remove), 260 .remove = w90p910_keypad_remove,
261 .driver = { 261 .driver = {
262 .name = "nuc900-kpi", 262 .name = "nuc900-kpi",
263 .owner = THIS_MODULE, 263 .owner = THIS_MODULE,
diff --git a/drivers/input/matrix-keymap.c b/drivers/input/matrix-keymap.c
index d88d9be1d1b7..3ae496ea5fe6 100644
--- a/drivers/input/matrix-keymap.c
+++ b/drivers/input/matrix-keymap.c
@@ -18,6 +18,7 @@
18 */ 18 */
19 19
20#include <linux/device.h> 20#include <linux/device.h>
21#include <linux/gfp.h>
21#include <linux/kernel.h> 22#include <linux/kernel.h>
22#include <linux/types.h> 23#include <linux/types.h>
23#include <linux/input.h> 24#include <linux/input.h>
@@ -123,6 +124,11 @@ static int matrix_keypad_parse_of_keymap(const char *propname,
123 * it will attempt load the keymap from property specified by @keymap_name 124 * it will attempt load the keymap from property specified by @keymap_name
124 * argument (or "linux,keymap" if @keymap_name is %NULL). 125 * argument (or "linux,keymap" if @keymap_name is %NULL).
125 * 126 *
127 * If @keymap is %NULL the function will automatically allocate managed
128 * block of memory to store the keymap. This memory will be associated with
129 * the parent device and automatically freed when device unbinds from the
130 * driver.
131 *
126 * Callers are expected to set up input_dev->dev.parent before calling this 132 * Callers are expected to set up input_dev->dev.parent before calling this
127 * function. 133 * function.
128 */ 134 */
@@ -133,12 +139,27 @@ int matrix_keypad_build_keymap(const struct matrix_keymap_data *keymap_data,
133 struct input_dev *input_dev) 139 struct input_dev *input_dev)
134{ 140{
135 unsigned int row_shift = get_count_order(cols); 141 unsigned int row_shift = get_count_order(cols);
142 size_t max_keys = rows << row_shift;
136 int i; 143 int i;
137 int error; 144 int error;
138 145
146 if (WARN_ON(!input_dev->dev.parent))
147 return -EINVAL;
148
149 if (!keymap) {
150 keymap = devm_kzalloc(input_dev->dev.parent,
151 max_keys * sizeof(*keymap),
152 GFP_KERNEL);
153 if (!keymap) {
154 dev_err(input_dev->dev.parent,
155 "Unable to allocate memory for keymap");
156 return -ENOMEM;
157 }
158 }
159
139 input_dev->keycode = keymap; 160 input_dev->keycode = keymap;
140 input_dev->keycodesize = sizeof(*keymap); 161 input_dev->keycodesize = sizeof(*keymap);
141 input_dev->keycodemax = rows << row_shift; 162 input_dev->keycodemax = max_keys;
142 163
143 __set_bit(EV_KEY, input_dev->evbit); 164 __set_bit(EV_KEY, input_dev->evbit);
144 165
diff --git a/drivers/input/misc/88pm80x_onkey.c b/drivers/input/misc/88pm80x_onkey.c
index 7f26e7b6c228..ee43e5b7c881 100644
--- a/drivers/input/misc/88pm80x_onkey.c
+++ b/drivers/input/misc/88pm80x_onkey.c
@@ -62,7 +62,7 @@ static irqreturn_t pm80x_onkey_handler(int irq, void *data)
62static SIMPLE_DEV_PM_OPS(pm80x_onkey_pm_ops, pm80x_dev_suspend, 62static SIMPLE_DEV_PM_OPS(pm80x_onkey_pm_ops, pm80x_dev_suspend,
63 pm80x_dev_resume); 63 pm80x_dev_resume);
64 64
65static int __devinit pm80x_onkey_probe(struct platform_device *pdev) 65static int pm80x_onkey_probe(struct platform_device *pdev)
66{ 66{
67 67
68 struct pm80x_chip *chip = dev_get_drvdata(pdev->dev.parent); 68 struct pm80x_chip *chip = dev_get_drvdata(pdev->dev.parent);
@@ -139,7 +139,7 @@ out:
139 return err; 139 return err;
140} 140}
141 141
142static int __devexit pm80x_onkey_remove(struct platform_device *pdev) 142static int pm80x_onkey_remove(struct platform_device *pdev)
143{ 143{
144 struct pm80x_onkey_info *info = platform_get_drvdata(pdev); 144 struct pm80x_onkey_info *info = platform_get_drvdata(pdev);
145 145
@@ -157,7 +157,7 @@ static struct platform_driver pm80x_onkey_driver = {
157 .pm = &pm80x_onkey_pm_ops, 157 .pm = &pm80x_onkey_pm_ops,
158 }, 158 },
159 .probe = pm80x_onkey_probe, 159 .probe = pm80x_onkey_probe,
160 .remove = __devexit_p(pm80x_onkey_remove), 160 .remove = pm80x_onkey_remove,
161}; 161};
162 162
163module_platform_driver(pm80x_onkey_driver); 163module_platform_driver(pm80x_onkey_driver);
diff --git a/drivers/input/misc/88pm860x_onkey.c b/drivers/input/misc/88pm860x_onkey.c
index f9ce1835e4d7..abd8453e5212 100644
--- a/drivers/input/misc/88pm860x_onkey.c
+++ b/drivers/input/misc/88pm860x_onkey.c
@@ -56,7 +56,7 @@ static irqreturn_t pm860x_onkey_handler(int irq, void *data)
56 return IRQ_HANDLED; 56 return IRQ_HANDLED;
57} 57}
58 58
59static int __devinit pm860x_onkey_probe(struct platform_device *pdev) 59static int pm860x_onkey_probe(struct platform_device *pdev)
60{ 60{
61 struct pm860x_chip *chip = dev_get_drvdata(pdev->dev.parent); 61 struct pm860x_chip *chip = dev_get_drvdata(pdev->dev.parent);
62 struct pm860x_onkey_info *info; 62 struct pm860x_onkey_info *info;
@@ -121,7 +121,7 @@ out:
121 return ret; 121 return ret;
122} 122}
123 123
124static int __devexit pm860x_onkey_remove(struct platform_device *pdev) 124static int pm860x_onkey_remove(struct platform_device *pdev)
125{ 125{
126 struct pm860x_onkey_info *info = platform_get_drvdata(pdev); 126 struct pm860x_onkey_info *info = platform_get_drvdata(pdev);
127 127
@@ -161,7 +161,7 @@ static struct platform_driver pm860x_onkey_driver = {
161 .pm = &pm860x_onkey_pm_ops, 161 .pm = &pm860x_onkey_pm_ops,
162 }, 162 },
163 .probe = pm860x_onkey_probe, 163 .probe = pm860x_onkey_probe,
164 .remove = __devexit_p(pm860x_onkey_remove), 164 .remove = pm860x_onkey_remove,
165}; 165};
166module_platform_driver(pm860x_onkey_driver); 166module_platform_driver(pm860x_onkey_driver);
167 167
diff --git a/drivers/input/misc/Kconfig b/drivers/input/misc/Kconfig
index 104a7c3153c0..259ef31abb18 100644
--- a/drivers/input/misc/Kconfig
+++ b/drivers/input/misc/Kconfig
@@ -300,8 +300,7 @@ config INPUT_ATI_REMOTE2
300 called ati_remote2. 300 called ati_remote2.
301 301
302config INPUT_KEYSPAN_REMOTE 302config INPUT_KEYSPAN_REMOTE
303 tristate "Keyspan DMR USB remote control (EXPERIMENTAL)" 303 tristate "Keyspan DMR USB remote control"
304 depends on EXPERIMENTAL
305 depends on USB_ARCH_HAS_HCD 304 depends on USB_ARCH_HAS_HCD
306 select USB 305 select USB
307 help 306 help
@@ -350,7 +349,6 @@ config INPUT_POWERMATE
350 349
351config INPUT_YEALINK 350config INPUT_YEALINK
352 tristate "Yealink usb-p1k voip phone" 351 tristate "Yealink usb-p1k voip phone"
353 depends on EXPERIMENTAL
354 depends on USB_ARCH_HAS_HCD 352 depends on USB_ARCH_HAS_HCD
355 select USB 353 select USB
356 help 354 help
@@ -366,7 +364,6 @@ config INPUT_YEALINK
366 364
367config INPUT_CM109 365config INPUT_CM109
368 tristate "C-Media CM109 USB I/O Controller" 366 tristate "C-Media CM109 USB I/O Controller"
369 depends on EXPERIMENTAL
370 depends on USB_ARCH_HAS_HCD 367 depends on USB_ARCH_HAS_HCD
371 select USB 368 select USB
372 help 369 help
@@ -377,6 +374,16 @@ config INPUT_CM109
377 To compile this driver as a module, choose M here: the module will be 374 To compile this driver as a module, choose M here: the module will be
378 called cm109. 375 called cm109.
379 376
377config INPUT_RETU_PWRBUTTON
378 tristate "Retu Power button Driver"
379 depends on MFD_RETU
380 help
381 Say Y here if you want to enable power key reporting via the
382 Retu chips found in Nokia Internet Tablets (770, N800, N810).
383
384 To compile this driver as a module, choose M here. The module will
385 be called retu-pwrbutton.
386
380config INPUT_TWL4030_PWRBUTTON 387config INPUT_TWL4030_PWRBUTTON
381 tristate "TWL4030 Power button Driver" 388 tristate "TWL4030 Power button Driver"
382 depends on TWL4030_CORE 389 depends on TWL4030_CORE
@@ -444,7 +451,7 @@ config INPUT_PCF50633_PMU
444 451
445config INPUT_PCF8574 452config INPUT_PCF8574
446 tristate "PCF8574 Keypad input device" 453 tristate "PCF8574 Keypad input device"
447 depends on I2C && EXPERIMENTAL 454 depends on I2C
448 help 455 help
449 Say Y here if you want to support a keypad connected via I2C 456 Say Y here if you want to support a keypad connected via I2C
450 with a PCF8574. 457 with a PCF8574.
@@ -454,7 +461,7 @@ config INPUT_PCF8574
454 461
455config INPUT_PWM_BEEPER 462config INPUT_PWM_BEEPER
456 tristate "PWM beeper support" 463 tristate "PWM beeper support"
457 depends on HAVE_PWM 464 depends on HAVE_PWM || PWM
458 help 465 help
459 Say Y here to get support for PWM based beeper devices. 466 Say Y here to get support for PWM based beeper devices.
460 467
@@ -496,6 +503,16 @@ config INPUT_DA9052_ONKEY
496 To compile this driver as a module, choose M here: the 503 To compile this driver as a module, choose M here: the
497 module will be called da9052_onkey. 504 module will be called da9052_onkey.
498 505
506config INPUT_DA9055_ONKEY
507 tristate "Dialog Semiconductor DA9055 ONKEY"
508 depends on MFD_DA9055
509 help
510 Support the ONKEY of DA9055 PMICs as an input device
511 reporting power button status.
512
513 To compile this driver as a module, choose M here: the module
514 will be called da9055_onkey.
515
499config INPUT_DM355EVM 516config INPUT_DM355EVM
500 tristate "TI DaVinci DM355 EVM Keypad and IR Remote" 517 tristate "TI DaVinci DM355 EVM Keypad and IR Remote"
501 depends on MFD_DM355EVM_MSP 518 depends on MFD_DM355EVM_MSP
diff --git a/drivers/input/misc/Makefile b/drivers/input/misc/Makefile
index 5ea769eda999..1f1e1b109d9d 100644
--- a/drivers/input/misc/Makefile
+++ b/drivers/input/misc/Makefile
@@ -24,6 +24,7 @@ obj-$(CONFIG_INPUT_CMA3000) += cma3000_d0x.o
24obj-$(CONFIG_INPUT_CMA3000_I2C) += cma3000_d0x_i2c.o 24obj-$(CONFIG_INPUT_CMA3000_I2C) += cma3000_d0x_i2c.o
25obj-$(CONFIG_INPUT_COBALT_BTNS) += cobalt_btns.o 25obj-$(CONFIG_INPUT_COBALT_BTNS) += cobalt_btns.o
26obj-$(CONFIG_INPUT_DA9052_ONKEY) += da9052_onkey.o 26obj-$(CONFIG_INPUT_DA9052_ONKEY) += da9052_onkey.o
27obj-$(CONFIG_INPUT_DA9055_ONKEY) += da9055_onkey.o
27obj-$(CONFIG_INPUT_DM355EVM) += dm355evm_keys.o 28obj-$(CONFIG_INPUT_DM355EVM) += dm355evm_keys.o
28obj-$(CONFIG_INPUT_GP2A) += gp2ap002a00f.o 29obj-$(CONFIG_INPUT_GP2A) += gp2ap002a00f.o
29obj-$(CONFIG_INPUT_GPIO_TILT_POLLED) += gpio_tilt_polled.o 30obj-$(CONFIG_INPUT_GPIO_TILT_POLLED) += gpio_tilt_polled.o
@@ -46,6 +47,7 @@ obj-$(CONFIG_INPUT_PMIC8XXX_PWRKEY) += pmic8xxx-pwrkey.o
46obj-$(CONFIG_INPUT_POWERMATE) += powermate.o 47obj-$(CONFIG_INPUT_POWERMATE) += powermate.o
47obj-$(CONFIG_INPUT_PWM_BEEPER) += pwm-beeper.o 48obj-$(CONFIG_INPUT_PWM_BEEPER) += pwm-beeper.o
48obj-$(CONFIG_INPUT_RB532_BUTTON) += rb532_button.o 49obj-$(CONFIG_INPUT_RB532_BUTTON) += rb532_button.o
50obj-$(CONFIG_INPUT_RETU_PWRBUTTON) += retu-pwrbutton.o
49obj-$(CONFIG_INPUT_GPIO_ROTARY_ENCODER) += rotary_encoder.o 51obj-$(CONFIG_INPUT_GPIO_ROTARY_ENCODER) += rotary_encoder.o
50obj-$(CONFIG_INPUT_SGI_BTNS) += sgi_btns.o 52obj-$(CONFIG_INPUT_SGI_BTNS) += sgi_btns.o
51obj-$(CONFIG_INPUT_SPARCSPKR) += sparcspkr.o 53obj-$(CONFIG_INPUT_SPARCSPKR) += sparcspkr.o
diff --git a/drivers/input/misc/ab8500-ponkey.c b/drivers/input/misc/ab8500-ponkey.c
index 84ec691c05aa..2f090b46e716 100644
--- a/drivers/input/misc/ab8500-ponkey.c
+++ b/drivers/input/misc/ab8500-ponkey.c
@@ -45,7 +45,7 @@ static irqreturn_t ab8500_ponkey_handler(int irq, void *data)
45 return IRQ_HANDLED; 45 return IRQ_HANDLED;
46} 46}
47 47
48static int __devinit ab8500_ponkey_probe(struct platform_device *pdev) 48static int ab8500_ponkey_probe(struct platform_device *pdev)
49{ 49{
50 struct ab8500 *ab8500 = dev_get_drvdata(pdev->dev.parent); 50 struct ab8500 *ab8500 = dev_get_drvdata(pdev->dev.parent);
51 struct ab8500_ponkey *ponkey; 51 struct ab8500_ponkey *ponkey;
@@ -118,7 +118,7 @@ err_free_mem:
118 return error; 118 return error;
119} 119}
120 120
121static int __devexit ab8500_ponkey_remove(struct platform_device *pdev) 121static int ab8500_ponkey_remove(struct platform_device *pdev)
122{ 122{
123 struct ab8500_ponkey *ponkey = platform_get_drvdata(pdev); 123 struct ab8500_ponkey *ponkey = platform_get_drvdata(pdev);
124 124
@@ -146,7 +146,7 @@ static struct platform_driver ab8500_ponkey_driver = {
146 .of_match_table = of_match_ptr(ab8500_ponkey_match), 146 .of_match_table = of_match_ptr(ab8500_ponkey_match),
147 }, 147 },
148 .probe = ab8500_ponkey_probe, 148 .probe = ab8500_ponkey_probe,
149 .remove = __devexit_p(ab8500_ponkey_remove), 149 .remove = ab8500_ponkey_remove,
150}; 150};
151module_platform_driver(ab8500_ponkey_driver); 151module_platform_driver(ab8500_ponkey_driver);
152 152
diff --git a/drivers/input/misc/ad714x-i2c.c b/drivers/input/misc/ad714x-i2c.c
index c8a79015472a..29d2064c26f2 100644
--- a/drivers/input/misc/ad714x-i2c.c
+++ b/drivers/input/misc/ad714x-i2c.c
@@ -72,7 +72,7 @@ static int ad714x_i2c_read(struct ad714x_chip *chip,
72 return 0; 72 return 0;
73} 73}
74 74
75static int __devinit ad714x_i2c_probe(struct i2c_client *client, 75static int ad714x_i2c_probe(struct i2c_client *client,
76 const struct i2c_device_id *id) 76 const struct i2c_device_id *id)
77{ 77{
78 struct ad714x_chip *chip; 78 struct ad714x_chip *chip;
@@ -87,7 +87,7 @@ static int __devinit ad714x_i2c_probe(struct i2c_client *client,
87 return 0; 87 return 0;
88} 88}
89 89
90static int __devexit ad714x_i2c_remove(struct i2c_client *client) 90static int ad714x_i2c_remove(struct i2c_client *client)
91{ 91{
92 struct ad714x_chip *chip = i2c_get_clientdata(client); 92 struct ad714x_chip *chip = i2c_get_clientdata(client);
93 93
@@ -112,7 +112,7 @@ static struct i2c_driver ad714x_i2c_driver = {
112 .pm = &ad714x_i2c_pm, 112 .pm = &ad714x_i2c_pm,
113 }, 113 },
114 .probe = ad714x_i2c_probe, 114 .probe = ad714x_i2c_probe,
115 .remove = __devexit_p(ad714x_i2c_remove), 115 .remove = ad714x_i2c_remove,
116 .id_table = ad714x_id, 116 .id_table = ad714x_id,
117}; 117};
118 118
diff --git a/drivers/input/misc/ad714x-spi.c b/drivers/input/misc/ad714x-spi.c
index 75f6136d608e..bdccca42d138 100644
--- a/drivers/input/misc/ad714x-spi.c
+++ b/drivers/input/misc/ad714x-spi.c
@@ -83,7 +83,7 @@ static int ad714x_spi_write(struct ad714x_chip *chip,
83 return 0; 83 return 0;
84} 84}
85 85
86static int __devinit ad714x_spi_probe(struct spi_device *spi) 86static int ad714x_spi_probe(struct spi_device *spi)
87{ 87{
88 struct ad714x_chip *chip; 88 struct ad714x_chip *chip;
89 int err; 89 int err;
@@ -103,7 +103,7 @@ static int __devinit ad714x_spi_probe(struct spi_device *spi)
103 return 0; 103 return 0;
104} 104}
105 105
106static int __devexit ad714x_spi_remove(struct spi_device *spi) 106static int ad714x_spi_remove(struct spi_device *spi)
107{ 107{
108 struct ad714x_chip *chip = spi_get_drvdata(spi); 108 struct ad714x_chip *chip = spi_get_drvdata(spi);
109 109
@@ -120,7 +120,7 @@ static struct spi_driver ad714x_spi_driver = {
120 .pm = &ad714x_spi_pm, 120 .pm = &ad714x_spi_pm,
121 }, 121 },
122 .probe = ad714x_spi_probe, 122 .probe = ad714x_spi_probe,
123 .remove = __devexit_p(ad714x_spi_remove), 123 .remove = ad714x_spi_remove,
124}; 124};
125 125
126module_spi_driver(ad714x_spi_driver); 126module_spi_driver(ad714x_spi_driver);
diff --git a/drivers/input/misc/adxl34x-i2c.c b/drivers/input/misc/adxl34x-i2c.c
index dd1d1c145a7f..535dda48cace 100644
--- a/drivers/input/misc/adxl34x-i2c.c
+++ b/drivers/input/misc/adxl34x-i2c.c
@@ -73,7 +73,7 @@ static const struct adxl34x_bus_ops adxl34x_i2c_bops = {
73 .read_block = adxl34x_i2c_read_block, 73 .read_block = adxl34x_i2c_read_block,
74}; 74};
75 75
76static int __devinit adxl34x_i2c_probe(struct i2c_client *client, 76static int adxl34x_i2c_probe(struct i2c_client *client,
77 const struct i2c_device_id *id) 77 const struct i2c_device_id *id)
78{ 78{
79 struct adxl34x *ac; 79 struct adxl34x *ac;
@@ -98,7 +98,7 @@ static int __devinit adxl34x_i2c_probe(struct i2c_client *client,
98 return 0; 98 return 0;
99} 99}
100 100
101static int __devexit adxl34x_i2c_remove(struct i2c_client *client) 101static int adxl34x_i2c_remove(struct i2c_client *client)
102{ 102{
103 struct adxl34x *ac = i2c_get_clientdata(client); 103 struct adxl34x *ac = i2c_get_clientdata(client);
104 104
@@ -144,7 +144,7 @@ static struct i2c_driver adxl34x_driver = {
144 .pm = &adxl34x_i2c_pm, 144 .pm = &adxl34x_i2c_pm,
145 }, 145 },
146 .probe = adxl34x_i2c_probe, 146 .probe = adxl34x_i2c_probe,
147 .remove = __devexit_p(adxl34x_i2c_remove), 147 .remove = adxl34x_i2c_remove,
148 .id_table = adxl34x_id, 148 .id_table = adxl34x_id,
149}; 149};
150 150
diff --git a/drivers/input/misc/adxl34x-spi.c b/drivers/input/misc/adxl34x-spi.c
index 820a802a1e6e..ad5f40d37e48 100644
--- a/drivers/input/misc/adxl34x-spi.c
+++ b/drivers/input/misc/adxl34x-spi.c
@@ -65,7 +65,7 @@ static const struct adxl34x_bus_ops adxl34x_spi_bops = {
65 .read_block = adxl34x_spi_read_block, 65 .read_block = adxl34x_spi_read_block,
66}; 66};
67 67
68static int __devinit adxl34x_spi_probe(struct spi_device *spi) 68static int adxl34x_spi_probe(struct spi_device *spi)
69{ 69{
70 struct adxl34x *ac; 70 struct adxl34x *ac;
71 71
@@ -87,7 +87,7 @@ static int __devinit adxl34x_spi_probe(struct spi_device *spi)
87 return 0; 87 return 0;
88} 88}
89 89
90static int __devexit adxl34x_spi_remove(struct spi_device *spi) 90static int adxl34x_spi_remove(struct spi_device *spi)
91{ 91{
92 struct adxl34x *ac = dev_get_drvdata(&spi->dev); 92 struct adxl34x *ac = dev_get_drvdata(&spi->dev);
93 93
@@ -126,7 +126,7 @@ static struct spi_driver adxl34x_driver = {
126 .pm = &adxl34x_spi_pm, 126 .pm = &adxl34x_spi_pm,
127 }, 127 },
128 .probe = adxl34x_spi_probe, 128 .probe = adxl34x_spi_probe,
129 .remove = __devexit_p(adxl34x_spi_remove), 129 .remove = adxl34x_spi_remove,
130}; 130};
131 131
132module_spi_driver(adxl34x_driver); 132module_spi_driver(adxl34x_driver);
diff --git a/drivers/input/misc/bfin_rotary.c b/drivers/input/misc/bfin_rotary.c
index 1c4146fccfdf..a6666e142a91 100644
--- a/drivers/input/misc/bfin_rotary.c
+++ b/drivers/input/misc/bfin_rotary.c
@@ -90,7 +90,7 @@ static irqreturn_t bfin_rotary_isr(int irq, void *dev_id)
90 return IRQ_HANDLED; 90 return IRQ_HANDLED;
91} 91}
92 92
93static int __devinit bfin_rotary_probe(struct platform_device *pdev) 93static int bfin_rotary_probe(struct platform_device *pdev)
94{ 94{
95 struct bfin_rotary_platform_data *pdata = pdev->dev.platform_data; 95 struct bfin_rotary_platform_data *pdata = pdev->dev.platform_data;
96 struct bfin_rot *rotary; 96 struct bfin_rot *rotary;
@@ -196,7 +196,7 @@ out1:
196 return error; 196 return error;
197} 197}
198 198
199static int __devexit bfin_rotary_remove(struct platform_device *pdev) 199static int bfin_rotary_remove(struct platform_device *pdev)
200{ 200{
201 struct bfin_rot *rotary = platform_get_drvdata(pdev); 201 struct bfin_rot *rotary = platform_get_drvdata(pdev);
202 202
@@ -255,7 +255,7 @@ static const struct dev_pm_ops bfin_rotary_pm_ops = {
255 255
256static struct platform_driver bfin_rotary_device_driver = { 256static struct platform_driver bfin_rotary_device_driver = {
257 .probe = bfin_rotary_probe, 257 .probe = bfin_rotary_probe,
258 .remove = __devexit_p(bfin_rotary_remove), 258 .remove = bfin_rotary_remove,
259 .driver = { 259 .driver = {
260 .name = "bfin-rotary", 260 .name = "bfin-rotary",
261 .owner = THIS_MODULE, 261 .owner = THIS_MODULE,
diff --git a/drivers/input/misc/bma150.c b/drivers/input/misc/bma150.c
index e2f1e9f952b1..08ffcabd7220 100644
--- a/drivers/input/misc/bma150.c
+++ b/drivers/input/misc/bma150.c
@@ -158,7 +158,7 @@ struct bma150_data {
158 * are stated and verified by Bosch Sensortec where they are configured 158 * are stated and verified by Bosch Sensortec where they are configured
159 * to provide a generic sensitivity performance. 159 * to provide a generic sensitivity performance.
160 */ 160 */
161static struct bma150_cfg default_cfg __devinitdata = { 161static struct bma150_cfg default_cfg = {
162 .any_motion_int = 1, 162 .any_motion_int = 1,
163 .hg_int = 1, 163 .hg_int = 1,
164 .lg_int = 1, 164 .lg_int = 1,
@@ -224,7 +224,7 @@ static int bma150_set_mode(struct bma150_data *bma150, u8 mode)
224 return 0; 224 return 0;
225} 225}
226 226
227static int __devinit bma150_soft_reset(struct bma150_data *bma150) 227static int bma150_soft_reset(struct bma150_data *bma150)
228{ 228{
229 int error; 229 int error;
230 230
@@ -237,19 +237,19 @@ static int __devinit bma150_soft_reset(struct bma150_data *bma150)
237 return 0; 237 return 0;
238} 238}
239 239
240static int __devinit bma150_set_range(struct bma150_data *bma150, u8 range) 240static int bma150_set_range(struct bma150_data *bma150, u8 range)
241{ 241{
242 return bma150_set_reg_bits(bma150->client, range, BMA150_RANGE_POS, 242 return bma150_set_reg_bits(bma150->client, range, BMA150_RANGE_POS,
243 BMA150_RANGE_MSK, BMA150_RANGE_REG); 243 BMA150_RANGE_MSK, BMA150_RANGE_REG);
244} 244}
245 245
246static int __devinit bma150_set_bandwidth(struct bma150_data *bma150, u8 bw) 246static int bma150_set_bandwidth(struct bma150_data *bma150, u8 bw)
247{ 247{
248 return bma150_set_reg_bits(bma150->client, bw, BMA150_BANDWIDTH_POS, 248 return bma150_set_reg_bits(bma150->client, bw, BMA150_BANDWIDTH_POS,
249 BMA150_BANDWIDTH_MSK, BMA150_BANDWIDTH_REG); 249 BMA150_BANDWIDTH_MSK, BMA150_BANDWIDTH_REG);
250} 250}
251 251
252static int __devinit bma150_set_low_g_interrupt(struct bma150_data *bma150, 252static int bma150_set_low_g_interrupt(struct bma150_data *bma150,
253 u8 enable, u8 hyst, u8 dur, u8 thres) 253 u8 enable, u8 hyst, u8 dur, u8 thres)
254{ 254{
255 int error; 255 int error;
@@ -273,7 +273,7 @@ static int __devinit bma150_set_low_g_interrupt(struct bma150_data *bma150,
273 BMA150_LOW_G_EN_REG); 273 BMA150_LOW_G_EN_REG);
274} 274}
275 275
276static int __devinit bma150_set_high_g_interrupt(struct bma150_data *bma150, 276static int bma150_set_high_g_interrupt(struct bma150_data *bma150,
277 u8 enable, u8 hyst, u8 dur, u8 thres) 277 u8 enable, u8 hyst, u8 dur, u8 thres)
278{ 278{
279 int error; 279 int error;
@@ -300,7 +300,7 @@ static int __devinit bma150_set_high_g_interrupt(struct bma150_data *bma150,
300} 300}
301 301
302 302
303static int __devinit bma150_set_any_motion_interrupt(struct bma150_data *bma150, 303static int bma150_set_any_motion_interrupt(struct bma150_data *bma150,
304 u8 enable, u8 dur, u8 thres) 304 u8 enable, u8 dur, u8 thres)
305{ 305{
306 int error; 306 int error;
@@ -424,7 +424,7 @@ static void bma150_poll_close(struct input_polled_dev *ipoll_dev)
424 bma150_close(bma150); 424 bma150_close(bma150);
425} 425}
426 426
427static int __devinit bma150_initialize(struct bma150_data *bma150, 427static int bma150_initialize(struct bma150_data *bma150,
428 const struct bma150_cfg *cfg) 428 const struct bma150_cfg *cfg)
429{ 429{
430 int error; 430 int error;
@@ -465,7 +465,7 @@ static int __devinit bma150_initialize(struct bma150_data *bma150,
465 return bma150_set_mode(bma150, BMA150_MODE_SLEEP); 465 return bma150_set_mode(bma150, BMA150_MODE_SLEEP);
466} 466}
467 467
468static void __devinit bma150_init_input_device(struct bma150_data *bma150, 468static void bma150_init_input_device(struct bma150_data *bma150,
469 struct input_dev *idev) 469 struct input_dev *idev)
470{ 470{
471 idev->name = BMA150_DRIVER; 471 idev->name = BMA150_DRIVER;
@@ -479,7 +479,7 @@ static void __devinit bma150_init_input_device(struct bma150_data *bma150,
479 input_set_abs_params(idev, ABS_Z, ABSMIN_ACC_VAL, ABSMAX_ACC_VAL, 0, 0); 479 input_set_abs_params(idev, ABS_Z, ABSMIN_ACC_VAL, ABSMAX_ACC_VAL, 0, 0);
480} 480}
481 481
482static int __devinit bma150_register_input_device(struct bma150_data *bma150) 482static int bma150_register_input_device(struct bma150_data *bma150)
483{ 483{
484 struct input_dev *idev; 484 struct input_dev *idev;
485 int error; 485 int error;
@@ -504,7 +504,7 @@ static int __devinit bma150_register_input_device(struct bma150_data *bma150)
504 return 0; 504 return 0;
505} 505}
506 506
507static int __devinit bma150_register_polled_device(struct bma150_data *bma150) 507static int bma150_register_polled_device(struct bma150_data *bma150)
508{ 508{
509 struct input_polled_dev *ipoll_dev; 509 struct input_polled_dev *ipoll_dev;
510 int error; 510 int error;
@@ -535,7 +535,7 @@ static int __devinit bma150_register_polled_device(struct bma150_data *bma150)
535 return 0; 535 return 0;
536} 536}
537 537
538static int __devinit bma150_probe(struct i2c_client *client, 538static int bma150_probe(struct i2c_client *client,
539 const struct i2c_device_id *id) 539 const struct i2c_device_id *id)
540{ 540{
541 const struct bma150_platform_data *pdata = client->dev.platform_data; 541 const struct bma150_platform_data *pdata = client->dev.platform_data;
@@ -613,7 +613,7 @@ err_free_mem:
613 return error; 613 return error;
614} 614}
615 615
616static int __devexit bma150_remove(struct i2c_client *client) 616static int bma150_remove(struct i2c_client *client)
617{ 617{
618 struct bma150_data *bma150 = i2c_get_clientdata(client); 618 struct bma150_data *bma150 = i2c_get_clientdata(client);
619 619
@@ -670,7 +670,7 @@ static struct i2c_driver bma150_driver = {
670 .class = I2C_CLASS_HWMON, 670 .class = I2C_CLASS_HWMON,
671 .id_table = bma150_id, 671 .id_table = bma150_id,
672 .probe = bma150_probe, 672 .probe = bma150_probe,
673 .remove = __devexit_p(bma150_remove), 673 .remove = bma150_remove,
674}; 674};
675 675
676module_i2c_driver(bma150_driver); 676module_i2c_driver(bma150_driver);
diff --git a/drivers/input/misc/cma3000_d0x_i2c.c b/drivers/input/misc/cma3000_d0x_i2c.c
index fe9b85f07792..4fdef98ceb56 100644
--- a/drivers/input/misc/cma3000_d0x_i2c.c
+++ b/drivers/input/misc/cma3000_d0x_i2c.c
@@ -55,7 +55,7 @@ static const struct cma3000_bus_ops cma3000_i2c_bops = {
55 .write = cma3000_i2c_set, 55 .write = cma3000_i2c_set,
56}; 56};
57 57
58static int __devinit cma3000_i2c_probe(struct i2c_client *client, 58static int cma3000_i2c_probe(struct i2c_client *client,
59 const struct i2c_device_id *id) 59 const struct i2c_device_id *id)
60{ 60{
61 struct cma3000_accl_data *data; 61 struct cma3000_accl_data *data;
@@ -69,7 +69,7 @@ static int __devinit cma3000_i2c_probe(struct i2c_client *client,
69 return 0; 69 return 0;
70} 70}
71 71
72static int __devexit cma3000_i2c_remove(struct i2c_client *client) 72static int cma3000_i2c_remove(struct i2c_client *client)
73{ 73{
74 struct cma3000_accl_data *data = i2c_get_clientdata(client); 74 struct cma3000_accl_data *data = i2c_get_clientdata(client);
75 75
@@ -114,7 +114,7 @@ MODULE_DEVICE_TABLE(i2c, cma3000_i2c_id);
114 114
115static struct i2c_driver cma3000_i2c_driver = { 115static struct i2c_driver cma3000_i2c_driver = {
116 .probe = cma3000_i2c_probe, 116 .probe = cma3000_i2c_probe,
117 .remove = __devexit_p(cma3000_i2c_remove), 117 .remove = cma3000_i2c_remove,
118 .id_table = cma3000_i2c_id, 118 .id_table = cma3000_i2c_id,
119 .driver = { 119 .driver = {
120 .name = "cma3000_i2c_accl", 120 .name = "cma3000_i2c_accl",
diff --git a/drivers/input/misc/cobalt_btns.c b/drivers/input/misc/cobalt_btns.c
index 53e43d295148..4f77f87847e8 100644
--- a/drivers/input/misc/cobalt_btns.c
+++ b/drivers/input/misc/cobalt_btns.c
@@ -73,7 +73,7 @@ static void handle_buttons(struct input_polled_dev *dev)
73 } 73 }
74} 74}
75 75
76static int __devinit cobalt_buttons_probe(struct platform_device *pdev) 76static int cobalt_buttons_probe(struct platform_device *pdev)
77{ 77{
78 struct buttons_dev *bdev; 78 struct buttons_dev *bdev;
79 struct input_polled_dev *poll_dev; 79 struct input_polled_dev *poll_dev;
@@ -135,7 +135,7 @@ static int __devinit cobalt_buttons_probe(struct platform_device *pdev)
135 return error; 135 return error;
136} 136}
137 137
138static int __devexit cobalt_buttons_remove(struct platform_device *pdev) 138static int cobalt_buttons_remove(struct platform_device *pdev)
139{ 139{
140 struct device *dev = &pdev->dev; 140 struct device *dev = &pdev->dev;
141 struct buttons_dev *bdev = dev_get_drvdata(dev); 141 struct buttons_dev *bdev = dev_get_drvdata(dev);
@@ -157,7 +157,7 @@ MODULE_ALIAS("platform:Cobalt buttons");
157 157
158static struct platform_driver cobalt_buttons_driver = { 158static struct platform_driver cobalt_buttons_driver = {
159 .probe = cobalt_buttons_probe, 159 .probe = cobalt_buttons_probe,
160 .remove = __devexit_p(cobalt_buttons_remove), 160 .remove = cobalt_buttons_remove,
161 .driver = { 161 .driver = {
162 .name = "Cobalt buttons", 162 .name = "Cobalt buttons",
163 .owner = THIS_MODULE, 163 .owner = THIS_MODULE,
diff --git a/drivers/input/misc/da9052_onkey.c b/drivers/input/misc/da9052_onkey.c
index 3be3acc3a6eb..020569a499f2 100644
--- a/drivers/input/misc/da9052_onkey.c
+++ b/drivers/input/misc/da9052_onkey.c
@@ -70,7 +70,7 @@ static irqreturn_t da9052_onkey_irq(int irq, void *data)
70 return IRQ_HANDLED; 70 return IRQ_HANDLED;
71} 71}
72 72
73static int __devinit da9052_onkey_probe(struct platform_device *pdev) 73static int da9052_onkey_probe(struct platform_device *pdev)
74{ 74{
75 struct da9052 *da9052 = dev_get_drvdata(pdev->dev.parent); 75 struct da9052 *da9052 = dev_get_drvdata(pdev->dev.parent);
76 struct da9052_onkey *onkey; 76 struct da9052_onkey *onkey;
@@ -129,7 +129,7 @@ err_free_mem:
129 return error; 129 return error;
130} 130}
131 131
132static int __devexit da9052_onkey_remove(struct platform_device *pdev) 132static int da9052_onkey_remove(struct platform_device *pdev)
133{ 133{
134 struct da9052_onkey *onkey = platform_get_drvdata(pdev); 134 struct da9052_onkey *onkey = platform_get_drvdata(pdev);
135 135
@@ -144,7 +144,7 @@ static int __devexit da9052_onkey_remove(struct platform_device *pdev)
144 144
145static struct platform_driver da9052_onkey_driver = { 145static struct platform_driver da9052_onkey_driver = {
146 .probe = da9052_onkey_probe, 146 .probe = da9052_onkey_probe,
147 .remove = __devexit_p(da9052_onkey_remove), 147 .remove = da9052_onkey_remove,
148 .driver = { 148 .driver = {
149 .name = "da9052-onkey", 149 .name = "da9052-onkey",
150 .owner = THIS_MODULE, 150 .owner = THIS_MODULE,
diff --git a/drivers/input/misc/da9055_onkey.c b/drivers/input/misc/da9055_onkey.c
new file mode 100644
index 000000000000..ee6ae3a00174
--- /dev/null
+++ b/drivers/input/misc/da9055_onkey.c
@@ -0,0 +1,171 @@
1/*
2 * ON pin driver for Dialog DA9055 PMICs
3 *
4 * Copyright(c) 2012 Dialog Semiconductor Ltd.
5 *
6 * Author: David Dajun Chen <dchen@diasemi.com>
7 *
8 * This program is free software; you can redistribute it and/or modify it
9 * under the terms of the GNU General Public License as published by the
10 * Free Software Foundation; either version 2 of the License, or (at your
11 * option) any later version.
12 */
13
14#include <linux/init.h>
15#include <linux/input.h>
16#include <linux/module.h>
17#include <linux/platform_device.h>
18
19#include <linux/mfd/da9055/core.h>
20#include <linux/mfd/da9055/reg.h>
21
22struct da9055_onkey {
23 struct da9055 *da9055;
24 struct input_dev *input;
25 struct delayed_work work;
26};
27
28static void da9055_onkey_query(struct da9055_onkey *onkey)
29{
30 int key_stat;
31
32 key_stat = da9055_reg_read(onkey->da9055, DA9055_REG_STATUS_A);
33 if (key_stat < 0) {
34 dev_err(onkey->da9055->dev,
35 "Failed to read onkey event %d\n", key_stat);
36 } else {
37 key_stat &= DA9055_NOKEY_STS;
38 /*
39 * Onkey status bit is cleared when onkey button is relased.
40 */
41 if (!key_stat) {
42 input_report_key(onkey->input, KEY_POWER, 0);
43 input_sync(onkey->input);
44 }
45 }
46
47 /*
48 * Interrupt is generated only when the ONKEY pin is asserted.
49 * Hence the deassertion of the pin is simulated through work queue.
50 */
51 if (key_stat)
52 schedule_delayed_work(&onkey->work, msecs_to_jiffies(10));
53
54}
55
56static void da9055_onkey_work(struct work_struct *work)
57{
58 struct da9055_onkey *onkey = container_of(work, struct da9055_onkey,
59 work.work);
60
61 da9055_onkey_query(onkey);
62}
63
64static irqreturn_t da9055_onkey_irq(int irq, void *data)
65{
66 struct da9055_onkey *onkey = data;
67
68 input_report_key(onkey->input, KEY_POWER, 1);
69 input_sync(onkey->input);
70
71 da9055_onkey_query(onkey);
72
73 return IRQ_HANDLED;
74}
75
76static int da9055_onkey_probe(struct platform_device *pdev)
77{
78 struct da9055 *da9055 = dev_get_drvdata(pdev->dev.parent);
79 struct da9055_onkey *onkey;
80 struct input_dev *input_dev;
81 int irq, err;
82
83 irq = platform_get_irq_byname(pdev, "ONKEY");
84 if (irq < 0) {
85 dev_err(&pdev->dev,
86 "Failed to get an IRQ for input device, %d\n", irq);
87 return -EINVAL;
88 }
89
90 onkey = devm_kzalloc(&pdev->dev, sizeof(*onkey), GFP_KERNEL);
91 if (!onkey) {
92 dev_err(&pdev->dev, "Failed to allocate memory\n");
93 return -ENOMEM;
94 }
95
96 input_dev = input_allocate_device();
97 if (!input_dev) {
98 dev_err(&pdev->dev, "Failed to allocate memory\n");
99 return -ENOMEM;
100 }
101
102 onkey->input = input_dev;
103 onkey->da9055 = da9055;
104 input_dev->name = "da9055-onkey";
105 input_dev->phys = "da9055-onkey/input0";
106 input_dev->dev.parent = &pdev->dev;
107
108 input_dev->evbit[0] = BIT_MASK(EV_KEY);
109 __set_bit(KEY_POWER, input_dev->keybit);
110
111 INIT_DELAYED_WORK(&onkey->work, da9055_onkey_work);
112
113 irq = regmap_irq_get_virq(da9055->irq_data, irq);
114 err = request_threaded_irq(irq, NULL, da9055_onkey_irq,
115 IRQF_TRIGGER_HIGH | IRQF_ONESHOT,
116 "ONKEY", onkey);
117 if (err < 0) {
118 dev_err(&pdev->dev,
119 "Failed to register ONKEY IRQ %d, error = %d\n",
120 irq, err);
121 goto err_free_input;
122 }
123
124 err = input_register_device(input_dev);
125 if (err) {
126 dev_err(&pdev->dev, "Unable to register input device, %d\n",
127 err);
128 goto err_free_irq;
129 }
130
131 platform_set_drvdata(pdev, onkey);
132
133 return 0;
134
135err_free_irq:
136 free_irq(irq, onkey);
137 cancel_delayed_work_sync(&onkey->work);
138err_free_input:
139 input_free_device(input_dev);
140
141 return err;
142}
143
144static int da9055_onkey_remove(struct platform_device *pdev)
145{
146 struct da9055_onkey *onkey = platform_get_drvdata(pdev);
147 int irq = platform_get_irq_byname(pdev, "ONKEY");
148
149 irq = regmap_irq_get_virq(onkey->da9055->irq_data, irq);
150 free_irq(irq, onkey);
151 cancel_delayed_work_sync(&onkey->work);
152 input_unregister_device(onkey->input);
153
154 return 0;
155}
156
157static struct platform_driver da9055_onkey_driver = {
158 .probe = da9055_onkey_probe,
159 .remove = da9055_onkey_remove,
160 .driver = {
161 .name = "da9055-onkey",
162 .owner = THIS_MODULE,
163 },
164};
165
166module_platform_driver(da9055_onkey_driver);
167
168MODULE_AUTHOR("David Dajun Chen <dchen@diasemi.com>");
169MODULE_DESCRIPTION("Onkey driver for DA9055");
170MODULE_LICENSE("GPL");
171MODULE_ALIAS("platform:da9055-onkey");
diff --git a/drivers/input/misc/dm355evm_keys.c b/drivers/input/misc/dm355evm_keys.c
index c1313d8535c3..a309a5c0899e 100644
--- a/drivers/input/misc/dm355evm_keys.c
+++ b/drivers/input/misc/dm355evm_keys.c
@@ -173,7 +173,7 @@ static irqreturn_t dm355evm_keys_irq(int irq, void *_keys)
173 173
174/*----------------------------------------------------------------------*/ 174/*----------------------------------------------------------------------*/
175 175
176static int __devinit dm355evm_keys_probe(struct platform_device *pdev) 176static int dm355evm_keys_probe(struct platform_device *pdev)
177{ 177{
178 struct dm355evm_keys *keys; 178 struct dm355evm_keys *keys;
179 struct input_dev *input; 179 struct input_dev *input;
@@ -239,7 +239,7 @@ fail1:
239 return status; 239 return status;
240} 240}
241 241
242static int __devexit dm355evm_keys_remove(struct platform_device *pdev) 242static int dm355evm_keys_remove(struct platform_device *pdev)
243{ 243{
244 struct dm355evm_keys *keys = platform_get_drvdata(pdev); 244 struct dm355evm_keys *keys = platform_get_drvdata(pdev);
245 245
@@ -262,7 +262,7 @@ static int __devexit dm355evm_keys_remove(struct platform_device *pdev)
262 */ 262 */
263static struct platform_driver dm355evm_keys_driver = { 263static struct platform_driver dm355evm_keys_driver = {
264 .probe = dm355evm_keys_probe, 264 .probe = dm355evm_keys_probe,
265 .remove = __devexit_p(dm355evm_keys_remove), 265 .remove = dm355evm_keys_remove,
266 .driver = { 266 .driver = {
267 .owner = THIS_MODULE, 267 .owner = THIS_MODULE,
268 .name = "dm355evm_keys", 268 .name = "dm355evm_keys",
diff --git a/drivers/input/misc/gp2ap002a00f.c b/drivers/input/misc/gp2ap002a00f.c
index b6664cfa340a..fe30bd0fe4bd 100644
--- a/drivers/input/misc/gp2ap002a00f.c
+++ b/drivers/input/misc/gp2ap002a00f.c
@@ -98,7 +98,7 @@ static void gp2a_device_close(struct input_dev *dev)
98 "unable to deactivate, err %d\n", error); 98 "unable to deactivate, err %d\n", error);
99} 99}
100 100
101static int __devinit gp2a_initialize(struct gp2a_data *dt) 101static int gp2a_initialize(struct gp2a_data *dt)
102{ 102{
103 int error; 103 int error;
104 104
@@ -122,7 +122,7 @@ static int __devinit gp2a_initialize(struct gp2a_data *dt)
122 return error; 122 return error;
123} 123}
124 124
125static int __devinit gp2a_probe(struct i2c_client *client, 125static int gp2a_probe(struct i2c_client *client,
126 const struct i2c_device_id *id) 126 const struct i2c_device_id *id)
127{ 127{
128 const struct gp2a_platform_data *pdata = client->dev.platform_data; 128 const struct gp2a_platform_data *pdata = client->dev.platform_data;
@@ -205,7 +205,7 @@ err_hw_shutdown:
205 return error; 205 return error;
206} 206}
207 207
208static int __devexit gp2a_remove(struct i2c_client *client) 208static int gp2a_remove(struct i2c_client *client)
209{ 209{
210 struct gp2a_data *dt = i2c_get_clientdata(client); 210 struct gp2a_data *dt = i2c_get_clientdata(client);
211 const struct gp2a_platform_data *pdata = dt->pdata; 211 const struct gp2a_platform_data *pdata = dt->pdata;
@@ -277,7 +277,7 @@ static struct i2c_driver gp2a_i2c_driver = {
277 .pm = &gp2a_pm, 277 .pm = &gp2a_pm,
278 }, 278 },
279 .probe = gp2a_probe, 279 .probe = gp2a_probe,
280 .remove = __devexit_p(gp2a_remove), 280 .remove = gp2a_remove,
281 .id_table = gp2a_i2c_id, 281 .id_table = gp2a_i2c_id,
282}; 282};
283 283
diff --git a/drivers/input/misc/gpio_tilt_polled.c b/drivers/input/misc/gpio_tilt_polled.c
index 277a0574c199..da05cca8b562 100644
--- a/drivers/input/misc/gpio_tilt_polled.c
+++ b/drivers/input/misc/gpio_tilt_polled.c
@@ -96,7 +96,7 @@ static void gpio_tilt_polled_close(struct input_polled_dev *dev)
96 pdata->disable(tdev->dev); 96 pdata->disable(tdev->dev);
97} 97}
98 98
99static int __devinit gpio_tilt_polled_probe(struct platform_device *pdev) 99static int gpio_tilt_polled_probe(struct platform_device *pdev)
100{ 100{
101 const struct gpio_tilt_platform_data *pdata = pdev->dev.platform_data; 101 const struct gpio_tilt_platform_data *pdata = pdev->dev.platform_data;
102 struct device *dev = &pdev->dev; 102 struct device *dev = &pdev->dev;
@@ -179,7 +179,7 @@ err_free_tdev:
179 return error; 179 return error;
180} 180}
181 181
182static int __devexit gpio_tilt_polled_remove(struct platform_device *pdev) 182static int gpio_tilt_polled_remove(struct platform_device *pdev)
183{ 183{
184 struct gpio_tilt_polled_dev *tdev = platform_get_drvdata(pdev); 184 struct gpio_tilt_polled_dev *tdev = platform_get_drvdata(pdev);
185 const struct gpio_tilt_platform_data *pdata = tdev->pdata; 185 const struct gpio_tilt_platform_data *pdata = tdev->pdata;
@@ -198,7 +198,7 @@ static int __devexit gpio_tilt_polled_remove(struct platform_device *pdev)
198 198
199static struct platform_driver gpio_tilt_polled_driver = { 199static struct platform_driver gpio_tilt_polled_driver = {
200 .probe = gpio_tilt_polled_probe, 200 .probe = gpio_tilt_polled_probe,
201 .remove = __devexit_p(gpio_tilt_polled_remove), 201 .remove = gpio_tilt_polled_remove,
202 .driver = { 202 .driver = {
203 .name = DRV_NAME, 203 .name = DRV_NAME,
204 .owner = THIS_MODULE, 204 .owner = THIS_MODULE,
diff --git a/drivers/input/misc/ixp4xx-beeper.c b/drivers/input/misc/ixp4xx-beeper.c
index 50e283068301..6ab3decc86e6 100644
--- a/drivers/input/misc/ixp4xx-beeper.c
+++ b/drivers/input/misc/ixp4xx-beeper.c
@@ -87,7 +87,7 @@ static irqreturn_t ixp4xx_spkr_interrupt(int irq, void *dev_id)
87 return IRQ_HANDLED; 87 return IRQ_HANDLED;
88} 88}
89 89
90static int __devinit ixp4xx_spkr_probe(struct platform_device *dev) 90static int ixp4xx_spkr_probe(struct platform_device *dev)
91{ 91{
92 struct input_dev *input_dev; 92 struct input_dev *input_dev;
93 int err; 93 int err;
@@ -132,7 +132,7 @@ static int __devinit ixp4xx_spkr_probe(struct platform_device *dev)
132 return err; 132 return err;
133} 133}
134 134
135static int __devexit ixp4xx_spkr_remove(struct platform_device *dev) 135static int ixp4xx_spkr_remove(struct platform_device *dev)
136{ 136{
137 struct input_dev *input_dev = platform_get_drvdata(dev); 137 struct input_dev *input_dev = platform_get_drvdata(dev);
138 unsigned int pin = (unsigned int) input_get_drvdata(input_dev); 138 unsigned int pin = (unsigned int) input_get_drvdata(input_dev);
@@ -165,7 +165,7 @@ static struct platform_driver ixp4xx_spkr_platform_driver = {
165 .owner = THIS_MODULE, 165 .owner = THIS_MODULE,
166 }, 166 },
167 .probe = ixp4xx_spkr_probe, 167 .probe = ixp4xx_spkr_probe,
168 .remove = __devexit_p(ixp4xx_spkr_remove), 168 .remove = ixp4xx_spkr_remove,
169 .shutdown = ixp4xx_spkr_shutdown, 169 .shutdown = ixp4xx_spkr_shutdown,
170}; 170};
171module_platform_driver(ixp4xx_spkr_platform_driver); 171module_platform_driver(ixp4xx_spkr_platform_driver);
diff --git a/drivers/input/misc/kxtj9.c b/drivers/input/misc/kxtj9.c
index f46139f19ff1..a993b67a8a5b 100644
--- a/drivers/input/misc/kxtj9.c
+++ b/drivers/input/misc/kxtj9.c
@@ -295,7 +295,7 @@ static void kxtj9_input_close(struct input_dev *dev)
295 kxtj9_disable(tj9); 295 kxtj9_disable(tj9);
296} 296}
297 297
298static void __devinit kxtj9_init_input_device(struct kxtj9_data *tj9, 298static void kxtj9_init_input_device(struct kxtj9_data *tj9,
299 struct input_dev *input_dev) 299 struct input_dev *input_dev)
300{ 300{
301 __set_bit(EV_ABS, input_dev->evbit); 301 __set_bit(EV_ABS, input_dev->evbit);
@@ -308,7 +308,7 @@ static void __devinit kxtj9_init_input_device(struct kxtj9_data *tj9,
308 input_dev->dev.parent = &tj9->client->dev; 308 input_dev->dev.parent = &tj9->client->dev;
309} 309}
310 310
311static int __devinit kxtj9_setup_input_device(struct kxtj9_data *tj9) 311static int kxtj9_setup_input_device(struct kxtj9_data *tj9)
312{ 312{
313 struct input_dev *input_dev; 313 struct input_dev *input_dev;
314 int err; 314 int err;
@@ -433,7 +433,7 @@ static void kxtj9_polled_input_close(struct input_polled_dev *dev)
433 kxtj9_disable(tj9); 433 kxtj9_disable(tj9);
434} 434}
435 435
436static int __devinit kxtj9_setup_polled_device(struct kxtj9_data *tj9) 436static int kxtj9_setup_polled_device(struct kxtj9_data *tj9)
437{ 437{
438 int err; 438 int err;
439 struct input_polled_dev *poll_dev; 439 struct input_polled_dev *poll_dev;
@@ -466,7 +466,7 @@ static int __devinit kxtj9_setup_polled_device(struct kxtj9_data *tj9)
466 return 0; 466 return 0;
467} 467}
468 468
469static void __devexit kxtj9_teardown_polled_device(struct kxtj9_data *tj9) 469static void kxtj9_teardown_polled_device(struct kxtj9_data *tj9)
470{ 470{
471 input_unregister_polled_device(tj9->poll_dev); 471 input_unregister_polled_device(tj9->poll_dev);
472 input_free_polled_device(tj9->poll_dev); 472 input_free_polled_device(tj9->poll_dev);
@@ -485,7 +485,7 @@ static inline void kxtj9_teardown_polled_device(struct kxtj9_data *tj9)
485 485
486#endif 486#endif
487 487
488static int __devinit kxtj9_verify(struct kxtj9_data *tj9) 488static int kxtj9_verify(struct kxtj9_data *tj9)
489{ 489{
490 int retval; 490 int retval;
491 491
@@ -506,7 +506,7 @@ out:
506 return retval; 506 return retval;
507} 507}
508 508
509static int __devinit kxtj9_probe(struct i2c_client *client, 509static int kxtj9_probe(struct i2c_client *client,
510 const struct i2c_device_id *id) 510 const struct i2c_device_id *id)
511{ 511{
512 const struct kxtj9_platform_data *pdata = client->dev.platform_data; 512 const struct kxtj9_platform_data *pdata = client->dev.platform_data;
@@ -594,7 +594,7 @@ err_free_mem:
594 return err; 594 return err;
595} 595}
596 596
597static int __devexit kxtj9_remove(struct i2c_client *client) 597static int kxtj9_remove(struct i2c_client *client)
598{ 598{
599 struct kxtj9_data *tj9 = i2c_get_clientdata(client); 599 struct kxtj9_data *tj9 = i2c_get_clientdata(client);
600 600
@@ -663,7 +663,7 @@ static struct i2c_driver kxtj9_driver = {
663 .pm = &kxtj9_pm_ops, 663 .pm = &kxtj9_pm_ops,
664 }, 664 },
665 .probe = kxtj9_probe, 665 .probe = kxtj9_probe,
666 .remove = __devexit_p(kxtj9_remove), 666 .remove = kxtj9_remove,
667 .id_table = kxtj9_id, 667 .id_table = kxtj9_id,
668}; 668};
669 669
diff --git a/drivers/input/misc/m68kspkr.c b/drivers/input/misc/m68kspkr.c
index 0c64d9bb718e..b40ee4b47f4f 100644
--- a/drivers/input/misc/m68kspkr.c
+++ b/drivers/input/misc/m68kspkr.c
@@ -48,7 +48,7 @@ static int m68kspkr_event(struct input_dev *dev, unsigned int type, unsigned int
48 return 0; 48 return 0;
49} 49}
50 50
51static int __devinit m68kspkr_probe(struct platform_device *dev) 51static int m68kspkr_probe(struct platform_device *dev)
52{ 52{
53 struct input_dev *input_dev; 53 struct input_dev *input_dev;
54 int err; 54 int err;
@@ -80,7 +80,7 @@ static int __devinit m68kspkr_probe(struct platform_device *dev)
80 return 0; 80 return 0;
81} 81}
82 82
83static int __devexit m68kspkr_remove(struct platform_device *dev) 83static int m68kspkr_remove(struct platform_device *dev)
84{ 84{
85 struct input_dev *input_dev = platform_get_drvdata(dev); 85 struct input_dev *input_dev = platform_get_drvdata(dev);
86 86
@@ -104,7 +104,7 @@ static struct platform_driver m68kspkr_platform_driver = {
104 .owner = THIS_MODULE, 104 .owner = THIS_MODULE,
105 }, 105 },
106 .probe = m68kspkr_probe, 106 .probe = m68kspkr_probe,
107 .remove = __devexit_p(m68kspkr_remove), 107 .remove = m68kspkr_remove,
108 .shutdown = m68kspkr_shutdown, 108 .shutdown = m68kspkr_shutdown,
109}; 109};
110 110
diff --git a/drivers/input/misc/max8925_onkey.c b/drivers/input/misc/max8925_onkey.c
index 0a12b74140d3..369a39de4ff3 100644
--- a/drivers/input/misc/max8925_onkey.c
+++ b/drivers/input/misc/max8925_onkey.c
@@ -62,7 +62,7 @@ static irqreturn_t max8925_onkey_handler(int irq, void *data)
62 return IRQ_HANDLED; 62 return IRQ_HANDLED;
63} 63}
64 64
65static int __devinit max8925_onkey_probe(struct platform_device *pdev) 65static int max8925_onkey_probe(struct platform_device *pdev)
66{ 66{
67 struct max8925_chip *chip = dev_get_drvdata(pdev->dev.parent); 67 struct max8925_chip *chip = dev_get_drvdata(pdev->dev.parent);
68 struct max8925_onkey_info *info; 68 struct max8925_onkey_info *info;
@@ -141,7 +141,7 @@ err_free_mem:
141 return error; 141 return error;
142} 142}
143 143
144static int __devexit max8925_onkey_remove(struct platform_device *pdev) 144static int max8925_onkey_remove(struct platform_device *pdev)
145{ 145{
146 struct max8925_onkey_info *info = platform_get_drvdata(pdev); 146 struct max8925_onkey_info *info = platform_get_drvdata(pdev);
147 struct max8925_chip *chip = dev_get_drvdata(pdev->dev.parent); 147 struct max8925_chip *chip = dev_get_drvdata(pdev->dev.parent);
@@ -195,7 +195,7 @@ static struct platform_driver max8925_onkey_driver = {
195 .pm = &max8925_onkey_pm_ops, 195 .pm = &max8925_onkey_pm_ops,
196 }, 196 },
197 .probe = max8925_onkey_probe, 197 .probe = max8925_onkey_probe,
198 .remove = __devexit_p(max8925_onkey_remove), 198 .remove = max8925_onkey_remove,
199}; 199};
200module_platform_driver(max8925_onkey_driver); 200module_platform_driver(max8925_onkey_driver);
201 201
diff --git a/drivers/input/misc/max8997_haptic.c b/drivers/input/misc/max8997_haptic.c
index 05b7b8bfaf0a..e973133212a5 100644
--- a/drivers/input/misc/max8997_haptic.c
+++ b/drivers/input/misc/max8997_haptic.c
@@ -241,7 +241,7 @@ static void max8997_haptic_close(struct input_dev *dev)
241 max8997_haptic_disable(chip); 241 max8997_haptic_disable(chip);
242} 242}
243 243
244static int __devinit max8997_haptic_probe(struct platform_device *pdev) 244static int max8997_haptic_probe(struct platform_device *pdev)
245{ 245{
246 struct max8997_dev *iodev = dev_get_drvdata(pdev->dev.parent); 246 struct max8997_dev *iodev = dev_get_drvdata(pdev->dev.parent);
247 const struct max8997_platform_data *pdata = 247 const struct max8997_platform_data *pdata =
@@ -354,7 +354,7 @@ err_free_mem:
354 return error; 354 return error;
355} 355}
356 356
357static int __devexit max8997_haptic_remove(struct platform_device *pdev) 357static int max8997_haptic_remove(struct platform_device *pdev)
358{ 358{
359 struct max8997_haptic *chip = platform_get_drvdata(pdev); 359 struct max8997_haptic *chip = platform_get_drvdata(pdev);
360 360
@@ -396,7 +396,7 @@ static struct platform_driver max8997_haptic_driver = {
396 .pm = &max8997_haptic_pm_ops, 396 .pm = &max8997_haptic_pm_ops,
397 }, 397 },
398 .probe = max8997_haptic_probe, 398 .probe = max8997_haptic_probe,
399 .remove = __devexit_p(max8997_haptic_remove), 399 .remove = max8997_haptic_remove,
400 .id_table = max8997_haptic_id, 400 .id_table = max8997_haptic_id,
401}; 401};
402module_platform_driver(max8997_haptic_driver); 402module_platform_driver(max8997_haptic_driver);
diff --git a/drivers/input/misc/mc13783-pwrbutton.c b/drivers/input/misc/mc13783-pwrbutton.c
index 8428f1e8e83e..0906ca593d5f 100644
--- a/drivers/input/misc/mc13783-pwrbutton.c
+++ b/drivers/input/misc/mc13783-pwrbutton.c
@@ -89,7 +89,7 @@ static irqreturn_t button_irq(int irq, void *_priv)
89 return IRQ_HANDLED; 89 return IRQ_HANDLED;
90} 90}
91 91
92static int __devinit mc13783_pwrbutton_probe(struct platform_device *pdev) 92static int mc13783_pwrbutton_probe(struct platform_device *pdev)
93{ 93{
94 const struct mc13xxx_buttons_platform_data *pdata; 94 const struct mc13xxx_buttons_platform_data *pdata;
95 struct mc13xxx *mc13783 = dev_get_drvdata(pdev->dev.parent); 95 struct mc13xxx *mc13783 = dev_get_drvdata(pdev->dev.parent);
@@ -230,7 +230,7 @@ free_input_dev:
230 return err; 230 return err;
231} 231}
232 232
233static int __devexit mc13783_pwrbutton_remove(struct platform_device *pdev) 233static int mc13783_pwrbutton_remove(struct platform_device *pdev)
234{ 234{
235 struct mc13783_pwrb *priv = platform_get_drvdata(pdev); 235 struct mc13783_pwrb *priv = platform_get_drvdata(pdev);
236 const struct mc13xxx_buttons_platform_data *pdata; 236 const struct mc13xxx_buttons_platform_data *pdata;
@@ -257,7 +257,7 @@ static int __devexit mc13783_pwrbutton_remove(struct platform_device *pdev)
257 257
258static struct platform_driver mc13783_pwrbutton_driver = { 258static struct platform_driver mc13783_pwrbutton_driver = {
259 .probe = mc13783_pwrbutton_probe, 259 .probe = mc13783_pwrbutton_probe,
260 .remove = __devexit_p(mc13783_pwrbutton_remove), 260 .remove = mc13783_pwrbutton_remove,
261 .driver = { 261 .driver = {
262 .name = "mc13783-pwrbutton", 262 .name = "mc13783-pwrbutton",
263 .owner = THIS_MODULE, 263 .owner = THIS_MODULE,
diff --git a/drivers/input/misc/mma8450.c b/drivers/input/misc/mma8450.c
index 873ebced544e..480557f14f23 100644
--- a/drivers/input/misc/mma8450.c
+++ b/drivers/input/misc/mma8450.c
@@ -167,7 +167,7 @@ static void mma8450_close(struct input_polled_dev *dev)
167/* 167/*
168 * I2C init/probing/exit functions 168 * I2C init/probing/exit functions
169 */ 169 */
170static int __devinit mma8450_probe(struct i2c_client *c, 170static int mma8450_probe(struct i2c_client *c,
171 const struct i2c_device_id *id) 171 const struct i2c_device_id *id)
172{ 172{
173 struct input_polled_dev *idev; 173 struct input_polled_dev *idev;
@@ -212,7 +212,7 @@ err_free_mem:
212 return err; 212 return err;
213} 213}
214 214
215static int __devexit mma8450_remove(struct i2c_client *c) 215static int mma8450_remove(struct i2c_client *c)
216{ 216{
217 struct mma8450 *m = i2c_get_clientdata(c); 217 struct mma8450 *m = i2c_get_clientdata(c);
218 struct input_polled_dev *idev = m->idev; 218 struct input_polled_dev *idev = m->idev;
@@ -243,7 +243,7 @@ static struct i2c_driver mma8450_driver = {
243 .of_match_table = mma8450_dt_ids, 243 .of_match_table = mma8450_dt_ids,
244 }, 244 },
245 .probe = mma8450_probe, 245 .probe = mma8450_probe,
246 .remove = __devexit_p(mma8450_remove), 246 .remove = mma8450_remove,
247 .id_table = mma8450_id, 247 .id_table = mma8450_id,
248}; 248};
249 249
diff --git a/drivers/input/misc/mpu3050.c b/drivers/input/misc/mpu3050.c
index 306f84c2d8fb..dce0d95943c5 100644
--- a/drivers/input/misc/mpu3050.c
+++ b/drivers/input/misc/mpu3050.c
@@ -257,7 +257,7 @@ static irqreturn_t mpu3050_interrupt_thread(int irq, void *data)
257 * 257 *
258 * Called during device probe; configures the sampling method. 258 * Called during device probe; configures the sampling method.
259 */ 259 */
260static int __devinit mpu3050_hw_init(struct mpu3050_sensor *sensor) 260static int mpu3050_hw_init(struct mpu3050_sensor *sensor)
261{ 261{
262 struct i2c_client *client = sensor->client; 262 struct i2c_client *client = sensor->client;
263 int ret; 263 int ret;
@@ -306,7 +306,7 @@ static int __devinit mpu3050_hw_init(struct mpu3050_sensor *sensor)
306 * 306 *
307 * If present install the relevant sysfs interfaces and input device. 307 * If present install the relevant sysfs interfaces and input device.
308 */ 308 */
309static int __devinit mpu3050_probe(struct i2c_client *client, 309static int mpu3050_probe(struct i2c_client *client,
310 const struct i2c_device_id *id) 310 const struct i2c_device_id *id)
311{ 311{
312 struct mpu3050_sensor *sensor; 312 struct mpu3050_sensor *sensor;
@@ -402,7 +402,7 @@ err_free_mem:
402 * 402 *
403 * Our sensor is going away, clean up the resources. 403 * Our sensor is going away, clean up the resources.
404 */ 404 */
405static int __devexit mpu3050_remove(struct i2c_client *client) 405static int mpu3050_remove(struct i2c_client *client)
406{ 406{
407 struct mpu3050_sensor *sensor = i2c_get_clientdata(client); 407 struct mpu3050_sensor *sensor = i2c_get_clientdata(client);
408 408
@@ -471,7 +471,7 @@ static struct i2c_driver mpu3050_i2c_driver = {
471 .of_match_table = mpu3050_of_match, 471 .of_match_table = mpu3050_of_match,
472 }, 472 },
473 .probe = mpu3050_probe, 473 .probe = mpu3050_probe,
474 .remove = __devexit_p(mpu3050_remove), 474 .remove = mpu3050_remove,
475 .id_table = mpu3050_ids, 475 .id_table = mpu3050_ids,
476}; 476};
477 477
diff --git a/drivers/input/misc/pcap_keys.c b/drivers/input/misc/pcap_keys.c
index e09b4fe81913..40ac9a5adf89 100644
--- a/drivers/input/misc/pcap_keys.c
+++ b/drivers/input/misc/pcap_keys.c
@@ -48,7 +48,7 @@ static irqreturn_t pcap_keys_handler(int irq, void *_pcap_keys)
48 return IRQ_HANDLED; 48 return IRQ_HANDLED;
49} 49}
50 50
51static int __devinit pcap_keys_probe(struct platform_device *pdev) 51static int pcap_keys_probe(struct platform_device *pdev)
52{ 52{
53 int err = -ENOMEM; 53 int err = -ENOMEM;
54 struct pcap_keys *pcap_keys; 54 struct pcap_keys *pcap_keys;
@@ -104,7 +104,7 @@ fail:
104 return err; 104 return err;
105} 105}
106 106
107static int __devexit pcap_keys_remove(struct platform_device *pdev) 107static int pcap_keys_remove(struct platform_device *pdev)
108{ 108{
109 struct pcap_keys *pcap_keys = platform_get_drvdata(pdev); 109 struct pcap_keys *pcap_keys = platform_get_drvdata(pdev);
110 110
@@ -119,7 +119,7 @@ static int __devexit pcap_keys_remove(struct platform_device *pdev)
119 119
120static struct platform_driver pcap_keys_device_driver = { 120static struct platform_driver pcap_keys_device_driver = {
121 .probe = pcap_keys_probe, 121 .probe = pcap_keys_probe,
122 .remove = __devexit_p(pcap_keys_remove), 122 .remove = pcap_keys_remove,
123 .driver = { 123 .driver = {
124 .name = "pcap-keys", 124 .name = "pcap-keys",
125 .owner = THIS_MODULE, 125 .owner = THIS_MODULE,
diff --git a/drivers/input/misc/pcf50633-input.c b/drivers/input/misc/pcf50633-input.c
index 53891de80b0e..73b13ebabe56 100644
--- a/drivers/input/misc/pcf50633-input.c
+++ b/drivers/input/misc/pcf50633-input.c
@@ -53,7 +53,7 @@ pcf50633_input_irq(int irq, void *data)
53 input_sync(input->input_dev); 53 input_sync(input->input_dev);
54} 54}
55 55
56static int __devinit pcf50633_input_probe(struct platform_device *pdev) 56static int pcf50633_input_probe(struct platform_device *pdev)
57{ 57{
58 struct pcf50633_input *input; 58 struct pcf50633_input *input;
59 struct input_dev *input_dev; 59 struct input_dev *input_dev;
@@ -93,7 +93,7 @@ static int __devinit pcf50633_input_probe(struct platform_device *pdev)
93 return 0; 93 return 0;
94} 94}
95 95
96static int __devexit pcf50633_input_remove(struct platform_device *pdev) 96static int pcf50633_input_remove(struct platform_device *pdev)
97{ 97{
98 struct pcf50633_input *input = platform_get_drvdata(pdev); 98 struct pcf50633_input *input = platform_get_drvdata(pdev);
99 99
@@ -111,7 +111,7 @@ static struct platform_driver pcf50633_input_driver = {
111 .name = "pcf50633-input", 111 .name = "pcf50633-input",
112 }, 112 },
113 .probe = pcf50633_input_probe, 113 .probe = pcf50633_input_probe,
114 .remove = __devexit_p(pcf50633_input_remove), 114 .remove = pcf50633_input_remove,
115}; 115};
116module_platform_driver(pcf50633_input_driver); 116module_platform_driver(pcf50633_input_driver);
117 117
diff --git a/drivers/input/misc/pcf8574_keypad.c b/drivers/input/misc/pcf8574_keypad.c
index 544c6635abe9..e37392976fdd 100644
--- a/drivers/input/misc/pcf8574_keypad.c
+++ b/drivers/input/misc/pcf8574_keypad.c
@@ -82,7 +82,7 @@ static irqreturn_t pcf8574_kp_irq_handler(int irq, void *dev_id)
82 return IRQ_HANDLED; 82 return IRQ_HANDLED;
83} 83}
84 84
85static int __devinit pcf8574_kp_probe(struct i2c_client *client, const struct i2c_device_id *id) 85static int pcf8574_kp_probe(struct i2c_client *client, const struct i2c_device_id *id)
86{ 86{
87 int i, ret; 87 int i, ret;
88 struct input_dev *idev; 88 struct input_dev *idev;
@@ -156,7 +156,7 @@ static int __devinit pcf8574_kp_probe(struct i2c_client *client, const struct i2
156 return ret; 156 return ret;
157} 157}
158 158
159static int __devexit pcf8574_kp_remove(struct i2c_client *client) 159static int pcf8574_kp_remove(struct i2c_client *client)
160{ 160{
161 struct kp_data *lp = i2c_get_clientdata(client); 161 struct kp_data *lp = i2c_get_clientdata(client);
162 162
@@ -212,7 +212,7 @@ static struct i2c_driver pcf8574_kp_driver = {
212#endif 212#endif
213 }, 213 },
214 .probe = pcf8574_kp_probe, 214 .probe = pcf8574_kp_probe,
215 .remove = __devexit_p(pcf8574_kp_remove), 215 .remove = pcf8574_kp_remove,
216 .id_table = pcf8574_kp_id, 216 .id_table = pcf8574_kp_id,
217}; 217};
218 218
diff --git a/drivers/input/misc/pcspkr.c b/drivers/input/misc/pcspkr.c
index b2484aa07f32..199db78acc4f 100644
--- a/drivers/input/misc/pcspkr.c
+++ b/drivers/input/misc/pcspkr.c
@@ -63,7 +63,7 @@ static int pcspkr_event(struct input_dev *dev, unsigned int type, unsigned int c
63 return 0; 63 return 0;
64} 64}
65 65
66static int __devinit pcspkr_probe(struct platform_device *dev) 66static int pcspkr_probe(struct platform_device *dev)
67{ 67{
68 struct input_dev *pcspkr_dev; 68 struct input_dev *pcspkr_dev;
69 int err; 69 int err;
@@ -95,7 +95,7 @@ static int __devinit pcspkr_probe(struct platform_device *dev)
95 return 0; 95 return 0;
96} 96}
97 97
98static int __devexit pcspkr_remove(struct platform_device *dev) 98static int pcspkr_remove(struct platform_device *dev)
99{ 99{
100 struct input_dev *pcspkr_dev = platform_get_drvdata(dev); 100 struct input_dev *pcspkr_dev = platform_get_drvdata(dev);
101 101
@@ -131,7 +131,7 @@ static struct platform_driver pcspkr_platform_driver = {
131 .pm = &pcspkr_pm_ops, 131 .pm = &pcspkr_pm_ops,
132 }, 132 },
133 .probe = pcspkr_probe, 133 .probe = pcspkr_probe,
134 .remove = __devexit_p(pcspkr_remove), 134 .remove = pcspkr_remove,
135 .shutdown = pcspkr_shutdown, 135 .shutdown = pcspkr_shutdown,
136}; 136};
137module_platform_driver(pcspkr_platform_driver); 137module_platform_driver(pcspkr_platform_driver);
diff --git a/drivers/input/misc/pm8xxx-vibrator.c b/drivers/input/misc/pm8xxx-vibrator.c
index dfbfb463ea5d..a9da65e41c5b 100644
--- a/drivers/input/misc/pm8xxx-vibrator.c
+++ b/drivers/input/misc/pm8xxx-vibrator.c
@@ -178,7 +178,7 @@ static int pm8xxx_vib_play_effect(struct input_dev *dev, void *data,
178 return 0; 178 return 0;
179} 179}
180 180
181static int __devinit pm8xxx_vib_probe(struct platform_device *pdev) 181static int pm8xxx_vib_probe(struct platform_device *pdev)
182 182
183{ 183{
184 struct pm8xxx_vib *vib; 184 struct pm8xxx_vib *vib;
@@ -242,7 +242,7 @@ err_free_mem:
242 return error; 242 return error;
243} 243}
244 244
245static int __devexit pm8xxx_vib_remove(struct platform_device *pdev) 245static int pm8xxx_vib_remove(struct platform_device *pdev)
246{ 246{
247 struct pm8xxx_vib *vib = platform_get_drvdata(pdev); 247 struct pm8xxx_vib *vib = platform_get_drvdata(pdev);
248 248
@@ -270,7 +270,7 @@ static SIMPLE_DEV_PM_OPS(pm8xxx_vib_pm_ops, pm8xxx_vib_suspend, NULL);
270 270
271static struct platform_driver pm8xxx_vib_driver = { 271static struct platform_driver pm8xxx_vib_driver = {
272 .probe = pm8xxx_vib_probe, 272 .probe = pm8xxx_vib_probe,
273 .remove = __devexit_p(pm8xxx_vib_remove), 273 .remove = pm8xxx_vib_remove,
274 .driver = { 274 .driver = {
275 .name = "pm8xxx-vib", 275 .name = "pm8xxx-vib",
276 .owner = THIS_MODULE, 276 .owner = THIS_MODULE,
diff --git a/drivers/input/misc/pmic8xxx-pwrkey.c b/drivers/input/misc/pmic8xxx-pwrkey.c
index 0f83d0f1d015..4b811be73974 100644
--- a/drivers/input/misc/pmic8xxx-pwrkey.c
+++ b/drivers/input/misc/pmic8xxx-pwrkey.c
@@ -81,7 +81,7 @@ static int pmic8xxx_pwrkey_resume(struct device *dev)
81static SIMPLE_DEV_PM_OPS(pm8xxx_pwr_key_pm_ops, 81static SIMPLE_DEV_PM_OPS(pm8xxx_pwr_key_pm_ops,
82 pmic8xxx_pwrkey_suspend, pmic8xxx_pwrkey_resume); 82 pmic8xxx_pwrkey_suspend, pmic8xxx_pwrkey_resume);
83 83
84static int __devinit pmic8xxx_pwrkey_probe(struct platform_device *pdev) 84static int pmic8xxx_pwrkey_probe(struct platform_device *pdev)
85{ 85{
86 struct input_dev *pwr; 86 struct input_dev *pwr;
87 int key_release_irq = platform_get_irq(pdev, 0); 87 int key_release_irq = platform_get_irq(pdev, 0);
@@ -187,7 +187,7 @@ free_pwrkey:
187 return err; 187 return err;
188} 188}
189 189
190static int __devexit pmic8xxx_pwrkey_remove(struct platform_device *pdev) 190static int pmic8xxx_pwrkey_remove(struct platform_device *pdev)
191{ 191{
192 struct pmic8xxx_pwrkey *pwrkey = platform_get_drvdata(pdev); 192 struct pmic8xxx_pwrkey *pwrkey = platform_get_drvdata(pdev);
193 int key_release_irq = platform_get_irq(pdev, 0); 193 int key_release_irq = platform_get_irq(pdev, 0);
@@ -206,7 +206,7 @@ static int __devexit pmic8xxx_pwrkey_remove(struct platform_device *pdev)
206 206
207static struct platform_driver pmic8xxx_pwrkey_driver = { 207static struct platform_driver pmic8xxx_pwrkey_driver = {
208 .probe = pmic8xxx_pwrkey_probe, 208 .probe = pmic8xxx_pwrkey_probe,
209 .remove = __devexit_p(pmic8xxx_pwrkey_remove), 209 .remove = pmic8xxx_pwrkey_remove,
210 .driver = { 210 .driver = {
211 .name = PM8XXX_PWRKEY_DEV_NAME, 211 .name = PM8XXX_PWRKEY_DEV_NAME,
212 .owner = THIS_MODULE, 212 .owner = THIS_MODULE,
diff --git a/drivers/input/misc/pwm-beeper.c b/drivers/input/misc/pwm-beeper.c
index fc84c8a51147..0808868461de 100644
--- a/drivers/input/misc/pwm-beeper.c
+++ b/drivers/input/misc/pwm-beeper.c
@@ -65,7 +65,7 @@ static int pwm_beeper_event(struct input_dev *input,
65 return 0; 65 return 0;
66} 66}
67 67
68static int __devinit pwm_beeper_probe(struct platform_device *pdev) 68static int pwm_beeper_probe(struct platform_device *pdev)
69{ 69{
70 unsigned long pwm_id = (unsigned long)pdev->dev.platform_data; 70 unsigned long pwm_id = (unsigned long)pdev->dev.platform_data;
71 struct pwm_beeper *beeper; 71 struct pwm_beeper *beeper;
@@ -75,7 +75,11 @@ static int __devinit pwm_beeper_probe(struct platform_device *pdev)
75 if (!beeper) 75 if (!beeper)
76 return -ENOMEM; 76 return -ENOMEM;
77 77
78 beeper->pwm = pwm_request(pwm_id, "pwm beeper"); 78 beeper->pwm = pwm_get(&pdev->dev, NULL);
79 if (IS_ERR(beeper->pwm)) {
80 dev_dbg(&pdev->dev, "unable to request PWM, trying legacy API\n");
81 beeper->pwm = pwm_request(pwm_id, "pwm beeper");
82 }
79 83
80 if (IS_ERR(beeper->pwm)) { 84 if (IS_ERR(beeper->pwm)) {
81 error = PTR_ERR(beeper->pwm); 85 error = PTR_ERR(beeper->pwm);
@@ -125,7 +129,7 @@ err_free:
125 return error; 129 return error;
126} 130}
127 131
128static int __devexit pwm_beeper_remove(struct platform_device *pdev) 132static int pwm_beeper_remove(struct platform_device *pdev)
129{ 133{
130 struct pwm_beeper *beeper = platform_get_drvdata(pdev); 134 struct pwm_beeper *beeper = platform_get_drvdata(pdev);
131 135
@@ -171,13 +175,21 @@ static SIMPLE_DEV_PM_OPS(pwm_beeper_pm_ops,
171#define PWM_BEEPER_PM_OPS NULL 175#define PWM_BEEPER_PM_OPS NULL
172#endif 176#endif
173 177
178#ifdef CONFIG_OF
179static const struct of_device_id pwm_beeper_match[] = {
180 { .compatible = "pwm-beeper", },
181 { },
182};
183#endif
184
174static struct platform_driver pwm_beeper_driver = { 185static struct platform_driver pwm_beeper_driver = {
175 .probe = pwm_beeper_probe, 186 .probe = pwm_beeper_probe,
176 .remove = __devexit_p(pwm_beeper_remove), 187 .remove = pwm_beeper_remove,
177 .driver = { 188 .driver = {
178 .name = "pwm-beeper", 189 .name = "pwm-beeper",
179 .owner = THIS_MODULE, 190 .owner = THIS_MODULE,
180 .pm = PWM_BEEPER_PM_OPS, 191 .pm = PWM_BEEPER_PM_OPS,
192 .of_match_table = of_match_ptr(pwm_beeper_match),
181 }, 193 },
182}; 194};
183module_platform_driver(pwm_beeper_driver); 195module_platform_driver(pwm_beeper_driver);
diff --git a/drivers/input/misc/rb532_button.c b/drivers/input/misc/rb532_button.c
index aeb02bcf7233..fb4f8ac3343b 100644
--- a/drivers/input/misc/rb532_button.c
+++ b/drivers/input/misc/rb532_button.c
@@ -51,7 +51,7 @@ static void rb532_button_poll(struct input_polled_dev *poll_dev)
51 input_sync(poll_dev->input); 51 input_sync(poll_dev->input);
52} 52}
53 53
54static int __devinit rb532_button_probe(struct platform_device *pdev) 54static int rb532_button_probe(struct platform_device *pdev)
55{ 55{
56 struct input_polled_dev *poll_dev; 56 struct input_polled_dev *poll_dev;
57 int error; 57 int error;
@@ -81,7 +81,7 @@ static int __devinit rb532_button_probe(struct platform_device *pdev)
81 return 0; 81 return 0;
82} 82}
83 83
84static int __devexit rb532_button_remove(struct platform_device *pdev) 84static int rb532_button_remove(struct platform_device *pdev)
85{ 85{
86 struct input_polled_dev *poll_dev = dev_get_drvdata(&pdev->dev); 86 struct input_polled_dev *poll_dev = dev_get_drvdata(&pdev->dev);
87 87
@@ -94,7 +94,7 @@ static int __devexit rb532_button_remove(struct platform_device *pdev)
94 94
95static struct platform_driver rb532_button_driver = { 95static struct platform_driver rb532_button_driver = {
96 .probe = rb532_button_probe, 96 .probe = rb532_button_probe,
97 .remove = __devexit_p(rb532_button_remove), 97 .remove = rb532_button_remove,
98 .driver = { 98 .driver = {
99 .name = DRV_NAME, 99 .name = DRV_NAME,
100 .owner = THIS_MODULE, 100 .owner = THIS_MODULE,
diff --git a/drivers/input/misc/retu-pwrbutton.c b/drivers/input/misc/retu-pwrbutton.c
new file mode 100644
index 000000000000..7ca09baa0016
--- /dev/null
+++ b/drivers/input/misc/retu-pwrbutton.c
@@ -0,0 +1,99 @@
1/*
2 * Retu power button driver.
3 *
4 * Copyright (C) 2004-2010 Nokia Corporation
5 *
6 * Original code written by Ari Saastamoinen, Juha Yrjölä and Felipe Balbi.
7 * Rewritten by Aaro Koskinen.
8 *
9 * This file is subject to the terms and conditions of the GNU General
10 * Public License. See the file "COPYING" in the main directory of this
11 * archive for more details.
12 *
13 * This program is distributed in the hope that it will be useful,
14 * but WITHOUT ANY WARRANTY; without even the implied warranty of
15 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
16 * GNU General Public License for more details.
17 */
18
19#include <linux/irq.h>
20#include <linux/init.h>
21#include <linux/slab.h>
22#include <linux/errno.h>
23#include <linux/input.h>
24#include <linux/kernel.h>
25#include <linux/module.h>
26#include <linux/mfd/retu.h>
27#include <linux/interrupt.h>
28#include <linux/platform_device.h>
29
30#define RETU_STATUS_PWRONX (1 << 5)
31
32static irqreturn_t retu_pwrbutton_irq(int irq, void *_pwr)
33{
34 struct input_dev *idev = _pwr;
35 struct retu_dev *rdev = input_get_drvdata(idev);
36 bool state;
37
38 state = !(retu_read(rdev, RETU_REG_STATUS) & RETU_STATUS_PWRONX);
39 input_report_key(idev, KEY_POWER, state);
40 input_sync(idev);
41
42 return IRQ_HANDLED;
43}
44
45static int retu_pwrbutton_probe(struct platform_device *pdev)
46{
47 struct retu_dev *rdev = dev_get_drvdata(pdev->dev.parent);
48 struct input_dev *idev;
49 int irq;
50 int error;
51
52 irq = platform_get_irq(pdev, 0);
53 if (irq < 0)
54 return irq;
55
56 idev = devm_input_allocate_device(&pdev->dev);
57 if (!idev)
58 return -ENOMEM;
59
60 idev->name = "retu-pwrbutton";
61 idev->dev.parent = &pdev->dev;
62
63 input_set_capability(idev, EV_KEY, KEY_POWER);
64 input_set_drvdata(idev, rdev);
65
66 error = devm_request_threaded_irq(&pdev->dev, irq,
67 NULL, retu_pwrbutton_irq, 0,
68 "retu-pwrbutton", idev);
69 if (error)
70 return error;
71
72 error = input_register_device(idev);
73 if (error)
74 return error;
75
76 return 0;
77}
78
79static int retu_pwrbutton_remove(struct platform_device *pdev)
80{
81 return 0;
82}
83
84static struct platform_driver retu_pwrbutton_driver = {
85 .probe = retu_pwrbutton_probe,
86 .remove = retu_pwrbutton_remove,
87 .driver = {
88 .name = "retu-pwrbutton",
89 .owner = THIS_MODULE,
90 },
91};
92module_platform_driver(retu_pwrbutton_driver);
93
94MODULE_ALIAS("platform:retu-pwrbutton");
95MODULE_DESCRIPTION("Retu Power Button");
96MODULE_AUTHOR("Ari Saastamoinen");
97MODULE_AUTHOR("Felipe Balbi");
98MODULE_AUTHOR("Aaro Koskinen <aaro.koskinen@iki.fi>");
99MODULE_LICENSE("GPL");
diff --git a/drivers/input/misc/rotary_encoder.c b/drivers/input/misc/rotary_encoder.c
index 99a49e4968d2..aff47b2c38ff 100644
--- a/drivers/input/misc/rotary_encoder.c
+++ b/drivers/input/misc/rotary_encoder.c
@@ -149,8 +149,7 @@ static struct of_device_id rotary_encoder_of_match[] = {
149}; 149};
150MODULE_DEVICE_TABLE(of, rotary_encoder_of_match); 150MODULE_DEVICE_TABLE(of, rotary_encoder_of_match);
151 151
152static struct rotary_encoder_platform_data * __devinit 152static struct rotary_encoder_platform_data *rotary_encoder_parse_dt(struct device *dev)
153rotary_encoder_parse_dt(struct device *dev)
154{ 153{
155 const struct of_device_id *of_id = 154 const struct of_device_id *of_id =
156 of_match_device(rotary_encoder_of_match, dev); 155 of_match_device(rotary_encoder_of_match, dev);
@@ -192,7 +191,7 @@ rotary_encoder_parse_dt(struct device *dev)
192} 191}
193#endif 192#endif
194 193
195static int __devinit rotary_encoder_probe(struct platform_device *pdev) 194static int rotary_encoder_probe(struct platform_device *pdev)
196{ 195{
197 struct device *dev = &pdev->dev; 196 struct device *dev = &pdev->dev;
198 const struct rotary_encoder_platform_data *pdata = dev_get_platdata(dev); 197 const struct rotary_encoder_platform_data *pdata = dev_get_platdata(dev);
@@ -302,7 +301,7 @@ exit_free_mem:
302 return err; 301 return err;
303} 302}
304 303
305static int __devexit rotary_encoder_remove(struct platform_device *pdev) 304static int rotary_encoder_remove(struct platform_device *pdev)
306{ 305{
307 struct rotary_encoder *encoder = platform_get_drvdata(pdev); 306 struct rotary_encoder *encoder = platform_get_drvdata(pdev);
308 const struct rotary_encoder_platform_data *pdata = encoder->pdata; 307 const struct rotary_encoder_platform_data *pdata = encoder->pdata;
@@ -325,7 +324,7 @@ static int __devexit rotary_encoder_remove(struct platform_device *pdev)
325 324
326static struct platform_driver rotary_encoder_driver = { 325static struct platform_driver rotary_encoder_driver = {
327 .probe = rotary_encoder_probe, 326 .probe = rotary_encoder_probe,
328 .remove = __devexit_p(rotary_encoder_remove), 327 .remove = rotary_encoder_remove,
329 .driver = { 328 .driver = {
330 .name = DRV_NAME, 329 .name = DRV_NAME,
331 .owner = THIS_MODULE, 330 .owner = THIS_MODULE,
diff --git a/drivers/input/misc/sgi_btns.c b/drivers/input/misc/sgi_btns.c
index 5d9fd5571199..ad6415ceaf5f 100644
--- a/drivers/input/misc/sgi_btns.c
+++ b/drivers/input/misc/sgi_btns.c
@@ -91,7 +91,7 @@ static void handle_buttons(struct input_polled_dev *dev)
91 } 91 }
92} 92}
93 93
94static int __devinit sgi_buttons_probe(struct platform_device *pdev) 94static int sgi_buttons_probe(struct platform_device *pdev)
95{ 95{
96 struct buttons_dev *bdev; 96 struct buttons_dev *bdev;
97 struct input_polled_dev *poll_dev; 97 struct input_polled_dev *poll_dev;
@@ -143,7 +143,7 @@ static int __devinit sgi_buttons_probe(struct platform_device *pdev)
143 return error; 143 return error;
144} 144}
145 145
146static int __devexit sgi_buttons_remove(struct platform_device *pdev) 146static int sgi_buttons_remove(struct platform_device *pdev)
147{ 147{
148 struct device *dev = &pdev->dev; 148 struct device *dev = &pdev->dev;
149 struct buttons_dev *bdev = dev_get_drvdata(dev); 149 struct buttons_dev *bdev = dev_get_drvdata(dev);
@@ -158,7 +158,7 @@ static int __devexit sgi_buttons_remove(struct platform_device *pdev)
158 158
159static struct platform_driver sgi_buttons_driver = { 159static struct platform_driver sgi_buttons_driver = {
160 .probe = sgi_buttons_probe, 160 .probe = sgi_buttons_probe,
161 .remove = __devexit_p(sgi_buttons_remove), 161 .remove = sgi_buttons_remove,
162 .driver = { 162 .driver = {
163 .name = "sgibtns", 163 .name = "sgibtns",
164 .owner = THIS_MODULE, 164 .owner = THIS_MODULE,
diff --git a/drivers/input/misc/sparcspkr.c b/drivers/input/misc/sparcspkr.c
index 0122f5351577..a53586a7fbdb 100644
--- a/drivers/input/misc/sparcspkr.c
+++ b/drivers/input/misc/sparcspkr.c
@@ -139,7 +139,7 @@ static int grover_spkr_event(struct input_dev *dev, unsigned int type, unsigned
139 return 0; 139 return 0;
140} 140}
141 141
142static int __devinit sparcspkr_probe(struct device *dev) 142static int sparcspkr_probe(struct device *dev)
143{ 143{
144 struct sparcspkr_state *state = dev_get_drvdata(dev); 144 struct sparcspkr_state *state = dev_get_drvdata(dev);
145 struct input_dev *input_dev; 145 struct input_dev *input_dev;
@@ -182,7 +182,7 @@ static void sparcspkr_shutdown(struct platform_device *dev)
182 state->event(input_dev, EV_SND, SND_BELL, 0); 182 state->event(input_dev, EV_SND, SND_BELL, 0);
183} 183}
184 184
185static int __devinit bbc_beep_probe(struct platform_device *op) 185static int bbc_beep_probe(struct platform_device *op)
186{ 186{
187 struct sparcspkr_state *state; 187 struct sparcspkr_state *state;
188 struct bbc_beep_info *info; 188 struct bbc_beep_info *info;
@@ -229,7 +229,7 @@ out_err:
229 return err; 229 return err;
230} 230}
231 231
232static int __devexit bbc_remove(struct platform_device *op) 232static int bbc_remove(struct platform_device *op)
233{ 233{
234 struct sparcspkr_state *state = dev_get_drvdata(&op->dev); 234 struct sparcspkr_state *state = dev_get_drvdata(&op->dev);
235 struct input_dev *input_dev = state->input_dev; 235 struct input_dev *input_dev = state->input_dev;
@@ -263,11 +263,11 @@ static struct platform_driver bbc_beep_driver = {
263 .of_match_table = bbc_beep_match, 263 .of_match_table = bbc_beep_match,
264 }, 264 },
265 .probe = bbc_beep_probe, 265 .probe = bbc_beep_probe,
266 .remove = __devexit_p(bbc_remove), 266 .remove = bbc_remove,
267 .shutdown = sparcspkr_shutdown, 267 .shutdown = sparcspkr_shutdown,
268}; 268};
269 269
270static int __devinit grover_beep_probe(struct platform_device *op) 270static int grover_beep_probe(struct platform_device *op)
271{ 271{
272 struct sparcspkr_state *state; 272 struct sparcspkr_state *state;
273 struct grover_beep_info *info; 273 struct grover_beep_info *info;
@@ -310,7 +310,7 @@ out_err:
310 return err; 310 return err;
311} 311}
312 312
313static int __devexit grover_remove(struct platform_device *op) 313static int grover_remove(struct platform_device *op)
314{ 314{
315 struct sparcspkr_state *state = dev_get_drvdata(&op->dev); 315 struct sparcspkr_state *state = dev_get_drvdata(&op->dev);
316 struct grover_beep_info *info = &state->u.grover; 316 struct grover_beep_info *info = &state->u.grover;
@@ -345,7 +345,7 @@ static struct platform_driver grover_beep_driver = {
345 .of_match_table = grover_beep_match, 345 .of_match_table = grover_beep_match,
346 }, 346 },
347 .probe = grover_beep_probe, 347 .probe = grover_beep_probe,
348 .remove = __devexit_p(grover_remove), 348 .remove = grover_remove,
349 .shutdown = sparcspkr_shutdown, 349 .shutdown = sparcspkr_shutdown,
350}; 350};
351 351
diff --git a/drivers/input/misc/twl4030-pwrbutton.c b/drivers/input/misc/twl4030-pwrbutton.c
index b3dd96d6448b..27c2bc8aa890 100644
--- a/drivers/input/misc/twl4030-pwrbutton.c
+++ b/drivers/input/misc/twl4030-pwrbutton.c
@@ -39,8 +39,7 @@ static irqreturn_t powerbutton_irq(int irq, void *_pwr)
39 int err; 39 int err;
40 u8 value; 40 u8 value;
41 41
42 err = twl_i2c_read_u8(TWL4030_MODULE_PM_MASTER, &value, 42 err = twl_i2c_read_u8(TWL_MODULE_PM_MASTER, &value, STS_HW_CONDITIONS);
43 STS_HW_CONDITIONS);
44 if (!err) { 43 if (!err) {
45 pm_wakeup_event(pwr->dev.parent, 0); 44 pm_wakeup_event(pwr->dev.parent, 0);
46 input_report_key(pwr, KEY_POWER, value & PWR_PWRON_IRQ); 45 input_report_key(pwr, KEY_POWER, value & PWR_PWRON_IRQ);
diff --git a/drivers/input/misc/twl4030-vibra.c b/drivers/input/misc/twl4030-vibra.c
index 2194a3c7236a..78eb6b30580a 100644
--- a/drivers/input/misc/twl4030-vibra.c
+++ b/drivers/input/misc/twl4030-vibra.c
@@ -207,7 +207,7 @@ static bool twl4030_vibra_check_coexist(struct twl4030_vibra_data *pdata,
207 return false; 207 return false;
208} 208}
209 209
210static int __devinit twl4030_vibra_probe(struct platform_device *pdev) 210static int twl4030_vibra_probe(struct platform_device *pdev)
211{ 211{
212 struct twl4030_vibra_data *pdata = pdev->dev.platform_data; 212 struct twl4030_vibra_data *pdata = pdev->dev.platform_data;
213 struct device_node *twl4030_core_node = pdev->dev.parent->of_node; 213 struct device_node *twl4030_core_node = pdev->dev.parent->of_node;
@@ -269,7 +269,7 @@ err_kzalloc:
269 return ret; 269 return ret;
270} 270}
271 271
272static int __devexit twl4030_vibra_remove(struct platform_device *pdev) 272static int twl4030_vibra_remove(struct platform_device *pdev)
273{ 273{
274 struct vibra_info *info = platform_get_drvdata(pdev); 274 struct vibra_info *info = platform_get_drvdata(pdev);
275 275
@@ -283,7 +283,7 @@ static int __devexit twl4030_vibra_remove(struct platform_device *pdev)
283 283
284static struct platform_driver twl4030_vibra_driver = { 284static struct platform_driver twl4030_vibra_driver = {
285 .probe = twl4030_vibra_probe, 285 .probe = twl4030_vibra_probe,
286 .remove = __devexit_p(twl4030_vibra_remove), 286 .remove = twl4030_vibra_remove,
287 .driver = { 287 .driver = {
288 .name = "twl4030-vibra", 288 .name = "twl4030-vibra",
289 .owner = THIS_MODULE, 289 .owner = THIS_MODULE,
diff --git a/drivers/input/misc/twl6040-vibra.c b/drivers/input/misc/twl6040-vibra.c
index c8a288ae1d5b..71a28ee699f3 100644
--- a/drivers/input/misc/twl6040-vibra.c
+++ b/drivers/input/misc/twl6040-vibra.c
@@ -255,7 +255,7 @@ static int twl6040_vibra_suspend(struct device *dev)
255 255
256static SIMPLE_DEV_PM_OPS(twl6040_vibra_pm_ops, twl6040_vibra_suspend, NULL); 256static SIMPLE_DEV_PM_OPS(twl6040_vibra_pm_ops, twl6040_vibra_suspend, NULL);
257 257
258static int __devinit twl6040_vibra_probe(struct platform_device *pdev) 258static int twl6040_vibra_probe(struct platform_device *pdev)
259{ 259{
260 struct twl6040_vibra_data *pdata = pdev->dev.platform_data; 260 struct twl6040_vibra_data *pdata = pdev->dev.platform_data;
261 struct device *twl6040_core_dev = pdev->dev.parent; 261 struct device *twl6040_core_dev = pdev->dev.parent;
@@ -418,7 +418,7 @@ err_kzalloc:
418 return ret; 418 return ret;
419} 419}
420 420
421static int __devexit twl6040_vibra_remove(struct platform_device *pdev) 421static int twl6040_vibra_remove(struct platform_device *pdev)
422{ 422{
423 struct vibra_info *info = platform_get_drvdata(pdev); 423 struct vibra_info *info = platform_get_drvdata(pdev);
424 424
@@ -433,7 +433,7 @@ static int __devexit twl6040_vibra_remove(struct platform_device *pdev)
433 433
434static struct platform_driver twl6040_vibra_driver = { 434static struct platform_driver twl6040_vibra_driver = {
435 .probe = twl6040_vibra_probe, 435 .probe = twl6040_vibra_probe,
436 .remove = __devexit_p(twl6040_vibra_remove), 436 .remove = twl6040_vibra_remove,
437 .driver = { 437 .driver = {
438 .name = "twl6040-vibra", 438 .name = "twl6040-vibra",
439 .owner = THIS_MODULE, 439 .owner = THIS_MODULE,
diff --git a/drivers/input/misc/wistron_btns.c b/drivers/input/misc/wistron_btns.c
index e2bdfd4bea70..56536f4b9572 100644
--- a/drivers/input/misc/wistron_btns.c
+++ b/drivers/input/misc/wistron_btns.c
@@ -170,7 +170,7 @@ static u16 bios_pop_queue(void)
170 return regs.eax; 170 return regs.eax;
171} 171}
172 172
173static void __devinit bios_attach(void) 173static void bios_attach(void)
174{ 174{
175 struct regs regs; 175 struct regs regs;
176 176
@@ -190,7 +190,7 @@ static void bios_detach(void)
190 call_bios(&regs); 190 call_bios(&regs);
191} 191}
192 192
193static u8 __devinit bios_get_cmos_address(void) 193static u8 bios_get_cmos_address(void)
194{ 194{
195 struct regs regs; 195 struct regs regs;
196 196
@@ -202,7 +202,7 @@ static u8 __devinit bios_get_cmos_address(void)
202 return regs.ecx; 202 return regs.ecx;
203} 203}
204 204
205static u16 __devinit bios_get_default_setting(u8 subsys) 205static u16 bios_get_default_setting(u8 subsys)
206{ 206{
207 struct regs regs; 207 struct regs regs;
208 208
@@ -1052,7 +1052,7 @@ static struct led_classdev wistron_wifi_led = {
1052 .brightness_set = wistron_wifi_led_set, 1052 .brightness_set = wistron_wifi_led_set,
1053}; 1053};
1054 1054
1055static void __devinit wistron_led_init(struct device *parent) 1055static void wistron_led_init(struct device *parent)
1056{ 1056{
1057 if (leds_present & FE_WIFI_LED) { 1057 if (leds_present & FE_WIFI_LED) {
1058 u16 wifi = bios_get_default_setting(WIFI); 1058 u16 wifi = bios_get_default_setting(WIFI);
@@ -1077,7 +1077,7 @@ static void __devinit wistron_led_init(struct device *parent)
1077 } 1077 }
1078} 1078}
1079 1079
1080static void __devexit wistron_led_remove(void) 1080static void wistron_led_remove(void)
1081{ 1081{
1082 if (leds_present & FE_MAIL_LED) 1082 if (leds_present & FE_MAIL_LED)
1083 led_classdev_unregister(&wistron_mail_led); 1083 led_classdev_unregister(&wistron_mail_led);
@@ -1168,7 +1168,7 @@ static void wistron_poll(struct input_polled_dev *dev)
1168 dev->poll_interval = POLL_INTERVAL_DEFAULT; 1168 dev->poll_interval = POLL_INTERVAL_DEFAULT;
1169} 1169}
1170 1170
1171static int __devinit wistron_setup_keymap(struct input_dev *dev, 1171static int wistron_setup_keymap(struct input_dev *dev,
1172 struct key_entry *entry) 1172 struct key_entry *entry)
1173{ 1173{
1174 switch (entry->type) { 1174 switch (entry->type) {
@@ -1199,7 +1199,7 @@ static int __devinit wistron_setup_keymap(struct input_dev *dev,
1199 return 0; 1199 return 0;
1200} 1200}
1201 1201
1202static int __devinit setup_input_dev(void) 1202static int setup_input_dev(void)
1203{ 1203{
1204 struct input_dev *input_dev; 1204 struct input_dev *input_dev;
1205 int error; 1205 int error;
@@ -1237,7 +1237,7 @@ static int __devinit setup_input_dev(void)
1237 1237
1238/* Driver core */ 1238/* Driver core */
1239 1239
1240static int __devinit wistron_probe(struct platform_device *dev) 1240static int wistron_probe(struct platform_device *dev)
1241{ 1241{
1242 int err; 1242 int err;
1243 1243
@@ -1277,7 +1277,7 @@ static int __devinit wistron_probe(struct platform_device *dev)
1277 return 0; 1277 return 0;
1278} 1278}
1279 1279
1280static int __devexit wistron_remove(struct platform_device *dev) 1280static int wistron_remove(struct platform_device *dev)
1281{ 1281{
1282 wistron_led_remove(); 1282 wistron_led_remove();
1283 input_unregister_polled_device(wistron_idev); 1283 input_unregister_polled_device(wistron_idev);
@@ -1334,7 +1334,7 @@ static struct platform_driver wistron_driver = {
1334#endif 1334#endif
1335 }, 1335 },
1336 .probe = wistron_probe, 1336 .probe = wistron_probe,
1337 .remove = __devexit_p(wistron_remove), 1337 .remove = wistron_remove,
1338}; 1338};
1339 1339
1340static int __init wb_module_init(void) 1340static int __init wb_module_init(void)
diff --git a/drivers/input/misc/wm831x-on.c b/drivers/input/misc/wm831x-on.c
index 6790a812a1db..558767d8ebf4 100644
--- a/drivers/input/misc/wm831x-on.c
+++ b/drivers/input/misc/wm831x-on.c
@@ -69,14 +69,15 @@ static irqreturn_t wm831x_on_irq(int irq, void *data)
69 return IRQ_HANDLED; 69 return IRQ_HANDLED;
70} 70}
71 71
72static int __devinit wm831x_on_probe(struct platform_device *pdev) 72static int wm831x_on_probe(struct platform_device *pdev)
73{ 73{
74 struct wm831x *wm831x = dev_get_drvdata(pdev->dev.parent); 74 struct wm831x *wm831x = dev_get_drvdata(pdev->dev.parent);
75 struct wm831x_on *wm831x_on; 75 struct wm831x_on *wm831x_on;
76 int irq = wm831x_irq(wm831x, platform_get_irq(pdev, 0)); 76 int irq = wm831x_irq(wm831x, platform_get_irq(pdev, 0));
77 int ret; 77 int ret;
78 78
79 wm831x_on = kzalloc(sizeof(struct wm831x_on), GFP_KERNEL); 79 wm831x_on = devm_kzalloc(&pdev->dev, sizeof(struct wm831x_on),
80 GFP_KERNEL);
80 if (!wm831x_on) { 81 if (!wm831x_on) {
81 dev_err(&pdev->dev, "Can't allocate data\n"); 82 dev_err(&pdev->dev, "Can't allocate data\n");
82 return -ENOMEM; 83 return -ENOMEM;
@@ -120,11 +121,10 @@ err_irq:
120err_input_dev: 121err_input_dev:
121 input_free_device(wm831x_on->dev); 122 input_free_device(wm831x_on->dev);
122err: 123err:
123 kfree(wm831x_on);
124 return ret; 124 return ret;
125} 125}
126 126
127static int __devexit wm831x_on_remove(struct platform_device *pdev) 127static int wm831x_on_remove(struct platform_device *pdev)
128{ 128{
129 struct wm831x_on *wm831x_on = platform_get_drvdata(pdev); 129 struct wm831x_on *wm831x_on = platform_get_drvdata(pdev);
130 int irq = platform_get_irq(pdev, 0); 130 int irq = platform_get_irq(pdev, 0);
@@ -132,14 +132,13 @@ static int __devexit wm831x_on_remove(struct platform_device *pdev)
132 free_irq(irq, wm831x_on); 132 free_irq(irq, wm831x_on);
133 cancel_delayed_work_sync(&wm831x_on->work); 133 cancel_delayed_work_sync(&wm831x_on->work);
134 input_unregister_device(wm831x_on->dev); 134 input_unregister_device(wm831x_on->dev);
135 kfree(wm831x_on);
136 135
137 return 0; 136 return 0;
138} 137}
139 138
140static struct platform_driver wm831x_on_driver = { 139static struct platform_driver wm831x_on_driver = {
141 .probe = wm831x_on_probe, 140 .probe = wm831x_on_probe,
142 .remove = __devexit_p(wm831x_on_remove), 141 .remove = wm831x_on_remove,
143 .driver = { 142 .driver = {
144 .name = "wm831x-on", 143 .name = "wm831x-on",
145 .owner = THIS_MODULE, 144 .owner = THIS_MODULE,
diff --git a/drivers/input/misc/xen-kbdfront.c b/drivers/input/misc/xen-kbdfront.c
index 6f7d99013031..e21c1816a8f9 100644
--- a/drivers/input/misc/xen-kbdfront.c
+++ b/drivers/input/misc/xen-kbdfront.c
@@ -104,7 +104,7 @@ static irqreturn_t input_handler(int rq, void *dev_id)
104 return IRQ_HANDLED; 104 return IRQ_HANDLED;
105} 105}
106 106
107static int __devinit xenkbd_probe(struct xenbus_device *dev, 107static int xenkbd_probe(struct xenbus_device *dev,
108 const struct xenbus_device_id *id) 108 const struct xenbus_device_id *id)
109{ 109{
110 int ret, i, abs; 110 int ret, i, abs;
diff --git a/drivers/input/mouse/alps.c b/drivers/input/mouse/alps.c
index cf5af1f495ec..e229fa3cad96 100644
--- a/drivers/input/mouse/alps.c
+++ b/drivers/input/mouse/alps.c
@@ -767,9 +767,8 @@ static psmouse_ret_t alps_handle_interleaved_ps2(struct psmouse *psmouse)
767 psmouse->packet[5]) & 0x80) || 767 psmouse->packet[5]) & 0x80) ||
768 (!alps_is_valid_first_byte(priv->i, psmouse->packet[6]))) { 768 (!alps_is_valid_first_byte(priv->i, psmouse->packet[6]))) {
769 psmouse_dbg(psmouse, 769 psmouse_dbg(psmouse,
770 "refusing packet %x %x %x %x (suspected interleaved ps/2)\n", 770 "refusing packet %4ph (suspected interleaved ps/2)\n",
771 psmouse->packet[3], psmouse->packet[4], 771 psmouse->packet + 3);
772 psmouse->packet[5], psmouse->packet[6]);
773 return PSMOUSE_BAD_DATA; 772 return PSMOUSE_BAD_DATA;
774 } 773 }
775 774
@@ -831,9 +830,8 @@ static void alps_flush_packet(unsigned long data)
831 psmouse->packet[4] | 830 psmouse->packet[4] |
832 psmouse->packet[5]) & 0x80) { 831 psmouse->packet[5]) & 0x80) {
833 psmouse_dbg(psmouse, 832 psmouse_dbg(psmouse,
834 "refusing packet %x %x %x (suspected interleaved ps/2)\n", 833 "refusing packet %3ph (suspected interleaved ps/2)\n",
835 psmouse->packet[3], psmouse->packet[4], 834 psmouse->packet + 3);
836 psmouse->packet[5]);
837 } else { 835 } else {
838 alps_process_packet(psmouse); 836 alps_process_packet(psmouse);
839 } 837 }
diff --git a/drivers/input/mouse/gpio_mouse.c b/drivers/input/mouse/gpio_mouse.c
index 39fe9b737cae..532eaca4cc56 100644
--- a/drivers/input/mouse/gpio_mouse.c
+++ b/drivers/input/mouse/gpio_mouse.c
@@ -46,7 +46,7 @@ static void gpio_mouse_scan(struct input_polled_dev *dev)
46 input_sync(input); 46 input_sync(input);
47} 47}
48 48
49static int __devinit gpio_mouse_probe(struct platform_device *pdev) 49static int gpio_mouse_probe(struct platform_device *pdev)
50{ 50{
51 struct gpio_mouse_platform_data *pdata = pdev->dev.platform_data; 51 struct gpio_mouse_platform_data *pdata = pdev->dev.platform_data;
52 struct input_polled_dev *input_poll; 52 struct input_polled_dev *input_poll;
@@ -150,7 +150,7 @@ static int __devinit gpio_mouse_probe(struct platform_device *pdev)
150 return error; 150 return error;
151} 151}
152 152
153static int __devexit gpio_mouse_remove(struct platform_device *pdev) 153static int gpio_mouse_remove(struct platform_device *pdev)
154{ 154{
155 struct input_polled_dev *input = platform_get_drvdata(pdev); 155 struct input_polled_dev *input = platform_get_drvdata(pdev);
156 struct gpio_mouse_platform_data *pdata = input->private; 156 struct gpio_mouse_platform_data *pdata = input->private;
@@ -172,7 +172,7 @@ static int __devexit gpio_mouse_remove(struct platform_device *pdev)
172 172
173static struct platform_driver gpio_mouse_device_driver = { 173static struct platform_driver gpio_mouse_device_driver = {
174 .probe = gpio_mouse_probe, 174 .probe = gpio_mouse_probe,
175 .remove = __devexit_p(gpio_mouse_remove), 175 .remove = gpio_mouse_remove,
176 .driver = { 176 .driver = {
177 .name = "gpio_mouse", 177 .name = "gpio_mouse",
178 .owner = THIS_MODULE, 178 .owner = THIS_MODULE,
diff --git a/drivers/input/mouse/maplemouse.c b/drivers/input/mouse/maplemouse.c
index 5f278176eb9b..0a60717b91c6 100644
--- a/drivers/input/mouse/maplemouse.c
+++ b/drivers/input/mouse/maplemouse.c
@@ -64,7 +64,7 @@ static void dc_mouse_close(struct input_dev *dev)
64} 64}
65 65
66/* allow the mouse to be used */ 66/* allow the mouse to be used */
67static int __devinit probe_maple_mouse(struct device *dev) 67static int probe_maple_mouse(struct device *dev)
68{ 68{
69 struct maple_device *mdev = to_maple_dev(dev); 69 struct maple_device *mdev = to_maple_dev(dev);
70 struct maple_driver *mdrv = to_maple_driver(dev->driver); 70 struct maple_driver *mdrv = to_maple_driver(dev->driver);
@@ -114,7 +114,7 @@ fail:
114 return error; 114 return error;
115} 115}
116 116
117static int __devexit remove_maple_mouse(struct device *dev) 117static int remove_maple_mouse(struct device *dev)
118{ 118{
119 struct maple_device *mdev = to_maple_dev(dev); 119 struct maple_device *mdev = to_maple_dev(dev);
120 struct dc_mouse *mse = maple_get_drvdata(mdev); 120 struct dc_mouse *mse = maple_get_drvdata(mdev);
@@ -132,7 +132,7 @@ static struct maple_driver dc_mouse_driver = {
132 .drv = { 132 .drv = {
133 .name = "Dreamcast_mouse", 133 .name = "Dreamcast_mouse",
134 .probe = probe_maple_mouse, 134 .probe = probe_maple_mouse,
135 .remove = __devexit_p(remove_maple_mouse), 135 .remove = remove_maple_mouse,
136 }, 136 },
137}; 137};
138 138
diff --git a/drivers/input/mouse/navpoint.c b/drivers/input/mouse/navpoint.c
index c29ae7654d5e..8e1b98ea5648 100644
--- a/drivers/input/mouse/navpoint.c
+++ b/drivers/input/mouse/navpoint.c
@@ -206,7 +206,7 @@ static void navpoint_close(struct input_dev *input)
206 navpoint_down(navpoint); 206 navpoint_down(navpoint);
207} 207}
208 208
209static int __devinit navpoint_probe(struct platform_device *pdev) 209static int navpoint_probe(struct platform_device *pdev)
210{ 210{
211 const struct navpoint_platform_data *pdata = 211 const struct navpoint_platform_data *pdata =
212 dev_get_platdata(&pdev->dev); 212 dev_get_platdata(&pdev->dev);
@@ -299,7 +299,7 @@ err_free_gpio:
299 return error; 299 return error;
300} 300}
301 301
302static int __devexit navpoint_remove(struct platform_device *pdev) 302static int navpoint_remove(struct platform_device *pdev)
303{ 303{
304 const struct navpoint_platform_data *pdata = 304 const struct navpoint_platform_data *pdata =
305 dev_get_platdata(&pdev->dev); 305 dev_get_platdata(&pdev->dev);
@@ -353,7 +353,7 @@ static SIMPLE_DEV_PM_OPS(navpoint_pm_ops, navpoint_suspend, navpoint_resume);
353 353
354static struct platform_driver navpoint_driver = { 354static struct platform_driver navpoint_driver = {
355 .probe = navpoint_probe, 355 .probe = navpoint_probe,
356 .remove = __devexit_p(navpoint_remove), 356 .remove = navpoint_remove,
357 .driver = { 357 .driver = {
358 .name = "navpoint", 358 .name = "navpoint",
359 .owner = THIS_MODULE, 359 .owner = THIS_MODULE,
diff --git a/drivers/input/mouse/pxa930_trkball.c b/drivers/input/mouse/pxa930_trkball.c
index 4fe055f2c536..0ecb9e7945eb 100644
--- a/drivers/input/mouse/pxa930_trkball.c
+++ b/drivers/input/mouse/pxa930_trkball.c
@@ -143,7 +143,7 @@ static void pxa930_trkball_close(struct input_dev *dev)
143 pxa930_trkball_disable(trkball); 143 pxa930_trkball_disable(trkball);
144} 144}
145 145
146static int __devinit pxa930_trkball_probe(struct platform_device *pdev) 146static int pxa930_trkball_probe(struct platform_device *pdev)
147{ 147{
148 struct pxa930_trkball *trkball; 148 struct pxa930_trkball *trkball;
149 struct input_dev *input; 149 struct input_dev *input;
@@ -230,7 +230,7 @@ failed:
230 return error; 230 return error;
231} 231}
232 232
233static int __devexit pxa930_trkball_remove(struct platform_device *pdev) 233static int pxa930_trkball_remove(struct platform_device *pdev)
234{ 234{
235 struct pxa930_trkball *trkball = platform_get_drvdata(pdev); 235 struct pxa930_trkball *trkball = platform_get_drvdata(pdev);
236 int irq = platform_get_irq(pdev, 0); 236 int irq = platform_get_irq(pdev, 0);
@@ -248,7 +248,7 @@ static struct platform_driver pxa930_trkball_driver = {
248 .name = "pxa930-trkball", 248 .name = "pxa930-trkball",
249 }, 249 },
250 .probe = pxa930_trkball_probe, 250 .probe = pxa930_trkball_probe,
251 .remove = __devexit_p(pxa930_trkball_remove), 251 .remove = pxa930_trkball_remove,
252}; 252};
253module_platform_driver(pxa930_trkball_driver); 253module_platform_driver(pxa930_trkball_driver);
254 254
diff --git a/drivers/input/mouse/synaptics_i2c.c b/drivers/input/mouse/synaptics_i2c.c
index 063a174d3a88..ad822608f6ee 100644
--- a/drivers/input/mouse/synaptics_i2c.c
+++ b/drivers/input/mouse/synaptics_i2c.c
@@ -535,7 +535,7 @@ static struct synaptics_i2c *synaptics_i2c_touch_create(struct i2c_client *clien
535 return touch; 535 return touch;
536} 536}
537 537
538static int __devinit synaptics_i2c_probe(struct i2c_client *client, 538static int synaptics_i2c_probe(struct i2c_client *client,
539 const struct i2c_device_id *dev_id) 539 const struct i2c_device_id *dev_id)
540{ 540{
541 int ret; 541 int ret;
@@ -601,7 +601,7 @@ err_mem_free:
601 return ret; 601 return ret;
602} 602}
603 603
604static int __devexit synaptics_i2c_remove(struct i2c_client *client) 604static int synaptics_i2c_remove(struct i2c_client *client)
605{ 605{
606 struct synaptics_i2c *touch = i2c_get_clientdata(client); 606 struct synaptics_i2c *touch = i2c_get_clientdata(client);
607 607
@@ -662,7 +662,7 @@ static struct i2c_driver synaptics_i2c_driver = {
662 }, 662 },
663 663
664 .probe = synaptics_i2c_probe, 664 .probe = synaptics_i2c_probe,
665 .remove = __devexit_p(synaptics_i2c_remove), 665 .remove = synaptics_i2c_remove,
666 666
667 .id_table = synaptics_i2c_id_table, 667 .id_table = synaptics_i2c_id_table,
668}; 668};
diff --git a/drivers/input/serio/Kconfig b/drivers/input/serio/Kconfig
index 55f2c2293ec6..4a4e182c33e7 100644
--- a/drivers/input/serio/Kconfig
+++ b/drivers/input/serio/Kconfig
@@ -234,4 +234,13 @@ config SERIO_PS2MULT
234 To compile this driver as a module, choose M here: the 234 To compile this driver as a module, choose M here: the
235 module will be called ps2mult. 235 module will be called ps2mult.
236 236
237config SERIO_ARC_PS2
238 tristate "ARC PS/2 support"
239 help
240 Say Y here if you have an ARC FPGA platform with a PS/2
241 controller in it.
242
243 To compile this driver as a module, choose M here; the module
244 will be called arc_ps2.
245
237endif 246endif
diff --git a/drivers/input/serio/Makefile b/drivers/input/serio/Makefile
index dbbe37616c92..4b0c8f84f1c1 100644
--- a/drivers/input/serio/Makefile
+++ b/drivers/input/serio/Makefile
@@ -25,3 +25,4 @@ obj-$(CONFIG_SERIO_RAW) += serio_raw.o
25obj-$(CONFIG_SERIO_AMS_DELTA) += ams_delta_serio.o 25obj-$(CONFIG_SERIO_AMS_DELTA) += ams_delta_serio.o
26obj-$(CONFIG_SERIO_XILINX_XPS_PS2) += xilinx_ps2.o 26obj-$(CONFIG_SERIO_XILINX_XPS_PS2) += xilinx_ps2.o
27obj-$(CONFIG_SERIO_ALTERA_PS2) += altera_ps2.o 27obj-$(CONFIG_SERIO_ALTERA_PS2) += altera_ps2.o
28obj-$(CONFIG_SERIO_ARC_PS2) += arc_ps2.o
diff --git a/drivers/input/serio/altera_ps2.c b/drivers/input/serio/altera_ps2.c
index cc11f4efe119..479ce5fe8955 100644
--- a/drivers/input/serio/altera_ps2.c
+++ b/drivers/input/serio/altera_ps2.c
@@ -81,7 +81,7 @@ static void altera_ps2_close(struct serio *io)
81/* 81/*
82 * Add one device to this driver. 82 * Add one device to this driver.
83 */ 83 */
84static int __devinit altera_ps2_probe(struct platform_device *pdev) 84static int altera_ps2_probe(struct platform_device *pdev)
85{ 85{
86 struct ps2if *ps2if; 86 struct ps2if *ps2if;
87 struct serio *serio; 87 struct serio *serio;
@@ -159,7 +159,7 @@ static int __devinit altera_ps2_probe(struct platform_device *pdev)
159/* 159/*
160 * Remove one device from this driver. 160 * Remove one device from this driver.
161 */ 161 */
162static int __devexit altera_ps2_remove(struct platform_device *pdev) 162static int altera_ps2_remove(struct platform_device *pdev)
163{ 163{
164 struct ps2if *ps2if = platform_get_drvdata(pdev); 164 struct ps2if *ps2if = platform_get_drvdata(pdev);
165 165
@@ -187,7 +187,7 @@ MODULE_DEVICE_TABLE(of, altera_ps2_match);
187 */ 187 */
188static struct platform_driver altera_ps2_driver = { 188static struct platform_driver altera_ps2_driver = {
189 .probe = altera_ps2_probe, 189 .probe = altera_ps2_probe,
190 .remove = __devexit_p(altera_ps2_remove), 190 .remove = altera_ps2_remove,
191 .driver = { 191 .driver = {
192 .name = DRV_NAME, 192 .name = DRV_NAME,
193 .owner = THIS_MODULE, 193 .owner = THIS_MODULE,
diff --git a/drivers/input/serio/ambakmi.c b/drivers/input/serio/ambakmi.c
index 2e77246c2e5a..4e2fd44865e1 100644
--- a/drivers/input/serio/ambakmi.c
+++ b/drivers/input/serio/ambakmi.c
@@ -107,7 +107,7 @@ static void amba_kmi_close(struct serio *io)
107 clk_disable_unprepare(kmi->clk); 107 clk_disable_unprepare(kmi->clk);
108} 108}
109 109
110static int __devinit amba_kmi_probe(struct amba_device *dev, 110static int amba_kmi_probe(struct amba_device *dev,
111 const struct amba_id *id) 111 const struct amba_id *id)
112{ 112{
113 struct amba_kmi_port *kmi; 113 struct amba_kmi_port *kmi;
@@ -163,7 +163,7 @@ static int __devinit amba_kmi_probe(struct amba_device *dev,
163 return ret; 163 return ret;
164} 164}
165 165
166static int __devexit amba_kmi_remove(struct amba_device *dev) 166static int amba_kmi_remove(struct amba_device *dev)
167{ 167{
168 struct amba_kmi_port *kmi = amba_get_drvdata(dev); 168 struct amba_kmi_port *kmi = amba_get_drvdata(dev);
169 169
@@ -204,7 +204,7 @@ static struct amba_driver ambakmi_driver = {
204 }, 204 },
205 .id_table = amba_kmi_idtable, 205 .id_table = amba_kmi_idtable,
206 .probe = amba_kmi_probe, 206 .probe = amba_kmi_probe,
207 .remove = __devexit_p(amba_kmi_remove), 207 .remove = amba_kmi_remove,
208 .resume = amba_kmi_resume, 208 .resume = amba_kmi_resume,
209}; 209};
210 210
diff --git a/drivers/input/serio/arc_ps2.c b/drivers/input/serio/arc_ps2.c
new file mode 100644
index 000000000000..b571eb3e4efc
--- /dev/null
+++ b/drivers/input/serio/arc_ps2.c
@@ -0,0 +1,274 @@
1/*
2 * Copyright (C) 2004, 2007-2010, 2011-2012 Synopsys, Inc. (www.synopsys.com)
3 *
4 * This program is free software; you can redistribute it and/or modify
5 * it under the terms of the GNU General Public License version 2 as
6 * published by the Free Software Foundation.
7 *
8 * Driver is originally developed by Pavel Sokolov <psokolov@synopsys.com>
9 */
10
11#include <linux/module.h>
12#include <linux/interrupt.h>
13#include <linux/input.h>
14#include <linux/serio.h>
15#include <linux/platform_device.h>
16#include <linux/io.h>
17#include <linux/kernel.h>
18#include <linux/slab.h>
19
20#define ARC_PS2_PORTS 2
21
22#define ARC_ARC_PS2_ID 0x0001f609
23
24#define STAT_TIMEOUT 128
25
26#define PS2_STAT_RX_FRM_ERR (1)
27#define PS2_STAT_RX_BUF_OVER (1 << 1)
28#define PS2_STAT_RX_INT_EN (1 << 2)
29#define PS2_STAT_RX_VAL (1 << 3)
30#define PS2_STAT_TX_ISNOT_FUL (1 << 4)
31#define PS2_STAT_TX_INT_EN (1 << 5)
32
33struct arc_ps2_port {
34 void __iomem *data_addr;
35 void __iomem *status_addr;
36 struct serio *io;
37};
38
39struct arc_ps2_data {
40 struct arc_ps2_port port[ARC_PS2_PORTS];
41 void __iomem *addr;
42 unsigned int frame_error;
43 unsigned int buf_overflow;
44 unsigned int total_int;
45};
46
47static void arc_ps2_check_rx(struct arc_ps2_data *arc_ps2,
48 struct arc_ps2_port *port)
49{
50 unsigned int timeout = 1000;
51 unsigned int flag, status;
52 unsigned char data;
53
54 do {
55 status = ioread32(port->status_addr);
56 if (!(status & PS2_STAT_RX_VAL))
57 return;
58
59 data = ioread32(port->data_addr) & 0xff;
60
61 flag = 0;
62 arc_ps2->total_int++;
63 if (status & PS2_STAT_RX_FRM_ERR) {
64 arc_ps2->frame_error++;
65 flag |= SERIO_PARITY;
66 } else if (status & PS2_STAT_RX_BUF_OVER) {
67 arc_ps2->buf_overflow++;
68 flag |= SERIO_FRAME;
69 }
70
71 serio_interrupt(port->io, data, flag);
72 } while (--timeout);
73
74 dev_err(&port->io->dev, "PS/2 hardware stuck\n");
75}
76
77static irqreturn_t arc_ps2_interrupt(int irq, void *dev)
78{
79 struct arc_ps2_data *arc_ps2 = dev;
80 int i;
81
82 for (i = 0; i < ARC_PS2_PORTS; i++)
83 arc_ps2_check_rx(arc_ps2, &arc_ps2->port[i]);
84
85 return IRQ_HANDLED;
86}
87
88static int arc_ps2_write(struct serio *io, unsigned char val)
89{
90 unsigned status;
91 struct arc_ps2_port *port = io->port_data;
92 int timeout = STAT_TIMEOUT;
93
94 do {
95 status = ioread32(port->status_addr);
96 cpu_relax();
97
98 if (status & PS2_STAT_TX_ISNOT_FUL) {
99 iowrite32(val & 0xff, port->data_addr);
100 return 0;
101 }
102
103 } while (--timeout);
104
105 dev_err(&io->dev, "write timeout\n");
106 return -ETIMEDOUT;
107}
108
109static int arc_ps2_open(struct serio *io)
110{
111 struct arc_ps2_port *port = io->port_data;
112
113 iowrite32(PS2_STAT_RX_INT_EN, port->status_addr);
114
115 return 0;
116}
117
118static void arc_ps2_close(struct serio *io)
119{
120 struct arc_ps2_port *port = io->port_data;
121
122 iowrite32(ioread32(port->status_addr) & ~PS2_STAT_RX_INT_EN,
123 port->status_addr);
124}
125
126static void __iomem *arc_ps2_calc_addr(struct arc_ps2_data *arc_ps2,
127 int index, bool status)
128{
129 void __iomem *addr;
130
131 addr = arc_ps2->addr + 4 + 4 * index;
132 if (status)
133 addr += ARC_PS2_PORTS * 4;
134
135 return addr;
136}
137
138static void arc_ps2_inhibit_ports(struct arc_ps2_data *arc_ps2)
139{
140 void __iomem *addr;
141 u32 val;
142 int i;
143
144 for (i = 0; i < ARC_PS2_PORTS; i++) {
145 addr = arc_ps2_calc_addr(arc_ps2, i, true);
146 val = ioread32(addr);
147 val &= ~(PS2_STAT_RX_INT_EN | PS2_STAT_TX_INT_EN);
148 iowrite32(val, addr);
149 }
150}
151
152static int arc_ps2_create_port(struct platform_device *pdev,
153 struct arc_ps2_data *arc_ps2,
154 int index)
155{
156 struct arc_ps2_port *port = &arc_ps2->port[index];
157 struct serio *io;
158
159 io = kzalloc(sizeof(struct serio), GFP_KERNEL);
160 if (!io)
161 return -ENOMEM;
162
163 io->id.type = SERIO_8042;
164 io->write = arc_ps2_write;
165 io->open = arc_ps2_open;
166 io->close = arc_ps2_close;
167 snprintf(io->name, sizeof(io->name), "ARC PS/2 port%d", index);
168 snprintf(io->phys, sizeof(io->phys), "arc/serio%d", index);
169 io->port_data = port;
170
171 port->io = io;
172
173 port->data_addr = arc_ps2_calc_addr(arc_ps2, index, false);
174 port->status_addr = arc_ps2_calc_addr(arc_ps2, index, true);
175
176 dev_dbg(&pdev->dev, "port%d is allocated (data = 0x%p, status = 0x%p)\n",
177 index, port->data_addr, port->status_addr);
178
179 serio_register_port(port->io);
180 return 0;
181}
182
183static int arc_ps2_probe(struct platform_device *pdev)
184{
185 struct arc_ps2_data *arc_ps2;
186 struct resource *res;
187 int irq;
188 int error, id, i;
189
190 res = platform_get_resource(pdev, IORESOURCE_MEM, 0);
191 if (!res) {
192 dev_err(&pdev->dev, "no IO memory defined\n");
193 return -EINVAL;
194 }
195
196 irq = platform_get_irq_byname(pdev, "arc_ps2_irq");
197 if (irq < 0) {
198 dev_err(&pdev->dev, "no IRQ defined\n");
199 return -EINVAL;
200 }
201
202 arc_ps2 = devm_kzalloc(&pdev->dev, sizeof(struct arc_ps2_data),
203 GFP_KERNEL);
204 if (!arc_ps2) {
205 dev_err(&pdev->dev, "out of memory\n");
206 return -ENOMEM;
207 }
208
209 arc_ps2->addr = devm_request_and_ioremap(&pdev->dev, res);
210 if (!arc_ps2->addr)
211 return -EBUSY;
212
213 dev_info(&pdev->dev, "irq = %d, address = 0x%p, ports = %i\n",
214 irq, arc_ps2->addr, ARC_PS2_PORTS);
215
216 id = ioread32(arc_ps2->addr);
217 if (id != ARC_ARC_PS2_ID) {
218 dev_err(&pdev->dev, "device id does not match\n");
219 return -ENXIO;
220 }
221
222 arc_ps2_inhibit_ports(arc_ps2);
223
224 error = devm_request_irq(&pdev->dev, irq, arc_ps2_interrupt,
225 0, "arc_ps2", arc_ps2);
226 if (error) {
227 dev_err(&pdev->dev, "Could not allocate IRQ\n");
228 return error;
229 }
230
231 for (i = 0; i < ARC_PS2_PORTS; i++) {
232 error = arc_ps2_create_port(pdev, arc_ps2, i);
233 if (error) {
234 while (--i >= 0)
235 serio_unregister_port(arc_ps2->port[i].io);
236 return error;
237 }
238 }
239
240 platform_set_drvdata(pdev, arc_ps2);
241
242 return 0;
243}
244
245static int arc_ps2_remove(struct platform_device *pdev)
246{
247 struct arc_ps2_data *arc_ps2 = platform_get_drvdata(pdev);
248 int i;
249
250 for (i = 0; i < ARC_PS2_PORTS; i++)
251 serio_unregister_port(arc_ps2->port[i].io);
252
253 dev_dbg(&pdev->dev, "interrupt count = %i\n", arc_ps2->total_int);
254 dev_dbg(&pdev->dev, "frame error count = %i\n", arc_ps2->frame_error);
255 dev_dbg(&pdev->dev, "buffer overflow count = %i\n",
256 arc_ps2->buf_overflow);
257
258 return 0;
259}
260
261static struct platform_driver arc_ps2_driver = {
262 .driver = {
263 .name = "arc_ps2",
264 .owner = THIS_MODULE,
265 },
266 .probe = arc_ps2_probe,
267 .remove = arc_ps2_remove,
268};
269
270module_platform_driver(arc_ps2_driver);
271
272MODULE_LICENSE("GPL");
273MODULE_AUTHOR("Pavel Sokolov <psokolov@synopsys.com>");
274MODULE_DESCRIPTION("ARC PS/2 Driver");
diff --git a/drivers/input/serio/ct82c710.c b/drivers/input/serio/ct82c710.c
index 852816567241..cfe549d4eaa5 100644
--- a/drivers/input/serio/ct82c710.c
+++ b/drivers/input/serio/ct82c710.c
@@ -175,7 +175,7 @@ static int __init ct82c710_detect(void)
175 return 0; 175 return 0;
176} 176}
177 177
178static int __devinit ct82c710_probe(struct platform_device *dev) 178static int ct82c710_probe(struct platform_device *dev)
179{ 179{
180 ct82c710_port = kzalloc(sizeof(struct serio), GFP_KERNEL); 180 ct82c710_port = kzalloc(sizeof(struct serio), GFP_KERNEL);
181 if (!ct82c710_port) 181 if (!ct82c710_port)
@@ -199,7 +199,7 @@ static int __devinit ct82c710_probe(struct platform_device *dev)
199 return 0; 199 return 0;
200} 200}
201 201
202static int __devexit ct82c710_remove(struct platform_device *dev) 202static int ct82c710_remove(struct platform_device *dev)
203{ 203{
204 serio_unregister_port(ct82c710_port); 204 serio_unregister_port(ct82c710_port);
205 205
@@ -212,7 +212,7 @@ static struct platform_driver ct82c710_driver = {
212 .owner = THIS_MODULE, 212 .owner = THIS_MODULE,
213 }, 213 },
214 .probe = ct82c710_probe, 214 .probe = ct82c710_probe,
215 .remove = __devexit_p(ct82c710_remove), 215 .remove = ct82c710_remove,
216}; 216};
217 217
218 218
diff --git a/drivers/input/serio/gscps2.c b/drivers/input/serio/gscps2.c
index 4225f5d6b15f..8d9ba0c3827c 100644
--- a/drivers/input/serio/gscps2.c
+++ b/drivers/input/serio/gscps2.c
@@ -327,7 +327,7 @@ static void gscps2_close(struct serio *port)
327 * @return: success/error report 327 * @return: success/error report
328 */ 328 */
329 329
330static int __devinit gscps2_probe(struct parisc_device *dev) 330static int gscps2_probe(struct parisc_device *dev)
331{ 331{
332 struct gscps2port *ps2port; 332 struct gscps2port *ps2port;
333 struct serio *serio; 333 struct serio *serio;
@@ -414,7 +414,7 @@ fail_nomem:
414 * @return: success/error report 414 * @return: success/error report
415 */ 415 */
416 416
417static int __devexit gscps2_remove(struct parisc_device *dev) 417static int gscps2_remove(struct parisc_device *dev)
418{ 418{
419 struct gscps2port *ps2port = dev_get_drvdata(&dev->dev); 419 struct gscps2port *ps2port = dev_get_drvdata(&dev->dev);
420 420
@@ -444,7 +444,7 @@ static struct parisc_driver parisc_ps2_driver = {
444 .name = "gsc_ps2", 444 .name = "gsc_ps2",
445 .id_table = gscps2_device_tbl, 445 .id_table = gscps2_device_tbl,
446 .probe = gscps2_probe, 446 .probe = gscps2_probe,
447 .remove = __devexit_p(gscps2_remove), 447 .remove = gscps2_remove,
448}; 448};
449 449
450static int __init gscps2_init(void) 450static int __init gscps2_init(void)
diff --git a/drivers/input/serio/hil_mlc.c b/drivers/input/serio/hil_mlc.c
index bfd3865d886b..65605e4ef3cf 100644
--- a/drivers/input/serio/hil_mlc.c
+++ b/drivers/input/serio/hil_mlc.c
@@ -686,13 +686,12 @@ static int hilse_donode(hil_mlc *mlc)
686 write_lock_irqsave(&mlc->lock, flags); 686 write_lock_irqsave(&mlc->lock, flags);
687 pack = node->object.packet; 687 pack = node->object.packet;
688 out: 688 out:
689 if (mlc->istarted) 689 if (!mlc->istarted) {
690 goto out2; 690 /* Prepare to receive input */
691 /* Prepare to receive input */ 691 if ((node + 1)->act & HILSE_IN)
692 if ((node + 1)->act & HILSE_IN) 692 hilse_setup_input(mlc, node + 1);
693 hilse_setup_input(mlc, node + 1); 693 }
694 694
695 out2:
696 write_unlock_irqrestore(&mlc->lock, flags); 695 write_unlock_irqrestore(&mlc->lock, flags);
697 696
698 if (down_trylock(&mlc->osem)) { 697 if (down_trylock(&mlc->osem)) {
@@ -1010,8 +1009,6 @@ static int __init hil_mlc_init(void)
1010static void __exit hil_mlc_exit(void) 1009static void __exit hil_mlc_exit(void)
1011{ 1010{
1012 del_timer_sync(&hil_mlcs_kicker); 1011 del_timer_sync(&hil_mlcs_kicker);
1013
1014 tasklet_disable(&hil_mlcs_tasklet);
1015 tasklet_kill(&hil_mlcs_tasklet); 1012 tasklet_kill(&hil_mlcs_tasklet);
1016} 1013}
1017 1014
diff --git a/drivers/input/serio/i8042-io.h b/drivers/input/serio/i8042-io.h
index 5d48bb66aa73..a5eed2ade53d 100644
--- a/drivers/input/serio/i8042-io.h
+++ b/drivers/input/serio/i8042-io.h
@@ -76,7 +76,7 @@ static inline int i8042_platform_init(void)
76 if (check_legacy_ioport(I8042_DATA_REG)) 76 if (check_legacy_ioport(I8042_DATA_REG))
77 return -ENODEV; 77 return -ENODEV;
78#endif 78#endif
79#if !defined(__sh__) && !defined(__alpha__) && !defined(__mips__) 79#if !defined(__sh__) && !defined(__alpha__)
80 if (!request_region(I8042_DATA_REG, 16, "i8042")) 80 if (!request_region(I8042_DATA_REG, 16, "i8042"))
81 return -EBUSY; 81 return -EBUSY;
82#endif 82#endif
diff --git a/drivers/input/serio/i8042-sparcio.h b/drivers/input/serio/i8042-sparcio.h
index 395a9af3adcd..d6aa4c67dbb6 100644
--- a/drivers/input/serio/i8042-sparcio.h
+++ b/drivers/input/serio/i8042-sparcio.h
@@ -49,7 +49,7 @@ static inline void i8042_write_command(int val)
49#define OBP_PS2MS_NAME1 "kdmouse" 49#define OBP_PS2MS_NAME1 "kdmouse"
50#define OBP_PS2MS_NAME2 "mouse" 50#define OBP_PS2MS_NAME2 "mouse"
51 51
52static int __devinit sparc_i8042_probe(struct platform_device *op) 52static int sparc_i8042_probe(struct platform_device *op)
53{ 53{
54 struct device_node *dp = op->dev.of_node; 54 struct device_node *dp = op->dev.of_node;
55 55
@@ -80,7 +80,7 @@ static int __devinit sparc_i8042_probe(struct platform_device *op)
80 return 0; 80 return 0;
81} 81}
82 82
83static int __devexit sparc_i8042_remove(struct platform_device *op) 83static int sparc_i8042_remove(struct platform_device *op)
84{ 84{
85 of_iounmap(kbd_res, kbd_iobase, 8); 85 of_iounmap(kbd_res, kbd_iobase, 8);
86 86
@@ -102,7 +102,7 @@ static struct platform_driver sparc_i8042_driver = {
102 .of_match_table = sparc_i8042_match, 102 .of_match_table = sparc_i8042_match,
103 }, 103 },
104 .probe = sparc_i8042_probe, 104 .probe = sparc_i8042_probe,
105 .remove = __devexit_p(sparc_i8042_remove), 105 .remove = sparc_i8042_remove,
106}; 106};
107 107
108static int __init i8042_platform_init(void) 108static int __init i8042_platform_init(void)
diff --git a/drivers/input/serio/i8042.c b/drivers/input/serio/i8042.c
index 86564414b75a..78e4de42efaa 100644
--- a/drivers/input/serio/i8042.c
+++ b/drivers/input/serio/i8042.c
@@ -1284,7 +1284,7 @@ static void __init i8042_register_ports(void)
1284 } 1284 }
1285} 1285}
1286 1286
1287static void __devexit i8042_unregister_ports(void) 1287static void i8042_unregister_ports(void)
1288{ 1288{
1289 int i; 1289 int i;
1290 1290
@@ -1437,7 +1437,7 @@ static int __init i8042_probe(struct platform_device *dev)
1437 return error; 1437 return error;
1438} 1438}
1439 1439
1440static int __devexit i8042_remove(struct platform_device *dev) 1440static int i8042_remove(struct platform_device *dev)
1441{ 1441{
1442 i8042_unregister_ports(); 1442 i8042_unregister_ports();
1443 i8042_free_irqs(); 1443 i8042_free_irqs();
@@ -1455,7 +1455,7 @@ static struct platform_driver i8042_driver = {
1455 .pm = &i8042_pm_ops, 1455 .pm = &i8042_pm_ops,
1456#endif 1456#endif
1457 }, 1457 },
1458 .remove = __devexit_p(i8042_remove), 1458 .remove = i8042_remove,
1459 .shutdown = i8042_shutdown, 1459 .shutdown = i8042_shutdown,
1460}; 1460};
1461 1461
diff --git a/drivers/input/serio/maceps2.c b/drivers/input/serio/maceps2.c
index 61da763b1209..bc85e1cc66d8 100644
--- a/drivers/input/serio/maceps2.c
+++ b/drivers/input/serio/maceps2.c
@@ -116,7 +116,7 @@ static void maceps2_close(struct serio *dev)
116} 116}
117 117
118 118
119static struct serio * __devinit maceps2_allocate_port(int idx) 119static struct serio *maceps2_allocate_port(int idx)
120{ 120{
121 struct serio *serio; 121 struct serio *serio;
122 122
@@ -135,7 +135,7 @@ static struct serio * __devinit maceps2_allocate_port(int idx)
135 return serio; 135 return serio;
136} 136}
137 137
138static int __devinit maceps2_probe(struct platform_device *dev) 138static int maceps2_probe(struct platform_device *dev)
139{ 139{
140 maceps2_port[0] = maceps2_allocate_port(0); 140 maceps2_port[0] = maceps2_allocate_port(0);
141 maceps2_port[1] = maceps2_allocate_port(1); 141 maceps2_port[1] = maceps2_allocate_port(1);
@@ -151,7 +151,7 @@ static int __devinit maceps2_probe(struct platform_device *dev)
151 return 0; 151 return 0;
152} 152}
153 153
154static int __devexit maceps2_remove(struct platform_device *dev) 154static int maceps2_remove(struct platform_device *dev)
155{ 155{
156 serio_unregister_port(maceps2_port[0]); 156 serio_unregister_port(maceps2_port[0]);
157 serio_unregister_port(maceps2_port[1]); 157 serio_unregister_port(maceps2_port[1]);
@@ -165,7 +165,7 @@ static struct platform_driver maceps2_driver = {
165 .owner = THIS_MODULE, 165 .owner = THIS_MODULE,
166 }, 166 },
167 .probe = maceps2_probe, 167 .probe = maceps2_probe,
168 .remove = __devexit_p(maceps2_remove), 168 .remove = maceps2_remove,
169}; 169};
170 170
171static int __init maceps2_init(void) 171static int __init maceps2_init(void)
diff --git a/drivers/input/serio/pcips2.c b/drivers/input/serio/pcips2.c
index 0c42497aaaf4..76f83836fd5a 100644
--- a/drivers/input/serio/pcips2.c
+++ b/drivers/input/serio/pcips2.c
@@ -127,7 +127,7 @@ static void pcips2_close(struct serio *io)
127 free_irq(ps2if->dev->irq, ps2if); 127 free_irq(ps2if->dev->irq, ps2if);
128} 128}
129 129
130static int __devinit pcips2_probe(struct pci_dev *dev, const struct pci_device_id *id) 130static int pcips2_probe(struct pci_dev *dev, const struct pci_device_id *id)
131{ 131{
132 struct pcips2_data *ps2if; 132 struct pcips2_data *ps2if;
133 struct serio *serio; 133 struct serio *serio;
@@ -176,7 +176,7 @@ static int __devinit pcips2_probe(struct pci_dev *dev, const struct pci_device_i
176 return ret; 176 return ret;
177} 177}
178 178
179static void __devexit pcips2_remove(struct pci_dev *dev) 179static void pcips2_remove(struct pci_dev *dev)
180{ 180{
181 struct pcips2_data *ps2if = pci_get_drvdata(dev); 181 struct pcips2_data *ps2if = pci_get_drvdata(dev);
182 182
@@ -212,7 +212,7 @@ static struct pci_driver pcips2_driver = {
212 .name = "pcips2", 212 .name = "pcips2",
213 .id_table = pcips2_ids, 213 .id_table = pcips2_ids,
214 .probe = pcips2_probe, 214 .probe = pcips2_probe,
215 .remove = __devexit_p(pcips2_remove), 215 .remove = pcips2_remove,
216}; 216};
217 217
218module_pci_driver(pcips2_driver); 218module_pci_driver(pcips2_driver);
diff --git a/drivers/input/serio/q40kbd.c b/drivers/input/serio/q40kbd.c
index 0c0df7f73802..70fe542839fb 100644
--- a/drivers/input/serio/q40kbd.c
+++ b/drivers/input/serio/q40kbd.c
@@ -122,7 +122,7 @@ static void q40kbd_close(struct serio *port)
122 q40kbd_flush(q40kbd); 122 q40kbd_flush(q40kbd);
123} 123}
124 124
125static int __devinit q40kbd_probe(struct platform_device *pdev) 125static int q40kbd_probe(struct platform_device *pdev)
126{ 126{
127 struct q40kbd *q40kbd; 127 struct q40kbd *q40kbd;
128 struct serio *port; 128 struct serio *port;
@@ -168,7 +168,7 @@ err_free_mem:
168 return error; 168 return error;
169} 169}
170 170
171static int __devexit q40kbd_remove(struct platform_device *pdev) 171static int q40kbd_remove(struct platform_device *pdev)
172{ 172{
173 struct q40kbd *q40kbd = platform_get_drvdata(pdev); 173 struct q40kbd *q40kbd = platform_get_drvdata(pdev);
174 174
@@ -190,7 +190,7 @@ static struct platform_driver q40kbd_driver = {
190 .name = "q40kbd", 190 .name = "q40kbd",
191 .owner = THIS_MODULE, 191 .owner = THIS_MODULE,
192 }, 192 },
193 .remove = __devexit_p(q40kbd_remove), 193 .remove = q40kbd_remove,
194}; 194};
195 195
196static int __init q40kbd_init(void) 196static int __init q40kbd_init(void)
diff --git a/drivers/input/serio/rpckbd.c b/drivers/input/serio/rpckbd.c
index 2af5df6a8fba..567566ae0dae 100644
--- a/drivers/input/serio/rpckbd.c
+++ b/drivers/input/serio/rpckbd.c
@@ -114,7 +114,7 @@ static void rpckbd_close(struct serio *port)
114 * Allocate and initialize serio structure for subsequent registration 114 * Allocate and initialize serio structure for subsequent registration
115 * with serio core. 115 * with serio core.
116 */ 116 */
117static int __devinit rpckbd_probe(struct platform_device *dev) 117static int rpckbd_probe(struct platform_device *dev)
118{ 118{
119 struct rpckbd_data *rpckbd; 119 struct rpckbd_data *rpckbd;
120 struct serio *serio; 120 struct serio *serio;
@@ -153,7 +153,7 @@ static int __devinit rpckbd_probe(struct platform_device *dev)
153 return 0; 153 return 0;
154} 154}
155 155
156static int __devexit rpckbd_remove(struct platform_device *dev) 156static int rpckbd_remove(struct platform_device *dev)
157{ 157{
158 struct serio *serio = platform_get_drvdata(dev); 158 struct serio *serio = platform_get_drvdata(dev);
159 struct rpckbd_data *rpckbd = serio->port_data; 159 struct rpckbd_data *rpckbd = serio->port_data;
@@ -166,7 +166,7 @@ static int __devexit rpckbd_remove(struct platform_device *dev)
166 166
167static struct platform_driver rpckbd_driver = { 167static struct platform_driver rpckbd_driver = {
168 .probe = rpckbd_probe, 168 .probe = rpckbd_probe,
169 .remove = __devexit_p(rpckbd_remove), 169 .remove = rpckbd_remove,
170 .driver = { 170 .driver = {
171 .name = "kart", 171 .name = "kart",
172 .owner = THIS_MODULE, 172 .owner = THIS_MODULE,
diff --git a/drivers/input/serio/sa1111ps2.c b/drivers/input/serio/sa1111ps2.c
index 389766707534..b3e688911fd9 100644
--- a/drivers/input/serio/sa1111ps2.c
+++ b/drivers/input/serio/sa1111ps2.c
@@ -193,7 +193,7 @@ static void ps2_close(struct serio *io)
193/* 193/*
194 * Clear the input buffer. 194 * Clear the input buffer.
195 */ 195 */
196static void __devinit ps2_clear_input(struct ps2if *ps2if) 196static void ps2_clear_input(struct ps2if *ps2if)
197{ 197{
198 int maxread = 100; 198 int maxread = 100;
199 199
@@ -203,7 +203,7 @@ static void __devinit ps2_clear_input(struct ps2if *ps2if)
203 } 203 }
204} 204}
205 205
206static unsigned int __devinit ps2_test_one(struct ps2if *ps2if, 206static unsigned int ps2_test_one(struct ps2if *ps2if,
207 unsigned int mask) 207 unsigned int mask)
208{ 208{
209 unsigned int val; 209 unsigned int val;
@@ -220,7 +220,7 @@ static unsigned int __devinit ps2_test_one(struct ps2if *ps2if,
220 * Test the keyboard interface. We basically check to make sure that 220 * Test the keyboard interface. We basically check to make sure that
221 * we can drive each line to the keyboard independently of each other. 221 * we can drive each line to the keyboard independently of each other.
222 */ 222 */
223static int __devinit ps2_test(struct ps2if *ps2if) 223static int ps2_test(struct ps2if *ps2if)
224{ 224{
225 unsigned int stat; 225 unsigned int stat;
226 int ret = 0; 226 int ret = 0;
@@ -251,7 +251,7 @@ static int __devinit ps2_test(struct ps2if *ps2if)
251/* 251/*
252 * Add one device to this driver. 252 * Add one device to this driver.
253 */ 253 */
254static int __devinit ps2_probe(struct sa1111_dev *dev) 254static int ps2_probe(struct sa1111_dev *dev)
255{ 255{
256 struct ps2if *ps2if; 256 struct ps2if *ps2if;
257 struct serio *serio; 257 struct serio *serio;
@@ -334,7 +334,7 @@ static int __devinit ps2_probe(struct sa1111_dev *dev)
334/* 334/*
335 * Remove one device from this driver. 335 * Remove one device from this driver.
336 */ 336 */
337static int __devexit ps2_remove(struct sa1111_dev *dev) 337static int ps2_remove(struct sa1111_dev *dev)
338{ 338{
339 struct ps2if *ps2if = sa1111_get_drvdata(dev); 339 struct ps2if *ps2if = sa1111_get_drvdata(dev);
340 340
@@ -357,7 +357,7 @@ static struct sa1111_driver ps2_driver = {
357 }, 357 },
358 .devid = SA1111_DEVID_PS2, 358 .devid = SA1111_DEVID_PS2,
359 .probe = ps2_probe, 359 .probe = ps2_probe,
360 .remove = __devexit_p(ps2_remove), 360 .remove = ps2_remove,
361}; 361};
362 362
363static int __init ps2_init(void) 363static int __init ps2_init(void)
diff --git a/drivers/input/serio/serio.c b/drivers/input/serio/serio.c
index d0f7533dbf88..25fc5971f426 100644
--- a/drivers/input/serio/serio.c
+++ b/drivers/input/serio/serio.c
@@ -891,8 +891,6 @@ static int serio_bus_match(struct device *dev, struct device_driver *drv)
891 return serio_match_port(serio_drv->id_table, serio); 891 return serio_match_port(serio_drv->id_table, serio);
892} 892}
893 893
894#ifdef CONFIG_HOTPLUG
895
896#define SERIO_ADD_UEVENT_VAR(fmt, val...) \ 894#define SERIO_ADD_UEVENT_VAR(fmt, val...) \
897 do { \ 895 do { \
898 int err = add_uevent_var(env, fmt, val); \ 896 int err = add_uevent_var(env, fmt, val); \
@@ -920,15 +918,6 @@ static int serio_uevent(struct device *dev, struct kobj_uevent_env *env)
920} 918}
921#undef SERIO_ADD_UEVENT_VAR 919#undef SERIO_ADD_UEVENT_VAR
922 920
923#else
924
925static int serio_uevent(struct device *dev, struct kobj_uevent_env *env)
926{
927 return -ENODEV;
928}
929
930#endif /* CONFIG_HOTPLUG */
931
932#ifdef CONFIG_PM 921#ifdef CONFIG_PM
933static int serio_suspend(struct device *dev) 922static int serio_suspend(struct device *dev)
934{ 923{
diff --git a/drivers/input/serio/xilinx_ps2.c b/drivers/input/serio/xilinx_ps2.c
index 1e983bec7d86..17be85948ffd 100644
--- a/drivers/input/serio/xilinx_ps2.c
+++ b/drivers/input/serio/xilinx_ps2.c
@@ -233,7 +233,7 @@ static void sxps2_close(struct serio *pserio)
233 * It returns 0, if the driver is bound to the PS/2 device, or a negative 233 * It returns 0, if the driver is bound to the PS/2 device, or a negative
234 * value if there is an error. 234 * value if there is an error.
235 */ 235 */
236static int __devinit xps2_of_probe(struct platform_device *ofdev) 236static int xps2_of_probe(struct platform_device *ofdev)
237{ 237{
238 struct resource r_irq; /* Interrupt resources */ 238 struct resource r_irq; /* Interrupt resources */
239 struct resource r_mem; /* IO mem resources */ 239 struct resource r_mem; /* IO mem resources */
@@ -333,7 +333,7 @@ failed1:
333 * if the driver module is being unloaded. It frees any resources allocated to 333 * if the driver module is being unloaded. It frees any resources allocated to
334 * the device. 334 * the device.
335 */ 335 */
336static int __devexit xps2_of_remove(struct platform_device *of_dev) 336static int xps2_of_remove(struct platform_device *of_dev)
337{ 337{
338 struct xps2data *drvdata = platform_get_drvdata(of_dev); 338 struct xps2data *drvdata = platform_get_drvdata(of_dev);
339 struct resource r_mem; /* IO mem resources */ 339 struct resource r_mem; /* IO mem resources */
@@ -355,7 +355,7 @@ static int __devexit xps2_of_remove(struct platform_device *of_dev)
355} 355}
356 356
357/* Match table for of_platform binding */ 357/* Match table for of_platform binding */
358static const struct of_device_id xps2_of_match[] __devinitconst = { 358static const struct of_device_id xps2_of_match[] = {
359 { .compatible = "xlnx,xps-ps2-1.00.a", }, 359 { .compatible = "xlnx,xps-ps2-1.00.a", },
360 { /* end of list */ }, 360 { /* end of list */ },
361}; 361};
@@ -368,7 +368,7 @@ static struct platform_driver xps2_of_driver = {
368 .of_match_table = xps2_of_match, 368 .of_match_table = xps2_of_match,
369 }, 369 },
370 .probe = xps2_of_probe, 370 .probe = xps2_of_probe,
371 .remove = __devexit_p(xps2_of_remove), 371 .remove = xps2_of_remove,
372}; 372};
373module_platform_driver(xps2_of_driver); 373module_platform_driver(xps2_of_driver);
374 374
diff --git a/drivers/input/tablet/wacom_sys.c b/drivers/input/tablet/wacom_sys.c
index 858ad446de91..f92d34f45a1c 100644
--- a/drivers/input/tablet/wacom_sys.c
+++ b/drivers/input/tablet/wacom_sys.c
@@ -386,23 +386,40 @@ static int wacom_parse_hid(struct usb_interface *intf,
386 if (usage == WCM_DESKTOP) { 386 if (usage == WCM_DESKTOP) {
387 if (finger) { 387 if (finger) {
388 features->device_type = BTN_TOOL_FINGER; 388 features->device_type = BTN_TOOL_FINGER;
389 if (features->type == TABLETPC2FG) { 389
390 /* need to reset back */ 390 switch (features->type) {
391 case TABLETPC2FG:
391 features->pktlen = WACOM_PKGLEN_TPC2FG; 392 features->pktlen = WACOM_PKGLEN_TPC2FG;
392 } 393 break;
393 394
394 if (features->type == MTSCREEN || features->type == WACOM_24HDT) 395 case MTSCREEN:
396 case WACOM_24HDT:
395 features->pktlen = WACOM_PKGLEN_MTOUCH; 397 features->pktlen = WACOM_PKGLEN_MTOUCH;
398 break;
396 399
397 if (features->type == BAMBOO_PT) { 400 case MTTPC:
398 /* need to reset back */ 401 features->pktlen = WACOM_PKGLEN_MTTPC;
402 break;
403
404 case BAMBOO_PT:
399 features->pktlen = WACOM_PKGLEN_BBTOUCH; 405 features->pktlen = WACOM_PKGLEN_BBTOUCH;
406 break;
407
408 default:
409 features->pktlen = WACOM_PKGLEN_GRAPHIRE;
410 break;
411 }
412
413 switch (features->type) {
414 case BAMBOO_PT:
400 features->x_phy = 415 features->x_phy =
401 get_unaligned_le16(&report[i + 5]); 416 get_unaligned_le16(&report[i + 5]);
402 features->x_max = 417 features->x_max =
403 get_unaligned_le16(&report[i + 8]); 418 get_unaligned_le16(&report[i + 8]);
404 i += 15; 419 i += 15;
405 } else if (features->type == WACOM_24HDT) { 420 break;
421
422 case WACOM_24HDT:
406 features->x_max = 423 features->x_max =
407 get_unaligned_le16(&report[i + 3]); 424 get_unaligned_le16(&report[i + 3]);
408 features->x_phy = 425 features->x_phy =
@@ -410,7 +427,9 @@ static int wacom_parse_hid(struct usb_interface *intf,
410 features->unit = report[i - 1]; 427 features->unit = report[i - 1];
411 features->unitExpo = report[i - 3]; 428 features->unitExpo = report[i - 3];
412 i += 12; 429 i += 12;
413 } else { 430 break;
431
432 default:
414 features->x_max = 433 features->x_max =
415 get_unaligned_le16(&report[i + 3]); 434 get_unaligned_le16(&report[i + 3]);
416 features->x_phy = 435 features->x_phy =
@@ -418,10 +437,11 @@ static int wacom_parse_hid(struct usb_interface *intf,
418 features->unit = report[i + 9]; 437 features->unit = report[i + 9];
419 features->unitExpo = report[i + 11]; 438 features->unitExpo = report[i + 11];
420 i += 12; 439 i += 12;
440 break;
421 } 441 }
422 } else if (pen) { 442 } else if (pen) {
423 /* penabled only accepts exact bytes of data */ 443 /* penabled only accepts exact bytes of data */
424 if (features->type == TABLETPC2FG) 444 if (features->type >= TABLETPC)
425 features->pktlen = WACOM_PKGLEN_GRAPHIRE; 445 features->pktlen = WACOM_PKGLEN_GRAPHIRE;
426 features->device_type = BTN_TOOL_PEN; 446 features->device_type = BTN_TOOL_PEN;
427 features->x_max = 447 features->x_max =
@@ -434,32 +454,40 @@ static int wacom_parse_hid(struct usb_interface *intf,
434 case HID_USAGE_Y: 454 case HID_USAGE_Y:
435 if (usage == WCM_DESKTOP) { 455 if (usage == WCM_DESKTOP) {
436 if (finger) { 456 if (finger) {
437 int type = features->type; 457 switch (features->type) {
438 458 case TABLETPC2FG:
439 if (type == TABLETPC2FG || type == MTSCREEN) { 459 case MTSCREEN:
460 case MTTPC:
440 features->y_max = 461 features->y_max =
441 get_unaligned_le16(&report[i + 3]); 462 get_unaligned_le16(&report[i + 3]);
442 features->y_phy = 463 features->y_phy =
443 get_unaligned_le16(&report[i + 6]); 464 get_unaligned_le16(&report[i + 6]);
444 i += 7; 465 i += 7;
445 } else if (type == WACOM_24HDT) { 466 break;
467
468 case WACOM_24HDT:
446 features->y_max = 469 features->y_max =
447 get_unaligned_le16(&report[i + 3]); 470 get_unaligned_le16(&report[i + 3]);
448 features->y_phy = 471 features->y_phy =
449 get_unaligned_le16(&report[i - 2]); 472 get_unaligned_le16(&report[i - 2]);
450 i += 7; 473 i += 7;
451 } else if (type == BAMBOO_PT) { 474 break;
475
476 case BAMBOO_PT:
452 features->y_phy = 477 features->y_phy =
453 get_unaligned_le16(&report[i + 3]); 478 get_unaligned_le16(&report[i + 3]);
454 features->y_max = 479 features->y_max =
455 get_unaligned_le16(&report[i + 6]); 480 get_unaligned_le16(&report[i + 6]);
456 i += 12; 481 i += 12;
457 } else { 482 break;
483
484 default:
458 features->y_max = 485 features->y_max =
459 features->x_max; 486 features->x_max;
460 features->y_phy = 487 features->y_phy =
461 get_unaligned_le16(&report[i + 3]); 488 get_unaligned_le16(&report[i + 3]);
462 i += 4; 489 i += 4;
490 break;
463 } 491 }
464 } else if (pen) { 492 } else if (pen) {
465 features->y_max = 493 features->y_max =
diff --git a/drivers/input/tablet/wacom_wac.c b/drivers/input/tablet/wacom_wac.c
index 0a67031ffc13..264138f3217e 100644
--- a/drivers/input/tablet/wacom_wac.c
+++ b/drivers/input/tablet/wacom_wac.c
@@ -467,9 +467,7 @@ static void wacom_intuos_general(struct wacom_wac *wacom)
467 /* general pen packet */ 467 /* general pen packet */
468 if ((data[1] & 0xb8) == 0xa0) { 468 if ((data[1] & 0xb8) == 0xa0) {
469 t = (data[6] << 2) | ((data[7] >> 6) & 3); 469 t = (data[6] << 2) | ((data[7] >> 6) & 3);
470 if ((features->type >= INTUOS4S && features->type <= INTUOS4L) || 470 if (features->type >= INTUOS4S && features->type <= WACOM_24HD) {
471 (features->type >= INTUOS5S && features->type <= INTUOS5L) ||
472 (features->type >= WACOM_21UX2 && features->type <= WACOM_24HD)) {
473 t = (t << 1) | (data[1] & 1); 471 t = (t << 1) | (data[1] & 1);
474 } 472 }
475 input_report_abs(input, ABS_PRESSURE, t); 473 input_report_abs(input, ABS_PRESSURE, t);
@@ -877,6 +875,11 @@ static int wacom_mt_touch(struct wacom_wac *wacom)
877 int i; 875 int i;
878 int current_num_contacts = data[2]; 876 int current_num_contacts = data[2];
879 int contacts_to_send = 0; 877 int contacts_to_send = 0;
878 int x_offset = 0;
879
880 /* MTTPC does not support Height and Width */
881 if (wacom->features.type == MTTPC)
882 x_offset = -4;
880 883
881 /* 884 /*
882 * First packet resets the counter since only the first 885 * First packet resets the counter since only the first
@@ -889,7 +892,7 @@ static int wacom_mt_touch(struct wacom_wac *wacom)
889 contacts_to_send = min(5, wacom->num_contacts_left); 892 contacts_to_send = min(5, wacom->num_contacts_left);
890 893
891 for (i = 0; i < contacts_to_send; i++) { 894 for (i = 0; i < contacts_to_send; i++) {
892 int offset = (WACOM_BYTES_PER_MT_PACKET * i) + 3; 895 int offset = (WACOM_BYTES_PER_MT_PACKET + x_offset) * i + 3;
893 bool touch = data[offset] & 0x1; 896 bool touch = data[offset] & 0x1;
894 int id = le16_to_cpup((__le16 *)&data[offset + 1]); 897 int id = le16_to_cpup((__le16 *)&data[offset + 1]);
895 int slot = find_slot_from_contactid(wacom, id); 898 int slot = find_slot_from_contactid(wacom, id);
@@ -900,8 +903,8 @@ static int wacom_mt_touch(struct wacom_wac *wacom)
900 input_mt_slot(input, slot); 903 input_mt_slot(input, slot);
901 input_mt_report_slot_state(input, MT_TOOL_FINGER, touch); 904 input_mt_report_slot_state(input, MT_TOOL_FINGER, touch);
902 if (touch) { 905 if (touch) {
903 int x = le16_to_cpup((__le16 *)&data[offset + 7]); 906 int x = le16_to_cpup((__le16 *)&data[offset + x_offset + 7]);
904 int y = le16_to_cpup((__le16 *)&data[offset + 9]); 907 int y = le16_to_cpup((__le16 *)&data[offset + x_offset + 9]);
905 input_report_abs(input, ABS_MT_POSITION_X, x); 908 input_report_abs(input, ABS_MT_POSITION_X, x);
906 input_report_abs(input, ABS_MT_POSITION_Y, y); 909 input_report_abs(input, ABS_MT_POSITION_Y, y);
907 } 910 }
@@ -1336,6 +1339,7 @@ void wacom_wac_irq(struct wacom_wac *wacom_wac, size_t len)
1336 case TABLETPCE: 1339 case TABLETPCE:
1337 case TABLETPC2FG: 1340 case TABLETPC2FG:
1338 case MTSCREEN: 1341 case MTSCREEN:
1342 case MTTPC:
1339 sync = wacom_tpc_irq(wacom_wac, len); 1343 sync = wacom_tpc_irq(wacom_wac, len);
1340 break; 1344 break;
1341 1345
@@ -1657,6 +1661,7 @@ int wacom_setup_input_capabilities(struct input_dev *input_dev,
1657 /* fall through */ 1661 /* fall through */
1658 1662
1659 case MTSCREEN: 1663 case MTSCREEN:
1664 case MTTPC:
1660 if (features->device_type == BTN_TOOL_FINGER) { 1665 if (features->device_type == BTN_TOOL_FINGER) {
1661 wacom_wac->slots = kmalloc(features->touch_max * 1666 wacom_wac->slots = kmalloc(features->touch_max *
1662 sizeof(int), 1667 sizeof(int),
@@ -2018,6 +2023,15 @@ static const struct wacom_features wacom_features_0xED =
2018static const struct wacom_features wacom_features_0xEF = 2023static const struct wacom_features wacom_features_0xEF =
2019 { "Wacom ISDv4 EF", WACOM_PKGLEN_GRAPHIRE, 26202, 16325, 255, 2024 { "Wacom ISDv4 EF", WACOM_PKGLEN_GRAPHIRE, 26202, 16325, 255,
2020 0, TABLETPC, WACOM_INTUOS_RES, WACOM_INTUOS_RES }; 2025 0, TABLETPC, WACOM_INTUOS_RES, WACOM_INTUOS_RES };
2026static const struct wacom_features wacom_features_0x100 =
2027 { "Wacom ISDv4 100", WACOM_PKGLEN_MTTPC, 26202, 16325, 255,
2028 0, MTTPC, WACOM_INTUOS_RES, WACOM_INTUOS_RES };
2029static const struct wacom_features wacom_features_0x101 =
2030 { "Wacom ISDv4 101", WACOM_PKGLEN_MTTPC, 26202, 16325, 255,
2031 0, MTTPC, WACOM_INTUOS_RES, WACOM_INTUOS_RES };
2032static const struct wacom_features wacom_features_0x4001 =
2033 { "Wacom ISDv4 4001", WACOM_PKGLEN_MTTPC, 26202, 16325, 255,
2034 0, MTTPC, WACOM_INTUOS_RES, WACOM_INTUOS_RES };
2021static const struct wacom_features wacom_features_0x47 = 2035static const struct wacom_features wacom_features_0x47 =
2022 { "Wacom Intuos2 6x8", WACOM_PKGLEN_INTUOS, 20320, 16240, 1023, 2036 { "Wacom Intuos2 6x8", WACOM_PKGLEN_INTUOS, 20320, 16240, 1023,
2023 31, INTUOS, WACOM_INTUOS_RES, WACOM_INTUOS_RES }; 2037 31, INTUOS, WACOM_INTUOS_RES, WACOM_INTUOS_RES };
@@ -2034,7 +2048,8 @@ static const struct wacom_features wacom_features_0xD1 =
2034 .touch_max = 2 }; 2048 .touch_max = 2 };
2035static const struct wacom_features wacom_features_0xD2 = 2049static const struct wacom_features wacom_features_0xD2 =
2036 { "Wacom Bamboo Craft", WACOM_PKGLEN_BBFUN, 14720, 9200, 1023, 2050 { "Wacom Bamboo Craft", WACOM_PKGLEN_BBFUN, 14720, 9200, 1023,
2037 31, BAMBOO_PT, WACOM_INTUOS_RES, WACOM_INTUOS_RES }; 2051 31, BAMBOO_PT, WACOM_INTUOS_RES, WACOM_INTUOS_RES,
2052 .touch_max = 2 };
2038static const struct wacom_features wacom_features_0xD3 = 2053static const struct wacom_features wacom_features_0xD3 =
2039 { "Wacom Bamboo 2FG 6x8", WACOM_PKGLEN_BBFUN, 21648, 13700, 1023, 2054 { "Wacom Bamboo 2FG 6x8", WACOM_PKGLEN_BBFUN, 21648, 13700, 1023,
2040 31, BAMBOO_PT, WACOM_INTUOS_RES, WACOM_INTUOS_RES, 2055 31, BAMBOO_PT, WACOM_INTUOS_RES, WACOM_INTUOS_RES,
@@ -2194,6 +2209,9 @@ const struct usb_device_id wacom_ids[] = {
2194 { USB_DEVICE_WACOM(0xEC) }, 2209 { USB_DEVICE_WACOM(0xEC) },
2195 { USB_DEVICE_WACOM(0xED) }, 2210 { USB_DEVICE_WACOM(0xED) },
2196 { USB_DEVICE_WACOM(0xEF) }, 2211 { USB_DEVICE_WACOM(0xEF) },
2212 { USB_DEVICE_WACOM(0x100) },
2213 { USB_DEVICE_WACOM(0x101) },
2214 { USB_DEVICE_WACOM(0x4001) },
2197 { USB_DEVICE_WACOM(0x47) }, 2215 { USB_DEVICE_WACOM(0x47) },
2198 { USB_DEVICE_WACOM(0xF4) }, 2216 { USB_DEVICE_WACOM(0xF4) },
2199 { USB_DEVICE_WACOM(0xF8) }, 2217 { USB_DEVICE_WACOM(0xF8) },
diff --git a/drivers/input/tablet/wacom_wac.h b/drivers/input/tablet/wacom_wac.h
index 345f1e76975e..9396d7769f86 100644
--- a/drivers/input/tablet/wacom_wac.h
+++ b/drivers/input/tablet/wacom_wac.h
@@ -26,6 +26,7 @@
26#define WACOM_PKGLEN_BBPEN 10 26#define WACOM_PKGLEN_BBPEN 10
27#define WACOM_PKGLEN_WIRELESS 32 27#define WACOM_PKGLEN_WIRELESS 32
28#define WACOM_PKGLEN_MTOUCH 62 28#define WACOM_PKGLEN_MTOUCH 62
29#define WACOM_PKGLEN_MTTPC 40
29 30
30/* wacom data size per MT contact */ 31/* wacom data size per MT contact */
31#define WACOM_BYTES_PER_MT_PACKET 11 32#define WACOM_BYTES_PER_MT_PACKET 11
@@ -88,6 +89,7 @@ enum {
88 TABLETPCE, 89 TABLETPCE,
89 TABLETPC2FG, 90 TABLETPC2FG,
90 MTSCREEN, 91 MTSCREEN,
92 MTTPC,
91 MAX_TYPE 93 MAX_TYPE
92}; 94};
93 95
diff --git a/drivers/input/touchscreen/88pm860x-ts.c b/drivers/input/touchscreen/88pm860x-ts.c
index 326218dbd6e6..c7068942ebe8 100644
--- a/drivers/input/touchscreen/88pm860x-ts.c
+++ b/drivers/input/touchscreen/88pm860x-ts.c
@@ -115,7 +115,7 @@ static void pm860x_touch_close(struct input_dev *dev)
115} 115}
116 116
117#ifdef CONFIG_OF 117#ifdef CONFIG_OF
118static int __devinit pm860x_touch_dt_init(struct platform_device *pdev, 118static int pm860x_touch_dt_init(struct platform_device *pdev,
119 struct pm860x_chip *chip, 119 struct pm860x_chip *chip,
120 int *res_x) 120 int *res_x)
121{ 121{
@@ -169,7 +169,7 @@ static int __devinit pm860x_touch_dt_init(struct platform_device *pdev,
169#define pm860x_touch_dt_init(x, y, z) (-1) 169#define pm860x_touch_dt_init(x, y, z) (-1)
170#endif 170#endif
171 171
172static int __devinit pm860x_touch_probe(struct platform_device *pdev) 172static int pm860x_touch_probe(struct platform_device *pdev)
173{ 173{
174 struct pm860x_chip *chip = dev_get_drvdata(pdev->dev.parent); 174 struct pm860x_chip *chip = dev_get_drvdata(pdev->dev.parent);
175 struct pm860x_touch_pdata *pdata = pdev->dev.platform_data; 175 struct pm860x_touch_pdata *pdata = pdev->dev.platform_data;
@@ -293,7 +293,7 @@ out:
293 return ret; 293 return ret;
294} 294}
295 295
296static int __devexit pm860x_touch_remove(struct platform_device *pdev) 296static int pm860x_touch_remove(struct platform_device *pdev)
297{ 297{
298 struct pm860x_touch *touch = platform_get_drvdata(pdev); 298 struct pm860x_touch *touch = platform_get_drvdata(pdev);
299 299
@@ -310,7 +310,7 @@ static struct platform_driver pm860x_touch_driver = {
310 .owner = THIS_MODULE, 310 .owner = THIS_MODULE,
311 }, 311 },
312 .probe = pm860x_touch_probe, 312 .probe = pm860x_touch_probe,
313 .remove = __devexit_p(pm860x_touch_remove), 313 .remove = pm860x_touch_remove,
314}; 314};
315module_platform_driver(pm860x_touch_driver); 315module_platform_driver(pm860x_touch_driver);
316 316
diff --git a/drivers/input/touchscreen/Kconfig b/drivers/input/touchscreen/Kconfig
index 0c45caddd41c..515cfe790543 100644
--- a/drivers/input/touchscreen/Kconfig
+++ b/drivers/input/touchscreen/Kconfig
@@ -111,18 +111,6 @@ config TOUCHSCREEN_AUO_PIXCIR
111 To compile this driver as a module, choose M here: the 111 To compile this driver as a module, choose M here: the
112 module will be called auo-pixcir-ts. 112 module will be called auo-pixcir-ts.
113 113
114config TOUCHSCREEN_BITSY
115 tristate "Compaq iPAQ H3600 (Bitsy) touchscreen"
116 depends on SA1100_BITSY
117 select SERIO
118 help
119 Say Y here if you have the h3600 (Bitsy) touchscreen.
120
121 If unsure, say N.
122
123 To compile this driver as a module, choose M here: the
124 module will be called h3600_ts_input.
125
126config TOUCHSCREEN_BU21013 114config TOUCHSCREEN_BU21013
127 tristate "BU21013 based touch panel controllers" 115 tristate "BU21013 based touch panel controllers"
128 depends on I2C 116 depends on I2C
diff --git a/drivers/input/touchscreen/Makefile b/drivers/input/touchscreen/Makefile
index 7c4c78ebe49e..6bfbeab67c9f 100644
--- a/drivers/input/touchscreen/Makefile
+++ b/drivers/input/touchscreen/Makefile
@@ -15,7 +15,6 @@ obj-$(CONFIG_TOUCHSCREEN_ADS7846) += ads7846.o
15obj-$(CONFIG_TOUCHSCREEN_ATMEL_MXT) += atmel_mxt_ts.o 15obj-$(CONFIG_TOUCHSCREEN_ATMEL_MXT) += atmel_mxt_ts.o
16obj-$(CONFIG_TOUCHSCREEN_ATMEL_TSADCC) += atmel_tsadcc.o 16obj-$(CONFIG_TOUCHSCREEN_ATMEL_TSADCC) += atmel_tsadcc.o
17obj-$(CONFIG_TOUCHSCREEN_AUO_PIXCIR) += auo-pixcir-ts.o 17obj-$(CONFIG_TOUCHSCREEN_AUO_PIXCIR) += auo-pixcir-ts.o
18obj-$(CONFIG_TOUCHSCREEN_BITSY) += h3600_ts_input.o
19obj-$(CONFIG_TOUCHSCREEN_BU21013) += bu21013_ts.o 18obj-$(CONFIG_TOUCHSCREEN_BU21013) += bu21013_ts.o
20obj-$(CONFIG_TOUCHSCREEN_CY8CTMG110) += cy8ctmg110_ts.o 19obj-$(CONFIG_TOUCHSCREEN_CY8CTMG110) += cy8ctmg110_ts.o
21obj-$(CONFIG_TOUCHSCREEN_CYTTSP_CORE) += cyttsp_core.o 20obj-$(CONFIG_TOUCHSCREEN_CYTTSP_CORE) += cyttsp_core.o
diff --git a/drivers/input/touchscreen/ad7877.c b/drivers/input/touchscreen/ad7877.c
index 2c7692108e6c..23fa829b869d 100644
--- a/drivers/input/touchscreen/ad7877.c
+++ b/drivers/input/touchscreen/ad7877.c
@@ -682,7 +682,7 @@ static void ad7877_setup_ts_def_msg(struct spi_device *spi, struct ad7877 *ts)
682 } 682 }
683} 683}
684 684
685static int __devinit ad7877_probe(struct spi_device *spi) 685static int ad7877_probe(struct spi_device *spi)
686{ 686{
687 struct ad7877 *ts; 687 struct ad7877 *ts;
688 struct input_dev *input_dev; 688 struct input_dev *input_dev;
@@ -810,7 +810,7 @@ err_free_mem:
810 return err; 810 return err;
811} 811}
812 812
813static int __devexit ad7877_remove(struct spi_device *spi) 813static int ad7877_remove(struct spi_device *spi)
814{ 814{
815 struct ad7877 *ts = dev_get_drvdata(&spi->dev); 815 struct ad7877 *ts = dev_get_drvdata(&spi->dev);
816 816
@@ -857,7 +857,7 @@ static struct spi_driver ad7877_driver = {
857 .pm = &ad7877_pm, 857 .pm = &ad7877_pm,
858 }, 858 },
859 .probe = ad7877_probe, 859 .probe = ad7877_probe,
860 .remove = __devexit_p(ad7877_remove), 860 .remove = ad7877_remove,
861}; 861};
862 862
863module_spi_driver(ad7877_driver); 863module_spi_driver(ad7877_driver);
diff --git a/drivers/input/touchscreen/ad7879-i2c.c b/drivers/input/touchscreen/ad7879-i2c.c
index 3054354d0dd3..dcf390771549 100644
--- a/drivers/input/touchscreen/ad7879-i2c.c
+++ b/drivers/input/touchscreen/ad7879-i2c.c
@@ -54,7 +54,7 @@ static const struct ad7879_bus_ops ad7879_i2c_bus_ops = {
54 .write = ad7879_i2c_write, 54 .write = ad7879_i2c_write,
55}; 55};
56 56
57static int __devinit ad7879_i2c_probe(struct i2c_client *client, 57static int ad7879_i2c_probe(struct i2c_client *client,
58 const struct i2c_device_id *id) 58 const struct i2c_device_id *id)
59{ 59{
60 struct ad7879 *ts; 60 struct ad7879 *ts;
@@ -75,7 +75,7 @@ static int __devinit ad7879_i2c_probe(struct i2c_client *client,
75 return 0; 75 return 0;
76} 76}
77 77
78static int __devexit ad7879_i2c_remove(struct i2c_client *client) 78static int ad7879_i2c_remove(struct i2c_client *client)
79{ 79{
80 struct ad7879 *ts = i2c_get_clientdata(client); 80 struct ad7879 *ts = i2c_get_clientdata(client);
81 81
@@ -98,7 +98,7 @@ static struct i2c_driver ad7879_i2c_driver = {
98 .pm = &ad7879_pm_ops, 98 .pm = &ad7879_pm_ops,
99 }, 99 },
100 .probe = ad7879_i2c_probe, 100 .probe = ad7879_i2c_probe,
101 .remove = __devexit_p(ad7879_i2c_remove), 101 .remove = ad7879_i2c_remove,
102 .id_table = ad7879_id, 102 .id_table = ad7879_id,
103}; 103};
104 104
diff --git a/drivers/input/touchscreen/ad7879-spi.c b/drivers/input/touchscreen/ad7879-spi.c
index db49abf056ba..606da5bd6115 100644
--- a/drivers/input/touchscreen/ad7879-spi.c
+++ b/drivers/input/touchscreen/ad7879-spi.c
@@ -110,7 +110,7 @@ static const struct ad7879_bus_ops ad7879_spi_bus_ops = {
110 .write = ad7879_spi_write, 110 .write = ad7879_spi_write,
111}; 111};
112 112
113static int __devinit ad7879_spi_probe(struct spi_device *spi) 113static int ad7879_spi_probe(struct spi_device *spi)
114{ 114{
115 struct ad7879 *ts; 115 struct ad7879 *ts;
116 int err; 116 int err;
@@ -137,7 +137,7 @@ static int __devinit ad7879_spi_probe(struct spi_device *spi)
137 return 0; 137 return 0;
138} 138}
139 139
140static int __devexit ad7879_spi_remove(struct spi_device *spi) 140static int ad7879_spi_remove(struct spi_device *spi)
141{ 141{
142 struct ad7879 *ts = spi_get_drvdata(spi); 142 struct ad7879 *ts = spi_get_drvdata(spi);
143 143
@@ -154,7 +154,7 @@ static struct spi_driver ad7879_spi_driver = {
154 .pm = &ad7879_pm_ops, 154 .pm = &ad7879_pm_ops,
155 }, 155 },
156 .probe = ad7879_spi_probe, 156 .probe = ad7879_spi_probe,
157 .remove = __devexit_p(ad7879_spi_remove), 157 .remove = ad7879_spi_remove,
158}; 158};
159 159
160module_spi_driver(ad7879_spi_driver); 160module_spi_driver(ad7879_spi_driver);
diff --git a/drivers/input/touchscreen/ads7846.c b/drivers/input/touchscreen/ads7846.c
index 78e5d9ab0ba7..4f702b3ec1a3 100644
--- a/drivers/input/touchscreen/ads7846.c
+++ b/drivers/input/touchscreen/ads7846.c
@@ -955,7 +955,7 @@ static int ads7846_resume(struct device *dev)
955 955
956static SIMPLE_DEV_PM_OPS(ads7846_pm, ads7846_suspend, ads7846_resume); 956static SIMPLE_DEV_PM_OPS(ads7846_pm, ads7846_suspend, ads7846_resume);
957 957
958static int __devinit ads7846_setup_pendown(struct spi_device *spi, 958static int ads7846_setup_pendown(struct spi_device *spi,
959 struct ads7846 *ts) 959 struct ads7846 *ts)
960{ 960{
961 struct ads7846_platform_data *pdata = spi->dev.platform_data; 961 struct ads7846_platform_data *pdata = spi->dev.platform_data;
@@ -997,7 +997,7 @@ static int __devinit ads7846_setup_pendown(struct spi_device *spi,
997 * Set up the transfers to read touchscreen state; this assumes we 997 * Set up the transfers to read touchscreen state; this assumes we
998 * use formula #2 for pressure, not #3. 998 * use formula #2 for pressure, not #3.
999 */ 999 */
1000static void __devinit ads7846_setup_spi_msg(struct ads7846 *ts, 1000static void ads7846_setup_spi_msg(struct ads7846 *ts,
1001 const struct ads7846_platform_data *pdata) 1001 const struct ads7846_platform_data *pdata)
1002{ 1002{
1003 struct spi_message *m = &ts->msg[0]; 1003 struct spi_message *m = &ts->msg[0];
@@ -1196,7 +1196,7 @@ static void __devinit ads7846_setup_spi_msg(struct ads7846 *ts,
1196 spi_message_add_tail(x, m); 1196 spi_message_add_tail(x, m);
1197} 1197}
1198 1198
1199static int __devinit ads7846_probe(struct spi_device *spi) 1199static int ads7846_probe(struct spi_device *spi)
1200{ 1200{
1201 struct ads7846 *ts; 1201 struct ads7846 *ts;
1202 struct ads7846_packet *packet; 1202 struct ads7846_packet *packet;
@@ -1390,7 +1390,7 @@ static int __devinit ads7846_probe(struct spi_device *spi)
1390 return err; 1390 return err;
1391} 1391}
1392 1392
1393static int __devexit ads7846_remove(struct spi_device *spi) 1393static int ads7846_remove(struct spi_device *spi)
1394{ 1394{
1395 struct ads7846 *ts = dev_get_drvdata(&spi->dev); 1395 struct ads7846 *ts = dev_get_drvdata(&spi->dev);
1396 1396
@@ -1434,7 +1434,7 @@ static struct spi_driver ads7846_driver = {
1434 .pm = &ads7846_pm, 1434 .pm = &ads7846_pm,
1435 }, 1435 },
1436 .probe = ads7846_probe, 1436 .probe = ads7846_probe,
1437 .remove = __devexit_p(ads7846_remove), 1437 .remove = ads7846_remove,
1438}; 1438};
1439 1439
1440module_spi_driver(ads7846_driver); 1440module_spi_driver(ads7846_driver);
diff --git a/drivers/input/touchscreen/atmel_mxt_ts.c b/drivers/input/touchscreen/atmel_mxt_ts.c
index 1df2396af008..d04f810cb1dd 100644
--- a/drivers/input/touchscreen/atmel_mxt_ts.c
+++ b/drivers/input/touchscreen/atmel_mxt_ts.c
@@ -1095,7 +1095,7 @@ static void mxt_input_close(struct input_dev *dev)
1095 mxt_stop(data); 1095 mxt_stop(data);
1096} 1096}
1097 1097
1098static int __devinit mxt_probe(struct i2c_client *client, 1098static int mxt_probe(struct i2c_client *client,
1099 const struct i2c_device_id *id) 1099 const struct i2c_device_id *id)
1100{ 1100{
1101 const struct mxt_platform_data *pdata = client->dev.platform_data; 1101 const struct mxt_platform_data *pdata = client->dev.platform_data;
@@ -1200,7 +1200,7 @@ err_free_mem:
1200 return error; 1200 return error;
1201} 1201}
1202 1202
1203static int __devexit mxt_remove(struct i2c_client *client) 1203static int mxt_remove(struct i2c_client *client)
1204{ 1204{
1205 struct mxt_data *data = i2c_get_clientdata(client); 1205 struct mxt_data *data = i2c_get_clientdata(client);
1206 1206
@@ -1270,7 +1270,7 @@ static struct i2c_driver mxt_driver = {
1270 .pm = &mxt_pm_ops, 1270 .pm = &mxt_pm_ops,
1271 }, 1271 },
1272 .probe = mxt_probe, 1272 .probe = mxt_probe,
1273 .remove = __devexit_p(mxt_remove), 1273 .remove = mxt_remove,
1274 .id_table = mxt_id, 1274 .id_table = mxt_id,
1275}; 1275};
1276 1276
diff --git a/drivers/input/touchscreen/atmel_tsadcc.c b/drivers/input/touchscreen/atmel_tsadcc.c
index ea392ee138ed..95f6785a94b0 100644
--- a/drivers/input/touchscreen/atmel_tsadcc.c
+++ b/drivers/input/touchscreen/atmel_tsadcc.c
@@ -177,7 +177,7 @@ static irqreturn_t atmel_tsadcc_interrupt(int irq, void *dev)
177 * The functions for inserting/removing us as a module. 177 * The functions for inserting/removing us as a module.
178 */ 178 */
179 179
180static int __devinit atmel_tsadcc_probe(struct platform_device *pdev) 180static int atmel_tsadcc_probe(struct platform_device *pdev)
181{ 181{
182 struct atmel_tsadcc *ts_dev; 182 struct atmel_tsadcc *ts_dev;
183 struct input_dev *input_dev; 183 struct input_dev *input_dev;
@@ -323,7 +323,7 @@ err_free_mem:
323 return err; 323 return err;
324} 324}
325 325
326static int __devexit atmel_tsadcc_remove(struct platform_device *pdev) 326static int atmel_tsadcc_remove(struct platform_device *pdev)
327{ 327{
328 struct atmel_tsadcc *ts_dev = dev_get_drvdata(&pdev->dev); 328 struct atmel_tsadcc *ts_dev = dev_get_drvdata(&pdev->dev);
329 struct resource *res; 329 struct resource *res;
@@ -346,7 +346,7 @@ static int __devexit atmel_tsadcc_remove(struct platform_device *pdev)
346 346
347static struct platform_driver atmel_tsadcc_driver = { 347static struct platform_driver atmel_tsadcc_driver = {
348 .probe = atmel_tsadcc_probe, 348 .probe = atmel_tsadcc_probe,
349 .remove = __devexit_p(atmel_tsadcc_remove), 349 .remove = atmel_tsadcc_remove,
350 .driver = { 350 .driver = {
351 .name = "atmel_tsadcc", 351 .name = "atmel_tsadcc",
352 }, 352 },
diff --git a/drivers/input/touchscreen/auo-pixcir-ts.c b/drivers/input/touchscreen/auo-pixcir-ts.c
index c7047b6bb020..c6e19a96348e 100644
--- a/drivers/input/touchscreen/auo-pixcir-ts.c
+++ b/drivers/input/touchscreen/auo-pixcir-ts.c
@@ -286,7 +286,7 @@ static int auo_pixcir_power_mode(struct auo_pixcir_ts *ts, int mode)
286 return 0; 286 return 0;
287} 287}
288 288
289static __devinit int auo_pixcir_int_config(struct auo_pixcir_ts *ts, 289static int auo_pixcir_int_config(struct auo_pixcir_ts *ts,
290 int int_setting) 290 int int_setting)
291{ 291{
292 struct i2c_client *client = ts->client; 292 struct i2c_client *client = ts->client;
@@ -482,7 +482,7 @@ unlock:
482static SIMPLE_DEV_PM_OPS(auo_pixcir_pm_ops, auo_pixcir_suspend, 482static SIMPLE_DEV_PM_OPS(auo_pixcir_pm_ops, auo_pixcir_suspend,
483 auo_pixcir_resume); 483 auo_pixcir_resume);
484 484
485static int __devinit auo_pixcir_probe(struct i2c_client *client, 485static int auo_pixcir_probe(struct i2c_client *client,
486 const struct i2c_device_id *id) 486 const struct i2c_device_id *id)
487{ 487{
488 const struct auo_pixcir_ts_platdata *pdata = client->dev.platform_data; 488 const struct auo_pixcir_ts_platdata *pdata = client->dev.platform_data;
@@ -599,7 +599,7 @@ err_gpio_int:
599 return ret; 599 return ret;
600} 600}
601 601
602static int __devexit auo_pixcir_remove(struct i2c_client *client) 602static int auo_pixcir_remove(struct i2c_client *client)
603{ 603{
604 struct auo_pixcir_ts *ts = i2c_get_clientdata(client); 604 struct auo_pixcir_ts *ts = i2c_get_clientdata(client);
605 const struct auo_pixcir_ts_platdata *pdata = client->dev.platform_data; 605 const struct auo_pixcir_ts_platdata *pdata = client->dev.platform_data;
@@ -631,7 +631,7 @@ static struct i2c_driver auo_pixcir_driver = {
631 .pm = &auo_pixcir_pm_ops, 631 .pm = &auo_pixcir_pm_ops,
632 }, 632 },
633 .probe = auo_pixcir_probe, 633 .probe = auo_pixcir_probe,
634 .remove = __devexit_p(auo_pixcir_remove), 634 .remove = auo_pixcir_remove,
635 .id_table = auo_pixcir_idtable, 635 .id_table = auo_pixcir_idtable,
636}; 636};
637 637
diff --git a/drivers/input/touchscreen/bu21013_ts.c b/drivers/input/touchscreen/bu21013_ts.c
index 5c487d23f11c..b9b5ddad6658 100644
--- a/drivers/input/touchscreen/bu21013_ts.c
+++ b/drivers/input/touchscreen/bu21013_ts.c
@@ -14,6 +14,9 @@
14#include <linux/slab.h> 14#include <linux/slab.h>
15#include <linux/regulator/consumer.h> 15#include <linux/regulator/consumer.h>
16#include <linux/module.h> 16#include <linux/module.h>
17#include <linux/gpio.h>
18#include <linux/of.h>
19#include <linux/of_gpio.h>
17 20
18#define PEN_DOWN_INTR 0 21#define PEN_DOWN_INTR 0
19#define MAX_FINGERS 2 22#define MAX_FINGERS 2
@@ -148,11 +151,12 @@
148struct bu21013_ts_data { 151struct bu21013_ts_data {
149 struct i2c_client *client; 152 struct i2c_client *client;
150 wait_queue_head_t wait; 153 wait_queue_head_t wait;
151 bool touch_stopped;
152 const struct bu21013_platform_device *chip; 154 const struct bu21013_platform_device *chip;
153 struct input_dev *in_dev; 155 struct input_dev *in_dev;
154 unsigned int intr_pin;
155 struct regulator *regulator; 156 struct regulator *regulator;
157 unsigned int irq;
158 unsigned int intr_pin;
159 bool touch_stopped;
156}; 160};
157 161
158/** 162/**
@@ -262,7 +266,7 @@ static irqreturn_t bu21013_gpio_irq(int irq, void *device_data)
262 return IRQ_NONE; 266 return IRQ_NONE;
263 } 267 }
264 268
265 data->intr_pin = data->chip->irq_read_val(); 269 data->intr_pin = gpio_get_value(data->chip->touch_pin);
266 if (data->intr_pin == PEN_DOWN_INTR) 270 if (data->intr_pin == PEN_DOWN_INTR)
267 wait_event_timeout(data->wait, data->touch_stopped, 271 wait_event_timeout(data->wait, data->touch_stopped,
268 msecs_to_jiffies(2)); 272 msecs_to_jiffies(2));
@@ -418,8 +422,70 @@ static void bu21013_free_irq(struct bu21013_ts_data *bu21013_data)
418{ 422{
419 bu21013_data->touch_stopped = true; 423 bu21013_data->touch_stopped = true;
420 wake_up(&bu21013_data->wait); 424 wake_up(&bu21013_data->wait);
421 free_irq(bu21013_data->chip->irq, bu21013_data); 425 free_irq(bu21013_data->irq, bu21013_data);
426}
427
428/**
429 * bu21013_cs_disable() - deconfigures the touch panel controller
430 * @bu21013_data: device structure pointer
431 *
432 * This function is used to deconfigure the chip selection
433 * for touch panel controller.
434 */
435static void bu21013_cs_disable(struct bu21013_ts_data *bu21013_data)
436{
437 int error;
438
439 error = gpio_direction_output(bu21013_data->chip->cs_pin, 0);
440 if (error < 0)
441 dev_warn(&bu21013_data->client->dev,
442 "%s: gpio direction failed, error: %d\n",
443 __func__, error);
444 else
445 gpio_set_value(bu21013_data->chip->cs_pin, 0);
446
447 gpio_free(bu21013_data->chip->cs_pin);
448}
449
450#ifdef CONFIG_OF
451static const struct bu21013_platform_device *
452bu21013_parse_dt(struct device *dev)
453{
454 struct device_node *np = dev->of_node;
455 struct bu21013_platform_device *pdata;
456
457 if (!np) {
458 dev_err(dev, "no device tree or platform data\n");
459 return ERR_PTR(-EINVAL);
460 }
461
462 pdata = devm_kzalloc(dev, sizeof(*pdata), GFP_KERNEL);
463 if (!pdata)
464 return ERR_PTR(-ENOMEM);
465
466 pdata->y_flip = pdata->x_flip = false;
467
468 pdata->x_flip = of_property_read_bool(np, "rohm,flip-x");
469 pdata->y_flip = of_property_read_bool(np, "rohm,flip-y");
470
471 of_property_read_u32(np, "rohm,touch-max-x", &pdata->touch_x_max);
472 of_property_read_u32(np, "rohm,touch-max-y", &pdata->touch_y_max);
473
474 pdata->touch_pin = of_get_named_gpio(np, "touch-gpio", 0);
475 pdata->cs_pin = of_get_named_gpio(np, "reset-gpio", 0);
476
477 pdata->ext_clk = false;
478
479 return pdata;
422} 480}
481#else
482static inline const struct bu21013_platform_device *
483bu21013_parse_dt(struct device *dev)
484{
485 dev_err(dev, "no platform data available\n");
486 return ERR_PTR(-EINVAL);
487}
488#endif
423 489
424/** 490/**
425 * bu21013_probe() - initializes the i2c-client touchscreen driver 491 * bu21013_probe() - initializes the i2c-client touchscreen driver
@@ -429,13 +495,13 @@ static void bu21013_free_irq(struct bu21013_ts_data *bu21013_data)
429 * This function used to initializes the i2c-client touchscreen 495 * This function used to initializes the i2c-client touchscreen
430 * driver and returns integer. 496 * driver and returns integer.
431 */ 497 */
432static int __devinit bu21013_probe(struct i2c_client *client, 498static int bu21013_probe(struct i2c_client *client,
433 const struct i2c_device_id *id) 499 const struct i2c_device_id *id)
434{ 500{
501 const struct bu21013_platform_device *pdata =
502 dev_get_platdata(&client->dev);
435 struct bu21013_ts_data *bu21013_data; 503 struct bu21013_ts_data *bu21013_data;
436 struct input_dev *in_dev; 504 struct input_dev *in_dev;
437 const struct bu21013_platform_device *pdata =
438 client->dev.platform_data;
439 int error; 505 int error;
440 506
441 if (!i2c_check_functionality(client->adapter, 507 if (!i2c_check_functionality(client->adapter,
@@ -445,7 +511,13 @@ static int __devinit bu21013_probe(struct i2c_client *client,
445 } 511 }
446 512
447 if (!pdata) { 513 if (!pdata) {
448 dev_err(&client->dev, "platform data not defined\n"); 514 pdata = bu21013_parse_dt(&client->dev);
515 if (IS_ERR(pdata))
516 return PTR_ERR(pdata);
517 }
518
519 if (!gpio_is_valid(pdata->touch_pin)) {
520 dev_err(&client->dev, "invalid touch_pin supplied\n");
449 return -EINVAL; 521 return -EINVAL;
450 } 522 }
451 523
@@ -460,8 +532,9 @@ static int __devinit bu21013_probe(struct i2c_client *client,
460 bu21013_data->in_dev = in_dev; 532 bu21013_data->in_dev = in_dev;
461 bu21013_data->chip = pdata; 533 bu21013_data->chip = pdata;
462 bu21013_data->client = client; 534 bu21013_data->client = client;
535 bu21013_data->irq = gpio_to_irq(pdata->touch_pin);
463 536
464 bu21013_data->regulator = regulator_get(&client->dev, "V-TOUCH"); 537 bu21013_data->regulator = regulator_get(&client->dev, "avdd");
465 if (IS_ERR(bu21013_data->regulator)) { 538 if (IS_ERR(bu21013_data->regulator)) {
466 dev_err(&client->dev, "regulator_get failed\n"); 539 dev_err(&client->dev, "regulator_get failed\n");
467 error = PTR_ERR(bu21013_data->regulator); 540 error = PTR_ERR(bu21013_data->regulator);
@@ -478,12 +551,11 @@ static int __devinit bu21013_probe(struct i2c_client *client,
478 init_waitqueue_head(&bu21013_data->wait); 551 init_waitqueue_head(&bu21013_data->wait);
479 552
480 /* configure the gpio pins */ 553 /* configure the gpio pins */
481 if (pdata->cs_en) { 554 error = gpio_request_one(pdata->cs_pin, GPIOF_OUT_INIT_HIGH,
482 error = pdata->cs_en(pdata->cs_pin); 555 "touchp_reset");
483 if (error < 0) { 556 if (error < 0) {
484 dev_err(&client->dev, "chip init failed\n"); 557 dev_err(&client->dev, "Unable to request gpio reset_pin\n");
485 goto err_disable_regulator; 558 goto err_disable_regulator;
486 }
487 } 559 }
488 560
489 /* configure the touch panel controller */ 561 /* configure the touch panel controller */
@@ -508,12 +580,13 @@ static int __devinit bu21013_probe(struct i2c_client *client,
508 pdata->touch_y_max, 0, 0); 580 pdata->touch_y_max, 0, 0);
509 input_set_drvdata(in_dev, bu21013_data); 581 input_set_drvdata(in_dev, bu21013_data);
510 582
511 error = request_threaded_irq(pdata->irq, NULL, bu21013_gpio_irq, 583 error = request_threaded_irq(bu21013_data->irq, NULL, bu21013_gpio_irq,
512 IRQF_TRIGGER_FALLING | IRQF_SHARED | 584 IRQF_TRIGGER_FALLING | IRQF_SHARED |
513 IRQF_ONESHOT, 585 IRQF_ONESHOT,
514 DRIVER_TP, bu21013_data); 586 DRIVER_TP, bu21013_data);
515 if (error) { 587 if (error) {
516 dev_err(&client->dev, "request irq %d failed\n", pdata->irq); 588 dev_err(&client->dev, "request irq %d failed\n",
589 bu21013_data->irq);
517 goto err_cs_disable; 590 goto err_cs_disable;
518 } 591 }
519 592
@@ -531,7 +604,7 @@ static int __devinit bu21013_probe(struct i2c_client *client,
531err_free_irq: 604err_free_irq:
532 bu21013_free_irq(bu21013_data); 605 bu21013_free_irq(bu21013_data);
533err_cs_disable: 606err_cs_disable:
534 pdata->cs_dis(pdata->cs_pin); 607 bu21013_cs_disable(bu21013_data);
535err_disable_regulator: 608err_disable_regulator:
536 regulator_disable(bu21013_data->regulator); 609 regulator_disable(bu21013_data->regulator);
537err_put_regulator: 610err_put_regulator:
@@ -549,13 +622,13 @@ err_free_mem:
549 * This function uses to remove the i2c-client 622 * This function uses to remove the i2c-client
550 * touchscreen driver and returns integer. 623 * touchscreen driver and returns integer.
551 */ 624 */
552static int __devexit bu21013_remove(struct i2c_client *client) 625static int bu21013_remove(struct i2c_client *client)
553{ 626{
554 struct bu21013_ts_data *bu21013_data = i2c_get_clientdata(client); 627 struct bu21013_ts_data *bu21013_data = i2c_get_clientdata(client);
555 628
556 bu21013_free_irq(bu21013_data); 629 bu21013_free_irq(bu21013_data);
557 630
558 bu21013_data->chip->cs_dis(bu21013_data->chip->cs_pin); 631 bu21013_cs_disable(bu21013_data);
559 632
560 input_unregister_device(bu21013_data->in_dev); 633 input_unregister_device(bu21013_data->in_dev);
561 634
@@ -584,9 +657,9 @@ static int bu21013_suspend(struct device *dev)
584 657
585 bu21013_data->touch_stopped = true; 658 bu21013_data->touch_stopped = true;
586 if (device_may_wakeup(&client->dev)) 659 if (device_may_wakeup(&client->dev))
587 enable_irq_wake(bu21013_data->chip->irq); 660 enable_irq_wake(bu21013_data->irq);
588 else 661 else
589 disable_irq(bu21013_data->chip->irq); 662 disable_irq(bu21013_data->irq);
590 663
591 regulator_disable(bu21013_data->regulator); 664 regulator_disable(bu21013_data->regulator);
592 665
@@ -621,9 +694,9 @@ static int bu21013_resume(struct device *dev)
621 bu21013_data->touch_stopped = false; 694 bu21013_data->touch_stopped = false;
622 695
623 if (device_may_wakeup(&client->dev)) 696 if (device_may_wakeup(&client->dev))
624 disable_irq_wake(bu21013_data->chip->irq); 697 disable_irq_wake(bu21013_data->irq);
625 else 698 else
626 enable_irq(bu21013_data->chip->irq); 699 enable_irq(bu21013_data->irq);
627 700
628 return 0; 701 return 0;
629} 702}
@@ -649,7 +722,7 @@ static struct i2c_driver bu21013_driver = {
649#endif 722#endif
650 }, 723 },
651 .probe = bu21013_probe, 724 .probe = bu21013_probe,
652 .remove = __devexit_p(bu21013_remove), 725 .remove = bu21013_remove,
653 .id_table = bu21013_id, 726 .id_table = bu21013_id,
654}; 727};
655 728
diff --git a/drivers/input/touchscreen/cy8ctmg110_ts.c b/drivers/input/touchscreen/cy8ctmg110_ts.c
index 464f1bf4b61d..96e0eedcc7e5 100644
--- a/drivers/input/touchscreen/cy8ctmg110_ts.c
+++ b/drivers/input/touchscreen/cy8ctmg110_ts.c
@@ -99,9 +99,18 @@ static int cy8ctmg110_read_regs(struct cy8ctmg110 *tsc,
99 int ret; 99 int ret;
100 struct i2c_msg msg[2] = { 100 struct i2c_msg msg[2] = {
101 /* first write slave position to i2c devices */ 101 /* first write slave position to i2c devices */
102 { client->addr, 0, 1, &cmd }, 102 {
103 .addr = client->addr,
104 .len = 1,
105 .buf = &cmd
106 },
103 /* Second read data from position */ 107 /* Second read data from position */
104 { client->addr, I2C_M_RD, len, data } 108 {
109 .addr = client->addr,
110 .flags = I2C_M_RD,
111 .len = len,
112 .buf = data
113 }
105 }; 114 };
106 115
107 ret = i2c_transfer(client->adapter, msg, 2); 116 ret = i2c_transfer(client->adapter, msg, 2);
@@ -166,7 +175,7 @@ static irqreturn_t cy8ctmg110_irq_thread(int irq, void *dev_id)
166 return IRQ_HANDLED; 175 return IRQ_HANDLED;
167} 176}
168 177
169static int __devinit cy8ctmg110_probe(struct i2c_client *client, 178static int cy8ctmg110_probe(struct i2c_client *client,
170 const struct i2c_device_id *id) 179 const struct i2c_device_id *id)
171{ 180{
172 const struct cy8ctmg110_pdata *pdata = client->dev.platform_data; 181 const struct cy8ctmg110_pdata *pdata = client->dev.platform_data;
@@ -314,7 +323,7 @@ static int cy8ctmg110_resume(struct device *dev)
314static SIMPLE_DEV_PM_OPS(cy8ctmg110_pm, cy8ctmg110_suspend, cy8ctmg110_resume); 323static SIMPLE_DEV_PM_OPS(cy8ctmg110_pm, cy8ctmg110_suspend, cy8ctmg110_resume);
315#endif 324#endif
316 325
317static int __devexit cy8ctmg110_remove(struct i2c_client *client) 326static int cy8ctmg110_remove(struct i2c_client *client)
318{ 327{
319 struct cy8ctmg110 *ts = i2c_get_clientdata(client); 328 struct cy8ctmg110 *ts = i2c_get_clientdata(client);
320 329
@@ -348,7 +357,7 @@ static struct i2c_driver cy8ctmg110_driver = {
348 }, 357 },
349 .id_table = cy8ctmg110_idtable, 358 .id_table = cy8ctmg110_idtable,
350 .probe = cy8ctmg110_probe, 359 .probe = cy8ctmg110_probe,
351 .remove = __devexit_p(cy8ctmg110_remove), 360 .remove = cy8ctmg110_remove,
352}; 361};
353 362
354module_i2c_driver(cy8ctmg110_driver); 363module_i2c_driver(cy8ctmg110_driver);
diff --git a/drivers/input/touchscreen/cyttsp_i2c.c b/drivers/input/touchscreen/cyttsp_i2c.c
index 2af1d0c52bcd..4dbdf44b8fc5 100644
--- a/drivers/input/touchscreen/cyttsp_i2c.c
+++ b/drivers/input/touchscreen/cyttsp_i2c.c
@@ -81,7 +81,7 @@ static const struct cyttsp_bus_ops cyttsp_i2c_bus_ops = {
81 .read = cyttsp_i2c_read_block_data, 81 .read = cyttsp_i2c_read_block_data,
82}; 82};
83 83
84static int __devinit cyttsp_i2c_probe(struct i2c_client *client, 84static int cyttsp_i2c_probe(struct i2c_client *client,
85 const struct i2c_device_id *id) 85 const struct i2c_device_id *id)
86{ 86{
87 struct cyttsp *ts; 87 struct cyttsp *ts;
@@ -102,7 +102,7 @@ static int __devinit cyttsp_i2c_probe(struct i2c_client *client,
102 return 0; 102 return 0;
103} 103}
104 104
105static int __devexit cyttsp_i2c_remove(struct i2c_client *client) 105static int cyttsp_i2c_remove(struct i2c_client *client)
106{ 106{
107 struct cyttsp *ts = i2c_get_clientdata(client); 107 struct cyttsp *ts = i2c_get_clientdata(client);
108 108
@@ -124,7 +124,7 @@ static struct i2c_driver cyttsp_i2c_driver = {
124 .pm = &cyttsp_pm_ops, 124 .pm = &cyttsp_pm_ops,
125 }, 125 },
126 .probe = cyttsp_i2c_probe, 126 .probe = cyttsp_i2c_probe,
127 .remove = __devexit_p(cyttsp_i2c_remove), 127 .remove = cyttsp_i2c_remove,
128 .id_table = cyttsp_i2c_id, 128 .id_table = cyttsp_i2c_id,
129}; 129};
130 130
diff --git a/drivers/input/touchscreen/cyttsp_spi.c b/drivers/input/touchscreen/cyttsp_spi.c
index 9f263410407b..638e20310f12 100644
--- a/drivers/input/touchscreen/cyttsp_spi.c
+++ b/drivers/input/touchscreen/cyttsp_spi.c
@@ -147,7 +147,7 @@ static const struct cyttsp_bus_ops cyttsp_spi_bus_ops = {
147 .read = cyttsp_spi_read_block_data, 147 .read = cyttsp_spi_read_block_data,
148}; 148};
149 149
150static int __devinit cyttsp_spi_probe(struct spi_device *spi) 150static int cyttsp_spi_probe(struct spi_device *spi)
151{ 151{
152 struct cyttsp *ts; 152 struct cyttsp *ts;
153 int error; 153 int error;
@@ -172,7 +172,7 @@ static int __devinit cyttsp_spi_probe(struct spi_device *spi)
172 return 0; 172 return 0;
173} 173}
174 174
175static int __devexit cyttsp_spi_remove(struct spi_device *spi) 175static int cyttsp_spi_remove(struct spi_device *spi)
176{ 176{
177 struct cyttsp *ts = spi_get_drvdata(spi); 177 struct cyttsp *ts = spi_get_drvdata(spi);
178 178
@@ -188,7 +188,7 @@ static struct spi_driver cyttsp_spi_driver = {
188 .pm = &cyttsp_pm_ops, 188 .pm = &cyttsp_pm_ops,
189 }, 189 },
190 .probe = cyttsp_spi_probe, 190 .probe = cyttsp_spi_probe,
191 .remove = __devexit_p(cyttsp_spi_remove), 191 .remove = cyttsp_spi_remove,
192}; 192};
193 193
194module_spi_driver(cyttsp_spi_driver); 194module_spi_driver(cyttsp_spi_driver);
diff --git a/drivers/input/touchscreen/da9034-ts.c b/drivers/input/touchscreen/da9034-ts.c
index 36b65cf10d7f..34ad84105e6e 100644
--- a/drivers/input/touchscreen/da9034-ts.c
+++ b/drivers/input/touchscreen/da9034-ts.c
@@ -297,7 +297,7 @@ static void da9034_touch_close(struct input_dev *dev)
297} 297}
298 298
299 299
300static int __devinit da9034_touch_probe(struct platform_device *pdev) 300static int da9034_touch_probe(struct platform_device *pdev)
301{ 301{
302 struct da9034_touch_pdata *pdata = pdev->dev.platform_data; 302 struct da9034_touch_pdata *pdata = pdev->dev.platform_data;
303 struct da9034_touch *touch; 303 struct da9034_touch *touch;
@@ -361,7 +361,7 @@ err_free_touch:
361 return ret; 361 return ret;
362} 362}
363 363
364static int __devexit da9034_touch_remove(struct platform_device *pdev) 364static int da9034_touch_remove(struct platform_device *pdev)
365{ 365{
366 struct da9034_touch *touch = platform_get_drvdata(pdev); 366 struct da9034_touch *touch = platform_get_drvdata(pdev);
367 367
@@ -377,7 +377,7 @@ static struct platform_driver da9034_touch_driver = {
377 .owner = THIS_MODULE, 377 .owner = THIS_MODULE,
378 }, 378 },
379 .probe = da9034_touch_probe, 379 .probe = da9034_touch_probe,
380 .remove = __devexit_p(da9034_touch_remove), 380 .remove = da9034_touch_remove,
381}; 381};
382module_platform_driver(da9034_touch_driver); 382module_platform_driver(da9034_touch_driver);
383 383
diff --git a/drivers/input/touchscreen/da9052_tsi.c b/drivers/input/touchscreen/da9052_tsi.c
index 53133efe0418..8f561e22bdd4 100644
--- a/drivers/input/touchscreen/da9052_tsi.c
+++ b/drivers/input/touchscreen/da9052_tsi.c
@@ -141,7 +141,7 @@ static void da9052_ts_pen_work(struct work_struct *work)
141 } 141 }
142} 142}
143 143
144static int __devinit da9052_ts_configure_gpio(struct da9052 *da9052) 144static int da9052_ts_configure_gpio(struct da9052 *da9052)
145{ 145{
146 int error; 146 int error;
147 147
@@ -160,7 +160,7 @@ static int __devinit da9052_ts_configure_gpio(struct da9052 *da9052)
160 return 0; 160 return 0;
161} 161}
162 162
163static int __devinit da9052_configure_tsi(struct da9052_tsi *tsi) 163static int da9052_configure_tsi(struct da9052_tsi *tsi)
164{ 164{
165 int error; 165 int error;
166 166
@@ -227,7 +227,7 @@ static void da9052_ts_input_close(struct input_dev *input_dev)
227 da9052_reg_update(tsi->da9052, DA9052_TSI_CONT_A_REG, 1 << 1, 0); 227 da9052_reg_update(tsi->da9052, DA9052_TSI_CONT_A_REG, 1 << 1, 0);
228} 228}
229 229
230static int __devinit da9052_ts_probe(struct platform_device *pdev) 230static int da9052_ts_probe(struct platform_device *pdev)
231{ 231{
232 struct da9052 *da9052; 232 struct da9052 *da9052;
233 struct da9052_tsi *tsi; 233 struct da9052_tsi *tsi;
@@ -317,7 +317,7 @@ err_free_mem:
317 return error; 317 return error;
318} 318}
319 319
320static int __devexit da9052_ts_remove(struct platform_device *pdev) 320static int da9052_ts_remove(struct platform_device *pdev)
321{ 321{
322 struct da9052_tsi *tsi = platform_get_drvdata(pdev); 322 struct da9052_tsi *tsi = platform_get_drvdata(pdev);
323 323
@@ -336,7 +336,7 @@ static int __devexit da9052_ts_remove(struct platform_device *pdev)
336 336
337static struct platform_driver da9052_tsi_driver = { 337static struct platform_driver da9052_tsi_driver = {
338 .probe = da9052_ts_probe, 338 .probe = da9052_ts_probe,
339 .remove = __devexit_p(da9052_ts_remove), 339 .remove = da9052_ts_remove,
340 .driver = { 340 .driver = {
341 .name = "da9052-tsi", 341 .name = "da9052-tsi",
342 .owner = THIS_MODULE, 342 .owner = THIS_MODULE,
diff --git a/drivers/input/touchscreen/edt-ft5x06.c b/drivers/input/touchscreen/edt-ft5x06.c
index 099d144ab7c9..a9170157b442 100644
--- a/drivers/input/touchscreen/edt-ft5x06.c
+++ b/drivers/input/touchscreen/edt-ft5x06.c
@@ -491,14 +491,6 @@ static int edt_ft5x06_debugfs_mode_set(void *data, u64 mode)
491DEFINE_SIMPLE_ATTRIBUTE(debugfs_mode_fops, edt_ft5x06_debugfs_mode_get, 491DEFINE_SIMPLE_ATTRIBUTE(debugfs_mode_fops, edt_ft5x06_debugfs_mode_get,
492 edt_ft5x06_debugfs_mode_set, "%llu\n"); 492 edt_ft5x06_debugfs_mode_set, "%llu\n");
493 493
494static int edt_ft5x06_debugfs_raw_data_open(struct inode *inode,
495 struct file *file)
496{
497 file->private_data = inode->i_private;
498
499 return 0;
500}
501
502static ssize_t edt_ft5x06_debugfs_raw_data_read(struct file *file, 494static ssize_t edt_ft5x06_debugfs_raw_data_read(struct file *file,
503 char __user *buf, size_t count, loff_t *off) 495 char __user *buf, size_t count, loff_t *off)
504{ 496{
@@ -579,11 +571,11 @@ out:
579 571
580 572
581static const struct file_operations debugfs_raw_data_fops = { 573static const struct file_operations debugfs_raw_data_fops = {
582 .open = edt_ft5x06_debugfs_raw_data_open, 574 .open = simple_open,
583 .read = edt_ft5x06_debugfs_raw_data_read, 575 .read = edt_ft5x06_debugfs_raw_data_read,
584}; 576};
585 577
586static void __devinit 578static void
587edt_ft5x06_ts_prepare_debugfs(struct edt_ft5x06_ts_data *tsdata, 579edt_ft5x06_ts_prepare_debugfs(struct edt_ft5x06_ts_data *tsdata,
588 const char *debugfs_name) 580 const char *debugfs_name)
589{ 581{
@@ -600,7 +592,7 @@ edt_ft5x06_ts_prepare_debugfs(struct edt_ft5x06_ts_data *tsdata,
600 tsdata->debug_dir, tsdata, &debugfs_raw_data_fops); 592 tsdata->debug_dir, tsdata, &debugfs_raw_data_fops);
601} 593}
602 594
603static void __devexit 595static void
604edt_ft5x06_ts_teardown_debugfs(struct edt_ft5x06_ts_data *tsdata) 596edt_ft5x06_ts_teardown_debugfs(struct edt_ft5x06_ts_data *tsdata)
605{ 597{
606 if (tsdata->debug_dir) 598 if (tsdata->debug_dir)
@@ -625,7 +617,7 @@ edt_ft5x06_ts_teardown_debugfs(struct edt_ft5x06_ts_data *tsdata)
625 617
626 618
627 619
628static int __devinit edt_ft5x06_ts_reset(struct i2c_client *client, 620static int edt_ft5x06_ts_reset(struct i2c_client *client,
629 int reset_pin) 621 int reset_pin)
630{ 622{
631 int error; 623 int error;
@@ -649,7 +641,7 @@ static int __devinit edt_ft5x06_ts_reset(struct i2c_client *client,
649 return 0; 641 return 0;
650} 642}
651 643
652static int __devinit edt_ft5x06_ts_identify(struct i2c_client *client, 644static int edt_ft5x06_ts_identify(struct i2c_client *client,
653 char *model_name, 645 char *model_name,
654 char *fw_version) 646 char *fw_version)
655{ 647{
@@ -683,7 +675,7 @@ static int __devinit edt_ft5x06_ts_identify(struct i2c_client *client,
683 pdata->name <= edt_ft5x06_attr_##name.limit_high) \ 675 pdata->name <= edt_ft5x06_attr_##name.limit_high) \
684 edt_ft5x06_register_write(tsdata, reg, pdata->name) 676 edt_ft5x06_register_write(tsdata, reg, pdata->name)
685 677
686static void __devinit 678static void
687edt_ft5x06_ts_get_defaults(struct edt_ft5x06_ts_data *tsdata, 679edt_ft5x06_ts_get_defaults(struct edt_ft5x06_ts_data *tsdata,
688 const struct edt_ft5x06_platform_data *pdata) 680 const struct edt_ft5x06_platform_data *pdata)
689{ 681{
@@ -697,7 +689,7 @@ edt_ft5x06_ts_get_defaults(struct edt_ft5x06_ts_data *tsdata,
697 EDT_ATTR_CHECKSET(report_rate, WORK_REGISTER_REPORT_RATE); 689 EDT_ATTR_CHECKSET(report_rate, WORK_REGISTER_REPORT_RATE);
698} 690}
699 691
700static void __devinit 692static void
701edt_ft5x06_ts_get_parameters(struct edt_ft5x06_ts_data *tsdata) 693edt_ft5x06_ts_get_parameters(struct edt_ft5x06_ts_data *tsdata)
702{ 694{
703 tsdata->threshold = edt_ft5x06_register_read(tsdata, 695 tsdata->threshold = edt_ft5x06_register_read(tsdata,
@@ -710,7 +702,7 @@ edt_ft5x06_ts_get_parameters(struct edt_ft5x06_ts_data *tsdata)
710 tsdata->num_y = edt_ft5x06_register_read(tsdata, WORK_REGISTER_NUM_Y); 702 tsdata->num_y = edt_ft5x06_register_read(tsdata, WORK_REGISTER_NUM_Y);
711} 703}
712 704
713static int __devinit edt_ft5x06_ts_probe(struct i2c_client *client, 705static int edt_ft5x06_ts_probe(struct i2c_client *client,
714 const struct i2c_device_id *id) 706 const struct i2c_device_id *id)
715{ 707{
716 const struct edt_ft5x06_platform_data *pdata = 708 const struct edt_ft5x06_platform_data *pdata =
@@ -830,7 +822,7 @@ err_free_mem:
830 return error; 822 return error;
831} 823}
832 824
833static int __devexit edt_ft5x06_ts_remove(struct i2c_client *client) 825static int edt_ft5x06_ts_remove(struct i2c_client *client)
834{ 826{
835 const struct edt_ft5x06_platform_data *pdata = 827 const struct edt_ft5x06_platform_data *pdata =
836 dev_get_platdata(&client->dev); 828 dev_get_platdata(&client->dev);
@@ -891,7 +883,7 @@ static struct i2c_driver edt_ft5x06_ts_driver = {
891 }, 883 },
892 .id_table = edt_ft5x06_ts_id, 884 .id_table = edt_ft5x06_ts_id,
893 .probe = edt_ft5x06_ts_probe, 885 .probe = edt_ft5x06_ts_probe,
894 .remove = __devexit_p(edt_ft5x06_ts_remove), 886 .remove = edt_ft5x06_ts_remove,
895}; 887};
896 888
897module_i2c_driver(edt_ft5x06_ts_driver); 889module_i2c_driver(edt_ft5x06_ts_driver);
diff --git a/drivers/input/touchscreen/eeti_ts.c b/drivers/input/touchscreen/eeti_ts.c
index 908407efc672..55255a940072 100644
--- a/drivers/input/touchscreen/eeti_ts.c
+++ b/drivers/input/touchscreen/eeti_ts.c
@@ -154,7 +154,7 @@ static void eeti_ts_close(struct input_dev *dev)
154 eeti_ts_stop(priv); 154 eeti_ts_stop(priv);
155} 155}
156 156
157static int __devinit eeti_ts_probe(struct i2c_client *client, 157static int eeti_ts_probe(struct i2c_client *client,
158 const struct i2c_device_id *idp) 158 const struct i2c_device_id *idp)
159{ 159{
160 struct eeti_ts_platform_data *pdata = client->dev.platform_data; 160 struct eeti_ts_platform_data *pdata = client->dev.platform_data;
@@ -248,7 +248,7 @@ err0:
248 return err; 248 return err;
249} 249}
250 250
251static int __devexit eeti_ts_remove(struct i2c_client *client) 251static int eeti_ts_remove(struct i2c_client *client)
252{ 252{
253 struct eeti_ts_priv *priv = i2c_get_clientdata(client); 253 struct eeti_ts_priv *priv = i2c_get_clientdata(client);
254 254
@@ -321,7 +321,7 @@ static struct i2c_driver eeti_ts_driver = {
321#endif 321#endif
322 }, 322 },
323 .probe = eeti_ts_probe, 323 .probe = eeti_ts_probe,
324 .remove = __devexit_p(eeti_ts_remove), 324 .remove = eeti_ts_remove,
325 .id_table = eeti_ts_id, 325 .id_table = eeti_ts_id,
326}; 326};
327 327
diff --git a/drivers/input/touchscreen/egalax_ts.c b/drivers/input/touchscreen/egalax_ts.c
index 13fa62fdfb0b..17c9097f3b5d 100644
--- a/drivers/input/touchscreen/egalax_ts.c
+++ b/drivers/input/touchscreen/egalax_ts.c
@@ -153,7 +153,7 @@ static int egalax_wake_up_device(struct i2c_client *client)
153 return 0; 153 return 0;
154} 154}
155 155
156static int __devinit egalax_firmware_version(struct i2c_client *client) 156static int egalax_firmware_version(struct i2c_client *client)
157{ 157{
158 static const u8 cmd[MAX_I2C_DATA_LEN] = { 0x03, 0x03, 0xa, 0x01, 0x41 }; 158 static const u8 cmd[MAX_I2C_DATA_LEN] = { 0x03, 0x03, 0xa, 0x01, 0x41 };
159 int ret; 159 int ret;
@@ -165,7 +165,7 @@ static int __devinit egalax_firmware_version(struct i2c_client *client)
165 return 0; 165 return 0;
166} 166}
167 167
168static int __devinit egalax_ts_probe(struct i2c_client *client, 168static int egalax_ts_probe(struct i2c_client *client,
169 const struct i2c_device_id *id) 169 const struct i2c_device_id *id)
170{ 170{
171 struct egalax_ts *ts; 171 struct egalax_ts *ts;
@@ -246,7 +246,7 @@ err_free_ts:
246 return error; 246 return error;
247} 247}
248 248
249static __devexit int egalax_ts_remove(struct i2c_client *client) 249static int egalax_ts_remove(struct i2c_client *client)
250{ 250{
251 struct egalax_ts *ts = i2c_get_clientdata(client); 251 struct egalax_ts *ts = i2c_get_clientdata(client);
252 252
@@ -301,7 +301,7 @@ static struct i2c_driver egalax_ts_driver = {
301 }, 301 },
302 .id_table = egalax_ts_id, 302 .id_table = egalax_ts_id,
303 .probe = egalax_ts_probe, 303 .probe = egalax_ts_probe,
304 .remove = __devexit_p(egalax_ts_remove), 304 .remove = egalax_ts_remove,
305}; 305};
306 306
307module_i2c_driver(egalax_ts_driver); 307module_i2c_driver(egalax_ts_driver);
diff --git a/drivers/input/touchscreen/h3600_ts_input.c b/drivers/input/touchscreen/h3600_ts_input.c
deleted file mode 100644
index b9e8686a6f1c..000000000000
--- a/drivers/input/touchscreen/h3600_ts_input.c
+++ /dev/null
@@ -1,479 +0,0 @@
1/*
2 * Copyright (c) 2001 "Crazy" James Simmons jsimmons@transvirtual.com
3 *
4 * Sponsored by Transvirtual Technology.
5 *
6 * Derived from the code in h3600_ts.[ch] by Charles Flynn
7 */
8
9/*
10 * Driver for the h3600 Touch Screen and other Atmel controlled devices.
11 */
12
13/*
14 * This program is free software; you can redistribute it and/or modify
15 * it under the terms of the GNU General Public License as published by
16 * the Free Software Foundation; either version 2 of the License, or
17 * (at your option) any later version.
18 *
19 * This program is distributed in the hope that it will be useful,
20 * but WITHOUT ANY WARRANTY; without even the implied warranty of
21 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
22 * GNU General Public License for more details.
23 *
24 * You should have received a copy of the GNU General Public License
25 * along with this program; if not, write to the Free Software
26 * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
27 *
28 * Should you need to contact me, the author, you can do so by
29 * e-mail - mail your message to <jsimmons@transvirtual.com>.
30 */
31
32#include <linux/errno.h>
33#include <linux/kernel.h>
34#include <linux/module.h>
35#include <linux/slab.h>
36#include <linux/input.h>
37#include <linux/serio.h>
38#include <linux/init.h>
39#include <linux/delay.h>
40
41/* SA1100 serial defines */
42#include <mach/hardware.h>
43#include <mach/irqs.h>
44
45#define DRIVER_DESC "H3600 touchscreen driver"
46
47MODULE_AUTHOR("James Simmons <jsimmons@transvirtual.com>");
48MODULE_DESCRIPTION(DRIVER_DESC);
49MODULE_LICENSE("GPL");
50
51/*
52 * Definitions & global arrays.
53 */
54
55/* The start and end of frame characters SOF and EOF */
56#define CHAR_SOF 0x02
57#define CHAR_EOF 0x03
58#define FRAME_OVERHEAD 3 /* CHAR_SOF,CHAR_EOF,LENGTH = 3 */
59
60/*
61 Atmel events and response IDs contained in frame.
62 Programmer has no control over these numbers.
63 TODO there are holes - specifically 1,7,0x0a
64*/
65#define VERSION_ID 0 /* Get Version (request/response) */
66#define KEYBD_ID 2 /* Keyboard (event) */
67#define TOUCHS_ID 3 /* Touch Screen (event)*/
68#define EEPROM_READ_ID 4 /* (request/response) */
69#define EEPROM_WRITE_ID 5 /* (request/response) */
70#define THERMAL_ID 6 /* (request/response) */
71#define NOTIFY_LED_ID 8 /* (request/response) */
72#define BATTERY_ID 9 /* (request/response) */
73#define SPI_READ_ID 0x0b /* ( request/response) */
74#define SPI_WRITE_ID 0x0c /* ( request/response) */
75#define FLITE_ID 0x0d /* backlight ( request/response) */
76#define STX_ID 0xa1 /* extension pack status (req/resp) */
77
78#define MAX_ID 14
79
80#define H3600_MAX_LENGTH 16
81#define H3600_KEY 0xf
82
83#define H3600_SCANCODE_RECORD 1 /* 1 -> record button */
84#define H3600_SCANCODE_CALENDAR 2 /* 2 -> calendar */
85#define H3600_SCANCODE_CONTACTS 3 /* 3 -> contact */
86#define H3600_SCANCODE_Q 4 /* 4 -> Q button */
87#define H3600_SCANCODE_START 5 /* 5 -> start menu */
88#define H3600_SCANCODE_UP 6 /* 6 -> up */
89#define H3600_SCANCODE_RIGHT 7 /* 7 -> right */
90#define H3600_SCANCODE_LEFT 8 /* 8 -> left */
91#define H3600_SCANCODE_DOWN 9 /* 9 -> down */
92
93/*
94 * Per-touchscreen data.
95 */
96struct h3600_dev {
97 struct input_dev *dev;
98 struct serio *serio;
99 unsigned char event; /* event ID from packet */
100 unsigned char chksum;
101 unsigned char len;
102 unsigned char idx;
103 unsigned char buf[H3600_MAX_LENGTH];
104 char phys[32];
105};
106
107static irqreturn_t action_button_handler(int irq, void *dev_id)
108{
109 int down = (GPLR & GPIO_BITSY_ACTION_BUTTON) ? 0 : 1;
110 struct input_dev *dev = dev_id;
111
112 input_report_key(dev, KEY_ENTER, down);
113 input_sync(dev);
114
115 return IRQ_HANDLED;
116}
117
118static irqreturn_t npower_button_handler(int irq, void *dev_id)
119{
120 int down = (GPLR & GPIO_BITSY_NPOWER_BUTTON) ? 0 : 1;
121 struct input_dev *dev = dev_id;
122
123 /*
124 * This interrupt is only called when we release the key. So we have
125 * to fake a key press.
126 */
127 input_report_key(dev, KEY_SUSPEND, 1);
128 input_report_key(dev, KEY_SUSPEND, down);
129 input_sync(dev);
130
131 return IRQ_HANDLED;
132}
133
134#ifdef CONFIG_PM
135
136static int flite_brightness = 25;
137
138enum flite_pwr {
139 FLITE_PWR_OFF = 0,
140 FLITE_PWR_ON = 1
141};
142
143/*
144 * h3600_flite_power: enables or disables power to frontlight, using last bright */
145unsigned int h3600_flite_power(struct input_dev *dev, enum flite_pwr pwr)
146{
147 unsigned char brightness = (pwr == FLITE_PWR_OFF) ? 0 : flite_brightness;
148 struct h3600_dev *ts = input_get_drvdata(dev);
149
150 /* Must be in this order */
151 serio_write(ts->serio, 1);
152 serio_write(ts->serio, pwr);
153 serio_write(ts->serio, brightness);
154
155 return 0;
156}
157
158#endif
159
160/*
161 * This function translates the native event packets to linux input event
162 * packets. Some packets coming from serial are not touchscreen related. In
163 * this case we send them off to be processed elsewhere.
164 */
165static void h3600ts_process_packet(struct h3600_dev *ts)
166{
167 struct input_dev *dev = ts->dev;
168 static int touched = 0;
169 int key, down = 0;
170
171 switch (ts->event) {
172 /*
173 Buttons - returned as a single byte
174 7 6 5 4 3 2 1 0
175 S x x x N N N N
176
177 S switch state ( 0=pressed 1=released)
178 x Unused.
179 NNNN switch number 0-15
180
181 Note: This is true for non interrupt generated key events.
182 */
183 case KEYBD_ID:
184 down = (ts->buf[0] & 0x80) ? 0 : 1;
185
186 switch (ts->buf[0] & 0x7f) {
187 case H3600_SCANCODE_RECORD:
188 key = KEY_RECORD;
189 break;
190 case H3600_SCANCODE_CALENDAR:
191 key = KEY_PROG1;
192 break;
193 case H3600_SCANCODE_CONTACTS:
194 key = KEY_PROG2;
195 break;
196 case H3600_SCANCODE_Q:
197 key = KEY_Q;
198 break;
199 case H3600_SCANCODE_START:
200 key = KEY_PROG3;
201 break;
202 case H3600_SCANCODE_UP:
203 key = KEY_UP;
204 break;
205 case H3600_SCANCODE_RIGHT:
206 key = KEY_RIGHT;
207 break;
208 case H3600_SCANCODE_LEFT:
209 key = KEY_LEFT;
210 break;
211 case H3600_SCANCODE_DOWN:
212 key = KEY_DOWN;
213 break;
214 default:
215 key = 0;
216 }
217 if (key)
218 input_report_key(dev, key, down);
219 break;
220 /*
221 * Native touchscreen event data is formatted as shown below:-
222 *
223 * +-------+-------+-------+-------+
224 * | Xmsb | Xlsb | Ymsb | Ylsb |
225 * +-------+-------+-------+-------+
226 * byte 0 1 2 3
227 */
228 case TOUCHS_ID:
229 if (!touched) {
230 input_report_key(dev, BTN_TOUCH, 1);
231 touched = 1;
232 }
233
234 if (ts->len) {
235 unsigned short x, y;
236
237 x = ts->buf[0]; x <<= 8; x += ts->buf[1];
238 y = ts->buf[2]; y <<= 8; y += ts->buf[3];
239
240 input_report_abs(dev, ABS_X, x);
241 input_report_abs(dev, ABS_Y, y);
242 } else {
243 input_report_key(dev, BTN_TOUCH, 0);
244 touched = 0;
245 }
246 break;
247 default:
248 /* Send a non input event elsewhere */
249 break;
250 }
251
252 input_sync(dev);
253}
254
255/*
256 * h3600ts_event() handles events from the input module.
257 */
258static int h3600ts_event(struct input_dev *dev, unsigned int type,
259 unsigned int code, int value)
260{
261#if 0
262 struct h3600_dev *ts = input_get_drvdata(dev);
263
264 switch (type) {
265 case EV_LED: {
266 // serio_write(ts->serio, SOME_CMD);
267 return 0;
268 }
269 }
270 return -1;
271#endif
272 return 0;
273}
274
275/*
276 Frame format
277 byte 1 2 3 len + 4
278 +-------+---------------+---------------+--=------------+
279 |SOF |id |len | len bytes | Chksum |
280 +-------+---------------+---------------+--=------------+
281 bit 0 7 8 11 12 15 16
282
283 +-------+---------------+-------+
284 |SOF |id |0 |Chksum | - Note Chksum does not include SOF
285 +-------+---------------+-------+
286 bit 0 7 8 11 12 15 16
287
288*/
289
290static int state;
291
292/* decode States */
293#define STATE_SOF 0 /* start of FRAME */
294#define STATE_ID 1 /* state where we decode the ID & len */
295#define STATE_DATA 2 /* state where we decode data */
296#define STATE_EOF 3 /* state where we decode checksum or EOF */
297
298static irqreturn_t h3600ts_interrupt(struct serio *serio, unsigned char data,
299 unsigned int flags)
300{
301 struct h3600_dev *ts = serio_get_drvdata(serio);
302
303 /*
304 * We have a new frame coming in.
305 */
306 switch (state) {
307 case STATE_SOF:
308 if (data == CHAR_SOF)
309 state = STATE_ID;
310 break;
311 case STATE_ID:
312 ts->event = (data & 0xf0) >> 4;
313 ts->len = (data & 0xf);
314 ts->idx = 0;
315 if (ts->event >= MAX_ID) {
316 state = STATE_SOF;
317 break;
318 }
319 ts->chksum = data;
320 state = (ts->len > 0) ? STATE_DATA : STATE_EOF;
321 break;
322 case STATE_DATA:
323 ts->chksum += data;
324 ts->buf[ts->idx]= data;
325 if (++ts->idx == ts->len)
326 state = STATE_EOF;
327 break;
328 case STATE_EOF:
329 state = STATE_SOF;
330 if (data == CHAR_EOF || data == ts->chksum)
331 h3600ts_process_packet(ts);
332 break;
333 default:
334 printk("Error3\n");
335 break;
336 }
337
338 return IRQ_HANDLED;
339}
340
341/*
342 * h3600ts_connect() is the routine that is called when someone adds a
343 * new serio device that supports H3600 protocol and registers it as
344 * an input device.
345 */
346static int h3600ts_connect(struct serio *serio, struct serio_driver *drv)
347{
348 struct h3600_dev *ts;
349 struct input_dev *input_dev;
350 int err;
351
352 ts = kzalloc(sizeof(struct h3600_dev), GFP_KERNEL);
353 input_dev = input_allocate_device();
354 if (!ts || !input_dev) {
355 err = -ENOMEM;
356 goto fail1;
357 }
358
359 ts->serio = serio;
360 ts->dev = input_dev;
361 snprintf(ts->phys, sizeof(ts->phys), "%s/input0", serio->phys);
362
363 input_dev->name = "H3600 TouchScreen";
364 input_dev->phys = ts->phys;
365 input_dev->id.bustype = BUS_RS232;
366 input_dev->id.vendor = SERIO_H3600;
367 input_dev->id.product = 0x0666; /* FIXME !!! We can ask the hardware */
368 input_dev->id.version = 0x0100;
369 input_dev->dev.parent = &serio->dev;
370
371 input_set_drvdata(input_dev, ts);
372
373 input_dev->event = h3600ts_event;
374
375 input_dev->evbit[0] = BIT_MASK(EV_KEY) | BIT_MASK(EV_ABS) |
376 BIT_MASK(EV_LED) | BIT_MASK(EV_PWR);
377 input_dev->ledbit[0] = BIT_MASK(LED_SLEEP);
378 input_set_abs_params(input_dev, ABS_X, 60, 985, 0, 0);
379 input_set_abs_params(input_dev, ABS_Y, 35, 1024, 0, 0);
380
381 set_bit(KEY_RECORD, input_dev->keybit);
382 set_bit(KEY_Q, input_dev->keybit);
383 set_bit(KEY_PROG1, input_dev->keybit);
384 set_bit(KEY_PROG2, input_dev->keybit);
385 set_bit(KEY_PROG3, input_dev->keybit);
386 set_bit(KEY_UP, input_dev->keybit);
387 set_bit(KEY_RIGHT, input_dev->keybit);
388 set_bit(KEY_LEFT, input_dev->keybit);
389 set_bit(KEY_DOWN, input_dev->keybit);
390 set_bit(KEY_ENTER, input_dev->keybit);
391 set_bit(KEY_SUSPEND, input_dev->keybit);
392 set_bit(BTN_TOUCH, input_dev->keybit);
393
394 /* Device specific stuff */
395 set_GPIO_IRQ_edge(GPIO_BITSY_ACTION_BUTTON, GPIO_BOTH_EDGES);
396 set_GPIO_IRQ_edge(GPIO_BITSY_NPOWER_BUTTON, GPIO_RISING_EDGE);
397
398 if (request_irq(IRQ_GPIO_BITSY_ACTION_BUTTON, action_button_handler,
399 IRQF_SHARED, "h3600_action", ts->dev)) {
400 printk(KERN_ERR "h3600ts.c: Could not allocate Action Button IRQ!\n");
401 err = -EBUSY;
402 goto fail1;
403 }
404
405 if (request_irq(IRQ_GPIO_BITSY_NPOWER_BUTTON, npower_button_handler,
406 IRQF_SHARED, "h3600_suspend", ts->dev)) {
407 printk(KERN_ERR "h3600ts.c: Could not allocate Power Button IRQ!\n");
408 err = -EBUSY;
409 goto fail2;
410 }
411
412 serio_set_drvdata(serio, ts);
413
414 err = serio_open(serio, drv);
415 if (err)
416 goto fail3;
417
418 //h3600_flite_control(1, 25); /* default brightness */
419 err = input_register_device(ts->dev);
420 if (err)
421 goto fail4;
422
423 return 0;
424
425fail4: serio_close(serio);
426fail3: serio_set_drvdata(serio, NULL);
427 free_irq(IRQ_GPIO_BITSY_NPOWER_BUTTON, ts->dev);
428fail2: free_irq(IRQ_GPIO_BITSY_ACTION_BUTTON, ts->dev);
429fail1: input_free_device(input_dev);
430 kfree(ts);
431 return err;
432}
433
434/*
435 * h3600ts_disconnect() is the opposite of h3600ts_connect()
436 */
437
438static void h3600ts_disconnect(struct serio *serio)
439{
440 struct h3600_dev *ts = serio_get_drvdata(serio);
441
442 free_irq(IRQ_GPIO_BITSY_ACTION_BUTTON, ts->dev);
443 free_irq(IRQ_GPIO_BITSY_NPOWER_BUTTON, ts->dev);
444 input_get_device(ts->dev);
445 input_unregister_device(ts->dev);
446 serio_close(serio);
447 serio_set_drvdata(serio, NULL);
448 input_put_device(ts->dev);
449 kfree(ts);
450}
451
452/*
453 * The serio driver structure.
454 */
455
456static struct serio_device_id h3600ts_serio_ids[] = {
457 {
458 .type = SERIO_RS232,
459 .proto = SERIO_H3600,
460 .id = SERIO_ANY,
461 .extra = SERIO_ANY,
462 },
463 { 0 }
464};
465
466MODULE_DEVICE_TABLE(serio, h3600ts_serio_ids);
467
468static struct serio_driver h3600ts_drv = {
469 .driver = {
470 .name = "h3600ts",
471 },
472 .description = DRIVER_DESC,
473 .id_table = h3600ts_serio_ids,
474 .interrupt = h3600ts_interrupt,
475 .connect = h3600ts_connect,
476 .disconnect = h3600ts_disconnect,
477};
478
479module_serio_driver(h3600ts_drv);
diff --git a/drivers/input/touchscreen/htcpen.c b/drivers/input/touchscreen/htcpen.c
index d13143b68b3e..6c4fb8436957 100644
--- a/drivers/input/touchscreen/htcpen.c
+++ b/drivers/input/touchscreen/htcpen.c
@@ -102,7 +102,7 @@ static void htcpen_close(struct input_dev *dev)
102 synchronize_irq(HTCPEN_IRQ); 102 synchronize_irq(HTCPEN_IRQ);
103} 103}
104 104
105static int __devinit htcpen_isa_probe(struct device *dev, unsigned int id) 105static int htcpen_isa_probe(struct device *dev, unsigned int id)
106{ 106{
107 struct input_dev *htcpen_dev; 107 struct input_dev *htcpen_dev;
108 int err = -EBUSY; 108 int err = -EBUSY;
@@ -174,7 +174,7 @@ static int __devinit htcpen_isa_probe(struct device *dev, unsigned int id)
174 return err; 174 return err;
175} 175}
176 176
177static int __devexit htcpen_isa_remove(struct device *dev, unsigned int id) 177static int htcpen_isa_remove(struct device *dev, unsigned int id)
178{ 178{
179 struct input_dev *htcpen_dev = dev_get_drvdata(dev); 179 struct input_dev *htcpen_dev = dev_get_drvdata(dev);
180 180
@@ -210,7 +210,7 @@ static int htcpen_isa_resume(struct device *dev, unsigned int n)
210 210
211static struct isa_driver htcpen_isa_driver = { 211static struct isa_driver htcpen_isa_driver = {
212 .probe = htcpen_isa_probe, 212 .probe = htcpen_isa_probe,
213 .remove = __devexit_p(htcpen_isa_remove), 213 .remove = htcpen_isa_remove,
214#ifdef CONFIG_PM 214#ifdef CONFIG_PM
215 .suspend = htcpen_isa_suspend, 215 .suspend = htcpen_isa_suspend,
216 .resume = htcpen_isa_resume, 216 .resume = htcpen_isa_resume,
diff --git a/drivers/input/touchscreen/ili210x.c b/drivers/input/touchscreen/ili210x.c
index 4ac69760ec08..1418bdda61bb 100644
--- a/drivers/input/touchscreen/ili210x.c
+++ b/drivers/input/touchscreen/ili210x.c
@@ -180,7 +180,7 @@ static const struct attribute_group ili210x_attr_group = {
180 .attrs = ili210x_attributes, 180 .attrs = ili210x_attributes,
181}; 181};
182 182
183static int __devinit ili210x_i2c_probe(struct i2c_client *client, 183static int ili210x_i2c_probe(struct i2c_client *client,
184 const struct i2c_device_id *id) 184 const struct i2c_device_id *id)
185{ 185{
186 struct device *dev = &client->dev; 186 struct device *dev = &client->dev;
@@ -298,7 +298,7 @@ err_free_mem:
298 return error; 298 return error;
299} 299}
300 300
301static int __devexit ili210x_i2c_remove(struct i2c_client *client) 301static int ili210x_i2c_remove(struct i2c_client *client)
302{ 302{
303 struct ili210x *priv = i2c_get_clientdata(client); 303 struct ili210x *priv = i2c_get_clientdata(client);
304 304
@@ -350,7 +350,7 @@ static struct i2c_driver ili210x_ts_driver = {
350 }, 350 },
351 .id_table = ili210x_i2c_id, 351 .id_table = ili210x_i2c_id,
352 .probe = ili210x_i2c_probe, 352 .probe = ili210x_i2c_probe,
353 .remove = __devexit_p(ili210x_i2c_remove), 353 .remove = ili210x_i2c_remove,
354}; 354};
355 355
356module_i2c_driver(ili210x_ts_driver); 356module_i2c_driver(ili210x_ts_driver);
diff --git a/drivers/input/touchscreen/intel-mid-touch.c b/drivers/input/touchscreen/intel-mid-touch.c
index cf299377fc49..465db5dba8b4 100644
--- a/drivers/input/touchscreen/intel-mid-touch.c
+++ b/drivers/input/touchscreen/intel-mid-touch.c
@@ -427,7 +427,7 @@ out:
427} 427}
428 428
429/* Utility to read PMIC ID */ 429/* Utility to read PMIC ID */
430static int __devinit mrstouch_read_pmic_id(uint *vendor, uint *rev) 430static int mrstouch_read_pmic_id(uint *vendor, uint *rev)
431{ 431{
432 int err; 432 int err;
433 u8 r; 433 u8 r;
@@ -446,7 +446,7 @@ static int __devinit mrstouch_read_pmic_id(uint *vendor, uint *rev)
446 * Parse ADC channels to find end of the channel configured by other ADC user 446 * Parse ADC channels to find end of the channel configured by other ADC user
447 * NEC and MAXIM requires 4 channels and FreeScale needs 18 channels 447 * NEC and MAXIM requires 4 channels and FreeScale needs 18 channels
448 */ 448 */
449static int __devinit mrstouch_chan_parse(struct mrstouch_dev *tsdev) 449static int mrstouch_chan_parse(struct mrstouch_dev *tsdev)
450{ 450{
451 int found = 0; 451 int found = 0;
452 int err, i; 452 int err, i;
@@ -478,7 +478,7 @@ static int __devinit mrstouch_chan_parse(struct mrstouch_dev *tsdev)
478/* 478/*
479 * Writes touch screen channels to ADC address selection registers 479 * Writes touch screen channels to ADC address selection registers
480 */ 480 */
481static int __devinit mrstouch_ts_chan_set(uint offset) 481static int mrstouch_ts_chan_set(uint offset)
482{ 482{
483 u16 chan; 483 u16 chan;
484 484
@@ -494,7 +494,7 @@ static int __devinit mrstouch_ts_chan_set(uint offset)
494} 494}
495 495
496/* Initialize ADC */ 496/* Initialize ADC */
497static int __devinit mrstouch_adc_init(struct mrstouch_dev *tsdev) 497static int mrstouch_adc_init(struct mrstouch_dev *tsdev)
498{ 498{
499 int err, start; 499 int err, start;
500 u8 ra, rm; 500 u8 ra, rm;
@@ -568,7 +568,7 @@ static int __devinit mrstouch_adc_init(struct mrstouch_dev *tsdev)
568 568
569 569
570/* Probe function for touch screen driver */ 570/* Probe function for touch screen driver */
571static int __devinit mrstouch_probe(struct platform_device *pdev) 571static int mrstouch_probe(struct platform_device *pdev)
572{ 572{
573 struct mrstouch_dev *tsdev; 573 struct mrstouch_dev *tsdev;
574 struct input_dev *input; 574 struct input_dev *input;
@@ -643,7 +643,7 @@ err_free_mem:
643 return err; 643 return err;
644} 644}
645 645
646static int __devexit mrstouch_remove(struct platform_device *pdev) 646static int mrstouch_remove(struct platform_device *pdev)
647{ 647{
648 struct mrstouch_dev *tsdev = platform_get_drvdata(pdev); 648 struct mrstouch_dev *tsdev = platform_get_drvdata(pdev);
649 649
@@ -662,7 +662,7 @@ static struct platform_driver mrstouch_driver = {
662 .owner = THIS_MODULE, 662 .owner = THIS_MODULE,
663 }, 663 },
664 .probe = mrstouch_probe, 664 .probe = mrstouch_probe,
665 .remove = __devexit_p(mrstouch_remove), 665 .remove = mrstouch_remove,
666}; 666};
667module_platform_driver(mrstouch_driver); 667module_platform_driver(mrstouch_driver);
668 668
diff --git a/drivers/input/touchscreen/jornada720_ts.c b/drivers/input/touchscreen/jornada720_ts.c
index 7f03d1bd916e..282d7c7ad2fc 100644
--- a/drivers/input/touchscreen/jornada720_ts.c
+++ b/drivers/input/touchscreen/jornada720_ts.c
@@ -99,7 +99,7 @@ static irqreturn_t jornada720_ts_interrupt(int irq, void *dev_id)
99 return IRQ_HANDLED; 99 return IRQ_HANDLED;
100} 100}
101 101
102static int __devinit jornada720_ts_probe(struct platform_device *pdev) 102static int jornada720_ts_probe(struct platform_device *pdev)
103{ 103{
104 struct jornada_ts *jornada_ts; 104 struct jornada_ts *jornada_ts;
105 struct input_dev *input_dev; 105 struct input_dev *input_dev;
@@ -151,7 +151,7 @@ static int __devinit jornada720_ts_probe(struct platform_device *pdev)
151 return error; 151 return error;
152} 152}
153 153
154static int __devexit jornada720_ts_remove(struct platform_device *pdev) 154static int jornada720_ts_remove(struct platform_device *pdev)
155{ 155{
156 struct jornada_ts *jornada_ts = platform_get_drvdata(pdev); 156 struct jornada_ts *jornada_ts = platform_get_drvdata(pdev);
157 157
@@ -168,7 +168,7 @@ MODULE_ALIAS("platform:jornada_ts");
168 168
169static struct platform_driver jornada720_ts_driver = { 169static struct platform_driver jornada720_ts_driver = {
170 .probe = jornada720_ts_probe, 170 .probe = jornada720_ts_probe,
171 .remove = __devexit_p(jornada720_ts_remove), 171 .remove = jornada720_ts_remove,
172 .driver = { 172 .driver = {
173 .name = "jornada_ts", 173 .name = "jornada_ts",
174 .owner = THIS_MODULE, 174 .owner = THIS_MODULE,
diff --git a/drivers/input/touchscreen/lpc32xx_ts.c b/drivers/input/touchscreen/lpc32xx_ts.c
index 4c2b8ed3bf16..9101ee529c92 100644
--- a/drivers/input/touchscreen/lpc32xx_ts.c
+++ b/drivers/input/touchscreen/lpc32xx_ts.c
@@ -203,7 +203,7 @@ static void lpc32xx_ts_close(struct input_dev *dev)
203 lpc32xx_stop_tsc(tsc); 203 lpc32xx_stop_tsc(tsc);
204} 204}
205 205
206static int __devinit lpc32xx_ts_probe(struct platform_device *pdev) 206static int lpc32xx_ts_probe(struct platform_device *pdev)
207{ 207{
208 struct lpc32xx_tsc *tsc; 208 struct lpc32xx_tsc *tsc;
209 struct input_dev *input; 209 struct input_dev *input;
@@ -309,7 +309,7 @@ err_free_mem:
309 return error; 309 return error;
310} 310}
311 311
312static int __devexit lpc32xx_ts_remove(struct platform_device *pdev) 312static int lpc32xx_ts_remove(struct platform_device *pdev)
313{ 313{
314 struct lpc32xx_tsc *tsc = platform_get_drvdata(pdev); 314 struct lpc32xx_tsc *tsc = platform_get_drvdata(pdev);
315 struct resource *res; 315 struct resource *res;
@@ -394,7 +394,7 @@ MODULE_DEVICE_TABLE(of, lpc32xx_tsc_of_match);
394 394
395static struct platform_driver lpc32xx_ts_driver = { 395static struct platform_driver lpc32xx_ts_driver = {
396 .probe = lpc32xx_ts_probe, 396 .probe = lpc32xx_ts_probe,
397 .remove = __devexit_p(lpc32xx_ts_remove), 397 .remove = lpc32xx_ts_remove,
398 .driver = { 398 .driver = {
399 .name = MOD_NAME, 399 .name = MOD_NAME,
400 .owner = THIS_MODULE, 400 .owner = THIS_MODULE,
diff --git a/drivers/input/touchscreen/max11801_ts.c b/drivers/input/touchscreen/max11801_ts.c
index 4eab50b856d7..00bc6caa27f5 100644
--- a/drivers/input/touchscreen/max11801_ts.c
+++ b/drivers/input/touchscreen/max11801_ts.c
@@ -156,7 +156,7 @@ out:
156 return IRQ_HANDLED; 156 return IRQ_HANDLED;
157} 157}
158 158
159static void __devinit max11801_ts_phy_init(struct max11801_data *data) 159static void max11801_ts_phy_init(struct max11801_data *data)
160{ 160{
161 struct i2c_client *client = data->client; 161 struct i2c_client *client = data->client;
162 162
@@ -174,7 +174,7 @@ static void __devinit max11801_ts_phy_init(struct max11801_data *data)
174 max11801_write_reg(client, OP_MODE_CONF_REG, 0x36); 174 max11801_write_reg(client, OP_MODE_CONF_REG, 0x36);
175} 175}
176 176
177static int __devinit max11801_ts_probe(struct i2c_client *client, 177static int max11801_ts_probe(struct i2c_client *client,
178 const struct i2c_device_id *id) 178 const struct i2c_device_id *id)
179{ 179{
180 struct max11801_data *data; 180 struct max11801_data *data;
@@ -228,7 +228,7 @@ err_free_mem:
228 return error; 228 return error;
229} 229}
230 230
231static __devexit int max11801_ts_remove(struct i2c_client *client) 231static int max11801_ts_remove(struct i2c_client *client)
232{ 232{
233 struct max11801_data *data = i2c_get_clientdata(client); 233 struct max11801_data *data = i2c_get_clientdata(client);
234 234
@@ -252,7 +252,7 @@ static struct i2c_driver max11801_ts_driver = {
252 }, 252 },
253 .id_table = max11801_ts_id, 253 .id_table = max11801_ts_id,
254 .probe = max11801_ts_probe, 254 .probe = max11801_ts_probe,
255 .remove = __devexit_p(max11801_ts_remove), 255 .remove = max11801_ts_remove,
256}; 256};
257 257
258module_i2c_driver(max11801_ts_driver); 258module_i2c_driver(max11801_ts_driver);
diff --git a/drivers/input/touchscreen/mc13783_ts.c b/drivers/input/touchscreen/mc13783_ts.c
index 48dc5b0d26f1..02103b6abb39 100644
--- a/drivers/input/touchscreen/mc13783_ts.c
+++ b/drivers/input/touchscreen/mc13783_ts.c
@@ -229,7 +229,7 @@ err_free_mem:
229 return ret; 229 return ret;
230} 230}
231 231
232static int __devexit mc13783_ts_remove(struct platform_device *pdev) 232static int mc13783_ts_remove(struct platform_device *pdev)
233{ 233{
234 struct mc13783_ts_priv *priv = platform_get_drvdata(pdev); 234 struct mc13783_ts_priv *priv = platform_get_drvdata(pdev);
235 235
@@ -243,7 +243,7 @@ static int __devexit mc13783_ts_remove(struct platform_device *pdev)
243} 243}
244 244
245static struct platform_driver mc13783_ts_driver = { 245static struct platform_driver mc13783_ts_driver = {
246 .remove = __devexit_p(mc13783_ts_remove), 246 .remove = mc13783_ts_remove,
247 .driver = { 247 .driver = {
248 .owner = THIS_MODULE, 248 .owner = THIS_MODULE,
249 .name = MC13783_TS_NAME, 249 .name = MC13783_TS_NAME,
diff --git a/drivers/input/touchscreen/mcs5000_ts.c b/drivers/input/touchscreen/mcs5000_ts.c
index b528511861ce..f9f4e0c56eda 100644
--- a/drivers/input/touchscreen/mcs5000_ts.c
+++ b/drivers/input/touchscreen/mcs5000_ts.c
@@ -187,7 +187,7 @@ static void mcs5000_ts_phys_init(struct mcs5000_ts_data *data)
187 OP_MODE_ACTIVE | REPORT_RATE_80); 187 OP_MODE_ACTIVE | REPORT_RATE_80);
188} 188}
189 189
190static int __devinit mcs5000_ts_probe(struct i2c_client *client, 190static int mcs5000_ts_probe(struct i2c_client *client,
191 const struct i2c_device_id *id) 191 const struct i2c_device_id *id)
192{ 192{
193 struct mcs5000_ts_data *data; 193 struct mcs5000_ts_data *data;
@@ -249,7 +249,7 @@ err_free_mem:
249 return ret; 249 return ret;
250} 250}
251 251
252static int __devexit mcs5000_ts_remove(struct i2c_client *client) 252static int mcs5000_ts_remove(struct i2c_client *client)
253{ 253{
254 struct mcs5000_ts_data *data = i2c_get_clientdata(client); 254 struct mcs5000_ts_data *data = i2c_get_clientdata(client);
255 255
@@ -292,7 +292,7 @@ MODULE_DEVICE_TABLE(i2c, mcs5000_ts_id);
292 292
293static struct i2c_driver mcs5000_ts_driver = { 293static struct i2c_driver mcs5000_ts_driver = {
294 .probe = mcs5000_ts_probe, 294 .probe = mcs5000_ts_probe,
295 .remove = __devexit_p(mcs5000_ts_remove), 295 .remove = mcs5000_ts_remove,
296 .driver = { 296 .driver = {
297 .name = "mcs5000_ts", 297 .name = "mcs5000_ts",
298#ifdef CONFIG_PM 298#ifdef CONFIG_PM
diff --git a/drivers/input/touchscreen/mms114.c b/drivers/input/touchscreen/mms114.c
index 560cf09d1c5a..98841d8aa635 100644
--- a/drivers/input/touchscreen/mms114.c
+++ b/drivers/input/touchscreen/mms114.c
@@ -10,6 +10,7 @@
10#include <linux/module.h> 10#include <linux/module.h>
11#include <linux/init.h> 11#include <linux/init.h>
12#include <linux/delay.h> 12#include <linux/delay.h>
13#include <linux/of.h>
13#include <linux/i2c.h> 14#include <linux/i2c.h>
14#include <linux/i2c/mms114.h> 15#include <linux/i2c/mms114.h>
15#include <linux/input/mt.h> 16#include <linux/input/mt.h>
@@ -360,14 +361,63 @@ static void mms114_input_close(struct input_dev *dev)
360 mms114_stop(data); 361 mms114_stop(data);
361} 362}
362 363
363static int __devinit mms114_probe(struct i2c_client *client, 364#ifdef CONFIG_OF
365static struct mms114_platform_data *mms114_parse_dt(struct device *dev)
366{
367 struct mms114_platform_data *pdata;
368 struct device_node *np = dev->of_node;
369
370 if (!np)
371 return NULL;
372
373 pdata = devm_kzalloc(dev, sizeof(*pdata), GFP_KERNEL);
374 if (!pdata) {
375 dev_err(dev, "failed to allocate platform data\n");
376 return NULL;
377 }
378
379 if (of_property_read_u32(np, "x-size", &pdata->x_size)) {
380 dev_err(dev, "failed to get x-size property\n");
381 return NULL;
382 };
383
384 if (of_property_read_u32(np, "y-size", &pdata->y_size)) {
385 dev_err(dev, "failed to get y-size property\n");
386 return NULL;
387 };
388
389 of_property_read_u32(np, "contact-threshold",
390 &pdata->contact_threshold);
391 of_property_read_u32(np, "moving-threshold",
392 &pdata->moving_threshold);
393
394 if (of_find_property(np, "x-invert", NULL))
395 pdata->x_invert = true;
396 if (of_find_property(np, "y-invert", NULL))
397 pdata->y_invert = true;
398
399 return pdata;
400}
401#else
402static inline struct mms114_platform_data *mms114_parse_dt(struct device *dev)
403{
404 return NULL;
405}
406#endif
407
408static int mms114_probe(struct i2c_client *client,
364 const struct i2c_device_id *id) 409 const struct i2c_device_id *id)
365{ 410{
411 const struct mms114_platform_data *pdata;
366 struct mms114_data *data; 412 struct mms114_data *data;
367 struct input_dev *input_dev; 413 struct input_dev *input_dev;
368 int error; 414 int error;
369 415
370 if (!client->dev.platform_data) { 416 pdata = dev_get_platdata(&client->dev);
417 if (!pdata)
418 pdata = mms114_parse_dt(&client->dev);
419
420 if (!pdata) {
371 dev_err(&client->dev, "Need platform data\n"); 421 dev_err(&client->dev, "Need platform data\n");
372 return -EINVAL; 422 return -EINVAL;
373 } 423 }
@@ -389,7 +439,7 @@ static int __devinit mms114_probe(struct i2c_client *client,
389 439
390 data->client = client; 440 data->client = client;
391 data->input_dev = input_dev; 441 data->input_dev = input_dev;
392 data->pdata = client->dev.platform_data; 442 data->pdata = pdata;
393 443
394 input_dev->name = "MELPAS MMS114 Touchscreen"; 444 input_dev->name = "MELPAS MMS114 Touchscreen";
395 input_dev->id.bustype = BUS_I2C; 445 input_dev->id.bustype = BUS_I2C;
@@ -458,7 +508,7 @@ err_free_mem:
458 return error; 508 return error;
459} 509}
460 510
461static int __devexit mms114_remove(struct i2c_client *client) 511static int mms114_remove(struct i2c_client *client)
462{ 512{
463 struct mms114_data *data = i2c_get_clientdata(client); 513 struct mms114_data *data = i2c_get_clientdata(client);
464 514
@@ -525,14 +575,22 @@ static const struct i2c_device_id mms114_id[] = {
525}; 575};
526MODULE_DEVICE_TABLE(i2c, mms114_id); 576MODULE_DEVICE_TABLE(i2c, mms114_id);
527 577
578#ifdef CONFIG_OF
579static struct of_device_id mms114_dt_match[] = {
580 { .compatible = "melfas,mms114" },
581 { }
582};
583#endif
584
528static struct i2c_driver mms114_driver = { 585static struct i2c_driver mms114_driver = {
529 .driver = { 586 .driver = {
530 .name = "mms114", 587 .name = "mms114",
531 .owner = THIS_MODULE, 588 .owner = THIS_MODULE,
532 .pm = &mms114_pm_ops, 589 .pm = &mms114_pm_ops,
590 .of_match_table = of_match_ptr(mms114_dt_match),
533 }, 591 },
534 .probe = mms114_probe, 592 .probe = mms114_probe,
535 .remove = __devexit_p(mms114_remove), 593 .remove = mms114_remove,
536 .id_table = mms114_id, 594 .id_table = mms114_id,
537}; 595};
538 596
diff --git a/drivers/input/touchscreen/pcap_ts.c b/drivers/input/touchscreen/pcap_ts.c
index f57aeb80f7e3..f22e04dd4e16 100644
--- a/drivers/input/touchscreen/pcap_ts.c
+++ b/drivers/input/touchscreen/pcap_ts.c
@@ -137,7 +137,7 @@ static void pcap_ts_close(struct input_dev *dev)
137 pcap_ts->read_state << PCAP_ADC_TS_M_SHIFT); 137 pcap_ts->read_state << PCAP_ADC_TS_M_SHIFT);
138} 138}
139 139
140static int __devinit pcap_ts_probe(struct platform_device *pdev) 140static int pcap_ts_probe(struct platform_device *pdev)
141{ 141{
142 struct input_dev *input_dev; 142 struct input_dev *input_dev;
143 struct pcap_ts *pcap_ts; 143 struct pcap_ts *pcap_ts;
@@ -202,7 +202,7 @@ fail:
202 return err; 202 return err;
203} 203}
204 204
205static int __devexit pcap_ts_remove(struct platform_device *pdev) 205static int pcap_ts_remove(struct platform_device *pdev)
206{ 206{
207 struct pcap_ts *pcap_ts = platform_get_drvdata(pdev); 207 struct pcap_ts *pcap_ts = platform_get_drvdata(pdev);
208 208
@@ -245,7 +245,7 @@ static const struct dev_pm_ops pcap_ts_pm_ops = {
245 245
246static struct platform_driver pcap_ts_driver = { 246static struct platform_driver pcap_ts_driver = {
247 .probe = pcap_ts_probe, 247 .probe = pcap_ts_probe,
248 .remove = __devexit_p(pcap_ts_remove), 248 .remove = pcap_ts_remove,
249 .driver = { 249 .driver = {
250 .name = "pcap-ts", 250 .name = "pcap-ts",
251 .owner = THIS_MODULE, 251 .owner = THIS_MODULE,
diff --git a/drivers/input/touchscreen/pixcir_i2c_ts.c b/drivers/input/touchscreen/pixcir_i2c_ts.c
index 953b4c105cad..6cc6b36663ff 100644
--- a/drivers/input/touchscreen/pixcir_i2c_ts.c
+++ b/drivers/input/touchscreen/pixcir_i2c_ts.c
@@ -125,7 +125,7 @@ static int pixcir_i2c_ts_resume(struct device *dev)
125static SIMPLE_DEV_PM_OPS(pixcir_dev_pm_ops, 125static SIMPLE_DEV_PM_OPS(pixcir_dev_pm_ops,
126 pixcir_i2c_ts_suspend, pixcir_i2c_ts_resume); 126 pixcir_i2c_ts_suspend, pixcir_i2c_ts_resume);
127 127
128static int __devinit pixcir_i2c_ts_probe(struct i2c_client *client, 128static int pixcir_i2c_ts_probe(struct i2c_client *client,
129 const struct i2c_device_id *id) 129 const struct i2c_device_id *id)
130{ 130{
131 const struct pixcir_ts_platform_data *pdata = client->dev.platform_data; 131 const struct pixcir_ts_platform_data *pdata = client->dev.platform_data;
@@ -189,7 +189,7 @@ err_free_mem:
189 return error; 189 return error;
190} 190}
191 191
192static int __devexit pixcir_i2c_ts_remove(struct i2c_client *client) 192static int pixcir_i2c_ts_remove(struct i2c_client *client)
193{ 193{
194 struct pixcir_i2c_ts_data *tsdata = i2c_get_clientdata(client); 194 struct pixcir_i2c_ts_data *tsdata = i2c_get_clientdata(client);
195 195
@@ -218,7 +218,7 @@ static struct i2c_driver pixcir_i2c_ts_driver = {
218 .pm = &pixcir_dev_pm_ops, 218 .pm = &pixcir_dev_pm_ops,
219 }, 219 },
220 .probe = pixcir_i2c_ts_probe, 220 .probe = pixcir_i2c_ts_probe,
221 .remove = __devexit_p(pixcir_i2c_ts_remove), 221 .remove = pixcir_i2c_ts_remove,
222 .id_table = pixcir_i2c_ts_id, 222 .id_table = pixcir_i2c_ts_id,
223}; 223};
224 224
diff --git a/drivers/input/touchscreen/s3c2410_ts.c b/drivers/input/touchscreen/s3c2410_ts.c
index 549fa29548f8..b061af2c8376 100644
--- a/drivers/input/touchscreen/s3c2410_ts.c
+++ b/drivers/input/touchscreen/s3c2410_ts.c
@@ -238,7 +238,7 @@ static void s3c24xx_ts_select(struct s3c_adc_client *client, unsigned select)
238 * Initialise, find and allocate any resources we need to run and then 238 * Initialise, find and allocate any resources we need to run and then
239 * register with the ADC and input systems. 239 * register with the ADC and input systems.
240 */ 240 */
241static int __devinit s3c2410ts_probe(struct platform_device *pdev) 241static int s3c2410ts_probe(struct platform_device *pdev)
242{ 242{
243 struct s3c2410_ts_mach_info *info; 243 struct s3c2410_ts_mach_info *info;
244 struct device *dev = &pdev->dev; 244 struct device *dev = &pdev->dev;
@@ -365,7 +365,7 @@ static int __devinit s3c2410ts_probe(struct platform_device *pdev)
365 * 365 *
366 * Free up our state ready to be removed. 366 * Free up our state ready to be removed.
367 */ 367 */
368static int __devexit s3c2410ts_remove(struct platform_device *pdev) 368static int s3c2410ts_remove(struct platform_device *pdev)
369{ 369{
370 free_irq(ts.irq_tc, ts.input); 370 free_irq(ts.irq_tc, ts.input);
371 del_timer_sync(&touch_timer); 371 del_timer_sync(&touch_timer);
@@ -430,7 +430,7 @@ static struct platform_driver s3c_ts_driver = {
430 }, 430 },
431 .id_table = s3cts_driver_ids, 431 .id_table = s3cts_driver_ids,
432 .probe = s3c2410ts_probe, 432 .probe = s3c2410ts_probe,
433 .remove = __devexit_p(s3c2410ts_remove), 433 .remove = s3c2410ts_remove,
434}; 434};
435module_platform_driver(s3c_ts_driver); 435module_platform_driver(s3c_ts_driver);
436 436
diff --git a/drivers/input/touchscreen/st1232.c b/drivers/input/touchscreen/st1232.c
index 6cb68a1981bf..d9d05e222428 100644
--- a/drivers/input/touchscreen/st1232.c
+++ b/drivers/input/touchscreen/st1232.c
@@ -139,7 +139,7 @@ end:
139 return IRQ_HANDLED; 139 return IRQ_HANDLED;
140} 140}
141 141
142static int __devinit st1232_ts_probe(struct i2c_client *client, 142static int st1232_ts_probe(struct i2c_client *client,
143 const struct i2c_device_id *id) 143 const struct i2c_device_id *id)
144{ 144{
145 struct st1232_ts_data *ts; 145 struct st1232_ts_data *ts;
@@ -206,7 +206,7 @@ err_free_mem:
206 return error; 206 return error;
207} 207}
208 208
209static int __devexit st1232_ts_remove(struct i2c_client *client) 209static int st1232_ts_remove(struct i2c_client *client)
210{ 210{
211 struct st1232_ts_data *ts = i2c_get_clientdata(client); 211 struct st1232_ts_data *ts = i2c_get_clientdata(client);
212 212
@@ -255,7 +255,7 @@ static const struct i2c_device_id st1232_ts_id[] = {
255MODULE_DEVICE_TABLE(i2c, st1232_ts_id); 255MODULE_DEVICE_TABLE(i2c, st1232_ts_id);
256 256
257#ifdef CONFIG_OF 257#ifdef CONFIG_OF
258static const struct of_device_id st1232_ts_dt_ids[] __devinitconst = { 258static const struct of_device_id st1232_ts_dt_ids[] = {
259 { .compatible = "sitronix,st1232", }, 259 { .compatible = "sitronix,st1232", },
260 { } 260 { }
261}; 261};
@@ -264,7 +264,7 @@ MODULE_DEVICE_TABLE(of, st1232_ts_dt_ids);
264 264
265static struct i2c_driver st1232_ts_driver = { 265static struct i2c_driver st1232_ts_driver = {
266 .probe = st1232_ts_probe, 266 .probe = st1232_ts_probe,
267 .remove = __devexit_p(st1232_ts_remove), 267 .remove = st1232_ts_remove,
268 .id_table = st1232_ts_id, 268 .id_table = st1232_ts_id,
269 .driver = { 269 .driver = {
270 .name = ST1232_TS_NAME, 270 .name = ST1232_TS_NAME,
diff --git a/drivers/input/touchscreen/stmpe-ts.c b/drivers/input/touchscreen/stmpe-ts.c
index 692b685720ce..84d884b4ec3e 100644
--- a/drivers/input/touchscreen/stmpe-ts.c
+++ b/drivers/input/touchscreen/stmpe-ts.c
@@ -1,4 +1,5 @@
1/* STMicroelectronics STMPE811 Touchscreen Driver 1/*
2 * STMicroelectronics STMPE811 Touchscreen Driver
2 * 3 *
3 * (C) 2010 Luotao Fu <l.fu@pengutronix.de> 4 * (C) 2010 Luotao Fu <l.fu@pengutronix.de>
4 * All rights reserved. 5 * All rights reserved.
@@ -16,6 +17,7 @@
16#include <linux/interrupt.h> 17#include <linux/interrupt.h>
17#include <linux/init.h> 18#include <linux/init.h>
18#include <linux/device.h> 19#include <linux/device.h>
20#include <linux/of.h>
19#include <linux/platform_device.h> 21#include <linux/platform_device.h>
20#include <linux/input.h> 22#include <linux/input.h>
21#include <linux/slab.h> 23#include <linux/slab.h>
@@ -166,7 +168,7 @@ static irqreturn_t stmpe_ts_handler(int irq, void *data)
166 return IRQ_HANDLED; 168 return IRQ_HANDLED;
167} 169}
168 170
169static int __devinit stmpe_init_hw(struct stmpe_touch *ts) 171static int stmpe_init_hw(struct stmpe_touch *ts)
170{ 172{
171 int ret; 173 int ret;
172 u8 adc_ctrl1, adc_ctrl1_mask, tsc_cfg, tsc_cfg_mask; 174 u8 adc_ctrl1, adc_ctrl1_mask, tsc_cfg, tsc_cfg_mask;
@@ -261,41 +263,18 @@ static void stmpe_ts_close(struct input_dev *dev)
261 STMPE_TSC_CTRL_TSC_EN, 0); 263 STMPE_TSC_CTRL_TSC_EN, 0);
262} 264}
263 265
264static int __devinit stmpe_input_probe(struct platform_device *pdev) 266static void stmpe_ts_get_platform_info(struct platform_device *pdev,
267 struct stmpe_touch *ts)
265{ 268{
266 struct stmpe *stmpe = dev_get_drvdata(pdev->dev.parent); 269 struct stmpe *stmpe = dev_get_drvdata(pdev->dev.parent);
267 struct stmpe_platform_data *pdata = stmpe->pdata; 270 struct device_node *np = pdev->dev.of_node;
268 struct stmpe_touch *ts;
269 struct input_dev *idev;
270 struct stmpe_ts_platform_data *ts_pdata = NULL; 271 struct stmpe_ts_platform_data *ts_pdata = NULL;
271 int ret;
272 int ts_irq;
273
274 ts_irq = platform_get_irq_byname(pdev, "FIFO_TH");
275 if (ts_irq < 0)
276 return ts_irq;
277
278 ts = kzalloc(sizeof(*ts), GFP_KERNEL);
279 if (!ts) {
280 ret = -ENOMEM;
281 goto err_out;
282 }
283 272
284 idev = input_allocate_device();
285 if (!idev) {
286 ret = -ENOMEM;
287 goto err_free_ts;
288 }
289
290 platform_set_drvdata(pdev, ts);
291 ts->stmpe = stmpe; 273 ts->stmpe = stmpe;
292 ts->idev = idev;
293 ts->dev = &pdev->dev;
294 274
295 if (pdata) 275 if (stmpe->pdata && stmpe->pdata->ts) {
296 ts_pdata = pdata->ts; 276 ts_pdata = stmpe->pdata->ts;
297 277
298 if (ts_pdata) {
299 ts->sample_time = ts_pdata->sample_time; 278 ts->sample_time = ts_pdata->sample_time;
300 ts->mod_12b = ts_pdata->mod_12b; 279 ts->mod_12b = ts_pdata->mod_12b;
301 ts->ref_sel = ts_pdata->ref_sel; 280 ts->ref_sel = ts_pdata->ref_sel;
@@ -305,22 +284,71 @@ static int __devinit stmpe_input_probe(struct platform_device *pdev)
305 ts->settling = ts_pdata->settling; 284 ts->settling = ts_pdata->settling;
306 ts->fraction_z = ts_pdata->fraction_z; 285 ts->fraction_z = ts_pdata->fraction_z;
307 ts->i_drive = ts_pdata->i_drive; 286 ts->i_drive = ts_pdata->i_drive;
287 } else if (np) {
288 u32 val;
289
290 if (!of_property_read_u32(np, "st,sample-time", &val))
291 ts->sample_time = val;
292 if (!of_property_read_u32(np, "st,mod-12b", &val))
293 ts->mod_12b = val;
294 if (!of_property_read_u32(np, "st,ref-sel", &val))
295 ts->ref_sel = val;
296 if (!of_property_read_u32(np, "st,adc-freq", &val))
297 ts->adc_freq = val;
298 if (!of_property_read_u32(np, "st,ave-ctrl", &val))
299 ts->ave_ctrl = val;
300 if (!of_property_read_u32(np, "st,touch-det-delay", &val))
301 ts->touch_det_delay = val;
302 if (!of_property_read_u32(np, "st,settling", &val))
303 ts->settling = val;
304 if (!of_property_read_u32(np, "st,fraction-z", &val))
305 ts->fraction_z = val;
306 if (!of_property_read_u32(np, "st,i-drive", &val))
307 ts->i_drive = val;
308 } 308 }
309}
310
311static int stmpe_input_probe(struct platform_device *pdev)
312{
313 struct stmpe_touch *ts;
314 struct input_dev *idev;
315 int error;
316 int ts_irq;
317
318 ts_irq = platform_get_irq_byname(pdev, "FIFO_TH");
319 if (ts_irq < 0)
320 return ts_irq;
321
322 ts = devm_kzalloc(&pdev->dev, sizeof(*ts), GFP_KERNEL);
323 if (!ts)
324 return -ENOMEM;
325
326 idev = devm_input_allocate_device(&pdev->dev);
327 if (!idev)
328 return -ENOMEM;
329
330 platform_set_drvdata(pdev, ts);
331 ts->idev = idev;
332 ts->dev = &pdev->dev;
333
334 stmpe_ts_get_platform_info(pdev, ts);
309 335
310 INIT_DELAYED_WORK(&ts->work, stmpe_work); 336 INIT_DELAYED_WORK(&ts->work, stmpe_work);
311 337
312 ret = request_threaded_irq(ts_irq, NULL, stmpe_ts_handler, 338 error = devm_request_threaded_irq(&pdev->dev, ts_irq,
313 IRQF_ONESHOT, STMPE_TS_NAME, ts); 339 NULL, stmpe_ts_handler,
314 if (ret) { 340 IRQF_ONESHOT, STMPE_TS_NAME, ts);
341 if (error) {
315 dev_err(&pdev->dev, "Failed to request IRQ %d\n", ts_irq); 342 dev_err(&pdev->dev, "Failed to request IRQ %d\n", ts_irq);
316 goto err_free_input; 343 return error;
317 } 344 }
318 345
319 ret = stmpe_init_hw(ts); 346 error = stmpe_init_hw(ts);
320 if (ret) 347 if (error)
321 goto err_free_irq; 348 return error;
322 349
323 idev->name = STMPE_TS_NAME; 350 idev->name = STMPE_TS_NAME;
351 idev->phys = STMPE_TS_NAME"/input0";
324 idev->id.bustype = BUS_I2C; 352 idev->id.bustype = BUS_I2C;
325 idev->evbit[0] = BIT_MASK(EV_KEY) | BIT_MASK(EV_ABS); 353 idev->evbit[0] = BIT_MASK(EV_KEY) | BIT_MASK(EV_ABS);
326 idev->keybit[BIT_WORD(BTN_TOUCH)] = BIT_MASK(BTN_TOUCH); 354 idev->keybit[BIT_WORD(BTN_TOUCH)] = BIT_MASK(BTN_TOUCH);
@@ -334,40 +362,21 @@ static int __devinit stmpe_input_probe(struct platform_device *pdev)
334 input_set_abs_params(idev, ABS_Y, 0, XY_MASK, 0, 0); 362 input_set_abs_params(idev, ABS_Y, 0, XY_MASK, 0, 0);
335 input_set_abs_params(idev, ABS_PRESSURE, 0x0, 0xff, 0, 0); 363 input_set_abs_params(idev, ABS_PRESSURE, 0x0, 0xff, 0, 0);
336 364
337 ret = input_register_device(idev); 365 error = input_register_device(idev);
338 if (ret) { 366 if (error) {
339 dev_err(&pdev->dev, "Could not register input device\n"); 367 dev_err(&pdev->dev, "Could not register input device\n");
340 goto err_free_irq; 368 return error;
341 } 369 }
342 370
343 return ret; 371 return 0;
344
345err_free_irq:
346 free_irq(ts_irq, ts);
347err_free_input:
348 input_free_device(idev);
349 platform_set_drvdata(pdev, NULL);
350err_free_ts:
351 kfree(ts);
352err_out:
353 return ret;
354} 372}
355 373
356static int __devexit stmpe_ts_remove(struct platform_device *pdev) 374static int stmpe_ts_remove(struct platform_device *pdev)
357{ 375{
358 struct stmpe_touch *ts = platform_get_drvdata(pdev); 376 struct stmpe_touch *ts = platform_get_drvdata(pdev);
359 unsigned int ts_irq = platform_get_irq_byname(pdev, "FIFO_TH");
360 377
361 stmpe_disable(ts->stmpe, STMPE_BLOCK_TOUCHSCREEN); 378 stmpe_disable(ts->stmpe, STMPE_BLOCK_TOUCHSCREEN);
362 379
363 free_irq(ts_irq, ts);
364
365 platform_set_drvdata(pdev, NULL);
366
367 input_unregister_device(ts->idev);
368
369 kfree(ts);
370
371 return 0; 380 return 0;
372} 381}
373 382
@@ -377,7 +386,7 @@ static struct platform_driver stmpe_ts_driver = {
377 .owner = THIS_MODULE, 386 .owner = THIS_MODULE,
378 }, 387 },
379 .probe = stmpe_input_probe, 388 .probe = stmpe_input_probe,
380 .remove = __devexit_p(stmpe_ts_remove), 389 .remove = stmpe_ts_remove,
381}; 390};
382module_platform_driver(stmpe_ts_driver); 391module_platform_driver(stmpe_ts_driver);
383 392
diff --git a/drivers/input/touchscreen/ti_am335x_tsc.c b/drivers/input/touchscreen/ti_am335x_tsc.c
index 7a18a8a15228..51e7b87827a4 100644
--- a/drivers/input/touchscreen/ti_am335x_tsc.c
+++ b/drivers/input/touchscreen/ti_am335x_tsc.c
@@ -258,7 +258,7 @@ static irqreturn_t titsc_irq(int irq, void *dev)
258 * The functions for inserting/removing driver as a module. 258 * The functions for inserting/removing driver as a module.
259 */ 259 */
260 260
261static int __devinit titsc_probe(struct platform_device *pdev) 261static int titsc_probe(struct platform_device *pdev)
262{ 262{
263 struct titsc *ts_dev; 263 struct titsc *ts_dev;
264 struct input_dev *input_dev; 264 struct input_dev *input_dev;
@@ -327,7 +327,7 @@ err_free_mem:
327 return err; 327 return err;
328} 328}
329 329
330static int __devexit titsc_remove(struct platform_device *pdev) 330static int titsc_remove(struct platform_device *pdev)
331{ 331{
332 struct ti_tscadc_dev *tscadc_dev = pdev->dev.platform_data; 332 struct ti_tscadc_dev *tscadc_dev = pdev->dev.platform_data;
333 struct titsc *ts_dev = tscadc_dev->tsc; 333 struct titsc *ts_dev = tscadc_dev->tsc;
@@ -384,7 +384,7 @@ static const struct dev_pm_ops titsc_pm_ops = {
384 384
385static struct platform_driver ti_tsc_driver = { 385static struct platform_driver ti_tsc_driver = {
386 .probe = titsc_probe, 386 .probe = titsc_probe,
387 .remove = __devexit_p(titsc_remove), 387 .remove = titsc_remove,
388 .driver = { 388 .driver = {
389 .name = "tsc", 389 .name = "tsc",
390 .owner = THIS_MODULE, 390 .owner = THIS_MODULE,
diff --git a/drivers/input/touchscreen/tnetv107x-ts.c b/drivers/input/touchscreen/tnetv107x-ts.c
index 368d2c6cf780..acfb87607b87 100644
--- a/drivers/input/touchscreen/tnetv107x-ts.c
+++ b/drivers/input/touchscreen/tnetv107x-ts.c
@@ -243,7 +243,7 @@ static void tsc_stop(struct input_dev *dev)
243 clk_disable(ts->clk); 243 clk_disable(ts->clk);
244} 244}
245 245
246static int __devinit tsc_probe(struct platform_device *pdev) 246static int tsc_probe(struct platform_device *pdev)
247{ 247{
248 struct device *dev = &pdev->dev; 248 struct device *dev = &pdev->dev;
249 struct tsc_data *ts; 249 struct tsc_data *ts;
@@ -357,7 +357,7 @@ error_res:
357 return error; 357 return error;
358} 358}
359 359
360static int __devexit tsc_remove(struct platform_device *pdev) 360static int tsc_remove(struct platform_device *pdev)
361{ 361{
362 struct tsc_data *ts = platform_get_drvdata(pdev); 362 struct tsc_data *ts = platform_get_drvdata(pdev);
363 363
@@ -374,7 +374,7 @@ static int __devexit tsc_remove(struct platform_device *pdev)
374 374
375static struct platform_driver tsc_driver = { 375static struct platform_driver tsc_driver = {
376 .probe = tsc_probe, 376 .probe = tsc_probe,
377 .remove = __devexit_p(tsc_remove), 377 .remove = tsc_remove,
378 .driver.name = "tnetv107x-ts", 378 .driver.name = "tnetv107x-ts",
379 .driver.owner = THIS_MODULE, 379 .driver.owner = THIS_MODULE,
380}; 380};
diff --git a/drivers/input/touchscreen/tps6507x-ts.c b/drivers/input/touchscreen/tps6507x-ts.c
index f7eda3d00fad..820a066c3b8a 100644
--- a/drivers/input/touchscreen/tps6507x-ts.c
+++ b/drivers/input/touchscreen/tps6507x-ts.c
@@ -345,7 +345,7 @@ err0:
345 return error; 345 return error;
346} 346}
347 347
348static int __devexit tps6507x_ts_remove(struct platform_device *pdev) 348static int tps6507x_ts_remove(struct platform_device *pdev)
349{ 349{
350 struct tps6507x_dev *tps6507x_dev = platform_get_drvdata(pdev); 350 struct tps6507x_dev *tps6507x_dev = platform_get_drvdata(pdev);
351 struct tps6507x_ts *tsc = tps6507x_dev->ts; 351 struct tps6507x_ts *tsc = tps6507x_dev->ts;
@@ -367,7 +367,7 @@ static struct platform_driver tps6507x_ts_driver = {
367 .owner = THIS_MODULE, 367 .owner = THIS_MODULE,
368 }, 368 },
369 .probe = tps6507x_ts_probe, 369 .probe = tps6507x_ts_probe,
370 .remove = __devexit_p(tps6507x_ts_remove), 370 .remove = tps6507x_ts_remove,
371}; 371};
372module_platform_driver(tps6507x_ts_driver); 372module_platform_driver(tps6507x_ts_driver);
373 373
diff --git a/drivers/input/touchscreen/tsc2005.c b/drivers/input/touchscreen/tsc2005.c
index 5ce3fa8ce646..9c0cdc7ea449 100644
--- a/drivers/input/touchscreen/tsc2005.c
+++ b/drivers/input/touchscreen/tsc2005.c
@@ -555,7 +555,7 @@ static void tsc2005_close(struct input_dev *input)
555 mutex_unlock(&ts->mutex); 555 mutex_unlock(&ts->mutex);
556} 556}
557 557
558static void __devinit tsc2005_setup_spi_xfer(struct tsc2005 *ts) 558static void tsc2005_setup_spi_xfer(struct tsc2005 *ts)
559{ 559{
560 tsc2005_setup_read(&ts->spi_x, TSC2005_REG_X, false); 560 tsc2005_setup_read(&ts->spi_x, TSC2005_REG_X, false);
561 tsc2005_setup_read(&ts->spi_y, TSC2005_REG_Y, false); 561 tsc2005_setup_read(&ts->spi_y, TSC2005_REG_Y, false);
@@ -569,7 +569,7 @@ static void __devinit tsc2005_setup_spi_xfer(struct tsc2005 *ts)
569 spi_message_add_tail(&ts->spi_z2.spi_xfer, &ts->spi_read_msg); 569 spi_message_add_tail(&ts->spi_z2.spi_xfer, &ts->spi_read_msg);
570} 570}
571 571
572static int __devinit tsc2005_probe(struct spi_device *spi) 572static int tsc2005_probe(struct spi_device *spi)
573{ 573{
574 const struct tsc2005_platform_data *pdata = spi->dev.platform_data; 574 const struct tsc2005_platform_data *pdata = spi->dev.platform_data;
575 struct tsc2005 *ts; 575 struct tsc2005 *ts;
@@ -686,7 +686,7 @@ err_free_mem:
686 return error; 686 return error;
687} 687}
688 688
689static int __devexit tsc2005_remove(struct spi_device *spi) 689static int tsc2005_remove(struct spi_device *spi)
690{ 690{
691 struct tsc2005 *ts = spi_get_drvdata(spi); 691 struct tsc2005 *ts = spi_get_drvdata(spi);
692 692
@@ -745,7 +745,7 @@ static struct spi_driver tsc2005_driver = {
745 .pm = &tsc2005_pm_ops, 745 .pm = &tsc2005_pm_ops,
746 }, 746 },
747 .probe = tsc2005_probe, 747 .probe = tsc2005_probe,
748 .remove = __devexit_p(tsc2005_remove), 748 .remove = tsc2005_remove,
749}; 749};
750 750
751module_spi_driver(tsc2005_driver); 751module_spi_driver(tsc2005_driver);
diff --git a/drivers/input/touchscreen/tsc2007.c b/drivers/input/touchscreen/tsc2007.c
index 1473d2382afd..0b67ba476b4c 100644
--- a/drivers/input/touchscreen/tsc2007.c
+++ b/drivers/input/touchscreen/tsc2007.c
@@ -273,7 +273,7 @@ static void tsc2007_close(struct input_dev *input_dev)
273 tsc2007_stop(ts); 273 tsc2007_stop(ts);
274} 274}
275 275
276static int __devinit tsc2007_probe(struct i2c_client *client, 276static int tsc2007_probe(struct i2c_client *client,
277 const struct i2c_device_id *id) 277 const struct i2c_device_id *id)
278{ 278{
279 struct tsc2007 *ts; 279 struct tsc2007 *ts;
@@ -366,7 +366,7 @@ static int __devinit tsc2007_probe(struct i2c_client *client,
366 return err; 366 return err;
367} 367}
368 368
369static int __devexit tsc2007_remove(struct i2c_client *client) 369static int tsc2007_remove(struct i2c_client *client)
370{ 370{
371 struct tsc2007 *ts = i2c_get_clientdata(client); 371 struct tsc2007 *ts = i2c_get_clientdata(client);
372 struct tsc2007_platform_data *pdata = client->dev.platform_data; 372 struct tsc2007_platform_data *pdata = client->dev.platform_data;
@@ -396,7 +396,7 @@ static struct i2c_driver tsc2007_driver = {
396 }, 396 },
397 .id_table = tsc2007_idtable, 397 .id_table = tsc2007_idtable,
398 .probe = tsc2007_probe, 398 .probe = tsc2007_probe,
399 .remove = __devexit_p(tsc2007_remove), 399 .remove = tsc2007_remove,
400}; 400};
401 401
402module_i2c_driver(tsc2007_driver); 402module_i2c_driver(tsc2007_driver);
diff --git a/drivers/input/touchscreen/ucb1400_ts.c b/drivers/input/touchscreen/ucb1400_ts.c
index 46e83ad53f43..1271f97b4079 100644
--- a/drivers/input/touchscreen/ucb1400_ts.c
+++ b/drivers/input/touchscreen/ucb1400_ts.c
@@ -274,7 +274,7 @@ static void ucb1400_ts_close(struct input_dev *idev)
274 * Try to probe our interrupt, rather than relying on lots of 274 * Try to probe our interrupt, rather than relying on lots of
275 * hard-coded machine dependencies. 275 * hard-coded machine dependencies.
276 */ 276 */
277static int __devinit ucb1400_ts_detect_irq(struct ucb1400_ts *ucb, 277static int ucb1400_ts_detect_irq(struct ucb1400_ts *ucb,
278 struct platform_device *pdev) 278 struct platform_device *pdev)
279{ 279{
280 unsigned long mask, timeout; 280 unsigned long mask, timeout;
@@ -318,7 +318,7 @@ static int __devinit ucb1400_ts_detect_irq(struct ucb1400_ts *ucb,
318 return 0; 318 return 0;
319} 319}
320 320
321static int __devinit ucb1400_ts_probe(struct platform_device *pdev) 321static int ucb1400_ts_probe(struct platform_device *pdev)
322{ 322{
323 struct ucb1400_ts *ucb = pdev->dev.platform_data; 323 struct ucb1400_ts *ucb = pdev->dev.platform_data;
324 int error, x_res, y_res; 324 int error, x_res, y_res;
@@ -397,7 +397,7 @@ err:
397 return error; 397 return error;
398} 398}
399 399
400static int __devexit ucb1400_ts_remove(struct platform_device *pdev) 400static int ucb1400_ts_remove(struct platform_device *pdev)
401{ 401{
402 struct ucb1400_ts *ucb = pdev->dev.platform_data; 402 struct ucb1400_ts *ucb = pdev->dev.platform_data;
403 403
@@ -442,7 +442,7 @@ static SIMPLE_DEV_PM_OPS(ucb1400_ts_pm_ops,
442 442
443static struct platform_driver ucb1400_ts_driver = { 443static struct platform_driver ucb1400_ts_driver = {
444 .probe = ucb1400_ts_probe, 444 .probe = ucb1400_ts_probe,
445 .remove = __devexit_p(ucb1400_ts_remove), 445 .remove = ucb1400_ts_remove,
446 .driver = { 446 .driver = {
447 .name = "ucb1400_ts", 447 .name = "ucb1400_ts",
448 .owner = THIS_MODULE, 448 .owner = THIS_MODULE,
diff --git a/drivers/input/touchscreen/w90p910_ts.c b/drivers/input/touchscreen/w90p910_ts.c
index 9396b21d0e8f..d2ef8f05c66e 100644
--- a/drivers/input/touchscreen/w90p910_ts.c
+++ b/drivers/input/touchscreen/w90p910_ts.c
@@ -215,7 +215,7 @@ static void w90p910_close(struct input_dev *dev)
215 clk_disable(w90p910_ts->clk); 215 clk_disable(w90p910_ts->clk);
216} 216}
217 217
218static int __devinit w90x900ts_probe(struct platform_device *pdev) 218static int w90x900ts_probe(struct platform_device *pdev)
219{ 219{
220 struct w90p910_ts *w90p910_ts; 220 struct w90p910_ts *w90p910_ts;
221 struct input_dev *input_dev; 221 struct input_dev *input_dev;
@@ -301,7 +301,7 @@ fail1: input_free_device(input_dev);
301 return err; 301 return err;
302} 302}
303 303
304static int __devexit w90x900ts_remove(struct platform_device *pdev) 304static int w90x900ts_remove(struct platform_device *pdev)
305{ 305{
306 struct w90p910_ts *w90p910_ts = platform_get_drvdata(pdev); 306 struct w90p910_ts *w90p910_ts = platform_get_drvdata(pdev);
307 struct resource *res; 307 struct resource *res;
@@ -325,7 +325,7 @@ static int __devexit w90x900ts_remove(struct platform_device *pdev)
325 325
326static struct platform_driver w90x900ts_driver = { 326static struct platform_driver w90x900ts_driver = {
327 .probe = w90x900ts_probe, 327 .probe = w90x900ts_probe,
328 .remove = __devexit_p(w90x900ts_remove), 328 .remove = w90x900ts_remove,
329 .driver = { 329 .driver = {
330 .name = "nuc900-ts", 330 .name = "nuc900-ts",
331 .owner = THIS_MODULE, 331 .owner = THIS_MODULE,
diff --git a/drivers/input/touchscreen/wacom_i2c.c b/drivers/input/touchscreen/wacom_i2c.c
index 0c01657132fd..bf0d07620bac 100644
--- a/drivers/input/touchscreen/wacom_i2c.c
+++ b/drivers/input/touchscreen/wacom_i2c.c
@@ -144,7 +144,7 @@ static void wacom_i2c_close(struct input_dev *dev)
144 disable_irq(client->irq); 144 disable_irq(client->irq);
145} 145}
146 146
147static int __devinit wacom_i2c_probe(struct i2c_client *client, 147static int wacom_i2c_probe(struct i2c_client *client,
148 const struct i2c_device_id *id) 148 const struct i2c_device_id *id)
149{ 149{
150 struct wacom_i2c *wac_i2c; 150 struct wacom_i2c *wac_i2c;
@@ -225,7 +225,7 @@ err_free_mem:
225 return error; 225 return error;
226} 226}
227 227
228static int __devexit wacom_i2c_remove(struct i2c_client *client) 228static int wacom_i2c_remove(struct i2c_client *client)
229{ 229{
230 struct wacom_i2c *wac_i2c = i2c_get_clientdata(client); 230 struct wacom_i2c *wac_i2c = i2c_get_clientdata(client);
231 231
@@ -272,7 +272,7 @@ static struct i2c_driver wacom_i2c_driver = {
272 }, 272 },
273 273
274 .probe = wacom_i2c_probe, 274 .probe = wacom_i2c_probe,
275 .remove = __devexit_p(wacom_i2c_remove), 275 .remove = wacom_i2c_remove,
276 .id_table = wacom_i2c_id, 276 .id_table = wacom_i2c_id,
277}; 277};
278module_i2c_driver(wacom_i2c_driver); 278module_i2c_driver(wacom_i2c_driver);
diff --git a/drivers/input/touchscreen/wm831x-ts.c b/drivers/input/touchscreen/wm831x-ts.c
index 52abb98a8ae5..f88fab56178c 100644
--- a/drivers/input/touchscreen/wm831x-ts.c
+++ b/drivers/input/touchscreen/wm831x-ts.c
@@ -233,7 +233,7 @@ static void wm831x_ts_input_close(struct input_dev *idev)
233 } 233 }
234} 234}
235 235
236static __devinit int wm831x_ts_probe(struct platform_device *pdev) 236static int wm831x_ts_probe(struct platform_device *pdev)
237{ 237{
238 struct wm831x_ts *wm831x_ts; 238 struct wm831x_ts *wm831x_ts;
239 struct wm831x *wm831x = dev_get_drvdata(pdev->dev.parent); 239 struct wm831x *wm831x = dev_get_drvdata(pdev->dev.parent);
@@ -245,7 +245,8 @@ static __devinit int wm831x_ts_probe(struct platform_device *pdev)
245 if (core_pdata) 245 if (core_pdata)
246 pdata = core_pdata->touch; 246 pdata = core_pdata->touch;
247 247
248 wm831x_ts = kzalloc(sizeof(struct wm831x_ts), GFP_KERNEL); 248 wm831x_ts = devm_kzalloc(&pdev->dev, sizeof(struct wm831x_ts),
249 GFP_KERNEL);
249 input_dev = input_allocate_device(); 250 input_dev = input_allocate_device();
250 if (!wm831x_ts || !input_dev) { 251 if (!wm831x_ts || !input_dev) {
251 error = -ENOMEM; 252 error = -ENOMEM;
@@ -376,21 +377,18 @@ err_data_irq:
376 free_irq(wm831x_ts->data_irq, wm831x_ts); 377 free_irq(wm831x_ts->data_irq, wm831x_ts);
377err_alloc: 378err_alloc:
378 input_free_device(input_dev); 379 input_free_device(input_dev);
379 kfree(wm831x_ts);
380 380
381 return error; 381 return error;
382} 382}
383 383
384static __devexit int wm831x_ts_remove(struct platform_device *pdev) 384static int wm831x_ts_remove(struct platform_device *pdev)
385{ 385{
386 struct wm831x_ts *wm831x_ts = platform_get_drvdata(pdev); 386 struct wm831x_ts *wm831x_ts = platform_get_drvdata(pdev);
387 387
388 free_irq(wm831x_ts->pd_irq, wm831x_ts); 388 free_irq(wm831x_ts->pd_irq, wm831x_ts);
389 free_irq(wm831x_ts->data_irq, wm831x_ts); 389 free_irq(wm831x_ts->data_irq, wm831x_ts);
390 input_unregister_device(wm831x_ts->input_dev); 390 input_unregister_device(wm831x_ts->input_dev);
391 kfree(wm831x_ts);
392 391
393 platform_set_drvdata(pdev, NULL);
394 return 0; 392 return 0;
395} 393}
396 394
@@ -400,7 +398,7 @@ static struct platform_driver wm831x_ts_driver = {
400 .owner = THIS_MODULE, 398 .owner = THIS_MODULE,
401 }, 399 },
402 .probe = wm831x_ts_probe, 400 .probe = wm831x_ts_probe,
403 .remove = __devexit_p(wm831x_ts_remove), 401 .remove = wm831x_ts_remove,
404}; 402};
405module_platform_driver(wm831x_ts_driver); 403module_platform_driver(wm831x_ts_driver);
406 404
diff --git a/drivers/mfd/stmpe.c b/drivers/mfd/stmpe.c
index 19636199d7a5..5e8e6927cfcd 100644
--- a/drivers/mfd/stmpe.c
+++ b/drivers/mfd/stmpe.c
@@ -326,6 +326,7 @@ static struct resource stmpe_keypad_resources[] = {
326 326
327static struct mfd_cell stmpe_keypad_cell = { 327static struct mfd_cell stmpe_keypad_cell = {
328 .name = "stmpe-keypad", 328 .name = "stmpe-keypad",
329 .of_compatible = "st,stmpe-keypad",
329 .resources = stmpe_keypad_resources, 330 .resources = stmpe_keypad_resources,
330 .num_resources = ARRAY_SIZE(stmpe_keypad_resources), 331 .num_resources = ARRAY_SIZE(stmpe_keypad_resources),
331}; 332};
@@ -409,6 +410,7 @@ static struct resource stmpe_ts_resources[] = {
409 410
410static struct mfd_cell stmpe_ts_cell = { 411static struct mfd_cell stmpe_ts_cell = {
411 .name = "stmpe-ts", 412 .name = "stmpe-ts",
413 .of_compatible = "st,stmpe-ts",
412 .resources = stmpe_ts_resources, 414 .resources = stmpe_ts_resources,
413 .num_resources = ARRAY_SIZE(stmpe_ts_resources), 415 .num_resources = ARRAY_SIZE(stmpe_ts_resources),
414}; 416};
diff --git a/include/linux/input.h b/include/linux/input.h
index cab994ba6d91..82ce323b9986 100644
--- a/include/linux/input.h
+++ b/include/linux/input.h
@@ -112,6 +112,11 @@ struct input_value {
112 * @h_list: list of input handles associated with the device. When 112 * @h_list: list of input handles associated with the device. When
113 * accessing the list dev->mutex must be held 113 * accessing the list dev->mutex must be held
114 * @node: used to place the device onto input_dev_list 114 * @node: used to place the device onto input_dev_list
115 * @num_vals: number of values queued in the current frame
116 * @max_vals: maximum number of values queued in a frame
117 * @vals: array of values queued in the current frame
118 * @devres_managed: indicates that devices is managed with devres framework
119 * and needs not be explicitly unregistered or freed.
115 */ 120 */
116struct input_dev { 121struct input_dev {
117 const char *name; 122 const char *name;
@@ -180,6 +185,8 @@ struct input_dev {
180 unsigned int num_vals; 185 unsigned int num_vals;
181 unsigned int max_vals; 186 unsigned int max_vals;
182 struct input_value *vals; 187 struct input_value *vals;
188
189 bool devres_managed;
183}; 190};
184#define to_input_dev(d) container_of(d, struct input_dev, dev) 191#define to_input_dev(d) container_of(d, struct input_dev, dev)
185 192
@@ -323,7 +330,8 @@ struct input_handle {
323 struct list_head h_node; 330 struct list_head h_node;
324}; 331};
325 332
326struct input_dev *input_allocate_device(void); 333struct input_dev __must_check *input_allocate_device(void);
334struct input_dev __must_check *devm_input_allocate_device(struct device *);
327void input_free_device(struct input_dev *dev); 335void input_free_device(struct input_dev *dev);
328 336
329static inline struct input_dev *input_get_device(struct input_dev *dev) 337static inline struct input_dev *input_get_device(struct input_dev *dev)
diff --git a/include/linux/input/bu21013.h b/include/linux/input/bu21013.h
index 05e03284b92a..6230d76bde5d 100644
--- a/include/linux/input/bu21013.h
+++ b/include/linux/input/bu21013.h
@@ -9,13 +9,10 @@
9 9
10/** 10/**
11 * struct bu21013_platform_device - Handle the platform data 11 * struct bu21013_platform_device - Handle the platform data
12 * @cs_en: pointer to the cs enable function
13 * @cs_dis: pointer to the cs disable function
14 * @irq_read_val: pointer to read the pen irq value function
15 * @touch_x_max: touch x max 12 * @touch_x_max: touch x max
16 * @touch_y_max: touch y max 13 * @touch_y_max: touch y max
17 * @cs_pin: chip select pin 14 * @cs_pin: chip select pin
18 * @irq: irq pin 15 * @touch_pin: touch gpio pin
19 * @ext_clk: external clock flag 16 * @ext_clk: external clock flag
20 * @x_flip: x flip flag 17 * @x_flip: x flip flag
21 * @y_flip: y flip flag 18 * @y_flip: y flip flag
@@ -24,13 +21,10 @@
24 * This is used to handle the platform data 21 * This is used to handle the platform data
25 */ 22 */
26struct bu21013_platform_device { 23struct bu21013_platform_device {
27 int (*cs_en)(int reset_pin);
28 int (*cs_dis)(int reset_pin);
29 int (*irq_read_val)(void);
30 int touch_x_max; 24 int touch_x_max;
31 int touch_y_max; 25 int touch_y_max;
32 unsigned int cs_pin; 26 unsigned int cs_pin;
33 unsigned int irq; 27 unsigned int touch_pin;
34 bool ext_clk; 28 bool ext_clk;
35 bool x_flip; 29 bool x_flip;
36 bool y_flip; 30 bool y_flip;