diff options
author | Dmitry Torokhov <dtor@insightbb.com> | 2007-05-01 00:24:54 -0400 |
---|---|---|
committer | Dmitry Torokhov <dtor@insightbb.com> | 2007-05-01 00:24:54 -0400 |
commit | bc95f3669f5e6f63cf0b84fe4922c3c6dd4aa775 (patch) | |
tree | 427fcf2a7287c16d4b5aa6cbf494d59579a6a8b1 /drivers/input | |
parent | 3d29cdff999c37b3876082278a8134a0642a02cd (diff) | |
parent | dc87c3985e9b442c60994308a96f887579addc39 (diff) |
Merge master.kernel.org:/pub/scm/linux/kernel/git/torvalds/linux-2.6
Conflicts:
drivers/usb/input/Makefile
drivers/usb/input/gtco.c
Diffstat (limited to 'drivers/input')
-rw-r--r-- | drivers/input/gameport/gameport.c | 39 | ||||
-rw-r--r-- | drivers/input/keyboard/Kconfig | 10 | ||||
-rw-r--r-- | drivers/input/keyboard/gpio_keys.c | 4 | ||||
-rw-r--r-- | drivers/input/serio/i8042.c | 10 | ||||
-rw-r--r-- | drivers/input/serio/libps2.c | 2 | ||||
-rw-r--r-- | drivers/input/serio/serio.c | 41 | ||||
-rw-r--r-- | drivers/input/touchscreen/ucb1400_ts.c | 1 |
7 files changed, 45 insertions, 62 deletions
diff --git a/drivers/input/gameport/gameport.c b/drivers/input/gameport/gameport.c index a00fe470a829..bd686a2a517d 100644 --- a/drivers/input/gameport/gameport.c +++ b/drivers/input/gameport/gameport.c | |||
@@ -190,16 +190,14 @@ static void gameport_run_poll_handler(unsigned long d) | |||
190 | * Basic gameport -> driver core mappings | 190 | * Basic gameport -> driver core mappings |
191 | */ | 191 | */ |
192 | 192 | ||
193 | static void gameport_bind_driver(struct gameport *gameport, struct gameport_driver *drv) | 193 | static int gameport_bind_driver(struct gameport *gameport, struct gameport_driver *drv) |
194 | { | 194 | { |
195 | int error; | 195 | int error; |
196 | 196 | ||
197 | down_write(&gameport_bus.subsys.rwsem); | ||
198 | |||
199 | gameport->dev.driver = &drv->driver; | 197 | gameport->dev.driver = &drv->driver; |
200 | if (drv->connect(gameport, drv)) { | 198 | if (drv->connect(gameport, drv)) { |
201 | gameport->dev.driver = NULL; | 199 | gameport->dev.driver = NULL; |
202 | goto out; | 200 | return -ENODEV; |
203 | } | 201 | } |
204 | 202 | ||
205 | error = device_bind_driver(&gameport->dev); | 203 | error = device_bind_driver(&gameport->dev); |
@@ -211,31 +209,21 @@ static void gameport_bind_driver(struct gameport *gameport, struct gameport_driv | |||
211 | drv->description, error); | 209 | drv->description, error); |
212 | drv->disconnect(gameport); | 210 | drv->disconnect(gameport); |
213 | gameport->dev.driver = NULL; | 211 | gameport->dev.driver = NULL; |
214 | goto out; | 212 | return error; |
215 | } | 213 | } |
216 | 214 | ||
217 | out: | 215 | return 0; |
218 | up_write(&gameport_bus.subsys.rwsem); | ||
219 | } | ||
220 | |||
221 | static void gameport_release_driver(struct gameport *gameport) | ||
222 | { | ||
223 | down_write(&gameport_bus.subsys.rwsem); | ||
224 | device_release_driver(&gameport->dev); | ||
225 | up_write(&gameport_bus.subsys.rwsem); | ||
226 | } | 216 | } |
227 | 217 | ||
228 | static void gameport_find_driver(struct gameport *gameport) | 218 | static void gameport_find_driver(struct gameport *gameport) |
229 | { | 219 | { |
230 | int error; | 220 | int error; |
231 | 221 | ||
232 | down_write(&gameport_bus.subsys.rwsem); | ||
233 | error = device_attach(&gameport->dev); | 222 | error = device_attach(&gameport->dev); |
234 | if (error < 0) | 223 | if (error < 0) |
235 | printk(KERN_WARNING | 224 | printk(KERN_WARNING |
236 | "gameport: device_attach() failed for %s (%s), error: %d\n", | 225 | "gameport: device_attach() failed for %s (%s), error: %d\n", |
237 | gameport->phys, gameport->name, error); | 226 | gameport->phys, gameport->name, error); |
238 | up_write(&gameport_bus.subsys.rwsem); | ||
239 | } | 227 | } |
240 | 228 | ||
241 | 229 | ||
@@ -483,13 +471,12 @@ static ssize_t gameport_rebind_driver(struct device *dev, struct device_attribut | |||
483 | { | 471 | { |
484 | struct gameport *gameport = to_gameport_port(dev); | 472 | struct gameport *gameport = to_gameport_port(dev); |
485 | struct device_driver *drv; | 473 | struct device_driver *drv; |
486 | int retval; | 474 | int error; |
487 | 475 | ||
488 | retval = mutex_lock_interruptible(&gameport_mutex); | 476 | error = mutex_lock_interruptible(&gameport_mutex); |
489 | if (retval) | 477 | if (error) |
490 | return retval; | 478 | return error; |
491 | 479 | ||
492 | retval = count; | ||
493 | if (!strncmp(buf, "none", count)) { | 480 | if (!strncmp(buf, "none", count)) { |
494 | gameport_disconnect_port(gameport); | 481 | gameport_disconnect_port(gameport); |
495 | } else if (!strncmp(buf, "reconnect", count)) { | 482 | } else if (!strncmp(buf, "reconnect", count)) { |
@@ -499,15 +486,15 @@ static ssize_t gameport_rebind_driver(struct device *dev, struct device_attribut | |||
499 | gameport_find_driver(gameport); | 486 | gameport_find_driver(gameport); |
500 | } else if ((drv = driver_find(buf, &gameport_bus)) != NULL) { | 487 | } else if ((drv = driver_find(buf, &gameport_bus)) != NULL) { |
501 | gameport_disconnect_port(gameport); | 488 | gameport_disconnect_port(gameport); |
502 | gameport_bind_driver(gameport, to_gameport_driver(drv)); | 489 | error = gameport_bind_driver(gameport, to_gameport_driver(drv)); |
503 | put_driver(drv); | 490 | put_driver(drv); |
504 | } else { | 491 | } else { |
505 | retval = -EINVAL; | 492 | error = -EINVAL; |
506 | } | 493 | } |
507 | 494 | ||
508 | mutex_unlock(&gameport_mutex); | 495 | mutex_unlock(&gameport_mutex); |
509 | 496 | ||
510 | return retval; | 497 | return error ? error : count; |
511 | } | 498 | } |
512 | 499 | ||
513 | static struct device_attribute gameport_device_attrs[] = { | 500 | static struct device_attribute gameport_device_attrs[] = { |
@@ -655,7 +642,7 @@ static void gameport_disconnect_port(struct gameport *gameport) | |||
655 | do { | 642 | do { |
656 | parent = s->parent; | 643 | parent = s->parent; |
657 | 644 | ||
658 | gameport_release_driver(s); | 645 | device_release_driver(&s->dev); |
659 | gameport_destroy_port(s); | 646 | gameport_destroy_port(s); |
660 | } while ((s = parent) != gameport); | 647 | } while ((s = parent) != gameport); |
661 | } | 648 | } |
@@ -663,7 +650,7 @@ static void gameport_disconnect_port(struct gameport *gameport) | |||
663 | /* | 650 | /* |
664 | * Ok, no children left, now disconnect this port | 651 | * Ok, no children left, now disconnect this port |
665 | */ | 652 | */ |
666 | gameport_release_driver(gameport); | 653 | device_release_driver(&gameport->dev); |
667 | } | 654 | } |
668 | 655 | ||
669 | void gameport_rescan(struct gameport *gameport) | 656 | void gameport_rescan(struct gameport *gameport) |
diff --git a/drivers/input/keyboard/Kconfig b/drivers/input/keyboard/Kconfig index be65e50e7a33..e2851725646a 100644 --- a/drivers/input/keyboard/Kconfig +++ b/drivers/input/keyboard/Kconfig | |||
@@ -224,14 +224,16 @@ config KEYBOARD_AAED2000 | |||
224 | module will be called aaed2000_kbd. | 224 | module will be called aaed2000_kbd. |
225 | 225 | ||
226 | config KEYBOARD_GPIO | 226 | config KEYBOARD_GPIO |
227 | tristate "Buttons on CPU GPIOs (PXA)" | 227 | tristate "GPIO Buttons" |
228 | depends on (ARCH_SA1100 || ARCH_PXA || ARCH_S3C2410) | 228 | depends on GENERIC_GPIO |
229 | help | 229 | help |
230 | This driver implements support for buttons connected | 230 | This driver implements support for buttons connected |
231 | directly to GPIO pins of SA1100, PXA or S3C24xx CPUs. | 231 | to GPIO pins of various CPUs (and some other chips). |
232 | 232 | ||
233 | Say Y here if your device has buttons connected | 233 | Say Y here if your device has buttons connected |
234 | directly to GPIO pins of the CPU. | 234 | directly to such GPIO pins. Your board-specific |
235 | setup logic must also provide a platform device, | ||
236 | with configuration data saying which GPIOs are used. | ||
235 | 237 | ||
236 | To compile this driver as a module, choose M here: the | 238 | To compile this driver as a module, choose M here: the |
237 | module will be called gpio-keys. | 239 | module will be called gpio-keys. |
diff --git a/drivers/input/keyboard/gpio_keys.c b/drivers/input/keyboard/gpio_keys.c index 71771ba61230..0d2796cdf738 100644 --- a/drivers/input/keyboard/gpio_keys.c +++ b/drivers/input/keyboard/gpio_keys.c | |||
@@ -23,11 +23,9 @@ | |||
23 | #include <linux/platform_device.h> | 23 | #include <linux/platform_device.h> |
24 | #include <linux/input.h> | 24 | #include <linux/input.h> |
25 | #include <linux/irq.h> | 25 | #include <linux/irq.h> |
26 | #include <linux/gpio_keys.h> | ||
26 | 27 | ||
27 | #include <asm/gpio.h> | 28 | #include <asm/gpio.h> |
28 | #include <asm/arch/hardware.h> | ||
29 | |||
30 | #include <asm/hardware/gpio_keys.h> | ||
31 | 29 | ||
32 | static irqreturn_t gpio_keys_isr(int irq, void *dev_id) | 30 | static irqreturn_t gpio_keys_isr(int irq, void *dev_id) |
33 | { | 31 | { |
diff --git a/drivers/input/serio/i8042.c b/drivers/input/serio/i8042.c index ff40b5cbbf3f..7c17377a65b9 100644 --- a/drivers/input/serio/i8042.c +++ b/drivers/input/serio/i8042.c | |||
@@ -553,7 +553,8 @@ static int __devinit i8042_check_aux(void) | |||
553 | */ | 553 | */ |
554 | 554 | ||
555 | param = 0x5a; | 555 | param = 0x5a; |
556 | if (i8042_command(¶m, I8042_CMD_AUX_LOOP) || param != 0x5a) { | 556 | retval = i8042_command(¶m, I8042_CMD_AUX_LOOP); |
557 | if (retval || param != 0x5a) { | ||
557 | 558 | ||
558 | /* | 559 | /* |
559 | * External connection test - filters out AT-soldered PS/2 i8042's | 560 | * External connection test - filters out AT-soldered PS/2 i8042's |
@@ -567,7 +568,12 @@ static int __devinit i8042_check_aux(void) | |||
567 | (param && param != 0xfa && param != 0xff)) | 568 | (param && param != 0xfa && param != 0xff)) |
568 | return -1; | 569 | return -1; |
569 | 570 | ||
570 | aux_loop_broken = 1; | 571 | /* |
572 | * If AUX_LOOP completed without error but returned unexpected data | ||
573 | * mark it as broken | ||
574 | */ | ||
575 | if (!retval) | ||
576 | aux_loop_broken = 1; | ||
571 | } | 577 | } |
572 | 578 | ||
573 | /* | 579 | /* |
diff --git a/drivers/input/serio/libps2.c b/drivers/input/serio/libps2.c index b3e84d3bb7f7..10d9d74ae43a 100644 --- a/drivers/input/serio/libps2.c +++ b/drivers/input/serio/libps2.c | |||
@@ -97,7 +97,7 @@ EXPORT_SYMBOL(ps2_drain); | |||
97 | 97 | ||
98 | int ps2_is_keyboard_id(char id_byte) | 98 | int ps2_is_keyboard_id(char id_byte) |
99 | { | 99 | { |
100 | const static char keyboard_ids[] = { | 100 | static const char keyboard_ids[] = { |
101 | 0xab, /* Regular keyboards */ | 101 | 0xab, /* Regular keyboards */ |
102 | 0xac, /* NCD Sun keyboard */ | 102 | 0xac, /* NCD Sun keyboard */ |
103 | 0x2b, /* Trust keyboard, translated */ | 103 | 0x2b, /* Trust keyboard, translated */ |
diff --git a/drivers/input/serio/serio.c b/drivers/input/serio/serio.c index a15e531ec755..5895202b972c 100644 --- a/drivers/input/serio/serio.c +++ b/drivers/input/serio/serio.c | |||
@@ -115,18 +115,18 @@ static int serio_match_port(const struct serio_device_id *ids, struct serio *ser | |||
115 | * Basic serio -> driver core mappings | 115 | * Basic serio -> driver core mappings |
116 | */ | 116 | */ |
117 | 117 | ||
118 | static void serio_bind_driver(struct serio *serio, struct serio_driver *drv) | 118 | static int serio_bind_driver(struct serio *serio, struct serio_driver *drv) |
119 | { | 119 | { |
120 | int error; | 120 | int error; |
121 | 121 | ||
122 | down_write(&serio_bus.subsys.rwsem); | ||
123 | |||
124 | if (serio_match_port(drv->id_table, serio)) { | 122 | if (serio_match_port(drv->id_table, serio)) { |
123 | |||
125 | serio->dev.driver = &drv->driver; | 124 | serio->dev.driver = &drv->driver; |
126 | if (serio_connect_driver(serio, drv)) { | 125 | if (serio_connect_driver(serio, drv)) { |
127 | serio->dev.driver = NULL; | 126 | serio->dev.driver = NULL; |
128 | goto out; | 127 | return -ENODEV; |
129 | } | 128 | } |
129 | |||
130 | error = device_bind_driver(&serio->dev); | 130 | error = device_bind_driver(&serio->dev); |
131 | if (error) { | 131 | if (error) { |
132 | printk(KERN_WARNING | 132 | printk(KERN_WARNING |
@@ -136,31 +136,21 @@ static void serio_bind_driver(struct serio *serio, struct serio_driver *drv) | |||
136 | drv->description, error); | 136 | drv->description, error); |
137 | serio_disconnect_driver(serio); | 137 | serio_disconnect_driver(serio); |
138 | serio->dev.driver = NULL; | 138 | serio->dev.driver = NULL; |
139 | goto out; | 139 | return error; |
140 | } | 140 | } |
141 | } | 141 | } |
142 | out: | 142 | return 0; |
143 | up_write(&serio_bus.subsys.rwsem); | ||
144 | } | ||
145 | |||
146 | static void serio_release_driver(struct serio *serio) | ||
147 | { | ||
148 | down_write(&serio_bus.subsys.rwsem); | ||
149 | device_release_driver(&serio->dev); | ||
150 | up_write(&serio_bus.subsys.rwsem); | ||
151 | } | 143 | } |
152 | 144 | ||
153 | static void serio_find_driver(struct serio *serio) | 145 | static void serio_find_driver(struct serio *serio) |
154 | { | 146 | { |
155 | int error; | 147 | int error; |
156 | 148 | ||
157 | down_write(&serio_bus.subsys.rwsem); | ||
158 | error = device_attach(&serio->dev); | 149 | error = device_attach(&serio->dev); |
159 | if (error < 0) | 150 | if (error < 0) |
160 | printk(KERN_WARNING | 151 | printk(KERN_WARNING |
161 | "serio: device_attach() failed for %s (%s), error: %d\n", | 152 | "serio: device_attach() failed for %s (%s), error: %d\n", |
162 | serio->phys, serio->name, error); | 153 | serio->phys, serio->name, error); |
163 | up_write(&serio_bus.subsys.rwsem); | ||
164 | } | 154 | } |
165 | 155 | ||
166 | 156 | ||
@@ -470,13 +460,12 @@ static ssize_t serio_rebind_driver(struct device *dev, struct device_attribute * | |||
470 | { | 460 | { |
471 | struct serio *serio = to_serio_port(dev); | 461 | struct serio *serio = to_serio_port(dev); |
472 | struct device_driver *drv; | 462 | struct device_driver *drv; |
473 | int retval; | 463 | int error; |
474 | 464 | ||
475 | retval = mutex_lock_interruptible(&serio_mutex); | 465 | error = mutex_lock_interruptible(&serio_mutex); |
476 | if (retval) | 466 | if (error) |
477 | return retval; | 467 | return error; |
478 | 468 | ||
479 | retval = count; | ||
480 | if (!strncmp(buf, "none", count)) { | 469 | if (!strncmp(buf, "none", count)) { |
481 | serio_disconnect_port(serio); | 470 | serio_disconnect_port(serio); |
482 | } else if (!strncmp(buf, "reconnect", count)) { | 471 | } else if (!strncmp(buf, "reconnect", count)) { |
@@ -486,15 +475,15 @@ static ssize_t serio_rebind_driver(struct device *dev, struct device_attribute * | |||
486 | serio_find_driver(serio); | 475 | serio_find_driver(serio); |
487 | } else if ((drv = driver_find(buf, &serio_bus)) != NULL) { | 476 | } else if ((drv = driver_find(buf, &serio_bus)) != NULL) { |
488 | serio_disconnect_port(serio); | 477 | serio_disconnect_port(serio); |
489 | serio_bind_driver(serio, to_serio_driver(drv)); | 478 | error = serio_bind_driver(serio, to_serio_driver(drv)); |
490 | put_driver(drv); | 479 | put_driver(drv); |
491 | } else { | 480 | } else { |
492 | retval = -EINVAL; | 481 | error = -EINVAL; |
493 | } | 482 | } |
494 | 483 | ||
495 | mutex_unlock(&serio_mutex); | 484 | mutex_unlock(&serio_mutex); |
496 | 485 | ||
497 | return retval; | 486 | return error ? error : count; |
498 | } | 487 | } |
499 | 488 | ||
500 | static ssize_t serio_show_bind_mode(struct device *dev, struct device_attribute *attr, char *buf) | 489 | static ssize_t serio_show_bind_mode(struct device *dev, struct device_attribute *attr, char *buf) |
@@ -665,7 +654,7 @@ static void serio_disconnect_port(struct serio *serio) | |||
665 | do { | 654 | do { |
666 | parent = s->parent; | 655 | parent = s->parent; |
667 | 656 | ||
668 | serio_release_driver(s); | 657 | device_release_driver(&s->dev); |
669 | serio_destroy_port(s); | 658 | serio_destroy_port(s); |
670 | } while ((s = parent) != serio); | 659 | } while ((s = parent) != serio); |
671 | } | 660 | } |
@@ -673,7 +662,7 @@ static void serio_disconnect_port(struct serio *serio) | |||
673 | /* | 662 | /* |
674 | * Ok, no children left, now disconnect this port | 663 | * Ok, no children left, now disconnect this port |
675 | */ | 664 | */ |
676 | serio_release_driver(serio); | 665 | device_release_driver(&serio->dev); |
677 | } | 666 | } |
678 | 667 | ||
679 | void serio_rescan(struct serio *serio) | 668 | void serio_rescan(struct serio *serio) |
diff --git a/drivers/input/touchscreen/ucb1400_ts.c b/drivers/input/touchscreen/ucb1400_ts.c index 24000f0efeaa..6582816a0477 100644 --- a/drivers/input/touchscreen/ucb1400_ts.c +++ b/drivers/input/touchscreen/ucb1400_ts.c | |||
@@ -557,6 +557,7 @@ static int ucb1400_ts_remove(struct device *dev) | |||
557 | } | 557 | } |
558 | 558 | ||
559 | static struct device_driver ucb1400_ts_driver = { | 559 | static struct device_driver ucb1400_ts_driver = { |
560 | .name = "ucb1400_ts", | ||
560 | .owner = THIS_MODULE, | 561 | .owner = THIS_MODULE, |
561 | .bus = &ac97_bus_type, | 562 | .bus = &ac97_bus_type, |
562 | .probe = ucb1400_ts_probe, | 563 | .probe = ucb1400_ts_probe, |