From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from smtpout-04.galae.net (smtpout-04.galae.net [185.171.202.116]) (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 6B3683128A6; Thu, 27 Nov 2025 15:07:17 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=185.171.202.116 ARC-Seal:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1764256039; cv=none; b=OQkdJy6XXKvAYesWEDW4wnCO2M702y/u1tI/RFnq4GjxMfaFPp8bPKxVof3np8DojhLUcSWmklG6wRD3U1VgjdOaPiCPXm1ZUJMqurUdSKhQh15PNj6Xuj/X05PMSJfWaBvw9nWxKP8D9K09y5C1qPhi8xNs9FRiJo7u9XcBKyQ= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1764256039; c=relaxed/simple; bh=NyPHAxEuBfxhiJKrWsktUqr6mdKRf3cbmidwmHAlulY=; h=From:To:Cc:Subject:Date:Message-ID:In-Reply-To:References: MIME-Version:Content-Type; b=t15wy+0pnSRZ/B+lcJW6rRj9Vrd+eo/KMBluXZhg2SZ8cMWqp26Hby8fVKV9m+T+jD/07E3CNGvoK0JqHfbTUrRaXXh/7e880PGhFQfuf/CuHDO3+v0j3762zCsrI0HIND4fZjjhbeR6OYsc+rJqrC4042WsiiVRPKKzsMNQwNM= ARC-Authentication-Results:i=1; smtp.subspace.kernel.org; dmarc=pass (p=reject dis=none) header.from=bootlin.com; spf=pass smtp.mailfrom=bootlin.com; dkim=pass (2048-bit key) header.d=bootlin.com header.i=@bootlin.com header.b=KsDxrTwJ; arc=none smtp.client-ip=185.171.202.116 Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=reject dis=none) header.from=bootlin.com Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=bootlin.com Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=bootlin.com header.i=@bootlin.com header.b="KsDxrTwJ" Received: from smtpout-01.galae.net (smtpout-01.galae.net [212.83.139.233]) by smtpout-04.galae.net (Postfix) with ESMTPS id C61A4C16A19; Thu, 27 Nov 2025 15:06:52 +0000 (UTC) Received: from mail.galae.net (mail.galae.net [212.83.136.155]) by smtpout-01.galae.net (Postfix) with ESMTPS id 8520D6072A; Thu, 27 Nov 2025 15:07:15 +0000 (UTC) Received: from [127.0.0.1] (localhost [127.0.0.1]) by localhost (Mailerdaemon) with ESMTPSA id EE57C102F218C; Thu, 27 Nov 2025 16:06:51 +0100 (CET) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=bootlin.com; s=dkim; t=1764256032; h=from:subject:date:message-id:to:cc:mime-version:content-type: in-reply-to:references; bh=Xb2gYHXIhVp2zaSFmlDMNszWhEx2yHpcG9wfBD9WQ6Q=; b=KsDxrTwJZ35P4V4zqNgBRz6dueQQQ479lYnTv33vH6BaAZQ6mqaBR8WEopD6/WxoiDZf3C Ic4RTSKoLEfjd0/q+TBQmqIrfWBRSTeCoErZlb34wHoEcX2HAzuN2RzutFpS6+d2ln9KMJ TSvAsAUfwMfwSBd4rCMr2Fdi3SKnKSNaEM9vqWiV42ClnoYd2t6PVCTiOsInGdUD2yiqj4 ZzTUOWwdLINFYrJ9uWeuCkQFxLH7ib2+v5JAxnvTykYWonFW1xB3OWNxxohmbmwdgPC/rA Ba8/f4uTLQUuaOMbgPFSeaBwbd+ExYFXfFw+9W2+71ncOaO/+QIwmKbAGZv6Rw== From: Romain Gantois To: "H. Nikolaus Schaller" Cc: Liam Girdwood , Mark Brown , Rob Herring , Krzysztof Kozlowski , Conor Dooley , Jonathan Cameron , David Lechner , Nuno =?UTF-8?B?U8Oh?= , Andy Shevchenko , Guenter Roeck , 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 Date: Thu, 27 Nov 2025 16:06:47 +0100 Message-ID: <8695751.T7Z3S40VBb@fw-rgant> In-Reply-To: <0E900830-E248-4F0F-A048-075EAF1D2440@goldelico.com> References: <20251124-ltm8054-driver-v4-0-107a8a814abe@bootlin.com> <3021060.e9J7NaK4W3@fw-rgant> <0E900830-E248-4F0F-A048-075EAF1D2440@goldelico.com> Precedence: bulk X-Mailing-List: linux-input@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Content-Type: multipart/signed; boundary="nextPart10847283.nUPlyArG6x"; micalg="pgp-sha512"; protocol="application/pgp-signature" X-Last-TLS-Session-Version: TLSv1.3 --nextPart10847283.nUPlyArG6x Content-Transfer-Encoding: 7Bit Content-Type: text/plain; charset="utf-8"; protected-headers="v1" From: Romain Gantois To: "H. Nikolaus Schaller" Date: Thu, 27 Nov 2025 16:06:47 +0100 Message-ID: <8695751.T7Z3S40VBb@fw-rgant> In-Reply-To: <0E900830-E248-4F0F-A048-075EAF1D2440@goldelico.com> MIME-Version: 1.0 On Tuesday, 25 November 2025 11:25:24 CET H. Nikolaus Schaller wrote: > Hi, > > > Am 25.11.2025 um 09:41 schrieb Romain Gantois > > : > > > > > > This is planned support for a voltage regulator chip. > > Well, but one which is not by itself programmable. So IMHO, it does not > support that chip, but the circuit it is used in. > The boundary is a bit blurry in this case, sure. > > > Are you looking for a virtual "glue" driver to logically combine several > > > low level functions? > > > > I'm looking for a clean userspace abstraction for this component, the low- > > level functions in this case are those of a voltage regulator. > > As far as I understood it has > - constant voltage > - current can be limited > - it can be turned on/off > > That means it is a fixed-regulator (for constant voltage and turn on/off) > and a mechanism to program the current limit (iio-dac). Both have clean > userspace abstraction. > > What am I missing? > In my case, the regulator has a DAC tapping into the feedback divider with allows modifying the output voltage level. This isn't specific to the LTM8054 though, you can theoretically do this with any regulator chip that has a feedback pin. ... > The question remains if you want to solve something for a single board which > happens to have an LTM8054 or if you are solving a more general design > pattern. > > In summary my view is that the LTM8054 is just a "fixed-regulator" which > gets an additional current-limiter feature by adding a DAC chip (which needs > a driver of course). So software control is required not by the LTM8054 but > by adding a DAC chip. > > 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? > > 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-reg > ulator.c#L97 > That could be a preferable solution given that similar current limit and output voltage limit control methods could apply to other regulator chips... I'll have to think about it some more. > 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. Sure, I appreciate that. Thanks, -- Romain Gantois, Bootlin Embedded Linux and Kernel engineering https://bootlin.com --nextPart10847283.nUPlyArG6x Content-Type: application/pgp-signature; name="signature.asc" Content-Description: This is a digitally signed message part. Content-Transfer-Encoding: 7Bit -----BEGIN PGP SIGNATURE----- iQIzBAABCgAdFiEEIcCsAScRrtr7W0x0KCYAIARzeA4FAmkoaQcACgkQKCYAIARz eA4wIA//cR+gzKtW78qSkS/qn3QD4fmem8sIoJemjJ96zZS/fPrrD7BVbwlzmT8Z PX35PtLLxRdN0CRWsdmEqAAwFLRMn0/UBGpROLNSqKZT9c3SisrVH5XlVV0s95LB fS6l3xzgbIjdqhGxwXgV+43B2OuuBLE9AopgYIwRunAam9+nECFHo9hU/4glxqrS O54WKxLhs7/BMJdpAv4T8UYjqKiC7Lvpd4oq43g64sacplSnZNv4iwqkga0oOtd8 2IayCT5+gRm6xd9Xt/cVkQUQAFsoiieLLt87+JZP1ECtjcfwIsDiPBf49DvppELP SLg8qwG44QYRhfsPvdBRLFuvkmsu1rGZaBdRQZ+npfBkkwljuh6EllMbFgUOpuCR aFQleHJ/6naNsAZGxp4mW6x1YPwsiYeCQuQdffSq2DrTLEAnG3EV3wIB5TbMsF72 p6glXdEj3uYECnRJ9Lql1PWO9MHGnubF2xCDqRIn7HDxq+DLmZkkZzg4c69/V1fy O7go8T5OfK1233Kqb1VDvY9SDRL5+nLo1tacht8yyrhq3LEUumAf7TFLXzBmN+QQ 5TURL5uovvulw4c6SXs9sa7yriUKuayb9s5CKLsJJI4uYBt+Csyhm/fOfpuvKVm5 Bryk0xixSfV1ekLMojoBFaS3AFNPGNCHqSmjGOEsaK8hrJ5HgkM= =KPmo -----END PGP SIGNATURE----- --nextPart10847283.nUPlyArG6x--