]> git.ipfire.org Git - thirdparty/kernel/stable.git/commit
clk: qcom: Support attaching GDSCs to multiple parents
authorBryan O'Donoghue <bryan.odonoghue@linaro.org>
Fri, 17 Jan 2025 13:54:10 +0000 (13:54 +0000)
committerBjorn Andersson <andersson@kernel.org>
Sat, 8 Feb 2025 05:20:55 +0000 (23:20 -0600)
commitb489235b4dc01ff2b53995c03f30726fb1ea8005
tree1ba9ffc8f67005e612bd76438cfdcddf6e6d48ef
parented5a0d065fe87d7f64e2aa67191bc73299b830bd
clk: qcom: Support attaching GDSCs to multiple parents

When a clock-controller lists multiple power-domains we need make each GDSC a
subdomain of each of the clock-controller's listed power-domains.

GDSCs without an explicitly defined parent should be a subdomain of each of
the clock-controller's listed power-domains.

GDSCs with an explicitly defined parent should attach only to the parent
GDSC and not the listed power-domains. Any votes will trickle through the
hierarchy up to the external power-domains.

========================================
::  arch/arm64/boot/dts/example.dtsi  ::
========================================

clockcc: clock-controller@0 {
        compat ="qcom,example-clockcc";
        power-domains = <&pd_a, &pd_b>;
}

========================================
:: drivers/clk/qcom/example-clockcc.c ::
========================================

static struct gdsc parent_gdsc = {
        .pd = {
                .name = "parent_gdsc",
        },
};

static struct gdsc child0_gdsc = {
        .pd = {
                .name = "child0_gdsc",
        },
        .parent = &parent_gdsc.pd,
};

static struct gdsc child1_gdsc = {
        .pd = {
                .name = "child1_gdsc",
        },
        .parent = &parent_gdsc.pd,
};

========================================
::          power-subdomains          ::
========================================

pm-domain::pd_a
└── pm-subdomain::clockcc::parent_gdsc
    ├── pm-subdomain::clockcc::child0_gdsc
    └── pm-subdomain::clockcc::child1_gdsc

pm-domain::pd_b
└── pm-subdomain::clockcc::parent_gdsc
    ├── pm-subdomain::clockcc::child1_gdsc
    └── pm-subdomain::clockcc::child2_gdsc

The performance states will percolate through the pm-domain hierarchy to
the domains that handle the relevant states.

Signed-off-by: Bryan O'Donoghue <bryan.odonoghue@linaro.org>
Link: https://lore.kernel.org/r/20250117-b4-linux-next-24-11-18-clock-multiple-power-domains-v10-4-13f2bb656dad@linaro.org
Signed-off-by: Bjorn Andersson <andersson@kernel.org>
drivers/clk/qcom/common.c
drivers/clk/qcom/gdsc.c
drivers/clk/qcom/gdsc.h