From: Kieran Bingham <kieran.bingham+renesas@ideasonboard.com>
To: Jacopo Mondi <jacopo+renesas@jmondi.org>,
laurent.pinchart+renesas@ideasonboard.com,
niklas.soderlund+renesas@ragnatech.se, geert@linux-m68k.org
Cc: linux-media@vger.kernel.org, linux-renesas-soc@vger.kernel.org,
linux-kernel@vger.kernel.org
Subject: Re: [PATCH 2/2] media: rdacm20: Enable GPIO1 explicitly
Date: Mon, 23 Nov 2020 14:19:23 +0000 [thread overview]
Message-ID: <639206d5-ccd6-4819-3372-4850fc734204@ideasonboard.com> (raw)
In-Reply-To: <20201120161529.236447-3-jacopo+renesas@jmondi.org>
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@jmondi.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@ideasonboard.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
>
prev parent reply other threads:[~2020-11-23 14:19 UTC|newest]
Thread overview: 7+ messages / expand[flat|nested] mbox.gz Atom feed top
2020-11-20 16:15 [PATCH 0/2] media: max9271: Fix GPIO handling Jacopo Mondi
2020-11-20 16:15 ` [PATCH 1/2] media: max9271: Fix GPIO enable/disable Jacopo Mondi
2020-11-20 19:12 ` Geert Uytterhoeven
2020-11-23 14:14 ` Kieran Bingham
2020-11-23 15:59 ` Sergei Shtylyov
2020-11-20 16:15 ` [PATCH 2/2] media: rdacm20: Enable GPIO1 explicitly Jacopo Mondi
2020-11-23 14:19 ` Kieran Bingham [this message]
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=639206d5-ccd6-4819-3372-4850fc734204@ideasonboard.com \
--to=kieran.bingham+renesas@ideasonboard.com \
--cc=geert@linux-m68k.org \
--cc=jacopo+renesas@jmondi.org \
--cc=laurent.pinchart+renesas@ideasonboard.com \
--cc=linux-kernel@vger.kernel.org \
--cc=linux-media@vger.kernel.org \
--cc=linux-renesas-soc@vger.kernel.org \
--cc=niklas.soderlund+renesas@ragnatech.se \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox
all inboxes | Powered by JetHome®