]> git.ipfire.org Git - thirdparty/kernel/linux.git/commit
pmdomain: core: add support for power-domains-child-ids
authorKevin Hilman (TI) <khilman@baylibre.com>
Mon, 20 Apr 2026 23:51:18 +0000 (16:51 -0700)
committerUlf Hansson <ulf.hansson@linaro.org>
Mon, 11 May 2026 10:46:42 +0000 (12:46 +0200)
commit29e34a882b09e9f01d0fff5e312ea0cf9499137d
treeb718bfb665febc1610834a1ccc633c4a96c7ff8c
parent53df57b3ae880914b5b4ea51a5e8e52c2729258a
pmdomain: core: add support for power-domains-child-ids

Currently, PM domains can only support hierarchy for simple
providers (e.g. ones with #power-domain-cells = 0).

Add support for oncell providers as well by adding a new property
`power-domains-child-ids` to describe the parent/child relationship.

For example, an SCMI PM domain provider has multiple domains, each of
which might be a child of diffeent parent domains. In this example,
the parent domains are MAIN_PD and WKUP_PD:

    scmi_pds: protocol@11 {
        reg = <0x11>;
        #power-domain-cells = <1>;
        power-domains = <&MAIN_PD>, <&WKUP_PD>;
        power-domains-child-ids = <15>, <19>;
    };

With this example using the new property, SCMI PM domain 15 becomes a
child domain of MAIN_PD, and SCMI domain 19 becomes a child domain of
WKUP_PD.

To support this feature, add two new core functions

- of_genpd_add_child_ids()
- of_genpd_remove_child_ids()

which can be called by pmdomain providers to add/remove child domains
if they support the new property power-domains-child-ids.

The add function is "all or nothing".  If it cannot add all of the
child domains in the list, it will unwind any additions already made
and report a failure.

Signed-off-by: Kevin Hilman (TI) <khilman@baylibre.com>
Signed-off-by: Ulf Hansson <ulf.hansson@linaro.org>
drivers/pmdomain/core.c
include/linux/pm_domain.h