Skip to content

Commit

Permalink
media: rdacm20: Enable GPIO1 explicitly
Browse files Browse the repository at this point in the history
[ Upstream commit 7fe1d44 ]

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: 34009bf ("media: i2c: Add RDACM20 driver")
Signed-off-by: Jacopo Mondi <jacopo+renesas@jmondi.org>
Reviewed-by: Kieran Bingham <kieran.bingham+renesas@ideasonboard.com>
Signed-off-by: Sakari Ailus <sakari.ailus@linux.intel.com>
Signed-off-by: Mauro Carvalho Chehab <mchehab+huawei@kernel.org>
Signed-off-by: Sasha Levin <sashal@kernel.org>
  • Loading branch information
Jacopo Mondi authored and gregkh committed Dec 30, 2020
1 parent 978649a commit 4440b48
Showing 1 changed file with 11 additions and 2 deletions.
13 changes: 11 additions & 2 deletions drivers/media/i2c/rdacm20.c
Expand Up @@ -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:
Expand Down

0 comments on commit 4440b48

Please sign in to comment.