Skip to content

Commit

Permalink
ARM: EXYNOS: add support for sub-power domains
Browse files Browse the repository at this point in the history
This patch adds support for making one power domain a sub-domain of
other domain. This is useful for modeling power dependences for devices
like TV Mixer or Camera ISP, which needs to have more than one power
domain enabled to be operational.

Based on previous work by Amit Daniel Kachhap <amit.daniel@samsung.com>.

Signed-off-by: Marek Szyprowski <m.szyprowski@samsung.com>
Reviewed-by: Ulf Hansson <ulf.hansson@linaro.org>
Signed-off-by: Kukjin Kim <kgene@kernel.org>
  • Loading branch information
mszyprow authored and Kukjin Kim committed Feb 26, 2015
1 parent dbe6754 commit 0f78075
Show file tree
Hide file tree
Showing 2 changed files with 30 additions and 0 deletions.
2 changes: 2 additions & 0 deletions Documentation/devicetree/bindings/arm/exynos/power_domain.txt
Original file line number Diff line number Diff line change
Expand Up @@ -22,6 +22,8 @@ Optional Properties:
- pclkN, clkN: Pairs of parent of input clock and input clock to the
devices in this power domain. Maximum of 4 pairs (N = 0 to 3)
are supported currently.
- power-domains: phandle pointing to the parent power domain, for more details
see Documentation/devicetree/bindings/power/power_domain.txt

Node of a device using power domains must have a power-domains property
defined with a phandle to respective power domain.
Expand Down
28 changes: 28 additions & 0 deletions arch/arm/mach-exynos/pm_domains.c
Original file line number Diff line number Diff line change
Expand Up @@ -161,6 +161,34 @@ static __init int exynos4_pm_init_power_domain(void)
of_genpd_add_provider_simple(np, &pd->pd);
}

/* Assign the child power domains to their parents */
for_each_compatible_node(np, NULL, "samsung,exynos4210-pd") {
struct generic_pm_domain *child_domain, *parent_domain;
struct of_phandle_args args;

args.np = np;
args.args_count = 0;
child_domain = of_genpd_get_from_provider(&args);
if (!child_domain)
continue;

if (of_parse_phandle_with_args(np, "power-domains",
"#power-domain-cells", 0, &args) != 0)
continue;

parent_domain = of_genpd_get_from_provider(&args);
if (!parent_domain)
continue;

if (pm_genpd_add_subdomain(parent_domain, child_domain))
pr_warn("%s failed to add subdomain: %s\n",
parent_domain->name, child_domain->name);
else
pr_info("%s has as child subdomain: %s.\n",
parent_domain->name, child_domain->name);
of_node_put(np);
}

return 0;
}
arch_initcall(exynos4_pm_init_power_domain);

0 comments on commit 0f78075

Please sign in to comment.