Received: by 2002:a05:6a10:22f:0:0:0:0 with SMTP id 15csp671388pxk; Wed, 16 Sep 2020 14:00:58 -0700 (PDT) X-Google-Smtp-Source: ABdhPJyW3AAY6/Avc4eJr/pzD/7+cqgpsC8yM6My0BULzPsU54MiSwod3YDlaKGHv/MeCqlI1EnU X-Received: by 2002:a05:6402:6d3:: with SMTP id n19mr29180807edy.381.1600290058020; Wed, 16 Sep 2020 14:00:58 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1600290058; cv=none; d=google.com; s=arc-20160816; b=dZWFIHMyr90givgYZWj272mb8GzC23XaDDiZZ8oqrOljVfEDqM06EkWJnvBhBsh6M+ h+cp9hlohaW58O4hyJzdltL7D0dP6Q0r7M1Fxeoy6YdRLMctYr2VT0ieb3q36oQsfgU3 +0b/iRxgg6sV0AGCwT79b66236zCbKJhDj/4wJoXq+mRC12k68cJpZlLBTYvA7UQYOnP sVBjEhVc7eA+YPfHW9rc9zLO7dtt7KdwSW4X4d9f+//xwX56WtFUGMmHQ4Z+7U3ofJ+0 D0E1HJv3dQWVJbtwBtDFzk4vXolxpX1I9lu4flASOtUSrLneIMwSxjVucY+ggr72fIvq 4CgA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:content-transfer-encoding:mime-version :references:in-reply-to:message-id:date:subject:cc:to:from; bh=LTid6dlpTSJi0qbLwlz31lmmWo8MD+CglwQsj+CcLes=; b=nNVPTCbi1XLy5VHzn+/k7mHvHrGybW+RFq35jhZZvrfJ6L4uscrE0vTK7QvkOwXK3Z d9yfE21mttO/ZknINswHs5Y0C/wdgwaPbPkiir6V2QYJAbKqRTT5q3qsjGVIsQWYf/0M 2bvP2GeqOCwqiB6syVDnlAGnaYyZNmD2O2YgE26EThxC7c5tx5Dr6OXoXA2yOMJB6xJj Dy1J18dUM/sSfF45xNXfxaHy6twRM23jRA/aXmVGzCfkgDjn4BLXhK387XrU+xkqyF/A VL1ac0S6lT/X43JUcTvLs+ZCahEpoaNJEVq5OLdU55ZPVqOUhYvyLxUo3d8VIyWh1nmp +gqg== ARC-Authentication-Results: i=1; mx.google.com; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [23.128.96.18]) by mx.google.com with ESMTP id c3si9843825ejk.666.2020.09.16.14.00.34; Wed, 16 Sep 2020 14:00:58 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) client-ip=23.128.96.18; Authentication-Results: mx.google.com; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1726739AbgIPU5U (ORCPT + 99 others); Wed, 16 Sep 2020 16:57:20 -0400 Received: from mslow2.mail.gandi.net ([217.70.178.242]:57346 "EHLO mslow2.mail.gandi.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1726550AbgIPQwh (ORCPT ); Wed, 16 Sep 2020 12:52:37 -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 Content-Transfer-Encoding: 8bit Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@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(-) 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); /* -- 2.28.0