diff options
author | Rajendra Nayak <rnayak@ti.com> | 2011-02-25 18:06:48 -0500 |
---|---|---|
committer | Paul Walmsley <paul@pwsan.com> | 2011-02-25 18:06:48 -0500 |
commit | 5cd1937b6d5990fe5d5287d925f05afd38e9fb02 (patch) | |
tree | bef088bf947646413c74f6d3d6ba28aa3921813e /arch/arm/mach-omap2/clockdomain.c | |
parent | 68b921ad7f35e0323ce0d9fe94e5701a112f257c (diff) |
OMAP: clockdomain: Arch specific funcs for hwsup control of clkdm
Define the following architecture specific funtions for omap2/3/4
.clkdm_allow_idle
.clkdm_deny_idle
Convert the platform-independent framework to call these functions.
Also rename the api's by removing the omap2_ preamble.
Hence call omap2_clkdm_allow_idle as clkdm_allow_idle and
omap2_clkdm_deny_idle as clkdm_deny_idle.
Make the _clkdm_add_autodeps and _clkdm_del_autodeps as non-static
so they can be accessed from OMAP2/3 platform specific code.
Signed-off-by: Rajendra Nayak <rnayak@ti.com>
Signed-off-by: Paul Walmsley <paul@pwsan.com>
Diffstat (limited to 'arch/arm/mach-omap2/clockdomain.c')
-rw-r--r-- | arch/arm/mach-omap2/clockdomain.c | 47 |
1 files changed, 15 insertions, 32 deletions
diff --git a/arch/arm/mach-omap2/clockdomain.c b/arch/arm/mach-omap2/clockdomain.c index 3035eb9eec36..44664e7cc2a6 100644 --- a/arch/arm/mach-omap2/clockdomain.c +++ b/arch/arm/mach-omap2/clockdomain.c | |||
@@ -178,7 +178,7 @@ static void _autodep_lookup(struct clkdm_autodep *autodep) | |||
178 | * XXX autodeps are deprecated and should be removed at the earliest | 178 | * XXX autodeps are deprecated and should be removed at the earliest |
179 | * opportunity | 179 | * opportunity |
180 | */ | 180 | */ |
181 | static void _clkdm_add_autodeps(struct clockdomain *clkdm) | 181 | void _clkdm_add_autodeps(struct clockdomain *clkdm) |
182 | { | 182 | { |
183 | struct clkdm_autodep *autodep; | 183 | struct clkdm_autodep *autodep; |
184 | 184 | ||
@@ -212,7 +212,7 @@ static void _clkdm_add_autodeps(struct clockdomain *clkdm) | |||
212 | * XXX autodeps are deprecated and should be removed at the earliest | 212 | * XXX autodeps are deprecated and should be removed at the earliest |
213 | * opportunity | 213 | * opportunity |
214 | */ | 214 | */ |
215 | static void _clkdm_del_autodeps(struct clockdomain *clkdm) | 215 | void _clkdm_del_autodeps(struct clockdomain *clkdm) |
216 | { | 216 | { |
217 | struct clkdm_autodep *autodep; | 217 | struct clkdm_autodep *autodep; |
218 | 218 | ||
@@ -357,7 +357,7 @@ void clkdm_init(struct clockdomain **clkdms, | |||
357 | if (clkdm->flags & CLKDM_CAN_FORCE_WAKEUP) | 357 | if (clkdm->flags & CLKDM_CAN_FORCE_WAKEUP) |
358 | 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 | clkdm_deny_idle(clkdm); |
361 | 361 | ||
362 | _resolve_clkdm_deps(clkdm, clkdm->wkdep_srcs); | 362 | _resolve_clkdm_deps(clkdm, clkdm->wkdep_srcs); |
363 | clkdm_clear_all_wkdeps(clkdm); | 363 | clkdm_clear_all_wkdeps(clkdm); |
@@ -821,7 +821,7 @@ int clkdm_wakeup(struct clockdomain *clkdm) | |||
821 | } | 821 | } |
822 | 822 | ||
823 | /** | 823 | /** |
824 | * omap2_clkdm_allow_idle - enable hwsup idle transitions for clkdm | 824 | * clkdm_allow_idle - enable hwsup idle transitions for clkdm |
825 | * @clkdm: struct clockdomain * | 825 | * @clkdm: struct clockdomain * |
826 | * | 826 | * |
827 | * Allow the hardware to automatically switch the clockdomain @clkdm into | 827 | * Allow the hardware to automatically switch the clockdomain @clkdm into |
@@ -830,7 +830,7 @@ int clkdm_wakeup(struct clockdomain *clkdm) | |||
830 | * framework, wkdep/sleepdep autodependencies are added; this is so | 830 | * framework, wkdep/sleepdep autodependencies are added; this is so |
831 | * device drivers can read and write to the device. No return value. | 831 | * device drivers can read and write to the device. No return value. |
832 | */ | 832 | */ |
833 | void omap2_clkdm_allow_idle(struct clockdomain *clkdm) | 833 | void clkdm_allow_idle(struct clockdomain *clkdm) |
834 | { | 834 | { |
835 | if (!clkdm) | 835 | if (!clkdm) |
836 | return; | 836 | return; |
@@ -841,27 +841,18 @@ void omap2_clkdm_allow_idle(struct clockdomain *clkdm) | |||
841 | return; | 841 | return; |
842 | } | 842 | } |
843 | 843 | ||
844 | if (!arch_clkdm || !arch_clkdm->clkdm_allow_idle) | ||
845 | return; | ||
846 | |||
844 | pr_debug("clockdomain: enabling automatic idle transitions for %s\n", | 847 | pr_debug("clockdomain: enabling automatic idle transitions for %s\n", |
845 | clkdm->name); | 848 | clkdm->name); |
846 | 849 | ||
847 | /* | 850 | arch_clkdm->clkdm_allow_idle(clkdm); |
848 | * XXX This should be removed once TI adds wakeup/sleep | ||
849 | * dependency code and data for OMAP4. | ||
850 | */ | ||
851 | if (cpu_is_omap44xx()) { | ||
852 | pr_err("clockdomain: %s: OMAP4 wakeup/sleep dependency support: not yet implemented\n", clkdm->name); | ||
853 | } else { | ||
854 | if (atomic_read(&clkdm->usecount) > 0) | ||
855 | _clkdm_add_autodeps(clkdm); | ||
856 | } | ||
857 | |||
858 | _enable_hwsup(clkdm); | ||
859 | |||
860 | pwrdm_clkdm_state_switch(clkdm); | 851 | pwrdm_clkdm_state_switch(clkdm); |
861 | } | 852 | } |
862 | 853 | ||
863 | /** | 854 | /** |
864 | * omap2_clkdm_deny_idle - disable hwsup idle transitions for clkdm | 855 | * clkdm_deny_idle - disable hwsup idle transitions for clkdm |
865 | * @clkdm: struct clockdomain * | 856 | * @clkdm: struct clockdomain * |
866 | * | 857 | * |
867 | * Prevent the hardware from automatically switching the clockdomain | 858 | * Prevent the hardware from automatically switching the clockdomain |
@@ -869,7 +860,7 @@ void omap2_clkdm_allow_idle(struct clockdomain *clkdm) | |||
869 | * downstream clocks enabled in the clock framework, wkdep/sleepdep | 860 | * downstream clocks enabled in the clock framework, wkdep/sleepdep |
870 | * autodependencies are removed. No return value. | 861 | * autodependencies are removed. No return value. |
871 | */ | 862 | */ |
872 | void omap2_clkdm_deny_idle(struct clockdomain *clkdm) | 863 | void clkdm_deny_idle(struct clockdomain *clkdm) |
873 | { | 864 | { |
874 | if (!clkdm) | 865 | if (!clkdm) |
875 | return; | 866 | return; |
@@ -880,21 +871,13 @@ void omap2_clkdm_deny_idle(struct clockdomain *clkdm) | |||
880 | return; | 871 | return; |
881 | } | 872 | } |
882 | 873 | ||
874 | if (!arch_clkdm || !arch_clkdm->clkdm_deny_idle) | ||
875 | return; | ||
876 | |||
883 | pr_debug("clockdomain: disabling automatic idle transitions for %s\n", | 877 | pr_debug("clockdomain: disabling automatic idle transitions for %s\n", |
884 | clkdm->name); | 878 | clkdm->name); |
885 | 879 | ||
886 | _disable_hwsup(clkdm); | 880 | arch_clkdm->clkdm_deny_idle(clkdm); |
887 | |||
888 | /* | ||
889 | * XXX This should be removed once TI adds wakeup/sleep | ||
890 | * dependency code and data for OMAP4. | ||
891 | */ | ||
892 | if (cpu_is_omap44xx()) { | ||
893 | pr_err("clockdomain: %s: OMAP4 wakeup/sleep dependency support: not yet implemented\n", clkdm->name); | ||
894 | } else { | ||
895 | if (atomic_read(&clkdm->usecount) > 0) | ||
896 | _clkdm_del_autodeps(clkdm); | ||
897 | } | ||
898 | } | 881 | } |
899 | 882 | ||
900 | 883 | ||