Skip to contentSkip to conversation

ASoC: Intel: Add Yoga Book RT5677 support

PATCH Superseded Maurizio Casciano 2 participants 5 messages Sep 1 – Sep 2

Subsystems (3)

v6 of 9 Superseded Latest is v9 →

lore
Share & tools
lore
#0 lore raw

v6 cover ASoC: Intel: Add Yoga Book RT5677 support

Hi,

This series adds the Cherry Trail machine driver and machine-table entry needed by the Lenovo Yoga Book YB1-X91F/L with its RT5677 codec and TS3A227E headset detector.

Only the SOF path is enabled. Legacy SST is deliberately not advertised because it has not been validated on this hardware.

Changes in v6:
- Return clock-disable errors to DAPM callers.
- Propagate all headphone, speaker and ASRC GPIO/setup errors. Roll back the first speaker GPIO when the second update fails.
- Restore the mode-3 enable pulse and settling delay required by the external speaker boost amplifier, while checking every GPIO operation.
- Compact the SND_SOC_DAILINK_DEF() declarations and remove the redundant card comment.
- Restrict the driver and machine entry to SOF; remove the legacy SST firmware, board fields and conditional card naming.
- Remove snd_soc_fixup_dai_links_platform_name(). The card registers and all tested endpoints work without it.

Validation:
- W=1 build of cht_rt5677.o and soc-acpi-intel-cht-match.o.
- W=1 build and temporary load of snd-soc-sst-cht-rt5677.ko on the Yoga Book with Linux 7.2.0.
- PCM0 playback and capture.
- PCM1 deep-buffer playback.
- Manual GNOME Settings tests of both built-in speakers and microphone.
- No new kernel errors during the successful final hardware test.

The v6 series is sent as a fresh thread and Yauhen Kharuzhy is copied as co-developer.

Maurizio Casciano (2):
ASoC: Intel: Add Cherry Trail RT5677 machine driver
ASoC: Intel: cht: Add Yoga Book RT5677 machine entry

 sound/soc/intel/boards/Kconfig                |  14 +
 sound/soc/intel/boards/Makefile               |   2 +
 sound/soc/intel/boards/cht_rt5677.c           | 636 ++++++++++++++++++
 .../intel/common/soc-acpi-intel-cht-match.c   |   6 +
 4 files changed, 658 insertions(+)
 create mode 100644 sound/soc/intel/boards/cht_rt5677.c

With Best Regards,
Maurizio Casciano

Signature · 1 line
2.53.0
#1 lore raw

PATCH v6 1/2 ASoC: Intel: Add Cherry Trail RT5677 machine driver

The Lenovo Yoga Book YB1-X91F/L uses the Cherry Trail SSP2 link with an RT5677 codec and a TS3A227E headset detector. Its amplifiers and headphone path also need board-specific GPIO sequencing.

Add a Cherry Trail RT5677 machine driver based on Yauhen Kharuzhy's implementation. Clone the card, DAI links and link components per device so probing never mutates global templates, and allocate jack storage with the device lifetime. Configure MCLK and PLL, jack buttons, microphones, and output controls.

Propagate clock, GPIO and ASRC setup failures so DAPM and probe callers do not continue with partially configured hardware. If the second speaker GPIO update fails, restore the first GPIO to its previous state. Reproduce the mode-3 enable pulse and settling delay required by the external speaker boost amplifier.

Only the SOF path has been validated, so identify the card as SOF and do not advertise legacy SST support. The Yoga Book registered successfully without snd_soc_fixup_dai_links_platform_name(). PCM0 playback and capture, plus PCM1 deep-buffer playback, all passed on the device. Manual Settings tests also confirmed audible built-in speakers and a working microphone.

---
 sound/soc/intel/boards/Kconfig      |  14 +
 sound/soc/intel/boards/Makefile     |   2 +
 sound/soc/intel/boards/cht_rt5677.c | 636 ++++++++++++++++++++++++++++
 3 files changed, 652 insertions(+)
 create mode 100644 sound/soc/intel/boards/cht_rt5677.c
sound/soc/intel/boards/Kconfig +14 -0
index cddbd2aa424e..33b2b409f150 100644
@@ -161,6 +161,20 @@ config SND_SOC_INTEL_CHT_BSW_RT5672_MACH
 	  Say Y or m if you have such a device. This is a recommended option.
 	  If unsure select "N".
 
+config SND_SOC_INTEL_CHT_RT5677_MACH
+	tristate "Cherrytrail with RT5677 codec"
+	depends on I2C && ACPI
+	depends on X86_INTEL_LPSS || COMPILE_TEST
+	depends on GPIOLIB || COMPILE_TEST
+	select SND_SOC_ACPI
+	select SND_SOC_RT5677
+	select SND_SOC_TS3A227E
+	help
+	  This adds support for Cherry Trail platforms with an RT5677 codec
+	  and TS3A227E headset-jack detector. It currently supports the
+	  Lenovo Yoga Book YB1-X91F/L.
+	  Say Y or m if you have such a device. If unsure select "N".
+
 config SND_SOC_INTEL_CHT_BSW_RT5645_MACH
 	tristate "Cherrytrail & Braswell with RT5645/5650 codec"
 	depends on I2C && ACPI
sound/soc/intel/boards/Makefile +2 -0
index 25a1a9066cbf..28940ca02aa7 100644
@@ -9,6 +9,7 @@ snd-soc-sst-bytcr-rt5640-y := bytcr_rt5640.o
 snd-soc-sst-bytcr-rt5651-y := bytcr_rt5651.o
 snd-soc-sst-bytcr-wm5102-y := bytcr_wm5102.o
 snd-soc-sst-cht-bsw-rt5672-y := cht_bsw_rt5672.o
+snd-soc-sst-cht-rt5677-y := cht_rt5677.o
 snd-soc-sst-cht-bsw-rt5645-y := cht_bsw_rt5645.o
 snd-soc-sst-cht-bsw-max98090_ti-y := cht_bsw_max98090_ti.o
 snd-soc-sst-cht-bsw-nau8824-y := cht_bsw_nau8824.o
@@ -41,6 +42,7 @@ obj-$(CONFIG_SND_SOC_INTEL_BYTCR_RT5640_MACH) += snd-soc-sst-bytcr-rt5640.o
 obj-$(CONFIG_SND_SOC_INTEL_BYTCR_RT5651_MACH) += snd-soc-sst-bytcr-rt5651.o
 obj-$(CONFIG_SND_SOC_INTEL_BYTCR_WM5102_MACH) += snd-soc-sst-bytcr-wm5102.o
 obj-$(CONFIG_SND_SOC_INTEL_CHT_BSW_RT5672_MACH) += snd-soc-sst-cht-bsw-rt5672.o
+obj-$(CONFIG_SND_SOC_INTEL_CHT_RT5677_MACH) += snd-soc-sst-cht-rt5677.o
 obj-$(CONFIG_SND_SOC_INTEL_CHT_BSW_RT5645_MACH) += snd-soc-sst-cht-bsw-rt5645.o
 obj-$(CONFIG_SND_SOC_INTEL_CHT_BSW_MAX98090_TI_MACH) += snd-soc-sst-cht-bsw-max98090_ti.o
 obj-$(CONFIG_SND_SOC_INTEL_CHT_BSW_NAU8824_MACH) += snd-soc-sst-cht-bsw-nau8824.o
sound/soc/intel/boards/cht_rt5677.c new file +636 -0

636 lines not on this page · raw message

Signature · 1 line
2.53.0
#2 lore raw

PATCH v6 2/2 ASoC: Intel: cht: Add Yoga Book RT5677 machine entry

In reply to Maurizio Casciano

The Yoga Book YB1-X91F/L exposes its RT5677 codec as ACPI device 10EC5677. Add a Cherry Trail machine-table entry so SOF creates the cht-rt5677 machine device and loads sof-cht-rt5677.tplg through the standard firmware search path.

Only SOF has been validated on this hardware. Leave the legacy SST firmware and board fields unset rather than advertising an untested DSP path. The topology sources are maintained and distributed separately by the SOF project.

Assisted-by Codex:gpt-5.6-sol sparse
---
 sound/soc/intel/common/soc-acpi-intel-cht-match.c | 6 ++++++
 1 file changed, 6 insertions(+)
sound/soc/intel/common/soc-acpi-intel-cht-match.c +6 -0
index e4c3492a0c28..b68f9c4feea3 100644
@@ -137,6 +137,12 @@ struct snd_soc_acpi_mach  snd_soc_acpi_intel_cherrytrail_machines[] = {
 		.board = "cht-bsw",
 		.sof_tplg_filename = "sof-cht-rt5670.tplg",
 	},
+	{
+		/* Lenovo Yoga Book YB1-X91F/L */
+		.id = "10EC5677",
+		.drv_name = "cht-rt5677",
+		.sof_tplg_filename = "sof-cht-rt5677.tplg",
+	},
 	{
 		.comp_ids = &rt5645_comp_ids,
 		.drv_name = "cht-bsw-rt5645",
Signature · 1 line
2.53.0
maintainer
#3 lore raw
In reply to Maurizio Casciano
Quoted 8 lines · Maurizio Casciano

Hi,

This series adds the Cherry Trail machine driver and machine-table entry needed by the Lenovo Yoga Book YB1-X91F/L with its RT5677 codec and TS3A227E headset detector.

Only the SOF path is enabled. Legacy SST is deliberately not advertised because it has not been validated on this hardware.

Before I move on to the review, this is contrary to what Yauhen claimed in v2 [1]. So, are we just rolling the dice here? If you have tested both, it's OK to have both supported. Changing in the middle of review does not increase credibility.

[1]: https://lore.kernel.org/all/aaYRd2Irw8bOpDL0@jekhomev/

#4 lore raw

Hi Cezary,

You are right. The statement in the cover letter is inaccurate: I conflated "not revalidated by me against this revision" with "not validated on this hardware", overlooking Yauhen's v2 report.

My testing covers the SOF path on a YB1-X91L, including PCM0 playback/capture and PCM1 deep-buffer playback. Yauhen reported testing the legacy SST path. Those are separate test results, but together they provide a basis for advertising both mutually exclusive firmware paths.

Narrowing v6 to SOF only was therefore an overcorrection, and the wording made it appear as though the support decision was based on guesswork. I will restore the dual SST/SOF selection in the next revision and document the validation of each path separately. Yauhen, please correct me if I have misstated the scope of the SST testing.

Sorry for the unnecessary churn.

With Best Regards,
Maurizio Casciano