From nobody Fri Apr 3 06:28:30 2026 Received: from mail-ed1-f47.google.com (mail-ed1-f47.google.com [209.85.208.47]) (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 07EBE31C576 for ; Tue, 17 Feb 2026 23:36:34 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=209.85.208.47 ARC-Seal: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1771371407; cv=none; b=Nam+rqDlj+Yv0QMDIKkRoa7Ev3HkUQ95PnFI4YaoKyexV3AtdNyu7H//hsIbAXS9BZKOFYEInfIBa/hG3w8bF1dZY/A3FIlq/clfvh/1lPdtqHN80M1u9xjTq2gDFCPh/zYvEYofBQxcTWM92vjUYCWz87zLF8SVPGtNdLOnras= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1771371407; c=relaxed/simple; bh=Kym5uHKZg/K+bSo4k43gho4k2QrggU7Y2CC146sLJ5o=; h=From:To:Cc:Subject:Date:Message-ID:In-Reply-To:References: MIME-Version; b=kdk0Vh+ENH9SU7FVxdga9nnl88ve+afCIy4d9zZ8NroG5mYsJn9PWhU6QluzShiSKyypsvyk2i5Pvl1vYNa1Ys14Re536phadVIfKjSb4+r1QB2ss/EVXpymO1Bv8wuOMLASzS6/CzSHgzGf9V7SOVxU7lNAKP6W68E44QJ9wTI= 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=ZpaqpUfM; arc=none smtp.client-ip=209.85.208.47 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="ZpaqpUfM" Received: by mail-ed1-f47.google.com with SMTP id 4fb4d7f45d1cf-65c0891f4e9so4252585a12.1 for ; Tue, 17 Feb 2026 15:36:34 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20230601; t=1771371393; x=1771976193; 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=cI+N9RBipmvK8X1lsCKSLjblZsbYFgXwsy1wchMwU+0=; b=ZpaqpUfMH1NSGu+fTz+o0H4gHnYCyA0XPylIPhHPIF+VI9nLATshoJGXidax0AtZiG c6JAbkl3EwGEjTrvMduVbLMM4HBg58Ljw1NgpiH8QkfDQyKGJscpl9qfSIjxZjb0fvAh 8rRhEsBgDhEZUPlveUJcoIkKyX0NtNotKFLxj3N2nkiduqgtwSRDejaSu96vMqGVfzW1 6+GEpCXTxeIUfZo7/Zh801x/jdACmo6tFG4+LpXJWQ1559wghepc+5KD45bcT3TOjJwe iVCP8pppFvwR75WpsnK61t15k2TwOJ04F3JckJ3QAIuzudrK4H5rjFwqqyA/UMAG5tA/ OMQA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1771371393; x=1771976193; 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=cI+N9RBipmvK8X1lsCKSLjblZsbYFgXwsy1wchMwU+0=; b=QJIqfJI1rAkNAzJ+BZRFN/fVamKjkl/+sljPJMefZKtw1VrQC66ZDfkGBdWc9PqEJ1 JYeTytyyVaUoagZTwR6TG0e7NcEcQR/E9zc3YDtLnvU2gjWgFXNd7BzjhY7fdVWPcKdV xjlyI9lnpVRVyHlvTQWCivKA0tPweKoyPkldvsLAyZlj8XUdIPtqK3cPYbbjHB3FvD+f 0kwceHHcuriPmiA+wJHvXv1ajk8CgPW9Yyj9euTzyt4Nwsa57y6cyfNNX8KDHOyzZ1NZ tOmNO2YRdrvr9T3KYa6ZEw62ykfpZjhchmNAuFjbji2uvgcMUv3MRjoOBEeCP81sFL/9 mHuw== X-Gm-Message-State: AOJu0YyUjHbUnjbvYGL6qNM9+tyEPmFZXE+TruayVbFe6mkLGa390ZDe bCDSk++9muR7hlqg0k6kacsCgYzDdVwikZ0YjozTWxEbz3vx7LXOOjn6 X-Gm-Gg: AZuq6aLIk+nIi4JR63TxxOkTqoyuG6MEF3UKp7D4p+Bq59omxZD4J10Frq4gGllFffv wFGmlhxkTpjdMrEr/bN51oaO9+krAHrHNifO1zktvz45L4PfYD//gmCeF+zP+p4PwfuSBu+tHEB EoPNo3gOPDc/fd/+Pbjot1VlzP7OtsHTkDdJIAjIJh0sID40XUkYjGSCxIrsA0DgdBA94SPkg8C U8Sq8RumdEfWT9bKvFrZwvyUSVTE6OXlHaMtigXhjVH9GZzeWQWZRf9d1UGggqcUD3ieExDcAo2 OSIUKUJ0cQIrRopNS4jI2AR6RQGcy/usiqGyQuYPaMdA58gRA+MivKhzBXPMk+YMYo2c6a0DyRs cRxB5dJowZoowWle3fdlyvN1MrS3AeAr0Yz7vJRfYIDJmwBF2pqV8YT73JD/gEkK/otmrMDHR/Y oB6Z9GhiMt5FxpBg== X-Received: by 2002:a05:6402:26cb:b0:65c:9d6:82b7 with SMTP id 4fb4d7f45d1cf-65c09d68a87mr4005643a12.10.1771371393114; Tue, 17 Feb 2026 15:36:33 -0800 (PST) Received: from jekhomev ([46.251.53.180]) by smtp.gmail.com with ESMTPSA id 4fb4d7f45d1cf-65bad19bfd3sm2858775a12.2.2026.02.17.15.36.29 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Tue, 17 Feb 2026 15:36:31 -0800 (PST) From: Yauhen Kharuzhy To: platform-driver-x86@vger.kernel.org, Hans de Goede , =?UTF-8?q?Ilpo=20J=C3=A4rvinen?= Cc: linux-kernel@vger.kernel.org, Yauhen Kharuzhy Subject: [PATCH v1 2/2] platform: x86-android-tablets: lenovo: Add Yoga Book YB1 sound card info Date: Wed, 18 Feb 2026 01:36:18 +0200 Message-ID: <20260217233618.1324550-3-jekhor@gmail.com> X-Mailer: git-send-email 2.51.0 In-Reply-To: <20260217233618.1324550-1-jekhor@gmail.com> References: <20260217233618.1324550-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" Define I2C devices, their properties, and GPIO lookup tables for the Yoga Book YB1-X90 sound codec and jack detection IC. The YB1-X90 doesn't have a valid codec entry in the DSDT, while the YB1-X91 does. The YB1-X91 includes additional information in the ACPI _CRS method regarding the jack detection IC connection, but it is also defined in this driver to simplify the unification of the sound driver for both tablet versions. Signed-off-by: Yauhen Kharuzhy --- .../platform/x86/x86-android-tablets/lenovo.c | 127 ++++++++++++++++++ 1 file changed, 127 insertions(+) diff --git a/drivers/platform/x86/x86-android-tablets/lenovo.c b/drivers/pl= atform/x86/x86-android-tablets/lenovo.c index 926a5e292c4f..485b5ec414ee 100644 --- a/drivers/platform/x86/x86-android-tablets/lenovo.c +++ b/drivers/platform/x86/x86-android-tablets/lenovo.c @@ -140,6 +140,43 @@ static const struct software_node lenovo_yb1_x9x_drv26= 04l_1_node =3D { .properties =3D lenovo_yb1_x9x_drv2604l_1_props, }; =20 +static const struct software_node lenovo_yb1_rt5677_gpiochip_node =3D { + .name =3D "rt5677", +}; + +/* + * Certain properties are used by the cht_yogabook sound platform driver. = The sound + * configuration is defined as the RT5677 ACPI entry on YB1-X91; hence, th= e same + * approach is utilized for YB1-X90 as well. + */ +static const struct property_entry lenovo_yb1_x9x_rt5677_props[] =3D { + PROPERTY_ENTRY_BOOL("realtek,lout1-differential"), + PROPERTY_ENTRY_BOOL("realtek,lout2-differential"), + PROPERTY_ENTRY_BOOL("realtek,lout3-differential"), + PROPERTY_ENTRY_BOOL("realtek,in1-differential"), + PROPERTY_ENTRY_BOOL("realtek,in2-differential"), + PROPERTY_ENTRY_GPIO("realtek,reset-gpios", &cherryview_gpiochip_nodes[3],= 25, GPIO_ACTIVE_LOW), + PROPERTY_ENTRY_GPIO("realtek,pow-ldo2-gpios", &cherryview_gpiochip_nodes[= 3], 18, GPIO_ACTIVE_HIGH), + PROPERTY_ENTRY_GPIO("speaker-enable-gpios", &cherryview_gpiochip_nodes[3]= , 48, GPIO_ACTIVE_HIGH), + PROPERTY_ENTRY_GPIO("speaker-enable2-gpios", &lenovo_yb1_rt5677_gpiochip_= node, 2, GPIO_ACTIVE_HIGH), + PROPERTY_ENTRY_GPIO("headphone-enable-gpios", &lenovo_yb1_rt5677_gpiochip= _node, 4, GPIO_ACTIVE_HIGH), + {} +}; + +static const struct software_node lenovo_yb1_x90_rt5677_node =3D { + .properties =3D lenovo_yb1_x9x_rt5677_props, +}; + +static const struct property_entry lenovo_yb1_ts3a227e_props[] =3D { + /* Got from Lenovo Android kernel code drop */ + PROPERTY_ENTRY_U32("ti,micbias", 7), + {} +}; + +static const struct software_node lenovo_yb1_ts3a227e_node =3D { + .properties =3D lenovo_yb1_ts3a227e_props, +}; + static const struct x86_i2c_client_info lenovo_yb1_x90_i2c_clients[] __ini= tconst =3D { { /* BQ27542 fuel-gauge */ @@ -229,6 +266,40 @@ static const struct x86_i2c_client_info lenovo_yb1_x90= _i2c_clients[] __initconst .polarity =3D ACPI_ACTIVE_LOW, .con_id =3D "hideep_ts_irq", }, + }, { + /* Audio codec */ + .board_info =3D { + .type =3D "rt5677", + .addr =3D 0x2c, + .dev_name =3D "rt5677", + .swnode =3D &lenovo_yb1_x90_rt5677_node, + }, + .adapter_path =3D "\\_SB_.PCI0.I2C1", + .irq_data =3D { + .type =3D X86_ACPI_IRQ_TYPE_GPIOINT, + .chip =3D "INT33FF:00", + .index =3D 91, + .trigger =3D ACPI_EDGE_SENSITIVE, + .polarity =3D ACPI_ACTIVE_LOW, + .con_id =3D "rt5677_irq", + }, + }, { + /* Audio jack detection IC */ + .board_info =3D { + .type =3D "ts3a227e", + .addr =3D 0x3b, + .dev_name =3D "ts3a227e", + .swnode =3D &lenovo_yb1_ts3a227e_node, + }, + .adapter_path =3D "\\_SB_.PCI0.I2C1", + .irq_data =3D { + .type =3D X86_ACPI_IRQ_TYPE_GPIOINT, + .chip =3D "INT33FF:00", + .index =3D 77, + .trigger =3D ACPI_EDGE_SENSITIVE, + .polarity =3D ACPI_ACTIVE_LOW, + .con_id =3D "ts3a227e_irq", + }, }, }; =20 @@ -282,6 +353,11 @@ static const struct software_node *lenovo_yb1_x90_lid_= swnodes[] =3D { NULL }; =20 +static const struct software_node *lenovo_yb1_x90_swnodes[] =3D { + &lenovo_yb1_rt5677_gpiochip_node, + NULL +}; + static int __init lenovo_yb1_x90_init(struct device *dev) { /* Enable the regulators used by the touchscreens */ @@ -309,6 +385,7 @@ const struct x86_dev_info lenovo_yogabook_x90_info __in= itconst =3D { .serdev_info =3D lenovo_yb1_x90_serdevs, .serdev_count =3D ARRAY_SIZE(lenovo_yb1_x90_serdevs), .gpio_button_swnodes =3D lenovo_yb1_x90_lid_swnodes, + .swnode_group =3D lenovo_yb1_x90_swnodes, .gpiochip_type =3D X86_GPIOCHIP_CHERRYVIEW, .init =3D lenovo_yb1_x90_init, }; @@ -325,14 +402,38 @@ static const struct x86_i2c_client_info lenovo_yogabo= ok_x91_i2c_clients[] __init }, .adapter_path =3D "\\_SB_.PCI0.I2C1", }, + { + /* Audio jack detection IC. Its configuration (I2C address and + * IRQ) is defined as additional resources in RTEK (10EC5677) + * ACPI node but define them here to simplify handling in + * the driver + */ + .board_info =3D { + .type =3D "ts3a227e", + .addr =3D 0x3b, + .dev_name =3D "ts3a227e", + .swnode =3D &lenovo_yb1_ts3a227e_node, + }, + .adapter_path =3D "\\_SB_.PCI0.I2C1", + .irq_data =3D { + .type =3D X86_ACPI_IRQ_TYPE_GPIOINT, + .chip =3D "INT33FF:00", + .index =3D 77, + .trigger =3D ACPI_EDGE_SENSITIVE, + .polarity =3D ACPI_ACTIVE_LOW, + .con_id =3D "ts3a227e_irq", + }, + }, }; =20 #define YB1_X91_DRV2604L_0_DEVICE "i2c-DRV2604:00" #define YB1_X91_DRV2604L_1_DEVICE "i2c-DRV2604:01" +#define YB1_X91_RT5677_DEVICE "i2c-10EC5677:00" =20 static int __init lenovo_yb1_x91_init(struct device *dev) { struct device *drv2604l_0_dev =3D NULL, *drv2604l_1_dev =3D NULL; + struct device *rt5677_dev =3D NULL; int ret =3D 0; =20 drv2604l_0_dev =3D bus_find_device_by_name(&i2c_bus_type, NULL, @@ -369,6 +470,26 @@ static int __init lenovo_yb1_x91_init(struct device *d= ev) goto put_drv2604l_1; } =20 + rt5677_dev =3D bus_find_device_by_name(&i2c_bus_type, NULL, + YB1_X91_RT5677_DEVICE); + if (!rt5677_dev) { + pr_err("error: cannot find %s device\n", + YB1_X91_RT5677_DEVICE); + ret =3D -ENODEV; + goto put_rt5677; + } + + ret =3D device_create_managed_software_node(rt5677_dev, + lenovo_yb1_x9x_rt5677_props, NULL); + if (ret) { + pr_err("error: cannot create software node for %s\n", + YB1_X91_RT5677_DEVICE); + ret =3D -EINVAL; + goto put_rt5677; + } + +put_rt5677: + put_device(rt5677_dev); put_drv2604l_0: put_device(drv2604l_0_dev); put_drv2604l_1: @@ -377,9 +498,15 @@ static int __init lenovo_yb1_x91_init(struct device *d= ev) return ret; } =20 +static const struct software_node *lenovo_yb1_x91_swnodes[] =3D { + &lenovo_yb1_rt5677_gpiochip_node, + NULL +}; + const struct x86_dev_info lenovo_yogabook_x91_info __initconst =3D { .i2c_client_info =3D lenovo_yogabook_x91_i2c_clients, .i2c_client_count =3D ARRAY_SIZE(lenovo_yogabook_x91_i2c_clients), + .swnode_group =3D lenovo_yb1_x91_swnodes, .gpiochip_type =3D X86_GPIOCHIP_CHERRYVIEW, .init =3D lenovo_yb1_x91_init, }; --=20 2.51.0