Zephyr OS Regulator Voltage Windows: Check Overlap Before Assuming the Request Was Clamped

A voltage request can overlap a configured regulator range without lying entirely inside it. In Zephyr OS v4.4.0, the common regulator setter checks for a disjoint interval, then forwards the original requested endpoints to the device driver. It does not itself replace them with the intersection.

For a product with board-specific supply limits, that distinction belongs in the configuration review. This article examines software request handling only. It is not an instruction to change a live rail, and no device-specific safe voltage is assumed.

Overlap does not mean the request was clamped; Board-approved interval, Requested interval, Common setter dispatch, Driver and application checks.
Original conceptual engineering diagram. Proposed review method, not a measured result.

Start with an acceptable interval, not an approximate target

The tagged regulator API takes minimum and maximum acceptable voltages in microvolts. It provides a separate getter for the configured output and describes devicetree voltage limits. The driver must select from the levels it actually supports.

An interval should represent values the application can genuinely accept. Do not widen it merely to make a failed request succeed without checking the connected components. An exact nominal voltage, a tolerance band and a list of discrete hardware settings are related but different descriptions.

For a hypothetical software-only case, imagine a configured interval of 1800000 to 1900000 microvolts and a request spanning 1700000 to 1850000. These intervals overlap, but part of the request lies below the configured minimum. The arithmetic is useful for reviewing dispatch behavior; it does not authorize those values on any real board.

Read the common setter's actual operation

The versioned common implementation rejects a request when its minimum exceeds the configured maximum or its maximum is below the configured minimum. If that test passes, it calls the driver's set_voltage callback with the original minimum and maximum.

Thus, an overlap check is not the same operation as clamping. A caller cannot conclude from this common layer alone that the driver received only the intersection. The selected driver's level-selection implementation still needs inspection before making a product-wide assertion about allowed outputs.

The common supported-voltage helper also performs the disjoint-range check before iterating advertised levels against the caller's window. Treat it as evidence with that scope, rather than a replacement for understanding the actual setter and device capabilities.

Make the board constraint explicit at the integration boundary

A conservative application design can calculate the intersection between its requested interval and the board-approved interval before dispatch. If the result is empty, report an incompatible requirement instead of silently choosing a nearby value. If an intersection exists, verify that the selected regulator has a supported level within it.

That is an application recommendation, not a claim that every existing driver lacks its own checks. Review the deployed driver to avoid either assuming absent protection or duplicating it incorrectly. Keep units explicit through all conversions; millivolt values passed to a microvolt API would create a much larger error than the overlap detail.

If several product functions depend on the same rail, the approved interval must reflect their actual constraints. This article does not replace shared-supply ownership or sequencing analysis. It addresses what reaches the voltage-selection callback once an authorized voltage request is being considered.

Verify dispatch without energizing a questionable setting

A software test with a fake or instrumented driver can record the endpoints received for an entirely contained interval, a partial overlap and a disjoint interval. That establishes whether the caller and common layer supply the window the design intended, without applying an unreviewed voltage to hardware.

After software checks, a hardware qualification should use only approved settings and appropriate measurement procedures. Compare the configured-value report with the actual rail under specified conditions; the getter is not an independent voltmeter.

The practical acceptance question is precise: did the chosen supported setting remain within every required interval? “The API returned success” and “the ranges overlap” are each narrower observations than that final requirement.

Similar Posts

Leave a Reply

Your email address will not be published. Required fields are marked *