Received: by 2002:a05:6a10:6744:0:0:0:0 with SMTP id w4csp1185187pxu; Fri, 16 Oct 2020 06:08:44 -0700 (PDT) X-Google-Smtp-Source: ABdhPJxz4TN5+BWu6pJUs4kOpChwcGHx4UclDN2L4bz/egR0efeG/zEjALxhBiuY7e0VuYFea6fr X-Received: by 2002:a17:906:ad87:: with SMTP id la7mr3626373ejb.85.1602853724444; Fri, 16 Oct 2020 06:08:44 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1602853724; cv=none; d=google.com; s=arc-20160816; b=K0Ix89bXOvpDNB1iYVmfIo9U3Xx1TiJ0LKrakkGu9o+SIGaFKm0fIcHZIyRsEgwBK8 RJCxrZe2hcmv5rVk8TbuOBs/My7Lh2aoct/2b0ZgweKlijSul5Ioqh7eOKcRTMXYsBIr w082GuQjjIGz3Z3l+l8nxBTmmNJlgnjTmfZ4DVPQRf4TrXRiMKnPqJvzazPP8JfQxJ9F MvrOSnxx7BfuZ5ZalC/cC4F0vHwQubAU7MnJ1EGeT2JI0dqH2q93yQ9gqY1D2TdfJfIx 3nAQ9OdZVZqKaFtRXoESYnbhYXFKLf/cj9Z6I0Ou2RxQ9ZKgYn00yy/do/25HqwuPbr6 loUA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:content-transfer-encoding:content-language :in-reply-to:mime-version:user-agent:date:message-id:organization :from:references:cc:to:subject:reply-to:dkim-signature; bh=MdwQAwvZVGK6BfyFkkA0khRbt7QpfOcGlaMB7beFFp0=; b=xchmUaI7uYwe6U0RNN2WqeQMyRnhA2hZkTTm1cOouXKhNeE23UKNDIFNTsJ76FV9p+ TKnZg9jJZ9S2mOzvgoQmToxhkmqtqyRmpVyNNj6x7We2hqWSX+flI2g2Wuz25UmAgQcl vjtfyPqFSAfRTZ+8oEcV6WZnMnKsUG2S5XfnwRnFCs9xMMpRdhScYe4NzuIsNplBLCxi EVGZZFIqEmPUus2HcksFUa/y5eTLFJyFN0dUhbV67Nt5oHcmP2vTX4HQUTjk39EczRMP N3GzCVmCRY1BoyZ8XxwmT+NHXprZF65EfBM0UQmaHMiB0N3IAZ1W8wpBDZYR0g9G3/lU MJdQ== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass (test mode) header.i=@ideasonboard.com header.s=mail header.b=rVWhYl4b; 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 p10si1634649ejx.708.2020.10.16.06.08.19; Fri, 16 Oct 2020 06:08:44 -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; dkim=pass (test mode) header.i=@ideasonboard.com header.s=mail header.b=rVWhYl4b; 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 S2406741AbgJPLEf (ORCPT + 99 others); Fri, 16 Oct 2020 07:04:35 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:50688 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S2406670AbgJPLEf (ORCPT ); Fri, 16 Oct 2020 07:04:35 -0400 Received: from perceval.ideasonboard.com (perceval.ideasonboard.com [IPv6:2001:4b98:dc2:55:216:3eff:fef7:d647]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 37F59C061755; Fri, 16 Oct 2020 04:04:35 -0700 (PDT) Received: from [192.168.0.20] (cpc89244-aztw30-2-0-cust3082.18-1.cable.virginm.net [86.31.172.11]) by perceval.ideasonboard.com (Postfix) with ESMTPSA id 3FC11528; Fri, 16 Oct 2020 13:04:32 +0200 (CEST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=ideasonboard.com; s=mail; t=1602846272; bh=KpwAjDEbv0VgYYcCcN3JOEIMqRVebV5AYoRSvMrsZq4=; h=Reply-To:Subject:To:Cc:References:From:Date:In-Reply-To:From; b=rVWhYl4bdvV0xA131ANG2T70nFbP0/YAeGXHBpXfzuF7xehT+3JHOHRxSCyiHCxDZ mlH0r2uQODH7sMLc2zc6TGDxJZdiEm7OlgJXWH4bqNHZZb6+W+ezcvltMZWQ8q6G57 Ozrp7jsiRaHQP+6QpO3o9ewQ4wVTc0bYC3hgTD3c= Reply-To: kieran.bingham+renesas@ideasonboard.com Subject: Re: [PATCH v3 5/7] media: i2c: max9286: Configure reverse channel amplitude To: Jacopo Mondi , laurent.pinchart+renesas@ideasonboard.com, niklas.soderlund+renesas@ragnatech.se Cc: linux-media@vger.kernel.org, linux-renesas-soc@vger.kernel.org, linux-kernel@vger.kernel.org, Hyun Kwon , Manivannan Sadhasivam References: <20201016120625.64337-1-jacopo+renesas@jmondi.org> <20201016120625.64337-6-jacopo+renesas@jmondi.org> From: Kieran Bingham Organization: Ideas on Board Message-ID: Date: Fri, 16 Oct 2020 12:04:29 +0100 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:68.0) Gecko/20100101 Thunderbird/68.10.0 MIME-Version: 1.0 In-Reply-To: <20201016120625.64337-6-jacopo+renesas@jmondi.org> Content-Type: text/plain; charset=utf-8 Content-Language: en-GB Content-Transfer-Encoding: 7bit Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Hi Jacopo, On 16/10/2020 13:06, Jacopo Mondi wrote: > Adjust reverse channel amplitude according to the presence of > the 'high-threshold" DTS property. > > If no high threshold compensation is required, start with a low > amplitude (100mV) and increase it after the remote serializers > have probed and have enabled noise immunity on their reverse > channels. > > If high threshold compensation is required, configure the reverse > channel with a 170mV amplitude before the remote serializers have > probed. > > This change is required for both rdacm20 and rdacm21 camera modules > to be correctly probed when used in combination with the max9286 > deserializer. My only fear here would be that perhaps on other cameras we need a more fine-grained control of the amplitudes? But I'll leave that discussion to the binding itself, For this patch ... Reviewed-by: Kieran Bingham > > Signed-off-by: Jacopo Mondi > --- > drivers/media/i2c/max9286.c | 19 ++++++++++++++++++- > 1 file changed, 18 insertions(+), 1 deletion(-) > > diff --git a/drivers/media/i2c/max9286.c b/drivers/media/i2c/max9286.c > index 31e27d0f34f1..4c72e1e6b27b 100644 > --- a/drivers/media/i2c/max9286.c > +++ b/drivers/media/i2c/max9286.c > @@ -163,6 +163,8 @@ struct max9286_priv { > unsigned int mux_channel; > bool mux_open; > > + bool high_threshold; > + > struct v4l2_ctrl_handler ctrls; > struct v4l2_ctrl *pixelrate; > > @@ -557,10 +559,14 @@ static int max9286_notify_bound(struct v4l2_async_notifier *notifier, > * All enabled sources have probed and enabled their reverse control > * channels: > * > + * - Increase the reverse channel amplitude to compensate for the > + * remote ends high threshold, if not done already > * - Verify all configuration links are properly detected > * - Disable auto-ack as communication on the control channel are now > * stable. > */ > + if (!priv->high_threshold) > + max9286_reverse_channel_setup(priv, 170); > max9286_check_config_link(priv, priv->source_mask); > > /* > @@ -967,7 +973,12 @@ static int max9286_setup(struct max9286_priv *priv) > * only. This should be disabled after the mux is initialised. > */ > max9286_configure_i2c(priv, true); > - max9286_reverse_channel_setup(priv, 170); > + > + /* > + * Compensate the remote end high threshold with a larger channel > + * amplitude if necessary. > + */ > + max9286_reverse_channel_setup(priv, priv->high_threshold ? 170 : 100); > > /* > * Enable GMSL links, mask unused ones and autodetect link > @@ -1235,6 +1246,12 @@ static int max9286_parse_dt(struct max9286_priv *priv) > } > of_node_put(node); > > + /* > + * Parse 'high_threshold' property to configure the reverse channel > + * amplitude. > + */ > + priv->high_threshold = device_property_present(dev, "high_threshold"); > + > priv->route_mask = priv->source_mask; > > return 0; >