From mboxrd@z Thu Jan 1 00:00:00 1970 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=ham 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 AC0D2C432BE for ; Tue, 17 Aug 2021 07:26:41 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by mail.kernel.org (Postfix) with ESMTP id 98A8860C3E for ; Tue, 17 Aug 2021 07:26:41 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S238343AbhHQH1N (ORCPT ); Tue, 17 Aug 2021 03:27:13 -0400 Received: from relay9-d.mail.gandi.net ([217.70.183.199]:50371 "EHLO relay9-d.mail.gandi.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S234696AbhHQH1M (ORCPT ); Tue, 17 Aug 2021 03:27:12 -0400 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?Niklas=20S=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 Content-Transfer-Encoding: 8bit Precedence: bulk List-ID: X-Mailing-List: linux-media@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 -- 2.32.0