Received: by 2002:a05:6a10:206:0:0:0:0 with SMTP id 6csp468321pxj; Wed, 16 Jun 2021 06:39:30 -0700 (PDT) X-Google-Smtp-Source: ABdhPJy5Lp33t2kbMsZh4B8c0CnfDCRLlefG1dfoQjLVD0D7XqKMHDaLv6XTBf0zRV4qNE0XyoZb X-Received: by 2002:a92:c5a9:: with SMTP id r9mr1666576ilt.56.1623850770731; Wed, 16 Jun 2021 06:39:30 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1623850770; cv=none; d=google.com; s=arc-20160816; b=OrF3HnVo+SIQUy5kd/VpXX3To5ZV96xIYZ/pQEHssKOyOrwq41VL3cUqJH4UsQcile X75F0eHwBrH/cib4S/1zblqouY8mZXqhsc6dST1lWqnSo/CXKVpKH1XprV4Pgm0Xl/78 RtIeAz1QZNCt+V9RtUdWNmPax7evIYT8eh9yFX7OV7BV0J3o3MAsHYtLZez+uhbxPmEB WlgEhBZlkgpIg+ltZMOVtR8+xDrl8DuZUxP5vMualovk78l+nAygDpvZ7Cq4HUaCSAf8 KBYGD9hVJHcTdBLA4Y7/wYF6xwyL0EJ177Gyx9427ckwczHlsFusZ8tt0J1fyWEbu37K UO5w== 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=64AG9ybjDPxpY/Lc72KfORj5XbDJGMRbWb+N14rg9oY=; b=l9QkaabyzHtAsgfZ0ZUdoUDHONAdc4v9RsfSiW/J7kdPeaZvVCi7JoQZ6VNO3XakLT +43lxhS37B1dT3SJ3DNrr7crVud/tFnlgpe5vu/1X0Lsen4YPEjvFVAfY9tRiVRglA62 LsWWBhk90y+wnOmY8BmFR+dgGOry2rwg3A4QvR2OvOUkoSLp0F6VY3M7O9n5wxuZdVp8 /fvg5tS7hcJ6xzN+3Lnqn+Ex07xonvx9fiFFRFr14QOn1zRpC1YLLIhWbDH2IUZwoMl+ E8g+cU2FsKjvQnLXN6/A6Vqm6zOYotU34hRDkLQCDdRSkKlSydYsjrhFea8QI+xxQtvu eKiw== 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 g12si2836383ila.95.2021.06.16.06.39.17; Wed, 16 Jun 2021 06:39:30 -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 S233027AbhFPMsg (ORCPT + 99 others); Wed, 16 Jun 2021 08:48:36 -0400 Received: from relay5-d.mail.gandi.net ([217.70.183.197]:43029 "EHLO relay5-d.mail.gandi.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S232934AbhFPMsK (ORCPT ); Wed, 16 Jun 2021 08:48:10 -0400 Received: (Authenticated sender: jacopo@jmondi.org) by relay5-d.mail.gandi.net (Postfix) with ESMTPSA id 4A43E1C0015; Wed, 16 Jun 2021 12:46:01 +0000 (UTC) From: Jacopo Mondi To: Hans Verkuil , 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, Laurent Pinchart Subject: [PATCH v5 11/15] media: i2c: rdacm20: Enable noise immunity Date: Wed, 16 Jun 2021 14:46:12 +0200 Message-Id: <20210616124616.49249-12-jacopo+renesas@jmondi.org> X-Mailer: git-send-email 2.31.1 In-Reply-To: <20210616124616.49249-1-jacopo+renesas@jmondi.org> References: <20210616124616.49249-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. Signed-off-by: Jacopo Mondi Reviewed-by: Laurent Pinchart Reviewed-by: Kieran Bingham --- 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