Add a quirk for setting the USB device vendor

This commit is contained in:
Richard Hughes 2017-12-08 17:43:03 +00:00
parent 168b9faa80
commit 725c19fa88
2 changed files with 18 additions and 0 deletions

View File

@ -365,6 +365,13 @@ fu_plugin_device_add (FuPlugin *plugin, FuDevice *device)
if (tmp != NULL)
fu_device_set_summary (device, tmp);
/* vendor */
tmp = fu_quirks_lookup_by_usb_device (priv->quirks,
FU_QUIRKS_USB_VENDOR,
usb_device);
if (tmp != NULL)
fu_device_set_vendor (device, tmp);
/* icon */
tmp = fu_quirks_lookup_by_usb_device (priv->quirks,
FU_QUIRKS_USB_ICON,

View File

@ -190,6 +190,17 @@ const gchar *fu_quirks_lookup_by_usb_device (FuQuirks *self,
*/
#define FU_QUIRKS_USB_GUID "fwupd-usb-guid"
/**
* FU_QUIRKS_USB_VENDOR:
* @key: the USB device ID, e.g. `USB\VID_0763&PID_2806`
* @value: the vendor, e.g. `Hughski Limited`
*
* Sets a vendor name for a specific hardware device.
*
* Since: 1.0.3
*/
#define FU_QUIRKS_USB_VENDOR "fwupd-usb-vendor"
G_END_DECLS
#endif /* __FU_QUIRKS_H */