All of lore.kernel.org
 help / color / mirror / Atom feed
From: Simon Horman <horms+renesas@verge.net.au>
To: linux-arm-kernel@lists.infradead.org
Subject: [PATCH] ARM: shmobile: R-Mobile: Use CPG/MSTP Clock Domain attach/detach helpers
Date: Thu, 24 Sep 2015 05:30:20 +0000	[thread overview]
Message-ID: <8b98d74780ab70147d40400c36059c16c1aea4da.1443072491.git.horms+renesas@verge.net.au> (raw)
In-Reply-To: <cover.1443072491.git.horms+renesas@verge.net.au>

From: Geert Uytterhoeven <geert+renesas@glider.be>

The R-Mobile PM Domain driver manages both power domains and a clock
domain.

The clock domain part is very similar to the CPG/MSTP Clock Domain,
which is used on shmobile SoCs without device power domains, except for
the way how clocks suitable for power management are selected:
  - The former uses the first clock tied to the device through the NULL
    con_id, which is a relic from the legacy pm_clk_notifier-based
    method in drivers/sh/pm_runtime.c,
  - The latter looks for suitable clocks in DT, which is more
    future-proof.

All platforms using this driver are now supported in DT-based ARM
multi-platform builds only, hence switch to using the CPG/MSTP Clock
Domain helpers.

Signed-off-by: Geert Uytterhoeven <geert+renesas@glider.be>
Reviewed-by: Ulf Hansson <ulf.hansson@linaro.org>
Signed-off-by: Simon Horman <horms+renesas@verge.net.au>
---
 arch/arm/mach-shmobile/pm-rmobile.c | 35 +++--------------------------------
 1 file changed, 3 insertions(+), 32 deletions(-)

diff --git a/arch/arm/mach-shmobile/pm-rmobile.c b/arch/arm/mach-shmobile/pm-rmobile.c
index a5b96b990aea..89068c8ec50f 100644
--- a/arch/arm/mach-shmobile/pm-rmobile.c
+++ b/arch/arm/mach-shmobile/pm-rmobile.c
@@ -12,6 +12,7 @@
  * License.  See the file "COPYING" in the main directory of this archive
  * for more details.
  */
+#include <linux/clk/shmobile.h>
 #include <linux/console.h>
 #include <linux/delay.h>
 #include <linux/of.h>
@@ -124,36 +125,6 @@ static bool rmobile_pd_active_wakeup(struct device *dev)
 	return true;
 }
 
-static int rmobile_pd_attach_dev(struct generic_pm_domain *domain,
-				 struct device *dev)
-{
-	int error;
-
-	error = pm_clk_create(dev);
-	if (error) {
-		dev_err(dev, "pm_clk_create failed %d\n", error);
-		return error;
-	}
-
-	error = pm_clk_add(dev, NULL);
-	if (error) {
-		dev_err(dev, "pm_clk_add failed %d\n", error);
-		goto fail;
-	}
-
-	return 0;
-
-fail:
-	pm_clk_destroy(dev);
-	return error;
-}
-
-static void rmobile_pd_detach_dev(struct generic_pm_domain *domain,
-				  struct device *dev)
-{
-	pm_clk_destroy(dev);
-}
-
 static void rmobile_init_pm_domain(struct rmobile_pm_domain *rmobile_pd)
 {
 	struct generic_pm_domain *genpd = &rmobile_pd->genpd;
@@ -164,8 +135,8 @@ static void rmobile_init_pm_domain(struct rmobile_pm_domain *rmobile_pd)
 	genpd->dev_ops.active_wakeup	= rmobile_pd_active_wakeup;
 	genpd->power_off		= rmobile_pd_power_down;
 	genpd->power_on			= rmobile_pd_power_up;
-	genpd->attach_dev		= rmobile_pd_attach_dev;
-	genpd->detach_dev		= rmobile_pd_detach_dev;
+	genpd->attach_dev		= cpg_mstp_attach_dev;
+	genpd->detach_dev		= cpg_mstp_detach_dev;
 	__rmobile_pd_power_up(rmobile_pd, false);
 }
 
-- 
2.1.4


WARNING: multiple messages have this Message-ID (diff)
From: horms+renesas@verge.net.au (Simon Horman)
To: linux-arm-kernel@lists.infradead.org
Subject: [PATCH] ARM: shmobile: R-Mobile: Use CPG/MSTP Clock Domain attach/detach helpers
Date: Thu, 24 Sep 2015 14:30:20 +0900	[thread overview]
Message-ID: <8b98d74780ab70147d40400c36059c16c1aea4da.1443072491.git.horms+renesas@verge.net.au> (raw)
In-Reply-To: <cover.1443072491.git.horms+renesas@verge.net.au>

From: Geert Uytterhoeven <geert+renesas@glider.be>

The R-Mobile PM Domain driver manages both power domains and a clock
domain.

The clock domain part is very similar to the CPG/MSTP Clock Domain,
which is used on shmobile SoCs without device power domains, except for
the way how clocks suitable for power management are selected:
  - The former uses the first clock tied to the device through the NULL
    con_id, which is a relic from the legacy pm_clk_notifier-based
    method in drivers/sh/pm_runtime.c,
  - The latter looks for suitable clocks in DT, which is more
    future-proof.

All platforms using this driver are now supported in DT-based ARM
multi-platform builds only, hence switch to using the CPG/MSTP Clock
Domain helpers.

Signed-off-by: Geert Uytterhoeven <geert+renesas@glider.be>
Reviewed-by: Ulf Hansson <ulf.hansson@linaro.org>
Signed-off-by: Simon Horman <horms+renesas@verge.net.au>
---
 arch/arm/mach-shmobile/pm-rmobile.c | 35 +++--------------------------------
 1 file changed, 3 insertions(+), 32 deletions(-)

diff --git a/arch/arm/mach-shmobile/pm-rmobile.c b/arch/arm/mach-shmobile/pm-rmobile.c
index a5b96b990aea..89068c8ec50f 100644
--- a/arch/arm/mach-shmobile/pm-rmobile.c
+++ b/arch/arm/mach-shmobile/pm-rmobile.c
@@ -12,6 +12,7 @@
  * License.  See the file "COPYING" in the main directory of this archive
  * for more details.
  */
+#include <linux/clk/shmobile.h>
 #include <linux/console.h>
 #include <linux/delay.h>
 #include <linux/of.h>
@@ -124,36 +125,6 @@ static bool rmobile_pd_active_wakeup(struct device *dev)
 	return true;
 }
 
-static int rmobile_pd_attach_dev(struct generic_pm_domain *domain,
-				 struct device *dev)
-{
-	int error;
-
-	error = pm_clk_create(dev);
-	if (error) {
-		dev_err(dev, "pm_clk_create failed %d\n", error);
-		return error;
-	}
-
-	error = pm_clk_add(dev, NULL);
-	if (error) {
-		dev_err(dev, "pm_clk_add failed %d\n", error);
-		goto fail;
-	}
-
-	return 0;
-
-fail:
-	pm_clk_destroy(dev);
-	return error;
-}
-
-static void rmobile_pd_detach_dev(struct generic_pm_domain *domain,
-				  struct device *dev)
-{
-	pm_clk_destroy(dev);
-}
-
 static void rmobile_init_pm_domain(struct rmobile_pm_domain *rmobile_pd)
 {
 	struct generic_pm_domain *genpd = &rmobile_pd->genpd;
@@ -164,8 +135,8 @@ static void rmobile_init_pm_domain(struct rmobile_pm_domain *rmobile_pd)
 	genpd->dev_ops.active_wakeup	= rmobile_pd_active_wakeup;
 	genpd->power_off		= rmobile_pd_power_down;
 	genpd->power_on			= rmobile_pd_power_up;
-	genpd->attach_dev		= rmobile_pd_attach_dev;
-	genpd->detach_dev		= rmobile_pd_detach_dev;
+	genpd->attach_dev		= cpg_mstp_attach_dev;
+	genpd->detach_dev		= cpg_mstp_detach_dev;
 	__rmobile_pd_power_up(rmobile_pd, false);
 }
 
-- 
2.1.4

  reply	other threads:[~2015-09-24  5:30 UTC|newest]

Thread overview: 156+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2014-04-16  6:03 [GIT PULL] Renesas ARM Based SoC Updates for v3.16 Simon Horman
2014-04-16  6:03 ` Simon Horman
2014-04-16  6:03 ` [PATCH 1/8] ARM: shmobile: Update r8a7791 CPU freq to 1500MHz in C Simon Horman
2014-04-16  6:03   ` Simon Horman
2014-04-16  6:03 ` [PATCH 2/8] ARM: shmobile: Add shared shmobile_init_delay() Simon Horman
2014-04-16  6:03   ` Simon Horman
2014-04-16  6:03 ` [PATCH 3/8] ARM: shmobile: Remove legacy EMEV2 SoC support Simon Horman
2014-04-16  6:03   ` Simon Horman
2014-04-16  6:03 ` [PATCH 4/8] ARM: shmobile: Remove EMEV2 header file Simon Horman
2014-04-16  6:03   ` Simon Horman
2014-04-16  6:03 ` [PATCH 5/8] ARM: shmobile: Make use of r8a7790_add_standard_devices() Simon Horman
2014-04-16  6:03   ` Simon Horman
2014-04-16  6:03 ` [PATCH 6/8] ARM: shmobile: rcar-gen2: Cache Mode Monitor Register Value Simon Horman
2014-04-16  6:03   ` Simon Horman
2014-04-16  6:03 ` [PATCH 7/8] ARM: shmobile: Check r8a7791 MD21 at SMP boot Simon Horman
2014-04-16  6:03   ` Simon Horman
2014-04-16  6:03 ` [PATCH 8/8] ARM: shmobile: r8a7778/bockw: Move "select RENESAS_INTC_IRQPIN" under SoC Simon Horman
2014-04-16  6:03   ` Simon Horman
2014-05-05 20:45 ` [GIT PULL] Renesas ARM Based SoC Updates for v3.16 Olof Johansson
2014-05-05 20:45   ` Olof Johansson
2014-06-25  7:35 ` [GIT PULL] Renesas ARM Based SoC Updates for v3.17 Simon Horman
2014-06-25  7:35   ` Simon Horman
2014-06-25  7:35   ` [PATCH 01/14] ARM: shmobile: r8a7791 SYSC setup code Simon Horman
2014-06-25  7:35     ` Simon Horman
2014-06-25  7:35   ` [PATCH 02/14] ARM: shmobile: APMU: Add Core-Standby-state for Suspend to RAM Simon Horman
2014-06-25  7:35     ` Simon Horman
2014-06-25  7:35   ` [PATCH 03/14] ARM: shmobile: r8a7790: Support Core-Standby " Simon Horman
2014-06-25  7:35     ` Simon Horman
2014-06-25  7:35   ` [PATCH 04/14] ARM: shmobile: r8a7791: " Simon Horman
2014-06-25  7:35     ` Simon Horman
2014-06-25  7:35   ` [PATCH 05/14] ARM: shmobile: Mark all SoCs in shmobile as CPUFreq, capable Simon Horman
2014-06-25  7:35     ` Simon Horman
2014-06-25  8:56     ` Viresh Kumar
2014-06-25  8:56       ` Viresh Kumar
2014-06-25  9:26       ` Simon Horman
2014-06-25  9:26         ` Simon Horman
2014-06-25  9:30         ` Viresh Kumar
2014-06-25  9:42           ` Viresh Kumar
2014-06-25 11:38           ` Simon Horman
2014-06-25 11:38             ` Simon Horman
2014-06-25 11:39             ` Viresh Kumar
2014-06-25 11:51               ` Viresh Kumar
2014-06-25 12:23               ` Simon Horman
2014-06-25 12:23                 ` Simon Horman
2014-06-26  1:48         ` Gaku Inami
2014-06-26  1:48           ` Gaku Inami
2014-06-25  7:35   ` [PATCH 06/14] ARM: shmobile: Use shmobile_init_late() on r8a7790 DT-only Simon Horman
2014-06-25  7:35     ` Simon Horman
2014-06-25  7:35   ` [PATCH 07/14] ARM: shmobile: Use shmobile_init_late() on r8a7791 DT-only Simon Horman
2014-06-25  7:35     ` Simon Horman
2014-06-25  7:35   ` [PATCH 08/14] ARM: shmobile: Add shared R-Car Gen2 CMA reservation code Simon Horman
2014-06-25  7:35     ` Simon Horman
2014-06-25 15:18     ` Sergei Shtylyov
2014-06-25 15:18       ` Sergei Shtylyov
2014-06-25 23:47       ` Simon Horman
2014-06-25 23:47         ` Simon Horman
2014-06-26  0:19         ` Simon Horman
2014-06-26  0:19           ` Simon Horman
2014-06-25  7:35   ` [PATCH 09/14] ARM: shmobile: rcar-gen2: Update for of_get_flat_dt_prop() update Simon Horman
2014-06-25  7:35     ` Simon Horman
2014-06-25  7:35   ` [PATCH 10/14] ARM: shmobile: rcar-gen2: Use "1ULL" instead of "(u64)1" Simon Horman
2014-06-25  7:35     ` Simon Horman
2014-06-25  7:35   ` [PATCH 11/14] ARM: shmobile: rcar-gen2: Remove useless copied section for LongTrail Simon Horman
2014-06-25  7:35     ` Simon Horman
2014-06-25  7:35   ` [PATCH 12/14] ARM: shmobile: rcar-gen2: correct return value of shmobile_smp_apmu_suspend_init Simon Horman
2014-06-25  7:35     ` Simon Horman
2014-06-25  7:35   ` [PATCH 13/14] ARM: shmobile: rcar-gen2: update call to dma_contiguous_reserve_area Simon Horman
2014-06-25  7:35     ` Simon Horman
2014-06-25  7:35   ` [PATCH 14/14] ARM: shmobile: Remove ARCH_HAS_CPUFREQ config for shmobile Simon Horman
2014-06-25  7:35     ` Simon Horman
2014-07-08  5:07   ` [GIT PULL] Renesas ARM Based SoC Updates for v3.17 Olof Johansson
2014-07-08  5:07     ` Olof Johansson
2014-07-11  9:40     ` Simon Horman
2014-07-11  9:40       ` Simon Horman
2014-08-23  1:44 ` [GIT PULL] Renesas ARM Based SoC Updates for v3.18 Simon Horman
2014-08-23  1:44   ` Simon Horman
2014-08-23  1:44   ` [PATCH 01/11] ARM: shmobile: r8a7778: Add missing call to shmobile_init_late() Simon Horman
2014-08-23  1:44     ` Simon Horman
2014-08-23  1:44   ` [PATCH 02/11] ARM: shmobile: sh73a0: Add shmobile_init_late() Simon Horman
2014-08-23  1:44     ` Simon Horman
2014-08-23  1:44   ` [PATCH 03/11] ARM: shmobile: r8a7779: Fix shmobile_init_late() Simon Horman
2014-08-23  1:44     ` Simon Horman
2014-08-23  1:44   ` [PATCH 04/11] ARM: shmobile: r8a7778: " Simon Horman
2014-08-23  1:44     ` Simon Horman
2014-08-23  1:44   ` [PATCH 05/11] ARM: shmobile: r8a73a4: Add shmobile_init_late() Simon Horman
2014-08-23  1:44     ` Simon Horman
2014-08-23  1:44   ` [PATCH 06/11] ARM: shmobile: r7s72100: " Simon Horman
2014-08-23  1:44     ` Simon Horman
2014-08-23  1:44   ` [PATCH 07/11] ARM: shmobile: Rework multiplatform include workaround Simon Horman
2014-08-23  1:44     ` Simon Horman
2014-08-23  1:44   ` [PATCH 08/11] ARM: shmobile: dma: Use defines instead of hardcoded numbers Simon Horman
2014-08-23  1:44     ` Simon Horman
2014-08-23  1:44   ` [PATCH 09/11] ARM: shmobile: r8a7779: Remove NR_IRQS_LEGACY Simon Horman
2014-08-23  1:44     ` Simon Horman
2014-08-23  1:44   ` [PATCH 10/11] ARM: shmobile: sh7372: Remove unneeded nr_irqs initialization Simon Horman
2014-08-23  1:44     ` Simon Horman
2014-08-23  1:44   ` [PATCH 11/11] ARM: shmobile: sh73a0: " Simon Horman
2014-08-23  1:44     ` Simon Horman
2014-08-25  0:41   ` [GIT PULL] Renesas ARM Based SoC Updates for v3.18 Simon Horman
2014-08-25  0:41     ` Simon Horman
2014-12-29  1:47 ` [GIT PULL] Renesas ARM Based SoC Updates for v3.20 Simon Horman
2014-12-29  1:47   ` Simon Horman
2014-12-29  1:47   ` [PATCH 1/4] ARM: shmobile: sh73a0 legacy/reference: Add missing INTCA0 clock for irqpin module Simon Horman
2014-12-29  1:47     ` Simon Horman
2014-12-29  1:47   ` [PATCH 2/4] ARM: shmobile: Fix is_e2 warning Simon Horman
2014-12-29  1:47     ` Simon Horman
2014-12-29  1:47   ` [PATCH 3/4] ARM: shmobile: r8a7779: No TWD setup in C for Multiplatform Simon Horman
2014-12-29  1:47     ` Simon Horman
2014-12-29  1:47   ` [PATCH 4/4] ARM: shmobile: r8a73a4: Multiplatform support Simon Horman
2014-12-29  1:47     ` Simon Horman
2015-01-12 22:37   ` [GIT PULL] Renesas ARM Based SoC Updates for v3.20 Olof Johansson
2015-01-12 22:37     ` Olof Johansson
2015-02-26  6:22 ` [GIT PULL] Renesas ARM Based SoC Updates for v4.1 Simon Horman
2015-02-26  6:22   ` Simon Horman
2015-02-26  6:22   ` [PATCH 1/5] ARM: shmobile: No R-Car Gen2 CMA reservation when HIGHMEM=n Simon Horman
2015-02-26  6:22     ` Simon Horman
2015-02-26  6:22   ` [PATCH 2/5] ARM: shmobile: R-Car Gen2: CONFIG_COMMON_CLK is always set Simon Horman
2015-02-26  6:22     ` Simon Horman
2015-02-26  6:22   ` [PATCH 3/5] ARM: shmobile: Add function to get SoCs revision data for R-Car Gen2 Simon Horman
2015-02-26  6:22     ` Simon Horman
2015-02-26  6:22   ` [PATCH 4/5] ARM: shmobile: Add support SOC_BUS to " Simon Horman
2015-02-26  6:22     ` Simon Horman
2015-02-26 15:53     ` Arnd Bergmann
2015-02-26 15:53       ` Arnd Bergmann
2015-02-27  0:52       ` Simon Horman
2015-02-27  0:52         ` Simon Horman
2015-02-27  9:00         ` Arnd Bergmann
2015-02-27  9:00           ` Arnd Bergmann
2015-02-27 10:41           ` Geert Uytterhoeven
2015-02-27 10:41             ` Geert Uytterhoeven
2015-02-27 13:44             ` Arnd Bergmann
2015-02-27 13:44               ` Arnd Bergmann
2015-03-01  1:52           ` Simon Horman
2015-03-01  1:52             ` Simon Horman
2015-02-26  6:22   ` [PATCH 5/5] ARM: shmobile: r8a7740: Remove restart callback Simon Horman
2015-02-26  6:22     ` Simon Horman
2015-05-28  1:05 ` [GIT PULL] Renesas ARM Based SoC Updates for v4.2 Simon Horman
2015-05-28  1:05   ` Simon Horman
2015-05-28  1:05   ` [PATCH] ARM: shmobile: only select sound drivers that build Simon Horman
2015-05-28  1:05     ` Simon Horman
2015-05-29 14:24   ` [GIT PULL] Renesas ARM Based SoC Updates for v4.2 Arnd Bergmann
2015-05-29 14:24     ` Arnd Bergmann
2015-07-24  8:41 ` [GIT PULL] Renesas ARM Based SoC Updates for v4.3 Simon Horman
2015-07-24  8:41   ` Simon Horman
2015-07-24  8:41   ` [PATCH 1/2] ARM: shmobile: Basic r8a7793 SoC support Simon Horman
2015-07-24  8:41     ` Simon Horman
2015-07-24  8:41   ` [PATCH 2/2] ARM: shmobile: gose: enable R-Car Gen2 regulator quirk Simon Horman
2015-07-24  8:41     ` Simon Horman
2015-07-27 12:35   ` [GIT PULL] Renesas ARM Based SoC Updates for v4.3 Olof Johansson
2015-07-27 12:35     ` Olof Johansson
2015-09-24  5:30 ` [GIT PULL] Renesas ARM Based SoC Updates for v4.4 Simon Horman
2015-09-24  5:30   ` Simon Horman
2015-09-24  5:30   ` Simon Horman [this message]
2015-09-24  5:30     ` [PATCH] ARM: shmobile: R-Mobile: Use CPG/MSTP Clock Domain attach/detach helpers Simon Horman
2015-10-06 14:43   ` [GIT PULL] Renesas ARM Based SoC Updates for v4.4 Arnd Bergmann
2015-10-06 14:43     ` Arnd Bergmann

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=8b98d74780ab70147d40400c36059c16c1aea4da.1443072491.git.horms+renesas@verge.net.au \
    --to=horms+renesas@verge.net.au \
    --cc=linux-arm-kernel@lists.infradead.org \
    /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.