Re: [PATCH 6/8] media: i2c: ov02e10: Implement specification t3 and t5 delays on power-up
From: Hans de Goede
Date: Mon Mar 17 2025 - 05:05:15 EST
Hi,
On 17-Mar-25 01:39, Bryan O'Donoghue wrote:
> The ov02e10 specification says for power-on:
>
> t3 = the time between dvdd stable and XSHUTDOWN deassert
> t5 = the time between XSHUTDOWN deassert and SCCB ready
>
> The power-off path in the spec shows no required delays between XSHUTDONW
> and power-rail shut off so power-off is left alone.
>
> Signed-off-by: Bryan O'Donoghue <bryan.odonoghue@xxxxxxxxxx>
> ---
> drivers/media/i2c/ov02e10.c | 6 +++++-
> 1 file changed, 5 insertions(+), 1 deletion(-)
>
> diff --git a/drivers/media/i2c/ov02e10.c b/drivers/media/i2c/ov02e10.c
> index 9ad70671a718ea0aaf80ad3adcc5738ee57a7ff6..40c4d3ee36e3e2a0bb8be3ff10d016e2bb9bbc9d 100644
> --- a/drivers/media/i2c/ov02e10.c
> +++ b/drivers/media/i2c/ov02e10.c
> @@ -579,7 +579,11 @@ static int ov02e10_power_on(struct device *dev)
> goto disable_clk;
> }
>
> - gpiod_set_value_cansleep(ov02e10->reset, 0);
> + if (ov02e10->reset) {
> + usleep_range(5000, 5100);
> + gpiod_set_value_cansleep(ov02e10->reset, 0);
> + usleep_range(8000, 8100);
> + }
>
> return 0;
>
Note ATM ov02e10->reset is requested with GPIOD_OUT_LOW and it is not
guaranteed that it was high before that. It really should be requested
with GPIOD_OUT_HIGH so that it is guaranteed to be high before
ov02e10_power_on() gets called as the code expects here.
Regards,
Hans