pmdomain: amlogic: init power domain state
authorxianwei.zhao <xianwei.zhao@amlogic.com>
Mon, 11 Sep 2023 02:52:20 +0000 (10:52 +0800)
committerUlf Hansson <ulf.hansson@linaro.org>
Wed, 13 Sep 2023 22:10:28 +0000 (00:10 +0200)
If initial power domain with 'AWAY_ON' property state is off,
turn on the power.

Signed-off-by: xianwei.zhao <xianwei.zhao@amlogic.com>
Link: https://lore.kernel.org/r/20230911025223.3433776-4-xianwei.zhao@amlogic.com
[Ulf: Re-based to fit the pmdomain subsystem]
Signed-off-by: Ulf Hansson <ulf.hansson@linaro.org>
drivers/pmdomain/amlogic/meson-secure-pwrc.c

index ecada53..d751c22 100644 (file)
@@ -222,6 +222,9 @@ static int meson_secure_pwrc_probe(struct platform_device *pdev)
                dom->base.power_on = meson_secure_pwrc_on;
                dom->base.power_off = meson_secure_pwrc_off;
 
+               if (match->domains[i].is_off(dom) && (dom->base.flags & GENPD_FLAG_ALWAYS_ON))
+                       meson_secure_pwrc_on(&dom->base);
+
                pm_genpd_init(&dom->base, NULL, match->domains[i].is_off(dom));
 
                pwrc->xlate.domains[i] = &dom->base;