aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/input/serio
diff options
context:
space:
mode:
authorDmitry Torokhov <dmitry.torokhov@gmail.com>2014-05-14 19:49:19 -0400
committerDmitry Torokhov <dmitry.torokhov@gmail.com>2014-05-14 19:49:19 -0400
commit879f99ef2c4c05d9a7f0a67a05f1415663119825 (patch)
tree0399664761f675eef741f8b08b92635069586151 /drivers/input/serio
parent70a26071f8552a0f193cf442f424decfe0f2e569 (diff)
parentd6d211db37e75de2ddc3a4f979038c40df7cc79c (diff)
Merge tag 'v3.15-rc5' into next
Merge with Linux 3.15-rc5 to sync up Wacom and other changes.
Diffstat (limited to 'drivers/input/serio')
-rw-r--r--drivers/input/serio/i8042-x86ia64io.h15
-rw-r--r--drivers/input/serio/i8042.c6
-rw-r--r--drivers/input/serio/serio.c14
3 files changed, 35 insertions, 0 deletions
diff --git a/drivers/input/serio/i8042-x86ia64io.h b/drivers/input/serio/i8042-x86ia64io.h
index 0ec9abbe31fe..381b20d4c561 100644
--- a/drivers/input/serio/i8042-x86ia64io.h
+++ b/drivers/input/serio/i8042-x86ia64io.h
@@ -702,6 +702,17 @@ static int i8042_pnp_aux_irq;
702static char i8042_pnp_kbd_name[32]; 702static char i8042_pnp_kbd_name[32];
703static char i8042_pnp_aux_name[32]; 703static char i8042_pnp_aux_name[32];
704 704
705static void i8042_pnp_id_to_string(struct pnp_id *id, char *dst, int dst_size)
706{
707 strlcpy(dst, "PNP:", dst_size);
708
709 while (id) {
710 strlcat(dst, " ", dst_size);
711 strlcat(dst, id->id, dst_size);
712 id = id->next;
713 }
714}
715
705static int i8042_pnp_kbd_probe(struct pnp_dev *dev, const struct pnp_device_id *did) 716static int i8042_pnp_kbd_probe(struct pnp_dev *dev, const struct pnp_device_id *did)
706{ 717{
707 if (pnp_port_valid(dev, 0) && pnp_port_len(dev, 0) == 1) 718 if (pnp_port_valid(dev, 0) && pnp_port_len(dev, 0) == 1)
@@ -718,6 +729,8 @@ static int i8042_pnp_kbd_probe(struct pnp_dev *dev, const struct pnp_device_id *
718 strlcat(i8042_pnp_kbd_name, ":", sizeof(i8042_pnp_kbd_name)); 729 strlcat(i8042_pnp_kbd_name, ":", sizeof(i8042_pnp_kbd_name));
719 strlcat(i8042_pnp_kbd_name, pnp_dev_name(dev), sizeof(i8042_pnp_kbd_name)); 730 strlcat(i8042_pnp_kbd_name, pnp_dev_name(dev), sizeof(i8042_pnp_kbd_name));
720 } 731 }
732 i8042_pnp_id_to_string(dev->id, i8042_kbd_firmware_id,
733 sizeof(i8042_kbd_firmware_id));
721 734
722 /* Keyboard ports are always supposed to be wakeup-enabled */ 735 /* Keyboard ports are always supposed to be wakeup-enabled */
723 device_set_wakeup_enable(&dev->dev, true); 736 device_set_wakeup_enable(&dev->dev, true);
@@ -742,6 +755,8 @@ static int i8042_pnp_aux_probe(struct pnp_dev *dev, const struct pnp_device_id *
742 strlcat(i8042_pnp_aux_name, ":", sizeof(i8042_pnp_aux_name)); 755 strlcat(i8042_pnp_aux_name, ":", sizeof(i8042_pnp_aux_name));
743 strlcat(i8042_pnp_aux_name, pnp_dev_name(dev), sizeof(i8042_pnp_aux_name)); 756 strlcat(i8042_pnp_aux_name, pnp_dev_name(dev), sizeof(i8042_pnp_aux_name));
744 } 757 }
758 i8042_pnp_id_to_string(dev->id, i8042_aux_firmware_id,
759 sizeof(i8042_aux_firmware_id));
745 760
746 i8042_pnp_aux_devices++; 761 i8042_pnp_aux_devices++;
747 return 0; 762 return 0;
diff --git a/drivers/input/serio/i8042.c b/drivers/input/serio/i8042.c
index 020053fa5aaa..3807c3e971cc 100644
--- a/drivers/input/serio/i8042.c
+++ b/drivers/input/serio/i8042.c
@@ -87,6 +87,8 @@ MODULE_PARM_DESC(debug, "Turn i8042 debugging mode on and off");
87#endif 87#endif
88 88
89static bool i8042_bypass_aux_irq_test; 89static bool i8042_bypass_aux_irq_test;
90static char i8042_kbd_firmware_id[128];
91static char i8042_aux_firmware_id[128];
90 92
91#include "i8042.h" 93#include "i8042.h"
92 94
@@ -1218,6 +1220,8 @@ static int __init i8042_create_kbd_port(void)
1218 serio->dev.parent = &i8042_platform_device->dev; 1220 serio->dev.parent = &i8042_platform_device->dev;
1219 strlcpy(serio->name, "i8042 KBD port", sizeof(serio->name)); 1221 strlcpy(serio->name, "i8042 KBD port", sizeof(serio->name));
1220 strlcpy(serio->phys, I8042_KBD_PHYS_DESC, sizeof(serio->phys)); 1222 strlcpy(serio->phys, I8042_KBD_PHYS_DESC, sizeof(serio->phys));
1223 strlcpy(serio->firmware_id, i8042_kbd_firmware_id,
1224 sizeof(serio->firmware_id));
1221 1225
1222 port->serio = serio; 1226 port->serio = serio;
1223 port->irq = I8042_KBD_IRQ; 1227 port->irq = I8042_KBD_IRQ;
@@ -1244,6 +1248,8 @@ static int __init i8042_create_aux_port(int idx)
1244 if (idx < 0) { 1248 if (idx < 0) {
1245 strlcpy(serio->name, "i8042 AUX port", sizeof(serio->name)); 1249 strlcpy(serio->name, "i8042 AUX port", sizeof(serio->name));
1246 strlcpy(serio->phys, I8042_AUX_PHYS_DESC, sizeof(serio->phys)); 1250 strlcpy(serio->phys, I8042_AUX_PHYS_DESC, sizeof(serio->phys));
1251 strlcpy(serio->firmware_id, i8042_aux_firmware_id,
1252 sizeof(serio->firmware_id));
1247 serio->close = i8042_port_close; 1253 serio->close = i8042_port_close;
1248 } else { 1254 } else {
1249 snprintf(serio->name, sizeof(serio->name), "i8042 AUX%d port", idx); 1255 snprintf(serio->name, sizeof(serio->name), "i8042 AUX%d port", idx);
diff --git a/drivers/input/serio/serio.c b/drivers/input/serio/serio.c
index 8f4c4ab04bc2..b29134de983b 100644
--- a/drivers/input/serio/serio.c
+++ b/drivers/input/serio/serio.c
@@ -451,6 +451,13 @@ static ssize_t serio_set_bind_mode(struct device *dev, struct device_attribute *
451 return retval; 451 return retval;
452} 452}
453 453
454static ssize_t firmware_id_show(struct device *dev, struct device_attribute *attr, char *buf)
455{
456 struct serio *serio = to_serio_port(dev);
457
458 return sprintf(buf, "%s\n", serio->firmware_id);
459}
460
454static DEVICE_ATTR_RO(type); 461static DEVICE_ATTR_RO(type);
455static DEVICE_ATTR_RO(proto); 462static DEVICE_ATTR_RO(proto);
456static DEVICE_ATTR_RO(id); 463static DEVICE_ATTR_RO(id);
@@ -473,12 +480,14 @@ static DEVICE_ATTR_RO(modalias);
473static DEVICE_ATTR_WO(drvctl); 480static DEVICE_ATTR_WO(drvctl);
474static DEVICE_ATTR(description, S_IRUGO, serio_show_description, NULL); 481static DEVICE_ATTR(description, S_IRUGO, serio_show_description, NULL);
475static DEVICE_ATTR(bind_mode, S_IWUSR | S_IRUGO, serio_show_bind_mode, serio_set_bind_mode); 482static DEVICE_ATTR(bind_mode, S_IWUSR | S_IRUGO, serio_show_bind_mode, serio_set_bind_mode);
483static DEVICE_ATTR_RO(firmware_id);
476 484
477static struct attribute *serio_device_attrs[] = { 485static struct attribute *serio_device_attrs[] = {
478 &dev_attr_modalias.attr, 486 &dev_attr_modalias.attr,
479 &dev_attr_description.attr, 487 &dev_attr_description.attr,
480 &dev_attr_drvctl.attr, 488 &dev_attr_drvctl.attr,
481 &dev_attr_bind_mode.attr, 489 &dev_attr_bind_mode.attr,
490 &dev_attr_firmware_id.attr,
482 NULL 491 NULL
483}; 492};
484 493
@@ -921,9 +930,14 @@ static int serio_uevent(struct device *dev, struct kobj_uevent_env *env)
921 SERIO_ADD_UEVENT_VAR("SERIO_PROTO=%02x", serio->id.proto); 930 SERIO_ADD_UEVENT_VAR("SERIO_PROTO=%02x", serio->id.proto);
922 SERIO_ADD_UEVENT_VAR("SERIO_ID=%02x", serio->id.id); 931 SERIO_ADD_UEVENT_VAR("SERIO_ID=%02x", serio->id.id);
923 SERIO_ADD_UEVENT_VAR("SERIO_EXTRA=%02x", serio->id.extra); 932 SERIO_ADD_UEVENT_VAR("SERIO_EXTRA=%02x", serio->id.extra);
933
924 SERIO_ADD_UEVENT_VAR("MODALIAS=serio:ty%02Xpr%02Xid%02Xex%02X", 934 SERIO_ADD_UEVENT_VAR("MODALIAS=serio:ty%02Xpr%02Xid%02Xex%02X",
925 serio->id.type, serio->id.proto, serio->id.id, serio->id.extra); 935 serio->id.type, serio->id.proto, serio->id.id, serio->id.extra);
926 936
937 if (serio->firmware_id[0])
938 SERIO_ADD_UEVENT_VAR("SERIO_FIRMWARE_ID=%s",
939 serio->firmware_id);
940
927 return 0; 941 return 0;
928} 942}
929#undef SERIO_ADD_UEVENT_VAR 943#undef SERIO_ADD_UEVENT_VAR