mirror of
https://git.proxmox.com/git/fwupd
synced 2025-08-02 12:54:52 +00:00
trivial: Add a quirk for setting the USB device version
This commit is contained in:
parent
5060246526
commit
4cea617967
@ -190,6 +190,17 @@ const gchar *fu_quirks_lookup_by_usb_device (FuQuirks *self,
|
||||
*/
|
||||
#define FU_QUIRKS_USB_GUID "FuUsbDevice:guid"
|
||||
|
||||
/**
|
||||
* FU_QUIRKS_USB_VERSION:
|
||||
* @key: the USB device ID, e.g. `USB\VID_0763&PID_2806&REV_0001`
|
||||
* @value: the version number, e.g. `1.2`
|
||||
*
|
||||
* Sets a version for a specific hardware device.
|
||||
*
|
||||
* Since: 1.0.3
|
||||
*/
|
||||
#define FU_QUIRKS_USB_VERSION "FuUsbDevice:version"
|
||||
|
||||
/**
|
||||
* FU_QUIRKS_USB_VENDOR:
|
||||
* @key: the USB device ID, e.g. `USB\VID_0763&PID_2806`
|
||||
|
@ -81,6 +81,11 @@ fu_usb_device_notify_quirks_cb (FuUsbDevice *device, GParamSpec *pspec, gpointer
|
||||
if (tmp != NULL)
|
||||
fu_device_set_vendor (FU_DEVICE (device), tmp);
|
||||
|
||||
/* version */
|
||||
tmp = fu_quirks_lookup_by_usb_device (quirks, FU_QUIRKS_USB_VERSION, usb_device);
|
||||
if (tmp != NULL)
|
||||
fu_device_set_version (FU_DEVICE (device), tmp);
|
||||
|
||||
/* icon */
|
||||
tmp = fu_quirks_lookup_by_usb_device (quirks, FU_QUIRKS_USB_ICON, usb_device);
|
||||
if (tmp != NULL)
|
||||
|
Loading…
Reference in New Issue
Block a user