[PATCH v5 03/16] power: sequencing: Add pwrseq_power_is_on()

Bartosz Golaszewski brgl at kernel.org
Wed Jul 15 05:10:26 PDT 2026


On Wed, 15 Jul 2026 11:29:02 +0200, Andy Shevchenko
<andriy.shevchenko at linux.intel.com> said:
> On Wed, Jul 15, 2026 at 04:53:33PM +0800, Chen-Yu Tsai wrote:
>> 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.
>
> Reviewed-by: Andy Shevchenko <andriy.shevchenko at linux.intel.com>
>
> ...
>
>> +/**
>> + * pwrseq_power_is_on() - Queries the last requested state of the power sequencer.
>> + * @desc: Descriptor referencing the power sequencer.
>> + *
>> + * This returns the last requested state of the power sequencer.
>> + *
>> + * Returns:
>> + * On success, 1 for on or desc is NULL (optional) and 0 for off;
>> + * negative error number on failure.
>
> I would rephrase it a bit.
>
>  * On success, 1 for on and 0 for off; negative error number on failure.
>  * If desc is NULL (means optional) return 1.
>
> And this rises a question: why 1? Shouldn't it be some "unknown" state?
> (But since Bart Acked this, this doesn't prevent the patch to go, you
>  got my tag above.)
>

No, this is good feedback. Maybe we should prefer an enum like so:

enum pwrseq_state {
	PWRSEQ_POWER_UNKNOWN,
	PWRSEQ_POWER_ON,
	PWRSEQ_POWER_OFF
};

Bart



More information about the Linux-mediatek mailing list