Skip to content

Commit 28edfaa

Browse files
mstrozekbroonie
authored andcommitted
ASoC: SDCA: Add quirk for incorrect function types for 3 systems
Certain systems have CS42L43 DisCo that claims to conform to version 0.6.28 but uses the function types from the 1.0 spec. Add a quirk as a workaround. Closes: thesofproject#5515 Cc: stable@vger.kernel.org Signed-off-by: Maciej Strozek <mstrozek@opensource.cirrus.com> Reviewed-by: Pierre-Louis Bossart <pierre-louis.bossart@linux.dev> Link: https://patch.msgid.link/20250901151518.3197941-1-mstrozek@opensource.cirrus.com Signed-off-by: Mark Brown <broonie@kernel.org>
1 parent f1d0260 commit 28edfaa

3 files changed

Lines changed: 29 additions & 5 deletions

File tree

include/sound/sdca.h

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -46,6 +46,7 @@ struct sdca_device_data {
4646

4747
enum sdca_quirk {
4848
SDCA_QUIRKS_RT712_VB,
49+
SDCA_QUIRKS_SKIP_FUNC_TYPE_PATCHING,
4950
};
5051

5152
#if IS_ENABLED(CONFIG_ACPI) && IS_ENABLED(CONFIG_SND_SOC_SDCA)

sound/soc/sdca/sdca_device.c

Lines changed: 20 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -7,6 +7,7 @@
77
*/
88

99
#include <linux/acpi.h>
10+
#include <linux/dmi.h>
1011
#include <linux/module.h>
1112
#include <linux/property.h>
1213
#include <linux/soundwire/sdw.h>
@@ -55,11 +56,30 @@ static bool sdca_device_quirk_rt712_vb(struct sdw_slave *slave)
5556
return false;
5657
}
5758

59+
static bool sdca_device_quirk_skip_func_type_patching(struct sdw_slave *slave)
60+
{
61+
const char *vendor, *sku;
62+
63+
vendor = dmi_get_system_info(DMI_SYS_VENDOR);
64+
sku = dmi_get_system_info(DMI_PRODUCT_SKU);
65+
66+
if (vendor && sku &&
67+
!strcmp(vendor, "Dell Inc.") &&
68+
(!strcmp(sku, "0C62") || !strcmp(sku, "0C63") || !strcmp(sku, "0C6B")) &&
69+
slave->sdca_data.interface_revision == 0x061c &&
70+
slave->id.mfg_id == 0x01fa && slave->id.part_id == 0x4243)
71+
return true;
72+
73+
return false;
74+
}
75+
5876
bool sdca_device_quirk_match(struct sdw_slave *slave, enum sdca_quirk quirk)
5977
{
6078
switch (quirk) {
6179
case SDCA_QUIRKS_RT712_VB:
6280
return sdca_device_quirk_rt712_vb(slave);
81+
case SDCA_QUIRKS_SKIP_FUNC_TYPE_PATCHING:
82+
return sdca_device_quirk_skip_func_type_patching(slave);
6383
default:
6484
break;
6585
}

sound/soc/sdca/sdca_functions.c

Lines changed: 8 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -90,6 +90,7 @@ static int find_sdca_function(struct acpi_device *adev, void *data)
9090
{
9191
struct fwnode_handle *function_node = acpi_fwnode_handle(adev);
9292
struct sdca_device_data *sdca_data = data;
93+
struct sdw_slave *slave = container_of(sdca_data, struct sdw_slave, sdca_data);
9394
struct device *dev = &adev->dev;
9495
struct fwnode_handle *control5; /* used to identify function type */
9596
const char *function_name;
@@ -137,11 +138,13 @@ static int find_sdca_function(struct acpi_device *adev, void *data)
137138
return ret;
138139
}
139140

140-
ret = patch_sdca_function_type(sdca_data->interface_revision, &function_type);
141-
if (ret < 0) {
142-
dev_err(dev, "SDCA version %#x invalid function type %d\n",
143-
sdca_data->interface_revision, function_type);
144-
return ret;
141+
if (!sdca_device_quirk_match(slave, SDCA_QUIRKS_SKIP_FUNC_TYPE_PATCHING)) {
142+
ret = patch_sdca_function_type(sdca_data->interface_revision, &function_type);
143+
if (ret < 0) {
144+
dev_err(dev, "SDCA version %#x invalid function type %d\n",
145+
sdca_data->interface_revision, function_type);
146+
return ret;
147+
}
145148
}
146149

147150
function_name = get_sdca_function_name(function_type);

0 commit comments

Comments
 (0)