[PATCH v6 4/8] media: i2c: rdacm20: Re-program chip address earlier

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



The current implementation of the camera module initialization
re-programs the chip address during the post-registration phase, once
the reverse channel amplitude has been compensated. While this guarantees
more reliable communications, reprogramming the chip address at probe()
time guarantees that the embedded MCU cannot over-write the settings
programmed by the driver.

Re-program the chip address at probe() time, to avoid conflicts on the
i2c bus due to messages sent by the embedded MCU to the default chip
address which render capture operations unstable.

Signed-off-by: Jacopo Mondi <jacopo+renesas@xxxxxxxxxx>
---
 drivers/media/i2c/rdacm20.c | 10 +++++-----
 1 file changed, 5 insertions(+), 5 deletions(-)

diff --git a/drivers/media/i2c/rdacm20.c b/drivers/media/i2c/rdacm20.c
index ba956733aa89..eb0e3dc22cc3 100644
--- a/drivers/media/i2c/rdacm20.c
+++ b/drivers/media/i2c/rdacm20.c
@@ -462,11 +462,6 @@ static int rdacm20_post_register(struct v4l2_subdev *sd)
 	if (ret < 0)
 		return ret;
 
-	ret = max9271_set_address(&dev->serializer, dev->addrs[0]);
-	if (ret < 0)
-		return ret;
-	dev->serializer.client->addr = dev->addrs[0];
-
 	/*
 	 * Release ov10635 from reset and initialize it. The image sensor
 	 * requires at least 2048 XVCLK cycles (85 micro-seconds at 24MHz)
@@ -562,6 +557,11 @@ static int rdacm20_initialize(struct rdacm20_device *dev)
 	if (ret)
 		return ret;
 
+	ret = max9271_set_address(&dev->serializer, dev->addrs[0]);
+	if (ret < 0)
+		return ret;
+	dev->serializer.client->addr = dev->addrs[0];
+
 	/*
 	 * Set reverse channel high threshold to increase noise immunity.
 	 *
-- 
2.32.0




[Index of Archives]     [Device Tree Compilter]     [Device Tree Spec]     [Linux Driver Backports]     [Video for Linux]     [Linux USB Devel]     [Linux PCI Devel]     [Linux Audio Users]     [Linux Kernel]     [Linux SCSI]     [XFree86]     [Yosemite Backpacking]


  Powered by Linux