public inbox for u-boot@lists.denx.de
 help / color / mirror / Atom feed
From: "Jaehoon Chung" <jh80.chung@samsung.com>
To: "'Neil Armstrong'" <neil.armstrong@linaro.org>,
	"'Lukasz Majewski'" <lukma@denx.de>,
	"'Sean Anderson'" <seanga2@gmail.com>,
	"'Tom	Rini'" <trini@konsulko.com>
Cc: <u-boot-amlogic@groups.io>, <u-boot@lists.denx.de>
Subject: RE: [PATCH 2/2] power/domain: meson-ee-pwrc: make sure to not enable a domain twice
Date: Wed, 23 Oct 2024 08:19:42 +0900	[thread overview]
Message-ID: <0a5d01db24d8$dfc35d20$9f4a1760$@samsung.com> (raw)
In-Reply-To: <20241009-u-boot-topic-fix-hdmi-v1-2-2479cd90c4ea@linaro.org>



> -----Original Message-----
> From: Neil Armstrong <neil.armstrong@linaro.org>
> Sent: Wednesday, October 9, 2024 6:15 PM
> To: Lukasz Majewski <lukma@denx.de>; Sean Anderson <seanga2@gmail.com>; Tom Rini <trini@konsulko.com>;
> Jaehoon Chung <jh80.chung@samsung.com>
> Cc: u-boot-amlogic@groups.io; u-boot@lists.denx.de; Neil Armstrong <neil.armstrong@linaro.org>
> Subject: [PATCH 2/2] power/domain: meson-ee-pwrc: make sure to not enable a domain twice
>
> 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.
>
> Signed-off-by: Neil Armstrong <neil.armstrong@linaro.org>

Reviewed-by: Jaehoon Chung <jh80.chung@samsung.com>

Best Regards,
Jaehoon Chung

> ---
>  drivers/power/domain/meson-ee-pwrc.c | 15 +++++++++++++--
>  1 file changed, 13 insertions(+), 2 deletions(-)
>
> diff --git a/drivers/power/domain/meson-ee-pwrc.c b/drivers/power/domain/meson-ee-pwrc.c
> index 20e9f32b381..4d9f3bba644 100644
> --- a/drivers/power/domain/meson-ee-pwrc.c
> +++ b/drivers/power/domain/meson-ee-pwrc.c
> @@ -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;
>  }
>
> --
> 2.34.1




  reply	other threads:[~2024-10-22 23:19 UTC|newest]

Thread overview: 5+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2024-10-09  9:15 [PATCH 0/2] ARM: mach-meson: fix HDMI since DT update to v6.11 Neil Armstrong
2024-10-09  9:15 ` [PATCH 1/2] clk: meson: gxbb: add HDMI clocks Neil Armstrong
2024-10-09  9:15 ` [PATCH 2/2] power/domain: meson-ee-pwrc: make sure to not enable a domain twice Neil Armstrong
2024-10-22 23:19   ` Jaehoon Chung [this message]
2024-10-11 14:42 ` [PATCH 0/2] ARM: mach-meson: fix HDMI since DT update to v6.11 Neil Armstrong

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to='0a5d01db24d8$dfc35d20$9f4a1760$@samsung.com' \
    --to=jh80.chung@samsung.com \
    --cc=lukma@denx.de \
    --cc=neil.armstrong@linaro.org \
    --cc=seanga2@gmail.com \
    --cc=trini@konsulko.com \
    --cc=u-boot-amlogic@groups.io \
    --cc=u-boot@lists.denx.de \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox