Linux ACPI
 help / color / mirror / Atom feed
From: Ilya Pavlukhin <i.pavluhin@ya.ru>
To: Takashi Iwai <tiwai@suse.com>
Cc: "Jaroslav Kysela" <perex@perex.cz>,
	"David Rhodes" <david.rhodes@cirrus.com>,
	"Richard Fitzgerald" <rf@opensource.cirrus.com>,
	"Rafael J . Wysocki" <rafael@kernel.org>,
	"Len Brown" <lenb@kernel.org>, "Hans de Goede" <hansg@kernel.org>,
	"Ilpo Järvinen" <ilpo.jarvinen@linux.intel.com>,
	linux-sound@vger.kernel.org, patches@opensource.cirrus.com,
	linux-acpi@vger.kernel.org, platform-driver-x86@vger.kernel.org,
	linux-kernel@vger.kernel.org
Subject: [PATCH 3/4] ALSA: hda: cs35l41: Add support for CLSA0102
Date: Sun, 20 Sep 2026 12:28:07 +0300	[thread overview]
Message-ID: <20260920092808.17234-4-i.pavluhin@ya.ru> (raw)
In-Reply-To: <20260920092808.17234-1-i.pavluhin@ya.ru>

The Lenovo Yoga Slim 7 Carbon 14ACN6 (82L0) drives its bass speakers
with two CS35L41 amplifiers, described by ACPI HID CLSA0102 without a
_DSD. The node has the same layout as CLSA0100/CLSA0101: both amps in
one node, reset on GPIO index 0 and the interrupt on a GpioInt. Unlike
the Legion 7 there is no speaker ID GPIO, index 2 is the interrupt line.

The Windows driver runs the amps from an external VSPK supply
(ExternalVspkControl, boost converter disabled), so use
CS35L41_EXT_BOOST with the VSPK switch on GPIO1. With the internal
boost converter enabled the amps report "Amp short error" during
playback.

There is no _SUB in the ACPI node, so the firmware files are looked up
by the codec SSID, 17aa3856.

Link: https://bugzilla.kernel.org/show_bug.cgi?id=215632
Assisted-by: Claude Opus 5
Signed-off-by: Ilya Pavlukhin <i.pavluhin@ya.ru>
---
 .../hda/codecs/side-codecs/cs35l41_hda_i2c.c  |  3 ++
 .../codecs/side-codecs/cs35l41_hda_property.c | 28 +++++++++++++++++++
 2 files changed, 31 insertions(+)

diff --git a/sound/hda/codecs/side-codecs/cs35l41_hda_i2c.c b/sound/hda/codecs/side-codecs/cs35l41_hda_i2c.c
index fdf406e92..59b82238f 100644
--- a/sound/hda/codecs/side-codecs/cs35l41_hda_i2c.c
+++ b/sound/hda/codecs/side-codecs/cs35l41_hda_i2c.c
@@ -23,6 +23,8 @@ static int cs35l41_hda_i2c_probe(struct i2c_client *clt)
 		device_name = "CLSA0100";
 	else if (strstr(dev_name(&clt->dev), "CLSA0101"))
 		device_name = "CLSA0101";
+	else if (strstr(dev_name(&clt->dev), "CLSA0102"))
+		device_name = "CLSA0102";
 	else if (strstr(dev_name(&clt->dev), "CSC3551"))
 		device_name = "CSC3551";
 	else
@@ -45,6 +47,7 @@ static const struct i2c_device_id cs35l41_hda_i2c_id[] = {
 static const struct acpi_device_id cs35l41_acpi_hda_match[] = {
 	{"CLSA0100", 0 },
 	{"CLSA0101", 0 },
+	{"CLSA0102", 0 },
 	{"CSC3551", 0 },
 	{}
 };
diff --git a/sound/hda/codecs/side-codecs/cs35l41_hda_property.c b/sound/hda/codecs/side-codecs/cs35l41_hda_property.c
index 416d7bf3e..c4f2bbed0 100644
--- a/sound/hda/codecs/side-codecs/cs35l41_hda_property.c
+++ b/sound/hda/codecs/side-codecs/cs35l41_hda_property.c
@@ -439,6 +439,33 @@ static int lenovo_legion_no_acpi(struct cs35l41_hda *cs35l41, struct device *phy
 	return 0;
 }
 
+/*
+ * Device CLSA0102 (Lenovo Yoga Slim 7 Carbon 14ACN6) has the same ACPI layout as CLSA010(0/1):
+ * no _DSD, both amps in one node, reset on GPIO index 0. It has no speaker ID GPIO, the
+ * interrupt GPIO sits at index 2. The speakers use an external VSPK supply switched by GPIO1
+ * (the Windows driver sets ExternalVspkControl and keeps the boost converter off).
+ */
+static int lenovo_yoga_slim7_carbon_no_acpi(struct cs35l41_hda *cs35l41, struct device *physdev,
+					    int id, const char *hid)
+{
+	struct cs35l41_hw_cfg *hw_cfg = &cs35l41->hw_cfg;
+
+	/* check I2C address to assign the index */
+	cs35l41->index = id == 0x40 ? 0 : 1;
+	cs35l41->channel_index = 0;
+	cs35l41->reset_gpio = gpiod_get_index(physdev, NULL, 0, GPIOD_OUT_HIGH);
+	cs35l41->speaker_id = -ENOENT;
+	hw_cfg->spk_pos = cs35l41->index;
+	hw_cfg->bst_type = CS35L41_EXT_BOOST;
+	hw_cfg->gpio1.func = CS35l41_VSPK_SWITCH;
+	hw_cfg->gpio1.valid = true;
+	hw_cfg->gpio2.func = CS35L41_INTERRUPT;
+	hw_cfg->gpio2.valid = true;
+	hw_cfg->valid = true;
+
+	return 0;
+}
+
 static int missing_speaker_id_gpio2(struct cs35l41_hda *cs35l41, struct device *physdev, int id,
 				    const char *hid)
 {
@@ -463,6 +490,7 @@ struct cs35l41_prop_model {
 static const struct cs35l41_prop_model cs35l41_prop_model_table[] = {
 	{ "CLSA0100", NULL, lenovo_legion_no_acpi },
 	{ "CLSA0101", NULL, lenovo_legion_no_acpi },
+	{ "CLSA0102", NULL, lenovo_yoga_slim7_carbon_no_acpi },
 	{ "CSC3551", "10251826", generic_dsd_config },
 	{ "CSC3551", "1025182C", generic_dsd_config },
 	{ "CSC3551", "10251844", generic_dsd_config },
-- 
2.43.0


  parent reply	other threads:[~2026-09-20  9:28 UTC|newest]

Thread overview: 9+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2026-09-20  9:28 [PATCH 0/4] Add support for the bass speakers of Lenovo Yoga Slim 7 Carbon 14ACN6 Ilya Pavlukhin
2026-09-20  9:28 ` [PATCH 1/4] ACPI: scan: Add CLSA0102 to the serial bus ignore list Ilya Pavlukhin
2026-09-22 11:32   ` Rafael J. Wysocki (Intel)
2026-09-20  9:28 ` [PATCH 2/4] platform/x86: serial-multi-instantiate: Add CLSA0102 Ilya Pavlukhin
2026-09-20  9:28 ` Ilya Pavlukhin [this message]
2026-09-20  9:28 ` [PATCH 4/4] ALSA: hda/realtek: Add quirk for Lenovo Yoga Slim 7 Carbon 14ACN6 Ilya Pavlukhin
2026-09-29  9:45 ` [PATCH 0/4] Add support for the bass speakers of " Takashi Iwai
2026-09-29 14:30   ` Stefan Binding
2026-09-29 14:44     ` Takashi Iwai

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=20260920092808.17234-4-i.pavluhin@ya.ru \
    --to=i.pavluhin@ya.ru \
    --cc=david.rhodes@cirrus.com \
    --cc=hansg@kernel.org \
    --cc=ilpo.jarvinen@linux.intel.com \
    --cc=lenb@kernel.org \
    --cc=linux-acpi@vger.kernel.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=linux-sound@vger.kernel.org \
    --cc=patches@opensource.cirrus.com \
    --cc=perex@perex.cz \
    --cc=platform-driver-x86@vger.kernel.org \
    --cc=rafael@kernel.org \
    --cc=rf@opensource.cirrus.com \
    --cc=tiwai@suse.com \
    /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