Fishwaldo opened a new pull request, #20378: URL: https://github.com/apache/nuttx/pull/20378
## Summary The MPQ8785 is a PMBus controlled synchronous buck converter, up to 40A from an input of up to 16V, used on several RISC-V boards to supply a core rail. NuttX had no driver for it. - **The board sets the limits, not the driver.** `mpq8785_initialize()` intersects the caller's range with the part's, so a board can narrow what is offered but never widen it past the specification. Passing zero asks for the part's full range. - **Ranges come from the datasheet, not from the two existing drivers for this part.** Both give the reference as 0.6V to 1.6V; the electrical table gives the VID reference DAC as 0.35V to 1.55V. `VOUT_COMMAND` is twelve bits while the DAC behind it is ten, so the register accepts values the part will not produce. - **A selector moves two reference steps.** The step is 1.5625mV, not a whole number of microvolts, so single-stepping would make some voltages unrepresentable. This costs half the resolution and makes every voltage the framework can ask for exact. VID format is written and read back, since a part that ignored the write would report against a different step and be wrong by a quarter silently. - **Readings publish as uORB topics** (output voltage, output current, their product, part temperature, input voltage) from one reading with one timestamp, and through the regulator `describe` method into `/proc/regulator`. Output and input are both voltages and a topic number carries one of each type, so the output takes `devno` and the input takes `vin_devno`. `nosensor` publishes neither. - **The worker stops with the last subscriber; the rail does not.** Unlike a sensor that exists only to be read, this part is supplying something. - **Nothing is applied at start up.** A rail found outside the registered range has no selector, so the read reports `-ERANGE` and `/proc/regulator` shows `uv:-` rather than naming a voltage the rail is not at. ## Impact New driver behind `CONFIG_REGULATOR_MPQ8785`, default `n`. No existing code path changes. ## Testing ESWIN EIC7700 EVB, MPQ8785 on i2c1 supplying the NPU rail, read through `/proc/regulator` and the uORB topics: ``` nsh> sensortest -n 2 voltage0 voltage0: timestamp:71949895 value:0.72 nsh> sensortest -n 1 temp0 temp0: timestamp:80439892 value:45.00 ``` 0.72V is inside the 700-1100mV range the board registers for that rail. Built for `eic7700-evb:nsh` with `-Wno-cpp -Werror`. -- This is an automated message from the Apache Git Service. To respond to the message, please log on to GitHub and use the URL above to go to the specific comment. To unsubscribe, e-mail: [email protected] For queries about this service, please contact Infrastructure at: [email protected]
