Allow reading the PciBcrAddr quirk from flashrom devices

This commit is contained in:
Richard Hughes 2021-03-15 13:02:05 +00:00
parent bc39faf4cf
commit aa95f30390

View File

@ -30,9 +30,29 @@ fu_flashrom_device_init (FuFlashromDevice *self)
fu_device_add_icon (FU_DEVICE (self), "computer");
}
static gboolean
fu_flashrom_device_set_quirk_kv (FuDevice *device,
const gchar *key,
const gchar *value,
GError **error)
{
if (g_strcmp0 (key, "PciBcrAddr") == 0) {
guint64 tmp = fu_common_strtoull (value);
fu_device_set_metadata_integer (device, "PciBcrAddr", tmp);
return TRUE;
}
g_set_error_literal (error,
G_IO_ERROR,
G_IO_ERROR_NOT_SUPPORTED,
"no supported");
return FALSE;
}
static void
fu_flashrom_device_class_init (FuFlashromDeviceClass *klass)
{
FuDeviceClass *klass_device = FU_DEVICE_CLASS (klass);
klass_device->set_quirk_kv = fu_flashrom_device_set_quirk_kv;
}
FuDevice *