[PATCH v3 03/13] power: sequencing: Add pwrseq_power_is_on()
Chen-Yu Tsai
wenst at chromium.org
Fri Jul 3 05:17:19 PDT 2026
On Fri, Jul 3, 2026 at 8:07 PM Bartosz Golaszewski <brgl at kernel.org> wrote:
>
> On Fri, 3 Jul 2026 13:03:04 +0200, Chen-Yu Tsai <wenst at chromium.org> said:
> > The power sequencing consumer API already does power on state tracking
> > internally. Expose the state to consumers through pwrseq_power_is_on()
> > so that they don't have to reimplement it locally.
> >
>
> They wouldn't be able to do it as the field is private to pwrseq core anyway.
Which is why a helper is added? Note this is returning the requested state
on the consumer side, not the actual state.
> In what situation would consumers need this? Typically you know what state the
> handle is in if you control it.
Mostly just to avoid extra tracking in the USB port device. For the hub's
port power feature flag, the hub driver actually queries the hub for the
current state; no in-kernel tracking is involved, i.e. the consumer doesn't
actually know what state it is currently in.
ChenYu
More information about the linux-arm-kernel
mailing list