]> git.dujemihanovic.xyz Git - u-boot.git/commitdiff
power/domain: meson-ee-pwrc: make sure to not enable a domain twice
authorNeil Armstrong <neil.armstrong@linaro.org>
Wed, 9 Oct 2024 09:15:21 +0000 (11:15 +0200)
committerNeil Armstrong <neil.armstrong@linaro.org>
Mon, 14 Oct 2024 07:06:16 +0000 (09:06 +0200)
The upstream Device Tree for GXBB/GXL/G12A was updated with VPU domain
shared between the VPU and HDMI node, causing a double enable.

Simply store the enable state and avoid enabling twice, fixing
HDMI output on all platforms.

Link: https://lore.kernel.org/r/20241009-u-boot-topic-fix-hdmi-v1-2-2479cd90c4ea@linaro.org
Signed-off-by: Neil Armstrong <neil.armstrong@linaro.org>
drivers/power/domain/meson-ee-pwrc.c

index 20e9f32b3819b3ce067eb07009d8845778544df1..4d9f3bba644c432e87c55bd56349a7c079fd5cc2 100644 (file)
@@ -60,6 +60,7 @@ struct meson_ee_pwrc_domain_desc {
        unsigned int mem_pd_count;
        struct meson_ee_pwrc_mem_domain *mem_pd;
        bool (*get_power)(struct power_domain *power_domain);
+       bool enabled;
 };
 
 struct meson_ee_pwrc_domain_data {
@@ -306,6 +307,8 @@ static int meson_ee_pwrc_off(struct power_domain *power_domain)
                clk_disable_bulk(&priv->clks);
        }
 
+       pwrc_domain->enabled = false;
+
        return 0;
 }
 
@@ -317,6 +320,9 @@ static int meson_ee_pwrc_on(struct power_domain *power_domain)
 
        pwrc_domain = &priv->data->domains[power_domain->id];
 
+       if (pwrc_domain->enabled)
+               return 0;
+
        if (pwrc_domain->top_pd)
                regmap_update_bits(priv->regmap_ao,
                                   pwrc_domain->top_pd->sleep_reg,
@@ -347,8 +353,13 @@ static int meson_ee_pwrc_on(struct power_domain *power_domain)
                        return ret;
        }
 
-       if (pwrc_domain->clk_names_count)
-               return clk_enable_bulk(&priv->clks);
+       if (pwrc_domain->clk_names_count) {
+               ret = clk_enable_bulk(&priv->clks);
+               if (ret)
+                       return ret;
+       }
+
+       pwrc_domain->enabled = true;
 
        return 0;
 }