From: Laurent Pinchart <laurent.pinchart@ideasonboard.com>
To: Geert Uytterhoeven <geert+renesas@glider.be>
Cc: Simon Horman <horms@verge.net.au>,
Magnus Damm <magnus.damm@gmail.com>,
linux-renesas-soc@vger.kernel.org,
linux-arm-kernel@lists.infradead.org, linux-pm@vger.kernel.org,
devicetree@vger.kernel.org
Subject: Re: [PATCH/RFC v2 05/11] soc: renesas: rcar: Handle clock domain devices in SYSC PM domains
Date: Tue, 16 Feb 2016 00:08:16 +0200 [thread overview]
Message-ID: <2087210.c20JsV3rp3@avalon> (raw)
In-Reply-To: <1455571020-18968-6-git-send-email-geert+renesas@glider.be>
Hi Geert,
Thank you for the patch.
On Monday 15 February 2016 22:16:54 Geert Uytterhoeven wrote:
> R-Car H3 contains some hardware modules (e.g. VSP and FCP_V) that are
> not only located in a power area controlled by the SYSC system
> controller, but that are also part of the generic CPG/MSSR clock domain.
> Make sure both are handled by enabling module clock PM when the device
> for such a hardware module is attached to the SYSC PM Domain.
Can't we specify both power domains in the DT power-domains attribute instead
?
> FIXME Share code with the renesas-cpg-mssr driver.
>
> Signed-off-by: Geert Uytterhoeven <geert+renesas@glider.be>
> ---
> v2:
> - New.
> ---
> drivers/soc/renesas/pm-rcar.c | 68 +++++++++++++++++++++++++++++++++++++++++
> 1 file changed, 68 insertions(+)
>
> diff --git a/drivers/soc/renesas/pm-rcar.c b/drivers/soc/renesas/pm-rcar.c
> index c0540934126e58eb..d1bf8c231540b11d 100644
> --- a/drivers/soc/renesas/pm-rcar.c
> +++ b/drivers/soc/renesas/pm-rcar.c
> @@ -9,16 +9,20 @@
> * for more details.
> */
>
> +#include <linux/clk.h>
> #include <linux/delay.h>
> #include <linux/err.h>
> #include <linux/mm.h>
> #include <linux/of_address.h>
> +#include <linux/pm_clock.h>
> #include <linux/pm_domain.h>
> #include <linux/slab.h>
> #include <linux/spinlock.h>
> #include <linux/io.h>
> #include <linux/soc/renesas/pm-rcar.h>
>
> +#include <dt-bindings/clock/renesas-cpg-mssr.h>
> +
> /* SYSC Common */
> #define SYSCSR 0x00 /* SYSC Status Register */
> #define SYSCISR 0x04 /* Interrupt Status Register */
> @@ -248,11 +252,75 @@ static int rcar_pd_power_up(struct generic_pm_domain
> *genpd) return rcar_sysc_power_up(&to_rcar_pd(genpd)->ch);
> }
>
> +#ifdef CONFIG_ARCH_R8A7795
> +static int rcar_clk_pd_attach_dev(struct generic_pm_domain *genpd,
> + struct device *dev)
> +{
> + struct device_node *np = dev->of_node;
> + struct of_phandle_args clkspec;
> + struct clk *clk;
> + int i = 0;
> + int error;
> +
> + while (!of_parse_phandle_with_args(np, "clocks", "#clock-cells", i,
> + &clkspec)) {
> + if (clkspec.args_count == 2 && clkspec.args[0] == CPG_MOD &&
> + of_device_is_compatible(clkspec.np,
> + "renesas,r8a7795-cpg-mssr"))
> + goto found;
> +
> + of_node_put(clkspec.np);
> + i++;
> + }
> +
> + return 0;
> +
> +found:
> + clk = of_clk_get_from_provider(&clkspec);
> + of_node_put(clkspec.np);
> +
> + if (IS_ERR(clk))
> + return PTR_ERR(clk);
> +
> + error = pm_clk_create(dev);
> + if (error) {
> + dev_err(dev, "pm_clk_create failed %d\n", error);
> + goto fail_put;
> + }
> +
> + error = pm_clk_add_clk(dev, clk);
> + if (error) {
> + dev_err(dev, "pm_clk_add_clk %pC failed %d\n", clk, error);
> + goto fail_destroy;
> + }
> +
> + return 0;
> +
> +fail_destroy:
> + pm_clk_destroy(dev);
> +fail_put:
> + clk_put(clk);
> + return error;
> +}
> +
> +static void rcar_clk_pd_detach_dev(struct generic_pm_domain *genpd,
> + struct device *dev)
> +{
> + if (!list_empty(&dev->power.subsys_data->clock_list))
> + pm_clk_destroy(dev);
> +}
> +#endif /* CONFIG_ARCH_R8A7795 */
> +
> static void rcar_init_pm_domain(struct rcar_pm_domain *rcar_pd)
> {
> struct generic_pm_domain *genpd = &rcar_pd->genpd;
> struct dev_power_governor *gov = rcar_pd->gov;
>
> +#ifdef CONFIG_ARCH_R8A7795
> + genpd->flags = GENPD_FLAG_PM_CLK;
> + genpd->attach_dev = rcar_clk_pd_attach_dev;
> + genpd->detach_dev = rcar_clk_pd_detach_dev;
> +#endif
> pm_genpd_init(genpd, gov ? : &simple_qos_governor, false);
> genpd->dev_ops.active_wakeup = rcar_pd_active_wakeup;
> genpd->power_off = rcar_pd_power_down;
--
Regards,
Laurent Pinchart
WARNING: multiple messages have this Message-ID (diff)
From: laurent.pinchart@ideasonboard.com (Laurent Pinchart)
To: linux-arm-kernel@lists.infradead.org
Subject: [PATCH/RFC v2 05/11] soc: renesas: rcar: Handle clock domain devices in SYSC PM domains
Date: Tue, 16 Feb 2016 00:08:16 +0200 [thread overview]
Message-ID: <2087210.c20JsV3rp3@avalon> (raw)
In-Reply-To: <1455571020-18968-6-git-send-email-geert+renesas@glider.be>
Hi Geert,
Thank you for the patch.
On Monday 15 February 2016 22:16:54 Geert Uytterhoeven wrote:
> R-Car H3 contains some hardware modules (e.g. VSP and FCP_V) that are
> not only located in a power area controlled by the SYSC system
> controller, but that are also part of the generic CPG/MSSR clock domain.
> Make sure both are handled by enabling module clock PM when the device
> for such a hardware module is attached to the SYSC PM Domain.
Can't we specify both power domains in the DT power-domains attribute instead
?
> FIXME Share code with the renesas-cpg-mssr driver.
>
> Signed-off-by: Geert Uytterhoeven <geert+renesas@glider.be>
> ---
> v2:
> - New.
> ---
> drivers/soc/renesas/pm-rcar.c | 68 +++++++++++++++++++++++++++++++++++++++++
> 1 file changed, 68 insertions(+)
>
> diff --git a/drivers/soc/renesas/pm-rcar.c b/drivers/soc/renesas/pm-rcar.c
> index c0540934126e58eb..d1bf8c231540b11d 100644
> --- a/drivers/soc/renesas/pm-rcar.c
> +++ b/drivers/soc/renesas/pm-rcar.c
> @@ -9,16 +9,20 @@
> * for more details.
> */
>
> +#include <linux/clk.h>
> #include <linux/delay.h>
> #include <linux/err.h>
> #include <linux/mm.h>
> #include <linux/of_address.h>
> +#include <linux/pm_clock.h>
> #include <linux/pm_domain.h>
> #include <linux/slab.h>
> #include <linux/spinlock.h>
> #include <linux/io.h>
> #include <linux/soc/renesas/pm-rcar.h>
>
> +#include <dt-bindings/clock/renesas-cpg-mssr.h>
> +
> /* SYSC Common */
> #define SYSCSR 0x00 /* SYSC Status Register */
> #define SYSCISR 0x04 /* Interrupt Status Register */
> @@ -248,11 +252,75 @@ static int rcar_pd_power_up(struct generic_pm_domain
> *genpd) return rcar_sysc_power_up(&to_rcar_pd(genpd)->ch);
> }
>
> +#ifdef CONFIG_ARCH_R8A7795
> +static int rcar_clk_pd_attach_dev(struct generic_pm_domain *genpd,
> + struct device *dev)
> +{
> + struct device_node *np = dev->of_node;
> + struct of_phandle_args clkspec;
> + struct clk *clk;
> + int i = 0;
> + int error;
> +
> + while (!of_parse_phandle_with_args(np, "clocks", "#clock-cells", i,
> + &clkspec)) {
> + if (clkspec.args_count == 2 && clkspec.args[0] == CPG_MOD &&
> + of_device_is_compatible(clkspec.np,
> + "renesas,r8a7795-cpg-mssr"))
> + goto found;
> +
> + of_node_put(clkspec.np);
> + i++;
> + }
> +
> + return 0;
> +
> +found:
> + clk = of_clk_get_from_provider(&clkspec);
> + of_node_put(clkspec.np);
> +
> + if (IS_ERR(clk))
> + return PTR_ERR(clk);
> +
> + error = pm_clk_create(dev);
> + if (error) {
> + dev_err(dev, "pm_clk_create failed %d\n", error);
> + goto fail_put;
> + }
> +
> + error = pm_clk_add_clk(dev, clk);
> + if (error) {
> + dev_err(dev, "pm_clk_add_clk %pC failed %d\n", clk, error);
> + goto fail_destroy;
> + }
> +
> + return 0;
> +
> +fail_destroy:
> + pm_clk_destroy(dev);
> +fail_put:
> + clk_put(clk);
> + return error;
> +}
> +
> +static void rcar_clk_pd_detach_dev(struct generic_pm_domain *genpd,
> + struct device *dev)
> +{
> + if (!list_empty(&dev->power.subsys_data->clock_list))
> + pm_clk_destroy(dev);
> +}
> +#endif /* CONFIG_ARCH_R8A7795 */
> +
> static void rcar_init_pm_domain(struct rcar_pm_domain *rcar_pd)
> {
> struct generic_pm_domain *genpd = &rcar_pd->genpd;
> struct dev_power_governor *gov = rcar_pd->gov;
>
> +#ifdef CONFIG_ARCH_R8A7795
> + genpd->flags = GENPD_FLAG_PM_CLK;
> + genpd->attach_dev = rcar_clk_pd_attach_dev;
> + genpd->detach_dev = rcar_clk_pd_detach_dev;
> +#endif
> pm_genpd_init(genpd, gov ? : &simple_qos_governor, false);
> genpd->dev_ops.active_wakeup = rcar_pd_active_wakeup;
> genpd->power_off = rcar_pd_power_down;
--
Regards,
Laurent Pinchart
next prev parent reply other threads:[~2016-02-15 22:07 UTC|newest]
Thread overview: 70+ messages / expand[flat|nested] mbox.gz Atom feed top
2016-02-15 21:16 [PATCH/RFC v2 00/11] ARM/arm64: renesas: Add SYSC PM Domain DT Support Geert Uytterhoeven
2016-02-15 21:16 ` Geert Uytterhoeven
2016-02-15 21:16 ` [PATCH/RFC v2 01/11] PM / Domains: Add DT bindings for the R-Car System Controller Geert Uytterhoeven
2016-02-15 21:16 ` Geert Uytterhoeven
2016-02-15 23:08 ` Laurent Pinchart
2016-02-15 23:08 ` Laurent Pinchart
2016-02-15 23:33 ` Laurent Pinchart
2016-02-15 23:33 ` Laurent Pinchart
2016-02-16 7:15 ` Geert Uytterhoeven
2016-02-16 7:15 ` Geert Uytterhoeven
2016-02-18 14:38 ` Rob Herring
2016-02-18 14:38 ` Rob Herring
2016-02-18 17:18 ` Geert Uytterhoeven
2016-02-18 17:18 ` Geert Uytterhoeven
2016-02-18 21:14 ` Laurent Pinchart
2016-02-18 21:14 ` Laurent Pinchart
2016-02-23 20:08 ` Rob Herring
2016-02-23 20:08 ` Rob Herring
2016-02-15 21:16 ` [PATCH/RFC v2 02/11] soc: renesas: Move pm-rcar to drivers/soc/renesas/ Geert Uytterhoeven
2016-02-15 21:16 ` Geert Uytterhoeven
2016-02-15 22:12 ` Laurent Pinchart
2016-02-15 22:12 ` Laurent Pinchart
2016-02-15 21:16 ` [PATCH/RFC v2 03/11] soc: renesas: Improve rcar_sysc_power() debug info Geert Uytterhoeven
2016-02-15 21:16 ` Geert Uytterhoeven
2016-02-15 22:11 ` Laurent Pinchart
2016-02-15 22:11 ` Laurent Pinchart
2016-02-15 21:16 ` [PATCH/RFC v2 05/11] soc: renesas: rcar: Handle clock domain devices in SYSC PM domains Geert Uytterhoeven
2016-02-15 21:16 ` Geert Uytterhoeven
2016-02-15 22:08 ` Laurent Pinchart [this message]
2016-02-15 22:08 ` Laurent Pinchart
2016-02-16 7:30 ` Geert Uytterhoeven
2016-02-16 7:30 ` Geert Uytterhoeven
2016-02-16 8:02 ` Laurent Pinchart
2016-02-16 8:02 ` Laurent Pinchart
2016-02-15 21:16 ` [PATCH/RFC v2 06/11] ARM: dts: r8a7779: Add " Geert Uytterhoeven
2016-02-15 21:16 ` Geert Uytterhoeven
2016-02-15 21:16 ` [PATCH/RFC v2 08/11] ARM: dts: r8a7791: " Geert Uytterhoeven
2016-02-15 21:16 ` Geert Uytterhoeven
2016-02-15 21:16 ` [PATCH/RFC v2 10/11] ARM: dts: r8a7794: " Geert Uytterhoeven
2016-02-15 21:16 ` Geert Uytterhoeven
[not found] ` <1455571020-18968-1-git-send-email-geert+renesas-gXvu3+zWzMSzQB+pC5nmwQ@public.gmane.org>
2016-02-15 21:16 ` [PATCH/RFC v2 04/11] soc: renesas: rcar: Add DT support for " Geert Uytterhoeven
2016-02-15 21:16 ` Geert Uytterhoeven
2016-02-15 21:16 ` Geert Uytterhoeven
2016-02-15 22:51 ` Laurent Pinchart
2016-02-15 22:51 ` Laurent Pinchart
2016-02-17 12:45 ` Geert Uytterhoeven
2016-02-17 12:45 ` Geert Uytterhoeven
2016-02-17 12:45 ` Geert Uytterhoeven
2016-02-26 15:41 ` Geert Uytterhoeven
2016-02-26 15:41 ` Geert Uytterhoeven
2016-02-26 15:41 ` Geert Uytterhoeven
2016-02-26 16:28 ` Laurent Pinchart
2016-02-26 16:28 ` Laurent Pinchart
2016-02-15 21:16 ` [PATCH/RFC v2 07/11] ARM: dts: r8a7790: Add " Geert Uytterhoeven
2016-02-15 21:16 ` Geert Uytterhoeven
2016-02-15 21:16 ` Geert Uytterhoeven
2016-02-15 21:16 ` [PATCH/RFC v2 09/11] ARM: dts: r8a7793: " Geert Uytterhoeven
2016-02-15 21:16 ` Geert Uytterhoeven
2016-02-15 21:16 ` Geert Uytterhoeven
2016-02-15 21:17 ` [PATCH/RFC v2 11/11] arm64: dts: r8a7795: " Geert Uytterhoeven
2016-02-15 21:17 ` Geert Uytterhoeven
2016-02-15 21:17 ` Geert Uytterhoeven
2016-02-27 1:53 ` [PATCH/RFC v2 00/11] ARM/arm64: renesas: Add SYSC PM Domain DT Support Laurent Pinchart
2016-02-27 1:53 ` Laurent Pinchart
2016-02-28 8:55 ` Geert Uytterhoeven
2016-02-28 8:55 ` Geert Uytterhoeven
2016-02-28 15:04 ` Laurent Pinchart
2016-02-28 15:04 ` Laurent Pinchart
2016-02-28 19:26 ` Laurent Pinchart
2016-02-28 19:26 ` Laurent Pinchart
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=2087210.c20JsV3rp3@avalon \
--to=laurent.pinchart@ideasonboard.com \
--cc=devicetree@vger.kernel.org \
--cc=geert+renesas@glider.be \
--cc=horms@verge.net.au \
--cc=linux-arm-kernel@lists.infradead.org \
--cc=linux-pm@vger.kernel.org \
--cc=linux-renesas-soc@vger.kernel.org \
--cc=magnus.damm@gmail.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 an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.