ARM: exynos: Move to generic PM domain DT bindings
Tomasz Figa [Fri, 19 Sep 2014 18:27:43 +0000 (20:27 +0200)]
This patch moves Exynos PM domain code to use the new generic PM domain
look-up framework introduced in previous patches, thus also allowing
the new code to be compiled with CONFIG_ARCH_EXYNOS.

This patch was originally submitted by Tomasz Figa when he was employed
by Samsung.

Link: http://marc.info/?l=linux-pm&m=139955336002083&w=2
Signed-off-by: Ulf Hansson <ulf.hansson@linaro.org>
Reviewed-by: Kevin Hilman <khilman@linaro.org>
Reviewed-by: Dmitry Torokhov <dmitry.torokhov@gmail.com>
Signed-off-by: Rafael J. Wysocki <rafael.j.wysocki@intel.com>

Conflicts:

Documentation/devicetree/bindings/arm/exynos/power_domain.txt
arch/arm/mach-exynos/pm_domains.c

Change-Id: I905669bca3d51c4b91a7525cb45c76f47d257c0f
Signed-off-by: Prashant Gaikwad <pgaikwad@nvidia.com>
Reviewed-on: http://git-master/r/660541
Reviewed-by: Bharat Nihalani <bnihalani@nvidia.com>

Documentation/devicetree/bindings/arm/exynos/power_domain.txt
arch/arm/mach-exynos/pm_domains.c
kernel/power/Kconfig

index 5216b41..1419ed2 100644 (file)
@@ -8,6 +8,8 @@ Required Properties:
     * samsung,exynos4210-pd - for exynos4210 type power domain.
 - reg: physical base address of the controller and length of memory mapped
     region.
+- #power-domain-cells: number of cells in power domain specifier;
+    must be 0.
 
 Node of a device using power domains must have a samsung,power-domain property
 defined with a phandle to respective power domain.
@@ -17,12 +19,19 @@ Example:
        lcd0: power-domain-lcd0 {
                compatible = "samsung,exynos4210-pd";
                reg = <0x10023C00 0x10>;
+               #power-domain-cells = <0>;
        };
 
 Example of the node using power domain:
 
-       node {
-               /* ... */
-               samsung,power-domain = <&lcd0>;
-               /* ... */
+       mfc_pd: power-domain@10044060 {
+               compatible = "samsung,exynos4210-pd";
+               reg = <0x10044060 0x20>;
+               clocks = <&clock CLK_FIN_PLL>, <&clock CLK_MOUT_SW_ACLK333>,
+                       <&clock CLK_MOUT_USER_ACLK333>;
+               clock-names = "oscclk", "pclk0", "clk0";
+               #power-domain-cells = <0>;
        };
+
+See Documentation/devicetree/bindings/power/power_domain.txt for description
+of consumer-side bindings.
index 9f1351d..74fa44d 100644 (file)
@@ -180,17 +180,15 @@ static __init int exynos_pm_dt_parse_domains(void)
                pd->base = of_iomap(np, 0);
                pd->pd.power_off = exynos_pd_power_off;
                pd->pd.power_on = exynos_pd_power_on;
-               pd->pd.of_node = np;
 
                platform_set_drvdata(pdev, pd);
 
                on = __raw_readl(pd->base + 0x4) & S5P_INT_LOCAL_PWR_EN;
 
                pm_genpd_init(&pd->pd, NULL, !on);
+               of_genpd_add_provider_simple(np, &pd->pd);
        }
 
-       bus_register_notifier(&platform_bus_type, &platform_nb);
-
        return 0;
 }
 #else
index 6e2a3fd..f9fe630 100644 (file)
@@ -293,7 +293,7 @@ config PM_GENERIC_DOMAINS_RUNTIME
 
 config PM_GENERIC_DOMAINS_OF
        def_bool y
-       depends on PM_GENERIC_DOMAINS && OF && !ARCH_EXYNOS
+       depends on PM_GENERIC_DOMAINS && OF
 
 config CPU_PM
        bool