All of lore.kernel.org
 help / color / mirror / Atom feed
From: Jacopo Mondi <jacopo+renesas@jmondi.org>
To: kieran.bingham+renesas@ideasonboard.com,
	laurent.pinchart@ideasonboard.com, niklas.soderlund@ragnatech.se
Cc: Jacopo Mondi <jacopo+renesas@jmondi.org>,
	linux-renesas-soc@vger.kernel.org
Subject: [PATCH v7 4/6] media: i2c: max9286: Adjust reverse channel amplitude
Date: Sun, 16 Feb 2020 11:51:03 +0100	[thread overview]
Message-ID: <20200216105105.3751688-5-jacopo+renesas@jmondi.org> (raw)
In-Reply-To: <20200216105105.3751688-1-jacopo+renesas@jmondi.org>

Start with reverse channel amplitude set to 100mV and later increase it
to 170mV to compensate the serializer high threshold.

This allows more reliable communications with RDACM21 camera which have
not been pre-programmed with an already compensated reverse channel
configuration.

Warning: this change breaks operation with pre-programmed RDACM20
camera modules

Signed-off-by: Jacopo Mondi <jacopo+renesas@jmondi.org>

---
v7:
 - new patch required to operate with RDACM21
---
 drivers/media/i2c/max9286.c | 12 +++++++-----
 1 file changed, 7 insertions(+), 5 deletions(-)

diff --git a/drivers/media/i2c/max9286.c b/drivers/media/i2c/max9286.c
index ed5dcae6b363..dd3bfb3c59b7 100644
--- a/drivers/media/i2c/max9286.c
+++ b/drivers/media/i2c/max9286.c
@@ -594,10 +594,13 @@ static int max9286_notify_bound(struct v4l2_async_notifier *notifier,
 	 * All enabled sources have probed and enabled their reverse control
 	 * channels:
 	 *
-	 * - Verify all configuration links are properly detected
+	 * - Increase reverse channel amplitude to 170mV
 	 * - Disable auto-ack as communication on the control channel are now
 	 *   stable.
 	 */
+	max9286_write(priv, 0x3b, MAX9286_REV_TRF(1) | MAX9286_REV_AMP(70) |
+		      MAX9286_REV_AMP_X);
+
 	max9286_check_config_link(priv, priv->source_mask);
 
 	/*
@@ -984,12 +987,11 @@ static int max9286_setup(struct max9286_priv *priv)
 	 *
 	 * - Enable custom reverse channel configuration (through register 0x3f)
 	 *   and set the first pulse length to 35 clock cycles.
-	 * - Increase the reverse channel amplitude to 170mV to accommodate the
-	 *   high threshold enabled by the serializer driver.
+	 * - Set reverse channel amplitude to 100mV and increase it later after
+	 *   the serializer high threshold have been increased.
 	 */
 	max9286_write(priv, 0x3f, MAX9286_EN_REV_CFG | MAX9286_REV_FLEN(35));
-	max9286_write(priv, 0x3b, MAX9286_REV_TRF(1) | MAX9286_REV_AMP(70) |
-		      MAX9286_REV_AMP_X);
+	max9286_write(priv, 0x3b, MAX9286_REV_TRF(1) | MAX9286_REV_AMP(100));
 	usleep_range(2000, 2500);
 
 	/*
-- 
2.25.0


  parent reply	other threads:[~2020-02-16 10:48 UTC|newest]

Thread overview: 7+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2020-02-16 10:50 [PATCH v7 0/6] RDACM20 and RDACM21 GMSL camera support Jacopo Mondi
2020-02-16 10:51 ` [PATCH v7 1/6] media: i2c: max9286: Disable overlap window Jacopo Mondi
2020-02-16 10:51 ` [PATCH v7 2/6] dt-bindings: media: i2c: Add bindings for IMI RDACM2x Jacopo Mondi
2020-02-16 10:51 ` [PATCH v7 3/6] media: i2c: Add driver for RDACM20 camera module Jacopo Mondi
2020-02-16 10:51 ` Jacopo Mondi [this message]
2020-02-16 10:51 ` [PATCH v7 5/6] media: i2c: max9286: Adjust image format size Jacopo Mondi
2020-02-16 10:51 ` [PATCH v7 6/6] media: i2c: Add driver for RDACM21 camera module Jacopo Mondi

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=20200216105105.3751688-5-jacopo+renesas@jmondi.org \
    --to=jacopo+renesas@jmondi.org \
    --cc=kieran.bingham+renesas@ideasonboard.com \
    --cc=laurent.pinchart@ideasonboard.com \
    --cc=linux-renesas-soc@vger.kernel.org \
    --cc=niklas.soderlund@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 an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.