The Linux Kernel Mailing List
 help / color / mirror / Atom feed
* [PATCH v3 0/2] x86-android-tablets: Add sound and haptics support for Lenovo YB1-X9*
@ 2026-06-11  8:29 Yauhen Kharuzhy
  2026-06-11  8:29 ` [PATCH v3 1/2] platform: x86-android-tablets: lenovo: Add Yoga Book haptics entries Yauhen Kharuzhy
  2026-06-11  8:29 ` [PATCH v3 2/2] platform: x86-android-tablets: lenovo: Add Yoga Book YB1 sound card info Yauhen Kharuzhy
  0 siblings, 2 replies; 4+ messages in thread
From: Yauhen Kharuzhy @ 2026-06-11  8:29 UTC (permalink / raw)
  To: Hans de Goede, Ilpo Järvinen
  Cc: platform-driver-x86, linux-kernel, Yauhen Kharuzhy

Defines I2C board info and properties for the DRV2604L haptics driver used in
Lenovo Yoga Book YB1-X90/X91 tablets.

Defines sound devices for both models: rt5677 codec and TS3A227E jack
detection IC. Machine sound driver is implemented in [1].

To simplify the sound driver, the same set of properties is used for both
the X91 and X90 versions. For X91, software nodes with such properties are
attached to the ACPI nodes.

Changes in v2:
- Use cleanup functions instead of goto's in lenovo_yb1_x91_init();
- Adjust ts3a227e settings: MICBIAS voltage and jack insertion
  debounce timeout, to prevent fake keypresses.

Changes in v3:
- Declarations of variables using cleanup functions have been moved from
  the start of the function to the assignment.
- Link to v2: https://lore.kernel.org/r/20260302-x86-tablets-yogabook-v2-0-061768d5c9e7@gmail.com

1. https://lore.kernel.org/linux-sound/20260611-asoc-yogabook-v2-v3-0-3128447b67b6@gmail.com/

Yauhen Kharuzhy (2):
  platform: x86-android-tablets: lenovo: Add Yoga Book haptics entries
  platform: x86-android-tablets: lenovo: Add Yoga Book YB1 sound card
    info

 .../platform/x86/x86-android-tablets/lenovo.c | 223 ++++++++++++++++++
 1 file changed, 223 insertions(+)

base-commit: next-20260227

--
2.51.0

---
Yauhen Kharuzhy (2):
      platform: x86-android-tablets: lenovo: Add Yoga Book haptics entries
      platform: x86-android-tablets: lenovo: Add Yoga Book YB1 sound card info

 drivers/platform/x86/x86-android-tablets/lenovo.c | 224 ++++++++++++++++++++++
 1 file changed, 224 insertions(+)
---
base-commit: e3b58e24c60351eaa02813cfc7ca110fb68144c5
change-id: 20260301-x86-tablets-yogabook-6fe4563ccb92

Best regards,
-- 
Yauhen Kharuzhy


^ permalink raw reply	[flat|nested] 4+ messages in thread

* [PATCH v3 1/2] platform: x86-android-tablets: lenovo: Add Yoga Book haptics entries
  2026-06-11  8:29 [PATCH v3 0/2] x86-android-tablets: Add sound and haptics support for Lenovo YB1-X9* Yauhen Kharuzhy
@ 2026-06-11  8:29 ` Yauhen Kharuzhy
  2026-07-07 13:19   ` Ilpo Järvinen
  2026-06-11  8:29 ` [PATCH v3 2/2] platform: x86-android-tablets: lenovo: Add Yoga Book YB1 sound card info Yauhen Kharuzhy
  1 sibling, 1 reply; 4+ messages in thread
From: Yauhen Kharuzhy @ 2026-06-11  8:29 UTC (permalink / raw)
  To: Hans de Goede, Ilpo Järvinen
  Cc: platform-driver-x86, linux-kernel, Yauhen Kharuzhy

Add drv2604l i2c_board_info for drv2604l haptics drivers present in
Lenovo Yoga Book YB1-X90 and YB1-X91. Set properties required for device
initialization and self-calibration.

Signed-off-by: Yauhen Kharuzhy <jekhor@gmail.com>
---
 drivers/platform/x86/x86-android-tablets/lenovo.c | 94 +++++++++++++++++++++++
 1 file changed, 94 insertions(+)

diff --git a/drivers/platform/x86/x86-android-tablets/lenovo.c b/drivers/platform/x86/x86-android-tablets/lenovo.c
index 8d825e0b4661..81453217fec5 100644
--- a/drivers/platform/x86/x86-android-tablets/lenovo.c
+++ b/drivers/platform/x86/x86-android-tablets/lenovo.c
@@ -10,6 +10,8 @@
 
 #define pr_fmt(fmt) KBUILD_MODNAME ": " fmt
 
+#include <linux/cleanup.h>
+#include <linux/device.h>
 #include <linux/efi.h>
 #include <linux/gpio/machine.h>
 #include <linux/gpio/property.h>
@@ -114,6 +116,32 @@ static const struct software_node lenovo_yb1_x90_hideep_ts_node = {
 	.properties = lenovo_yb1_x90_hideep_ts_props,
 };
 
+static const struct property_entry lenovo_yb1_x9x_drv2604l_0_props[] = {
+	PROPERTY_ENTRY_U32("vib-rated-mv", 1500),
+	PROPERTY_ENTRY_U32("vib-overdrive-mv", 2100),
+	PROPERTY_ENTRY_U32("mode", 0), /* LRA */
+	PROPERTY_ENTRY_U32("library-sel", 0), /* DRV260X_LIB_EMPTY */
+	PROPERTY_ENTRY_GPIO("enable-gpios", &cherryview_gpiochip_nodes[0], 79, GPIO_ACTIVE_HIGH),
+	{}
+};
+
+static const struct software_node lenovo_yb1_x9x_drv2604l_0_node = {
+	.properties = lenovo_yb1_x9x_drv2604l_0_props,
+};
+
+static const struct property_entry lenovo_yb1_x9x_drv2604l_1_props[] = {
+	PROPERTY_ENTRY_U32("vib-rated-mv", 1500),
+	PROPERTY_ENTRY_U32("vib-overdrive-mv", 2100),
+	PROPERTY_ENTRY_U32("mode", 0), /* LRA */
+	PROPERTY_ENTRY_U32("library-sel", 0), /* DRV260X_LIB_EMPTY */
+	PROPERTY_ENTRY_GPIO("enable-gpios", &cherryview_gpiochip_nodes[1], 47, GPIO_ACTIVE_HIGH),
+	{}
+};
+
+static const struct software_node lenovo_yb1_x9x_drv2604l_1_node = {
+	.properties = lenovo_yb1_x9x_drv2604l_1_props,
+};
+
 static const struct x86_i2c_client_info lenovo_yb1_x90_i2c_clients[] __initconst = {
 	{
 		/* BQ27542 fuel-gauge */
@@ -159,6 +187,24 @@ static const struct x86_i2c_client_info lenovo_yb1_x90_i2c_clients[] __initconst
 			.polarity = ACPI_ACTIVE_LOW,
 			.con_id = "wacom_irq",
 		},
+	}, {
+		/* Keyboard haptics driver */
+		.board_info = {
+			.type = "drv2604l",
+			.addr = 0x5a,
+			.dev_name = "drv2604l.0",
+			.swnode = &lenovo_yb1_x9x_drv2604l_0_node,
+		},
+		.adapter_path = "\\_SB_.PCI0.I2C1",
+	}, {
+		/* Keyboard haptics driver */
+		.board_info = {
+			.type = "drv2604l",
+			.addr = 0x5a,
+			.dev_name = "drv2604l.1",
+			.swnode = &lenovo_yb1_x9x_drv2604l_1_node,
+		},
+		.adapter_path = "\\_SB_.PCI0.I2C4",
 	}, {
 		/* LP8557 Backlight controller */
 		.board_info = {
@@ -283,9 +329,57 @@ static const struct x86_i2c_client_info lenovo_yogabook_x91_i2c_clients[] __init
 	},
 };
 
+#define YB1_X91_DRV2604L_0_DEVICE "i2c-DRV2604:00"
+#define YB1_X91_DRV2604L_1_DEVICE "i2c-DRV2604:01"
+
+static int __init lenovo_yb1_x91_init(struct device *dev)
+{
+	int ret = 0;
+
+	struct device *drv2604l_0_dev __free(put_device) =
+		bus_find_device_by_name(&i2c_bus_type, NULL,
+					YB1_X91_DRV2604L_0_DEVICE);
+	if (!drv2604l_0_dev) {
+		pr_err("error: cannot find %s device\n",
+		       YB1_X91_DRV2604L_0_DEVICE);
+		return -ENODEV;
+	}
+
+	ret = device_create_managed_software_node(drv2604l_0_dev,
+						  lenovo_yb1_x9x_drv2604l_0_props,
+						  NULL);
+	if (ret) {
+		pr_err("error: cannot create software node for %s: %d\n",
+		       YB1_X91_DRV2604L_0_DEVICE, ret);
+		return ret;
+	}
+
+	struct device *drv2604l_1_dev __free(put_device) =
+		bus_find_device_by_name(&i2c_bus_type, NULL,
+					YB1_X91_DRV2604L_1_DEVICE);
+	if (!drv2604l_1_dev) {
+		pr_err("error: cannot find %s device\n",
+		       YB1_X91_DRV2604L_1_DEVICE);
+		return -ENODEV;
+	}
+
+	ret = device_create_managed_software_node(drv2604l_1_dev,
+						  lenovo_yb1_x9x_drv2604l_1_props,
+						  NULL);
+	if (ret) {
+		pr_err("error: cannot create software node for %s\n",
+		       YB1_X91_DRV2604L_1_DEVICE);
+		return ret;
+	}
+
+	return 0;
+}
+
 const struct x86_dev_info lenovo_yogabook_x91_info __initconst = {
 	.i2c_client_info = lenovo_yogabook_x91_i2c_clients,
 	.i2c_client_count = ARRAY_SIZE(lenovo_yogabook_x91_i2c_clients),
+	.gpiochip_type = X86_GPIOCHIP_CHERRYVIEW,
+	.init = lenovo_yb1_x91_init,
 };
 
 /* Lenovo Yoga Tablet 2 1050F/L's Android factory image has everything hardcoded */

-- 
2.53.0


^ permalink raw reply related	[flat|nested] 4+ messages in thread

* [PATCH v3 2/2] platform: x86-android-tablets: lenovo: Add Yoga Book YB1 sound card info
  2026-06-11  8:29 [PATCH v3 0/2] x86-android-tablets: Add sound and haptics support for Lenovo YB1-X9* Yauhen Kharuzhy
  2026-06-11  8:29 ` [PATCH v3 1/2] platform: x86-android-tablets: lenovo: Add Yoga Book haptics entries Yauhen Kharuzhy
@ 2026-06-11  8:29 ` Yauhen Kharuzhy
  1 sibling, 0 replies; 4+ messages in thread
From: Yauhen Kharuzhy @ 2026-06-11  8:29 UTC (permalink / raw)
  To: Hans de Goede, Ilpo Järvinen
  Cc: platform-driver-x86, linux-kernel, Yauhen Kharuzhy

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 <jekhor@gmail.com>
---
 drivers/platform/x86/x86-android-tablets/lenovo.c | 130 ++++++++++++++++++++++
 1 file changed, 130 insertions(+)

diff --git a/drivers/platform/x86/x86-android-tablets/lenovo.c b/drivers/platform/x86/x86-android-tablets/lenovo.c
index 81453217fec5..95ed201c5cb0 100644
--- a/drivers/platform/x86/x86-android-tablets/lenovo.c
+++ b/drivers/platform/x86/x86-android-tablets/lenovo.c
@@ -142,6 +142,49 @@ static const struct software_node lenovo_yb1_x9x_drv2604l_1_node = {
 	.properties = lenovo_yb1_x9x_drv2604l_1_props,
 };
 
+static const struct software_node lenovo_yb1_rt5677_gpiochip_node = {
+	.name = "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, the same
+ * approach is utilized for YB1-X90 as well.
+ */
+static const struct property_entry lenovo_yb1_x9x_rt5677_props[] = {
+	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 = {
+	.properties = lenovo_yb1_x9x_rt5677_props,
+};
+
+static const struct property_entry lenovo_yb1_ts3a227e_props[] = {
+	/* MICBIAS is 2.5V */
+	PROPERTY_ENTRY_U32("ti,micbias", 4),
+	PROPERTY_ENTRY_U32("ti,debounce-insertion-ms", 2000),
+	{}
+};
+
+static const struct software_node lenovo_yb1_ts3a227e_node = {
+	.properties = lenovo_yb1_ts3a227e_props,
+};
+
 static const struct x86_i2c_client_info lenovo_yb1_x90_i2c_clients[] __initconst = {
 	{
 		/* BQ27542 fuel-gauge */
@@ -231,6 +274,40 @@ static const struct x86_i2c_client_info lenovo_yb1_x90_i2c_clients[] __initconst
 			.polarity = ACPI_ACTIVE_LOW,
 			.con_id = "hideep_ts_irq",
 		},
+	}, {
+		/* Audio codec */
+		.board_info = {
+			.type = "rt5677",
+			.addr = 0x2c,
+			.dev_name = "rt5677",
+			.swnode = &lenovo_yb1_x90_rt5677_node,
+		},
+		.adapter_path = "\\_SB_.PCI0.I2C1",
+		.irq_data = {
+			.type = X86_ACPI_IRQ_TYPE_GPIOINT,
+			.chip = "INT33FF:00",
+			.index = 91,
+			.trigger = ACPI_EDGE_SENSITIVE,
+			.polarity = ACPI_ACTIVE_LOW,
+			.con_id = "rt5677_irq",
+		},
+	}, {
+		/* Audio jack detection IC */
+		.board_info = {
+			.type = "ts3a227e",
+			.addr = 0x3b,
+			.dev_name = "ts3a227e",
+			.swnode = &lenovo_yb1_ts3a227e_node,
+		},
+		.adapter_path = "\\_SB_.PCI0.I2C1",
+		.irq_data = {
+			.type = X86_ACPI_IRQ_TYPE_GPIOINT,
+			.chip = "INT33FF:00",
+			.index = 77,
+			.trigger = ACPI_EDGE_SENSITIVE,
+			.polarity = ACPI_ACTIVE_LOW,
+			.con_id = "ts3a227e_irq",
+		},
 	},
 };
 
@@ -284,6 +361,11 @@ static const struct software_node *lenovo_yb1_x90_lid_swnodes[] = {
 	NULL
 };
 
+static const struct software_node *lenovo_yb1_x90_swnodes[] = {
+	&lenovo_yb1_rt5677_gpiochip_node,
+	NULL
+};
+
 static int __init lenovo_yb1_x90_init(struct device *dev)
 {
 	/* Enable the regulators used by the touchscreens */
@@ -311,6 +393,7 @@ const struct x86_dev_info lenovo_yogabook_x90_info __initconst = {
 	.serdev_info = lenovo_yb1_x90_serdevs,
 	.serdev_count = ARRAY_SIZE(lenovo_yb1_x90_serdevs),
 	.gpio_button_swnodes = lenovo_yb1_x90_lid_swnodes,
+	.swnode_group = lenovo_yb1_x90_swnodes,
 	.gpiochip_type = X86_GPIOCHIP_CHERRYVIEW,
 	.init = lenovo_yb1_x90_init,
 };
@@ -327,10 +410,33 @@ static const struct x86_i2c_client_info lenovo_yogabook_x91_i2c_clients[] __init
 		},
 		.adapter_path = "\\_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 = {
+			.type = "ts3a227e",
+			.addr = 0x3b,
+			.dev_name = "ts3a227e",
+			.swnode = &lenovo_yb1_ts3a227e_node,
+		},
+		.adapter_path = "\\_SB_.PCI0.I2C1",
+		.irq_data = {
+			.type = X86_ACPI_IRQ_TYPE_GPIOINT,
+			.chip = "INT33FF:00",
+			.index = 77,
+			.trigger = ACPI_EDGE_SENSITIVE,
+			.polarity = ACPI_ACTIVE_LOW,
+			.con_id = "ts3a227e_irq",
+		},
+	},
 };
 
 #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"
 
 static int __init lenovo_yb1_x91_init(struct device *dev)
 {
@@ -372,12 +478,36 @@ static int __init lenovo_yb1_x91_init(struct device *dev)
 		return ret;
 	}
 
+	struct device *rt5677_dev __free(put_device) =
+		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);
+		return -ENODEV;
+	}
+
+	ret = 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);
+		return ret;
+	}
+
 	return 0;
 }
 
+static const struct software_node *lenovo_yb1_x91_swnodes[] = {
+	&lenovo_yb1_rt5677_gpiochip_node,
+	NULL
+};
+
 const struct x86_dev_info lenovo_yogabook_x91_info __initconst = {
 	.i2c_client_info = lenovo_yogabook_x91_i2c_clients,
 	.i2c_client_count = ARRAY_SIZE(lenovo_yogabook_x91_i2c_clients),
+	.swnode_group = lenovo_yb1_x91_swnodes,
 	.gpiochip_type = X86_GPIOCHIP_CHERRYVIEW,
 	.init = lenovo_yb1_x91_init,
 };

-- 
2.53.0


^ permalink raw reply related	[flat|nested] 4+ messages in thread

* Re: [PATCH v3 1/2] platform: x86-android-tablets: lenovo: Add Yoga Book haptics entries
  2026-06-11  8:29 ` [PATCH v3 1/2] platform: x86-android-tablets: lenovo: Add Yoga Book haptics entries Yauhen Kharuzhy
@ 2026-07-07 13:19   ` Ilpo Järvinen
  0 siblings, 0 replies; 4+ messages in thread
From: Ilpo Järvinen @ 2026-07-07 13:19 UTC (permalink / raw)
  To: Yauhen Kharuzhy; +Cc: Hans de Goede, platform-driver-x86, LKML

On Thu, 11 Jun 2026, Yauhen Kharuzhy wrote:

> Add drv2604l i2c_board_info for drv2604l haptics drivers present in
> Lenovo Yoga Book YB1-X90 and YB1-X91. Set properties required for device
> initialization and self-calibration.
> 
> Signed-off-by: Yauhen Kharuzhy <jekhor@gmail.com>
> ---
>  drivers/platform/x86/x86-android-tablets/lenovo.c | 94 +++++++++++++++++++++++
>  1 file changed, 94 insertions(+)
> 
> diff --git a/drivers/platform/x86/x86-android-tablets/lenovo.c b/drivers/platform/x86/x86-android-tablets/lenovo.c
> index 8d825e0b4661..81453217fec5 100644
> --- a/drivers/platform/x86/x86-android-tablets/lenovo.c
> +++ b/drivers/platform/x86/x86-android-tablets/lenovo.c
> @@ -10,6 +10,8 @@
>  
>  #define pr_fmt(fmt) KBUILD_MODNAME ": " fmt
>  
> +#include <linux/cleanup.h>
> +#include <linux/device.h>
>  #include <linux/efi.h>
>  #include <linux/gpio/machine.h>
>  #include <linux/gpio/property.h>
> @@ -114,6 +116,32 @@ static const struct software_node lenovo_yb1_x90_hideep_ts_node = {
>  	.properties = lenovo_yb1_x90_hideep_ts_props,
>  };
>  
> +static const struct property_entry lenovo_yb1_x9x_drv2604l_0_props[] = {
> +	PROPERTY_ENTRY_U32("vib-rated-mv", 1500),
> +	PROPERTY_ENTRY_U32("vib-overdrive-mv", 2100),
> +	PROPERTY_ENTRY_U32("mode", 0), /* LRA */
> +	PROPERTY_ENTRY_U32("library-sel", 0), /* DRV260X_LIB_EMPTY */

Please align the comments. If there's enough space to add one tab to the 
second line, please add that as well so these comments don't mix with the
code.

> +	PROPERTY_ENTRY_GPIO("enable-gpios", &cherryview_gpiochip_nodes[0], 79, GPIO_ACTIVE_HIGH),
> +	{}
> +};
> +
> +static const struct software_node lenovo_yb1_x9x_drv2604l_0_node = {
> +	.properties = lenovo_yb1_x9x_drv2604l_0_props,
> +};
> +
> +static const struct property_entry lenovo_yb1_x9x_drv2604l_1_props[] = {
> +	PROPERTY_ENTRY_U32("vib-rated-mv", 1500),
> +	PROPERTY_ENTRY_U32("vib-overdrive-mv", 2100),
> +	PROPERTY_ENTRY_U32("mode", 0), /* LRA */
> +	PROPERTY_ENTRY_U32("library-sel", 0), /* DRV260X_LIB_EMPTY */

Ditto.

-- 
 i.

> +	PROPERTY_ENTRY_GPIO("enable-gpios", &cherryview_gpiochip_nodes[1], 47, GPIO_ACTIVE_HIGH),
> +	{}
> +};
> +
> +static const struct software_node lenovo_yb1_x9x_drv2604l_1_node = {
> +	.properties = lenovo_yb1_x9x_drv2604l_1_props,
> +};
> +
>  static const struct x86_i2c_client_info lenovo_yb1_x90_i2c_clients[] __initconst = {
>  	{
>  		/* BQ27542 fuel-gauge */
> @@ -159,6 +187,24 @@ static const struct x86_i2c_client_info lenovo_yb1_x90_i2c_clients[] __initconst
>  			.polarity = ACPI_ACTIVE_LOW,
>  			.con_id = "wacom_irq",
>  		},
> +	}, {
> +		/* Keyboard haptics driver */
> +		.board_info = {
> +			.type = "drv2604l",
> +			.addr = 0x5a,
> +			.dev_name = "drv2604l.0",
> +			.swnode = &lenovo_yb1_x9x_drv2604l_0_node,
> +		},
> +		.adapter_path = "\\_SB_.PCI0.I2C1",
> +	}, {
> +		/* Keyboard haptics driver */
> +		.board_info = {
> +			.type = "drv2604l",
> +			.addr = 0x5a,
> +			.dev_name = "drv2604l.1",
> +			.swnode = &lenovo_yb1_x9x_drv2604l_1_node,
> +		},
> +		.adapter_path = "\\_SB_.PCI0.I2C4",
>  	}, {
>  		/* LP8557 Backlight controller */
>  		.board_info = {
> @@ -283,9 +329,57 @@ static const struct x86_i2c_client_info lenovo_yogabook_x91_i2c_clients[] __init
>  	},
>  };
>  
> +#define YB1_X91_DRV2604L_0_DEVICE "i2c-DRV2604:00"
> +#define YB1_X91_DRV2604L_1_DEVICE "i2c-DRV2604:01"
> +
> +static int __init lenovo_yb1_x91_init(struct device *dev)
> +{
> +	int ret = 0;
> +
> +	struct device *drv2604l_0_dev __free(put_device) =
> +		bus_find_device_by_name(&i2c_bus_type, NULL,
> +					YB1_X91_DRV2604L_0_DEVICE);
> +	if (!drv2604l_0_dev) {
> +		pr_err("error: cannot find %s device\n",
> +		       YB1_X91_DRV2604L_0_DEVICE);
> +		return -ENODEV;
> +	}
> +
> +	ret = device_create_managed_software_node(drv2604l_0_dev,
> +						  lenovo_yb1_x9x_drv2604l_0_props,
> +						  NULL);
> +	if (ret) {
> +		pr_err("error: cannot create software node for %s: %d\n",
> +		       YB1_X91_DRV2604L_0_DEVICE, ret);
> +		return ret;
> +	}
> +
> +	struct device *drv2604l_1_dev __free(put_device) =
> +		bus_find_device_by_name(&i2c_bus_type, NULL,
> +					YB1_X91_DRV2604L_1_DEVICE);
> +	if (!drv2604l_1_dev) {
> +		pr_err("error: cannot find %s device\n",
> +		       YB1_X91_DRV2604L_1_DEVICE);
> +		return -ENODEV;
> +	}
> +
> +	ret = device_create_managed_software_node(drv2604l_1_dev,
> +						  lenovo_yb1_x9x_drv2604l_1_props,
> +						  NULL);
> +	if (ret) {
> +		pr_err("error: cannot create software node for %s\n",
> +		       YB1_X91_DRV2604L_1_DEVICE);
> +		return ret;
> +	}
> +
> +	return 0;
> +}
> +
>  const struct x86_dev_info lenovo_yogabook_x91_info __initconst = {
>  	.i2c_client_info = lenovo_yogabook_x91_i2c_clients,
>  	.i2c_client_count = ARRAY_SIZE(lenovo_yogabook_x91_i2c_clients),
> +	.gpiochip_type = X86_GPIOCHIP_CHERRYVIEW,
> +	.init = lenovo_yb1_x91_init,
>  };
>  
>  /* Lenovo Yoga Tablet 2 1050F/L's Android factory image has everything hardcoded */
> 
> 

^ permalink raw reply	[flat|nested] 4+ messages in thread

end of thread, other threads:[~2026-07-07 13:19 UTC | newest]

Thread overview: 4+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2026-06-11  8:29 [PATCH v3 0/2] x86-android-tablets: Add sound and haptics support for Lenovo YB1-X9* Yauhen Kharuzhy
2026-06-11  8:29 ` [PATCH v3 1/2] platform: x86-android-tablets: lenovo: Add Yoga Book haptics entries Yauhen Kharuzhy
2026-07-07 13:19   ` Ilpo Järvinen
2026-06-11  8:29 ` [PATCH v3 2/2] platform: x86-android-tablets: lenovo: Add Yoga Book YB1 sound card info Yauhen Kharuzhy

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox