diff options
author | Matthew Wilcox <willy@parisc-linux.org> | 2005-10-21 22:58:51 -0400 |
---|---|---|
committer | Kyle McMartin <kyle@parisc-linux.org> | 2005-10-21 22:58:51 -0400 |
commit | 6ab0f5cd364476fe5cb329fd46ee41bea6d4c69c (patch) | |
tree | d89c5f47149b443e05345ed8e7c8c9d8960cfa15 /drivers/input/keyboard | |
parent | ae8c75c1c47029a64976690c37336a2be6b49778 (diff) |
[PARISC] Update parisc specific input code from parisc tree
Update drivers to new input layer changes.
Signed-off-by: Helge Deller <deller@parisc-linux.org>
Signed-off-by: Matthew Wilcox <willy@parisc-linux.org>
Reorder code in gscps2_interrupt() and only enable ports when opened.
This fixes issues with hangs booting an SMP kernel on my C360.
Previously serio_interrupt() could be called before the lock in
struct serio was initialised.
Signed-off-by: Richard Hirst <rhirst@parisc-linux.org>
Signed-off-by: Kyle McMartin <kyle@parisc-linux.org>
Diffstat (limited to 'drivers/input/keyboard')
-rw-r--r-- | drivers/input/keyboard/hil_kbd.c | 28 | ||||
-rw-r--r-- | drivers/input/keyboard/hilkbd.c | 2 |
2 files changed, 21 insertions, 9 deletions
diff --git a/drivers/input/keyboard/hil_kbd.c b/drivers/input/keyboard/hil_kbd.c index ef78bffed5e7..0a90962c38e7 100644 --- a/drivers/input/keyboard/hil_kbd.c +++ b/drivers/input/keyboard/hil_kbd.c | |||
@@ -204,7 +204,7 @@ static irqreturn_t hil_kbd_interrupt(struct serio *serio, | |||
204 | hil_packet packet; | 204 | hil_packet packet; |
205 | int idx; | 205 | int idx; |
206 | 206 | ||
207 | kbd = (struct hil_kbd *)serio->private; | 207 | kbd = serio_get_drvdata(serio); |
208 | if (kbd == NULL) { | 208 | if (kbd == NULL) { |
209 | BUG(); | 209 | BUG(); |
210 | return IRQ_HANDLED; | 210 | return IRQ_HANDLED; |
@@ -234,7 +234,7 @@ static void hil_kbd_disconnect(struct serio *serio) | |||
234 | { | 234 | { |
235 | struct hil_kbd *kbd; | 235 | struct hil_kbd *kbd; |
236 | 236 | ||
237 | kbd = (struct hil_kbd *)serio->private; | 237 | kbd = serio_get_drvdata(serio); |
238 | if (kbd == NULL) { | 238 | if (kbd == NULL) { |
239 | BUG(); | 239 | BUG(); |
240 | return; | 240 | return; |
@@ -245,20 +245,20 @@ static void hil_kbd_disconnect(struct serio *serio) | |||
245 | kfree(kbd); | 245 | kfree(kbd); |
246 | } | 246 | } |
247 | 247 | ||
248 | static void hil_kbd_connect(struct serio *serio, struct serio_driver *drv) | 248 | static int hil_kbd_connect(struct serio *serio, struct serio_driver *drv) |
249 | { | 249 | { |
250 | struct hil_kbd *kbd; | 250 | struct hil_kbd *kbd; |
251 | uint8_t did, *idd; | 251 | uint8_t did, *idd; |
252 | int i; | 252 | int i; |
253 | 253 | ||
254 | if (serio->type != (SERIO_HIL_MLC | SERIO_HIL)) return; | 254 | kbd = kmalloc(sizeof(*kbd), GFP_KERNEL); |
255 | 255 | if (!kbd) | |
256 | if (!(kbd = kmalloc(sizeof(struct hil_kbd), GFP_KERNEL))) return; | 256 | return -ENOMEM; |
257 | memset(kbd, 0, sizeof(struct hil_kbd)); | 257 | memset(kbd, 0, sizeof(struct hil_kbd)); |
258 | 258 | ||
259 | if (serio_open(serio, drv)) goto bail0; | 259 | if (serio_open(serio, drv)) goto bail0; |
260 | 260 | ||
261 | serio->private = kbd; | 261 | serio_set_drvdata(serio, kbd); |
262 | kbd->serio = serio; | 262 | kbd->serio = serio; |
263 | kbd->dev.private = kbd; | 263 | kbd->dev.private = kbd; |
264 | 264 | ||
@@ -342,19 +342,31 @@ static void hil_kbd_connect(struct serio *serio, struct serio_driver *drv) | |||
342 | down(&(kbd->sem)); | 342 | down(&(kbd->sem)); |
343 | up(&(kbd->sem)); | 343 | up(&(kbd->sem)); |
344 | 344 | ||
345 | return; | 345 | return 0; |
346 | bail1: | 346 | bail1: |
347 | serio_close(serio); | 347 | serio_close(serio); |
348 | bail0: | 348 | bail0: |
349 | kfree(kbd); | 349 | kfree(kbd); |
350 | serio_set_drvdata(serio, NULL); | ||
351 | return -EIO; | ||
350 | } | 352 | } |
351 | 353 | ||
354 | static struct serio_device_id hil_kbd_ids[] = { | ||
355 | { | ||
356 | .type = SERIO_HIL_MLC, | ||
357 | .proto = SERIO_HIL, | ||
358 | .id = SERIO_ANY, | ||
359 | .extra = SERIO_ANY, | ||
360 | }, | ||
361 | { 0 } | ||
362 | }; | ||
352 | 363 | ||
353 | struct serio_driver hil_kbd_serio_drv = { | 364 | struct serio_driver hil_kbd_serio_drv = { |
354 | .driver = { | 365 | .driver = { |
355 | .name = "hil_kbd", | 366 | .name = "hil_kbd", |
356 | }, | 367 | }, |
357 | .description = "HP HIL keyboard driver", | 368 | .description = "HP HIL keyboard driver", |
369 | .id_table = hil_kbd_ids, | ||
358 | .connect = hil_kbd_connect, | 370 | .connect = hil_kbd_connect, |
359 | .disconnect = hil_kbd_disconnect, | 371 | .disconnect = hil_kbd_disconnect, |
360 | .interrupt = hil_kbd_interrupt | 372 | .interrupt = hil_kbd_interrupt |
diff --git a/drivers/input/keyboard/hilkbd.c b/drivers/input/keyboard/hilkbd.c index e7a1e14f8b0c..e95bc052e32a 100644 --- a/drivers/input/keyboard/hilkbd.c +++ b/drivers/input/keyboard/hilkbd.c | |||
@@ -22,7 +22,7 @@ | |||
22 | #include <linux/errno.h> | 22 | #include <linux/errno.h> |
23 | #include <linux/input.h> | 23 | #include <linux/input.h> |
24 | #include <linux/init.h> | 24 | #include <linux/init.h> |
25 | #include <linux/irq.h> | 25 | #include <linux/interrupt.h> |
26 | #include <linux/hil.h> | 26 | #include <linux/hil.h> |
27 | #include <linux/spinlock.h> | 27 | #include <linux/spinlock.h> |
28 | 28 | ||