From patchwork Tue Aug 17 07:27:02 2021 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Jacopo Mondi X-Patchwork-Id: 12440615 X-Patchwork-Delegate: kieran@bingham.xyz Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-16.8 required=3.0 tests=BAYES_00, HEADER_FROM_DIFFERENT_DOMAINS,INCLUDES_CR_TRAILER,INCLUDES_PATCH, MAILING_LIST_MULTI,SPF_HELO_NONE,SPF_PASS,URIBL_BLOCKED,USER_AGENT_GIT autolearn=unavailable autolearn_force=no version=3.4.0 Received: from mail.kernel.org (mail.kernel.org [198.145.29.99]) by smtp.lore.kernel.org (Postfix) with ESMTP id 45766C4338F for ; Tue, 17 Aug 2021 07:34:53 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by mail.kernel.org (Postfix) with ESMTP id 1F77F60C3E for ; Tue, 17 Aug 2021 07:34:53 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S234762AbhHQHfZ (ORCPT ); Tue, 17 Aug 2021 03:35:25 -0400 Received: from mslow1.mail.gandi.net ([217.70.178.240]:60157 "EHLO mslow1.mail.gandi.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S234669AbhHQHfY (ORCPT ); Tue, 17 Aug 2021 03:35:24 -0400 Received: from relay9-d.mail.gandi.net (unknown [217.70.183.199]) by mslow1.mail.gandi.net (Postfix) with ESMTP id 0958FCD8F2 for ; Tue, 17 Aug 2021 07:27:00 +0000 (UTC) Received: (Authenticated sender: jacopo@jmondi.org) by relay9-d.mail.gandi.net (Postfix) with ESMTPSA id CBB20FF811; Tue, 17 Aug 2021 07:26:34 +0000 (UTC) From: Jacopo Mondi To: Mauro Carvalho Chehab , Kieran Bingham , Laurent Pinchart , =?utf-8?q?Nik?= =?utf-8?q?las_S=C3=B6derlund?= Cc: Jacopo Mondi , Hans Verkuil , Sakari Ailus , Manivannan Sadhasivam , Thomas NIZAN , linux-renesas-soc@vger.kernel.org, linux-media@vger.kernel.org Subject: [RFC 4/5] media: i2c: max9286: Fetch PIXEL_RATE in s_stream Date: Tue, 17 Aug 2021 09:27:02 +0200 Message-Id: <20210817072703.1167-5-jacopo+renesas@jmondi.org> X-Mailer: git-send-email 2.32.0 In-Reply-To: <20210817072703.1167-1-jacopo+renesas@jmondi.org> References: <20210817072703.1167-1-jacopo+renesas@jmondi.org> MIME-Version: 1.0 Precedence: bulk List-ID: X-Mailing-List: linux-renesas-soc@vger.kernel.org The max9286 driver needs to fetch the remote serializer PIXEL_RATE control value in order to compute its own one, as the sum of the values reported by the connected subdevices. Currently the control is verified to be present at notifier's bound time, which requires the serializer driver to register the control at probe time. As the serializer driver might need to register the control later, by adding the control handler of its connected sensor, post-pone the max9286 check for the control availability at start stream time. Signed-off-by: Jacopo Mondi --- drivers/media/i2c/max9286.c | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/drivers/media/i2c/max9286.c b/drivers/media/i2c/max9286.c index 1b92d18a1f94..98fc90339a9e 100644 --- a/drivers/media/i2c/max9286.c +++ b/drivers/media/i2c/max9286.c @@ -595,7 +595,7 @@ static int max9286_notify_bound(struct v4l2_async_notifier *notifier, max9286_check_config_link(priv, priv->source_mask); max9286_configure_i2c(priv, false); - return max9286_set_pixelrate(priv); + return 0; } static void max9286_notify_unbind(struct v4l2_async_notifier *notifier, @@ -674,6 +674,10 @@ static int max9286_s_stream(struct v4l2_subdev *sd, int enable) int ret; if (enable) { + ret = max9286_set_pixelrate(priv); + if (ret) + return ret; + /* * The frame sync between cameras is transmitted across the * reverse channel as GPIO. We must open all channels while