diff options
Diffstat (limited to 'drivers/input/serio')
-rw-r--r-- | drivers/input/serio/Kconfig | 2 | ||||
-rw-r--r-- | drivers/input/serio/i8042-x86ia64io.h | 14 | ||||
-rw-r--r-- | drivers/input/serio/i8042.c | 60 | ||||
-rw-r--r-- | drivers/input/serio/serio.c | 42 | ||||
-rw-r--r-- | drivers/input/serio/serio_raw.c | 1 |
5 files changed, 74 insertions, 45 deletions
diff --git a/drivers/input/serio/Kconfig b/drivers/input/serio/Kconfig index b3710733b36b..98acf170252c 100644 --- a/drivers/input/serio/Kconfig +++ b/drivers/input/serio/Kconfig | |||
@@ -175,7 +175,7 @@ config SERIO_RAW | |||
175 | allocating minor 1 (that historically corresponds to /dev/psaux) | 175 | allocating minor 1 (that historically corresponds to /dev/psaux) |
176 | first. To bind this driver to a serio port use sysfs interface: | 176 | first. To bind this driver to a serio port use sysfs interface: |
177 | 177 | ||
178 | echo -n "serio_raw" > /sys/bus/serio/devices/serioX/driver | 178 | echo -n "serio_raw" > /sys/bus/serio/devices/serioX/drvctl |
179 | 179 | ||
180 | To compile this driver as a module, choose M here: the | 180 | To compile this driver as a module, choose M here: the |
181 | module will be called serio_raw. | 181 | module will be called serio_raw. |
diff --git a/drivers/input/serio/i8042-x86ia64io.h b/drivers/input/serio/i8042-x86ia64io.h index 0487ecbb8a49..03877c84e6ff 100644 --- a/drivers/input/serio/i8042-x86ia64io.h +++ b/drivers/input/serio/i8042-x86ia64io.h | |||
@@ -131,12 +131,26 @@ static struct dmi_system_id __initdata i8042_dmi_nomux_table[] = { | |||
131 | }, | 131 | }, |
132 | }, | 132 | }, |
133 | { | 133 | { |
134 | .ident = "Fujitsu-Siemens Lifebook T3010", | ||
135 | .matches = { | ||
136 | DMI_MATCH(DMI_SYS_VENDOR, "FUJITSU SIEMENS"), | ||
137 | DMI_MATCH(DMI_PRODUCT_NAME, "LIFEBOOK T3010"), | ||
138 | }, | ||
139 | }, | ||
140 | { | ||
134 | .ident = "Toshiba P10", | 141 | .ident = "Toshiba P10", |
135 | .matches = { | 142 | .matches = { |
136 | DMI_MATCH(DMI_SYS_VENDOR, "TOSHIBA"), | 143 | DMI_MATCH(DMI_SYS_VENDOR, "TOSHIBA"), |
137 | DMI_MATCH(DMI_PRODUCT_NAME, "Satellite P10"), | 144 | DMI_MATCH(DMI_PRODUCT_NAME, "Satellite P10"), |
138 | }, | 145 | }, |
139 | }, | 146 | }, |
147 | { | ||
148 | .ident = "Alienware Sentia", | ||
149 | .matches = { | ||
150 | DMI_MATCH(DMI_SYS_VENDOR, "ALIENWARE"), | ||
151 | DMI_MATCH(DMI_PRODUCT_NAME, "Sentia"), | ||
152 | }, | ||
153 | }, | ||
140 | { } | 154 | { } |
141 | }; | 155 | }; |
142 | 156 | ||
diff --git a/drivers/input/serio/i8042.c b/drivers/input/serio/i8042.c index a9bf549c8dc5..708a1d3beab9 100644 --- a/drivers/input/serio/i8042.c +++ b/drivers/input/serio/i8042.c | |||
@@ -100,7 +100,7 @@ struct i8042_port { | |||
100 | static struct i8042_port i8042_ports[I8042_NUM_PORTS] = { | 100 | static struct i8042_port i8042_ports[I8042_NUM_PORTS] = { |
101 | { | 101 | { |
102 | .disable = I8042_CTR_KBDDIS, | 102 | .disable = I8042_CTR_KBDDIS, |
103 | .irqen = I8042_CTR_KBDINT, | 103 | .irqen = I8042_CTR_KBDINT, |
104 | .mux = -1, | 104 | .mux = -1, |
105 | .name = "KBD", | 105 | .name = "KBD", |
106 | }, | 106 | }, |
@@ -191,41 +191,45 @@ static int i8042_flush(void) | |||
191 | static int i8042_command(unsigned char *param, int command) | 191 | static int i8042_command(unsigned char *param, int command) |
192 | { | 192 | { |
193 | unsigned long flags; | 193 | unsigned long flags; |
194 | int retval = 0, i = 0; | 194 | int i, retval, auxerr = 0; |
195 | 195 | ||
196 | if (i8042_noloop && command == I8042_CMD_AUX_LOOP) | 196 | if (i8042_noloop && command == I8042_CMD_AUX_LOOP) |
197 | return -1; | 197 | return -1; |
198 | 198 | ||
199 | spin_lock_irqsave(&i8042_lock, flags); | 199 | spin_lock_irqsave(&i8042_lock, flags); |
200 | 200 | ||
201 | retval = i8042_wait_write(); | 201 | if ((retval = i8042_wait_write())) |
202 | if (!retval) { | 202 | goto out; |
203 | dbg("%02x -> i8042 (command)", command & 0xff); | 203 | |
204 | i8042_write_command(command & 0xff); | 204 | dbg("%02x -> i8042 (command)", command & 0xff); |
205 | i8042_write_command(command & 0xff); | ||
206 | |||
207 | for (i = 0; i < ((command >> 12) & 0xf); i++) { | ||
208 | if ((retval = i8042_wait_write())) | ||
209 | goto out; | ||
210 | dbg("%02x -> i8042 (parameter)", param[i]); | ||
211 | i8042_write_data(param[i]); | ||
205 | } | 212 | } |
206 | 213 | ||
207 | if (!retval) | 214 | for (i = 0; i < ((command >> 8) & 0xf); i++) { |
208 | for (i = 0; i < ((command >> 12) & 0xf); i++) { | 215 | if ((retval = i8042_wait_read())) |
209 | if ((retval = i8042_wait_write())) break; | 216 | goto out; |
210 | dbg("%02x -> i8042 (parameter)", param[i]); | ||
211 | i8042_write_data(param[i]); | ||
212 | } | ||
213 | 217 | ||
214 | if (!retval) | 218 | if (command == I8042_CMD_AUX_LOOP && |
215 | for (i = 0; i < ((command >> 8) & 0xf); i++) { | 219 | !(i8042_read_status() & I8042_STR_AUXDATA)) { |
216 | if ((retval = i8042_wait_read())) break; | 220 | retval = auxerr = -1; |
217 | if (i8042_read_status() & I8042_STR_AUXDATA) | 221 | goto out; |
218 | param[i] = ~i8042_read_data(); | ||
219 | else | ||
220 | param[i] = i8042_read_data(); | ||
221 | dbg("%02x <- i8042 (return)", param[i]); | ||
222 | } | 222 | } |
223 | 223 | ||
224 | spin_unlock_irqrestore(&i8042_lock, flags); | 224 | param[i] = i8042_read_data(); |
225 | dbg("%02x <- i8042 (return)", param[i]); | ||
226 | } | ||
225 | 227 | ||
226 | if (retval) | 228 | if (retval) |
227 | dbg(" -- i8042 (timeout)"); | 229 | dbg(" -- i8042 (%s)", auxerr ? "auxerr" : "timeout"); |
228 | 230 | ||
231 | out: | ||
232 | spin_unlock_irqrestore(&i8042_lock, flags); | ||
229 | return retval; | 233 | return retval; |
230 | } | 234 | } |
231 | 235 | ||
@@ -507,17 +511,17 @@ static int i8042_set_mux_mode(unsigned int mode, unsigned char *mux_version) | |||
507 | */ | 511 | */ |
508 | 512 | ||
509 | param = 0xf0; | 513 | param = 0xf0; |
510 | if (i8042_command(¶m, I8042_CMD_AUX_LOOP) || param != 0x0f) | 514 | if (i8042_command(¶m, I8042_CMD_AUX_LOOP) || param != 0xf0) |
511 | return -1; | 515 | return -1; |
512 | param = mode ? 0x56 : 0xf6; | 516 | param = mode ? 0x56 : 0xf6; |
513 | if (i8042_command(¶m, I8042_CMD_AUX_LOOP) || param != (mode ? 0xa9 : 0x09)) | 517 | if (i8042_command(¶m, I8042_CMD_AUX_LOOP) || param != (mode ? 0x56 : 0xf6)) |
514 | return -1; | 518 | return -1; |
515 | param = mode ? 0xa4 : 0xa5; | 519 | param = mode ? 0xa4 : 0xa5; |
516 | if (i8042_command(¶m, I8042_CMD_AUX_LOOP) || param == (mode ? 0x5b : 0x5a)) | 520 | if (i8042_command(¶m, I8042_CMD_AUX_LOOP) || param == (mode ? 0xa4 : 0xa5)) |
517 | return -1; | 521 | return -1; |
518 | 522 | ||
519 | if (mux_version) | 523 | if (mux_version) |
520 | *mux_version = ~param; | 524 | *mux_version = param; |
521 | 525 | ||
522 | return 0; | 526 | return 0; |
523 | } | 527 | } |
@@ -619,7 +623,7 @@ static int __init i8042_check_aux(void) | |||
619 | */ | 623 | */ |
620 | 624 | ||
621 | param = 0x5a; | 625 | param = 0x5a; |
622 | if (i8042_command(¶m, I8042_CMD_AUX_LOOP) || param != 0xa5) { | 626 | if (i8042_command(¶m, I8042_CMD_AUX_LOOP) || param != 0x5a) { |
623 | 627 | ||
624 | /* | 628 | /* |
625 | * External connection test - filters out AT-soldered PS/2 i8042's | 629 | * External connection test - filters out AT-soldered PS/2 i8042's |
@@ -630,7 +634,7 @@ static int __init i8042_check_aux(void) | |||
630 | */ | 634 | */ |
631 | 635 | ||
632 | if (i8042_command(¶m, I8042_CMD_AUX_TEST) | 636 | if (i8042_command(¶m, I8042_CMD_AUX_TEST) |
633 | || (param && param != 0xfa && param != 0xff)) | 637 | || (param && param != 0xfa && param != 0xff)) |
634 | return -1; | 638 | return -1; |
635 | } | 639 | } |
636 | 640 | ||
diff --git a/drivers/input/serio/serio.c b/drivers/input/serio/serio.c index f367695e69b5..edd15db17715 100644 --- a/drivers/input/serio/serio.c +++ b/drivers/input/serio/serio.c | |||
@@ -389,6 +389,14 @@ static ssize_t serio_show_description(struct device *dev, struct device_attribut | |||
389 | return sprintf(buf, "%s\n", serio->name); | 389 | return sprintf(buf, "%s\n", serio->name); |
390 | } | 390 | } |
391 | 391 | ||
392 | static ssize_t serio_show_modalias(struct device *dev, struct device_attribute *attr, char *buf) | ||
393 | { | ||
394 | struct serio *serio = to_serio_port(dev); | ||
395 | |||
396 | return sprintf(buf, "serio:ty%02Xpr%02Xid%02Xex%02X\n", | ||
397 | serio->id.type, serio->id.proto, serio->id.id, serio->id.extra); | ||
398 | } | ||
399 | |||
392 | static ssize_t serio_show_id_type(struct device *dev, struct device_attribute *attr, char *buf) | 400 | static ssize_t serio_show_id_type(struct device *dev, struct device_attribute *attr, char *buf) |
393 | { | 401 | { |
394 | struct serio *serio = to_serio_port(dev); | 402 | struct serio *serio = to_serio_port(dev); |
@@ -487,6 +495,7 @@ static ssize_t serio_set_bind_mode(struct device *dev, struct device_attribute * | |||
487 | 495 | ||
488 | static struct device_attribute serio_device_attrs[] = { | 496 | static struct device_attribute serio_device_attrs[] = { |
489 | __ATTR(description, S_IRUGO, serio_show_description, NULL), | 497 | __ATTR(description, S_IRUGO, serio_show_description, NULL), |
498 | __ATTR(modalias, S_IRUGO, serio_show_modalias, NULL), | ||
490 | __ATTR(drvctl, S_IWUSR, NULL, serio_rebind_driver), | 499 | __ATTR(drvctl, S_IWUSR, NULL, serio_rebind_driver), |
491 | __ATTR(bind_mode, S_IWUSR | S_IRUGO, serio_show_bind_mode, serio_set_bind_mode), | 500 | __ATTR(bind_mode, S_IWUSR | S_IRUGO, serio_show_bind_mode, serio_set_bind_mode), |
492 | __ATTR_NULL | 501 | __ATTR_NULL |
@@ -785,36 +794,37 @@ static int serio_bus_match(struct device *dev, struct device_driver *drv) | |||
785 | 794 | ||
786 | #ifdef CONFIG_HOTPLUG | 795 | #ifdef CONFIG_HOTPLUG |
787 | 796 | ||
788 | #define PUT_ENVP(fmt, val) \ | 797 | #define SERIO_ADD_HOTPLUG_VAR(fmt, val...) \ |
789 | do { \ | 798 | do { \ |
790 | envp[i++] = buffer; \ | 799 | int err = add_hotplug_env_var(envp, num_envp, &i, \ |
791 | length += snprintf(buffer, buffer_size - length, fmt, val); \ | 800 | buffer, buffer_size, &len, \ |
792 | if (buffer_size - length <= 0 || i >= num_envp) \ | 801 | fmt, val); \ |
793 | return -ENOMEM; \ | 802 | if (err) \ |
794 | length++; \ | 803 | return err; \ |
795 | buffer += length; \ | 804 | } while (0) |
796 | } while (0) | 805 | |
797 | static int serio_hotplug(struct device *dev, char **envp, int num_envp, char *buffer, int buffer_size) | 806 | static int serio_hotplug(struct device *dev, char **envp, int num_envp, char *buffer, int buffer_size) |
798 | { | 807 | { |
799 | struct serio *serio; | 808 | struct serio *serio; |
800 | int i = 0; | 809 | int i = 0; |
801 | int length = 0; | 810 | int len = 0; |
802 | 811 | ||
803 | if (!dev) | 812 | if (!dev) |
804 | return -ENODEV; | 813 | return -ENODEV; |
805 | 814 | ||
806 | serio = to_serio_port(dev); | 815 | serio = to_serio_port(dev); |
807 | 816 | ||
808 | PUT_ENVP("SERIO_TYPE=%02x", serio->id.type); | 817 | SERIO_ADD_HOTPLUG_VAR("SERIO_TYPE=%02x", serio->id.type); |
809 | PUT_ENVP("SERIO_PROTO=%02x", serio->id.proto); | 818 | SERIO_ADD_HOTPLUG_VAR("SERIO_PROTO=%02x", serio->id.proto); |
810 | PUT_ENVP("SERIO_ID=%02x", serio->id.id); | 819 | SERIO_ADD_HOTPLUG_VAR("SERIO_ID=%02x", serio->id.id); |
811 | PUT_ENVP("SERIO_EXTRA=%02x", serio->id.extra); | 820 | SERIO_ADD_HOTPLUG_VAR("SERIO_EXTRA=%02x", serio->id.extra); |
812 | 821 | SERIO_ADD_HOTPLUG_VAR("MODALIAS=serio:ty%02Xpr%02Xid%02Xex%02X", | |
822 | serio->id.type, serio->id.proto, serio->id.id, serio->id.extra); | ||
813 | envp[i] = NULL; | 823 | envp[i] = NULL; |
814 | 824 | ||
815 | return 0; | 825 | return 0; |
816 | } | 826 | } |
817 | #undef PUT_ENVP | 827 | #undef SERIO_ADD_HOTPLUG_VAR |
818 | 828 | ||
819 | #else | 829 | #else |
820 | 830 | ||
diff --git a/drivers/input/serio/serio_raw.c b/drivers/input/serio/serio_raw.c index d914e7e93db4..47e08de18d07 100644 --- a/drivers/input/serio/serio_raw.c +++ b/drivers/input/serio/serio_raw.c | |||
@@ -299,6 +299,7 @@ static int serio_raw_connect(struct serio *serio, struct serio_driver *drv) | |||
299 | 299 | ||
300 | serio_raw->dev.minor = PSMOUSE_MINOR; | 300 | serio_raw->dev.minor = PSMOUSE_MINOR; |
301 | serio_raw->dev.name = serio_raw->name; | 301 | serio_raw->dev.name = serio_raw->name; |
302 | serio_raw->dev.dev = &serio->dev; | ||
302 | serio_raw->dev.fops = &serio_raw_fops; | 303 | serio_raw->dev.fops = &serio_raw_fops; |
303 | 304 | ||
304 | err = misc_register(&serio_raw->dev); | 305 | err = misc_register(&serio_raw->dev); |