[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <20260120-dragon-of-fascinating-felicity-b0cf4d@quoll>
Date: Tue, 20 Jan 2026 11:33:26 +0100
From: Krzysztof Kozlowski <krzk@...nel.org>
To: Petr Hodina <petr.hodina@...tonmail.com>
Cc: Song Qiang <songqiang1304521@...il.com>,
Jonathan Cameron <jic23@...nel.org>, David Lechner <dlechner@...libre.com>,
Nuno Sá <nuno.sa@...log.com>, Andy Shevchenko <andy@...nel.org>, Rob Herring <robh@...nel.org>,
Krzysztof Kozlowski <krzk+dt@...nel.org>, Conor Dooley <conor+dt@...nel.org>,
Liam Girdwood <lgirdwood@...il.com>, Mark Brown <broonie@...nel.org>,
David Heidelberg <david@...t.cz>, linux-iio@...r.kernel.org, devicetree@...r.kernel.org,
linux-kernel@...r.kernel.org
Subject: Re: [PATCH 3/4] iio: proximity: vl53l0x-i2c: Fix reset sequence
On Mon, Jan 19, 2026 at 06:19:57PM +0100, Petr Hodina wrote:
> Fix the reset GPIO handling and power-up timing to better match the
> VL53L0X reset requirements.
>
> Signed-off-by: Petr Hodina <petr.hodina@...tonmail.com>
> ---
> drivers/iio/proximity/vl53l0x-i2c.c | 12 ++++++++----
> 1 file changed, 8 insertions(+), 4 deletions(-)
>
> diff --git a/drivers/iio/proximity/vl53l0x-i2c.c b/drivers/iio/proximity/vl53l0x-i2c.c
> index 7bfab396377a..6901ce7dd835 100644
> --- a/drivers/iio/proximity/vl53l0x-i2c.c
> +++ b/drivers/iio/proximity/vl53l0x-i2c.c
> @@ -275,9 +275,13 @@ static int vl53l0x_power_on(struct vl53l0x_data *data)
> return ret;
> }
>
> - gpiod_set_value_cansleep(data->reset_gpio, 0);
> -
> - usleep_range(3200, 5000);
> + usleep_range(5000, 6000);
> + if (data->reset_gpio) {
> + gpiod_set_value_cansleep(data->reset_gpio, 1);
> + usleep_range(5000, 6000);
> + gpiod_set_value_cansleep(data->reset_gpio, 0);
> + usleep_range(5000, 6000);
> + }
>
> return 0;
> }
> @@ -354,7 +358,7 @@ static int vl53l0x_probe(struct i2c_client *client)
> return dev_err_probe(&client->dev, PTR_ERR(data->vio_supply),
> "Unable to get VDDIO regulator\n");
>
> - data->reset_gpio = devm_gpiod_get_optional(&client->dev, "reset", GPIOD_OUT_HIGH);
> + data->reset_gpio = devm_gpiod_get_optional(&client->dev, "reset", GPIOD_OUT_LOW);
This feels wrong - you are now bringing the device out of reset without
observing any of the reset sequence constraints.
Best regards,
Krzysztof
Powered by blists - more mailing lists