aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/input/keyboard/hil_kbd.c
diff options
context:
space:
mode:
authorMatthew Wilcox <willy@parisc-linux.org>2005-10-21 22:58:51 -0400
committerKyle McMartin <kyle@parisc-linux.org>2005-10-21 22:58:51 -0400
commit6ab0f5cd364476fe5cb329fd46ee41bea6d4c69c (patch)
treed89c5f47149b443e05345ed8e7c8c9d8960cfa15 /drivers/input/keyboard/hil_kbd.c
parentae8c75c1c47029a64976690c37336a2be6b49778 (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/hil_kbd.c')
-rw-r--r--drivers/input/keyboard/hil_kbd.c28
1 files changed, 20 insertions, 8 deletions
diff --git a/drivers/input/keyboard/hil_kbd.c b/drivers/input/keyboard/hil_kbd.c
index ef78bffed5e..0a90962c38e 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
248static void hil_kbd_connect(struct serio *serio, struct serio_driver *drv) 248static 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
354static 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
353struct serio_driver hil_kbd_serio_drv = { 364struct 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