Re: [PATCH 2/5] input: drv260x: Add support for ACPI-enumerated devices
From: Dmitry Torokhov
Date: Thu Feb 12 2026 - 12:26:38 EST
Hi Yauhen,
On Thu, Feb 12, 2026 at 01:46:52AM +0200, Yauhen Kharuzhy wrote:
> Add ACPI ids and GPIO lookup mapping for drv2604 haptics device.
> Found in Lenovo Yoga Book YB1-X91L tablet.
>
> Signed-off-by: Yauhen Kharuzhy <jekhor@xxxxxxxxx>
> ---
> drivers/input/misc/drv260x.c | 30 ++++++++++++++++++++++++++++--
> 1 file changed, 28 insertions(+), 2 deletions(-)
>
> diff --git a/drivers/input/misc/drv260x.c b/drivers/input/misc/drv260x.c
> index 18360bdfe877..f613c81fa2ba 100644
> --- a/drivers/input/misc/drv260x.c
> +++ b/drivers/input/misc/drv260x.c
> @@ -15,6 +15,7 @@
> #include <linux/delay.h>
> #include <linux/gpio/consumer.h>
> #include <linux/regulator/consumer.h>
> +#include <linux/acpi.h>
Sort alphabetically please.
>
> #include <dt-bindings/input/ti-drv260x.h>
>
> @@ -419,6 +420,12 @@ static const struct regmap_config drv260x_regmap_config = {
> .cache_type = REGCACHE_NONE,
> };
>
> +static const struct acpi_gpio_params enable_gpio = { 0, 0, false };
> +static const struct acpi_gpio_mapping acpi_drv260x_default_gpios[] = {
> + { "enable-gpio", &enable_gpio, 1 },
> + { }
> +};
I'd rather move this ACPI/device-specifin handling into drivers/platform/x86/x86-android-tablets/lenovo.c
> +
> static int drv260x_probe(struct i2c_client *client)
> {
> struct device *dev = &client->dev;
> @@ -426,6 +433,14 @@ static int drv260x_probe(struct i2c_client *client)
> u32 voltage;
> int error;
>
> + if (has_acpi_companion(dev)) {
> + error = devm_acpi_dev_add_driver_gpios(dev, acpi_drv260x_default_gpios);
> + if (error) {
> + dev_err(dev, "can't add GPIO ACPI mapping\n");
> + return error;
> + }
> + }
> +
> haptics = devm_kzalloc(dev, sizeof(*haptics), GFP_KERNEL);
> if (!haptics)
> return -ENOMEM;
> @@ -484,8 +499,10 @@ static int drv260x_probe(struct i2c_client *client)
> return error;
> }
>
> - haptics->enable_gpio = devm_gpiod_get_optional(dev, "enable",
> - GPIOD_OUT_HIGH);
> + haptics->enable_gpio = devm_gpiod_get_optional(dev,
> + "enable", GPIOD_OUT_HIGH);
Why this change?
> +
> + dev_dbg(dev, "Enable gpio = 0x%p\n", haptics->enable_gpio);
?
> if (IS_ERR(haptics->enable_gpio))
> return PTR_ERR(haptics->enable_gpio);
>
> @@ -606,6 +623,14 @@ static const struct i2c_device_id drv260x_id[] = {
> };
> MODULE_DEVICE_TABLE(i2c, drv260x_id);
>
> +#ifdef CONFIG_ACPI
> +static const struct acpi_device_id drv260x_acpi_match[] = {
> + { "DRV2604", 0 },
> + { }
> +};
> +MODULE_DEVICE_TABLE(acpi, drv260x_acpi_match);
> +#endif
> +
> static const struct of_device_id drv260x_of_match[] = {
> { .compatible = "ti,drv2604", },
> { .compatible = "ti,drv2604l", },
> @@ -621,6 +646,7 @@ static struct i2c_driver drv260x_driver = {
> .name = "drv260x-haptics",
> .of_match_table = drv260x_of_match,
> .pm = pm_sleep_ptr(&drv260x_pm_ops),
> + .acpi_match_table = ACPI_PTR(drv260x_acpi_match),
> },
> .id_table = drv260x_id,
> };
Thanks.
--
Dmitry