From 725c19fa88b44e3de817d62cb4f371bd7ca06695 Mon Sep 17 00:00:00 2001 From: Richard Hughes Date: Fri, 8 Dec 2017 17:43:03 +0000 Subject: [PATCH] Add a quirk for setting the USB device vendor --- src/fu-plugin.c | 7 +++++++ src/fu-quirks.h | 11 +++++++++++ 2 files changed, 18 insertions(+) diff --git a/src/fu-plugin.c b/src/fu-plugin.c index c58b3abec..6530fd7e3 100644 --- a/src/fu-plugin.c +++ b/src/fu-plugin.c @@ -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, diff --git a/src/fu-quirks.h b/src/fu-quirks.h index dd196c84c..c1b81069c 100644 --- a/src/fu-quirks.h +++ b/src/fu-quirks.h @@ -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 */