* [PATCH] ASoC: SDCA: Add quirk for incorrect function types for 3 systems
@ 2025-09-01 7:57 Maciej Strozek
2025-09-01 13:55 ` Pierre-Louis Bossart
` (2 more replies)
0 siblings, 3 replies; 6+ messages in thread
From: Maciej Strozek @ 2025-09-01 7:57 UTC (permalink / raw)
To: Mark Brown, Charles Keepax
Cc: Bard Liao, Pierre-Louis Bossart, Liam Girdwood, linux-kernel,
linux-sound, patches, Maciej Strozek
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.
Signed-off-by: Maciej Strozek <mstrozek@opensource.cirrus.com>
---
include/sound/sdca.h | 1 +
sound/soc/sdca/sdca_device.c | 20 ++++++++++++++++++++
sound/soc/sdca/sdca_functions.c | 13 ++++++++-----
3 files changed, 29 insertions(+), 5 deletions(-)
diff --git a/include/sound/sdca.h b/include/sound/sdca.h
index 5a5d6de78d728..9c6a351c9d474 100644
--- a/include/sound/sdca.h
+++ b/include/sound/sdca.h
@@ -46,6 +46,7 @@ struct sdca_device_data {
enum sdca_quirk {
SDCA_QUIRKS_RT712_VB,
+ SDCA_QUIRKS_SKIP_FUNC_TYPE_PATCHING,
};
#if IS_ENABLED(CONFIG_ACPI) && IS_ENABLED(CONFIG_SND_SOC_SDCA)
diff --git a/sound/soc/sdca/sdca_device.c b/sound/soc/sdca/sdca_device.c
index 0244cdcdd109a..4798ce2c8f0b4 100644
--- a/sound/soc/sdca/sdca_device.c
+++ b/sound/soc/sdca/sdca_device.c
@@ -7,6 +7,7 @@
*/
#include <linux/acpi.h>
+#include <linux/dmi.h>
#include <linux/module.h>
#include <linux/property.h>
#include <linux/soundwire/sdw.h>
@@ -55,11 +56,30 @@ static bool sdca_device_quirk_rt712_vb(struct sdw_slave *slave)
return false;
}
+static bool sdca_device_quirk_skip_func_type_patching(struct sdw_slave *slave)
+{
+ const char *vendor, *sku;
+
+ vendor = dmi_get_system_info(DMI_SYS_VENDOR);
+ sku = dmi_get_system_info(DMI_PRODUCT_SKU);
+
+ if (vendor && sku &&
+ !strcmp(vendor, "Dell Inc.") &&
+ (!strcmp(sku, "0C62") || !strcmp(sku, "0C63") || !strcmp(sku, "0C6B")) &&
+ slave->sdca_data.interface_revision == 0x061c &&
+ slave->id.mfg_id == 0x01fa && slave->id.part_id == 0x4243)
+ return true;
+
+ return false;
+}
+
bool sdca_device_quirk_match(struct sdw_slave *slave, enum sdca_quirk quirk)
{
switch (quirk) {
case SDCA_QUIRKS_RT712_VB:
return sdca_device_quirk_rt712_vb(slave);
+ case SDCA_QUIRKS_SKIP_FUNC_TYPE_PATCHING:
+ return sdca_device_quirk_skip_func_type_patching(slave);
default:
break;
}
diff --git a/sound/soc/sdca/sdca_functions.c b/sound/soc/sdca/sdca_functions.c
index f26f597dca9e9..13f68f7b6dd6a 100644
--- a/sound/soc/sdca/sdca_functions.c
+++ b/sound/soc/sdca/sdca_functions.c
@@ -90,6 +90,7 @@ static int find_sdca_function(struct acpi_device *adev, void *data)
{
struct fwnode_handle *function_node = acpi_fwnode_handle(adev);
struct sdca_device_data *sdca_data = data;
+ struct sdw_slave *slave = container_of(sdca_data, struct sdw_slave, sdca_data);
struct device *dev = &adev->dev;
struct fwnode_handle *control5; /* used to identify function type */
const char *function_name;
@@ -137,11 +138,13 @@ static int find_sdca_function(struct acpi_device *adev, void *data)
return ret;
}
- ret = patch_sdca_function_type(sdca_data->interface_revision, &function_type);
- if (ret < 0) {
- dev_err(dev, "SDCA version %#x invalid function type %d\n",
- sdca_data->interface_revision, function_type);
- return ret;
+ if (!sdca_device_quirk_match(slave, SDCA_QUIRKS_SKIP_FUNC_TYPE_PATCHING)) {
+ ret = patch_sdca_function_type(sdca_data->interface_revision, &function_type);
+ if (ret < 0) {
+ dev_err(dev, "SDCA version %#x invalid function type %d\n",
+ sdca_data->interface_revision, function_type);
+ return ret;
+ }
}
function_name = get_sdca_function_name(function_type);
--
2.47.2
^ permalink raw reply related [flat|nested] 6+ messages in thread
* Re: [PATCH] ASoC: SDCA: Add quirk for incorrect function types for 3 systems
2025-09-01 7:57 [PATCH] ASoC: SDCA: Add quirk for incorrect function types for 3 systems Maciej Strozek
@ 2025-09-01 13:55 ` Pierre-Louis Bossart
2025-09-01 14:05 ` Takashi Iwai
2025-09-02 11:51 ` Mark Brown
2 siblings, 0 replies; 6+ messages in thread
From: Pierre-Louis Bossart @ 2025-09-01 13:55 UTC (permalink / raw)
To: Maciej Strozek, Mark Brown, Charles Keepax
Cc: Bard Liao, Liam Girdwood, linux-kernel, linux-sound, patches
On 9/1/25 09:57, Maciej Strozek wrote:
> 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.
>
> Signed-off-by: Maciej Strozek <mstrozek@opensource.cirrus.com>
yay firmware quirks... Probably the start of a *long* list, eh?
Reviewed-by: Pierre-Louis Bossart <pierre-louis.bossart@linux.dev>
> ---
> include/sound/sdca.h | 1 +
> sound/soc/sdca/sdca_device.c | 20 ++++++++++++++++++++
> sound/soc/sdca/sdca_functions.c | 13 ++++++++-----
> 3 files changed, 29 insertions(+), 5 deletions(-)
>
> diff --git a/include/sound/sdca.h b/include/sound/sdca.h
> index 5a5d6de78d728..9c6a351c9d474 100644
> --- a/include/sound/sdca.h
> +++ b/include/sound/sdca.h
> @@ -46,6 +46,7 @@ struct sdca_device_data {
>
> enum sdca_quirk {
> SDCA_QUIRKS_RT712_VB,
> + SDCA_QUIRKS_SKIP_FUNC_TYPE_PATCHING,
> };
>
> #if IS_ENABLED(CONFIG_ACPI) && IS_ENABLED(CONFIG_SND_SOC_SDCA)
> diff --git a/sound/soc/sdca/sdca_device.c b/sound/soc/sdca/sdca_device.c
> index 0244cdcdd109a..4798ce2c8f0b4 100644
> --- a/sound/soc/sdca/sdca_device.c
> +++ b/sound/soc/sdca/sdca_device.c
> @@ -7,6 +7,7 @@
> */
>
> #include <linux/acpi.h>
> +#include <linux/dmi.h>
> #include <linux/module.h>
> #include <linux/property.h>
> #include <linux/soundwire/sdw.h>
> @@ -55,11 +56,30 @@ static bool sdca_device_quirk_rt712_vb(struct sdw_slave *slave)
> return false;
> }
>
> +static bool sdca_device_quirk_skip_func_type_patching(struct sdw_slave *slave)
> +{
> + const char *vendor, *sku;
> +
> + vendor = dmi_get_system_info(DMI_SYS_VENDOR);
> + sku = dmi_get_system_info(DMI_PRODUCT_SKU);
> +
> + if (vendor && sku &&
> + !strcmp(vendor, "Dell Inc.") &&
> + (!strcmp(sku, "0C62") || !strcmp(sku, "0C63") || !strcmp(sku, "0C6B")) &&
> + slave->sdca_data.interface_revision == 0x061c &&
> + slave->id.mfg_id == 0x01fa && slave->id.part_id == 0x4243)
> + return true;
> +
> + return false;
> +}
> +
> bool sdca_device_quirk_match(struct sdw_slave *slave, enum sdca_quirk quirk)
> {
> switch (quirk) {
> case SDCA_QUIRKS_RT712_VB:
> return sdca_device_quirk_rt712_vb(slave);
> + case SDCA_QUIRKS_SKIP_FUNC_TYPE_PATCHING:
> + return sdca_device_quirk_skip_func_type_patching(slave);
> default:
> break;
> }
> diff --git a/sound/soc/sdca/sdca_functions.c b/sound/soc/sdca/sdca_functions.c
> index f26f597dca9e9..13f68f7b6dd6a 100644
> --- a/sound/soc/sdca/sdca_functions.c
> +++ b/sound/soc/sdca/sdca_functions.c
> @@ -90,6 +90,7 @@ static int find_sdca_function(struct acpi_device *adev, void *data)
> {
> struct fwnode_handle *function_node = acpi_fwnode_handle(adev);
> struct sdca_device_data *sdca_data = data;
> + struct sdw_slave *slave = container_of(sdca_data, struct sdw_slave, sdca_data);
> struct device *dev = &adev->dev;
> struct fwnode_handle *control5; /* used to identify function type */
> const char *function_name;
> @@ -137,11 +138,13 @@ static int find_sdca_function(struct acpi_device *adev, void *data)
> return ret;
> }
>
> - ret = patch_sdca_function_type(sdca_data->interface_revision, &function_type);
> - if (ret < 0) {
> - dev_err(dev, "SDCA version %#x invalid function type %d\n",
> - sdca_data->interface_revision, function_type);
> - return ret;
> + if (!sdca_device_quirk_match(slave, SDCA_QUIRKS_SKIP_FUNC_TYPE_PATCHING)) {
> + ret = patch_sdca_function_type(sdca_data->interface_revision, &function_type);
> + if (ret < 0) {
> + dev_err(dev, "SDCA version %#x invalid function type %d\n",
> + sdca_data->interface_revision, function_type);
> + return ret;
> + }
> }
>
> function_name = get_sdca_function_name(function_type);
> --
> 2.47.2
>
^ permalink raw reply [flat|nested] 6+ messages in thread
* Re: [PATCH] ASoC: SDCA: Add quirk for incorrect function types for 3 systems
2025-09-01 7:57 [PATCH] ASoC: SDCA: Add quirk for incorrect function types for 3 systems Maciej Strozek
2025-09-01 13:55 ` Pierre-Louis Bossart
@ 2025-09-01 14:05 ` Takashi Iwai
2025-09-01 14:28 ` Maciej Strozek
2025-09-02 11:51 ` Mark Brown
2 siblings, 1 reply; 6+ messages in thread
From: Takashi Iwai @ 2025-09-01 14:05 UTC (permalink / raw)
To: Maciej Strozek
Cc: Mark Brown, Charles Keepax, Bard Liao, Pierre-Louis Bossart,
Liam Girdwood, linux-kernel, linux-sound, patches
On Mon, 01 Sep 2025 09:57:46 +0200,
Maciej Strozek wrote:
>
> 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.
>
> Signed-off-by: Maciej Strozek <mstrozek@opensource.cirrus.com>
It's a fix for the report below, right?
https://github.com/thesofproject/linux/issues/5515
Then please put it to Link tag. Also at best give Fixes tag if you
can give some hint for the stable backports.
thanks,
Takashi
^ permalink raw reply [flat|nested] 6+ messages in thread
* Re: [PATCH] ASoC: SDCA: Add quirk for incorrect function types for 3 systems
2025-09-01 14:05 ` Takashi Iwai
@ 2025-09-01 14:28 ` Maciej Strozek
2025-09-01 14:47 ` Takashi Iwai
0 siblings, 1 reply; 6+ messages in thread
From: Maciej Strozek @ 2025-09-01 14:28 UTC (permalink / raw)
To: Takashi Iwai
Cc: Mark Brown, Charles Keepax, Bard Liao, Pierre-Louis Bossart,
Liam Girdwood, linux-kernel, linux-sound, patches
W dniu pon, 01.09.2025 o godzinie 16∶05 +0200, użytkownik Takashi Iwai
napisał:
> On Mon, 01 Sep 2025 09:57:46 +0200,
> Maciej Strozek wrote:
> >
> > 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.
> >
> > Signed-off-by: Maciej Strozek <mstrozek@opensource.cirrus.com>
>
> It's a fix for the report below, right?
> https://github.com/thesofproject/linux/issues/5515
> Then please put it to Link tag. Also at best give Fixes tag if you
> can give some hint for the stable backports.
>
That's correct, will put the Link in v2, thanks.
Not sure however if Fixes tag is appropriate (not fixing a bug in a
kernel commit but in the ACPI after all) - maybe a "Cc:
stable@vger.kernel.org" is going to be enough?
>
> thanks,
>
> Takashi
--
Regards,
Maciej
^ permalink raw reply [flat|nested] 6+ messages in thread
* Re: [PATCH] ASoC: SDCA: Add quirk for incorrect function types for 3 systems
2025-09-01 14:28 ` Maciej Strozek
@ 2025-09-01 14:47 ` Takashi Iwai
0 siblings, 0 replies; 6+ messages in thread
From: Takashi Iwai @ 2025-09-01 14:47 UTC (permalink / raw)
To: Maciej Strozek
Cc: Takashi Iwai, Mark Brown, Charles Keepax, Bard Liao,
Pierre-Louis Bossart, Liam Girdwood, linux-kernel, linux-sound,
patches
On Mon, 01 Sep 2025 16:28:48 +0200,
Maciej Strozek wrote:
>
> W dniu pon, 01.09.2025 o godzinie 16∶05 +0200, użytkownik Takashi Iwai
> napisał:
> > On Mon, 01 Sep 2025 09:57:46 +0200,
> > Maciej Strozek wrote:
> > >
> > > 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.
> > >
> > > Signed-off-by: Maciej Strozek <mstrozek@opensource.cirrus.com>
> >
> > It's a fix for the report below, right?
> > https://github.com/thesofproject/linux/issues/5515
> > Then please put it to Link tag. Also at best give Fixes tag if you
> > can give some hint for the stable backports.
> >
> That's correct, will put the Link in v2, thanks.
> Not sure however if Fixes tag is appropriate (not fixing a bug in a
> kernel commit but in the ACPI after all) - maybe a "Cc:
> stable@vger.kernel.org" is going to be enough?
I thought it's a regression, judging from the original bug report on
https://bugzilla.opensuse.org/show_bug.cgi?id=1248239
but Cc-to-stable works, too.
thanks,
Takashi
^ permalink raw reply [flat|nested] 6+ messages in thread
* Re: [PATCH] ASoC: SDCA: Add quirk for incorrect function types for 3 systems
2025-09-01 7:57 [PATCH] ASoC: SDCA: Add quirk for incorrect function types for 3 systems Maciej Strozek
2025-09-01 13:55 ` Pierre-Louis Bossart
2025-09-01 14:05 ` Takashi Iwai
@ 2025-09-02 11:51 ` Mark Brown
2 siblings, 0 replies; 6+ messages in thread
From: Mark Brown @ 2025-09-02 11:51 UTC (permalink / raw)
To: Charles Keepax, Maciej Strozek
Cc: Bard Liao, Pierre-Louis Bossart, Liam Girdwood, linux-kernel,
linux-sound, patches
On Mon, 01 Sep 2025 08:57:46 +0100, Maciej Strozek wrote:
> 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.
>
>
Applied to
https://git.kernel.org/pub/scm/linux/kernel/git/broonie/sound.git for-next
Thanks!
[1/1] ASoC: SDCA: Add quirk for incorrect function types for 3 systems
commit: 28edfaa10ca1b370b1a27fde632000d35c43402c
All being well this means that it will be integrated into the linux-next
tree (usually sometime in the next 24 hours) and sent to Linus during
the next merge window (or sooner if it is a bug fix), however if
problems are discovered then the patch may be dropped or reverted.
You may get further e-mails resulting from automated or manual testing
and review of the tree, please engage with people reporting problems and
send followup patches addressing any issues that are reported if needed.
If any updates are required or you are submitting further changes they
should be sent as incremental updates against current git, existing
patches will not be replaced.
Please add any relevant lists and maintainers to the CCs when replying
to this mail.
Thanks,
Mark
^ permalink raw reply [flat|nested] 6+ messages in thread
end of thread, other threads:[~2025-09-02 11:51 UTC | newest]
Thread overview: 6+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2025-09-01 7:57 [PATCH] ASoC: SDCA: Add quirk for incorrect function types for 3 systems Maciej Strozek
2025-09-01 13:55 ` Pierre-Louis Bossart
2025-09-01 14:05 ` Takashi Iwai
2025-09-01 14:28 ` Maciej Strozek
2025-09-01 14:47 ` Takashi Iwai
2025-09-02 11:51 ` Mark Brown
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).