<html>
<head>
<meta http-equiv="content-type" content="text/html; charset=UTF-8">
</head>
<body><p style="margin-top:0;margin-bottom:0;margin-left:0;margin-right:0;">On Monday, 24 November 2025 17:19:45 CET H. Nikolaus Schaller wrote:</p>
<p style="margin-top:0;margin-bottom:0;margin-left:0;margin-right:0;">...</p>
<p style="margin-top:0;margin-bottom:0;margin-left:0;margin-right:0;">> > The LTM8054's feedback pin can be driven by a different DAC, which allows</p>
<p style="margin-top:0;margin-bottom:0;margin-left:0;margin-right:0;">> > for dynamic output voltage control. This is a more complex upstreaming</p>
<p style="margin-top:0;margin-bottom:0;margin-left:0;margin-right:0;">> > topic however, so I've left it out of this initial series. There are</p>
<p style="margin-top:0;margin-bottom:0;margin-left:0;margin-right:0;">> > other component functions which fit in squarely into the regulator</p>
<p style="margin-top:0;margin-bottom:0;margin-left:0;margin-right:0;">> > framework, such as input current limit control and soft-start. But I</p>
<p style="margin-top:0;margin-bottom:0;margin-left:0;margin-right:0;">> > understand that the current driver might look a bit "bare".</p>
<p style="margin-top:0;margin-bottom:0;margin-left:0;margin-right:0;">> </p>
<p style="margin-top:0;margin-bottom:0;margin-left:0;margin-right:0;">> So you just want to have some user-space mechanism to control voltage</p>
<p style="margin-top:0;margin-bottom:0;margin-left:0;margin-right:0;">> and current limits? Can't this be done by directly controlling them through</p>
<p style="margin-top:0;margin-bottom:0;margin-left:0;margin-right:0;">> the iio API?</p>
<p style="margin-top:0;margin-bottom:0;margin-left:0;margin-right:0;">> </p>
<p style="margin-top:0;margin-bottom:0;margin-left:0;margin-right:0;">> Is this for a device that is already in kernel or planned to be supported?</p>
<p style="margin-top:0;margin-bottom:0;margin-left:0;margin-right:0;">> Or is it "application support" for some SBC?</p>
<p style="margin-top:0;margin-bottom:0;margin-left:0;margin-right:0;">> </p>
<br /><p style="margin-top:0;margin-bottom:0;margin-left:0;margin-right:0;">This is planned support for a voltage regulator chip.</p>
<br /><p style="margin-top:0;margin-bottom:0;margin-left:0;margin-right:0;">> Are you looking for a virtual "glue" driver to logically combine several low</p>
<p style="margin-top:0;margin-bottom:0;margin-left:0;margin-right:0;">> level functions?</p>
<p style="margin-top:0;margin-bottom:0;margin-left:0;margin-right:0;">> </p>
<br /><p style="margin-top:0;margin-bottom:0;margin-left:0;margin-right:0;">I'm looking for a clean userspace abstraction for this component, the low-</p>
<p style="margin-top:0;margin-bottom:0;margin-left:0;margin-right:0;">level functions in this case are those of a voltage regulator.</p>
<br /><p style="margin-top:0;margin-bottom:0;margin-left:0;margin-right:0;">> > > What could be necessary is if you really want to be able to "regulate"</p>
<p style="margin-top:0;margin-bottom:0;margin-left:0;margin-right:0;">> > > the current going to Vout, some bridge between regulator API and some</p>
<p style="margin-top:0;margin-bottom:0;margin-left:0;margin-right:0;">> > > IIO DAC.</p>
<p style="margin-top:0;margin-bottom:0;margin-left:0;margin-right:0;">> > > </p>
<p style="margin-top:0;margin-bottom:0;margin-left:0;margin-right:0;">> > > And enabling/disabling the regulator by some GPIO can be described in</p>
<p style="margin-top:0;margin-bottom:0;margin-left:0;margin-right:0;">> > > the DT already through a "regulator-fixed".</p>
<p style="margin-top:0;margin-bottom:0;margin-left:0;margin-right:0;">> > </p>
<p style="margin-top:0;margin-bottom:0;margin-left:0;margin-right:0;">> > This is a possibility, but when you bring in all of these other hardware</p>
<p style="margin-top:0;margin-bottom:0;margin-left:0;margin-right:0;">> > functions that I mentionned e.g. output voltage control and stepping,</p>
<p style="margin-top:0;margin-bottom:0;margin-left:0;margin-right:0;">> > you'll end up with several different devices which look unrelated from</p>
<p style="margin-top:0;margin-bottom:0;margin-left:0;margin-right:0;">> > userspace, but actually control the same chip.</p>
<p style="margin-top:0;margin-bottom:0;margin-left:0;margin-right:0;">> </p>
<p style="margin-top:0;margin-bottom:0;margin-left:0;margin-right:0;">> That is quite usual... I have often heard: user space must fix this as</p>
<p style="margin-top:0;margin-bottom:0;margin-left:0;margin-right:0;">> kernel just provides basic functions in a harmonized way and integration</p>
<p style="margin-top:0;margin-bottom:0;margin-left:0;margin-right:0;">> has to be tailored to the device anyways :)</p>
<p style="margin-top:0;margin-bottom:0;margin-left:0;margin-right:0;">> </p>
<br /><p style="margin-top:0;margin-bottom:0;margin-left:0;margin-right:0;">IMHO this is not integration, it's BSP work. As far as regulator functions are </p>
<p style="margin-top:0;margin-bottom:0;margin-left:0;margin-right:0;">concerned, the current status quo is that the kernel handles getting/setting </p>
<p style="margin-top:0;margin-bottom:0;margin-left:0;margin-right:0;">voltage levels, applying current and voltage constraints and other basic </p>
<p style="margin-top:0;margin-bottom:0;margin-left:0;margin-right:0;">regulator features.</p>
<br /><p style="margin-top:0;margin-bottom:0;margin-left:0;margin-right:0;">> > Userspace will also have to know about some hardware details to properly</p>
<p style="margin-top:0;margin-bottom:0;margin-left:0;margin-right:0;">> > control the DACs, such as the values of the sense and feedback resistors.</p>
<p style="margin-top:0;margin-bottom:0;margin-left:0;margin-right:0;">> > In my opinion, this bypasses the kernel's abstraction of hardware.</p>
<p style="margin-top:0;margin-bottom:0;margin-left:0;margin-right:0;">> </p>
<p style="margin-top:0;margin-bottom:0;margin-left:0;margin-right:0;">> I came up with this argument several times in the part and got a lot of</p>
<p style="margin-top:0;margin-bottom:0;margin-left:0;margin-right:0;">> contrary :)</p>
<p style="margin-top:0;margin-bottom:0;margin-left:0;margin-right:0;">> </p>
<p style="margin-top:0;margin-bottom:0;margin-left:0;margin-right:0;">> What I still wonder: does your hardware warrant an upstream driver for a</p>
<p style="margin-top:0;margin-bottom:0;margin-left:0;margin-right:0;">> non-programable chip if a different solution (with help of user-space)</p>
<p style="margin-top:0;margin-bottom:0;margin-left:0;margin-right:0;">> already exist?</p>
<p style="margin-top:0;margin-bottom:0;margin-left:0;margin-right:0;">> </p>
<br /><p style="margin-top:0;margin-bottom:0;margin-left:0;margin-right:0;">A different solution does not currently exist (although a userspace-based </p>
<p style="margin-top:0;margin-bottom:0;margin-left:0;margin-right:0;">solution could be designed). I just think that a kernel-based solution is more </p>
<p style="margin-top:0;margin-bottom:0;margin-left:0;margin-right:0;">desirable here.</p>
<br /><p style="margin-top:0;margin-bottom:0;margin-left:0;margin-right:0;">> Another question: is your scheme generic enough so that it can be expected</p>
<p style="margin-top:0;margin-bottom:0;margin-left:0;margin-right:0;">> that other devices are using it in the same way?</p>
<p style="margin-top:0;margin-bottom:0;margin-left:0;margin-right:0;">> </p>
<br /><p style="margin-top:0;margin-bottom:0;margin-left:0;margin-right:0;">Yes, the LTM8054 has a fairly common design as far as buck-boost chips go. </p>
<p style="margin-top:0;margin-bottom:0;margin-left:0;margin-right:0;">Things like feedback dividers on the output voltage pin are standard practice.</p>
<p style="margin-top:0;margin-bottom:0;margin-left:0;margin-right:0;">And since the driver doesn't rely on a particular way of integrating the </p>
<p style="margin-top:0;margin-bottom:0;margin-left:0;margin-right:0;">LTM8054 with other components, it can be reused wherever the same regulator </p>
<p style="margin-top:0;margin-bottom:0;margin-left:0;margin-right:0;">chip is used.</p>
<br /><p style="margin-top:0;margin-bottom:0;margin-left:0;margin-right:0;">> Or could the power controller framework (/sys/class/power_supply) fit</p>
<p style="margin-top:0;margin-bottom:0;margin-left:0;margin-right:0;">> better?</p>
<p style="margin-top:0;margin-bottom:0;margin-left:0;margin-right:0;">> </p>
<br /><p style="margin-top:0;margin-bottom:0;margin-left:0;margin-right:0;">I don't think the power supply abstraction is relevant here. The LTM8054 is a </p>
<p style="margin-top:0;margin-bottom:0;margin-left:0;margin-right:0;">voltage regulator, it doesn't have charge, capacity, temperature monitoring, </p>
<p style="margin-top:0;margin-bottom:0;margin-left:0;margin-right:0;">power limitation, or other power supply class features.</p>
<br /><p style="margin-top:0;margin-bottom:0;margin-left:0;margin-right:0;">> There is an API to ask chargers etc. for battery voltage and current limits</p>
<p style="margin-top:0;margin-bottom:0;margin-left:0;margin-right:0;">> or even write them.</p>
<p style="margin-top:0;margin-bottom:0;margin-left:0;margin-right:0;">> </p>
<p style="margin-top:0;margin-bottom:0;margin-left:0;margin-right:0;">> There is also "generic-adc-battery" which allows to hook up with arbitrary</p>
<p style="margin-top:0;margin-bottom:0;margin-left:0;margin-right:0;">> iio-adcs for measurements - although you need a DAC in your setup. Maybe an</p>
<p style="margin-top:0;margin-bottom:0;margin-left:0;margin-right:0;">> extension here is a better strategy than a dedicated ltm8054 driver?</p>
<br /><br /><p style="margin-top:0;margin-bottom:0;margin-left:0;margin-right:0;">What if the LTM8054 is not used to supply a battery?</p>
<br /><p style="margin-top:0;margin-bottom:0;margin-left:0;margin-right:0;">Thanks,</p>
<br /><p style="margin-top:0;margin-bottom:0;margin-left:0;margin-right:0;">-- </p>
<p style="margin-top:0;margin-bottom:0;margin-left:0;margin-right:0;">Romain Gantois, Bootlin</p>
<p style="margin-top:0;margin-bottom:0;margin-left:0;margin-right:0;">Embedded Linux and Kernel engineering</p>
<p style="margin-top:0;margin-bottom:0;margin-left:0;margin-right:0;">https://bootlin.com</p>
<br /></body>
</html>