Renesas ARM Based SoC Updates for v4.4

* ARM: shmobile: R-Mobile: Use CPG/MSTP Clock Domain attach/detach helpers
 
   This part of a multi-stage effort by Geert Uytterhoeven to add:
 
   "Clock Domain support to the Clock Pulse Generator (CPG) Module Stop
    (MSTP) Clocks driver using the generic PM Domain, to be used on shmobile
    SoCs without device power domains (R-Car Gen1 and Gen2, RZ).  This allows
    to power-manage the module clocks of SoC devices that are part of the
    CPG/MSTP Clock Domain using Runtime PM, or for system suspend/resume,
    similar to SoCs with device power domains (SH-Mobile and R-Mobile)."
 -----BEGIN PGP SIGNATURE-----
 Version: GnuPG v1
 
 iQIcBAABAgAGBQJWA4njAAoJENfPZGlqN0++ITEP/1MoqyaFaipwQf0FMsDd8z2b
 9T0o/fWHYIhP3dUayutrzmSrdi9GX8QzJPYEaJ7j6nLN3RZn0RdRWfUVKpFwg6m/
 n/zoFPvmmDB4Q4cmG2bOylZnpoTKreX/5xtSAQD4EJTlHs7yxmQpYVW3RIQ0Ui/f
 vc/eimChi3Y0I9nHYSU2esnvPPEmRjH7hLkNjIm6AAhmosH86S5lhDfgIB4LYd0V
 C3go7b6hPAeiUKhjeajDSsHAXhgb7yt43UePb4/8qWBdrngcfnvXXebJo1mkLNQW
 PB1UV8Xc5ZKQAWPe5+gSJRWZkOu0liI2O0kuNMkLBNpxhuNMEZPzIbT0kvDPPHiM
 kYuT1m9aNRgtvDMDT8Yl6EEGp89EvGrxIClXsjv3GzvOV46zrDWaVY2JD752ZXyf
 z8khxJqQfC+pqFFTWtTfjTkcvKTcqnKh12oKWpSPixqZaVApGNLV3meZtBgGo2VH
 6FFIw4UBLJWehBzbMabrDLoBeDtjTsPSTO+GWUFachtC3BBAUjFgE0mGwlDUk74V
 e9kki/su1xrQkDW+vtXVPuIJcR7+ZZHH/esFWxjNL8PmG6dysXZC32R1VFEE/8NQ
 1p4kFOjDcriMYgIdxZMjFzaGneIOtQv0qsiT293eeL4HNn6IFFOTUay0Ro3gDbcK
 rV2IMYuvaFZoAXh9evw8
 =OvKg
 -----END PGP SIGNATURE-----

Merge tag 'renesas-soc-for-v4.4' of git://git.kernel.org/pub/scm/linux/kernel/git/horms/renesas into next/soc

Merge "Renesas ARM Based SoC Updates for v4.4" from Simon Horman:

* ARM: shmobile: R-Mobile: Use CPG/MSTP Clock Domain attach/detach helpers

  This part of a multi-stage effort by Geert Uytterhoeven to add:

  "Clock Domain support to the Clock Pulse Generator (CPG) Module Stop
   (MSTP) Clocks driver using the generic PM Domain, to be used on shmobile
   SoCs without device power domains (R-Car Gen1 and Gen2, RZ).  This allows
   to power-manage the module clocks of SoC devices that are part of the
   CPG/MSTP Clock Domain using Runtime PM, or for system suspend/resume,
   similar to SoCs with device power domains (SH-Mobile and R-Mobile)."

* tag 'renesas-soc-for-v4.4' of git://git.kernel.org/pub/scm/linux/kernel/git/horms/renesas:
  ARM: shmobile: R-Mobile: Use CPG/MSTP Clock Domain attach/detach helpers
  clk: shmobile: mstp: Consider "zb_clk" suitable for power management
This commit is contained in:
Arnd Bergmann 2015-10-06 16:42:07 +02:00
Родитель 049e6dde7e 8b98d74780
Коммит 6468527318
2 изменённых файлов: 7 добавлений и 32 удалений

Просмотреть файл

@ -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);
}

Просмотреть файл

@ -259,6 +259,10 @@ int cpg_mstp_attach_dev(struct generic_pm_domain *domain, struct device *dev)
"renesas,cpg-mstp-clocks"))
goto found;
/* BSC on r8a73a4/sh73a0 uses zb_clk instead of an mstp clock */
if (!strcmp(clkspec.np->name, "zb_clk"))
goto found;
of_node_put(clkspec.np);
i++;
}