From patchwork Wed Sep 16 15:43:37 2020 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Jacopo Mondi X-Patchwork-Id: 11780979 X-Patchwork-Delegate: kieran@bingham.xyz Return-Path: Received: from mail.kernel.org (pdx-korg-mail-1.web.codeaurora.org [172.30.200.123]) by pdx-korg-patchwork-2.web.codeaurora.org (Postfix) with ESMTP id 195F692C for ; Wed, 16 Sep 2020 20:59:39 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by mail.kernel.org (Postfix) with ESMTP id 0332D21941 for ; Wed, 16 Sep 2020 20:59:38 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1726236AbgIPU7i (ORCPT ); Wed, 16 Sep 2020 16:59:38 -0400 Received: from mslow2.mail.gandi.net ([217.70.178.242]:50110 "EHLO mslow2.mail.gandi.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1726331AbgIPQai (ORCPT ); Wed, 16 Sep 2020 12:30:38 -0400 Received: from relay10.mail.gandi.net (unknown [217.70.178.230]) by mslow2.mail.gandi.net (Postfix) with ESMTP id EAC293B067F; Wed, 16 Sep 2020 15:45:21 +0000 (UTC) Received: from uno.lan (93-34-118-233.ip49.fastwebnet.it [93.34.118.233]) (Authenticated sender: jacopo@jmondi.org) by relay10.mail.gandi.net (Postfix) with ESMTPSA id 960FA240010; Wed, 16 Sep 2020 15:39:57 +0000 (UTC) From: Jacopo Mondi To: kieran.bingham+renesas@ideasonboard.com, laurent.pinchart+renesas@ideasonboard.com, niklas.soderlund+renesas@ragnatech.se, mchehab@kernel.org Cc: Jacopo Mondi , linux-media@vger.kernel.org, linux-renesas-soc@vger.kernel.org, linux-kernel@vger.kernel.org, Sakari Ailus , Hans Verkuil , Hyun Kwon , Manivannan Sadhasivam Subject: [PATCH 1/2] RFC: media: i2c: max9286: Compensate reverse channel Date: Wed, 16 Sep 2020 17:43:37 +0200 Message-Id: <20200916154338.159747-2-jacopo+renesas@jmondi.org> X-Mailer: git-send-email 2.28.0 In-Reply-To: <20200916154338.159747-1-jacopo+renesas@jmondi.org> References: <20200916154338.159747-1-jacopo+renesas@jmondi.org> MIME-Version: 1.0 Sender: linux-renesas-soc-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-renesas-soc@vger.kernel.org Adjust the MAX9286 reverse channel amplitude to support devices which are not pre-programmed, like the RDACM21 camera module. The de-serializer starts with a 100mV channel amplitude, and increases it to 170mV after all remote ends have probed and enabled their 'high-threshold' noise immunity feature. Signed-off-by: Jacopo Mondi --- drivers/media/i2c/max9286.c | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) -- 2.28.0 diff --git a/drivers/media/i2c/max9286.c b/drivers/media/i2c/max9286.c index 6852448284ea..992eb15a59be 100644 --- a/drivers/media/i2c/max9286.c +++ b/drivers/media/i2c/max9286.c @@ -535,6 +535,11 @@ static int max9286_notify_bound(struct v4l2_async_notifier *notifier, * - Disable auto-ack as communication on the control channel are now * stable. */ + 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); + usleep_range(2000, 2500); + max9286_check_config_link(priv, priv->source_mask); /* @@ -953,8 +958,7 @@ static int max9286_setup(struct max9286_priv *priv) * high threshold enabled by the serializer driver. */ 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); /*