Re: [PATCH v2 3/3] platform/x86: x86-android-tablets: Add Yoga Book audio GPIOs
From: Dmitry Torokhov
Date: Sat Aug 29 2026 - 09:06:23 EST
Hi Maurizio,
On Fri, Aug 28, 2026 at 01:17:00AM +0200, Maurizio Casciano wrote:
> The Yoga Book YB1-X91F/L uses two GPIOs provided by the RT5677 codec
> itself. GPIO2 enables the second speaker amplifier and GPIO4 enables the
> headphone path, but ACPI does not map either signal.
>
> Add lookup entries for the codec device so the Yoga Book ASoC machine
> driver can request both controls by function name. Register and remove
> the table with the tablet description lifetime.
>
> Signed-off-by: Maurizio Casciano <mauriziocasciano7@xxxxxxxxx>
> Assisted-by: LLM sparse
> ---
> drivers/platform/x86/x86-android-tablets/lenovo.c | 13 +++++++++++++
> 1 file changed, 13 insertions(+)
>
> diff --git a/drivers/platform/x86/x86-android-tablets/lenovo.c b/drivers/platform/x86/x86-android-tablets/lenovo.c
> index 88693b9a1b01..8a69194a724e 100644
> --- a/drivers/platform/x86/x86-android-tablets/lenovo.c
> +++ b/drivers/platform/x86/x86-android-tablets/lenovo.c
> @@ -345,6 +345,16 @@ static const struct x86_i2c_client_info lenovo_yogabook_x91_i2c_clients[] __init
> },
> };
>
> +static struct gpiod_lookup_table lenovo_yb1_x91_rt5677_gpios = {
> + .dev_id = "i2c-10EC5677:00",
> + .table = {
> + /* GPIO2 drives the second speaker amp; GPIO4 drives headphones. */
> + GPIO_LOOKUP("rt5677", 2, "speaker-enable2", GPIO_ACTIVE_HIGH),
> + GPIO_LOOKUP("rt5677", 4, "headphone-enable", GPIO_ACTIVE_HIGH),
> + { }
> + },
> +};
> +
It would be better if we used software nodes here instead of lookup
tables.
Thanks.
--
Dmitry