diff --git a/plugins/realtek-mst/README.md b/plugins/realtek-mst/README.md index 4d3fd99c5..6e1751b88 100644 --- a/plugins/realtek-mst/README.md +++ b/plugins/realtek-mst/README.md @@ -29,11 +29,9 @@ This plugin supports the following protocol ID: ## GUID Generation -Devices use custom DeviceInstanceId values derived from device names -provided by system firmware and read from sysfs, like: +Devices use an extra instance ID derived from SMBIOS, e.g. -* REALTEK-MST\NAME_10EC2142:00 -* REALTEK-MST\NAME_10EC2142:00&FAMILY_Google_Hatch +* `I2C\NAME_10EC2142:00&FAMILY_Google_Hatch` ## Quirk Use diff --git a/plugins/realtek-mst/fu-realtek-mst-device.c b/plugins/realtek-mst/fu-realtek-mst-device.c index 28d217e7d..140f7be26 100644 --- a/plugins/realtek-mst/fu-realtek-mst-device.c +++ b/plugins/realtek-mst/fu-realtek-mst-device.c @@ -385,32 +385,19 @@ fu_realtek_mst_device_probe(FuDevice *device, GError **error) { FuRealtekMstDevice *self = FU_REALTEK_MST_DEVICE(device); FuContext *context = fu_device_get_context(device); - const gchar *quirk_name = NULL; - /* set custom instance ID and load matching quirks */ - fu_device_add_instance_str( - device, - "NAME", - fu_udev_device_get_sysfs_attr(FU_UDEV_DEVICE(device), "name", NULL)); - if (!fu_device_build_instance_id(device, error, "REALTEK-MST", "NAME", NULL)) + /* FuI2cDevice->probe */ + if (!FU_DEVICE_CLASS(fu_realtek_mst_device_parent_class)->probe(device, error)) return FALSE; + /* add custom instance ID and load matching quirks */ fu_device_add_instance_str(device, "FAMILY", fu_context_get_hwid_value(context, FU_HWIDS_KEY_FAMILY)); - fu_device_build_instance_id_quirk(device, NULL, "REALTEK-MST", "NAME", "FAMILY", NULL); + if (!fu_device_build_instance_id_quirk(device, error, "I2C", "NAME", "FAMILY", NULL)) + return FALSE; /* having loaded quirks, check this device is supported */ - quirk_name = fu_device_get_name(device); - if (g_strcmp0(quirk_name, "RTD2142") != 0 && g_strcmp0(quirk_name, "RTD2141B") != 0) { - g_set_error(error, - FWUPD_ERROR, - FWUPD_ERROR_NOT_SUPPORTED, - "device name %s is not supported", - quirk_name); - return FALSE; - } - if (self->dp_aux_dev_name != NULL) { if (!fu_realtek_mst_device_use_aux_dev(self, error)) return FALSE; @@ -428,10 +415,6 @@ fu_realtek_mst_device_probe(FuDevice *device, GError **error) /* locate its sibling i2c device and use that instead */ - /* FuI2cDevice */ - if (!FU_DEVICE_CLASS(fu_realtek_mst_device_parent_class)->probe(device, error)) - return FALSE; - /* success */ return TRUE; } diff --git a/plugins/realtek-mst/realtek-mst.quirk b/plugins/realtek-mst/realtek-mst.quirk index b3f740050..37a395fb0 100644 --- a/plugins/realtek-mst/realtek-mst.quirk +++ b/plugins/realtek-mst/realtek-mst.quirk @@ -1,15 +1,11 @@ -# match all devices with this udev subsystem -[I2C] -Plugin = realtek_mst - -[REALTEK-MST\NAME_10EC2142:00] +[I2C\NAME_10EC2142:00] Name = RTD2142 -[REALTEK-MST\NAME_10EC2142:00&FAMILY_Google_Hatch] +[I2C\NAME_10EC2142:00&FAMILY_Google_Hatch] RealtekMstDpAuxName = DPDDC-C -[REALTEK-MST\NAME_10EC2141:00] +[I2C\NAME_10EC2141:00] Name = RTD2141B -[REALTEK-MST\NAME_10EC2141:00&FAMILY_Google_Zork] +[I2C\NAME_10EC2141:00&FAMILY_Google_Zork] RealtekMstDrmCardKernelName = card0-DP-1