From nobody Fri Apr 3 06:02:56 2026 Received: from mail-ed1-f49.google.com (mail-ed1-f49.google.com [209.85.208.49]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id 0D32528D8D1 for ; Tue, 17 Feb 2026 23:13:33 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=209.85.208.49 ARC-Seal: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1771370015; cv=none; b=NhOs4/XuYuO10DYyxGUqGBeb/at+Q1SiwPxtJJvZ1vhQrqlKxHx9LMENdsfj+EuKRMkgno8jWVKb8xt3nKjUYaYKyDiXM+PkwKuKHbX0ChCq/QWN6JLI369drEHKVuMkcw+xkLps39KcAYslMCnWHfQ01FdxtVlh9u6CmMYKc/A= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1771370015; c=relaxed/simple; bh=aEdMirBVX3PPQ1QFkY6pFwuZYxuJIL/jbDi5a1WULFI=; h=From:To:Cc:Subject:Date:Message-ID:In-Reply-To:References: MIME-Version; b=ddLVFh83WUbqqtB1iHpgn+qCiEjVUe6PyGX5mMNnVPsvwY1ccVhQCKkEQf1iE4sw3YgIWcbZcH+2Z8l0xHnAWANjKODZLu++pKaNsafpqVeVZh8WT6XzGI3eW6TsiTGn+X73Hn4HgjN5WPyVWpy+rLrxrCwU8XZF8PuYwTW8jy4= ARC-Authentication-Results: i=1; smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=gmail.com; spf=pass smtp.mailfrom=gmail.com; dkim=pass (2048-bit key) header.d=gmail.com header.i=@gmail.com header.b=IpIfbGL5; arc=none smtp.client-ip=209.85.208.49 Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=gmail.com Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=gmail.com Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=gmail.com header.i=@gmail.com header.b="IpIfbGL5" Received: by mail-ed1-f49.google.com with SMTP id 4fb4d7f45d1cf-65a2fea1a1eso514177a12.0 for ; Tue, 17 Feb 2026 15:13:33 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20230601; t=1771370012; x=1771974812; darn=vger.kernel.org; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:from:to:cc:subject:date :message-id:reply-to; bh=ChNMzOH279vklBP3A89PcATTRSKJjuOlqr/8qHAiJfo=; b=IpIfbGL52kPzS4cQZ1amP7z+sW7sXRhCWyLgOAKufPB5ZfqmULH208cCf+IsaCOdCR tmLhiG3W76F3b5SWtOIJFBV88hRW1S3KSDAMq5d5VSY6IjK45ANZj3uiUOlG5Af8PVVD nv+C/OWFGV/bscjSl2tOdAMUSd1NMTv3Jn98B0U4ECW2l2T3Exjnx9f2hh2fREh9oCa3 0y5s7ZYsDY132y8sFjhdCdC+udeRhT+sLZXMO29chi2jTyOdDtO06+VEN0eOHYycNej3 sJKzHDj3S5UX7okaQuop5uh4DX/32TWmJRzYWdcJJOD0ko07p8UEcLsaKON5w8/N1JkZ 6pCw== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1771370012; x=1771974812; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:x-gm-gg:x-gm-message-state:from :to:cc:subject:date:message-id:reply-to; bh=ChNMzOH279vklBP3A89PcATTRSKJjuOlqr/8qHAiJfo=; b=CmlCHDZzz7Hjj1+8rPamDFqHGXx404LpjQpLBsJPk1NehqDPGYR2pSes4wsNe+mJeX T+9zYygwka8KnO0XzWjBykWghmA6l9LAn3IJoUzsiCiGIjEGetsia7+xsUm+31tIQiK/ +GaAMyEFEUDzgZjpuXvQvso8hUk00UnF+cKOx0klGvDwe914x3wAatSsZtfFnH30RO9q aFYDPHUPwF2UOrNHbzdAvwARTPgxd3nHjclB06O5cKuij1K3166WZKlTvTyj4LKvl4v2 Yv5QZ4k69SaUiSFkoc+uaeUU1AjqvOctZCb1asp/Rkv+C9nN7+weRwI+4GPXDt+KIXqM jJAQ== X-Gm-Message-State: AOJu0YzjvfGk8+ZjYsEsoIHZqO/HcFG9V/MrATJM2qqOUZqW1aG6mjXa apPx7QUzmc5gJu9Y4gAodfnrwIoEZUWhVcwCPq3ZKFll/6JBSQg1YKQ4 X-Gm-Gg: AZuq6aK1LxrisOBauZELhfLE8r23g+N4UNmc0V3FOop+ptOXoiYuRB46KbAYyOmORfz eh33bsbRqZdYXScnOHWy3/eIFUDrMvFeEkCmahDvFk/x9fEQE2eRWwQ3xQbp1n7tJAEaRuZe+Mw BN6Q+05nZ8c6mvnXG7uMjZFOZ6fFLvxYLTkF27OVKtg/qs09Q5cwG1gggNZ4bP/CC6qe9z58nT0 XI6qAblYiVnljeFAgRP+qFbpLTlAr8y8jwjWzIdkUMdM3poNxj7I7nGTJBH/A0sI7koy8V5eWgy KGcrnzS7Suu2aRCAfrnii6wFN6kT+TIIdC/zokFlOyFAG659vRbxGLk7AohuIagwhxzAJJ9LlW7 534BH27nBHxVvaUMJnh1aTdS6YzRccYNAKtoCAjYccX+QzaRGBt5+q/K6lVUD7zrdj/9PngRtDD CAkcrLU4UhxJnHtw== X-Received: by 2002:a17:907:9341:b0:b72:5629:1789 with SMTP id a640c23a62f3a-b903ce43635mr3012566b.13.1771370012393; Tue, 17 Feb 2026 15:13:32 -0800 (PST) Received: from jekhomev ([46.251.53.180]) by smtp.gmail.com with ESMTPSA id 4fb4d7f45d1cf-65bad3f137dsm2661375a12.27.2026.02.17.15.13.31 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Tue, 17 Feb 2026 15:13:32 -0800 (PST) From: Yauhen Kharuzhy To: linux-sound@vger.kernel.org, Cezary Rojewski , Liam Girdwood , Pierre-Louis Bossart , Mark Brown Cc: linux-kernel@vger.kernel.org, Hans de Goede , Yauhen Kharuzhy Subject: [PATCH v1 2/2] ASoC: Intel: soc-acpi-cht: Add Lenovo Yoga Book entries Date: Wed, 18 Feb 2026 01:13:24 +0200 Message-ID: <20260217231324.1319392-3-jekhor@gmail.com> X-Mailer: git-send-email 2.51.0 In-Reply-To: <20260217231324.1319392-1-jekhor@gmail.com> References: <20260217231324.1319392-1-jekhor@gmail.com> Precedence: bulk X-Mailing-List: linux-kernel@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Content-Transfer-Encoding: quoted-printable Content-Type: text/plain; charset="utf-8" Lenovo Yoga Book YB1-X91 device uses a Cherry Trail SoC and has a valid ACPI DSDT entry for the RT5677 codec. This entry has some non-standard resource definitions, such as jack detection chip information, and hardware has some additional GPIO controls so use 'cht-yogabook' for the driver name instead of some default (like 'cht-bsw-rt5677'). Lenovo Yoga Book YB1-X90 device (Android version of the tablet) has the same hardware configuration but lacks a valid ACPI DSDT entry for the codec. To match this device, extend the existing quirk designated for the Lenovo Yoga Tab 3 Pro YT3-X90 and make it more generic: select a matched machine using the dmi_check_system() quirk mechanism. Signed-off-by: Yauhen Kharuzhy --- .../intel/common/soc-acpi-intel-cht-match.c | 144 ++++++++++++------ 1 file changed, 94 insertions(+), 50 deletions(-) diff --git a/sound/soc/intel/common/soc-acpi-intel-cht-match.c b/sound/soc/= intel/common/soc-acpi-intel-cht-match.c index e4c3492a0c28..cadb7790d86a 100644 --- a/sound/soc/intel/common/soc-acpi-intel-cht-match.c +++ b/sound/soc/intel/common/soc-acpi-intel-cht-match.c @@ -9,13 +9,47 @@ #include #include =20 -static unsigned long cht_machine_id; +static struct snd_soc_acpi_mach *cht_quirk_mach; =20 -#define CHT_SURFACE_MACH 1 +static struct snd_soc_acpi_mach cht_surface_mach =3D { + .id =3D "10EC5640", + .drv_name =3D "cht-bsw-rt5645", + .fw_filename =3D "intel/fw_sst_22a8.bin", + .board =3D "cht-bsw", + .sof_tplg_filename =3D "sof-cht-rt5645.tplg", +}; + +static struct snd_soc_acpi_mach cht_yogabook_mach =3D { + .id =3D "10EC5677", + .drv_name =3D "cht-yogabook", + .fw_filename =3D "intel/fw_sst_22a8.bin", + .board =3D "cht-yogabook", + .sof_tplg_filename =3D "sof-cht-rt5677.tplg", +}; + +static struct snd_soc_acpi_mach cht_lenovo_yoga_tab3_x90_mach =3D { + .id =3D "10WM5102", + .drv_name =3D "bytcr_wm5102", + .fw_filename =3D "intel/fw_sst_22a8.bin", + .board =3D "bytcr_wm5102", + .sof_tplg_filename =3D "sof-cht-wm5102.tplg", +}; =20 static int cht_surface_quirk_cb(const struct dmi_system_id *id) { - cht_machine_id =3D CHT_SURFACE_MACH; + cht_quirk_mach =3D &cht_surface_mach; + return 1; +} + +static int cht_yogabook_quirk_cb(const struct dmi_system_id *id) +{ + cht_quirk_mach =3D &cht_yogabook_mach; + return 1; +} + +static int cht_yt3_quirk_cb(const struct dmi_system_id *id) +{ + cht_quirk_mach =3D &cht_lenovo_yoga_tab3_x90_mach; return 1; } =20 @@ -27,29 +61,57 @@ static const struct dmi_system_id cht_table[] =3D { DMI_MATCH(DMI_PRODUCT_NAME, "Surface 3"), }, }, + { + .callback =3D cht_yogabook_quirk_cb, + .ident =3D "Lenovo Yoga Book YB1-X91", + /* YB1-X91L/F */ + .matches =3D { + DMI_MATCH(DMI_PRODUCT_NAME, "Lenovo YB1-X91"), + } + }, + { + .callback =3D cht_yogabook_quirk_cb, + .ident =3D "Lenovo Yoga Book YB1-X90", + /* YB1-X90L/F, codec is not listed in DSDT */ + .matches =3D { + DMI_EXACT_MATCH(DMI_SYS_VENDOR, "Intel Corporation"), + DMI_EXACT_MATCH(DMI_PRODUCT_NAME, "CHERRYVIEW D1 PLATFORM"), + DMI_EXACT_MATCH(DMI_PRODUCT_VERSION, "YETI-11"), + } + }, + { + /* + * The Lenovo Yoga Tab 3 Pro YT3-X90, with Android factory OS + * has a buggy DSDT with the codec not being listed at all. + */ + .callback =3D cht_yt3_quirk_cb, + .matches =3D { + DMI_MATCH(DMI_SYS_VENDOR, "Intel Corporation"), + DMI_MATCH(DMI_PRODUCT_VERSION, "Blade3-10A-001"), + }, + }, { } }; =20 -static struct snd_soc_acpi_mach cht_surface_mach =3D { - .id =3D "10EC5640", - .drv_name =3D "cht-bsw-rt5645", - .fw_filename =3D "intel/fw_sst_22a8.bin", - .board =3D "cht-bsw", - .sof_tplg_filename =3D "sof-cht-rt5645.tplg", -}; - static struct snd_soc_acpi_mach *cht_quirk(void *arg) { struct snd_soc_acpi_mach *mach =3D arg; =20 dmi_check_system(cht_table); =20 - if (cht_machine_id =3D=3D CHT_SURFACE_MACH) - return &cht_surface_mach; + if (cht_quirk_mach) + return cht_quirk_mach; else return mach; } =20 +static struct snd_soc_acpi_mach *cht_quirk_nocodec(void *arg) +{ + struct snd_soc_acpi_mach *mach =3D cht_quirk(arg); + + return mach =3D=3D arg ? NULL : mach; +} + /* * Some tablets with Android factory OS have buggy DSDTs with an ESSX8316 = device * in the ACPI tables. While they are not using an ESS8316 codec. These DS= DTs @@ -75,38 +137,6 @@ static struct snd_soc_acpi_mach *cht_ess8316_quirk(void= *arg) return arg; } =20 -/* - * The Lenovo Yoga Tab 3 Pro YT3-X90, with Android factory OS has a buggy = DSDT - * with the coded not being listed at all. - */ -static const struct dmi_system_id lenovo_yoga_tab3_x90[] =3D { - { - /* Lenovo Yoga Tab 3 Pro YT3-X90, codec missing from DSDT */ - .matches =3D { - DMI_MATCH(DMI_SYS_VENDOR, "Intel Corporation"), - DMI_MATCH(DMI_PRODUCT_VERSION, "Blade3-10A-001"), - }, - }, - { } -}; - -static struct snd_soc_acpi_mach cht_lenovo_yoga_tab3_x90_mach =3D { - .id =3D "10WM5102", - .drv_name =3D "bytcr_wm5102", - .fw_filename =3D "intel/fw_sst_22a8.bin", - .board =3D "bytcr_wm5102", - .sof_tplg_filename =3D "sof-cht-wm5102.tplg", -}; - -static struct snd_soc_acpi_mach *lenovo_yt3_x90_quirk(void *arg) -{ - if (dmi_check_system(lenovo_yoga_tab3_x90)) - return &cht_lenovo_yoga_tab3_x90_mach; - - /* Skip wildcard match snd_soc_acpi_intel_cherrytrail_machines[] entry */ - return NULL; -} - static const struct snd_soc_acpi_codecs rt5640_comp_ids =3D { .num_codecs =3D 2, .codecs =3D { "10EC5640", "10EC3276" }, @@ -137,6 +167,20 @@ struct snd_soc_acpi_mach snd_soc_acpi_intel_cherrytra= il_machines[] =3D { .board =3D "cht-bsw", .sof_tplg_filename =3D "sof-cht-rt5670.tplg", }, + /* + * The only known Cherry Trail device with RT5677 codec and 10EC677 + * DSTD entry is the Lenovo Yoga Book YB1-X91. It has a device-specific + * driver, so check DMI and use a machine quirk to override the default + * (non-existent) machine driver. + */ + { + .id =3D "10EC5677", + .drv_name =3D "cht-bsw-rt5677", + .fw_filename =3D "intel/fw_sst_22a8.bin", + .board =3D "cht-bsw", + .machine_quirk =3D cht_quirk, + .sof_tplg_filename =3D "sof-cht-rt5677.tplg", + }, { .comp_ids =3D &rt5645_comp_ids, .drv_name =3D "cht-bsw-rt5645", @@ -208,14 +252,14 @@ struct snd_soc_acpi_mach snd_soc_acpi_intel_cherrytr= ail_machines[] =3D { .sof_tplg_filename =3D "sof-cht-src-50khz-pcm512x.tplg", }, /* - * Special case for the Lenovo Yoga Tab 3 Pro YT3-X90 where the DSDT - * misses the codec. Match on the SST id instead, lenovo_yt3_x90_quirk() - * will return a YT3 specific mach or NULL when called on other hw, - * skipping this entry. + * Special case for the Lenovo Yoga Tab 3 Pro YT3-X90 and Lenovo + * Yoga Book YB1-X90 where the DSDT misses the codec. Match on the + * SST id instead, cht_quirk_nocodec() will return a machine-specific + * mach or NULL when called on other hw, skipping this entry. */ { .id =3D "808622A8", - .machine_quirk =3D lenovo_yt3_x90_quirk, + .machine_quirk =3D cht_quirk_nocodec, }, =20 #if IS_ENABLED(CONFIG_SND_SOC_INTEL_BYT_CHT_NOCODEC_MACH) --=20 2.51.0