2023-06-21 16:31:15

by Matthew Anderson

[permalink] [raw]
Subject: [PATCH v4] ALSA: hda/realtek: Add quirks for ROG ALLY CS35l41 audio

This requires a patched ACPI table or a firmware from ASUS to work because
the system does not come with the _DSD field for the CSC3551.

Link: https://bugzilla.kernel.org/show_bug.cgi?id=217550

Signed-off-by: Matthew Anderson <[email protected]>
---
changes in v2:
- Fixed indentation
changes in v3:
- Adjusted code as advised
changes in v4:
- Fold and resubmit
---
sound/pci/hda/patch_realtek.c | 46 +++++++++++++++++++++++++++++++++++
1 file changed, 46 insertions(+)

diff --git a/sound/pci/hda/patch_realtek.c b/sound/pci/hda/patch_realtek.c
index 308ec7034cc9..75f64131b369 100644
--- a/sound/pci/hda/patch_realtek.c
+++ b/sound/pci/hda/patch_realtek.c
@@ -7120,6 +7120,10 @@ enum {
ALC294_FIXUP_ASUS_DUAL_SPK,
ALC285_FIXUP_THINKPAD_X1_GEN7,
ALC285_FIXUP_THINKPAD_HEADSET_JACK,
+ ALC294_FIXUP_ASUS_ALLY,
+ ALC294_FIXUP_ASUS_ALLY_PINS,
+ ALC294_FIXUP_ASUS_ALLY_VERBS,
+ ALC294_FIXUP_ASUS_ALLY_SPEAKER,
ALC294_FIXUP_ASUS_HPE,
ALC294_FIXUP_ASUS_COEF_1B,
ALC294_FIXUP_ASUS_GX502_HP,
@@ -8432,6 +8436,47 @@ static const struct hda_fixup alc269_fixups[] = {
.chained = true,
.chain_id = ALC294_FIXUP_SPK2_TO_DAC1
},
+ [ALC294_FIXUP_ASUS_ALLY] = {
+ .type = HDA_FIXUP_FUNC,
+ .v.func = cs35l41_fixup_i2c_two,
+ .chained = true,
+ .chain_id = ALC294_FIXUP_ASUS_ALLY_PINS
+ },
+ [ALC294_FIXUP_ASUS_ALLY_PINS] = {
+ .type = HDA_FIXUP_PINS,
+ .v.pins = (const struct hda_pintbl[]) {
+ { 0x19, 0x03a11050 },
+ { 0x1a, 0x03a11c30 },
+ { 0x21, 0x03211420 },
+ { }
+ },
+ .chained = true,
+ .chain_id = ALC294_FIXUP_ASUS_ALLY_VERBS
+ },
+ [ALC294_FIXUP_ASUS_ALLY_VERBS] = {
+ .type = HDA_FIXUP_VERBS,
+ .v.verbs = (const struct hda_verb[]) {
+ { 0x20, AC_VERB_SET_COEF_INDEX, 0x45 },
+ { 0x20, AC_VERB_SET_PROC_COEF, 0x5089 },
+ { 0x20, AC_VERB_SET_COEF_INDEX, 0x46 },
+ { 0x20, AC_VERB_SET_PROC_COEF, 0x0004 },
+ { 0x20, AC_VERB_SET_COEF_INDEX, 0x47 },
+ { 0x20, AC_VERB_SET_PROC_COEF, 0xa47a },
+ { 0x20, AC_VERB_SET_COEF_INDEX, 0x49 },
+ { 0x20, AC_VERB_SET_PROC_COEF, 0x0049},
+ { 0x20, AC_VERB_SET_COEF_INDEX, 0x4a },
+ { 0x20, AC_VERB_SET_PROC_COEF, 0x201b },
+ { 0x20, AC_VERB_SET_COEF_INDEX, 0x6b },
+ { 0x20, AC_VERB_SET_PROC_COEF, 0x4278},
+ { }
+ },
+ .chained = true,
+ .chain_id = ALC294_FIXUP_ASUS_ALLY_SPEAKER
+ },
+ [ALC294_FIXUP_ASUS_ALLY_SPEAKER] = {
+ .type = HDA_FIXUP_FUNC,
+ .v.func = alc285_fixup_speaker2_to_dac1,
+ },
[ALC285_FIXUP_THINKPAD_X1_GEN7] = {
.type = HDA_FIXUP_FUNC,
.v.func = alc285_fixup_thinkpad_x1_gen7,
@@ -9534,6 +9579,7 @@ static const struct snd_pci_quirk alc269_fixup_tbl[] = {
SND_PCI_QUIRK(0x1043, 0x16e3, "ASUS UX50", ALC269_FIXUP_STEREO_DMIC),
SND_PCI_QUIRK(0x1043, 0x1740, "ASUS UX430UA", ALC295_FIXUP_ASUS_DACS),
SND_PCI_QUIRK(0x1043, 0x17d1, "ASUS UX431FL", ALC294_FIXUP_ASUS_DUAL_SPK),
+ SND_PCI_QUIRK(0x1043, 0x17f3, "ROG Ally RC71L_RC71L", ALC294_FIXUP_ASUS_ALLY),
SND_PCI_QUIRK(0x1043, 0x1881, "ASUS Zephyrus S/M", ALC294_FIXUP_ASUS_GX502_PINS),
SND_PCI_QUIRK(0x1043, 0x18b1, "Asus MJ401TA", ALC256_FIXUP_ASUS_HEADSET_MIC),
SND_PCI_QUIRK(0x1043, 0x18f1, "Asus FX505DT", ALC256_FIXUP_ASUS_HEADSET_MIC),
--
2.41.0



2023-06-22 13:08:35

by Andrei Matei

[permalink] [raw]
Subject: Re: [PATCH v4] ALSA: hda/realtek: Add quirks for ROG ALLY CS35l41 audio

Hello,
Is this patch specific to the Ally, or does it cover other Asus
laptops discussed in this thread [1]?

Thanks!

[1] https://lore.kernel.org/lkml/[email protected]/T/#m42ec3f3f4ceb610430587b916281b570fbb666df

2023-06-22 23:51:30

by Luke Jones

[permalink] [raw]
Subject: Re: [PATCH v4] ALSA: hda/realtek: Add quirks for ROG ALLY CS35l41 audio

On Thu, 2023-06-22 at 08:35 -0400, Andrei Matei wrote:
> Hello,
> Is this patch specific to the Ally, or does it cover other Asus
> laptops discussed in this thread [1]?
>
> Thanks!
>
> [1]
> https://lore.kernel.org/lkml/[email protected]/T/#m42ec3f3f4ceb610430587b916281b570fbb666df


It is Ally specific. Most of the laptops will require a set of similar
quirks, but for a different codec susbsystem ID.

Some others have now been submitted, if your laptop is not yet
supported please file a bug report, if it is a ROG laptop you can
submit something here https://gitlab.com/asus-linux/asusctl and I will
help plus submit any fixes upstream per usual.

Do keep in mind that the 2023 range of ASUS laptops are almost all
missing the _DSD properties for the Cirrus amp they are using, and so
you will be missing bass/midrange until a solution is agreed upon (or
you add an ssdt patch) - you also need the correct firmware tunings for
your laptop. It is very highly unlikely ASUS will add the missing
properties to a bios update for each and every one of the laptops + the
variants in the full 2023 range.

Regards,
Luke.