From: Mike Looijmans Date: Fri, 7 Jul 2023 23:29:15 +0000 (-0700) Subject: Input: exc3000 - support power supply regulators X-Git-Url: http://git.maquefel.me/?a=commitdiff_plain;h=0d384e5959dde12717419a3fd77ee62cc10f069f;p=linux.git Input: exc3000 - support power supply regulators Add power supply regulator support to the exc3000 devices. Signed-off-by: Mike Looijmans Link: https://lore.kernel.org/r/20230707131042.10795-2-mike.looijmans@topic.nl Signed-off-by: Dmitry Torokhov --- diff --git a/drivers/input/touchscreen/exc3000.c b/drivers/input/touchscreen/exc3000.c index 4af4c1e5d0da2..e3f6d21b3c1b3 100644 --- a/drivers/input/touchscreen/exc3000.c +++ b/drivers/input/touchscreen/exc3000.c @@ -18,6 +18,7 @@ #include #include #include +#include #include #include #include @@ -360,6 +361,12 @@ static int exc3000_probe(struct i2c_client *client) if (IS_ERR(data->reset)) return PTR_ERR(data->reset); + /* For proper reset sequence, enable power while reset asserted */ + error = devm_regulator_get_enable(&client->dev, "vdd"); + if (error && error != -ENODEV) + return dev_err_probe(&client->dev, error, + "failed to request vdd regulator\n"); + if (data->reset) { msleep(EXC3000_RESET_MS); gpiod_set_value_cansleep(data->reset, 0);