Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]
Groups > linux.kernel > #1199787
| From | Geert Uytterhoeven <geert+renesas@glider.be> |
|---|---|
| Newsgroups | linux.kernel |
| Subject | [PATCH v4 16/16] ARM: shmobile: R-Mobile: Use CPG/MSTP Clock Domain attach/detach helpers |
| Date | 2015-08-04 14:40 +0200 |
| Message-ID | <pTJFE-2bp-27@gated-at.bofh.it> (permalink) |
| References | <pTJvX-1ZY-7@gated-at.bofh.it> |
| Organization | linux.* mail to news gateway |
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>
---
v4:
- Add Reviewed-by,
v3:
- Drop -legacy support, hence this patch depends on r8a7740/sh73a0
legacy removal,
- Use "CPG/MSTP Clock Domain" instead of "CPG Clock Domain",
v2:
- New.
---
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 a5b96b990aea8dfc..89068c8ec50f2c76 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);
}
--
1.9.1
--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@vger.kernel.org
More majordomo info at http://vger.kernel.org/majordomo-info.html
Please read the FAQ at http://www.tux.org/lkml/
Back to linux.kernel | Previous | Next — Previous in thread | Next in thread | Find similar | Unroll thread
[PATCH v4 00/16] ARM: shmobile: Add CPG/MSTP Clock Domain Geert Uytterhoeven <geert+renesas@glider.be> - 2015-08-04 14:40 +0200
[PATCH v4 11/16] ARM: shmobile: r8a7793 dtsi: Add CPG/MSTP Clock Domain Geert Uytterhoeven <geert+renesas@glider.be> - 2015-08-04 14:40 +0200
[PATCH v4 01/16] clk: shmobile: Add CPG/MSTP Clock Domain support Geert Uytterhoeven <geert+renesas@glider.be> - 2015-08-04 14:40 +0200
[PATCH v4 12/16] ARM: shmobile: r8a7794 dtsi: Add CPG/MSTP Clock Domain Geert Uytterhoeven <geert+renesas@glider.be> - 2015-08-04 14:40 +0200
[PATCH v4 06/16] ARM: shmobile: r7s72100 dtsi: Add CPG/MSTP Clock Domain Geert Uytterhoeven <geert+renesas@glider.be> - 2015-08-04 14:40 +0200
[PATCH v4 16/16] ARM: shmobile: R-Mobile: Use CPG/MSTP Clock Domain attach/detach helpers Geert Uytterhoeven <geert+renesas@glider.be> - 2015-08-04 14:40 +0200
[PATCH v4 02/16] clk: shmobile: r8a7778: Add CPG/MSTP Clock Domain support Geert Uytterhoeven <geert+renesas@glider.be> - 2015-08-04 14:40 +0200
[PATCH v4 07/16] ARM: shmobile: r8a7778 dtsi: Add CPG/MSTP Clock Domain Geert Uytterhoeven <geert+renesas@glider.be> - 2015-08-04 14:40 +0200
Re: [PATCH v4 00/16] ARM: shmobile: Add CPG/MSTP Clock Domain Simon Horman <horms@verge.net.au> - 2015-08-04 15:50 +0200
Re: [PATCH v4 00/16] ARM: shmobile: Add CPG/MSTP Clock Domain Simon Horman <horms@verge.net.au> - 2015-08-05 03:00 +0200
Re: [PATCH v4 00/16] ARM: shmobile: Add CPG/MSTP Clock Domain Geert Uytterhoeven <geert@linux-m68k.org> - 2015-08-05 09:00 +0200
Re: [PATCH v4 00/16] ARM: shmobile: Add CPG/MSTP Clock Domain Simon Horman <horms@verge.net.au> - 2015-08-06 03:00 +0200
csiph-web