Received: by 2002:a05:6a10:8c0a:0:0:0:0 with SMTP id go10csp7457272pxb; Thu, 18 Feb 2021 10:30:28 -0800 (PST) X-Google-Smtp-Source: ABdhPJydON2J069ofVfp55OJ9WvergFr8ZlwDMsTpB6cAFIttQH9xlZOiWagPNSYfwNhRhbKhsVf X-Received: by 2002:a17:906:4c85:: with SMTP id q5mr5134514eju.375.1613673028701; Thu, 18 Feb 2021 10:30:28 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1613673028; cv=none; d=google.com; s=arc-20160816; b=NwWwZpq8gjlCahx0UbwBOs0bGvisytMN8w3Dg1TKG7Vg7pL+Tx+L7touQeHDClAOzW Ja3gqqm0sxoMHVHGYSVxlP7w769z3N9n+3LZGrbvqngV9DiUqwMV9dDRsbWhgqINJMEs 4MnvrQWZhdrondGRO+AMZBOca/Sf0HAQ9lt/4MQvJ/W3ESu0psYnrE0ZioX4/YCVsn6L OYpruYomm5KkNj6AonwudEK1/F+CF+WI507doW+haKeNU6U0zwJfJmZMLv4qEqtingEA HNDSxmWWmzq1x6PPvHsJJ6AZVvIUSZCNPfSuKIgn+dmwmKrt0fTDfyxmeJKYVOrub2lS H+iw== 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=xoiy3IE6d5hKJQqOnXEEJRPCYffruKL8Dh64cUVFcak=; b=XR8ygIImMYr0pFRbbRCRFocJZEA6wb4awVlJF9KoB2F6IC+HZafkn5vzrWigNJWxwC 4ufGlnUmv/Fx32SRq7yb7mzY2aQDfJaCXjCkdTHQY3rTfzB9a+xQt1ysGAqPi3eVZTes w5Aw/grzxLffFZBJJ61t5RtcJOQZMfO9b1m3Cfw56Z0LZgE6m9fbZ9deMIjDTfSleiYH Aluf7i4QhYAdWr4JLMHM75+xwC4jEis95FOEVj32Q+6cEceiixO2vANkD8eBKyaUHSYk CvIPs+Qtq/iBSzXg9BNVVNgR6IS6yL6znzOaUH0gLLOEwQyDrYgovks5SRD7NhSjCL/1 IeVQ== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass (test mode) header.i=@ideasonboard.com header.s=mail header.b=pOIMR0ov; 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 y6si4229307edw.448.2021.02.18.10.30.04; Thu, 18 Feb 2021 10:30:28 -0800 (PST) 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=pOIMR0ov; 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 S231951AbhBRS2K (ORCPT + 99 others); Thu, 18 Feb 2021 13:28:10 -0500 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:38194 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S232851AbhBRQFn (ORCPT ); Thu, 18 Feb 2021 11:05:43 -0500 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 B3808C061756 for ; Thu, 18 Feb 2021 08:04:58 -0800 (PST) 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 ED42F3E7; Thu, 18 Feb 2021 17:00:18 +0100 (CET) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=ideasonboard.com; s=mail; t=1613664019; bh=+fg4ZdYS3PaFeKu9P08ymW/RCB8AxtGAFSyL34K0jjU=; h=Reply-To:Subject:To:Cc:References:From:Date:In-Reply-To:From; b=pOIMR0ovOb19HoGIScfXBqUfGhjiMfaWVe4lAro4kD3Ad4dt3lKR0LOy+f2xggAiK 86eRjaiidiGAwzgbZJ+W2W7kUDfxKefPRWmfnlVZXkJeUEoKkBiIEY4Pro/DG8/VnB XcC/gz8ff15aeURrsdDkDNvY1Wx+e5WjrF94EAmI= Reply-To: kieran.bingham+renesas@ideasonboard.com Subject: Re: [PATCH 14/16] media: i2c: max9286: Initialize remotes when bound To: Jacopo Mondi , laurent.pinchart+renesas@ideasonboard.com, niklas.soderlund+renesas@ragnatech.se, geert@linux-m68k.org Cc: Mauro Carvalho Chehab , linux-media@vger.kernel.org, linux-renesas-soc@vger.kernel.org, linux-kernel@vger.kernel.org References: <20210216174146.106639-1-jacopo+renesas@jmondi.org> <20210216174146.106639-15-jacopo+renesas@jmondi.org> From: Kieran Bingham Organization: Ideas on Board Message-ID: <2c4299af-4e1f-9a72-b24b-bb7876bb1e5b@ideasonboard.com> Date: Thu, 18 Feb 2021 16:00:16 +0000 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: <20210216174146.106639-15-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 On 16/02/2021 17:41, Jacopo Mondi wrote: > With the introduction of the .init() core subdev operation in the > max9271 GMSL serializer, the max9286 deserializer needs to explicitly > initialize the remote devices by calling the .init() subdev operation on > each probed camera. > > Call the .init() subdev operation at remote bound time and toggle > the reverse channel amplitude to compensate for the remote ends > noise immunity threshold. > Should this patch be merged with the previous one to keep the RDACM2x and max9286 usage aligned? I expect it won't compile fail, but it would fail a test (if bisecting was testing the capture). Seems to look ok, given the previous patch as a dependency: Reviewed-by: Kieran Bingham > Signed-off-by: Jacopo Mondi > --- > drivers/media/i2c/max9286.c | 24 +++++++++++++++++++----- > 1 file changed, 19 insertions(+), 5 deletions(-) > > diff --git a/drivers/media/i2c/max9286.c b/drivers/media/i2c/max9286.c > index 7913b5f2249e..c41284de89b6 100644 > --- a/drivers/media/i2c/max9286.c > +++ b/drivers/media/i2c/max9286.c > @@ -554,25 +554,39 @@ static int max9286_notify_bound(struct v4l2_async_notifier *notifier, > dev_dbg(&priv->client->dev, "Bound %s pad: %u on index %u\n", > subdev->name, src_pad, index); > > + /* > + * Initialize the remote camera. Increase the channel amplitude > + * to compensate for the remote noise immunity threshold. > + */ > + max9286_reverse_channel_setup(priv, MAX9286_REV_AMP_HIGH); > + ret = v4l2_subdev_call(subdev, core, init, 0); > + if (ret) { > + dev_err(&priv->client->dev, > + "Failed to initialize camera device %u\n", index); > + return ret; > + } > + > /* > * We can only register v4l2_async_notifiers, which do not provide a > * means to register a complete callback. bound_sources allows us to > * identify when all remote serializers have completed their probe. > */ > - if (priv->bound_sources != priv->source_mask) > + if (priv->bound_sources != priv->source_mask) { > + /* > + * If not all remotes have probed yet, restore the initial > + * reverse channel amplitude to allow the next camera to probe. > + */ > + max9286_reverse_channel_setup(priv, priv->init_rev_chan_mv); Oh - wow, now I see why we definitely need to store both the initial and the current value. > return 0; > + } > > /* > * All enabled sources have probed and enabled their reverse control > * channels: > - * > - * - Increase the reverse channel amplitude to compensate for the > - * remote ends high threshold > * - Verify all configuration links are properly detected > * - Disable auto-ack as communication on the control channel are now > * stable. > */ > - max9286_reverse_channel_setup(priv, MAX9286_REV_AMP_HIGH); > max9286_check_config_link(priv, priv->source_mask); > > /* >