aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--Documentation/devicetree/bindings/power/pd-samsung.txt4
-rw-r--r--drivers/soc/samsung/pm_domains.c12
2 files changed, 14 insertions, 2 deletions
diff --git a/Documentation/devicetree/bindings/power/pd-samsung.txt b/Documentation/devicetree/bindings/power/pd-samsung.txt
index 4e947372a693..c461b1090cb6 100644
--- a/Documentation/devicetree/bindings/power/pd-samsung.txt
+++ b/Documentation/devicetree/bindings/power/pd-samsung.txt
@@ -12,6 +12,8 @@ Required Properties:
12 must be 0. 12 must be 0.
13 13
14Optional Properties: 14Optional Properties:
15- label: Human readable string with domain name. Will be visible in userspace
16 to let user to distinguish between multiple domains in SoC.
15- clocks: List of clock handles. The parent clocks of the input clocks to the 17- clocks: List of clock handles. The parent clocks of the input clocks to the
16 devices in this power domain are set to oscclk before power gating 18 devices in this power domain are set to oscclk before power gating
17 and restored back after powering on a domain. This is required for 19 and restored back after powering on a domain. This is required for
@@ -38,6 +40,7 @@ Example:
38 compatible = "samsung,exynos4210-pd"; 40 compatible = "samsung,exynos4210-pd";
39 reg = <0x10023C00 0x10>; 41 reg = <0x10023C00 0x10>;
40 #power-domain-cells = <0>; 42 #power-domain-cells = <0>;
43 label = "LCD0";
41 }; 44 };
42 45
43 mfc_pd: power-domain@10044060 { 46 mfc_pd: power-domain@10044060 {
@@ -46,6 +49,7 @@ Example:
46 clocks = <&clock CLK_FIN_PLL>, <&clock CLK_MOUT_USER_ACLK333>; 49 clocks = <&clock CLK_FIN_PLL>, <&clock CLK_MOUT_USER_ACLK333>;
47 clock-names = "oscclk", "clk0"; 50 clock-names = "oscclk", "clk0";
48 #power-domain-cells = <0>; 51 #power-domain-cells = <0>;
52 label = "MFC";
49 }; 53 };
50 54
51See Documentation/devicetree/bindings/power/power_domain.txt for description 55See Documentation/devicetree/bindings/power/power_domain.txt for description
diff --git a/drivers/soc/samsung/pm_domains.c b/drivers/soc/samsung/pm_domains.c
index 0649024fce09..31270171f23d 100644
--- a/drivers/soc/samsung/pm_domains.c
+++ b/drivers/soc/samsung/pm_domains.c
@@ -135,6 +135,15 @@ static const struct of_device_id exynos_pm_domain_of_match[] __initconst = {
135 { }, 135 { },
136}; 136};
137 137
138static __init const char *exynos_get_domain_name(struct device_node *node)
139{
140 const char *name;
141
142 if (of_property_read_string(node, "label", &name) < 0)
143 name = strrchr(node->full_name, '/') + 1;
144 return kstrdup_const(name, GFP_KERNEL);
145}
146
138static __init int exynos4_pm_init_power_domain(void) 147static __init int exynos4_pm_init_power_domain(void)
139{ 148{
140 struct device_node *np; 149 struct device_node *np;
@@ -152,8 +161,7 @@ static __init int exynos4_pm_init_power_domain(void)
152 of_node_put(np); 161 of_node_put(np);
153 return -ENOMEM; 162 return -ENOMEM;
154 } 163 }
155 pd->pd.name = kstrdup_const(strrchr(np->full_name, '/') + 1, 164 pd->pd.name = exynos_get_domain_name(np);
156 GFP_KERNEL);
157 if (!pd->pd.name) { 165 if (!pd->pd.name) {
158 kfree(pd); 166 kfree(pd);
159 of_node_put(np); 167 of_node_put(np);