mirror of https://lore.kernel.org/lkml/
 help / color / mirror / Atom feed
* [PATCH] media: imx335: Fix reset-gpio handling
@ 2024-07-29  6:05 Umang Jain
  2024-07-29  7:41 ` Sakari Ailus
  2024-07-29  8:12 ` Jacopo Mondi
  0 siblings, 2 replies; 8+ messages in thread
From: Umang Jain @ 2024-07-29  6:05 UTC (permalink / raw)
  To: linux-media
  Cc: Kieran Bingham, Sakari Ailus, open list, Tommaso Merciai, Umang Jain

The imx335 reset-gpio is initialised with GPIO_OUT_LOW during probe.
However, the reset-gpio logical value is set to 1 in during power-on
and to 0 on power-off. This is incorrect as the reset line
cannot be high during power-on and low during power-off.

Rectify the logical value of reset-gpio so that it is set to
0 during power-on and to 1 during power-off.

Signed-off-by: Umang Jain <umang.jain@ideasonboard.com>
---
 drivers/media/i2c/imx335.c | 6 +++---
 1 file changed, 3 insertions(+), 3 deletions(-)

diff --git a/drivers/media/i2c/imx335.c b/drivers/media/i2c/imx335.c
index cd150606a8a9..878d88b5f476 100644
--- a/drivers/media/i2c/imx335.c
+++ b/drivers/media/i2c/imx335.c
@@ -1171,7 +1171,7 @@ static int imx335_power_on(struct device *dev)
 	usleep_range(500, 550); /* Tlow */
 
 	/* Set XCLR */
-	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);
 
-- 
2.45.0


^ permalink raw reply	[flat|nested] 8+ messages in thread

end of thread, other threads:[~2024-07-29 10:22 UTC | newest]

Thread overview: 8+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2024-07-29  6:05 [PATCH] media: imx335: Fix reset-gpio handling Umang Jain
2024-07-29  7:41 ` Sakari Ailus
2024-07-29  8:49   ` Umang Jain
2024-07-29  8:54     ` Sakari Ailus
2024-07-29 10:22       ` Kieran Bingham
2024-07-29  8:12 ` Jacopo Mondi
2024-07-29  8:48   ` Umang Jain
2024-07-29  9:19     ` Jacopo Mondi

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®