[PATCH v2 4/4] platform/x86: x86-android-tablets: Add Yoga Book audio GPIOs
From: Maurizio Casciano
Date: Thu Aug 27 2026 - 14:17:08 EST
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),
+ { }
+ },
+};
+
#define YB1_X91_DRV2604_0_DEVICE "i2c-DRV2604:00"
#define YB1_X91_DRV2604_1_DEVICE "i2c-DRV2604:01"
@@ -392,6 +402,8 @@ static void lenovo_yb1_x91_remove_haptics_props(int index)
static int __init lenovo_yb1_x91_init(struct device *dev)
{
+ gpiod_add_lookup_table(&lenovo_yb1_x91_rt5677_gpios);
+
lenovo_yb1_x91_add_haptics_props(dev, 0, YB1_X91_DRV2604_0_DEVICE);
lenovo_yb1_x91_add_haptics_props(dev, 1, YB1_X91_DRV2604_1_DEVICE);
@@ -402,6 +414,7 @@ static void lenovo_yb1_x91_exit(void)
{
lenovo_yb1_x91_remove_haptics_props(1);
lenovo_yb1_x91_remove_haptics_props(0);
+ gpiod_remove_lookup_table(&lenovo_yb1_x91_rt5677_gpios);
}
const struct x86_dev_info lenovo_yogabook_x91_info __initconst = {
--
2.53.0