[PATCH v3 03/13] power: sequencing: Add pwrseq_power_is_on()
Bartosz Golaszewski
brgl at kernel.org
Fri Jul 3 06:18:24 PDT 2026
On Fri, 3 Jul 2026 14:17:19 +0200, Chen-Yu Tsai <wenst at chromium.org> said:
> 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.
>
Fair enough, thanks.
Acked-by: Bartosz Golaszewski <bartosz.golaszewski at oss.qualcomm.com>
More information about the linux-arm-kernel
mailing list