From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from smtp.kernel.org (aws-us-west-2-korg-mail-1.web.codeaurora.org [10.30.226.201]) (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 8BB0A221578; Sun, 7 Dec 2025 18:48:47 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=10.30.226.201 ARC-Seal:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1765133328; cv=none; b=Ugl2YxB/rGOI4jGFOtXLnrmHmWNy3Lf4U35WogLYhG8QRgwEAelJGUV8iQCsU0HUuwvGd48l4jGKRqOrhR1S6AwbASBnWRiAo5gJC9H+msiZ7nNUtVQmUGHdI9UiLn27cIPavBDPhuBHPZwQc/SBInh42AYGnfDvHI+oCUK8qbA= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1765133328; c=relaxed/simple; bh=i3PBFrjGBQBs0q3+aqCj3KcAnStBM/0oVzLp8ZbqdoA=; h=Date:From:To:Cc:Subject:Message-ID:In-Reply-To:References: MIME-Version:Content-Type; b=dmy7ty0WHS+HSXauycxPx/OYLBZf9V1mTcGh3dpt7dEir/uwRaO3A5fAH5CZb6h9vuqukEUP3+EZYbrVv+vwZzbSC6u4cRGB9/hIApyZwEcoVWM3kx4buhZitetnjDLYnTCiutrpR7BxruKHyJESeOAXS1QHq2kjDcPfzfGmSOs= ARC-Authentication-Results:i=1; smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=kernel.org header.i=@kernel.org header.b=CD8ThFBZ; arc=none smtp.client-ip=10.30.226.201 Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=kernel.org header.i=@kernel.org header.b="CD8ThFBZ" Received: by smtp.kernel.org (Postfix) with ESMTPSA id D25EFC4CEFB; Sun, 7 Dec 2025 18:48:23 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=k20201202; t=1765133327; bh=i3PBFrjGBQBs0q3+aqCj3KcAnStBM/0oVzLp8ZbqdoA=; h=Date:From:To:Cc:Subject:In-Reply-To:References:From; b=CD8ThFBZDwJ9StM2NbaV5N6iNe4+vc30b3pEXddJ5Oo65Cmj3O9bdmORFW1sVXtmY LC/YL4KVbdSODRsPq83UcIlFRUV8IxF24wvCw72ErJXBTWIKUELAKR6tJw5w6IEP85 u3p6oLIwTosCFTBxreZudIHlbc0hdl5qjEyo/KOIM2hpuUz13Rdh8WpILW6/CZt0mV R0lUYB8JffGNoMwacw1v8aPFjO2IteAyUgyGJkJDp1ZeWQ2Qp7Ep5lfFeHVGV2rAPv lFbDuPO+C5+12PXhp6ElYyqcAL4Eikvf9mV28JoGOOAxynDEG2QMAwLtpRwxlTSlUn Rq/8Du/Y5ngFA== Date: Sun, 7 Dec 2025 18:48:18 +0000 From: Jonathan Cameron To: Guenter Roeck Cc: "H. Nikolaus Schaller" , Romain Gantois , Liam Girdwood , Mark Brown , Rob Herring , Krzysztof Kozlowski , Conor Dooley , David Lechner , Nuno =?UTF-8?B?U8Oh?= , Andy Shevchenko , Thomas Petazzoni , linux-kernel@vger.kernel.org, devicetree@vger.kernel.org, linux-iio@vger.kernel.org, Conor Dooley , MyungJoo Ham , Chanwoo Choi , Peter Rosin , Mariel Tinaco , Lars-Peter Clausen , Michael Hennerich , Kevin Tsai , Linus Walleij , Dmitry Torokhov , Eugen Hristev , Vinod Koul , Kishon Vijay Abraham I , Sebastian Reichel , Chen-Yu Tsai , Support Opensource , Paul Cercueil , Iskren Chernev , Marek Szyprowski , Matheus Castello , Saravanan Sekar , Matthias Brugger , AngeloGioacchino Del Regno , Casey Connolly , Pali =?UTF-8?B?Um9ow6Fy?= , Orson Zhai , Baolin Wang , Chunyan Zhang , Amit Kucheria , Thara Gopinath , "Rafael J. Wysocki" , Daniel Lezcano , Zhang Rui , Lukasz Luba , Claudiu Beznea , Jaroslav Kysela , Takashi Iwai , Sylwester Nawrocki , Olivier Moysan , Arnaud Pouliquen , Maxime Coquelin , Alexandre Torgue , Dixit Parmar , linux-hwmon@vger.kernel.org, linux-input@vger.kernel.org, linux-phy@lists.infradead.org, linux-pm@vger.kernel.org, linux-mips@vger.kernel.org, linux-arm-kernel@lists.infradead.org, linux-mediatek@lists.infradead.org, linux-arm-msm@vger.kernel.org, linux-sound@vger.kernel.org, linux-stm32@st-md-mailman.stormreply.com, Andy Shevchenko Subject: Re: [PATCH v4 0/6] Add support for the LTM8054 voltage regulator Message-ID: <20251207184818.2ad7cef7@jic23-huawei> In-Reply-To: <9b43da0b-61e1-49bb-acc2-392de3817db7@roeck-us.net> References: <20251124-ltm8054-driver-v4-0-107a8a814abe@bootlin.com> <4053840.MHq7AAxBmi@fw-rgant> <732D3F12-0361-4800-8981-EF629B4C491F@goldelico.com> <3021060.e9J7NaK4W3@fw-rgant> <0E900830-E248-4F0F-A048-075EAF1D2440@goldelico.com> <9b43da0b-61e1-49bb-acc2-392de3817db7@roeck-us.net> X-Mailer: Claws Mail 4.3.1 (GTK 3.24.51; x86_64-pc-linux-gnu) Precedence: bulk X-Mailing-List: linux-pm@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Content-Type: text/plain; charset=US-ASCII Content-Transfer-Encoding: 7bit On Tue, 25 Nov 2025 08:37:20 -0800 Guenter Roeck wrote: > On 11/25/25 02:25, H. Nikolaus Schaller wrote: > ... > > Another suggestion: what extending the "regulator-fixed", "regulator-gpio", > > "regulator-fixed-clock" pattern by some "regulator-gpio-iio-dac-current-limiter" > > driver to make it independent of your specific chip? > > > The name is terrible ;-), but that is what I would have suggested as well. > I don't see anything chip specific in this code. If there is a need for > a regulator driver which uses gpio to enable it and a DAC for current limiting, > it should be made generic. Agreed - something generic is the ideal way to go. However, before going too far it is worth exploring what are common circuits with these things to identify what parameters we need to describe how the DAC channel is used - e.g is linear scaling enough? You'll need to that to define a DT binding. If it turns out to be too complex, then fallback to specific compatibles in a generic driver to cover the ones that don't fit with a common scheme. A similar case we already have is discrete components as analog front ends for ADCs - mostly they fall into a few categories and we have drivers covering those, but some are very odd indeed and for those ones we do have a driver even though they don't have anything to control as such - most extreme case being when it's a non linear analog sensor. The mention of a DAC as part of the analog feedback circuit sounds harder too generalise but that's specific to this particular buck-boost device, it's board specific so probably doesn't change the above. > > > By the way, are you aware of this feature of the regulator-gpio driver? > > > > https://elixir.bootlin.com/linux/v6.18-rc7/source/drivers/regulator/gpio-regulator.c#L97 > > > > Just to note: I am neither maintainer nor doing any decisions on this, just asking > > questions for curiosity and from experience and giving hints for alternative approaches, > > where I hope they help to find the really best solution. > > > Same here. Only covering the thing you are consuming so not my problem to maintain either ;) Jonathan > > Thanks, > Guenter >