From: Laurent Pinchart <laurent.pinchart@ideasonboard.com>
To: Umang Jain <umang.jain@ideasonboard.com>
Cc: linux-media@vger.kernel.org, stable@vger.kernel.org,
Kieran Bingham <kieran.bingham@ideasonboard.com>,
Sakari Ailus <sakari.ailus@linux.intel.com>,
Tommaso Merciai <tomm.merciai@gmail.com>,
Jacopo Mondi <jacopo.mondi@ideasonboard.com>
Subject: Re: [PATCH v2 2/2] media: imx335: Fix reset-gpio handling
Date: Mon, 29 Jul 2024 14:13:15 +0300 [thread overview]
Message-ID: <20240729111315.GI2320@pendragon.ideasonboard.com> (raw)
In-Reply-To: <20240729110437.199428-3-umang.jain@ideasonboard.com>
Hi Umang,
Thank you for the patch.
On Mon, Jul 29, 2024 at 04:34:37PM +0530, Umang Jain wrote:
> Rectify the logical value of reset-gpio so that it is set to
> 0 (disabled) during power-on and to 1 (enabled) during power-off.
>
> Meanwhile at it, set the reset-gpio to GPIO_OUT_HIGH at initialization
> time to make sure it starts off in reset.
>
> Fixes: 45d19b5fb9ae ("media: i2c: Add imx335 camera sensor driver")
> Signed-off-by: Umang Jain <umang.jain@ideasonboard.com>
> ---
> drivers/media/i2c/imx335.c | 8 ++++----
> 1 file changed, 4 insertions(+), 4 deletions(-)
>
> diff --git a/drivers/media/i2c/imx335.c b/drivers/media/i2c/imx335.c
> index cd150606a8a9..7241fc87ef84 100644
> --- a/drivers/media/i2c/imx335.c
> +++ b/drivers/media/i2c/imx335.c
> @@ -1057,7 +1057,7 @@ static int imx335_parse_hw_config(struct imx335 *imx335)
>
> /* Request optional reset pin */
> imx335->reset_gpio = devm_gpiod_get_optional(imx335->dev, "reset",
> - GPIOD_OUT_LOW);
> + GPIOD_OUT_HIGH);
> if (IS_ERR(imx335->reset_gpio)) {
> dev_err(imx335->dev, "failed to get reset gpio %ld\n",
> PTR_ERR(imx335->reset_gpio));
> @@ -1171,7 +1171,7 @@ static int imx335_power_on(struct device *dev)
> usleep_range(500, 550); /* Tlow */
>
> /* Set XCLR */
I would replace this with
/* Deassert the reset (XCLR) signal. */
or something similar.
Reviewed-by: Laurent Pinchart <laurent.pinchart@ideasonboard.com>
> - gpiod_set_value_cansleep(imx335->reset_gpio, 1);
> + gpiod_set_value_cansleep(imx335->reset_gpio, 0);
>
> ret = clk_prepare_enable(imx335->inclk);
> if (ret) {
> @@ -1184,7 +1184,7 @@ static int imx335_power_on(struct device *dev)
> return 0;
>
> error_reset:
> - gpiod_set_value_cansleep(imx335->reset_gpio, 0);
> + gpiod_set_value_cansleep(imx335->reset_gpio, 1);
> regulator_bulk_disable(ARRAY_SIZE(imx335_supply_name), imx335->supplies);
>
> return ret;
> @@ -1201,7 +1201,7 @@ static int imx335_power_off(struct device *dev)
> struct v4l2_subdev *sd = dev_get_drvdata(dev);
> struct imx335 *imx335 = to_imx335(sd);
>
> - gpiod_set_value_cansleep(imx335->reset_gpio, 0);
> + gpiod_set_value_cansleep(imx335->reset_gpio, 1);
> clk_disable_unprepare(imx335->inclk);
> regulator_bulk_disable(ARRAY_SIZE(imx335_supply_name), imx335->supplies);
>
--
Regards,
Laurent Pinchart
next prev parent reply other threads:[~2024-07-29 11:13 UTC|newest]
Thread overview: 20+ messages / expand[flat|nested] mbox.gz Atom feed top
2024-07-29 11:04 [PATCH v2 0/2] media: imx335: Fix reset-gpio handling Umang Jain
2024-07-29 11:04 ` [PATCH v2 1/2] dt-bindings: imx335: Mention reset-gpio polarity Umang Jain
2024-07-29 11:10 ` Laurent Pinchart
2024-07-29 12:06 ` Umang Jain
2024-07-29 14:27 ` Laurent Pinchart
2024-07-29 13:14 ` kernel test robot
2024-07-29 14:08 ` Krzysztof Kozlowski
2024-07-29 14:20 ` Laurent Pinchart
2024-07-29 11:04 ` [PATCH v2 2/2] media: imx335: Fix reset-gpio handling Umang Jain
2024-07-29 11:13 ` Laurent Pinchart [this message]
2024-07-30 8:17 ` Sakari Ailus
2024-07-29 14:09 ` Krzysztof Kozlowski
2024-07-30 8:24 ` Sakari Ailus
2024-07-30 8:42 ` Krzysztof Kozlowski
2024-07-30 9:10 ` Laurent Pinchart
2024-07-31 5:41 ` Umang Jain
2024-07-31 9:02 ` Kieran Bingham
2024-07-31 9:06 ` Krzysztof Kozlowski
2024-07-31 9:39 ` Laurent Pinchart
2024-08-01 16:09 ` Sakari Ailus
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=20240729111315.GI2320@pendragon.ideasonboard.com \
--to=laurent.pinchart@ideasonboard.com \
--cc=jacopo.mondi@ideasonboard.com \
--cc=kieran.bingham@ideasonboard.com \
--cc=linux-media@vger.kernel.org \
--cc=sakari.ailus@linux.intel.com \
--cc=stable@vger.kernel.org \
--cc=tomm.merciai@gmail.com \
--cc=umang.jain@ideasonboard.com \
/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