diff --git a/sound/soc/codecs/rt711-sdw.c b/sound/soc/codecs/rt711-sdw.c index 78cc5dee0d1cee..00f12b420c06f6 100644 --- a/sound/soc/codecs/rt711-sdw.c +++ b/sound/soc/codecs/rt711-sdw.c @@ -439,6 +439,8 @@ static struct sdw_slave_ops rt711_slave_ops = { .bus_config = rt711_bus_config, }; +#define RT701_WORKAROUND_LINK0 0 + /* DMI quirks */ static const struct dmi_system_id rt701_quirk_table[] = { { @@ -446,6 +448,8 @@ static const struct dmi_system_id rt701_quirk_table[] = { DMI_MATCH(DMI_SYS_VENDOR, "HP"), DMI_MATCH(DMI_PRODUCT_NAME, "HP Spectre x360 Convertible 13-aw2xxx"), }, + .driver_data = (void *)(RT701_WORKAROUND_LINK0), + }, {} }; @@ -455,13 +459,21 @@ static int rt711_sdw_probe(struct sdw_slave *slave, { struct regmap *sdw_regmap, *regmap; const struct dmi_system_id *dmi_id; + unsigned long link_id; /* only allow BIOS work-around in specific configurations */ - dmi_id = dmi_first_match(rt701_quirk_table); - if (id->part_id == 0x701 && !dmi_id) { - dev_dbg(&slave->dev, "%s: probe of part 0x%x on link %d not supported\n", - __func__, id->part_id, slave->bus->link_id); - return -ENODEV; + if (id->part_id == 0x701) { + dmi_id = dmi_first_match(rt701_quirk_table); + if (!dmi_id) { + dev_dbg(&slave->dev, "%s: probe workaround requires DMI quirk\n", __func__); + return -ENODEV; + } + link_id = (unsigned long)dmi_id->driver_data; + if (link_id != slave->bus->link_id) { + dev_dbg(&slave->dev, "%s: probe workaround on link %d not supported\n", + __func__, id->part_id, slave->bus->link_id); + return -ENODEV; + } } /* Regmap Initialization */