[PATCH] ALSA: hda/realtek: Add quirks for Asus ROG Ally handheld using CS35L41

Matthew Anderson posted 1 patch 2 years, 7 months ago
sound/pci/hda/patch_realtek.c | 46 +++++++++++++++++++++++++++++++++++
1 file changed, 46 insertions(+)
[PATCH] ALSA: hda/realtek: Add quirks for Asus ROG Ally handheld using CS35L41
Posted by Matthew Anderson 2 years, 7 months ago
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.

Signed-off-by: Matthew Anderson <ruinairas1992@gmail.com>
---
 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..b918b0046144 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,
@@ -9596,6 +9641,7 @@ static const struct snd_pci_quirk alc269_fixup_tbl[] = {
 	SND_PCI_QUIRK(0x10ec, 0x1254, "Intel Reference board", ALC295_FIXUP_CHROME_BOOK),
 	SND_PCI_QUIRK(0x10ec, 0x12cc, "Intel Reference board", ALC225_FIXUP_HEADSET_JACK),
 	SND_PCI_QUIRK(0x10f7, 0x8338, "Panasonic CF-SZ6", ALC269_FIXUP_HEADSET_MODE),
+	SND_PCI_QUIRK(0x1043, 0x17F3, "ROG Ally RC71L_RC71L", ALC294_FIXUP_ASUS_ALLY),
 	SND_PCI_QUIRK(0x144d, 0xc109, "Samsung Ativ book 9 (NP900X3G)", ALC269_FIXUP_INV_DMIC),
 	SND_PCI_QUIRK(0x144d, 0xc169, "Samsung Notebook 9 Pen (NP930SBE-K01US)", ALC298_FIXUP_SAMSUNG_AMP),
 	SND_PCI_QUIRK(0x144d, 0xc176, "Samsung Notebook 9 Pro (NP930MBE-K04US)", ALC298_FIXUP_SAMSUNG_AMP),
-- 
2.41.0
Re: [PATCH] ALSA: hda/realtek: Add quirks for Asus ROG Ally handheld using CS35L41
Posted by Philip Müller 2 years, 7 months ago
On 21.06.23 01:55, Matthew Anderson wrote:
> 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.
> 
> Signed-off-by: Matthew Anderson <ruinairas1992@gmail.com>
> ---
>   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..b918b0046144 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,
> @@ -9596,6 +9641,7 @@ static const struct snd_pci_quirk alc269_fixup_tbl[] = {
>   	SND_PCI_QUIRK(0x10ec, 0x1254, "Intel Reference board", ALC295_FIXUP_CHROME_BOOK),
>   	SND_PCI_QUIRK(0x10ec, 0x12cc, "Intel Reference board", ALC225_FIXUP_HEADSET_JACK),
>   	SND_PCI_QUIRK(0x10f7, 0x8338, "Panasonic CF-SZ6", ALC269_FIXUP_HEADSET_MODE),
> +	SND_PCI_QUIRK(0x1043, 0x17F3, "ROG Ally RC71L_RC71L", ALC294_FIXUP_ASUS_ALLY),
>   	SND_PCI_QUIRK(0x144d, 0xc109, "Samsung Ativ book 9 (NP900X3G)", ALC269_FIXUP_INV_DMIC),
>   	SND_PCI_QUIRK(0x144d, 0xc169, "Samsung Notebook 9 Pen (NP930SBE-K01US)", ALC298_FIXUP_SAMSUNG_AMP),
>   	SND_PCI_QUIRK(0x144d, 0xc176, "Samsung Notebook 9 Pro (NP930MBE-K04US)", ALC298_FIXUP_SAMSUNG_AMP),

Tested-by: Philip Mueller <philm@manjaro.org>