aboutsummaryrefslogtreecommitdiffstats
path: root/arch/arm/mach-omap2/powerdomain.c
diff options
context:
space:
mode:
authorRajendra Nayak <rnayak@ti.com>2010-12-21 22:01:18 -0500
committerPaul Walmsley <paul@pwsan.com>2010-12-21 22:01:18 -0500
commitf327e07b0ef9c60a6018799c9f04de10101d8e5a (patch)
tree4f21b95c3a8f5badb3a1cf69ab75b8edfd1624a6 /arch/arm/mach-omap2/powerdomain.c
parent3b1e8b21fcbd686445f0bb42f84701b4621cdec6 (diff)
OMAP: powerdomain: Arch specific funcs for state control
Define the following architecture specific funtions for omap2/3/4 .pwrdm_set_next_pwrst .pwrdm_read_next_pwrst .pwrdm_read_pwrst .pwrdm_read_prev_pwrst Convert the platform-independent framework to call these functions. Signed-off-by: Rajendra Nayak <rnayak@ti.com> [paul@pwsan.com: remove remaining static allocations in powerdomains.h file; remove path in file header comments, rearranged Makefile changes] Signed-off-by: Paul Walmsley <paul@pwsan.com> Cc: Benoit Cousson <b-cousson@ti.com> Cc: Kevin Hilman <khilman@deeprootsystems.com> Reviewed-by: Kevin Hilman <khilman@deeprootsystems.com> Tested-by: Kevin Hilman <khilman@deeprootsystems.com> Tested-by: Santosh Shilimkar <santosh.shilimkar@ti.com> Tested-by: Rajendra Nayak <rnayak@ti.com>
Diffstat (limited to 'arch/arm/mach-omap2/powerdomain.c')
-rw-r--r--arch/arm/mach-omap2/powerdomain.c33
1 files changed, 23 insertions, 10 deletions
diff --git a/arch/arm/mach-omap2/powerdomain.c b/arch/arm/mach-omap2/powerdomain.c
index 3aa3eb335416..0ae1ebf4e974 100644
--- a/arch/arm/mach-omap2/powerdomain.c
+++ b/arch/arm/mach-omap2/powerdomain.c
@@ -439,6 +439,8 @@ int pwrdm_get_mem_bank_count(struct powerdomain *pwrdm)
439 */ 439 */
440int pwrdm_set_next_pwrst(struct powerdomain *pwrdm, u8 pwrst) 440int pwrdm_set_next_pwrst(struct powerdomain *pwrdm, u8 pwrst)
441{ 441{
442 int ret = -EINVAL;
443
442 if (!pwrdm) 444 if (!pwrdm)
443 return -EINVAL; 445 return -EINVAL;
444 446
@@ -448,11 +450,10 @@ int pwrdm_set_next_pwrst(struct powerdomain *pwrdm, u8 pwrst)
448 pr_debug("powerdomain: setting next powerstate for %s to %0x\n", 450 pr_debug("powerdomain: setting next powerstate for %s to %0x\n",
449 pwrdm->name, pwrst); 451 pwrdm->name, pwrst);
450 452
451 prm_rmw_mod_reg_bits(OMAP_POWERSTATE_MASK, 453 if (arch_pwrdm && arch_pwrdm->pwrdm_set_next_pwrst)
452 (pwrst << OMAP_POWERSTATE_SHIFT), 454 ret = arch_pwrdm->pwrdm_set_next_pwrst(pwrdm, pwrst);
453 pwrdm->prcm_offs, pwrstctrl_reg_offs);
454 455
455 return 0; 456 return ret;
456} 457}
457 458
458/** 459/**
@@ -465,11 +466,15 @@ int pwrdm_set_next_pwrst(struct powerdomain *pwrdm, u8 pwrst)
465 */ 466 */
466int pwrdm_read_next_pwrst(struct powerdomain *pwrdm) 467int pwrdm_read_next_pwrst(struct powerdomain *pwrdm)
467{ 468{
469 int ret = -EINVAL;
470
468 if (!pwrdm) 471 if (!pwrdm)
469 return -EINVAL; 472 return -EINVAL;
470 473
471 return prm_read_mod_bits_shift(pwrdm->prcm_offs, 474 if (arch_pwrdm && arch_pwrdm->pwrdm_read_next_pwrst)
472 pwrstctrl_reg_offs, OMAP_POWERSTATE_MASK); 475 ret = arch_pwrdm->pwrdm_read_next_pwrst(pwrdm);
476
477 return ret;
473} 478}
474 479
475/** 480/**
@@ -482,11 +487,15 @@ int pwrdm_read_next_pwrst(struct powerdomain *pwrdm)
482 */ 487 */
483int pwrdm_read_pwrst(struct powerdomain *pwrdm) 488int pwrdm_read_pwrst(struct powerdomain *pwrdm)
484{ 489{
490 int ret = -EINVAL;
491
485 if (!pwrdm) 492 if (!pwrdm)
486 return -EINVAL; 493 return -EINVAL;
487 494
488 return prm_read_mod_bits_shift(pwrdm->prcm_offs, 495 if (arch_pwrdm && arch_pwrdm->pwrdm_read_pwrst)
489 pwrstst_reg_offs, OMAP_POWERSTATEST_MASK); 496 ret = arch_pwrdm->pwrdm_read_pwrst(pwrdm);
497
498 return ret;
490} 499}
491 500
492/** 501/**
@@ -499,11 +508,15 @@ int pwrdm_read_pwrst(struct powerdomain *pwrdm)
499 */ 508 */
500int pwrdm_read_prev_pwrst(struct powerdomain *pwrdm) 509int pwrdm_read_prev_pwrst(struct powerdomain *pwrdm)
501{ 510{
511 int ret = -EINVAL;
512
502 if (!pwrdm) 513 if (!pwrdm)
503 return -EINVAL; 514 return -EINVAL;
504 515
505 return prm_read_mod_bits_shift(pwrdm->prcm_offs, OMAP3430_PM_PREPWSTST, 516 if (arch_pwrdm && arch_pwrdm->pwrdm_read_prev_pwrst)
506 OMAP3430_LASTPOWERSTATEENTERED_MASK); 517 ret = arch_pwrdm->pwrdm_read_prev_pwrst(pwrdm);
518
519 return ret;
507} 520}
508 521
509/** 522/**