diff options
Diffstat (limited to 'arch/arm/mach-omap2/clockdomain.c')
-rw-r--r-- | arch/arm/mach-omap2/clockdomain.c | 64 |
1 files changed, 15 insertions, 49 deletions
diff --git a/arch/arm/mach-omap2/clockdomain.c b/arch/arm/mach-omap2/clockdomain.c index 895c153c18e0..3035eb9eec36 100644 --- a/arch/arm/mach-omap2/clockdomain.c +++ b/arch/arm/mach-omap2/clockdomain.c | |||
@@ -355,7 +355,7 @@ void clkdm_init(struct clockdomain **clkdms, | |||
355 | */ | 355 | */ |
356 | list_for_each_entry(clkdm, &clkdm_list, node) { | 356 | list_for_each_entry(clkdm, &clkdm_list, node) { |
357 | if (clkdm->flags & CLKDM_CAN_FORCE_WAKEUP) | 357 | if (clkdm->flags & CLKDM_CAN_FORCE_WAKEUP) |
358 | omap2_clkdm_wakeup(clkdm); | 358 | clkdm_wakeup(clkdm); |
359 | else if (clkdm->flags & CLKDM_CAN_DISABLE_AUTO) | 359 | else if (clkdm->flags & CLKDM_CAN_DISABLE_AUTO) |
360 | omap2_clkdm_deny_idle(clkdm); | 360 | omap2_clkdm_deny_idle(clkdm); |
361 | 361 | ||
@@ -765,7 +765,7 @@ int clkdm_clear_all_sleepdeps(struct clockdomain *clkdm) | |||
765 | } | 765 | } |
766 | 766 | ||
767 | /** | 767 | /** |
768 | * omap2_clkdm_sleep - force clockdomain sleep transition | 768 | * clkdm_sleep - force clockdomain sleep transition |
769 | * @clkdm: struct clockdomain * | 769 | * @clkdm: struct clockdomain * |
770 | * | 770 | * |
771 | * Instruct the CM to force a sleep transition on the specified | 771 | * Instruct the CM to force a sleep transition on the specified |
@@ -773,7 +773,7 @@ int clkdm_clear_all_sleepdeps(struct clockdomain *clkdm) | |||
773 | * clockdomain does not support software-initiated sleep; 0 upon | 773 | * clockdomain does not support software-initiated sleep; 0 upon |
774 | * success. | 774 | * success. |
775 | */ | 775 | */ |
776 | int omap2_clkdm_sleep(struct clockdomain *clkdm) | 776 | int clkdm_sleep(struct clockdomain *clkdm) |
777 | { | 777 | { |
778 | if (!clkdm) | 778 | if (!clkdm) |
779 | return -EINVAL; | 779 | return -EINVAL; |
@@ -784,33 +784,16 @@ int omap2_clkdm_sleep(struct clockdomain *clkdm) | |||
784 | return -EINVAL; | 784 | return -EINVAL; |
785 | } | 785 | } |
786 | 786 | ||
787 | pr_debug("clockdomain: forcing sleep on %s\n", clkdm->name); | 787 | if (!arch_clkdm || !arch_clkdm->clkdm_sleep) |
788 | 788 | return -EINVAL; | |
789 | if (cpu_is_omap24xx()) { | ||
790 | |||
791 | omap2_cm_set_mod_reg_bits(OMAP24XX_FORCESTATE_MASK, | ||
792 | clkdm->pwrdm.ptr->prcm_offs, OMAP2_PM_PWSTCTRL); | ||
793 | |||
794 | } else if (cpu_is_omap34xx()) { | ||
795 | |||
796 | omap3xxx_cm_clkdm_force_sleep(clkdm->pwrdm.ptr->prcm_offs, | ||
797 | clkdm->clktrctrl_mask); | ||
798 | |||
799 | } else if (cpu_is_omap44xx()) { | ||
800 | |||
801 | omap4_cminst_clkdm_force_sleep(clkdm->prcm_partition, | ||
802 | clkdm->cm_inst, | ||
803 | clkdm->clkdm_offs); | ||
804 | 789 | ||
805 | } else { | 790 | pr_debug("clockdomain: forcing sleep on %s\n", clkdm->name); |
806 | BUG(); | ||
807 | }; | ||
808 | 791 | ||
809 | return 0; | 792 | return arch_clkdm->clkdm_sleep(clkdm); |
810 | } | 793 | } |
811 | 794 | ||
812 | /** | 795 | /** |
813 | * omap2_clkdm_wakeup - force clockdomain wakeup transition | 796 | * clkdm_wakeup - force clockdomain wakeup transition |
814 | * @clkdm: struct clockdomain * | 797 | * @clkdm: struct clockdomain * |
815 | * | 798 | * |
816 | * Instruct the CM to force a wakeup transition on the specified | 799 | * Instruct the CM to force a wakeup transition on the specified |
@@ -818,7 +801,7 @@ int omap2_clkdm_sleep(struct clockdomain *clkdm) | |||
818 | * clockdomain does not support software-controlled wakeup; 0 upon | 801 | * clockdomain does not support software-controlled wakeup; 0 upon |
819 | * success. | 802 | * success. |
820 | */ | 803 | */ |
821 | int omap2_clkdm_wakeup(struct clockdomain *clkdm) | 804 | int clkdm_wakeup(struct clockdomain *clkdm) |
822 | { | 805 | { |
823 | if (!clkdm) | 806 | if (!clkdm) |
824 | return -EINVAL; | 807 | return -EINVAL; |
@@ -829,29 +812,12 @@ int omap2_clkdm_wakeup(struct clockdomain *clkdm) | |||
829 | return -EINVAL; | 812 | return -EINVAL; |
830 | } | 813 | } |
831 | 814 | ||
832 | pr_debug("clockdomain: forcing wakeup on %s\n", clkdm->name); | 815 | if (!arch_clkdm || !arch_clkdm->clkdm_wakeup) |
833 | 816 | return -EINVAL; | |
834 | if (cpu_is_omap24xx()) { | ||
835 | |||
836 | omap2_cm_clear_mod_reg_bits(OMAP24XX_FORCESTATE_MASK, | ||
837 | clkdm->pwrdm.ptr->prcm_offs, OMAP2_PM_PWSTCTRL); | ||
838 | |||
839 | } else if (cpu_is_omap34xx()) { | ||
840 | |||
841 | omap3xxx_cm_clkdm_force_wakeup(clkdm->pwrdm.ptr->prcm_offs, | ||
842 | clkdm->clktrctrl_mask); | ||
843 | |||
844 | } else if (cpu_is_omap44xx()) { | ||
845 | |||
846 | omap4_cminst_clkdm_force_wakeup(clkdm->prcm_partition, | ||
847 | clkdm->cm_inst, | ||
848 | clkdm->clkdm_offs); | ||
849 | 817 | ||
850 | } else { | 818 | pr_debug("clockdomain: forcing wakeup on %s\n", clkdm->name); |
851 | BUG(); | ||
852 | }; | ||
853 | 819 | ||
854 | return 0; | 820 | return arch_clkdm->clkdm_wakeup(clkdm); |
855 | } | 821 | } |
856 | 822 | ||
857 | /** | 823 | /** |
@@ -990,7 +956,7 @@ int omap2_clkdm_clk_enable(struct clockdomain *clkdm, struct clk *clk) | |||
990 | _clkdm_add_autodeps(clkdm); | 956 | _clkdm_add_autodeps(clkdm); |
991 | _enable_hwsup(clkdm); | 957 | _enable_hwsup(clkdm); |
992 | } else { | 958 | } else { |
993 | omap2_clkdm_wakeup(clkdm); | 959 | clkdm_wakeup(clkdm); |
994 | } | 960 | } |
995 | 961 | ||
996 | pwrdm_wait_transition(clkdm->pwrdm.ptr); | 962 | pwrdm_wait_transition(clkdm->pwrdm.ptr); |
@@ -1062,7 +1028,7 @@ int omap2_clkdm_clk_disable(struct clockdomain *clkdm, struct clk *clk) | |||
1062 | _clkdm_del_autodeps(clkdm); | 1028 | _clkdm_del_autodeps(clkdm); |
1063 | _enable_hwsup(clkdm); | 1029 | _enable_hwsup(clkdm); |
1064 | } else { | 1030 | } else { |
1065 | omap2_clkdm_sleep(clkdm); | 1031 | clkdm_sleep(clkdm); |
1066 | } | 1032 | } |
1067 | 1033 | ||
1068 | pwrdm_clkdm_state_switch(clkdm); | 1034 | pwrdm_clkdm_state_switch(clkdm); |