Commit b13b2330 authored by Marek Szyprowski's avatar Marek Szyprowski Committed by Krzysztof Kozlowski

soc: samsung: pm_domains: Read domain name from the new label property

Device tree nodes for each power domain should use generic "power-domain"
name, so using it as a domain name doesn't give much benefits. This patch
adds support for human readable names defined in 'label' property. Such
names are visible to userspace and makes debugging much easier. When no
'label' property is found, driver keeps using the name constructed from
full node name.
Suggested-by: default avatarKrzysztof Kozlowski <krzk@kernel.org>
Signed-off-by: default avatarMarek Szyprowski <m.szyprowski@samsung.com>
Signed-off-by: default avatarKrzysztof Kozlowski <krzk@kernel.org>
parent d1a09872
...@@ -12,6 +12,8 @@ Required Properties: ...@@ -12,6 +12,8 @@ Required Properties:
must be 0. must be 0.
Optional Properties: Optional Properties:
- label: Human readable string with domain name. Will be visible in userspace
to let user to distinguish between multiple domains in SoC.
- clocks: List of clock handles. The parent clocks of the input clocks to the - clocks: List of clock handles. The parent clocks of the input clocks to the
devices in this power domain are set to oscclk before power gating devices in this power domain are set to oscclk before power gating
and restored back after powering on a domain. This is required for and restored back after powering on a domain. This is required for
...@@ -38,6 +40,7 @@ Example: ...@@ -38,6 +40,7 @@ Example:
compatible = "samsung,exynos4210-pd"; compatible = "samsung,exynos4210-pd";
reg = <0x10023C00 0x10>; reg = <0x10023C00 0x10>;
#power-domain-cells = <0>; #power-domain-cells = <0>;
label = "LCD0";
}; };
mfc_pd: power-domain@10044060 { mfc_pd: power-domain@10044060 {
...@@ -46,6 +49,7 @@ Example: ...@@ -46,6 +49,7 @@ Example:
clocks = <&clock CLK_FIN_PLL>, <&clock CLK_MOUT_USER_ACLK333>; clocks = <&clock CLK_FIN_PLL>, <&clock CLK_MOUT_USER_ACLK333>;
clock-names = "oscclk", "clk0"; clock-names = "oscclk", "clk0";
#power-domain-cells = <0>; #power-domain-cells = <0>;
label = "MFC";
}; };
See Documentation/devicetree/bindings/power/power_domain.txt for description See Documentation/devicetree/bindings/power/power_domain.txt for description
......
...@@ -135,6 +135,15 @@ static const struct of_device_id exynos_pm_domain_of_match[] __initconst = { ...@@ -135,6 +135,15 @@ static const struct of_device_id exynos_pm_domain_of_match[] __initconst = {
{ }, { },
}; };
static __init const char *exynos_get_domain_name(struct device_node *node)
{
const char *name;
if (of_property_read_string(node, "label", &name) < 0)
name = strrchr(node->full_name, '/') + 1;
return kstrdup_const(name, GFP_KERNEL);
}
static __init int exynos4_pm_init_power_domain(void) static __init int exynos4_pm_init_power_domain(void)
{ {
struct device_node *np; struct device_node *np;
...@@ -152,8 +161,7 @@ static __init int exynos4_pm_init_power_domain(void) ...@@ -152,8 +161,7 @@ static __init int exynos4_pm_init_power_domain(void)
of_node_put(np); of_node_put(np);
return -ENOMEM; return -ENOMEM;
} }
pd->pd.name = kstrdup_const(strrchr(np->full_name, '/') + 1, pd->pd.name = exynos_get_domain_name(np);
GFP_KERNEL);
if (!pd->pd.name) { if (!pd->pd.name) {
kfree(pd); kfree(pd);
of_node_put(np); of_node_put(np);
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment