Skip to content

Instantly share code, notes, and snippets.

@steffengy
Last active June 27, 2024 06:34
Show Gist options
  • Save steffengy/aa48549f40c37acf85de7a7f9a6c0475 to your computer and use it in GitHub Desktop.
Save steffengy/aa48549f40c37acf85de7a7f9a6c0475 to your computer and use it in GitHub Desktop.
Linux 6.8.2 patch 10431A63 - UX3405MA.304 Sound CS35L41 Workaround For context: In bios version 304 pretty much all the config is present (confirmed via dumping and looking at ssdt16), except for "spk-id-gpios".
--- ./cs35l41_hda_property.old.c 2024-04-03 15:32:51.000000000 +0200
+++ ./cs35l41_hda_property.c 2024-04-03 20:27:58.179588400 +0200
@@ -83,6 +83,7 @@
{ "104317F3", 2, INTERNAL, { CS35L41_LEFT, CS35L41_RIGHT, 0, 0 }, 0, 1, -1, 1000, 4500, 24 },
{ "10431863", 2, INTERNAL, { CS35L41_LEFT, CS35L41_RIGHT, 0, 0 }, 1, 2, 0, 1000, 4500, 24 },
{ "104318D3", 2, EXTERNAL, { CS35L41_LEFT, CS35L41_RIGHT, 0, 0 }, 0, 1, -1, 0, 0, 0 },
+ { "10431A63", 2, EXTERNAL, { CS35L41_LEFT, CS35L41_RIGHT, 0, 0 }, -1, 2, -1, 0, 0, 0 },
{ "10431A83", 2, INTERNAL, { CS35L41_LEFT, CS35L41_RIGHT, 0, 0 }, 0, 1, -1, 1000, 4500, 24 },
{ "10431C9F", 2, INTERNAL, { CS35L41_LEFT, CS35L41_RIGHT, 0, 0 }, 1, 2, 0, 1000, 4500, 24 },
{ "10431CAF", 2, INTERNAL, { CS35L41_LEFT, CS35L41_RIGHT, 0, 0 }, 1, 2, 0, 1000, 4500, 24 },
@@ -229,7 +230,7 @@
dsd_found = acpi_dev_has_props(cs35l41->dacpi);
- if (!dsd_found) {
+ // if (!dsd_found) {
ret = cs35l41_add_gpios(cs35l41, physdev, cfg->reset_gpio_index,
cfg->spkid_gpio_index, cfg->cs_gpio_index,
cfg->num_amps);
@@ -237,10 +238,10 @@
dev_err(cs35l41->dev, "Error adding GPIO mapping: %d\n", ret);
return ret;
}
- } else if (cfg->reset_gpio_index >= 0 || cfg->spkid_gpio_index >= 0) {
+ /*} else if (cfg->reset_gpio_index >= 0 || cfg->spkid_gpio_index >= 0) {
dev_warn(cs35l41->dev, "Cannot add Reset/Speaker ID/SPI CS GPIO Mapping, "
"_DSD already exists.\n");
- }
+ }*/
if (cs35l41->control_bus == SPI) {
cs35l41->index = id;
@@ -420,6 +421,7 @@
{ "CSC3551", "104317F3", generic_dsd_config },
{ "CSC3551", "10431863", generic_dsd_config },
{ "CSC3551", "104318D3", generic_dsd_config },
+ { "CSC3551", "10431A63", generic_dsd_config },
{ "CSC3551", "10431A83", generic_dsd_config },
{ "CSC3551", "10431C9F", generic_dsd_config },
{ "CSC3551", "10431CAF", generic_dsd_config },
@paul-ri
Copy link

paul-ri commented Jun 23, 2024

Thanks for this file! That fixed the volume issues on the UX3405ma here. Do you have any plan to submit this to some kernel folks? It'd need modified since it's hacky. Maybe asking the Cirrus Logic people instead that they'd need to fix this.

Also, what do you make of this other solution using an SSDT file https://github.com/smallcms/asus_zenbook_ux3405ma ? Is this something that should be done in addition to your patch? Instead of? Your patch is enough to fix the volume for me, and I'm failing to make their SSDT file work properly here. I've described by problems & attempts there smallcms/asus_zenbook_ux3405ma#7

@steffengy
Copy link
Author

steffengy commented Jun 23, 2024

So far haven't taken the time to do so and unsure when/if I will - as wouldn't be upstreamed like this but with a less hacky patch.
My original hope was they'd just fix that in DSD shipped in bios eventually, but that seems unlikely.
In theory both variants should work, I personally think this one is less "invasive" and "simpler" in some ways.

@paul-ri
Copy link

paul-ri commented Jun 23, 2024

Alright! That helps to know that both solutions would work. I agree on the kernel approach. I've e-mailed someone at Cirrus Logic that appears to deal with this file & firmware. Hopefully we get guidance : )

@paul-ri
Copy link

paul-ri commented Jun 27, 2024

I've been hinted where to file a bug, so here it is: https://bugzilla.kernel.org/show_bug.cgi?id=218991

There are a bunch of patches that have been submitted over the weeks doing something very similar to what you're doing, for other laptops. So, that appears to be a classic issue!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment