Commit 9abcb95a authored by Hans de Goede's avatar Hans de Goede Committed by Jiri Slaby

Input: i8042 - add firmware_id support

commit a7c5868c upstream.

Fill in the new serio firmware_id sysfs attribute for pnp instantiated
8042 serio ports.
Signed-off-by: default avatarHans de Goede <hdegoede@redhat.com>
Acked-by: default avatarPeter Hutterer <peter.hutterer@who-t.net>
Signed-off-by: default avatarDmitry Torokhov <dmitry.torokhov@gmail.com>
Signed-off-by: default avatarJiri Slaby <jslaby@suse.cz>
parent d278ba64
...@@ -746,6 +746,17 @@ static int i8042_pnp_aux_irq; ...@@ -746,6 +746,17 @@ static int i8042_pnp_aux_irq;
static char i8042_pnp_kbd_name[32]; static char i8042_pnp_kbd_name[32];
static char i8042_pnp_aux_name[32]; static char i8042_pnp_aux_name[32];
static void i8042_pnp_id_to_string(struct pnp_id *id, char *dst, int dst_size)
{
strlcpy(dst, "PNP:", dst_size);
while (id) {
strlcat(dst, " ", dst_size);
strlcat(dst, id->id, dst_size);
id = id->next;
}
}
static int i8042_pnp_kbd_probe(struct pnp_dev *dev, const struct pnp_device_id *did) static int i8042_pnp_kbd_probe(struct pnp_dev *dev, const struct pnp_device_id *did)
{ {
if (pnp_port_valid(dev, 0) && pnp_port_len(dev, 0) == 1) if (pnp_port_valid(dev, 0) && pnp_port_len(dev, 0) == 1)
...@@ -762,6 +773,8 @@ static int i8042_pnp_kbd_probe(struct pnp_dev *dev, const struct pnp_device_id * ...@@ -762,6 +773,8 @@ static int i8042_pnp_kbd_probe(struct pnp_dev *dev, const struct pnp_device_id *
strlcat(i8042_pnp_kbd_name, ":", sizeof(i8042_pnp_kbd_name)); strlcat(i8042_pnp_kbd_name, ":", sizeof(i8042_pnp_kbd_name));
strlcat(i8042_pnp_kbd_name, pnp_dev_name(dev), sizeof(i8042_pnp_kbd_name)); strlcat(i8042_pnp_kbd_name, pnp_dev_name(dev), sizeof(i8042_pnp_kbd_name));
} }
i8042_pnp_id_to_string(dev->id, i8042_kbd_firmware_id,
sizeof(i8042_kbd_firmware_id));
/* Keyboard ports are always supposed to be wakeup-enabled */ /* Keyboard ports are always supposed to be wakeup-enabled */
device_set_wakeup_enable(&dev->dev, true); device_set_wakeup_enable(&dev->dev, true);
...@@ -786,6 +799,8 @@ static int i8042_pnp_aux_probe(struct pnp_dev *dev, const struct pnp_device_id * ...@@ -786,6 +799,8 @@ static int i8042_pnp_aux_probe(struct pnp_dev *dev, const struct pnp_device_id *
strlcat(i8042_pnp_aux_name, ":", sizeof(i8042_pnp_aux_name)); strlcat(i8042_pnp_aux_name, ":", sizeof(i8042_pnp_aux_name));
strlcat(i8042_pnp_aux_name, pnp_dev_name(dev), sizeof(i8042_pnp_aux_name)); strlcat(i8042_pnp_aux_name, pnp_dev_name(dev), sizeof(i8042_pnp_aux_name));
} }
i8042_pnp_id_to_string(dev->id, i8042_aux_firmware_id,
sizeof(i8042_aux_firmware_id));
i8042_pnp_aux_devices++; i8042_pnp_aux_devices++;
return 0; return 0;
......
...@@ -87,6 +87,8 @@ MODULE_PARM_DESC(debug, "Turn i8042 debugging mode on and off"); ...@@ -87,6 +87,8 @@ MODULE_PARM_DESC(debug, "Turn i8042 debugging mode on and off");
#endif #endif
static bool i8042_bypass_aux_irq_test; static bool i8042_bypass_aux_irq_test;
static char i8042_kbd_firmware_id[128];
static char i8042_aux_firmware_id[128];
#include "i8042.h" #include "i8042.h"
...@@ -1218,6 +1220,8 @@ static int __init i8042_create_kbd_port(void) ...@@ -1218,6 +1220,8 @@ static int __init i8042_create_kbd_port(void)
serio->dev.parent = &i8042_platform_device->dev; serio->dev.parent = &i8042_platform_device->dev;
strlcpy(serio->name, "i8042 KBD port", sizeof(serio->name)); strlcpy(serio->name, "i8042 KBD port", sizeof(serio->name));
strlcpy(serio->phys, I8042_KBD_PHYS_DESC, sizeof(serio->phys)); strlcpy(serio->phys, I8042_KBD_PHYS_DESC, sizeof(serio->phys));
strlcpy(serio->firmware_id, i8042_kbd_firmware_id,
sizeof(serio->firmware_id));
port->serio = serio; port->serio = serio;
port->irq = I8042_KBD_IRQ; port->irq = I8042_KBD_IRQ;
...@@ -1244,6 +1248,8 @@ static int __init i8042_create_aux_port(int idx) ...@@ -1244,6 +1248,8 @@ static int __init i8042_create_aux_port(int idx)
if (idx < 0) { if (idx < 0) {
strlcpy(serio->name, "i8042 AUX port", sizeof(serio->name)); strlcpy(serio->name, "i8042 AUX port", sizeof(serio->name));
strlcpy(serio->phys, I8042_AUX_PHYS_DESC, sizeof(serio->phys)); strlcpy(serio->phys, I8042_AUX_PHYS_DESC, sizeof(serio->phys));
strlcpy(serio->firmware_id, i8042_aux_firmware_id,
sizeof(serio->firmware_id));
serio->close = i8042_port_close; serio->close = i8042_port_close;
} else { } else {
snprintf(serio->name, sizeof(serio->name), "i8042 AUX%d port", idx); snprintf(serio->name, sizeof(serio->name), "i8042 AUX%d port", idx);
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment