diff options
Diffstat (limited to 'arch/arm/mach-tegra/pmc.c')
| -rw-r--r-- | arch/arm/mach-tegra/pmc.c | 41 |
1 files changed, 22 insertions, 19 deletions
diff --git a/arch/arm/mach-tegra/pmc.c b/arch/arm/mach-tegra/pmc.c index 8acb881f7cfe..7916ff91f969 100644 --- a/arch/arm/mach-tegra/pmc.c +++ b/arch/arm/mach-tegra/pmc.c | |||
| @@ -285,13 +285,10 @@ static const struct of_device_id matches[] __initconst = { | |||
| 285 | { } | 285 | { } |
| 286 | }; | 286 | }; |
| 287 | 287 | ||
| 288 | static void __init tegra_pmc_parse_dt(void) | 288 | void __init tegra_pmc_init_irq(void) |
| 289 | { | 289 | { |
| 290 | struct device_node *np; | 290 | struct device_node *np; |
| 291 | u32 prop; | 291 | u32 val; |
| 292 | enum tegra_suspend_mode suspend_mode; | ||
| 293 | u32 core_good_time[2] = {0, 0}; | ||
| 294 | u32 lp0_vec[2] = {0, 0}; | ||
| 295 | 292 | ||
| 296 | np = of_find_matching_node(NULL, matches); | 293 | np = of_find_matching_node(NULL, matches); |
| 297 | BUG_ON(!np); | 294 | BUG_ON(!np); |
| @@ -300,6 +297,26 @@ static void __init tegra_pmc_parse_dt(void) | |||
| 300 | 297 | ||
| 301 | tegra_pmc_invert_interrupt = of_property_read_bool(np, | 298 | tegra_pmc_invert_interrupt = of_property_read_bool(np, |
| 302 | "nvidia,invert-interrupt"); | 299 | "nvidia,invert-interrupt"); |
| 300 | |||
| 301 | val = tegra_pmc_readl(PMC_CTRL); | ||
| 302 | if (tegra_pmc_invert_interrupt) | ||
| 303 | val |= PMC_CTRL_INTR_LOW; | ||
| 304 | else | ||
| 305 | val &= ~PMC_CTRL_INTR_LOW; | ||
| 306 | tegra_pmc_writel(val, PMC_CTRL); | ||
| 307 | } | ||
| 308 | |||
| 309 | void __init tegra_pmc_init(void) | ||
| 310 | { | ||
| 311 | struct device_node *np; | ||
| 312 | u32 prop; | ||
| 313 | enum tegra_suspend_mode suspend_mode; | ||
| 314 | u32 core_good_time[2] = {0, 0}; | ||
| 315 | u32 lp0_vec[2] = {0, 0}; | ||
| 316 | |||
| 317 | np = of_find_matching_node(NULL, matches); | ||
| 318 | BUG_ON(!np); | ||
| 319 | |||
| 303 | tegra_pclk = of_clk_get_by_name(np, "pclk"); | 320 | tegra_pclk = of_clk_get_by_name(np, "pclk"); |
| 304 | WARN_ON(IS_ERR(tegra_pclk)); | 321 | WARN_ON(IS_ERR(tegra_pclk)); |
| 305 | 322 | ||
| @@ -365,17 +382,3 @@ static void __init tegra_pmc_parse_dt(void) | |||
| 365 | 382 | ||
| 366 | pmc_pm_data.suspend_mode = suspend_mode; | 383 | pmc_pm_data.suspend_mode = suspend_mode; |
| 367 | } | 384 | } |
| 368 | |||
| 369 | void __init tegra_pmc_init(void) | ||
| 370 | { | ||
| 371 | u32 val; | ||
| 372 | |||
| 373 | tegra_pmc_parse_dt(); | ||
| 374 | |||
| 375 | val = tegra_pmc_readl(PMC_CTRL); | ||
| 376 | if (tegra_pmc_invert_interrupt) | ||
| 377 | val |= PMC_CTRL_INTR_LOW; | ||
| 378 | else | ||
| 379 | val &= ~PMC_CTRL_INTR_LOW; | ||
| 380 | tegra_pmc_writel(val, PMC_CTRL); | ||
| 381 | } | ||
