Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by smtp.lore.kernel.org (Postfix) with ESMTP id 55853C7619A for ; Mon, 20 Mar 2023 09:55:18 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S229550AbjCTJzQ (ORCPT ); Mon, 20 Mar 2023 05:55:16 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:47218 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S229508AbjCTJzL (ORCPT ); Mon, 20 Mar 2023 05:55:11 -0400 Received: from perceval.ideasonboard.com (perceval.ideasonboard.com [213.167.242.64]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 339CC8A4C; Mon, 20 Mar 2023 02:55:11 -0700 (PDT) Received: from pendragon.ideasonboard.com (213-243-189-158.bb.dnainternet.fi [213.243.189.158]) by perceval.ideasonboard.com (Postfix) with ESMTPSA id 33B101257; Mon, 20 Mar 2023 10:55:08 +0100 (CET) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=ideasonboard.com; s=mail; t=1679306108; bh=EKjW1R7h+yja6osOOOMwfX4qtMew8wgQB1kQ/QcnDA4=; h=Date:From:To:Cc:Subject:References:In-Reply-To:From; b=QlYZ/6zgLyhtixQ1oN2VTaAMtAR1L/5xZ2gU8sHqJRjuYyyvFlzfrevArxn6EBg8n MNiqv+qNdc9xnj6mkJqrC2GTLFPyUmz4tLRYpvyceUzBIpohfgz9PW9D7ewY3RF7qe Q6hcyLO4w7IebBC51RZz6PeAiGyJz+WQ2r/SOjsw= Date: Mon, 20 Mar 2023 11:55:14 +0200 From: Laurent Pinchart To: Sakari Ailus Cc: Jacopo Mondi , Francesco Dolcini , Sakari Ailus , Marcel Ziswiler , linux-media@vger.kernel.org, Philipp Zabel , kernel@pengutronix.de, Francesco Dolcini , Aishwarya Kothari , Marcel Ziswiler , Mauro Carvalho Chehab , Steve Longerbeam , linux-kernel@vger.kernel.org, Marco Felsch Subject: Re: [PATCH v2] media: i2c: ov5640: Implement get_mbus_config Message-ID: <20230320095514.GF20234@pendragon.ideasonboard.com> References: <20230306063649.7387-1-marcel@ziswiler.com> <20230320084844.tdjiv6kaxcosiwm2@uno.localdomain> <20230320092602.GE20234@pendragon.ideasonboard.com> MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Disposition: inline In-Reply-To: Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Mon, Mar 20, 2023 at 11:37:33AM +0200, Sakari Ailus wrote: > Hi Laurent, > > On Mon, Mar 20, 2023 at 11:26:02AM +0200, Laurent Pinchart wrote: > > In a (simplified) nutshell, > > > > ---------+ +----------+ +---------+ +-----+ +-----+ > > | Camera | --> | CSI-2 RX | --> | CSI2IPU | --> | Mux | --> | IPU | > > | Sensor | | | | Gasket | | | | | > > ---------+ +----------+ +---------+ +-----+ +-----+ > > Thank you, this is helpful. > > I suppose the mux here at least won't actively do anything to the data. So > presumably its endpoint won't contain the active configuration, but its > superset. > > > > > All those blocks, except for the gasket, have a node in DT. > > > > The IPU driver needs to know the number of CSI-2 data lanes, which is > > encoded in the data-lanes DT property present in both the sensor output > > endpoint and the CSI-2 RX input endpoint, but not the other endpoints in > > the pipeline. > > This doesn't yet explain why the sensor would need to implement > get_mbus_config if its bus configuration remains constant. If I recall correctly, the IPU driver calls .g_mbus_config() on the camera sensor to get the number of lanes, as it can't get it from its own endpoint. That's a hack, and as Jacopo proposed, calling .g_mbus_config() on the CSI-2 RX would be better, as the CSI-2 RX driver can then get the value from its own endpoint, without requiring all sensor drivers to implement .g_mbus_config(). > I suppose those blocks in between would probably need something to convey > their active configuration from upstream sub-devices. -- Regards, Laurent Pinchart