aboutsummaryrefslogtreecommitdiffstats
path: root/arch/arm/mach-omap2/powerdomain.c
diff options
context:
space:
mode:
Diffstat (limited to 'arch/arm/mach-omap2/powerdomain.c')
-rw-r--r--arch/arm/mach-omap2/powerdomain.c42
1 files changed, 23 insertions, 19 deletions
diff --git a/arch/arm/mach-omap2/powerdomain.c b/arch/arm/mach-omap2/powerdomain.c
index f00289abd30f..26b3f3ee82a3 100644
--- a/arch/arm/mach-omap2/powerdomain.c
+++ b/arch/arm/mach-omap2/powerdomain.c
@@ -10,9 +10,7 @@
10 * it under the terms of the GNU General Public License version 2 as 10 * it under the terms of the GNU General Public License version 2 as
11 * published by the Free Software Foundation. 11 * published by the Free Software Foundation.
12 */ 12 */
13#ifdef CONFIG_OMAP_DEBUG_POWERDOMAIN 13#undef DEBUG
14# define DEBUG
15#endif
16 14
17#include <linux/kernel.h> 15#include <linux/kernel.h>
18#include <linux/module.h> 16#include <linux/module.h>
@@ -31,9 +29,9 @@
31#include "prm.h" 29#include "prm.h"
32#include "prm-regbits-34xx.h" 30#include "prm-regbits-34xx.h"
33 31
34#include <mach/cpu.h> 32#include <plat/cpu.h>
35#include <mach/powerdomain.h> 33#include <plat/powerdomain.h>
36#include <mach/clockdomain.h> 34#include <plat/clockdomain.h>
37 35
38#include "pm.h" 36#include "pm.h"
39 37
@@ -160,7 +158,7 @@ static __init void _pwrdm_setup(struct powerdomain *pwrdm)
160{ 158{
161 int i; 159 int i;
162 160
163 for (i = 0; i < 4; i++) 161 for (i = 0; i < PWRDM_MAX_PWRSTS; i++)
164 pwrdm->state_counter[i] = 0; 162 pwrdm->state_counter[i] = 0;
165 163
166 pwrdm_wait_transition(pwrdm); 164 pwrdm_wait_transition(pwrdm);
@@ -480,7 +478,7 @@ int pwrdm_add_wkdep(struct powerdomain *pwrdm1, struct powerdomain *pwrdm2)
480 if (IS_ERR(p)) { 478 if (IS_ERR(p)) {
481 pr_debug("powerdomain: hardware cannot set/clear wake up of " 479 pr_debug("powerdomain: hardware cannot set/clear wake up of "
482 "%s when %s wakes up\n", pwrdm1->name, pwrdm2->name); 480 "%s when %s wakes up\n", pwrdm1->name, pwrdm2->name);
483 return IS_ERR(p); 481 return PTR_ERR(p);
484 } 482 }
485 483
486 pr_debug("powerdomain: hardware will wake up %s when %s wakes up\n", 484 pr_debug("powerdomain: hardware will wake up %s when %s wakes up\n",
@@ -513,7 +511,7 @@ int pwrdm_del_wkdep(struct powerdomain *pwrdm1, struct powerdomain *pwrdm2)
513 if (IS_ERR(p)) { 511 if (IS_ERR(p)) {
514 pr_debug("powerdomain: hardware cannot set/clear wake up of " 512 pr_debug("powerdomain: hardware cannot set/clear wake up of "
515 "%s when %s wakes up\n", pwrdm1->name, pwrdm2->name); 513 "%s when %s wakes up\n", pwrdm1->name, pwrdm2->name);
516 return IS_ERR(p); 514 return PTR_ERR(p);
517 } 515 }
518 516
519 pr_debug("powerdomain: hardware will no longer wake up %s after %s " 517 pr_debug("powerdomain: hardware will no longer wake up %s after %s "
@@ -550,7 +548,7 @@ int pwrdm_read_wkdep(struct powerdomain *pwrdm1, struct powerdomain *pwrdm2)
550 if (IS_ERR(p)) { 548 if (IS_ERR(p)) {
551 pr_debug("powerdomain: hardware cannot set/clear wake up of " 549 pr_debug("powerdomain: hardware cannot set/clear wake up of "
552 "%s when %s wakes up\n", pwrdm1->name, pwrdm2->name); 550 "%s when %s wakes up\n", pwrdm1->name, pwrdm2->name);
553 return IS_ERR(p); 551 return PTR_ERR(p);
554 } 552 }
555 553
556 return prm_read_mod_bits_shift(pwrdm1->prcm_offs, PM_WKDEP, 554 return prm_read_mod_bits_shift(pwrdm1->prcm_offs, PM_WKDEP,
@@ -573,10 +571,10 @@ int pwrdm_add_sleepdep(struct powerdomain *pwrdm1, struct powerdomain *pwrdm2)
573{ 571{
574 struct powerdomain *p; 572 struct powerdomain *p;
575 573
576 if (!pwrdm1) 574 if (!cpu_is_omap34xx())
577 return -EINVAL; 575 return -EINVAL;
578 576
579 if (!cpu_is_omap34xx()) 577 if (!pwrdm1)
580 return -EINVAL; 578 return -EINVAL;
581 579
582 p = _pwrdm_deps_lookup(pwrdm2, pwrdm1->sleepdep_srcs); 580 p = _pwrdm_deps_lookup(pwrdm2, pwrdm1->sleepdep_srcs);
@@ -584,7 +582,7 @@ int pwrdm_add_sleepdep(struct powerdomain *pwrdm1, struct powerdomain *pwrdm2)
584 pr_debug("powerdomain: hardware cannot set/clear sleep " 582 pr_debug("powerdomain: hardware cannot set/clear sleep "
585 "dependency affecting %s from %s\n", pwrdm1->name, 583 "dependency affecting %s from %s\n", pwrdm1->name,
586 pwrdm2->name); 584 pwrdm2->name);
587 return IS_ERR(p); 585 return PTR_ERR(p);
588 } 586 }
589 587
590 pr_debug("powerdomain: will prevent %s from sleeping if %s is active\n", 588 pr_debug("powerdomain: will prevent %s from sleeping if %s is active\n",
@@ -612,10 +610,10 @@ int pwrdm_del_sleepdep(struct powerdomain *pwrdm1, struct powerdomain *pwrdm2)
612{ 610{
613 struct powerdomain *p; 611 struct powerdomain *p;
614 612
615 if (!pwrdm1) 613 if (!cpu_is_omap34xx())
616 return -EINVAL; 614 return -EINVAL;
617 615
618 if (!cpu_is_omap34xx()) 616 if (!pwrdm1)
619 return -EINVAL; 617 return -EINVAL;
620 618
621 p = _pwrdm_deps_lookup(pwrdm2, pwrdm1->sleepdep_srcs); 619 p = _pwrdm_deps_lookup(pwrdm2, pwrdm1->sleepdep_srcs);
@@ -623,7 +621,7 @@ int pwrdm_del_sleepdep(struct powerdomain *pwrdm1, struct powerdomain *pwrdm2)
623 pr_debug("powerdomain: hardware cannot set/clear sleep " 621 pr_debug("powerdomain: hardware cannot set/clear sleep "
624 "dependency affecting %s from %s\n", pwrdm1->name, 622 "dependency affecting %s from %s\n", pwrdm1->name,
625 pwrdm2->name); 623 pwrdm2->name);
626 return IS_ERR(p); 624 return PTR_ERR(p);
627 } 625 }
628 626
629 pr_debug("powerdomain: will no longer prevent %s from sleeping if " 627 pr_debug("powerdomain: will no longer prevent %s from sleeping if "
@@ -655,10 +653,10 @@ int pwrdm_read_sleepdep(struct powerdomain *pwrdm1, struct powerdomain *pwrdm2)
655{ 653{
656 struct powerdomain *p; 654 struct powerdomain *p;
657 655
658 if (!pwrdm1) 656 if (!cpu_is_omap34xx())
659 return -EINVAL; 657 return -EINVAL;
660 658
661 if (!cpu_is_omap34xx()) 659 if (!pwrdm1)
662 return -EINVAL; 660 return -EINVAL;
663 661
664 p = _pwrdm_deps_lookup(pwrdm2, pwrdm1->sleepdep_srcs); 662 p = _pwrdm_deps_lookup(pwrdm2, pwrdm1->sleepdep_srcs);
@@ -666,7 +664,7 @@ int pwrdm_read_sleepdep(struct powerdomain *pwrdm1, struct powerdomain *pwrdm2)
666 pr_debug("powerdomain: hardware cannot set/clear sleep " 664 pr_debug("powerdomain: hardware cannot set/clear sleep "
667 "dependency affecting %s from %s\n", pwrdm1->name, 665 "dependency affecting %s from %s\n", pwrdm1->name,
668 pwrdm2->name); 666 pwrdm2->name);
669 return IS_ERR(p); 667 return PTR_ERR(p);
670 } 668 }
671 669
672 return prm_read_mod_bits_shift(pwrdm1->prcm_offs, OMAP3430_CM_SLEEPDEP, 670 return prm_read_mod_bits_shift(pwrdm1->prcm_offs, OMAP3430_CM_SLEEPDEP,
@@ -985,6 +983,9 @@ int pwrdm_read_mem_pwrst(struct powerdomain *pwrdm, u8 bank)
985 if (pwrdm->banks < (bank + 1)) 983 if (pwrdm->banks < (bank + 1))
986 return -EEXIST; 984 return -EEXIST;
987 985
986 if (pwrdm->flags & PWRDM_HAS_MPU_QUIRK)
987 bank = 1;
988
988 /* 989 /*
989 * The register bit names below may not correspond to the 990 * The register bit names below may not correspond to the
990 * actual names of the bits in each powerdomain's register, 991 * actual names of the bits in each powerdomain's register,
@@ -1032,6 +1033,9 @@ int pwrdm_read_prev_mem_pwrst(struct powerdomain *pwrdm, u8 bank)
1032 if (pwrdm->banks < (bank + 1)) 1033 if (pwrdm->banks < (bank + 1))
1033 return -EEXIST; 1034 return -EEXIST;
1034 1035
1036 if (pwrdm->flags & PWRDM_HAS_MPU_QUIRK)
1037 bank = 1;
1038
1035 /* 1039 /*
1036 * The register bit names below may not correspond to the 1040 * The register bit names below may not correspond to the
1037 * actual names of the bits in each powerdomain's register, 1041 * actual names of the bits in each powerdomain's register,