aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/input
diff options
context:
space:
mode:
Diffstat (limited to 'drivers/input')
-rw-r--r--drivers/input/gameport/gameport.c1
-rw-r--r--drivers/input/input-compat.c4
-rw-r--r--drivers/input/input-compat.h2
-rw-r--r--drivers/input/joydev.c1
-rw-r--r--drivers/input/joystick/amijoy.c1
-rw-r--r--drivers/input/keyboard/jornada720_kbd.c1
-rw-r--r--drivers/input/misc/88pm860x_onkey.c26
-rw-r--r--drivers/input/misc/Kconfig2
-rw-r--r--drivers/input/mouse/amimouse.c1
-rw-r--r--drivers/input/mouse/atarimouse.c1
-rw-r--r--drivers/input/serio/ambakmi.c13
-rw-r--r--drivers/input/serio/ams_delta_serio.c56
-rw-r--r--drivers/input/serio/hp_sdc.c1
-rw-r--r--drivers/input/serio/maceps2.c1
-rw-r--r--drivers/input/serio/rpckbd.c45
-rw-r--r--drivers/input/serio/sa1111ps2.c60
-rw-r--r--drivers/input/serio/serio.c1
-rw-r--r--drivers/input/touchscreen/Kconfig2
-rw-r--r--drivers/input/touchscreen/jornada720_ts.c1
-rw-r--r--drivers/input/touchscreen/mc13783_ts.c11
20 files changed, 158 insertions, 73 deletions
diff --git a/drivers/input/gameport/gameport.c b/drivers/input/gameport/gameport.c
index c351aa421f8f..da739d9d1905 100644
--- a/drivers/input/gameport/gameport.c
+++ b/drivers/input/gameport/gameport.c
@@ -449,7 +449,6 @@ static ssize_t gameport_rebind_driver(struct device *dev, struct device_attribut
449 } else if ((drv = driver_find(buf, &gameport_bus)) != NULL) { 449 } else if ((drv = driver_find(buf, &gameport_bus)) != NULL) {
450 gameport_disconnect_port(gameport); 450 gameport_disconnect_port(gameport);
451 error = gameport_bind_driver(gameport, to_gameport_driver(drv)); 451 error = gameport_bind_driver(gameport, to_gameport_driver(drv));
452 put_driver(drv);
453 } else { 452 } else {
454 error = -EINVAL; 453 error = -EINVAL;
455 } 454 }
diff --git a/drivers/input/input-compat.c b/drivers/input/input-compat.c
index e46a86776a6b..64ca7113ff28 100644
--- a/drivers/input/input-compat.c
+++ b/drivers/input/input-compat.c
@@ -17,7 +17,7 @@
17int input_event_from_user(const char __user *buffer, 17int input_event_from_user(const char __user *buffer,
18 struct input_event *event) 18 struct input_event *event)
19{ 19{
20 if (INPUT_COMPAT_TEST) { 20 if (INPUT_COMPAT_TEST && !COMPAT_USE_64BIT_TIME) {
21 struct input_event_compat compat_event; 21 struct input_event_compat compat_event;
22 22
23 if (copy_from_user(&compat_event, buffer, 23 if (copy_from_user(&compat_event, buffer,
@@ -41,7 +41,7 @@ int input_event_from_user(const char __user *buffer,
41int input_event_to_user(char __user *buffer, 41int input_event_to_user(char __user *buffer,
42 const struct input_event *event) 42 const struct input_event *event)
43{ 43{
44 if (INPUT_COMPAT_TEST) { 44 if (INPUT_COMPAT_TEST && !COMPAT_USE_64BIT_TIME) {
45 struct input_event_compat compat_event; 45 struct input_event_compat compat_event;
46 46
47 compat_event.time.tv_sec = event->time.tv_sec; 47 compat_event.time.tv_sec = event->time.tv_sec;
diff --git a/drivers/input/input-compat.h b/drivers/input/input-compat.h
index 22be27b424de..148f66fe3205 100644
--- a/drivers/input/input-compat.h
+++ b/drivers/input/input-compat.h
@@ -67,7 +67,7 @@ struct ff_effect_compat {
67 67
68static inline size_t input_event_size(void) 68static inline size_t input_event_size(void)
69{ 69{
70 return INPUT_COMPAT_TEST ? 70 return (INPUT_COMPAT_TEST && !COMPAT_USE_64BIT_TIME) ?
71 sizeof(struct input_event_compat) : sizeof(struct input_event); 71 sizeof(struct input_event_compat) : sizeof(struct input_event);
72} 72}
73 73
diff --git a/drivers/input/joydev.c b/drivers/input/joydev.c
index c24ec2d5f926..26043cc6a016 100644
--- a/drivers/input/joydev.c
+++ b/drivers/input/joydev.c
@@ -13,7 +13,6 @@
13#define pr_fmt(fmt) KBUILD_MODNAME ": " fmt 13#define pr_fmt(fmt) KBUILD_MODNAME ": " fmt
14 14
15#include <asm/io.h> 15#include <asm/io.h>
16#include <asm/system.h>
17#include <linux/delay.h> 16#include <linux/delay.h>
18#include <linux/errno.h> 17#include <linux/errno.h>
19#include <linux/joystick.h> 18#include <linux/joystick.h>
diff --git a/drivers/input/joystick/amijoy.c b/drivers/input/joystick/amijoy.c
index 3aa93bf60ae3..c65b5fa69f1e 100644
--- a/drivers/input/joystick/amijoy.c
+++ b/drivers/input/joystick/amijoy.c
@@ -35,7 +35,6 @@
35#include <linux/interrupt.h> 35#include <linux/interrupt.h>
36#include <linux/mutex.h> 36#include <linux/mutex.h>
37 37
38#include <asm/system.h>
39#include <asm/amigahw.h> 38#include <asm/amigahw.h>
40#include <asm/amigaints.h> 39#include <asm/amigaints.h>
41 40
diff --git a/drivers/input/keyboard/jornada720_kbd.c b/drivers/input/keyboard/jornada720_kbd.c
index eeafc30b207b..9d639fa1afbd 100644
--- a/drivers/input/keyboard/jornada720_kbd.c
+++ b/drivers/input/keyboard/jornada720_kbd.c
@@ -27,6 +27,7 @@
27 27
28#include <mach/jornada720.h> 28#include <mach/jornada720.h>
29#include <mach/hardware.h> 29#include <mach/hardware.h>
30#include <mach/irqs.h>
30 31
31MODULE_AUTHOR("Kristoffer Ericson <Kristoffer.Ericson@gmail.com>"); 32MODULE_AUTHOR("Kristoffer Ericson <Kristoffer.Ericson@gmail.com>");
32MODULE_DESCRIPTION("HP Jornada 710/720/728 keyboard driver"); 33MODULE_DESCRIPTION("HP Jornada 710/720/728 keyboard driver");
diff --git a/drivers/input/misc/88pm860x_onkey.c b/drivers/input/misc/88pm860x_onkey.c
index f2e0cbc5ab64..f9ce1835e4d7 100644
--- a/drivers/input/misc/88pm860x_onkey.c
+++ b/drivers/input/misc/88pm860x_onkey.c
@@ -105,6 +105,8 @@ static int __devinit pm860x_onkey_probe(struct platform_device *pdev)
105 } 105 }
106 106
107 platform_set_drvdata(pdev, info); 107 platform_set_drvdata(pdev, info);
108 device_init_wakeup(&pdev->dev, 1);
109
108 return 0; 110 return 0;
109 111
110out_irq: 112out_irq:
@@ -129,10 +131,34 @@ static int __devexit pm860x_onkey_remove(struct platform_device *pdev)
129 return 0; 131 return 0;
130} 132}
131 133
134#ifdef CONFIG_PM_SLEEP
135static int pm860x_onkey_suspend(struct device *dev)
136{
137 struct platform_device *pdev = to_platform_device(dev);
138 struct pm860x_chip *chip = dev_get_drvdata(pdev->dev.parent);
139
140 if (device_may_wakeup(dev))
141 chip->wakeup_flag |= 1 << PM8607_IRQ_ONKEY;
142 return 0;
143}
144static int pm860x_onkey_resume(struct device *dev)
145{
146 struct platform_device *pdev = to_platform_device(dev);
147 struct pm860x_chip *chip = dev_get_drvdata(pdev->dev.parent);
148
149 if (device_may_wakeup(dev))
150 chip->wakeup_flag &= ~(1 << PM8607_IRQ_ONKEY);
151 return 0;
152}
153#endif
154
155static SIMPLE_DEV_PM_OPS(pm860x_onkey_pm_ops, pm860x_onkey_suspend, pm860x_onkey_resume);
156
132static struct platform_driver pm860x_onkey_driver = { 157static struct platform_driver pm860x_onkey_driver = {
133 .driver = { 158 .driver = {
134 .name = "88pm860x-onkey", 159 .name = "88pm860x-onkey",
135 .owner = THIS_MODULE, 160 .owner = THIS_MODULE,
161 .pm = &pm860x_onkey_pm_ops,
136 }, 162 },
137 .probe = pm860x_onkey_probe, 163 .probe = pm860x_onkey_probe,
138 .remove = __devexit_p(pm860x_onkey_remove), 164 .remove = __devexit_p(pm860x_onkey_remove),
diff --git a/drivers/input/misc/Kconfig b/drivers/input/misc/Kconfig
index d62827271802..2d787796bf50 100644
--- a/drivers/input/misc/Kconfig
+++ b/drivers/input/misc/Kconfig
@@ -580,7 +580,7 @@ config INPUT_CMA3000_I2C
580 580
581config INPUT_XEN_KBDDEV_FRONTEND 581config INPUT_XEN_KBDDEV_FRONTEND
582 tristate "Xen virtual keyboard and mouse support" 582 tristate "Xen virtual keyboard and mouse support"
583 depends on XEN_FBDEV_FRONTEND 583 depends on XEN
584 default y 584 default y
585 select XEN_XENBUS_FRONTEND 585 select XEN_XENBUS_FRONTEND
586 help 586 help
diff --git a/drivers/input/mouse/amimouse.c b/drivers/input/mouse/amimouse.c
index ff5f61a0fd3a..5fa99341a39d 100644
--- a/drivers/input/mouse/amimouse.c
+++ b/drivers/input/mouse/amimouse.c
@@ -25,7 +25,6 @@
25 25
26#include <asm/irq.h> 26#include <asm/irq.h>
27#include <asm/setup.h> 27#include <asm/setup.h>
28#include <asm/system.h>
29#include <asm/uaccess.h> 28#include <asm/uaccess.h>
30#include <asm/amigahw.h> 29#include <asm/amigahw.h>
31#include <asm/amigaints.h> 30#include <asm/amigaints.h>
diff --git a/drivers/input/mouse/atarimouse.c b/drivers/input/mouse/atarimouse.c
index 5c4a692bf73a..d1c43236b125 100644
--- a/drivers/input/mouse/atarimouse.c
+++ b/drivers/input/mouse/atarimouse.c
@@ -47,7 +47,6 @@
47 47
48#include <asm/irq.h> 48#include <asm/irq.h>
49#include <asm/setup.h> 49#include <asm/setup.h>
50#include <asm/system.h>
51#include <asm/uaccess.h> 50#include <asm/uaccess.h>
52#include <asm/atarihw.h> 51#include <asm/atarihw.h>
53#include <asm/atarikb.h> 52#include <asm/atarikb.h>
diff --git a/drivers/input/serio/ambakmi.c b/drivers/input/serio/ambakmi.c
index 8407d5b0ced8..2ffd110bd5bc 100644
--- a/drivers/input/serio/ambakmi.c
+++ b/drivers/input/serio/ambakmi.c
@@ -208,18 +208,7 @@ static struct amba_driver ambakmi_driver = {
208 .resume = amba_kmi_resume, 208 .resume = amba_kmi_resume,
209}; 209};
210 210
211static int __init amba_kmi_init(void) 211module_amba_driver(ambakmi_driver);
212{
213 return amba_driver_register(&ambakmi_driver);
214}
215
216static void __exit amba_kmi_exit(void)
217{
218 amba_driver_unregister(&ambakmi_driver);
219}
220
221module_init(amba_kmi_init);
222module_exit(amba_kmi_exit);
223 212
224MODULE_AUTHOR("Russell King <rmk@arm.linux.org.uk>"); 213MODULE_AUTHOR("Russell King <rmk@arm.linux.org.uk>");
225MODULE_DESCRIPTION("AMBA KMI controller driver"); 214MODULE_DESCRIPTION("AMBA KMI controller driver");
diff --git a/drivers/input/serio/ams_delta_serio.c b/drivers/input/serio/ams_delta_serio.c
index d4d08bd9205b..f5fbdf94de3b 100644
--- a/drivers/input/serio/ams_delta_serio.c
+++ b/drivers/input/serio/ams_delta_serio.c
@@ -92,8 +92,7 @@ static irqreturn_t ams_delta_serio_interrupt(int irq, void *dev_id)
92static int ams_delta_serio_open(struct serio *serio) 92static int ams_delta_serio_open(struct serio *serio)
93{ 93{
94 /* enable keyboard */ 94 /* enable keyboard */
95 ams_delta_latch2_write(AMD_DELTA_LATCH2_KEYBRD_PWR, 95 gpio_set_value(AMS_DELTA_GPIO_PIN_KEYBRD_PWR, 1);
96 AMD_DELTA_LATCH2_KEYBRD_PWR);
97 96
98 return 0; 97 return 0;
99} 98}
@@ -101,9 +100,32 @@ static int ams_delta_serio_open(struct serio *serio)
101static void ams_delta_serio_close(struct serio *serio) 100static void ams_delta_serio_close(struct serio *serio)
102{ 101{
103 /* disable keyboard */ 102 /* disable keyboard */
104 ams_delta_latch2_write(AMD_DELTA_LATCH2_KEYBRD_PWR, 0); 103 gpio_set_value(AMS_DELTA_GPIO_PIN_KEYBRD_PWR, 0);
105} 104}
106 105
106static const struct gpio ams_delta_gpios[] __initconst_or_module = {
107 {
108 .gpio = AMS_DELTA_GPIO_PIN_KEYBRD_DATA,
109 .flags = GPIOF_DIR_IN,
110 .label = "serio-data",
111 },
112 {
113 .gpio = AMS_DELTA_GPIO_PIN_KEYBRD_CLK,
114 .flags = GPIOF_DIR_IN,
115 .label = "serio-clock",
116 },
117 {
118 .gpio = AMS_DELTA_GPIO_PIN_KEYBRD_PWR,
119 .flags = GPIOF_OUT_INIT_LOW,
120 .label = "serio-power",
121 },
122 {
123 .gpio = AMS_DELTA_GPIO_PIN_KEYBRD_DATAOUT,
124 .flags = GPIOF_OUT_INIT_LOW,
125 .label = "serio-dataout",
126 },
127};
128
107static int __init ams_delta_serio_init(void) 129static int __init ams_delta_serio_init(void)
108{ 130{
109 int err; 131 int err;
@@ -123,19 +145,12 @@ static int __init ams_delta_serio_init(void)
123 strlcpy(ams_delta_serio->phys, "GPIO/serio0", 145 strlcpy(ams_delta_serio->phys, "GPIO/serio0",
124 sizeof(ams_delta_serio->phys)); 146 sizeof(ams_delta_serio->phys));
125 147
126 err = gpio_request(AMS_DELTA_GPIO_PIN_KEYBRD_DATA, "serio-data"); 148 err = gpio_request_array(ams_delta_gpios,
149 ARRAY_SIZE(ams_delta_gpios));
127 if (err) { 150 if (err) {
128 pr_err("ams_delta_serio: Couldn't request gpio pin for data\n"); 151 pr_err("ams_delta_serio: Couldn't request gpio pins\n");
129 goto serio; 152 goto serio;
130 } 153 }
131 gpio_direction_input(AMS_DELTA_GPIO_PIN_KEYBRD_DATA);
132
133 err = gpio_request(AMS_DELTA_GPIO_PIN_KEYBRD_CLK, "serio-clock");
134 if (err) {
135 pr_err("ams_delta_serio: couldn't request gpio pin for clock\n");
136 goto gpio_data;
137 }
138 gpio_direction_input(AMS_DELTA_GPIO_PIN_KEYBRD_CLK);
139 154
140 err = request_irq(gpio_to_irq(AMS_DELTA_GPIO_PIN_KEYBRD_CLK), 155 err = request_irq(gpio_to_irq(AMS_DELTA_GPIO_PIN_KEYBRD_CLK),
141 ams_delta_serio_interrupt, IRQ_TYPE_EDGE_RISING, 156 ams_delta_serio_interrupt, IRQ_TYPE_EDGE_RISING,
@@ -143,7 +158,7 @@ static int __init ams_delta_serio_init(void)
143 if (err < 0) { 158 if (err < 0) {
144 pr_err("ams_delta_serio: couldn't request gpio interrupt %d\n", 159 pr_err("ams_delta_serio: couldn't request gpio interrupt %d\n",
145 gpio_to_irq(AMS_DELTA_GPIO_PIN_KEYBRD_CLK)); 160 gpio_to_irq(AMS_DELTA_GPIO_PIN_KEYBRD_CLK));
146 goto gpio_clk; 161 goto gpio;
147 } 162 }
148 /* 163 /*
149 * Since GPIO register handling for keyboard clock pin is performed 164 * Since GPIO register handling for keyboard clock pin is performed
@@ -157,10 +172,9 @@ static int __init ams_delta_serio_init(void)
157 dev_info(&ams_delta_serio->dev, "%s\n", ams_delta_serio->name); 172 dev_info(&ams_delta_serio->dev, "%s\n", ams_delta_serio->name);
158 173
159 return 0; 174 return 0;
160gpio_clk: 175gpio:
161 gpio_free(AMS_DELTA_GPIO_PIN_KEYBRD_CLK); 176 gpio_free_array(ams_delta_gpios,
162gpio_data: 177 ARRAY_SIZE(ams_delta_gpios));
163 gpio_free(AMS_DELTA_GPIO_PIN_KEYBRD_DATA);
164serio: 178serio:
165 kfree(ams_delta_serio); 179 kfree(ams_delta_serio);
166 return err; 180 return err;
@@ -170,8 +184,8 @@ module_init(ams_delta_serio_init);
170static void __exit ams_delta_serio_exit(void) 184static void __exit ams_delta_serio_exit(void)
171{ 185{
172 serio_unregister_port(ams_delta_serio); 186 serio_unregister_port(ams_delta_serio);
173 free_irq(OMAP_GPIO_IRQ(AMS_DELTA_GPIO_PIN_KEYBRD_CLK), 0); 187 free_irq(gpio_to_irq(AMS_DELTA_GPIO_PIN_KEYBRD_CLK), 0);
174 gpio_free(AMS_DELTA_GPIO_PIN_KEYBRD_CLK); 188 gpio_free_array(ams_delta_gpios,
175 gpio_free(AMS_DELTA_GPIO_PIN_KEYBRD_DATA); 189 ARRAY_SIZE(ams_delta_gpios));
176} 190}
177module_exit(ams_delta_serio_exit); 191module_exit(ams_delta_serio_exit);
diff --git a/drivers/input/serio/hp_sdc.c b/drivers/input/serio/hp_sdc.c
index be3316073ae7..09a089996ded 100644
--- a/drivers/input/serio/hp_sdc.c
+++ b/drivers/input/serio/hp_sdc.c
@@ -71,7 +71,6 @@
71#include <linux/slab.h> 71#include <linux/slab.h>
72#include <linux/hil.h> 72#include <linux/hil.h>
73#include <asm/io.h> 73#include <asm/io.h>
74#include <asm/system.h>
75 74
76/* Machine-specific abstraction */ 75/* Machine-specific abstraction */
77 76
diff --git a/drivers/input/serio/maceps2.c b/drivers/input/serio/maceps2.c
index 558200e96d0f..61da763b1209 100644
--- a/drivers/input/serio/maceps2.c
+++ b/drivers/input/serio/maceps2.c
@@ -21,7 +21,6 @@
21 21
22#include <asm/io.h> 22#include <asm/io.h>
23#include <asm/irq.h> 23#include <asm/irq.h>
24#include <asm/system.h>
25#include <asm/ip32/mace.h> 24#include <asm/ip32/mace.h>
26#include <asm/ip32/ip32_ints.h> 25#include <asm/ip32/ip32_ints.h>
27 26
diff --git a/drivers/input/serio/rpckbd.c b/drivers/input/serio/rpckbd.c
index 8b44ddc8041c..2af5df6a8fba 100644
--- a/drivers/input/serio/rpckbd.c
+++ b/drivers/input/serio/rpckbd.c
@@ -36,16 +36,19 @@
36#include <linux/io.h> 36#include <linux/io.h>
37#include <linux/slab.h> 37#include <linux/slab.h>
38 38
39#include <asm/irq.h>
40#include <mach/hardware.h> 39#include <mach/hardware.h>
41#include <asm/hardware/iomd.h> 40#include <asm/hardware/iomd.h>
42#include <asm/system.h>
43 41
44MODULE_AUTHOR("Vojtech Pavlik, Russell King"); 42MODULE_AUTHOR("Vojtech Pavlik, Russell King");
45MODULE_DESCRIPTION("Acorn RiscPC PS/2 keyboard controller driver"); 43MODULE_DESCRIPTION("Acorn RiscPC PS/2 keyboard controller driver");
46MODULE_LICENSE("GPL"); 44MODULE_LICENSE("GPL");
47MODULE_ALIAS("platform:kart"); 45MODULE_ALIAS("platform:kart");
48 46
47struct rpckbd_data {
48 int tx_irq;
49 int rx_irq;
50};
51
49static int rpckbd_write(struct serio *port, unsigned char val) 52static int rpckbd_write(struct serio *port, unsigned char val)
50{ 53{
51 while (!(iomd_readb(IOMD_KCTRL) & (1 << 7))) 54 while (!(iomd_readb(IOMD_KCTRL) & (1 << 7)))
@@ -78,19 +81,21 @@ static irqreturn_t rpckbd_tx(int irq, void *dev_id)
78 81
79static int rpckbd_open(struct serio *port) 82static int rpckbd_open(struct serio *port)
80{ 83{
84 struct rpckbd_data *rpckbd = port->port_data;
85
81 /* Reset the keyboard state machine. */ 86 /* Reset the keyboard state machine. */
82 iomd_writeb(0, IOMD_KCTRL); 87 iomd_writeb(0, IOMD_KCTRL);
83 iomd_writeb(8, IOMD_KCTRL); 88 iomd_writeb(8, IOMD_KCTRL);
84 iomd_readb(IOMD_KARTRX); 89 iomd_readb(IOMD_KARTRX);
85 90
86 if (request_irq(IRQ_KEYBOARDRX, rpckbd_rx, 0, "rpckbd", port) != 0) { 91 if (request_irq(rpckbd->rx_irq, rpckbd_rx, 0, "rpckbd", port) != 0) {
87 printk(KERN_ERR "rpckbd.c: Could not allocate keyboard receive IRQ\n"); 92 printk(KERN_ERR "rpckbd.c: Could not allocate keyboard receive IRQ\n");
88 return -EBUSY; 93 return -EBUSY;
89 } 94 }
90 95
91 if (request_irq(IRQ_KEYBOARDTX, rpckbd_tx, 0, "rpckbd", port) != 0) { 96 if (request_irq(rpckbd->tx_irq, rpckbd_tx, 0, "rpckbd", port) != 0) {
92 printk(KERN_ERR "rpckbd.c: Could not allocate keyboard transmit IRQ\n"); 97 printk(KERN_ERR "rpckbd.c: Could not allocate keyboard transmit IRQ\n");
93 free_irq(IRQ_KEYBOARDRX, port); 98 free_irq(rpckbd->rx_irq, port);
94 return -EBUSY; 99 return -EBUSY;
95 } 100 }
96 101
@@ -99,8 +104,10 @@ static int rpckbd_open(struct serio *port)
99 104
100static void rpckbd_close(struct serio *port) 105static void rpckbd_close(struct serio *port)
101{ 106{
102 free_irq(IRQ_KEYBOARDRX, port); 107 struct rpckbd_data *rpckbd = port->port_data;
103 free_irq(IRQ_KEYBOARDTX, port); 108
109 free_irq(rpckbd->rx_irq, port);
110 free_irq(rpckbd->tx_irq, port);
104} 111}
105 112
106/* 113/*
@@ -109,17 +116,35 @@ static void rpckbd_close(struct serio *port)
109 */ 116 */
110static int __devinit rpckbd_probe(struct platform_device *dev) 117static int __devinit rpckbd_probe(struct platform_device *dev)
111{ 118{
119 struct rpckbd_data *rpckbd;
112 struct serio *serio; 120 struct serio *serio;
121 int tx_irq, rx_irq;
122
123 rx_irq = platform_get_irq(dev, 0);
124 if (rx_irq <= 0)
125 return rx_irq < 0 ? rx_irq : -ENXIO;
126
127 tx_irq = platform_get_irq(dev, 1);
128 if (tx_irq <= 0)
129 return tx_irq < 0 ? tx_irq : -ENXIO;
113 130
114 serio = kzalloc(sizeof(struct serio), GFP_KERNEL); 131 serio = kzalloc(sizeof(struct serio), GFP_KERNEL);
115 if (!serio) 132 rpckbd = kzalloc(sizeof(*rpckbd), GFP_KERNEL);
133 if (!serio || !rpckbd) {
134 kfree(rpckbd);
135 kfree(serio);
116 return -ENOMEM; 136 return -ENOMEM;
137 }
138
139 rpckbd->rx_irq = rx_irq;
140 rpckbd->tx_irq = tx_irq;
117 141
118 serio->id.type = SERIO_8042; 142 serio->id.type = SERIO_8042;
119 serio->write = rpckbd_write; 143 serio->write = rpckbd_write;
120 serio->open = rpckbd_open; 144 serio->open = rpckbd_open;
121 serio->close = rpckbd_close; 145 serio->close = rpckbd_close;
122 serio->dev.parent = &dev->dev; 146 serio->dev.parent = &dev->dev;
147 serio->port_data = rpckbd;
123 strlcpy(serio->name, "RiscPC PS/2 kbd port", sizeof(serio->name)); 148 strlcpy(serio->name, "RiscPC PS/2 kbd port", sizeof(serio->name));
124 strlcpy(serio->phys, "rpckbd/serio0", sizeof(serio->phys)); 149 strlcpy(serio->phys, "rpckbd/serio0", sizeof(serio->phys));
125 150
@@ -131,7 +156,11 @@ static int __devinit rpckbd_probe(struct platform_device *dev)
131static int __devexit rpckbd_remove(struct platform_device *dev) 156static int __devexit rpckbd_remove(struct platform_device *dev)
132{ 157{
133 struct serio *serio = platform_get_drvdata(dev); 158 struct serio *serio = platform_get_drvdata(dev);
159 struct rpckbd_data *rpckbd = serio->port_data;
160
134 serio_unregister_port(serio); 161 serio_unregister_port(serio);
162 kfree(rpckbd);
163
135 return 0; 164 return 0;
136} 165}
137 166
diff --git a/drivers/input/serio/sa1111ps2.c b/drivers/input/serio/sa1111ps2.c
index 44fc8b4bcd81..389766707534 100644
--- a/drivers/input/serio/sa1111ps2.c
+++ b/drivers/input/serio/sa1111ps2.c
@@ -20,10 +20,29 @@
20#include <linux/spinlock.h> 20#include <linux/spinlock.h>
21 21
22#include <asm/io.h> 22#include <asm/io.h>
23#include <asm/system.h>
24 23
25#include <asm/hardware/sa1111.h> 24#include <asm/hardware/sa1111.h>
26 25
26#define PS2CR 0x0000
27#define PS2STAT 0x0004
28#define PS2DATA 0x0008
29#define PS2CLKDIV 0x000c
30#define PS2PRECNT 0x0010
31
32#define PS2CR_ENA 0x08
33#define PS2CR_FKD 0x02
34#define PS2CR_FKC 0x01
35
36#define PS2STAT_STP 0x0100
37#define PS2STAT_TXE 0x0080
38#define PS2STAT_TXB 0x0040
39#define PS2STAT_RXF 0x0020
40#define PS2STAT_RXB 0x0010
41#define PS2STAT_ENA 0x0008
42#define PS2STAT_RXP 0x0004
43#define PS2STAT_KBD 0x0002
44#define PS2STAT_KBC 0x0001
45
27struct ps2if { 46struct ps2if {
28 struct serio *io; 47 struct serio *io;
29 struct sa1111_dev *dev; 48 struct sa1111_dev *dev;
@@ -45,22 +64,22 @@ static irqreturn_t ps2_rxint(int irq, void *dev_id)
45 struct ps2if *ps2if = dev_id; 64 struct ps2if *ps2if = dev_id;
46 unsigned int scancode, flag, status; 65 unsigned int scancode, flag, status;
47 66
48 status = sa1111_readl(ps2if->base + SA1111_PS2STAT); 67 status = sa1111_readl(ps2if->base + PS2STAT);
49 while (status & PS2STAT_RXF) { 68 while (status & PS2STAT_RXF) {
50 if (status & PS2STAT_STP) 69 if (status & PS2STAT_STP)
51 sa1111_writel(PS2STAT_STP, ps2if->base + SA1111_PS2STAT); 70 sa1111_writel(PS2STAT_STP, ps2if->base + PS2STAT);
52 71
53 flag = (status & PS2STAT_STP ? SERIO_FRAME : 0) | 72 flag = (status & PS2STAT_STP ? SERIO_FRAME : 0) |
54 (status & PS2STAT_RXP ? 0 : SERIO_PARITY); 73 (status & PS2STAT_RXP ? 0 : SERIO_PARITY);
55 74
56 scancode = sa1111_readl(ps2if->base + SA1111_PS2DATA) & 0xff; 75 scancode = sa1111_readl(ps2if->base + PS2DATA) & 0xff;
57 76
58 if (hweight8(scancode) & 1) 77 if (hweight8(scancode) & 1)
59 flag ^= SERIO_PARITY; 78 flag ^= SERIO_PARITY;
60 79
61 serio_interrupt(ps2if->io, scancode, flag); 80 serio_interrupt(ps2if->io, scancode, flag);
62 81
63 status = sa1111_readl(ps2if->base + SA1111_PS2STAT); 82 status = sa1111_readl(ps2if->base + PS2STAT);
64 } 83 }
65 84
66 return IRQ_HANDLED; 85 return IRQ_HANDLED;
@@ -75,12 +94,12 @@ static irqreturn_t ps2_txint(int irq, void *dev_id)
75 unsigned int status; 94 unsigned int status;
76 95
77 spin_lock(&ps2if->lock); 96 spin_lock(&ps2if->lock);
78 status = sa1111_readl(ps2if->base + SA1111_PS2STAT); 97 status = sa1111_readl(ps2if->base + PS2STAT);
79 if (ps2if->head == ps2if->tail) { 98 if (ps2if->head == ps2if->tail) {
80 disable_irq_nosync(irq); 99 disable_irq_nosync(irq);
81 /* done */ 100 /* done */
82 } else if (status & PS2STAT_TXE) { 101 } else if (status & PS2STAT_TXE) {
83 sa1111_writel(ps2if->buf[ps2if->tail], ps2if->base + SA1111_PS2DATA); 102 sa1111_writel(ps2if->buf[ps2if->tail], ps2if->base + PS2DATA);
84 ps2if->tail = (ps2if->tail + 1) & (sizeof(ps2if->buf) - 1); 103 ps2if->tail = (ps2if->tail + 1) & (sizeof(ps2if->buf) - 1);
85 } 104 }
86 spin_unlock(&ps2if->lock); 105 spin_unlock(&ps2if->lock);
@@ -103,8 +122,8 @@ static int ps2_write(struct serio *io, unsigned char val)
103 /* 122 /*
104 * If the TX register is empty, we can go straight out. 123 * If the TX register is empty, we can go straight out.
105 */ 124 */
106 if (sa1111_readl(ps2if->base + SA1111_PS2STAT) & PS2STAT_TXE) { 125 if (sa1111_readl(ps2if->base + PS2STAT) & PS2STAT_TXE) {
107 sa1111_writel(val, ps2if->base + SA1111_PS2DATA); 126 sa1111_writel(val, ps2if->base + PS2DATA);
108 } else { 127 } else {
109 if (ps2if->head == ps2if->tail) 128 if (ps2if->head == ps2if->tail)
110 enable_irq(ps2if->dev->irq[1]); 129 enable_irq(ps2if->dev->irq[1]);
@@ -124,13 +143,16 @@ static int ps2_open(struct serio *io)
124 struct ps2if *ps2if = io->port_data; 143 struct ps2if *ps2if = io->port_data;
125 int ret; 144 int ret;
126 145
127 sa1111_enable_device(ps2if->dev); 146 ret = sa1111_enable_device(ps2if->dev);
147 if (ret)
148 return ret;
128 149
129 ret = request_irq(ps2if->dev->irq[0], ps2_rxint, 0, 150 ret = request_irq(ps2if->dev->irq[0], ps2_rxint, 0,
130 SA1111_DRIVER_NAME(ps2if->dev), ps2if); 151 SA1111_DRIVER_NAME(ps2if->dev), ps2if);
131 if (ret) { 152 if (ret) {
132 printk(KERN_ERR "sa1111ps2: could not allocate IRQ%d: %d\n", 153 printk(KERN_ERR "sa1111ps2: could not allocate IRQ%d: %d\n",
133 ps2if->dev->irq[0], ret); 154 ps2if->dev->irq[0], ret);
155 sa1111_disable_device(ps2if->dev);
134 return ret; 156 return ret;
135 } 157 }
136 158
@@ -140,6 +162,7 @@ static int ps2_open(struct serio *io)
140 printk(KERN_ERR "sa1111ps2: could not allocate IRQ%d: %d\n", 162 printk(KERN_ERR "sa1111ps2: could not allocate IRQ%d: %d\n",
141 ps2if->dev->irq[1], ret); 163 ps2if->dev->irq[1], ret);
142 free_irq(ps2if->dev->irq[0], ps2if); 164 free_irq(ps2if->dev->irq[0], ps2if);
165 sa1111_disable_device(ps2if->dev);
143 return ret; 166 return ret;
144 } 167 }
145 168
@@ -147,7 +170,7 @@ static int ps2_open(struct serio *io)
147 170
148 enable_irq_wake(ps2if->dev->irq[0]); 171 enable_irq_wake(ps2if->dev->irq[0]);
149 172
150 sa1111_writel(PS2CR_ENA, ps2if->base + SA1111_PS2CR); 173 sa1111_writel(PS2CR_ENA, ps2if->base + PS2CR);
151 return 0; 174 return 0;
152} 175}
153 176
@@ -155,7 +178,7 @@ static void ps2_close(struct serio *io)
155{ 178{
156 struct ps2if *ps2if = io->port_data; 179 struct ps2if *ps2if = io->port_data;
157 180
158 sa1111_writel(0, ps2if->base + SA1111_PS2CR); 181 sa1111_writel(0, ps2if->base + PS2CR);
159 182
160 disable_irq_wake(ps2if->dev->irq[0]); 183 disable_irq_wake(ps2if->dev->irq[0]);
161 184
@@ -175,7 +198,7 @@ static void __devinit ps2_clear_input(struct ps2if *ps2if)
175 int maxread = 100; 198 int maxread = 100;
176 199
177 while (maxread--) { 200 while (maxread--) {
178 if ((sa1111_readl(ps2if->base + SA1111_PS2DATA) & 0xff) == 0xff) 201 if ((sa1111_readl(ps2if->base + PS2DATA) & 0xff) == 0xff)
179 break; 202 break;
180 } 203 }
181} 204}
@@ -185,11 +208,11 @@ static unsigned int __devinit ps2_test_one(struct ps2if *ps2if,
185{ 208{
186 unsigned int val; 209 unsigned int val;
187 210
188 sa1111_writel(PS2CR_ENA | mask, ps2if->base + SA1111_PS2CR); 211 sa1111_writel(PS2CR_ENA | mask, ps2if->base + PS2CR);
189 212
190 udelay(2); 213 udelay(2);
191 214
192 val = sa1111_readl(ps2if->base + SA1111_PS2STAT); 215 val = sa1111_readl(ps2if->base + PS2STAT);
193 return val & (PS2STAT_KBC | PS2STAT_KBD); 216 return val & (PS2STAT_KBC | PS2STAT_KBD);
194} 217}
195 218
@@ -220,7 +243,7 @@ static int __devinit ps2_test(struct ps2if *ps2if)
220 ret = -ENODEV; 243 ret = -ENODEV;
221 } 244 }
222 245
223 sa1111_writel(0, ps2if->base + SA1111_PS2CR); 246 sa1111_writel(0, ps2if->base + PS2CR);
224 247
225 return ret; 248 return ret;
226} 249}
@@ -274,8 +297,8 @@ static int __devinit ps2_probe(struct sa1111_dev *dev)
274 sa1111_enable_device(ps2if->dev); 297 sa1111_enable_device(ps2if->dev);
275 298
276 /* Incoming clock is 8MHz */ 299 /* Incoming clock is 8MHz */
277 sa1111_writel(0, ps2if->base + SA1111_PS2CLKDIV); 300 sa1111_writel(0, ps2if->base + PS2CLKDIV);
278 sa1111_writel(127, ps2if->base + SA1111_PS2PRECNT); 301 sa1111_writel(127, ps2if->base + PS2PRECNT);
279 302
280 /* 303 /*
281 * Flush any pending input. 304 * Flush any pending input.
@@ -330,6 +353,7 @@ static int __devexit ps2_remove(struct sa1111_dev *dev)
330static struct sa1111_driver ps2_driver = { 353static struct sa1111_driver ps2_driver = {
331 .drv = { 354 .drv = {
332 .name = "sa1111-ps2", 355 .name = "sa1111-ps2",
356 .owner = THIS_MODULE,
333 }, 357 },
334 .devid = SA1111_DEVID_PS2, 358 .devid = SA1111_DEVID_PS2,
335 .probe = ps2_probe, 359 .probe = ps2_probe,
diff --git a/drivers/input/serio/serio.c b/drivers/input/serio/serio.c
index ba70058e2be3..d0f7533dbf88 100644
--- a/drivers/input/serio/serio.c
+++ b/drivers/input/serio/serio.c
@@ -441,7 +441,6 @@ static ssize_t serio_rebind_driver(struct device *dev, struct device_attribute *
441 } else if ((drv = driver_find(buf, &serio_bus)) != NULL) { 441 } else if ((drv = driver_find(buf, &serio_bus)) != NULL) {
442 serio_disconnect_port(serio); 442 serio_disconnect_port(serio);
443 error = serio_bind_driver(serio, to_serio_driver(drv)); 443 error = serio_bind_driver(serio, to_serio_driver(drv));
444 put_driver(drv);
445 serio_remove_duplicate_events(serio, SERIO_RESCAN_PORT); 444 serio_remove_duplicate_events(serio, SERIO_RESCAN_PORT);
446 } else { 445 } else {
447 error = -EINVAL; 446 error = -EINVAL;
diff --git a/drivers/input/touchscreen/Kconfig b/drivers/input/touchscreen/Kconfig
index 97b31a0e0525..2a2141915aa0 100644
--- a/drivers/input/touchscreen/Kconfig
+++ b/drivers/input/touchscreen/Kconfig
@@ -260,7 +260,7 @@ config TOUCHSCREEN_ILI210X
260 260
261config TOUCHSCREEN_S3C2410 261config TOUCHSCREEN_S3C2410
262 tristate "Samsung S3C2410/generic touchscreen input driver" 262 tristate "Samsung S3C2410/generic touchscreen input driver"
263 depends on ARCH_S3C2410 || SAMSUNG_DEV_TS 263 depends on ARCH_S3C24XX || SAMSUNG_DEV_TS
264 select S3C_ADC 264 select S3C_ADC
265 help 265 help
266 Say Y here if you have the s3c2410 touchscreen. 266 Say Y here if you have the s3c2410 touchscreen.
diff --git a/drivers/input/touchscreen/jornada720_ts.c b/drivers/input/touchscreen/jornada720_ts.c
index c3848ad2325b..d9be6eac99b1 100644
--- a/drivers/input/touchscreen/jornada720_ts.c
+++ b/drivers/input/touchscreen/jornada720_ts.c
@@ -22,6 +22,7 @@
22 22
23#include <mach/hardware.h> 23#include <mach/hardware.h>
24#include <mach/jornada720.h> 24#include <mach/jornada720.h>
25#include <mach/irqs.h>
25 26
26MODULE_AUTHOR("Kristoffer Ericson <kristoffer.ericson@gmail.com>"); 27MODULE_AUTHOR("Kristoffer Ericson <kristoffer.ericson@gmail.com>");
27MODULE_DESCRIPTION("HP Jornada 710/720/728 touchscreen driver"); 28MODULE_DESCRIPTION("HP Jornada 710/720/728 touchscreen driver");
diff --git a/drivers/input/touchscreen/mc13783_ts.c b/drivers/input/touchscreen/mc13783_ts.c
index ede02743eac1..48dc5b0d26f1 100644
--- a/drivers/input/touchscreen/mc13783_ts.c
+++ b/drivers/input/touchscreen/mc13783_ts.c
@@ -39,6 +39,7 @@ struct mc13783_ts_priv {
39 struct delayed_work work; 39 struct delayed_work work;
40 struct workqueue_struct *workq; 40 struct workqueue_struct *workq;
41 unsigned int sample[4]; 41 unsigned int sample[4];
42 struct mc13xxx_ts_platform_data *touch;
42}; 43};
43 44
44static irqreturn_t mc13783_ts_handler(int irq, void *data) 45static irqreturn_t mc13783_ts_handler(int irq, void *data)
@@ -125,7 +126,9 @@ static void mc13783_ts_work(struct work_struct *work)
125 unsigned int channel = 12; 126 unsigned int channel = 12;
126 127
127 if (mc13xxx_adc_do_conversion(priv->mc13xxx, 128 if (mc13xxx_adc_do_conversion(priv->mc13xxx,
128 mode, channel, priv->sample) == 0) 129 mode, channel,
130 priv->touch->ato, priv->touch->atox,
131 priv->sample) == 0)
129 mc13783_ts_report_sample(priv); 132 mc13783_ts_report_sample(priv);
130} 133}
131 134
@@ -179,6 +182,12 @@ static int __init mc13783_ts_probe(struct platform_device *pdev)
179 INIT_DELAYED_WORK(&priv->work, mc13783_ts_work); 182 INIT_DELAYED_WORK(&priv->work, mc13783_ts_work);
180 priv->mc13xxx = dev_get_drvdata(pdev->dev.parent); 183 priv->mc13xxx = dev_get_drvdata(pdev->dev.parent);
181 priv->idev = idev; 184 priv->idev = idev;
185 priv->touch = dev_get_platdata(&pdev->dev);
186 if (!priv->touch) {
187 dev_err(&pdev->dev, "missing platform data\n");
188 ret = -ENODEV;
189 goto err_free_mem;
190 }
182 191
183 /* 192 /*
184 * We need separate workqueue because mc13783_adc_do_conversion 193 * We need separate workqueue because mc13783_adc_do_conversion