Linux Sound subsystem development
 help / color / mirror / Atom feed
From: Stefan Binding <sbinding@opensource.cirrus.com>
To: ArcticLampyrid <ArcticLampyrid@outlook.com>,
	<james.schulman@cirrus.com>, <david.rhodes@cirrus.com>,
	<rf@opensource.cirrus.com>
Cc: <patches@opensource.cirrus.com>, <linux-sound@vger.kernel.org>,
	<linux-kernel@vger.kernel.org>, <stable@vger.kernel.org>
Subject: Re: [PATCH] ALSA: hda/realtek: Fix internal speakers for Legion Y9000X 2022 IAH7
Date: Mon, 15 Apr 2024 10:55:33 +0100	[thread overview]
Message-ID: <335eb6d4-424e-43e5-8990-3d87ad579e7c@opensource.cirrus.com> (raw)
In-Reply-To: <TYCP286MB25352F3E995FED9CCE90F1F6C40B2@TYCP286MB2535.JPNP286.PROD.OUTLOOK.COM>

Hi,

On 13/04/2024 14:07, ArcticLampyrid wrote:
> This fixes the sound not working from internal speakers on
> Lenovo Legion Y9000X 2022 IAH7 models.
>
> Signed-off-by: ArcticLampyrid <ArcticLampyrid@outlook.com>
> Cc: <stable@vger.kernel.org>
> ---
>   sound/pci/hda/cs35l41_hda_property.c | 17 +++++++++++++++++
>   sound/pci/hda/patch_realtek.c        |  1 +
>   2 files changed, 18 insertions(+)
>
> diff --git a/sound/pci/hda/cs35l41_hda_property.c b/sound/pci/hda/cs35l41_hda_property.c
> index 8fb688e41..244e41d51 100644
> --- a/sound/pci/hda/cs35l41_hda_property.c
> +++ b/sound/pci/hda/cs35l41_hda_property.c
> @@ -109,6 +109,7 @@ static const struct cs35l41_config cs35l41_config_table[] = {
>   	{ "10431F1F", 2, EXTERNAL, { CS35L41_LEFT, CS35L41_RIGHT, 0, 0 }, 1, -1, 0, 0, 0, 0 },
>   	{ "10431F62", 2, EXTERNAL, { CS35L41_LEFT, CS35L41_RIGHT, 0, 0 }, 1, 2, 0, 0, 0, 0 },
>   	{ "10433A60", 2, INTERNAL, { CS35L41_LEFT, CS35L41_RIGHT, 0, 0 }, 1, 2, 0, 1000, 4500, 24 },
> +	{ "17AA386E", 2, EXTERNAL, { CS35L41_LEFT, CS35L41_RIGHT, 0, 0 }, 0, 1, -1, 0, 0, 0 },

According to the ACPI that I have access to, this is not correct - the 
Speaker ID is on index 2 not index 1.
Index 1 has a reference to the interrupt line. Therefore this should be:

	{ "17AA386E", 2, EXTERNAL, { CS35L41_LEFT, CS35L41_RIGHT, 0, 0 }, 0, 2, -1, 0, 0, 0 },

>   	{ "17AA386F", 2, EXTERNAL, { CS35L41_LEFT, CS35L41_RIGHT, 0, 0 }, 0, -1, -1, 0, 0, 0 },
>   	{ "17AA3877", 2, EXTERNAL, { CS35L41_LEFT, CS35L41_RIGHT, 0, 0 }, 0, 1, -1, 0, 0, 0 },
>   	{ "17AA3878", 2, EXTERNAL, { CS35L41_LEFT, CS35L41_RIGHT, 0, 0 }, 0, 1, -1, 0, 0, 0 },
> @@ -414,6 +415,21 @@ static int lenovo_legion_no_acpi(struct cs35l41_hda *cs35l41, struct device *phy
>   	return 0;
>   }
>   
> +/*
> + * Some devices just have a single interrupt line for multiple amps, for which we
> + * should just register the interrupt for the first amp. Otherwise, we would meet EBUSY
> + * when registering the interrupt for the second amp.
> + */
> +static int single_interrupt_dsd_config(struct cs35l41_hda *cs35l41, struct device *physdev, int id,
> +			       const char *hid)
> +{
> +	generic_dsd_config(cs35l41, physdev, id, hid);
> +	if (id != 0x40) {
> +		cs35l41->hw_cfg.gpio2.func = CS35L41_NOT_USED;
> +	}
> +	return 0;
> +}
> +

According to the schematics I have access to, both amps have a reset 
line. The reason for any issue you see may be
because you have assigned the speaker id for the interrupt gpio in ACPI 
as mentioned above.

Thanks,

Stefan

>   struct cs35l41_prop_model {
>   	const char *hid;
>   	const char *ssid;
> @@ -500,6 +516,7 @@ static const struct cs35l41_prop_model cs35l41_prop_model_table[] = {
>   	{ "CSC3551", "10431F1F", generic_dsd_config },
>   	{ "CSC3551", "10431F62", generic_dsd_config },
>   	{ "CSC3551", "10433A60", generic_dsd_config },
> +	{ "CSC3551", "17AA386E", single_interrupt_dsd_config },
>   	{ "CSC3551", "17AA386F", generic_dsd_config },
>   	{ "CSC3551", "17AA3877", generic_dsd_config },
>   	{ "CSC3551", "17AA3878", generic_dsd_config },
> diff --git a/sound/pci/hda/patch_realtek.c b/sound/pci/hda/patch_realtek.c
> index cdcb28aa9..ac729187f 100644
> --- a/sound/pci/hda/patch_realtek.c
> +++ b/sound/pci/hda/patch_realtek.c
> @@ -10382,6 +10382,7 @@ static const struct snd_pci_quirk alc269_fixup_tbl[] = {
>   	SND_PCI_QUIRK(0x17aa, 0x3853, "Lenovo Yoga 7 15ITL5", ALC287_FIXUP_YOGA7_14ITL_SPEAKERS),
>   	SND_PCI_QUIRK(0x17aa, 0x3855, "Legion 7 16ITHG6", ALC287_FIXUP_LEGION_16ITHG6),
>   	SND_PCI_QUIRK(0x17aa, 0x3869, "Lenovo Yoga7 14IAL7", ALC287_FIXUP_YOGA9_14IAP7_BASS_SPK_PIN),
> +	SND_PCI_QUIRK(0x17aa, 0x386e, "Legion Y9000X 2022 IAH7", ALC287_FIXUP_CS35L41_I2C_2),
>   	SND_PCI_QUIRK(0x17aa, 0x386f, "Legion 7i 16IAX7", ALC287_FIXUP_CS35L41_I2C_2),
>   	SND_PCI_QUIRK(0x17aa, 0x3870, "Lenovo Yoga 7 14ARB7", ALC287_FIXUP_YOGA7_14ARB7_I2C),
>   	SND_PCI_QUIRK(0x17aa, 0x3877, "Lenovo Legion 7 Slim 16ARHA7", ALC287_FIXUP_CS35L41_I2C_2),

  reply	other threads:[~2024-04-15  9:55 UTC|newest]

Thread overview: 6+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2024-04-13 13:07 [PATCH] ALSA: hda/realtek: Fix internal speakers for Legion Y9000X 2022 IAH7 ArcticLampyrid
2024-04-15  9:55 ` Stefan Binding [this message]
2024-04-15 16:49   ` ArcticLampyrid
2024-04-17 15:18     ` Stefan Binding
2024-04-18  4:03       ` ArcticLampyrid
2024-04-18  6:51 ` ArcticLampyrid

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=335eb6d4-424e-43e5-8990-3d87ad579e7c@opensource.cirrus.com \
    --to=sbinding@opensource.cirrus.com \
    --cc=ArcticLampyrid@outlook.com \
    --cc=david.rhodes@cirrus.com \
    --cc=james.schulman@cirrus.com \
    --cc=linux-kernel@vger.kernel.org \
    --cc=linux-sound@vger.kernel.org \
    --cc=patches@opensource.cirrus.com \
    --cc=rf@opensource.cirrus.com \
    --cc=stable@vger.kernel.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox