aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/input/serio
diff options
context:
space:
mode:
Diffstat (limited to 'drivers/input/serio')
-rw-r--r--drivers/input/serio/Kconfig2
-rw-r--r--drivers/input/serio/ambakmi.c4
-rw-r--r--drivers/input/serio/ct82c710.c4
-rw-r--r--drivers/input/serio/gscps2.c10
-rw-r--r--drivers/input/serio/hil_mlc.c50
-rw-r--r--drivers/input/serio/hp_sdc.c8
-rw-r--r--drivers/input/serio/i8042.c25
-rw-r--r--drivers/input/serio/libps2.c3
-rw-r--r--drivers/input/serio/maceps2.c5
-rw-r--r--drivers/input/serio/parkbd.c4
-rw-r--r--drivers/input/serio/pcips2.c4
-rw-r--r--drivers/input/serio/q40kbd.c4
-rw-r--r--drivers/input/serio/rpckbd.c6
-rw-r--r--drivers/input/serio/sa1111ps2.c6
-rw-r--r--drivers/input/serio/serio.c26
-rw-r--r--drivers/input/serio/serio_raw.c2
-rw-r--r--drivers/input/serio/serport.c5
17 files changed, 95 insertions, 73 deletions
diff --git a/drivers/input/serio/Kconfig b/drivers/input/serio/Kconfig
index 8cdbfeca5903..adef447f23ea 100644
--- a/drivers/input/serio/Kconfig
+++ b/drivers/input/serio/Kconfig
@@ -112,7 +112,7 @@ config SERIO_GSCPS2
112 112
113config HP_SDC 113config HP_SDC
114 tristate "HP System Device Controller i8042 Support" 114 tristate "HP System Device Controller i8042 Support"
115 depends on GSC && SERIO 115 depends on (GSC || HP300) && SERIO
116 default y 116 default y
117 ---help--- 117 ---help---
118 This option enables support for the "System Device 118 This option enables support for the "System Device
diff --git a/drivers/input/serio/ambakmi.c b/drivers/input/serio/ambakmi.c
index 3df5eedf8f31..5a7b49c35539 100644
--- a/drivers/input/serio/ambakmi.c
+++ b/drivers/input/serio/ambakmi.c
@@ -37,14 +37,14 @@ struct amba_kmi_port {
37 unsigned int open; 37 unsigned int open;
38}; 38};
39 39
40static irqreturn_t amba_kmi_int(int irq, void *dev_id, struct pt_regs *regs) 40static irqreturn_t amba_kmi_int(int irq, void *dev_id)
41{ 41{
42 struct amba_kmi_port *kmi = dev_id; 42 struct amba_kmi_port *kmi = dev_id;
43 unsigned int status = readb(KMIIR); 43 unsigned int status = readb(KMIIR);
44 int handled = IRQ_NONE; 44 int handled = IRQ_NONE;
45 45
46 while (status & KMIIR_RXINTR) { 46 while (status & KMIIR_RXINTR) {
47 serio_interrupt(kmi->io, readb(KMIDATA), 0, regs); 47 serio_interrupt(kmi->io, readb(KMIDATA), 0);
48 status = readb(KMIIR); 48 status = readb(KMIIR);
49 handled = IRQ_HANDLED; 49 handled = IRQ_HANDLED;
50 } 50 }
diff --git a/drivers/input/serio/ct82c710.c b/drivers/input/serio/ct82c710.c
index bc6e87add093..0d35018c23a9 100644
--- a/drivers/input/serio/ct82c710.c
+++ b/drivers/input/serio/ct82c710.c
@@ -71,9 +71,9 @@ static struct resource ct82c710_iores;
71 * is waiting in the 82C710. 71 * is waiting in the 82C710.
72 */ 72 */
73 73
74static irqreturn_t ct82c710_interrupt(int cpl, void *dev_id, struct pt_regs * regs) 74static irqreturn_t ct82c710_interrupt(int cpl, void *dev_id)
75{ 75{
76 return serio_interrupt(ct82c710_port, inb(CT82C710_DATA), 0, regs); 76 return serio_interrupt(ct82c710_port, inb(CT82C710_DATA), 0);
77} 77}
78 78
79/* 79/*
diff --git a/drivers/input/serio/gscps2.c b/drivers/input/serio/gscps2.c
index cde036a92168..74f14e097789 100644
--- a/drivers/input/serio/gscps2.c
+++ b/drivers/input/serio/gscps2.c
@@ -82,7 +82,7 @@ MODULE_DEVICE_TABLE(parisc, gscps2_device_tbl);
82#define GSC_ID_MOUSE 1 82#define GSC_ID_MOUSE 1
83 83
84 84
85static irqreturn_t gscps2_interrupt(int irq, void *dev, struct pt_regs *regs); 85static irqreturn_t gscps2_interrupt(int irq, void *dev);
86 86
87#define BUFFER_SIZE 0x0f 87#define BUFFER_SIZE 0x0f
88 88
@@ -166,7 +166,7 @@ static inline int gscps2_writeb_output(struct gscps2port *ps2port, u8 data)
166 166
167 /* make sure any received data is returned as fast as possible */ 167 /* make sure any received data is returned as fast as possible */
168 /* this is important e.g. when we set the LEDs on the keyboard */ 168 /* this is important e.g. when we set the LEDs on the keyboard */
169 gscps2_interrupt(0, NULL, NULL); 169 gscps2_interrupt(0, NULL);
170 170
171 return 1; 171 return 1;
172} 172}
@@ -226,7 +226,7 @@ static LIST_HEAD(ps2port_list);
226 * later. 226 * later.
227 */ 227 */
228 228
229static irqreturn_t gscps2_interrupt(int irq, void *dev, struct pt_regs *regs) 229static irqreturn_t gscps2_interrupt(int irq, void *dev)
230{ 230{
231 struct gscps2port *ps2port; 231 struct gscps2port *ps2port;
232 232
@@ -267,7 +267,7 @@ static irqreturn_t gscps2_interrupt(int irq, void *dev, struct pt_regs *regs)
267 rxflags = ((status & GSC_STAT_TERR) ? SERIO_TIMEOUT : 0 ) | 267 rxflags = ((status & GSC_STAT_TERR) ? SERIO_TIMEOUT : 0 ) |
268 ((status & GSC_STAT_PERR) ? SERIO_PARITY : 0 ); 268 ((status & GSC_STAT_PERR) ? SERIO_PARITY : 0 );
269 269
270 serio_interrupt(ps2port->port, data, rxflags, regs); 270 serio_interrupt(ps2port->port, data, rxflags);
271 271
272 } /* while() */ 272 } /* while() */
273 273
@@ -306,7 +306,7 @@ static int gscps2_open(struct serio *port)
306 /* enable it */ 306 /* enable it */
307 gscps2_enable(ps2port, ENABLE); 307 gscps2_enable(ps2port, ENABLE);
308 308
309 gscps2_interrupt(0, NULL, NULL); 309 gscps2_interrupt(0, NULL);
310 310
311 return 0; 311 return 0;
312} 312}
diff --git a/drivers/input/serio/hil_mlc.c b/drivers/input/serio/hil_mlc.c
index bbbe15e21904..49e11e2c1d5d 100644
--- a/drivers/input/serio/hil_mlc.c
+++ b/drivers/input/serio/hil_mlc.c
@@ -162,10 +162,10 @@ static void hil_mlc_send_polls(hil_mlc *mlc) {
162 if (did != (p & HIL_PKT_ADDR_MASK) >> 8) { 162 if (did != (p & HIL_PKT_ADDR_MASK) >> 8) {
163 if (drv == NULL || drv->interrupt == NULL) goto skip; 163 if (drv == NULL || drv->interrupt == NULL) goto skip;
164 164
165 drv->interrupt(serio, 0, 0, NULL); 165 drv->interrupt(serio, 0, 0);
166 drv->interrupt(serio, HIL_ERR_INT >> 16, 0, NULL); 166 drv->interrupt(serio, HIL_ERR_INT >> 16, 0);
167 drv->interrupt(serio, HIL_PKT_CMD >> 8, 0, NULL); 167 drv->interrupt(serio, HIL_PKT_CMD >> 8, 0);
168 drv->interrupt(serio, HIL_CMD_POL + cnt, 0, NULL); 168 drv->interrupt(serio, HIL_CMD_POL + cnt, 0);
169 skip: 169 skip:
170 did = (p & HIL_PKT_ADDR_MASK) >> 8; 170 did = (p & HIL_PKT_ADDR_MASK) >> 8;
171 serio = did ? mlc->serio[mlc->di_map[did-1]] : NULL; 171 serio = did ? mlc->serio[mlc->di_map[did-1]] : NULL;
@@ -174,10 +174,10 @@ static void hil_mlc_send_polls(hil_mlc *mlc) {
174 } 174 }
175 cnt++; i++; 175 cnt++; i++;
176 if (drv == NULL || drv->interrupt == NULL) continue; 176 if (drv == NULL || drv->interrupt == NULL) continue;
177 drv->interrupt(serio, (p >> 24), 0, NULL); 177 drv->interrupt(serio, (p >> 24), 0);
178 drv->interrupt(serio, (p >> 16) & 0xff, 0, NULL); 178 drv->interrupt(serio, (p >> 16) & 0xff, 0);
179 drv->interrupt(serio, (p >> 8) & ~HIL_PKT_ADDR_MASK, 0, NULL); 179 drv->interrupt(serio, (p >> 8) & ~HIL_PKT_ADDR_MASK, 0);
180 drv->interrupt(serio, p & 0xff, 0, NULL); 180 drv->interrupt(serio, p & 0xff, 0);
181 } 181 }
182} 182}
183 183
@@ -391,23 +391,23 @@ static int hilse_operate(hil_mlc *mlc, int repoll) {
391} 391}
392 392
393#define FUNC(funct, funct_arg, zero_rc, neg_rc, pos_rc) \ 393#define FUNC(funct, funct_arg, zero_rc, neg_rc, pos_rc) \
394{ HILSE_FUNC, { func: &funct }, funct_arg, zero_rc, neg_rc, pos_rc }, 394{ HILSE_FUNC, { .func = funct }, funct_arg, zero_rc, neg_rc, pos_rc },
395#define OUT(pack) \ 395#define OUT(pack) \
396{ HILSE_OUT, { packet: pack }, 0, HILSEN_NEXT, HILSEN_DOZE, 0 }, 396{ HILSE_OUT, { .packet = pack }, 0, HILSEN_NEXT, HILSEN_DOZE, 0 },
397#define CTS \ 397#define CTS \
398{ HILSE_CTS, { packet: 0 }, 0, HILSEN_NEXT | HILSEN_SCHED | HILSEN_BREAK, HILSEN_DOZE, 0 }, 398{ HILSE_CTS, { .packet = 0 }, 0, HILSEN_NEXT | HILSEN_SCHED | HILSEN_BREAK, HILSEN_DOZE, 0 },
399#define EXPECT(comp, to, got, got_wrong, timed_out) \ 399#define EXPECT(comp, to, got, got_wrong, timed_out) \
400{ HILSE_EXPECT, { packet: comp }, to, got, got_wrong, timed_out }, 400{ HILSE_EXPECT, { .packet = comp }, to, got, got_wrong, timed_out },
401#define EXPECT_LAST(comp, to, got, got_wrong, timed_out) \ 401#define EXPECT_LAST(comp, to, got, got_wrong, timed_out) \
402{ HILSE_EXPECT_LAST, { packet: comp }, to, got, got_wrong, timed_out }, 402{ HILSE_EXPECT_LAST, { .packet = comp }, to, got, got_wrong, timed_out },
403#define EXPECT_DISC(comp, to, got, got_wrong, timed_out) \ 403#define EXPECT_DISC(comp, to, got, got_wrong, timed_out) \
404{ HILSE_EXPECT_DISC, { packet: comp }, to, got, got_wrong, timed_out }, 404{ HILSE_EXPECT_DISC, { .packet = comp }, to, got, got_wrong, timed_out },
405#define IN(to, got, got_error, timed_out) \ 405#define IN(to, got, got_error, timed_out) \
406{ HILSE_IN, { packet: 0 }, to, got, got_error, timed_out }, 406{ HILSE_IN, { .packet = 0 }, to, got, got_error, timed_out },
407#define OUT_DISC(pack) \ 407#define OUT_DISC(pack) \
408{ HILSE_OUT_DISC, { packet: pack }, 0, 0, 0, 0 }, 408{ HILSE_OUT_DISC, { .packet = pack }, 0, 0, 0, 0 },
409#define OUT_LAST(pack) \ 409#define OUT_LAST(pack) \
410{ HILSE_OUT_LAST, { packet: pack }, 0, 0, 0, 0 }, 410{ HILSE_OUT_LAST, { .packet = pack }, 0, 0, 0, 0 },
411 411
412struct hilse_node hil_mlc_se[HILSEN_END] = { 412struct hilse_node hil_mlc_se[HILSEN_END] = {
413 413
@@ -780,16 +780,16 @@ static int hil_mlc_serio_write(struct serio *serio, unsigned char c) {
780 while ((last != idx) && (*last == 0)) last--; 780 while ((last != idx) && (*last == 0)) last--;
781 781
782 while (idx != last) { 782 while (idx != last) {
783 drv->interrupt(serio, 0, 0, NULL); 783 drv->interrupt(serio, 0, 0);
784 drv->interrupt(serio, HIL_ERR_INT >> 16, 0, NULL); 784 drv->interrupt(serio, HIL_ERR_INT >> 16, 0);
785 drv->interrupt(serio, 0, 0, NULL); 785 drv->interrupt(serio, 0, 0);
786 drv->interrupt(serio, *idx, 0, NULL); 786 drv->interrupt(serio, *idx, 0);
787 idx++; 787 idx++;
788 } 788 }
789 drv->interrupt(serio, 0, 0, NULL); 789 drv->interrupt(serio, 0, 0);
790 drv->interrupt(serio, HIL_ERR_INT >> 16, 0, NULL); 790 drv->interrupt(serio, HIL_ERR_INT >> 16, 0);
791 drv->interrupt(serio, HIL_PKT_CMD >> 8, 0, NULL); 791 drv->interrupt(serio, HIL_PKT_CMD >> 8, 0);
792 drv->interrupt(serio, *idx, 0, NULL); 792 drv->interrupt(serio, *idx, 0);
793 793
794 mlc->serio_oidx[map->didx] = 0; 794 mlc->serio_oidx[map->didx] = 0;
795 mlc->serio_opacket[map->didx] = 0; 795 mlc->serio_opacket[map->didx] = 0;
diff --git a/drivers/input/serio/hp_sdc.c b/drivers/input/serio/hp_sdc.c
index a10348bb25e9..9907ad3bea23 100644
--- a/drivers/input/serio/hp_sdc.c
+++ b/drivers/input/serio/hp_sdc.c
@@ -202,7 +202,7 @@ static void hp_sdc_take (int irq, void *dev_id, uint8_t status, uint8_t data) {
202 } 202 }
203} 203}
204 204
205static irqreturn_t hp_sdc_isr(int irq, void *dev_id, struct pt_regs * regs) { 205static irqreturn_t hp_sdc_isr(int irq, void *dev_id) {
206 uint8_t status, data; 206 uint8_t status, data;
207 207
208 status = hp_sdc_status_in8(); 208 status = hp_sdc_status_in8();
@@ -253,7 +253,7 @@ static irqreturn_t hp_sdc_isr(int irq, void *dev_id, struct pt_regs * regs) {
253} 253}
254 254
255 255
256static irqreturn_t hp_sdc_nmisr(int irq, void *dev_id, struct pt_regs * regs) { 256static irqreturn_t hp_sdc_nmisr(int irq, void *dev_id) {
257 int status; 257 int status;
258 258
259 status = hp_sdc_status_in8(); 259 status = hp_sdc_status_in8();
@@ -310,7 +310,7 @@ static void hp_sdc_tasklet(unsigned long foo) {
310 * in tasklet/bh context. 310 * in tasklet/bh context.
311 */ 311 */
312 if (curr->act.irqhook) 312 if (curr->act.irqhook)
313 curr->act.irqhook(0, 0, 0, 0); 313 curr->act.irqhook(0, NULL, 0, 0);
314 } 314 }
315 curr->actidx = curr->idx; 315 curr->actidx = curr->idx;
316 curr->idx++; 316 curr->idx++;
@@ -525,7 +525,7 @@ actdone:
525 up(curr->act.semaphore); 525 up(curr->act.semaphore);
526 } 526 }
527 else if (act & HP_SDC_ACT_CALLBACK) { 527 else if (act & HP_SDC_ACT_CALLBACK) {
528 curr->act.irqhook(0,0,0,0); 528 curr->act.irqhook(0,NULL,0,0);
529 } 529 }
530 if (curr->idx >= curr->endidx) { /* This transaction is over. */ 530 if (curr->idx >= curr->endidx) { /* This transaction is over. */
531 if (act & HP_SDC_ACT_DEALLOC) kfree(curr); 531 if (act & HP_SDC_ACT_DEALLOC) kfree(curr);
diff --git a/drivers/input/serio/i8042.c b/drivers/input/serio/i8042.c
index 1bb0c76a9259..7e3141f37e32 100644
--- a/drivers/input/serio/i8042.c
+++ b/drivers/input/serio/i8042.c
@@ -106,9 +106,10 @@ static unsigned char i8042_ctr;
106static unsigned char i8042_mux_present; 106static unsigned char i8042_mux_present;
107static unsigned char i8042_kbd_irq_registered; 107static unsigned char i8042_kbd_irq_registered;
108static unsigned char i8042_aux_irq_registered; 108static unsigned char i8042_aux_irq_registered;
109static unsigned char i8042_suppress_kbd_ack;
109static struct platform_device *i8042_platform_device; 110static struct platform_device *i8042_platform_device;
110 111
111static irqreturn_t i8042_interrupt(int irq, void *dev_id, struct pt_regs *regs); 112static irqreturn_t i8042_interrupt(int irq, void *dev_id);
112 113
113/* 114/*
114 * The i8042_wait_read() and i8042_wait_write functions wait for the i8042 to 115 * The i8042_wait_read() and i8042_wait_write functions wait for the i8042 to
@@ -271,7 +272,7 @@ static int i8042_aux_write(struct serio *serio, unsigned char c)
271 * characters later. 272 * characters later.
272 */ 273 */
273 274
274 i8042_interrupt(0, NULL, NULL); 275 i8042_interrupt(0, NULL);
275 return retval; 276 return retval;
276} 277}
277 278
@@ -309,14 +310,14 @@ static void i8042_stop(struct serio *serio)
309 * to the upper layers. 310 * to the upper layers.
310 */ 311 */
311 312
312static irqreturn_t i8042_interrupt(int irq, void *dev_id, struct pt_regs *regs) 313static irqreturn_t i8042_interrupt(int irq, void *dev_id)
313{ 314{
314 struct i8042_port *port; 315 struct i8042_port *port;
315 unsigned long flags; 316 unsigned long flags;
316 unsigned char str, data; 317 unsigned char str, data;
317 unsigned int dfl; 318 unsigned int dfl;
318 unsigned int port_no; 319 unsigned int port_no;
319 int ret; 320 int ret = 1;
320 321
321 spin_lock_irqsave(&i8042_lock, flags); 322 spin_lock_irqsave(&i8042_lock, flags);
322 str = i8042_read_status(); 323 str = i8042_read_status();
@@ -378,10 +379,16 @@ static irqreturn_t i8042_interrupt(int irq, void *dev_id, struct pt_regs *regs)
378 dfl & SERIO_PARITY ? ", bad parity" : "", 379 dfl & SERIO_PARITY ? ", bad parity" : "",
379 dfl & SERIO_TIMEOUT ? ", timeout" : ""); 380 dfl & SERIO_TIMEOUT ? ", timeout" : "");
380 381
382 if (unlikely(i8042_suppress_kbd_ack))
383 if (port_no == I8042_KBD_PORT_NO &&
384 (data == 0xfa || data == 0xfe)) {
385 i8042_suppress_kbd_ack = 0;
386 goto out;
387 }
388
381 if (likely(port->exists)) 389 if (likely(port->exists))
382 serio_interrupt(port->serio, data, dfl, regs); 390 serio_interrupt(port->serio, data, dfl);
383 391
384 ret = 1;
385 out: 392 out:
386 return IRQ_RETVAL(ret); 393 return IRQ_RETVAL(ret);
387} 394}
@@ -519,7 +526,7 @@ static int __devinit i8042_check_mux(void)
519static struct completion i8042_aux_irq_delivered __devinitdata; 526static struct completion i8042_aux_irq_delivered __devinitdata;
520static int i8042_irq_being_tested __devinitdata; 527static int i8042_irq_being_tested __devinitdata;
521 528
522static irqreturn_t __devinit i8042_aux_test_irq(int irq, void *dev_id, struct pt_regs *regs) 529static irqreturn_t __devinit i8042_aux_test_irq(int irq, void *dev_id)
523{ 530{
524 unsigned long flags; 531 unsigned long flags;
525 unsigned char str, data; 532 unsigned char str, data;
@@ -842,11 +849,13 @@ static long i8042_panic_blink(long count)
842 led ^= 0x01 | 0x04; 849 led ^= 0x01 | 0x04;
843 while (i8042_read_status() & I8042_STR_IBF) 850 while (i8042_read_status() & I8042_STR_IBF)
844 DELAY; 851 DELAY;
852 i8042_suppress_kbd_ack = 1;
845 i8042_write_data(0xed); /* set leds */ 853 i8042_write_data(0xed); /* set leds */
846 DELAY; 854 DELAY;
847 while (i8042_read_status() & I8042_STR_IBF) 855 while (i8042_read_status() & I8042_STR_IBF)
848 DELAY; 856 DELAY;
849 DELAY; 857 DELAY;
858 i8042_suppress_kbd_ack = 1;
850 i8042_write_data(led); 859 i8042_write_data(led);
851 DELAY; 860 DELAY;
852 last_blink = count; 861 last_blink = count;
@@ -905,7 +914,7 @@ static int i8042_resume(struct platform_device *dev)
905 if (i8042_ports[I8042_KBD_PORT_NO].serio) 914 if (i8042_ports[I8042_KBD_PORT_NO].serio)
906 i8042_enable_kbd_port(); 915 i8042_enable_kbd_port();
907 916
908 i8042_interrupt(0, NULL, NULL); 917 i8042_interrupt(0, NULL);
909 918
910 return 0; 919 return 0;
911} 920}
diff --git a/drivers/input/serio/libps2.c b/drivers/input/serio/libps2.c
index dcb16b5cbec0..e5b1b60757bb 100644
--- a/drivers/input/serio/libps2.c
+++ b/drivers/input/serio/libps2.c
@@ -189,7 +189,7 @@ int ps2_command(struct ps2dev *ps2dev, unsigned char *param, int command)
189 return -1; 189 return -1;
190 } 190 }
191 191
192 mutex_lock_nested(&ps2dev->cmd_mutex, SINGLE_DEPTH_NESTING); 192 mutex_lock(&ps2dev->cmd_mutex);
193 193
194 serio_pause_rx(ps2dev->serio); 194 serio_pause_rx(ps2dev->serio);
195 ps2dev->flags = command == PS2_CMD_GETID ? PS2_FLAG_WAITID : 0; 195 ps2dev->flags = command == PS2_CMD_GETID ? PS2_FLAG_WAITID : 0;
@@ -296,6 +296,7 @@ EXPORT_SYMBOL(ps2_schedule_command);
296void ps2_init(struct ps2dev *ps2dev, struct serio *serio) 296void ps2_init(struct ps2dev *ps2dev, struct serio *serio)
297{ 297{
298 mutex_init(&ps2dev->cmd_mutex); 298 mutex_init(&ps2dev->cmd_mutex);
299 lockdep_set_subclass(&ps2dev->cmd_mutex, serio->depth);
299 init_waitqueue_head(&ps2dev->wait); 300 init_waitqueue_head(&ps2dev->wait);
300 ps2dev->serio = serio; 301 ps2dev->serio = serio;
301} 302}
diff --git a/drivers/input/serio/maceps2.c b/drivers/input/serio/maceps2.c
index f08a5d0cd5fa..558200e96d0f 100644
--- a/drivers/input/serio/maceps2.c
+++ b/drivers/input/serio/maceps2.c
@@ -72,8 +72,7 @@ static int maceps2_write(struct serio *dev, unsigned char val)
72 return -1; 72 return -1;
73} 73}
74 74
75static irqreturn_t maceps2_interrupt(int irq, void *dev_id, 75static irqreturn_t maceps2_interrupt(int irq, void *dev_id)
76 struct pt_regs *regs)
77{ 76{
78 struct serio *dev = dev_id; 77 struct serio *dev = dev_id;
79 struct mace_ps2port *port = ((struct maceps2_data *)dev->port_data)->port; 78 struct mace_ps2port *port = ((struct maceps2_data *)dev->port_data)->port;
@@ -81,7 +80,7 @@ static irqreturn_t maceps2_interrupt(int irq, void *dev_id,
81 80
82 if (port->status & PS2_STATUS_RX_FULL) { 81 if (port->status & PS2_STATUS_RX_FULL) {
83 byte = port->rx; 82 byte = port->rx;
84 serio_interrupt(dev, byte & 0xff, 0, regs); 83 serio_interrupt(dev, byte & 0xff, 0);
85 } 84 }
86 85
87 return IRQ_HANDLED; 86 return IRQ_HANDLED;
diff --git a/drivers/input/serio/parkbd.c b/drivers/input/serio/parkbd.c
index a5c1fb3a4a51..688610e86a3e 100644
--- a/drivers/input/serio/parkbd.c
+++ b/drivers/input/serio/parkbd.c
@@ -102,7 +102,7 @@ static int parkbd_write(struct serio *port, unsigned char c)
102 return 0; 102 return 0;
103} 103}
104 104
105static void parkbd_interrupt(int irq, void *dev_id, struct pt_regs *regs) 105static void parkbd_interrupt(int irq, void *dev_id)
106{ 106{
107 107
108 if (parkbd_writing) { 108 if (parkbd_writing) {
@@ -134,7 +134,7 @@ static void parkbd_interrupt(int irq, void *dev_id, struct pt_regs *regs)
134 parkbd_buffer |= (parkbd_readlines() >> 1) << parkbd_counter++; 134 parkbd_buffer |= (parkbd_readlines() >> 1) << parkbd_counter++;
135 135
136 if (parkbd_counter == parkbd_mode + 10) 136 if (parkbd_counter == parkbd_mode + 10)
137 serio_interrupt(parkbd_port, (parkbd_buffer >> (2 - parkbd_mode)) & 0xff, 0, regs); 137 serio_interrupt(parkbd_port, (parkbd_buffer >> (2 - parkbd_mode)) & 0xff, 0);
138 } 138 }
139 139
140 parkbd_last = jiffies; 140 parkbd_last = jiffies;
diff --git a/drivers/input/serio/pcips2.c b/drivers/input/serio/pcips2.c
index fb727c665253..ea5e3c6ddb62 100644
--- a/drivers/input/serio/pcips2.c
+++ b/drivers/input/serio/pcips2.c
@@ -58,7 +58,7 @@ static int pcips2_write(struct serio *io, unsigned char val)
58 return 0; 58 return 0;
59} 59}
60 60
61static irqreturn_t pcips2_interrupt(int irq, void *devid, struct pt_regs *regs) 61static irqreturn_t pcips2_interrupt(int irq, void *devid)
62{ 62{
63 struct pcips2_data *ps2if = devid; 63 struct pcips2_data *ps2if = devid;
64 unsigned char status, scancode; 64 unsigned char status, scancode;
@@ -80,7 +80,7 @@ static irqreturn_t pcips2_interrupt(int irq, void *devid, struct pt_regs *regs)
80 if (hweight8(scancode) & 1) 80 if (hweight8(scancode) & 1)
81 flag ^= SERIO_PARITY; 81 flag ^= SERIO_PARITY;
82 82
83 serio_interrupt(ps2if->io, scancode, flag, regs); 83 serio_interrupt(ps2if->io, scancode, flag);
84 } while (1); 84 } while (1);
85 return IRQ_RETVAL(handled); 85 return IRQ_RETVAL(handled);
86} 86}
diff --git a/drivers/input/serio/q40kbd.c b/drivers/input/serio/q40kbd.c
index d3827c5fe119..cb89aff2e160 100644
--- a/drivers/input/serio/q40kbd.c
+++ b/drivers/input/serio/q40kbd.c
@@ -53,14 +53,14 @@ DEFINE_SPINLOCK(q40kbd_lock);
53static struct serio *q40kbd_port; 53static struct serio *q40kbd_port;
54static struct platform_device *q40kbd_device; 54static struct platform_device *q40kbd_device;
55 55
56static irqreturn_t q40kbd_interrupt(int irq, void *dev_id, struct pt_regs *regs) 56static irqreturn_t q40kbd_interrupt(int irq, void *dev_id)
57{ 57{
58 unsigned long flags; 58 unsigned long flags;
59 59
60 spin_lock_irqsave(&q40kbd_lock, flags); 60 spin_lock_irqsave(&q40kbd_lock, flags);
61 61
62 if (Q40_IRQ_KEYB_MASK & master_inb(INTERRUPT_REG)) 62 if (Q40_IRQ_KEYB_MASK & master_inb(INTERRUPT_REG))
63 serio_interrupt(q40kbd_port, master_inb(KEYCODE_REG), 0, regs); 63 serio_interrupt(q40kbd_port, master_inb(KEYCODE_REG), 0);
64 64
65 master_outb(-1, KEYBOARD_UNLOCK_REG); 65 master_outb(-1, KEYBOARD_UNLOCK_REG);
66 66
diff --git a/drivers/input/serio/rpckbd.c b/drivers/input/serio/rpckbd.c
index 513d37fc1acf..49f84315cb32 100644
--- a/drivers/input/serio/rpckbd.c
+++ b/drivers/input/serio/rpckbd.c
@@ -56,7 +56,7 @@ static int rpckbd_write(struct serio *port, unsigned char val)
56 return 0; 56 return 0;
57} 57}
58 58
59static irqreturn_t rpckbd_rx(int irq, void *dev_id, struct pt_regs *regs) 59static irqreturn_t rpckbd_rx(int irq, void *dev_id)
60{ 60{
61 struct serio *port = dev_id; 61 struct serio *port = dev_id;
62 unsigned int byte; 62 unsigned int byte;
@@ -65,13 +65,13 @@ static irqreturn_t rpckbd_rx(int irq, void *dev_id, struct pt_regs *regs)
65 while (iomd_readb(IOMD_KCTRL) & (1 << 5)) { 65 while (iomd_readb(IOMD_KCTRL) & (1 << 5)) {
66 byte = iomd_readb(IOMD_KARTRX); 66 byte = iomd_readb(IOMD_KARTRX);
67 67
68 serio_interrupt(port, byte, 0, regs); 68 serio_interrupt(port, byte, 0);
69 handled = IRQ_HANDLED; 69 handled = IRQ_HANDLED;
70 } 70 }
71 return handled; 71 return handled;
72} 72}
73 73
74static irqreturn_t rpckbd_tx(int irq, void *dev_id, struct pt_regs *regs) 74static irqreturn_t rpckbd_tx(int irq, void *dev_id)
75{ 75{
76 return IRQ_HANDLED; 76 return IRQ_HANDLED;
77} 77}
diff --git a/drivers/input/serio/sa1111ps2.c b/drivers/input/serio/sa1111ps2.c
index ebd9976fc811..559508795af1 100644
--- a/drivers/input/serio/sa1111ps2.c
+++ b/drivers/input/serio/sa1111ps2.c
@@ -40,7 +40,7 @@ struct ps2if {
40 * at the most one, but we loop for safety. If there was a 40 * at the most one, but we loop for safety. If there was a
41 * framing error, we have to manually clear the status. 41 * framing error, we have to manually clear the status.
42 */ 42 */
43static irqreturn_t ps2_rxint(int irq, void *dev_id, struct pt_regs *regs) 43static irqreturn_t ps2_rxint(int irq, void *dev_id)
44{ 44{
45 struct ps2if *ps2if = dev_id; 45 struct ps2if *ps2if = dev_id;
46 unsigned int scancode, flag, status; 46 unsigned int scancode, flag, status;
@@ -58,7 +58,7 @@ static irqreturn_t ps2_rxint(int irq, void *dev_id, struct pt_regs *regs)
58 if (hweight8(scancode) & 1) 58 if (hweight8(scancode) & 1)
59 flag ^= SERIO_PARITY; 59 flag ^= SERIO_PARITY;
60 60
61 serio_interrupt(ps2if->io, scancode, flag, regs); 61 serio_interrupt(ps2if->io, scancode, flag);
62 62
63 status = sa1111_readl(ps2if->base + SA1111_PS2STAT); 63 status = sa1111_readl(ps2if->base + SA1111_PS2STAT);
64 } 64 }
@@ -69,7 +69,7 @@ static irqreturn_t ps2_rxint(int irq, void *dev_id, struct pt_regs *regs)
69/* 69/*
70 * Completion of ps2 write 70 * Completion of ps2 write
71 */ 71 */
72static irqreturn_t ps2_txint(int irq, void *dev_id, struct pt_regs *regs) 72static irqreturn_t ps2_txint(int irq, void *dev_id)
73{ 73{
74 struct ps2if *ps2if = dev_id; 74 struct ps2if *ps2if = dev_id;
75 unsigned int status; 75 unsigned int status;
diff --git a/drivers/input/serio/serio.c b/drivers/input/serio/serio.c
index 3e76ad71c9a0..211943f85cb6 100644
--- a/drivers/input/serio/serio.c
+++ b/drivers/input/serio/serio.c
@@ -118,6 +118,8 @@ static int serio_match_port(const struct serio_device_id *ids, struct serio *ser
118 118
119static void serio_bind_driver(struct serio *serio, struct serio_driver *drv) 119static void serio_bind_driver(struct serio *serio, struct serio_driver *drv)
120{ 120{
121 int error;
122
121 down_write(&serio_bus.subsys.rwsem); 123 down_write(&serio_bus.subsys.rwsem);
122 124
123 if (serio_match_port(drv->id_table, serio)) { 125 if (serio_match_port(drv->id_table, serio)) {
@@ -126,9 +128,19 @@ static void serio_bind_driver(struct serio *serio, struct serio_driver *drv)
126 serio->dev.driver = NULL; 128 serio->dev.driver = NULL;
127 goto out; 129 goto out;
128 } 130 }
129 device_bind_driver(&serio->dev); 131 error = device_bind_driver(&serio->dev);
132 if (error) {
133 printk(KERN_WARNING
134 "serio: device_bind_driver() failed "
135 "for %s (%s) and %s, error: %d\n",
136 serio->phys, serio->name,
137 drv->description, error);
138 serio_disconnect_driver(serio);
139 serio->dev.driver = NULL;
140 goto out;
141 }
130 } 142 }
131out: 143 out:
132 up_write(&serio_bus.subsys.rwsem); 144 up_write(&serio_bus.subsys.rwsem);
133} 145}
134 146
@@ -538,8 +550,12 @@ static void serio_init_port(struct serio *serio)
538 "serio%ld", (long)atomic_inc_return(&serio_no) - 1); 550 "serio%ld", (long)atomic_inc_return(&serio_no) - 1);
539 serio->dev.bus = &serio_bus; 551 serio->dev.bus = &serio_bus;
540 serio->dev.release = serio_release_port; 552 serio->dev.release = serio_release_port;
541 if (serio->parent) 553 if (serio->parent) {
542 serio->dev.parent = &serio->parent->dev; 554 serio->dev.parent = &serio->parent->dev;
555 serio->depth = serio->parent->depth + 1;
556 } else
557 serio->depth = 0;
558 lockdep_set_subclass(&serio->lock, serio->depth);
543} 559}
544 560
545/* 561/*
@@ -911,7 +927,7 @@ void serio_close(struct serio *serio)
911} 927}
912 928
913irqreturn_t serio_interrupt(struct serio *serio, 929irqreturn_t serio_interrupt(struct serio *serio,
914 unsigned char data, unsigned int dfl, struct pt_regs *regs) 930 unsigned char data, unsigned int dfl)
915{ 931{
916 unsigned long flags; 932 unsigned long flags;
917 irqreturn_t ret = IRQ_NONE; 933 irqreturn_t ret = IRQ_NONE;
@@ -919,7 +935,7 @@ irqreturn_t serio_interrupt(struct serio *serio,
919 spin_lock_irqsave(&serio->lock, flags); 935 spin_lock_irqsave(&serio->lock, flags);
920 936
921 if (likely(serio->drv)) { 937 if (likely(serio->drv)) {
922 ret = serio->drv->interrupt(serio, data, dfl, regs); 938 ret = serio->drv->interrupt(serio, data, dfl);
923 } else if (!dfl && serio->registered) { 939 } else if (!dfl && serio->registered) {
924 serio_rescan(serio); 940 serio_rescan(serio);
925 ret = IRQ_HANDLED; 941 ret = IRQ_HANDLED;
diff --git a/drivers/input/serio/serio_raw.c b/drivers/input/serio/serio_raw.c
index 71a8eea816cb..ba2a2035d648 100644
--- a/drivers/input/serio/serio_raw.c
+++ b/drivers/input/serio/serio_raw.c
@@ -250,7 +250,7 @@ static struct file_operations serio_raw_fops = {
250 *********************************************************************/ 250 *********************************************************************/
251 251
252static irqreturn_t serio_raw_interrupt(struct serio *serio, unsigned char data, 252static irqreturn_t serio_raw_interrupt(struct serio *serio, unsigned char data,
253 unsigned int dfl, struct pt_regs *regs) 253 unsigned int dfl)
254{ 254{
255 struct serio_raw *serio_raw = serio_get_drvdata(serio); 255 struct serio_raw *serio_raw = serio_get_drvdata(serio);
256 struct serio_raw_list *list; 256 struct serio_raw_list *list;
diff --git a/drivers/input/serio/serport.c b/drivers/input/serio/serport.c
index 54a680cc704d..e1a3a79ab3f9 100644
--- a/drivers/input/serio/serport.c
+++ b/drivers/input/serio/serport.c
@@ -117,9 +117,6 @@ static void serport_ldisc_close(struct tty_struct *tty)
117 * serport_ldisc_receive() is called by the low level tty driver when characters 117 * serport_ldisc_receive() is called by the low level tty driver when characters
118 * are ready for us. We forward the characters, one by one to the 'interrupt' 118 * are ready for us. We forward the characters, one by one to the 'interrupt'
119 * routine. 119 * routine.
120 *
121 * FIXME: We should get pt_regs from the tty layer and forward them to
122 * serio_interrupt here.
123 */ 120 */
124 121
125static void serport_ldisc_receive(struct tty_struct *tty, const unsigned char *cp, char *fp, int count) 122static void serport_ldisc_receive(struct tty_struct *tty, const unsigned char *cp, char *fp, int count)
@@ -134,7 +131,7 @@ static void serport_ldisc_receive(struct tty_struct *tty, const unsigned char *c
134 goto out; 131 goto out;
135 132
136 for (i = 0; i < count; i++) 133 for (i = 0; i < count; i++)
137 serio_interrupt(serport->serio, cp[i], 0, NULL); 134 serio_interrupt(serport->serio, cp[i], 0);
138 135
139out: 136out:
140 spin_unlock_irqrestore(&serport->lock, flags); 137 spin_unlock_irqrestore(&serport->lock, flags);