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
commit12627578523d2d9396cae76b1dad0ed3dccf1730 (patch)
tree0cce660ef2a1bc3390823469fed55a409617194a /arch/arm/mach-omap2/powerdomain.c
parentf327e07b0ef9c60a6018799c9f04de10101d8e5a (diff)
OMAP: powerdomain: Arch specific funcs for logic control
Define the following architecture specific funtions for omap2/3/4 .pwrdm_set_logic_retst .pwrdm_read_logic_pwrst .pwrdm_read_prev_logic_pwrst .pwrdm_read_logic_retst Convert the platform-independent framework to call these functions. Signed-off-by: Rajendra Nayak <rnayak@ti.com> 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.c51
1 files changed, 22 insertions, 29 deletions
diff --git a/arch/arm/mach-omap2/powerdomain.c b/arch/arm/mach-omap2/powerdomain.c
index 0ae1ebf4e974..562a3fe9db5b 100644
--- a/arch/arm/mach-omap2/powerdomain.c
+++ b/arch/arm/mach-omap2/powerdomain.c
@@ -532,7 +532,7 @@ int pwrdm_read_prev_pwrst(struct powerdomain *pwrdm)
532 */ 532 */
533int pwrdm_set_logic_retst(struct powerdomain *pwrdm, u8 pwrst) 533int pwrdm_set_logic_retst(struct powerdomain *pwrdm, u8 pwrst)
534{ 534{
535 u32 v; 535 int ret = -EINVAL;
536 536
537 if (!pwrdm) 537 if (!pwrdm)
538 return -EINVAL; 538 return -EINVAL;
@@ -543,17 +543,10 @@ int pwrdm_set_logic_retst(struct powerdomain *pwrdm, u8 pwrst)
543 pr_debug("powerdomain: setting next logic powerstate for %s to %0x\n", 543 pr_debug("powerdomain: setting next logic powerstate for %s to %0x\n",
544 pwrdm->name, pwrst); 544 pwrdm->name, pwrst);
545 545
546 /* 546 if (arch_pwrdm && arch_pwrdm->pwrdm_set_logic_retst)
547 * The register bit names below may not correspond to the 547 ret = arch_pwrdm->pwrdm_set_logic_retst(pwrdm, pwrst);
548 * actual names of the bits in each powerdomain's register,
549 * but the type of value returned is the same for each
550 * powerdomain.
551 */
552 v = pwrst << __ffs(OMAP3430_LOGICL1CACHERETSTATE_MASK);
553 prm_rmw_mod_reg_bits(OMAP3430_LOGICL1CACHERETSTATE_MASK, v,
554 pwrdm->prcm_offs, pwrstctrl_reg_offs);
555 548
556 return 0; 549 return ret;
557} 550}
558 551
559/** 552/**
@@ -696,11 +689,15 @@ int pwrdm_set_mem_retst(struct powerdomain *pwrdm, u8 bank, u8 pwrst)
696 */ 689 */
697int pwrdm_read_logic_pwrst(struct powerdomain *pwrdm) 690int pwrdm_read_logic_pwrst(struct powerdomain *pwrdm)
698{ 691{
692 int ret = -EINVAL;
693
699 if (!pwrdm) 694 if (!pwrdm)
700 return -EINVAL; 695 return -EINVAL;
701 696
702 return prm_read_mod_bits_shift(pwrdm->prcm_offs, pwrstst_reg_offs, 697 if (arch_pwrdm && arch_pwrdm->pwrdm_read_logic_pwrst)
703 OMAP3430_LOGICSTATEST_MASK); 698 ret = arch_pwrdm->pwrdm_read_logic_pwrst(pwrdm);
699
700 return ret;
704} 701}
705 702
706/** 703/**
@@ -713,17 +710,15 @@ int pwrdm_read_logic_pwrst(struct powerdomain *pwrdm)
713 */ 710 */
714int pwrdm_read_prev_logic_pwrst(struct powerdomain *pwrdm) 711int pwrdm_read_prev_logic_pwrst(struct powerdomain *pwrdm)
715{ 712{
713 int ret = -EINVAL;
714
716 if (!pwrdm) 715 if (!pwrdm)
717 return -EINVAL; 716 return -EINVAL;
718 717
719 /* 718 if (arch_pwrdm && arch_pwrdm->pwrdm_read_prev_logic_pwrst)
720 * The register bit names below may not correspond to the 719 ret = arch_pwrdm->pwrdm_read_prev_logic_pwrst(pwrdm);
721 * actual names of the bits in each powerdomain's register, 720
722 * but the type of value returned is the same for each 721 return ret;
723 * powerdomain.
724 */
725 return prm_read_mod_bits_shift(pwrdm->prcm_offs, OMAP3430_PM_PREPWSTST,
726 OMAP3430_LASTLOGICSTATEENTERED_MASK);
727} 722}
728 723
729/** 724/**
@@ -736,17 +731,15 @@ int pwrdm_read_prev_logic_pwrst(struct powerdomain *pwrdm)
736 */ 731 */
737int pwrdm_read_logic_retst(struct powerdomain *pwrdm) 732int pwrdm_read_logic_retst(struct powerdomain *pwrdm)
738{ 733{
734 int ret = -EINVAL;
735
739 if (!pwrdm) 736 if (!pwrdm)
740 return -EINVAL; 737 return -EINVAL;
741 738
742 /* 739 if (arch_pwrdm && arch_pwrdm->pwrdm_read_logic_retst)
743 * The register bit names below may not correspond to the 740 ret = arch_pwrdm->pwrdm_read_logic_retst(pwrdm);
744 * actual names of the bits in each powerdomain's register, 741
745 * but the type of value returned is the same for each 742 return ret;
746 * powerdomain.
747 */
748 return prm_read_mod_bits_shift(pwrdm->prcm_offs, pwrstctrl_reg_offs,
749 OMAP3430_LOGICSTATEST_MASK);
750} 743}
751 744
752/** 745/**