forked from luck/tmp_suning_uos_patched
ARM: EXYNOS: register power domain driver from core_initcall
SYSMMU devices are registered very early in arch_initcall, so ensure that they can get access to power domains by registering power domain driver from earlier initcall. This change requires dropping usage of the platform device associated with each power domain and replacing clock calls with respective of_clk_* equivalents. Signed-off-by: Marek Szyprowski <m.szyprowski@samsung.com> Reviewed-by: Krzysztof Kozlowski <k.kozlowski@samsung.com> Signed-off-by: Kukjin Kim <kgene@kernel.org>
This commit is contained in:
parent
c4241a582d
commit
2be2a3ff42
@ -121,22 +121,11 @@ static int exynos_pd_power_off(struct generic_pm_domain *domain)
|
|||||||
|
|
||||||
static __init int exynos4_pm_init_power_domain(void)
|
static __init int exynos4_pm_init_power_domain(void)
|
||||||
{
|
{
|
||||||
struct platform_device *pdev;
|
|
||||||
struct device_node *np;
|
struct device_node *np;
|
||||||
|
|
||||||
for_each_compatible_node(np, NULL, "samsung,exynos4210-pd") {
|
for_each_compatible_node(np, NULL, "samsung,exynos4210-pd") {
|
||||||
struct exynos_pm_domain *pd;
|
struct exynos_pm_domain *pd;
|
||||||
int on, i;
|
int on, i;
|
||||||
struct device *dev;
|
|
||||||
|
|
||||||
pdev = of_find_device_by_node(np);
|
|
||||||
if (!pdev) {
|
|
||||||
pr_err("%s: failed to find device for node %s\n",
|
|
||||||
__func__, np->name);
|
|
||||||
of_node_put(np);
|
|
||||||
continue;
|
|
||||||
}
|
|
||||||
dev = &pdev->dev;
|
|
||||||
|
|
||||||
pd = kzalloc(sizeof(*pd), GFP_KERNEL);
|
pd = kzalloc(sizeof(*pd), GFP_KERNEL);
|
||||||
if (!pd) {
|
if (!pd) {
|
||||||
@ -145,8 +134,8 @@ 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 = kstrdup(dev_name(dev), GFP_KERNEL);
|
GFP_KERNEL);
|
||||||
if (!pd->pd.name) {
|
if (!pd->pd.name) {
|
||||||
kfree(pd);
|
kfree(pd);
|
||||||
of_node_put(np);
|
of_node_put(np);
|
||||||
@ -156,7 +145,7 @@ static __init int exynos4_pm_init_power_domain(void)
|
|||||||
pd->name = pd->pd.name;
|
pd->name = pd->pd.name;
|
||||||
pd->base = of_iomap(np, 0);
|
pd->base = of_iomap(np, 0);
|
||||||
if (!pd->base) {
|
if (!pd->base) {
|
||||||
dev_warn(&pdev->dev, "Failed to map memory\n");
|
pr_warn("%s: failed to map memory\n", __func__);
|
||||||
kfree(pd->pd.name);
|
kfree(pd->pd.name);
|
||||||
kfree(pd);
|
kfree(pd);
|
||||||
of_node_put(np);
|
of_node_put(np);
|
||||||
@ -170,12 +159,12 @@ static __init int exynos4_pm_init_power_domain(void)
|
|||||||
char clk_name[8];
|
char clk_name[8];
|
||||||
|
|
||||||
snprintf(clk_name, sizeof(clk_name), "asb%d", i);
|
snprintf(clk_name, sizeof(clk_name), "asb%d", i);
|
||||||
pd->asb_clk[i] = clk_get(dev, clk_name);
|
pd->asb_clk[i] = of_clk_get_by_name(np, clk_name);
|
||||||
if (IS_ERR(pd->asb_clk[i]))
|
if (IS_ERR(pd->asb_clk[i]))
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
|
|
||||||
pd->oscclk = clk_get(dev, "oscclk");
|
pd->oscclk = of_clk_get_by_name(np, "oscclk");
|
||||||
if (IS_ERR(pd->oscclk))
|
if (IS_ERR(pd->oscclk))
|
||||||
goto no_clk;
|
goto no_clk;
|
||||||
|
|
||||||
@ -183,7 +172,7 @@ static __init int exynos4_pm_init_power_domain(void)
|
|||||||
char clk_name[8];
|
char clk_name[8];
|
||||||
|
|
||||||
snprintf(clk_name, sizeof(clk_name), "clk%d", i);
|
snprintf(clk_name, sizeof(clk_name), "clk%d", i);
|
||||||
pd->clk[i] = clk_get(dev, clk_name);
|
pd->clk[i] = of_clk_get_by_name(np, clk_name);
|
||||||
if (IS_ERR(pd->clk[i]))
|
if (IS_ERR(pd->clk[i]))
|
||||||
break;
|
break;
|
||||||
/*
|
/*
|
||||||
@ -234,4 +223,4 @@ static __init int exynos4_pm_init_power_domain(void)
|
|||||||
|
|
||||||
return 0;
|
return 0;
|
||||||
}
|
}
|
||||||
arch_initcall(exynos4_pm_init_power_domain);
|
core_initcall(exynos4_pm_init_power_domain);
|
||||||
|
Loading…
Reference in New Issue
Block a user