aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/input/serio
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/serio
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/serio')
-rw-r--r--drivers/input/serio/gscps2.c13
-rw-r--r--drivers/input/serio/hil_mlc.c14
2 files changed, 17 insertions, 10 deletions
diff --git a/drivers/input/serio/gscps2.c b/drivers/input/serio/gscps2.c
index 9790d7169a53..a7b0de0f92b2 100644
--- a/drivers/input/serio/gscps2.c
+++ b/drivers/input/serio/gscps2.c
@@ -211,9 +211,6 @@ static void gscps2_reset(struct gscps2port *ps2port)
211 writeb(0xff, addr+GSC_RESET); 211 writeb(0xff, addr+GSC_RESET);
212 gscps2_flush(ps2port); 212 gscps2_flush(ps2port);
213 spin_unlock_irqrestore(&ps2port->lock, flags); 213 spin_unlock_irqrestore(&ps2port->lock, flags);
214
215 /* enable it */
216 gscps2_enable(ps2port, ENABLE);
217} 214}
218 215
219static LIST_HEAD(ps2port_list); 216static LIST_HEAD(ps2port_list);
@@ -307,6 +304,9 @@ static int gscps2_open(struct serio *port)
307 304
308 gscps2_reset(ps2port); 305 gscps2_reset(ps2port);
309 306
307 /* enable it */
308 gscps2_enable(ps2port, ENABLE);
309
310 gscps2_interrupt(0, NULL, NULL); 310 gscps2_interrupt(0, NULL, NULL);
311 311
312 return 0; 312 return 0;
@@ -370,8 +370,6 @@ static int __init gscps2_probe(struct parisc_device *dev)
370 serio->port_data = ps2port; 370 serio->port_data = ps2port;
371 serio->dev.parent = &dev->dev; 371 serio->dev.parent = &dev->dev;
372 372
373 list_add_tail(&ps2port->node, &ps2port_list);
374
375 ret = -EBUSY; 373 ret = -EBUSY;
376 if (request_irq(dev->irq, gscps2_interrupt, SA_SHIRQ, ps2port->port->name, ps2port)) 374 if (request_irq(dev->irq, gscps2_interrupt, SA_SHIRQ, ps2port->port->name, ps2port))
377 goto fail_miserably; 375 goto fail_miserably;
@@ -396,15 +394,16 @@ static int __init gscps2_probe(struct parisc_device *dev)
396 394
397 serio_register_port(ps2port->port); 395 serio_register_port(ps2port->port);
398 396
397 list_add_tail(&ps2port->node, &ps2port_list);
398
399 return 0; 399 return 0;
400 400
401fail: 401fail:
402 free_irq(dev->irq, ps2port); 402 free_irq(dev->irq, ps2port);
403 403
404fail_miserably: 404fail_miserably:
405 list_del(&ps2port->node);
406 iounmap(ps2port->addr); 405 iounmap(ps2port->addr);
407 release_mem_region(dev->hpa, GSC_STATUS + 4); 406 release_mem_region(dev->hpa.start, GSC_STATUS + 4);
408 407
409fail_nomem: 408fail_nomem:
410 kfree(ps2port); 409 kfree(ps2port);
diff --git a/drivers/input/serio/hil_mlc.c b/drivers/input/serio/hil_mlc.c
index c243cb6fdfc4..5704204964a3 100644
--- a/drivers/input/serio/hil_mlc.c
+++ b/drivers/input/serio/hil_mlc.c
@@ -801,7 +801,8 @@ static int hil_mlc_serio_open(struct serio *serio) {
801 struct hil_mlc_serio_map *map; 801 struct hil_mlc_serio_map *map;
802 struct hil_mlc *mlc; 802 struct hil_mlc *mlc;
803 803
804 if (serio->private != NULL) return -EBUSY; 804 if (serio_get_drvdata(serio) != NULL)
805 return -EBUSY;
805 806
806 map = serio->port_data; 807 map = serio->port_data;
807 if (map == NULL) { 808 if (map == NULL) {
@@ -832,11 +833,18 @@ static void hil_mlc_serio_close(struct serio *serio) {
832 return; 833 return;
833 } 834 }
834 835
835 serio->private = NULL; 836 serio_set_drvdata(serio, NULL);
836 serio->drv = NULL; 837 serio->drv = NULL;
837 /* TODO wake up interruptable */ 838 /* TODO wake up interruptable */
838} 839}
839 840
841static struct serio_device_id hil_mlc_serio_id = {
842 .type = SERIO_HIL_MLC,
843 .proto = SERIO_HIL,
844 .extra = SERIO_ANY,
845 .id = SERIO_ANY,
846};
847
840int hil_mlc_register(hil_mlc *mlc) { 848int hil_mlc_register(hil_mlc *mlc) {
841 int i; 849 int i;
842 unsigned long flags; 850 unsigned long flags;
@@ -867,7 +875,7 @@ int hil_mlc_register(hil_mlc *mlc) {
867 mlc_serio = kmalloc(sizeof(*mlc_serio), GFP_KERNEL); 875 mlc_serio = kmalloc(sizeof(*mlc_serio), GFP_KERNEL);
868 mlc->serio[i] = mlc_serio; 876 mlc->serio[i] = mlc_serio;
869 memset(mlc_serio, 0, sizeof(*mlc_serio)); 877 memset(mlc_serio, 0, sizeof(*mlc_serio));
870 mlc_serio->type = SERIO_HIL | SERIO_HIL_MLC; 878 mlc_serio->id = hil_mlc_serio_id;
871 mlc_serio->write = hil_mlc_serio_write; 879 mlc_serio->write = hil_mlc_serio_write;
872 mlc_serio->open = hil_mlc_serio_open; 880 mlc_serio->open = hil_mlc_serio_open;
873 mlc_serio->close = hil_mlc_serio_close; 881 mlc_serio->close = hil_mlc_serio_close;