Skip to content

Commit

Permalink
[SQUASHME] rt1711-sdw: better DMI quirk with link_id
Browse files Browse the repository at this point in the history
Signed-off-by: Pierre-Louis Bossart <pierre-louis.bossart@linux.intel.com>
  • Loading branch information
plbossart committed Jan 21, 2021
1 parent 8963720 commit c19a33a
Showing 1 changed file with 17 additions and 5 deletions.
22 changes: 17 additions & 5 deletions sound/soc/codecs/rt711-sdw.c
Expand Up @@ -439,13 +439,17 @@ 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[] = {
{
.matches = {
DMI_MATCH(DMI_SYS_VENDOR, "HP"),
DMI_MATCH(DMI_PRODUCT_NAME, "HP Spectre x360 Convertible 13-aw2xxx"),
},
.driver_data = (void *)(RT701_WORKAROUND_LINK0),

},
{}
};
Expand All @@ -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 */
Expand Down

0 comments on commit c19a33a

Please sign in to comment.