trivial: Add a quirk for setting the USB device version

This commit is contained in:
Richard Hughes 2017-12-09 12:29:42 +00:00
parent 5060246526
commit 4cea617967
2 changed files with 16 additions and 0 deletions

View File

@ -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`

View File

@ -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)