From: Neil Armstrong <neil.armstrong@linaro.org>
To: Xianwei Zhao <xianwei.zhao@amlogic.com>,
devicetree@vger.kernel.org, linux-arm-kernel@lists.infradead.org,
linux-amlogic@lists.infradead.org, linux-kernel@vger.kernel.org
Cc: Rob Herring <robh+dt@kernel.org>,
Krzysztof Kozlowski <krzysztof.kozlowski+dt@linaro.org>,
Conor Dooley <conor+dt@kernel.org>,
Kevin Hilman <khilman@baylibre.com>
Subject: Re: [PATCH V2 2/6] soc: amlogic: add driver to support power parent node
Date: Thu, 24 Aug 2023 10:27:59 +0200 [thread overview]
Message-ID: <741c1e35-648d-4c2f-a939-24bcbec93911@linaro.org> (raw)
In-Reply-To: <20230824055930.2576849-3-xianwei.zhao@amlogic.com>
Hi,
On 24/08/2023 07:59, Xianwei Zhao wrote:
> From: "xianwei.zhao" <xianwei.zhao@amlogic.com>
>
> Some power domains depends on other domains, Such as Amlogic T7 SoC.
> Add parent node to support this case.
>
> Signed-off-by: xianwei.zhao <xianwei.zhao@amlogic.com>
> ---
> V1 -> V2: None
> ---
> drivers/genpd/amlogic/meson-secure-pwrc.c | 26 ++++++++++++++++++++++-
> 1 file changed, 25 insertions(+), 1 deletion(-)
>
> diff --git a/drivers/genpd/amlogic/meson-secure-pwrc.c b/drivers/genpd/amlogic/meson-secure-pwrc.c
> index 5ac2437ab8ad..76527f4946b4 100644
> --- a/drivers/genpd/amlogic/meson-secure-pwrc.c
> +++ b/drivers/genpd/amlogic/meson-secure-pwrc.c
> @@ -19,10 +19,12 @@
>
> #define PWRC_ON 1
> #define PWRC_OFF 0
> +#define PWRC_NO_PARENT ((1UL << (sizeof(unsigned int) * 8)) - 1)
This is fishy, just use UINT_MAX
>
> struct meson_secure_pwrc_domain {
> struct generic_pm_domain base;
> unsigned int index;
> + unsigned int parent;
> struct meson_secure_pwrc *pwrc;
> };
>
> @@ -34,6 +36,7 @@ struct meson_secure_pwrc {
>
> struct meson_secure_pwrc_domain_desc {
> unsigned int index;
> + unsigned int parent;
> unsigned int flags;
> char *name;
> bool (*is_off)(struct meson_secure_pwrc_domain *pwrc_domain);
> @@ -90,8 +93,19 @@ static int meson_secure_pwrc_on(struct generic_pm_domain *domain)
> { \
> .name = #__name, \
> .index = PWRC_##__name##_ID, \
> - .is_off = pwrc_secure_is_off, \
> + .is_off = pwrc_secure_is_off, \
> .flags = __flag, \
> + .parent = PWRC_NO_PARENT, \
> +}
> +
> +#define TOP_PD(__name, __flag, __parent) \
> +[PWRC_##__name##_ID] = \
> +{ \
> + .name = #__name, \
> + .index = PWRC_##__name##_ID, \
> + .is_off = pwrc_secure_is_off, \
> + .flags = __flag, \
> + .parent = __parent, \
> }
>
> static struct meson_secure_pwrc_domain_desc a1_pwrc_domains[] = {
> @@ -202,6 +216,7 @@ static int meson_secure_pwrc_probe(struct platform_device *pdev)
>
> dom->pwrc = pwrc;
> dom->index = match->domains[i].index;
> + dom->parent = match->domains[i].parent;
> dom->base.name = match->domains[i].name;
> dom->base.flags = match->domains[i].flags;
> dom->base.power_on = meson_secure_pwrc_on;
> @@ -212,6 +227,15 @@ static int meson_secure_pwrc_probe(struct platform_device *pdev)
> pwrc->xlate.domains[i] = &dom->base;
> }
>
> + for (i = 0; i < match->count; i++) {
> + struct meson_secure_pwrc_domain *dom = pwrc->domains;
> +
> + if (!match->domains[i].name || match->domains[i].parent == PWRC_NO_PARENT)
> + continue;
> +
> + pm_genpd_add_subdomain(&dom[dom[i].parent].base, &dom[i].base);
> + }
> +
> return of_genpd_add_provider_onecell(pdev->dev.of_node, &pwrc->xlate);
> }
>
_______________________________________________
linux-amlogic mailing list
linux-amlogic@lists.infradead.org
http://lists.infradead.org/mailman/listinfo/linux-amlogic
next prev parent reply other threads:[~2023-08-24 8:28 UTC|newest]
Thread overview: 20+ messages / expand[flat|nested] mbox.gz Atom feed top
2023-08-24 5:59 [PATCH V2 0/6] Power: T7: add power domain driver Xianwei Zhao
2023-08-24 5:59 ` [PATCH V2 1/6] soc: amlogic: modify some power domains property Xianwei Zhao
2023-08-24 8:24 ` Neil Armstrong
2023-08-24 8:32 ` Xianwei Zhao
2023-08-24 5:59 ` [PATCH V2 2/6] soc: amlogic: add driver to support power parent node Xianwei Zhao
2023-08-24 8:27 ` Neil Armstrong [this message]
2023-08-24 8:42 ` Xianwei Zhao
2023-08-24 5:59 ` [PATCH V2 3/6] soc: amlogic: init power domain state Xianwei Zhao
2023-08-24 8:30 ` Neil Armstrong
2023-08-24 8:46 ` Xianwei Zhao
2023-08-24 5:59 ` [PATCH V2 4/6] dt-bindings: power: add Amlogic T7 power domains Xianwei Zhao
2023-08-24 15:07 ` Conor Dooley
2023-08-26 18:00 ` Lucas Tanure
2023-08-24 5:59 ` [PATCH V2 5/6] soc: amlogic: Add support for T7 power domains controller Xianwei Zhao
2023-08-24 8:30 ` Neil Armstrong
2023-08-24 8:49 ` Xianwei Zhao
2023-08-24 5:59 ` [PATCH V2 6/6] arm64: dts: add support for T7 power domain controller Xianwei Zhao
2023-08-24 8:32 ` Neil Armstrong
2023-08-24 8:51 ` Xianwei Zhao
2023-08-26 17:59 ` Lucas Tanure
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=741c1e35-648d-4c2f-a939-24bcbec93911@linaro.org \
--to=neil.armstrong@linaro.org \
--cc=conor+dt@kernel.org \
--cc=devicetree@vger.kernel.org \
--cc=khilman@baylibre.com \
--cc=krzysztof.kozlowski+dt@linaro.org \
--cc=linux-amlogic@lists.infradead.org \
--cc=linux-arm-kernel@lists.infradead.org \
--cc=linux-kernel@vger.kernel.org \
--cc=robh+dt@kernel.org \
--cc=xianwei.zhao@amlogic.com \
/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
all inboxes | Powered by JetHome®