diff mbox

omap3 pm: dependency between opp layer and cpufreq

Message ID B85A65D85D7EB246BE421B3FB0FBB59301E71FDE25@dbde02.ent.ti.com (mailing list archive)
State New, archived
Delegated to: Kevin Hilman
Headers show

Commit Message

Sanjeev Premi May 27, 2010, 1:19 p.m. UTC
None
diff mbox

Patch

diff --git a/arch/arm/plat-omap/Makefile b/arch/arm/plat-omap/Makefile
index 2b9ebf0..18d291f 100644
--- a/arch/arm/plat-omap/Makefile
+++ b/arch/arm/plat-omap/Makefile
@@ -15,7 +15,7 @@  obj-$(CONFIG_ARCH_OMAP16XX) += ocpi.o
 # OPP support in (OMAP3+ only at the moment)
 # XXX The OPP TWL/TPS code should only be included when a TWL/TPS
 # PMIC is selected.
-ifdef CONFIG_CPU_FREQ
+ifdef CONFIG_TWL4030_POWER
 obj-$(CONFIG_ARCH_OMAP3) += opp.o opp_twl_tps.o
 endif

diff --git a/arch/arm/plat-omap/include/plat/opp.h b/arch/arm/plat-omap/include/plat/opp.h
index 7d16a46..03463d5 100644
--- a/arch/arm/plat-omap/include/plat/opp.h
+++ b/arch/arm/plat-omap/include/plat/opp.h
@@ -67,6 +67,14 @@  struct omap_opp_def {
 struct omap_opp;

 #ifdef CONFIG_CPU_FREQ
+void opp_init_cpufreq_table(enum opp_t opp_type,
+                           struct cpufreq_frequency_table **table);
+#else
+static inline void opp_init_cpufreq_table(struct omap_opp *opps,
+                           struct cpufreq_frequency_table **table)
+{
+}
+#endif

 /**
  * opp_get_voltage() - Gets the voltage corresponding to an opp
@@ -233,79 +241,4 @@  struct omap_opp * __deprecated opp_find_by_opp_id(enum opp_t opp_type,
                                                  u8 opp_id);
 u8 __deprecated opp_get_opp_id(struct omap_opp *opp);

-void opp_init_cpufreq_table(enum opp_t opp_type,
-                           struct cpufreq_frequency_table **table);
-#else
-static inline unsigned long opp_get_voltage(const struct omap_opp *opp)
-{
-       return 0;
-}
-
-static inline unsigned long opp_get_freq(const struct omap_opp *opp)
-{
-       return 0;
-}
-
-static inline int opp_get_opp_count(struct omap_opp *oppl)
-{
-       return 0;
-}
-
-static inline struct omap_opp *opp_find_freq_exact(struct omap_opp *oppl,
-                                    unsigned long freq, bool enabled)
-{
-       return ERR_PTR(-EINVAL);
-}
-
-static inline struct omap_opp *opp_find_freq_floor(struct omap_opp *oppl,
-                                    unsigned long *freq)
-{
-       return ERR_PTR(-EINVAL);
-}
-
-static inline struct omap_opp *opp_find_freq_ceil(struct omap_opp *oppl,
-                                       unsigned long *freq)
-{
-       return ERR_PTR(-EINVAL);
-}
-
-static inline
-struct omap_opp __init *opp_init_list(const struct omap_opp_def *opp_defs)
-{
-       return ERR_PTR(-EINVAL);
-}
-
-static inline struct omap_opp *opp_add(struct omap_opp *oppl,
-                        const struct omap_opp_def *opp_def)
-{
-       return ERR_PTR(-EINVAL);
-}
-
-static inline int opp_enable(struct omap_opp *opp)
-{
-       return 0;
-}
-
-static inline int opp_disable(struct omap_opp *opp)
-{
-       return 0;
-}
-
-static inline struct omap_opp * __deprecated
-opp_find_by_opp_id(struct omap_opp *opps, u8 opp_id)
-{
-       return ERR_PTR(-EINVAL);
-}
-
-static inline u8 __deprecated opp_get_opp_id(struct omap_opp *opp)
-{
-       return 0;
-}
-
-static inline void opp_init_cpufreq_table(struct omap_opp *opps,
-                           struct cpufreq_frequency_table **table)
-{
-}
-
-#endif         /* CONFIG_CPU_FREQ */
 #endif         /* __ASM_ARM_OMAP_OPP_H */
diff --git a/arch/arm/plat-omap/opp.c b/arch/arm/plat-omap/opp.c
index 13da451..76466fb 100644
--- a/arch/arm/plat-omap/opp.c
+++ b/arch/arm/plat-omap/opp.c
@@ -352,7 +352,7 @@  int opp_disable(struct omap_opp *opp)
        return 0;
 }

-/* XXX document */
+#ifdef CONFIG_CPU_FREQ
 void opp_init_cpufreq_table(enum opp_t opp_type,
                            struct cpufreq_frequency_table **table)
 {
@@ -397,3 +397,4 @@  void opp_init_cpufreq_table(enum opp_t opp_type,

        *table = &freq_table[0];
 }
+#endif