diff mbox series

[1/1] ALSA: HDA: Asus UM5302LA: Added quirks for cs35L41/10431A83 on i2c bus

Message ID CAHiQ-bDGx89vWjtqrnH4FtO-JF9XUWMgwCpR4nusC9Zvw=bN7Q@mail.gmail.com (mailing list archive)
State Superseded
Headers show
Series [1/1] ALSA: HDA: Asus UM5302LA: Added quirks for cs35L41/10431A83 on i2c bus | expand

Commit Message

Vitalii Torshyn Nov. 9, 2023, 12:22 a.m. UTC
Hi Takashi,

Proposed patch fixes initialization of CSC3551 on the UM5302LA laptop.
Patching DSDT table is not required since ASUS did added _DSD entry.
Nothing new introduced but reused work started by Stefan B.

Currently there is no official firmware available for 10431A83 on cirrus
git unfortunately.
For testing used 104317f3 (which is also seems on i2c bus):

$ cd /lib/firmware/cirrus/ && \
for fw in $(find ./ -name '*104317f3*'); do newfw=$(echo $fw | sed
's/104317f3/10431a83/g'); echo echo "$fw -> $newfw"; ln -s $f $newfw; done

With the patch applied to 6.6.0 and obviously symlinks to 104317F3 FW,
speakers works and to my susrprise they sound quite good and loud without
distortion.

Probably confirmation from cirrus team is needed on firmware.

Signed-off-by: Vitalii Torshyn <vitaly.torshyn@gmail.com>
---
sound/pci/hda/patch_realtek.c | 7 +++++++
1 file changed, 7 insertions(+)

+       SND_PCI_QUIRK(0x1043, 0x1a83, "ASUS UM5302LA",
ALC294_FIXUP_CS35L41_I2C_2),
       SND_PCI_QUIRK(0x1043, 0x1f92, "ASUS ROG Flow X16",
ALC289_FIXUP_ASUS_GA401),
       SND_PCI_QUIRK(0x1043, 0x3030, "ASUS ZN270IE",
ALC256_FIXUP_ASUS_AIO_GPIO2),
       SND_PCI_QUIRK(0x1043, 0x3a20, "ASUS G614JZR",
ALC245_FIXUP_CS35L41_SPI_2),

Comments

Vitalii Torshyn Nov. 9, 2023, 1:33 p.m. UTC | #1
Dear Takashi,

Thanks a lot for the quick review.
My idea was to keep "similar" devices' quirks close to each other but I do
agree that using PCI SSID makes more sense.

Please find the updated version of the patch attached.

Vitalii
---
diff --git a/sound/pci/hda/patch_realtek.c b/sound/pci/hda/patch_realtek.c
index 58006c8bc..a28d078c9 100644
--- a/sound/pci/hda/patch_realtek.c
+++ b/sound/pci/hda/patch_realtek.c
@@ -7444,6 +7444,7 @@ enum {
       ALC287_FIXUP_THINKPAD_I2S_SPK,
       ALC287_FIXUP_MG_RTKC_CSAMP_CS35L41_I2C_THINKPAD,
       ALC2XX_FIXUP_HEADSET_MIC,
+       ALC294_FIXUP_CS35L41_I2C_2
};

/* A special fixup for Lenovo C940 and Yoga Duet 7;
@@ -9552,6 +9553,11 @@ static const struct hda_fixup alc269_fixups[] = {
               .type = HDA_FIXUP_FUNC,
               .v.func = alc_fixup_headset_mic,
       },
+       [ALC294_FIXUP_CS35L41_I2C_2] = {
+               .type = HDA_FIXUP_FUNC,
+               .v.func = cs35l41_fixup_i2c_two,
+       },
+
};

static const struct snd_pci_quirk alc269_fixup_tbl[] = {
@@ -9913,6 +9919,7 @@ static const struct snd_pci_quirk alc269_fixup_tbl[]
= {
       SND_PCI_QUIRK(0x1043, 0x19e1, "ASUS UX581LV",
ALC295_FIXUP_ASUS_MIC_NO_PRESENCE),
       SND_PCI_QUIRK(0x1043, 0x1a13, "Asus G73Jw",
ALC269_FIXUP_ASUS_G73JW),
       SND_PCI_QUIRK(0x1043, 0x1a30, "ASUS X705UD", ALC256_FIXUP_ASUS_MIC),
+       SND_PCI_QUIRK(0x1043, 0x1a83, "ASUS UM5302LA",
ALC294_FIXUP_CS35L41_I2C_2),
       SND_PCI_QUIRK(0x1043, 0x1a8f, "ASUS UX582ZS",
ALC245_FIXUP_CS35L41_SPI_2),
       SND_PCI_QUIRK(0x1043, 0x1b11, "ASUS UX431DA",
ALC294_FIXUP_ASUS_COEF_1B),
       SND_PCI_QUIRK(0x1043, 0x1b13, "Asus U41SV", ALC269_FIXUP_INV_DMIC),




On Thu, 9 Nov 2023 at 09:40, Takashi Iwai <tiwai@suse.de> wrote:

> On Thu, 09 Nov 2023 01:22:57 +0100,
> vitaly.torshyn@gmail.com wrote:
> >
> >
> > Hi Takashi,
> >
> > Proposed patch fixes initialization of CSC3551 on the UM5302LA laptop.
> > Patching DSDT table is not required since ASUS did added _DSD entry.
> > Nothing new introduced but reused work started by Stefan B.
> >
> > Currently there is no official firmware available for 10431A83 on cirrus
> git
> > unfortunately.
> > For testing used 104317f3 (which is also seems on i2c bus):
> >
> > $ cd /lib/firmware/cirrus/ && \
> > for fw in $(find ./ -name '*104317f3*'); do newfw=$(echo $fw | sed
> 's/104317f3
> > /10431a83/g'); echo echo "$fw -> $newfw"; ln -s $f $newfw; done
> >
> > With the patch applied to 6.6.0 and obviously symlinks to 104317F3 FW,
> > speakers works and to my susrprise they sound quite good and loud without
> > distortion.
> >
> > Probably confirmation from cirrus team is needed on firmware.
> >
> > Signed-off-by: Vitalii Torshyn <vitaly.torshyn@gmail.com>
>
> Thanks for the patch.
> The change looks almost fine, but only one thing:
>
> > @@ -9937,6 +9943,7 @@ static const struct snd_pci_quirk
> alc269_fixup_tbl[] = {
> >       SND_PCI_QUIRK(0x1043, 0x1c52, "ASUS Zephyrus G15 2022",
> ALC289_FIXUP_ASUS_GA401),
> >       SND_PCI_QUIRK(0x1043, 0x1f11, "ASUS Zephyrus G14",
> ALC289_FIXUP_ASUS_GA401),
> >       SND_PCI_QUIRK(0x1043, 0x1f12, "ASUS UM5302",
> ALC287_FIXUP_CS35L41_I2C_2),
> > +     SND_PCI_QUIRK(0x1043, 0x1a83, "ASUS UM5302LA",
> ALC294_FIXUP_CS35L41_I2C_2),
>
> The entry is sorted in PCI SSID order.  Please put at the right
> position.
>
>
> thanks,
>
> Takashi
>
Takashi Iwai Nov. 9, 2023, 2:15 p.m. UTC | #2
On Thu, 09 Nov 2023 14:33:21 +0100,
vitaly.torshyn@gmail.com wrote:
> 
> 
> Dear Takashi,
> 
> Thanks a lot for the quick review.
> My idea was to keep "similar" devices' quirks close to each other but I do
> agree that using PCI SSID makes more sense.
> 
> Please find the updated version of the patch attached.

Could you rather resubmit properly as v2 patch?


thanks,

Takashi
diff mbox series

Patch

From 8c6432e79f5669a7ed48069db0a92edd69d2b095 Mon Sep 17 00:00:00 2001
From: Vitalii Torshyn <vitaly.torshyn@gmail.com>
Date: Thu, 9 Nov 2023 01:13:54 +0200
Subject: [PATCH 1/1] ALSA: HDA: Asus UM5302LA: Added quirks for cs35L41/10431A83 on i2c bus
To: tiwai@suse.de
Cc: perex@perex.cz,alsa-devel@alsa-project.org
MIME-Version: 1.0
Content-Type: multipart/mixed; boundary="------------alsa-hda-cs35l41-asus-um5302la-fix.patch"

This is a multi-part message in MIME format.
--------------alsa-hda-cs35l41-asus-um5302la-fix.patch
Content-Type: text/plain; charset=UTF-8; format=fixed
Content-Transfer-Encoding: 8bit
Hi Takashi,

Proposed patch fixes initialization of CSC3551 on the UM5302LA laptop.
Patching DSDT table is not required since ASUS did added _DSD entry.
Nothing new introduced but reused work started by Stefan B.

Currently there is no official firmware available for 10431A83 on cirrus git unfortunately.
For testing used 104317f3 (which is also seems on i2c bus):

$ cd /lib/firmware/cirrus/ && \
for fw in $(find ./ -name '*104317f3*'); do newfw=$(echo $fw | sed 's/104317f3/10431a83/g'); echo echo "$fw -> $newfw"; ln -s $f $newfw; done

With the patch applied to 6.6.0 and obviously symlinks to 104317F3 FW, speakers works and to my susrprise they sound quite good and loud without distortion.

Probably confirmation from cirrus team is needed on firmware.

Signed-off-by: Vitalii Torshyn <vitaly.torshyn@gmail.com>
---
 sound/pci/hda/patch_realtek.c | 7 +++++++
 1 file changed, 7 insertions(+)


--------------alsa-hda-cs35l41-asus-um5302la-fix.patch
Content-Type: text/x-patch; name="0001-Subject-PATCH-ALSA-HDA-Asus-UM5302LA-Added-quirks-fo.patch"
Content-Transfer-Encoding: 8bit
Content-Disposition: attachment; filename="0001-Subject-PATCH-ALSA-HDA-Asus-UM5302LA-Added-quirks-fo.patch"

diff --git a/sound/pci/hda/patch_realtek.c b/sound/pci/hda/patch_realtek.c
index 58006c8bc..52956b58a 100644
--- a/sound/pci/hda/patch_realtek.c
+++ b/sound/pci/hda/patch_realtek.c
@@ -7444,6 +7444,7 @@  enum {
 	ALC287_FIXUP_THINKPAD_I2S_SPK,
 	ALC287_FIXUP_MG_RTKC_CSAMP_CS35L41_I2C_THINKPAD,
 	ALC2XX_FIXUP_HEADSET_MIC,
+	ALC294_FIXUP_CS35L41_I2C_2
 };
 
 /* A special fixup for Lenovo C940 and Yoga Duet 7;
@@ -9552,6 +9553,11 @@  static const struct hda_fixup alc269_fixups[] = {
 		.type = HDA_FIXUP_FUNC,
 		.v.func = alc_fixup_headset_mic,
 	},
+	[ALC294_FIXUP_CS35L41_I2C_2] = {
+		.type = HDA_FIXUP_FUNC,
+		.v.func = cs35l41_fixup_i2c_two,
+	},
+
 };
 
 static const struct snd_pci_quirk alc269_fixup_tbl[] = {
@@ -9937,6 +9943,7 @@  static const struct snd_pci_quirk alc269_fixup_tbl[] = {
 	SND_PCI_QUIRK(0x1043, 0x1c52, "ASUS Zephyrus G15 2022", ALC289_FIXUP_ASUS_GA401),
 	SND_PCI_QUIRK(0x1043, 0x1f11, "ASUS Zephyrus G14", ALC289_FIXUP_ASUS_GA401),
 	SND_PCI_QUIRK(0x1043, 0x1f12, "ASUS UM5302", ALC287_FIXUP_CS35L41_I2C_2),
+	SND_PCI_QUIRK(0x1043, 0x1a83, "ASUS UM5302LA", ALC294_FIXUP_CS35L41_I2C_2),
 	SND_PCI_QUIRK(0x1043, 0x1f92, "ASUS ROG Flow X16", ALC289_FIXUP_ASUS_GA401),
 	SND_PCI_QUIRK(0x1043, 0x3030, "ASUS ZN270IE", ALC256_FIXUP_ASUS_AIO_GPIO2),
 	SND_PCI_QUIRK(0x1043, 0x3a20, "ASUS G614JZR", ALC245_FIXUP_CS35L41_SPI_2),

--------------alsa-hda-cs35l41-asus-um5302la-fix.patch--