aboutsummaryrefslogtreecommitdiffstats
path: root/arch/arm/mach-omap2/powerdomain.c
diff options
context:
space:
mode:
authorJon Hunter <jon-hunter@ti.com>2012-06-29 17:04:52 -0400
committerPaul Walmsley <paul@pwsan.com>2012-07-04 06:12:07 -0400
commitd49cae924faeffe8fb6b50493ec1655731d8dbd0 (patch)
treea4d062c17e2460a5f68343de18fd312a7fc77bd4 /arch/arm/mach-omap2/powerdomain.c
parent65aa94b204dcecca01521e2a4a57e44892632b47 (diff)
ARM: OMAP2+: powerdomain code: Fix Wake-up power domain power status
The wake-up power domain is an alway-on power domain and so this power domain does not have a power state status (PM_PWSTST_xxx) register that indicates the current state. However, during the registering of the wake-up power domain the state of the domain is queried by calling pwrdm_read_pwrst(). This actually tries to read a register that does not exist and returns a value of 0 that indicates that the current state is OFF. The OFF state count of the wake-up power domain is then set to 1 and the current state to OFF. Both of which are incorrect. To fix this, if a power domain only supports the ON state, do not attempt to read the power state status register and simply return ON as the current power state. This is based upon Tony's current linux-omap master branch. Testing: - Boot tested on OMAP4460 panda. - Boot tested on OMAP3430 beagle and validated CORE RET still working (using Paul's 32k timer patch [1]). [1] http://marc.info/?l=linux-omap&m=134000053229888&w=2 Signed-off-by: Jon Hunter <jon-hunter@ti.com> Acked-by: Kevin Hilman <khilman@ti.com> Acked-by: Santosh Shilimkar <santosh.shilimkar@ti.com> [paul@pwsan.com: edited commit message slightly] Signed-off-by: Paul Walmsley <paul@pwsan.com>
Diffstat (limited to 'arch/arm/mach-omap2/powerdomain.c')
-rw-r--r--arch/arm/mach-omap2/powerdomain.c6
1 files changed, 5 insertions, 1 deletions
diff --git a/arch/arm/mach-omap2/powerdomain.c b/arch/arm/mach-omap2/powerdomain.c
index 96114901b932..2f963f702a05 100644
--- a/arch/arm/mach-omap2/powerdomain.c
+++ b/arch/arm/mach-omap2/powerdomain.c
@@ -526,7 +526,8 @@ int pwrdm_read_next_pwrst(struct powerdomain *pwrdm)
526 * 526 *
527 * Return the powerdomain @pwrdm's current power state. Returns -EINVAL 527 * Return the powerdomain @pwrdm's current power state. Returns -EINVAL
528 * if the powerdomain pointer is null or returns the current power state 528 * if the powerdomain pointer is null or returns the current power state
529 * upon success. 529 * upon success. Note that if the power domain only supports the ON state
530 * then just return ON as the current state.
530 */ 531 */
531int pwrdm_read_pwrst(struct powerdomain *pwrdm) 532int pwrdm_read_pwrst(struct powerdomain *pwrdm)
532{ 533{
@@ -535,6 +536,9 @@ int pwrdm_read_pwrst(struct powerdomain *pwrdm)
535 if (!pwrdm) 536 if (!pwrdm)
536 return -EINVAL; 537 return -EINVAL;
537 538
539 if (pwrdm->pwrsts == PWRSTS_ON)
540 return PWRDM_POWER_ON;
541
538 if (arch_pwrdm && arch_pwrdm->pwrdm_read_pwrst) 542 if (arch_pwrdm && arch_pwrdm->pwrdm_read_pwrst)
539 ret = arch_pwrdm->pwrdm_read_pwrst(pwrdm); 543 ret = arch_pwrdm->pwrdm_read_pwrst(pwrdm);
540 544