mirror of
https://git.proxmox.com/git/fwupd
synced 2025-08-07 02:54:26 +00:00
Add the serio->firmare_id for UDev devices
If set, it is a device-specified InstanceID specifying the firmware stream.
This commit is contained in:
parent
7a63a4c41c
commit
70aca476d7
@ -244,6 +244,28 @@ fu_udev_device_probe_i2c_dev (FuUdevDevice *self, GError **error)
|
|||||||
}
|
}
|
||||||
return TRUE;
|
return TRUE;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
static gboolean
|
||||||
|
fu_udev_device_probe_serio (FuUdevDevice *self, GError **error)
|
||||||
|
{
|
||||||
|
FuUdevDevicePrivate *priv = GET_PRIVATE (self);
|
||||||
|
const gchar *tmp;
|
||||||
|
|
||||||
|
/* firmware ID */
|
||||||
|
tmp = g_udev_device_get_property (priv->udev_device, "SERIO_FIRMWARE_ID");
|
||||||
|
if (tmp != NULL) {
|
||||||
|
g_autofree gchar *devid = NULL;
|
||||||
|
g_autofree gchar *id_safe = NULL;
|
||||||
|
/* this prefix is not useful */
|
||||||
|
if (g_str_has_prefix (tmp, "PNP: "))
|
||||||
|
tmp += 5;
|
||||||
|
id_safe = g_utf8_strup (tmp, -1);
|
||||||
|
g_strdelimit (id_safe, " /\\\"", '-');
|
||||||
|
devid = g_strdup_printf ("SERIO\\FWID_%s", id_safe);
|
||||||
|
fu_device_add_instance_id (FU_DEVICE (self), devid);
|
||||||
|
}
|
||||||
|
return TRUE;
|
||||||
|
}
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
static gboolean
|
static gboolean
|
||||||
@ -459,6 +481,12 @@ fu_udev_device_probe (FuDevice *device, GError **error)
|
|||||||
return FALSE;
|
return FALSE;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/* add firmware_id */
|
||||||
|
if (g_strcmp0 (g_udev_device_get_subsystem (priv->udev_device), "serio") == 0) {
|
||||||
|
if (!fu_udev_device_probe_serio (self, error))
|
||||||
|
return FALSE;
|
||||||
|
}
|
||||||
|
|
||||||
/* determine if we're wired internally */
|
/* determine if we're wired internally */
|
||||||
parent_i2c = g_udev_device_get_parent_with_subsystem (priv->udev_device,
|
parent_i2c = g_udev_device_get_parent_with_subsystem (priv->udev_device,
|
||||||
"i2c", NULL);
|
"i2c", NULL);
|
||||||
|
Loading…
Reference in New Issue
Block a user