Received: by 2002:a05:6a10:17d3:0:0:0:0 with SMTP id hz19csp1631744pxb; Mon, 12 Apr 2021 02:57:06 -0700 (PDT) X-Google-Smtp-Source: ABdhPJypNNFJvuOEUP0UfrC4ZmNhyqawZJ2OoouFvpTdi+bRN0OAE0/28WXg+y+w1jugnpClfT1D X-Received: by 2002:a17:902:8ec1:b029:e9:998d:91f3 with SMTP id x1-20020a1709028ec1b02900e9998d91f3mr19549275plo.59.1618221426041; Mon, 12 Apr 2021 02:57:06 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1618221426; cv=none; d=google.com; s=arc-20160816; b=0Aup+5hVUiY53O0Nh/uqCu4OuaB+JYqQJg/4UzyGGCQ4apcbU3aEWvIXNs8ITvtvF4 UyjFRwDiU5qT9CZ8ylODfDAxjmV55Uh1+daLjuvHOIKKJlkb+NmQBw7BWlSZ9iiwGadt 0M9R7NipAg4lfSNX2+h7HvYVcmI7frmTsSAXg09CNMsjZAA2qRKR/xjimWGLZDQa+9fu Ha7KsBGFRP+ducT/uAScdKisYg9tHkKMw3C8xRVmJ6hjqAYDf1maiYmq6MZhGUQCEHbR O3bStH/CkUKofmeQPqrC/fBAgM1+R5ifUq5cucGgcNGKyRLLSoZXvQbkuDzEeHfugRFm aYCw== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:content-transfer-encoding:mime-version :references:in-reply-to:message-id:date:subject:cc:to:from; bh=P1UHzAC7VnzB/neglJ/a0TzroR2Io8UnaVVkOBhcWCk=; b=UsVMw0eWqqkEVOi07lQIbuJ3GtFHcquFDlZ1crwWxpzNojlkj5/ZL6HqctlB7KfkRG rKyyCn7cueCPkqgg1g6xQMcrfN4YNS7qEH+DCSmOLY86n57gY6rfTvybhWSTIe3jdO8C XrZ8nGAILyIXqV9ikx2QvJcuoKuT+uSFDbD6Ezdht6vGN1D/EJ3qOJHk0YKUqRVYJY6c nMWFbSoqPujILnvNWNTB+f0EaxA+AvzIG1qANk96s3jgkrmXcodnMEydbj4c2qOUpQLN XBdewye/Jc0kmccHqeGRNNXq66+ABocWsN09oMaAurvgXEHSP4v8Sd0sfHHHQ178ifWu K5Dg== 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 u76si13073808pgc.268.2021.04.12.02.56.54; Mon, 12 Apr 2021 02:57:06 -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 S241731AbhDLJtS (ORCPT + 99 others); Mon, 12 Apr 2021 05:49:18 -0400 Received: from relay12.mail.gandi.net ([217.70.178.232]:37361 "EHLO relay12.mail.gandi.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S241002AbhDLJgh (ORCPT ); Mon, 12 Apr 2021 05:36:37 -0400 Received: from uno.lan (93-34-118-233.ip49.fastwebnet.it [93.34.118.233]) (Authenticated sender: jacopo@jmondi.org) by relay12.mail.gandi.net (Postfix) with ESMTPSA id 4AE2520001C; Mon, 12 Apr 2021 09:34:41 +0000 (UTC) From: Jacopo Mondi To: kieran.bingham+renesas@ideasonboard.com, laurent.pinchart+renesas@ideasonboard.com, niklas.soderlund+renesas@ragnatech.se, geert@linux-m68k.org Cc: Jacopo Mondi , Mauro Carvalho Chehab , linux-media@vger.kernel.org, linux-renesas-soc@vger.kernel.org, linux-kernel@vger.kernel.org Subject: [PATCH v4 11/17] media: i2c: rdacm20: Enable noise immunity Date: Mon, 12 Apr 2021 11:34:45 +0200 Message-Id: <20210412093451.14198-12-jacopo+renesas@jmondi.org> X-Mailer: git-send-email 2.31.1 In-Reply-To: <20210412093451.14198-1-jacopo+renesas@jmondi.org> References: <20210412093451.14198-1-jacopo+renesas@jmondi.org> MIME-Version: 1.0 Content-Transfer-Encoding: 8bit Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Enable the noise immunity threshold at the end of the rdacm20 initialization routine. The rdacm20 camera module has been so far tested with a startup delay that allowed the embedded MCU to program the serializer. If the initialization routine is run before the MCU programs the serializer and the image sensor and their addresses gets changed by the rdacm20 driver it is required to manually enable the noise immunity threshold to make the communication on the control channel more reliable. Reviewed-by: Kieran Bingham Signed-off-by: Jacopo Mondi --- drivers/media/i2c/rdacm20.c | 14 +++++++++++++- 1 file changed, 13 insertions(+), 1 deletion(-) diff --git a/drivers/media/i2c/rdacm20.c b/drivers/media/i2c/rdacm20.c index c1a717153303..5e0314a2b1ca 100644 --- a/drivers/media/i2c/rdacm20.c +++ b/drivers/media/i2c/rdacm20.c @@ -539,7 +539,19 @@ static int rdacm20_initialize(struct rdacm20_device *dev) dev_info(dev->dev, "Identified MAX9271 + OV10635 device\n"); - return 0; + /* + * Set reverse channel high threshold to increase noise immunity. + * + * This should be compensated by increasing the reverse channel + * amplitude on the remote deserializer side. + * + * TODO Inspect the embedded MCU programming sequence to make sure + * there are no conflicts with the configuration applied here. + * + * TODO Clarify the embedded MCU startup delay to avoid write + * collisions on the I2C bus. + */ + return max9271_set_high_threshold(&dev->serializer, true); } static int rdacm20_probe(struct i2c_client *client) -- 2.31.1