From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from perceval.ideasonboard.com (perceval.ideasonboard.com [213.167.242.64]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id CF5A22EA74B for ; Thu, 24 Jul 2025 15:44:20 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=213.167.242.64 ARC-Seal:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1753371862; cv=none; b=svDvitTYYELmSXNZKKYPTQubcnP1xh8rP9mqmNrv4hUpDPSSs+zcsNievNDcW39jcPIhllmNbiy14WL1sqyY0UAfrkyKysaWsaNlhXUz7zRgzT24fLENxHfjYR/blygfzcljWuiAaWrmkvykGnPXzfrCYw/bBSIw3VINkZXrN68= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1753371862; c=relaxed/simple; bh=WUWUGHdOqQkF/Z1sfPK+5mTXJXMUai8/GjWXSeeCLEg=; h=Date:From:To:Cc:Subject:Message-ID:References:MIME-Version: Content-Type:Content-Disposition:In-Reply-To; b=rkN+cfOx9fUOaPYBZZZv1FIFCNp4lZNRBuQn4Uv7PJPgp1NLt68tLqQ4U12QSD5Llob05ZTdTWUK9DO76FxfDQydypPT00oxlTXBr/vRlMcQTTHAm2hFZMxopEtyUmnK9IB8p//D41Y2KoqPQYgiyLnt3pK3BubU9jp1VASZgKM= ARC-Authentication-Results:i=1; smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=ideasonboard.com; spf=pass smtp.mailfrom=ideasonboard.com; dkim=pass (1024-bit key) header.d=ideasonboard.com header.i=@ideasonboard.com header.b=g1idT12+; arc=none smtp.client-ip=213.167.242.64 Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=ideasonboard.com Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=ideasonboard.com Authentication-Results: smtp.subspace.kernel.org; dkim=pass (1024-bit key) header.d=ideasonboard.com header.i=@ideasonboard.com header.b="g1idT12+" Received: from pendragon.ideasonboard.com (81-175-209-231.bb.dnainternet.fi [81.175.209.231]) by perceval.ideasonboard.com (Postfix) with UTF8SMTPSA id 23213EAE; Thu, 24 Jul 2025 17:43:39 +0200 (CEST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=ideasonboard.com; s=mail; t=1753371819; bh=WUWUGHdOqQkF/Z1sfPK+5mTXJXMUai8/GjWXSeeCLEg=; h=Date:From:To:Cc:Subject:References:In-Reply-To:From; b=g1idT12+pDGGnpDwK+oz95BC0jf1BWB+zj3cBI0Vhf6fIKgsKGAC99uIzNbBFV2Df MSwrHatCDif+ugv3ZzeY3MHpf4bg/9l4AZRaiuAmdIJwLsc/8O4gbtkhLMgR7H3MsV PqfRmXvgoB5RP3AoFKr9cHgGrSzDI0LTu2lKbTCM= Date: Thu, 24 Jul 2025 18:44:14 +0300 From: Laurent Pinchart To: Tarang Raval Cc: "linux-media@vger.kernel.org" , Sakari Ailus , Mehdi Djait , Alim Akhtar , =?utf-8?B?QW5kcsOp?= Apitzsch , Andrzej Hajda , Arec Kao , Benjamin Mugnier , Bingbu Cao , Bjorn Andersson , Bryan O'Donoghue , Bryan O'Donoghue , Conor Dooley , Daniel Scally , Dongcheng Yan , Dongchun Zhu , Fabio Estevam , Geert Uytterhoeven , Hans de Goede , Hans Verkuil , Hao Yao , Heimir Thor Sverrisson , Jacopo Mondi , Jason Chen , Jimmy Su , Jingjing Xiong , Jonas Karlman , Konrad Dybcio , Krzysztof Kozlowski , Lad Prabhakar , Leon Luo , Liam Girdwood , Magnus Damm , Manivannan Sadhasivam , Mark Brown , Matthew Majewski , Matthias Fend , Mikhail Rudenko , Nicolas Dufresne , Niklas =?utf-8?Q?S=C3=B6derlund?= , Pavel Machek , Pengutronix Kernel Team , Ricardo Ribalda , Rob Herring , Sascha Hauer , Shawn Guo , Shunqian Zheng , Sylvain Petinot , Sylwester Nawrocki , Tianshu Qiu , Todor Tomov , Tomi Valkeinen , Tony Lindgren , Zhi Mao , "devicetree@vger.kernel.org" , "imx@lists.linux.dev" , "linux-arm-kernel@lists.infradead.org" , "linux-arm-msm@vger.kernel.org" , "linux-omap@vger.kernel.org" , "linux-renesas-soc@vger.kernel.org" , "linux-samsung-soc@vger.kernel.org" Subject: Re: [PATCH 00/72] media: i2c: Reduce cargo-cult Message-ID: <20250724154414.GE22016@pendragon.ideasonboard.com> References: <20250710174808.5361-1-laurent.pinchart@ideasonboard.com> <20250724115202.GK11202@pendragon.ideasonboard.com> <20250724135259.GR11202@pendragon.ideasonboard.com> Precedence: bulk X-Mailing-List: imx@lists.linux.dev List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Disposition: inline Content-Transfer-Encoding: 8bit In-Reply-To: On Thu, Jul 24, 2025 at 02:20:10PM +0000, Tarang Raval wrote: > > > > > 2. In the regulator code, you can reduce boilerplate by using > > > > >    devm_regulator_bulk_get_enable(). > > > > > > > > devm_regulator_bulk_get_enable() doesn't seem to be a good idea. You > > > > generally don't want to enable power everywhere unconditionally, and > > > > sensors very often need a guaranteed power up sequence. > > > > > > The regulators are optional, we supply power to the camera sensor directly > > > through dedicated power rails and there is no strict enable sequence > > > required in this case. > > > > What exactly do you mean by "this case" ? Are you talking about one > > particular sensor ? One particular camera module ? > > Laurent, by “this case” I meant the common scenario where power to the > camera sensor is supplied by a PMIC regulator that is always-on. In such > setups, the regulator is fixed and cannot be enabled or disabled from the > driver, the sensor is always powered. > > This is what I’ve seen in most platforms, where the CSI input connector > provides fixed 3.3V/1.8V power rails directly to the camera module. > > Of course, if the camera supply comes from a dedicated regulator controlled > via a GPIO, then the driver would need to handle enable/disable sequencing > explicitly. But I’m specifically referring to the first case, where the power rails > are always-on. How does the sensor driver know which of those two cases it is dealing with ? > Mark, depending on the hardware, the power rails could come either from a > PMIC or from a regulator controlled by GPIO, but I’m talking about the always-on > PMIC case here. -- Regards, Laurent Pinchart