Received: by 2002:a05:6a10:9848:0:0:0:0 with SMTP id x8csp1558278pxf; Fri, 19 Mar 2021 09:44:10 -0700 (PDT) X-Google-Smtp-Source: ABdhPJy4s7n6ZIXXj//wfNf6pIw9Z0oHJCdUaGWNTqGZ0m7QqBIV42g7/fQzV14XOgU1ygUVn2gv X-Received: by 2002:a17:906:22d2:: with SMTP id q18mr5376928eja.437.1616172249928; Fri, 19 Mar 2021 09:44:09 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1616172249; cv=none; d=google.com; s=arc-20160816; b=m/HPg5Tv+uzNX0JFd8eEBPc3hz5ALiQDfuOx8bUXBaXl0Ap5ikVFmVWG2/MtvRJJtv 43uhqcm6zkPYt5UonGdLtb3xC5QLrGZ7vRQGhgIwfVrG4DMVDthTvmAMpETZn7ekcA0k Rp9X0xI8W0AHxPxkvDHu/5XQ1bSHdenBhtMM09Yxzw8MiGhvh7Z2Diwa8MkhVyZYMj+h lNfQz6csGk8nU/NI7H4l37EINnRgECHZOxf7IpQoXgvYbyBSqcMsuNbtqqYOQKy1gkQd lg74OyC+IKQ56gAKU/Ht5C10SOQskBtpQSMsbMXbwncKJ6odNNPncQYbYOKkkxS5PsaM VnTw== 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=G5A5vmpRtj1ypXuEN7zw0ilDrntGJziKBQ5mnpNO7gU=; b=uWhrHl5sSwXa2BwU91vi5rP5SL8hOwTWlIHXSlz93oOUTgwLCDesMUphzM24OnIGFI ku+7JAuEXvTUcAFTDjO5J7MHIdsFdE1Ub2DxxAI6aGousCvsvH3e5At02s0KI4JsOkFn NtxhR+kYvUf8EOPMyzx0cWG5ZpcGgVwWPj/PEqdBWpwPGW4zfYZLt16B06huxbd/4VoO jSrzUweaw0OyNrskFHZqjbAwg81GXl0qIcUAechPpvKNbxYT7bT6YI+TMeRcHcAFJbAl VXi151hkXHjLUY+sXxhJKfiwEKZdblDCEZst/tL0L8FQIuJFo+EPZ7dgZ1Xx1mCWkK4F TdXg== 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 hd34si4641639ejc.197.2021.03.19.09.43.47; Fri, 19 Mar 2021 09:44:09 -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 S231139AbhCSQmt (ORCPT + 99 others); Fri, 19 Mar 2021 12:42:49 -0400 Received: from relay6-d.mail.gandi.net ([217.70.183.198]:36899 "EHLO relay6-d.mail.gandi.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S230253AbhCSQmR (ORCPT ); Fri, 19 Mar 2021 12:42:17 -0400 X-Originating-IP: 5.92.35.220 Received: from uno.localdomain (mob-5-92-35-220.net.vodafone.it [5.92.35.220]) (Authenticated sender: jacopo@jmondi.org) by relay6-d.mail.gandi.net (Postfix) with ESMTPSA id 4DCF9C0007; Fri, 19 Mar 2021 16:42:13 +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 v3 14/19] media: i2c: rdacm20: Enable noise immunity Date: Fri, 19 Mar 2021 17:41:43 +0100 Message-Id: <20210319164148.199192-15-jacopo+renesas@jmondi.org> X-Mailer: git-send-email 2.30.0 In-Reply-To: <20210319164148.199192-1-jacopo+renesas@jmondi.org> References: <20210319164148.199192-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 2881e752efbe..554fd3b3ec3d 100644 --- a/drivers/media/i2c/rdacm20.c +++ b/drivers/media/i2c/rdacm20.c @@ -518,7 +518,19 @@ static int rdacm20_init(struct v4l2_subdev *sd, unsigned int val) 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 const struct v4l2_subdev_core_ops rdacm20_core_ops = { -- 2.30.0