[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <639206d5-ccd6-4819-3372-4850fc734204@ideasonboard.com>
Date: Mon, 23 Nov 2020 14:19:23 +0000
From: Kieran Bingham <kieran.bingham+renesas@...asonboard.com>
To: Jacopo Mondi <jacopo+renesas@...ndi.org>,
laurent.pinchart+renesas@...asonboard.com,
niklas.soderlund+renesas@...natech.se, geert@...ux-m68k.org
Cc: linux-media@...r.kernel.org, linux-renesas-soc@...r.kernel.org,
linux-kernel@...r.kernel.org
Subject: Re: [PATCH 2/2] media: rdacm20: Enable GPIO1 explicitly
Hi Jacopo,
On 20/11/2020 16:15, Jacopo Mondi wrote:
> The MAX9271 GPIO1 line that controls the sensor reset is by default
> enabled after a serializer chip reset.
>
> As rdacm20 does not go through an explicit serializer reset, make sure
> GPIO1 is enabled to make the camera module driver more robust.
>
> Fixes: 34009bffc1c6 ("media: i2c: Add RDACM20 driver")
> Signed-off-by: Jacopo Mondi <jacopo+renesas@...ndi.org>
Looks helpful to ensure a GPIO is enabled before toggling ;-)
Reading the datasheet, GPIO1EN defaults to enabled, so I assume this was
already working - however I think being explicit is a good thing anyway.
Reviewed-by: Kieran Bingham <kieran.bingham+renesas@...asonboard.com>
> ---
> drivers/media/i2c/rdacm20.c | 13 +++++++++++--
> 1 file changed, 11 insertions(+), 2 deletions(-)
>
> diff --git a/drivers/media/i2c/rdacm20.c b/drivers/media/i2c/rdacm20.c
> index 1ed928c4ca70..16bcb764b0e0 100644
> --- a/drivers/media/i2c/rdacm20.c
> +++ b/drivers/media/i2c/rdacm20.c
> @@ -487,9 +487,18 @@ static int rdacm20_initialize(struct rdacm20_device *dev)
> * Reset the sensor by cycling the OV10635 reset signal connected to the
> * MAX9271 GPIO1 and verify communication with the OV10635.
> */
> - max9271_clear_gpios(dev->serializer, MAX9271_GPIO1OUT);
> + ret = max9271_enable_gpios(dev->serializer, MAX9271_GPIO1OUT);
> + if (ret)
> + return ret;
> +
> + ret = max9271_clear_gpios(dev->serializer, MAX9271_GPIO1OUT);
> + if (ret)
> + return ret;
> usleep_range(10000, 15000);
> - max9271_set_gpios(dev->serializer, MAX9271_GPIO1OUT);
> +
> + ret = max9271_set_gpios(dev->serializer, MAX9271_GPIO1OUT);
> + if (ret)
> + return ret;
> usleep_range(10000, 15000);
>
> again:
> --
> 2.29.1
>
Powered by blists - more mailing lists