diff mbox series

[v4,8/9] ALSA: hda/realtek: Add support for HP Laptops

Message ID 20220120134326.5295-9-sbinding@opensource.cirrus.com (mailing list archive)
State Superseded
Headers show
Series Support Spi in i2c-multi-instantiate driver | expand

Commit Message

Stefan Binding Jan. 20, 2022, 1:43 p.m. UTC
From: Lucas Tanure <tanureal@opensource.cirrus.com>

Add support for two and four CS35L41 using the component
binding method

Signed-off-by: Lucas Tanure <tanureal@opensource.cirrus.com>
Signed-off-by: Stefan Binding <sbinding@opensource.cirrus.com>
---
 sound/pci/hda/patch_realtek.c | 43 ++++++++++++++++++++++++++++++++++-
 1 file changed, 42 insertions(+), 1 deletion(-)

Comments

Takashi Iwai Jan. 20, 2022, 3:27 p.m. UTC | #1
On Thu, 20 Jan 2022 14:43:25 +0100,
Stefan Binding wrote:
> 
> From: Lucas Tanure <tanureal@opensource.cirrus.com>
> 
> Add support for two and four CS35L41 using the component
> binding method
> 
> Signed-off-by: Lucas Tanure <tanureal@opensource.cirrus.com>
> Signed-off-by: Stefan Binding <sbinding@opensource.cirrus.com>

I guess this patch won't be applicable until ACPI or other tree syncs
with the latest Linus tree or sound git tree.  Must this patch be
merged with other patches?

About the code change:

> +	SND_PCI_QUIRK(0x103c, 0x896E, "HP EliteBook x360 830 G9", ALC245_FIXUP_CS35L41_SPI_2),
> +	SND_PCI_QUIRK(0x103c, 0x8971, "HP EliteBook 830 G9", ALC245_FIXUP_CS35L41_SPI_2),
> +	SND_PCI_QUIRK(0x103c, 0x8972, "HP EliteBook 840 G9", ALC245_FIXUP_CS35L41_SPI_2),
> +	SND_PCI_QUIRK(0x103c, 0x8973, "HP EliteBook 860 G9", ALC245_FIXUP_CS35L41_SPI_2),
> +	SND_PCI_QUIRK(0x103c, 0x8974, "HP EliteBook 840 Aero G9", ALC245_FIXUP_CS35L41_SPI_2),
> +	SND_PCI_QUIRK(0x103c, 0x8975, "HP EliteBook x360 840 Aero G9", ALC245_FIXUP_CS35L41_SPI_2),
> +	SND_PCI_QUIRK(0x103c, 0x8981, "HP Elite Dragonfly G3", ALC245_FIXUP_CS35L41_SPI_4),
> +	SND_PCI_QUIRK(0x103c, 0x898E, "HP EliteBook 835 G9", ALC287_FIXUP_CS35L41_I2C_2),
> +	SND_PCI_QUIRK(0x103c, 0x898F, "HP EliteBook 835 G9", ALC287_FIXUP_CS35L41_I2C_2),
> +	SND_PCI_QUIRK(0x103c, 0x8991, "HP EliteBook 845 G9", ALC287_FIXUP_CS35L41_I2C_2),
> +	SND_PCI_QUIRK(0x103c, 0x8992, "HP EliteBook 845 G9", ALC287_FIXUP_CS35L41_I2C_2),
> +	SND_PCI_QUIRK(0x103c, 0x8994, "HP EliteBook 855 G9", ALC287_FIXUP_CS35L41_I2C_2),
> +	SND_PCI_QUIRK(0x103c, 0x8995, "HP EliteBook 855 G9", ALC287_FIXUP_CS35L41_I2C_2),
> +	SND_PCI_QUIRK(0x103c, 0x89C3, "Zbook Studio G9", ALC245_FIXUP_CS35L41_SPI_4_HP_GPIO_LED),
> +	SND_PCI_QUIRK(0x103c, 0x89C6, "Zbook Fury 17 G9", ALC245_FIXUP_CS35L41_SPI_2),

Please put the entries at the right places to keep the table in SSID
order.


thanks,

Takashi
Stefan Binding Jan. 21, 2022, 2:32 p.m. UTC | #2
Hi Takashi,

> -----Original Message-----
> From: Alsa-devel <alsa-devel-bounces@alsa-project.org> On Behalf Of
> Takashi Iwai
> Sent: 20 January 2022 15:27
> To: Stefan Binding <sbinding@opensource.cirrus.com>
> Cc: platform-driver-x86@vger.kernel.org; alsa-devel@alsa-project.org;
linux-
> acpi@vger.kernel.org; Lucas Tanure <tanureal@opensource.cirrus.com>;
> Rafael J . Wysocki <rafael@kernel.org>; linux-kernel@vger.kernel.org;
> Takashi Iwai <tiwai@suse.com>; Mark Gross <markgross@kernel.org>; Hans
> de Goede <hdegoede@redhat.com>; Mark Brown <broonie@kernel.org>;
> patches@opensource.cirrus.com; linux-spi@vger.kernel.org; Len Brown
> <lenb@kernel.org>
> Subject: Re: [PATCH v4 8/9] ALSA: hda/realtek: Add support for HP Laptops
> 
> On Thu, 20 Jan 2022 14:43:25 +0100,
> Stefan Binding wrote:
> >
> > From: Lucas Tanure <tanureal@opensource.cirrus.com>
> >
> > Add support for two and four CS35L41 using the component
> > binding method
> >
> > Signed-off-by: Lucas Tanure <tanureal@opensource.cirrus.com>
> > Signed-off-by: Stefan Binding <sbinding@opensource.cirrus.com>
> 
> I guess this patch won't be applicable until ACPI or other tree syncs
> with the latest Linus tree or sound git tree.  Must this patch be
> merged with other patches?

In order for these laptops to work correctly, it will need all of the
patches merged,
including both this change and the ACPI changes - without the ACPI changes,
some of the amps will not probe.

Thanks,
Stefan
Takashi Iwai Jan. 21, 2022, 2:39 p.m. UTC | #3
On Fri, 21 Jan 2022 15:32:24 +0100,
Stefan Binding wrote:
> 
> Hi Takashi,
> 
> > -----Original Message-----
> > From: Alsa-devel <alsa-devel-bounces@alsa-project.org> On Behalf Of
> > Takashi Iwai
> > Sent: 20 January 2022 15:27
> > To: Stefan Binding <sbinding@opensource.cirrus.com>
> > Cc: platform-driver-x86@vger.kernel.org; alsa-devel@alsa-project.org;
> linux-
> > acpi@vger.kernel.org; Lucas Tanure <tanureal@opensource.cirrus.com>;
> > Rafael J . Wysocki <rafael@kernel.org>; linux-kernel@vger.kernel.org;
> > Takashi Iwai <tiwai@suse.com>; Mark Gross <markgross@kernel.org>; Hans
> > de Goede <hdegoede@redhat.com>; Mark Brown <broonie@kernel.org>;
> > patches@opensource.cirrus.com; linux-spi@vger.kernel.org; Len Brown
> > <lenb@kernel.org>
> > Subject: Re: [PATCH v4 8/9] ALSA: hda/realtek: Add support for HP Laptops
> > 
> > On Thu, 20 Jan 2022 14:43:25 +0100,
> > Stefan Binding wrote:
> > >
> > > From: Lucas Tanure <tanureal@opensource.cirrus.com>
> > >
> > > Add support for two and four CS35L41 using the component
> > > binding method
> > >
> > > Signed-off-by: Lucas Tanure <tanureal@opensource.cirrus.com>
> > > Signed-off-by: Stefan Binding <sbinding@opensource.cirrus.com>
> > 
> > I guess this patch won't be applicable until ACPI or other tree syncs
> > with the latest Linus tree or sound git tree.  Must this patch be
> > merged with other patches?
> 
> In order for these laptops to work correctly, it will need all of the
> patches merged,
> including both this change and the ACPI changes - without the ACPI changes,
> some of the amps will not probe.

Well, the question is whether merging it would break other things or
not.

Currently the sound on the laptop won't work anyway, and applying this
in other tree would need the back-pull of existing HD-audio changes
from sound.git tree or Linus treee, which is often cumbersome.  The
goal is to plumb everything up in 5.17-rc as soon as possible, and
it's often faster if each tree concentrates on only the responsible
bits.


Takashi
diff mbox series

Patch

diff --git a/sound/pci/hda/patch_realtek.c b/sound/pci/hda/patch_realtek.c
index 668274e52674..956515aa4ec3 100644
--- a/sound/pci/hda/patch_realtek.c
+++ b/sound/pci/hda/patch_realtek.c
@@ -6611,6 +6611,16 @@  static void cs35l41_fixup_i2c_two(struct hda_codec *cdc, const struct hda_fixup
 	cs35l41_generic_fixup(cdc, action, "i2c", "CSC3551", 2);
 }
 
+static void cs35l41_fixup_spi_two(struct hda_codec *codec, const struct hda_fixup *fix, int action)
+{
+	cs35l41_generic_fixup(codec, action, "spi0", "CSC3551", 2);
+}
+
+static void cs35l41_fixup_spi_four(struct hda_codec *codec, const struct hda_fixup *fix, int action)
+{
+	cs35l41_generic_fixup(codec, action, "spi0", "CSC3551", 4);
+}
+
 static void alc287_legion_16achg6_playback_hook(struct hda_pcm_stream *hinfo, struct hda_codec *cdc,
 						struct snd_pcm_substream *sub, int action)
 {
@@ -6948,6 +6958,9 @@  enum {
 	ALC285_FIXUP_LEGION_Y9000X_AUTOMUTE,
 	ALC287_FIXUP_LEGION_16ACHG6,
 	ALC287_FIXUP_CS35L41_I2C_2,
+	ALC245_FIXUP_CS35L41_SPI_2,
+	ALC245_FIXUP_CS35L41_SPI_4,
+	ALC245_FIXUP_CS35L41_SPI_4_HP_GPIO_LED,
 	ALC285_FIXUP_HP_SPEAKERS_MICMUTE_LED,
 };
 
@@ -8699,6 +8712,20 @@  static const struct hda_fixup alc269_fixups[] = {
 		.type = HDA_FIXUP_FUNC,
 		.v.func = cs35l41_fixup_i2c_two,
 	},
+	[ALC245_FIXUP_CS35L41_SPI_2] = {
+		.type = HDA_FIXUP_FUNC,
+		.v.func = cs35l41_fixup_spi_two,
+	},
+	[ALC245_FIXUP_CS35L41_SPI_4] = {
+		.type = HDA_FIXUP_FUNC,
+		.v.func = cs35l41_fixup_spi_four,
+	},
+	[ALC245_FIXUP_CS35L41_SPI_4_HP_GPIO_LED] = {
+		.type = HDA_FIXUP_FUNC,
+		.v.func = alc245_fixup_hp_gpio_led,
+		.chained = true,
+		.chain_id = ALC245_FIXUP_CS35L41_SPI_4,
+	},
 	[ALC285_FIXUP_HP_SPEAKERS_MICMUTE_LED] = {
 		.type = HDA_FIXUP_VERBS,
 		.v.verbs = (const struct hda_verb[]) {
@@ -8926,8 +8953,22 @@  static const struct snd_pci_quirk alc269_fixup_tbl[] = {
 	SND_PCI_QUIRK(0x103c, 0x8896, "HP EliteBook 855 G8 Notebook PC", ALC285_FIXUP_HP_MUTE_LED),
 	SND_PCI_QUIRK(0x103c, 0x8898, "HP EliteBook 845 G8 Notebook PC", ALC285_FIXUP_HP_LIMIT_INT_MIC_BOOST),
 	SND_PCI_QUIRK(0x103c, 0x88d0, "HP Pavilion 15-eh1xxx (mainboard 88D0)", ALC287_FIXUP_HP_GPIO_LED),
-	SND_PCI_QUIRK(0x103c, 0x89c3, "HP", ALC285_FIXUP_HP_GPIO_LED),
 	SND_PCI_QUIRK(0x103c, 0x89ca, "HP", ALC236_FIXUP_HP_MUTE_LED_MICMUTE_VREF),
+	SND_PCI_QUIRK(0x103c, 0x896E, "HP EliteBook x360 830 G9", ALC245_FIXUP_CS35L41_SPI_2),
+	SND_PCI_QUIRK(0x103c, 0x8971, "HP EliteBook 830 G9", ALC245_FIXUP_CS35L41_SPI_2),
+	SND_PCI_QUIRK(0x103c, 0x8972, "HP EliteBook 840 G9", ALC245_FIXUP_CS35L41_SPI_2),
+	SND_PCI_QUIRK(0x103c, 0x8973, "HP EliteBook 860 G9", ALC245_FIXUP_CS35L41_SPI_2),
+	SND_PCI_QUIRK(0x103c, 0x8974, "HP EliteBook 840 Aero G9", ALC245_FIXUP_CS35L41_SPI_2),
+	SND_PCI_QUIRK(0x103c, 0x8975, "HP EliteBook x360 840 Aero G9", ALC245_FIXUP_CS35L41_SPI_2),
+	SND_PCI_QUIRK(0x103c, 0x8981, "HP Elite Dragonfly G3", ALC245_FIXUP_CS35L41_SPI_4),
+	SND_PCI_QUIRK(0x103c, 0x898E, "HP EliteBook 835 G9", ALC287_FIXUP_CS35L41_I2C_2),
+	SND_PCI_QUIRK(0x103c, 0x898F, "HP EliteBook 835 G9", ALC287_FIXUP_CS35L41_I2C_2),
+	SND_PCI_QUIRK(0x103c, 0x8991, "HP EliteBook 845 G9", ALC287_FIXUP_CS35L41_I2C_2),
+	SND_PCI_QUIRK(0x103c, 0x8992, "HP EliteBook 845 G9", ALC287_FIXUP_CS35L41_I2C_2),
+	SND_PCI_QUIRK(0x103c, 0x8994, "HP EliteBook 855 G9", ALC287_FIXUP_CS35L41_I2C_2),
+	SND_PCI_QUIRK(0x103c, 0x8995, "HP EliteBook 855 G9", ALC287_FIXUP_CS35L41_I2C_2),
+	SND_PCI_QUIRK(0x103c, 0x89C3, "Zbook Studio G9", ALC245_FIXUP_CS35L41_SPI_4_HP_GPIO_LED),
+	SND_PCI_QUIRK(0x103c, 0x89C6, "Zbook Fury 17 G9", ALC245_FIXUP_CS35L41_SPI_2),
 	SND_PCI_QUIRK(0x1043, 0x103e, "ASUS X540SA", ALC256_FIXUP_ASUS_MIC),
 	SND_PCI_QUIRK(0x1043, 0x103f, "ASUS TX300", ALC282_FIXUP_ASUS_TX300),
 	SND_PCI_QUIRK(0x1043, 0x106d, "Asus K53BE", ALC269_FIXUP_LIMIT_INT_MIC_BOOST),