ARM: tegra11: thermal: Clean duplicated definitions
Alex Frid [Sun, 2 Dec 2012 07:16:05 +0000 (23:16 -0800)]
Same Tegra throttling data structures and function prototypes were
defined in

mach-tegra/include/mach/thermal.h
and
mach-tegra/cpu-tegra.h

Consolidated all definitions in thermal.h header.

Change-Id: I52f6a964d04cb74513e5fc7be2f2aa7762b90c3d
Signed-off-by: Alex Frid <afrid@nvidia.com>
Reviewed-on: http://git-master/r/168663
Reviewed-by: Automatic_Commit_Validation_User
Reviewed-by: Diwakar Tundlam <dtundlam@nvidia.com>
Tested-by: Diwakar Tundlam <dtundlam@nvidia.com>

arch/arm/mach-tegra/cpu-tegra.h
arch/arm/mach-tegra/include/mach/thermal.h

index da4450e..37a6ffd 100644 (file)
@@ -22,6 +22,7 @@
 #define __MACH_TEGRA_CPU_TEGRA_H
 
 #include <linux/fs.h>
+#include <mach/thermal.h>
 
 unsigned int tegra_getspeed(unsigned int cpu);
 int tegra_update_cpu_speed(unsigned long rate);
@@ -31,47 +32,6 @@ unsigned int tegra_get_slowest_cpu_n(void);
 unsigned long tegra_cpu_lowest_speed(void);
 unsigned long tegra_cpu_highest_speed(void);
 
-#define MAX_THROT_TABLE_SIZE   (64)
-
-struct throttle_table {
-       unsigned int cpu_freq;
-       int core_cap_level;
-};
-
-struct balanced_throttle {
-       struct thermal_cooling_device *cdev;
-       struct list_head node;
-       int is_throttling;
-       int throttle_count;
-       int throttle_index;
-       int throt_tab_size;
-       struct throttle_table throt_tab[MAX_THROT_TABLE_SIZE + 1];
-};
-
-#ifdef CONFIG_TEGRA_THERMAL_THROTTLE
-int tegra_throttle_init(struct mutex *cpu_lock);
-struct thermal_cooling_device *balanced_throttle_register(
-               struct balanced_throttle *bthrot,
-               char *type);
-void tegra_throttle_exit(void);
-bool tegra_is_throttling(int *count);
-unsigned int tegra_throttle_governor_speed(unsigned int requested_speed);
-#else
-static inline int tegra_throttle_init(struct mutex *cpu_lock)
-{ return 0; }
-static inline struct thermal_cooling_device *balanced_throttle_register(
-               struct balanced_throttle *bthrot,
-               char *type)
-{ return ERR_PTR(-ENODEV); }
-static inline void tegra_throttle_exit(void)
-{}
-static inline bool tegra_is_throttling(int *count)
-{ return false; }
-static inline unsigned int tegra_throttle_governor_speed(
-       unsigned int requested_speed)
-{ return requested_speed; }
-#endif /* CONFIG_TEGRA_THERMAL_THROTTLE */
-
 #if defined(CONFIG_TEGRA_AUTO_HOTPLUG) && !defined(CONFIG_ARCH_TEGRA_2x_SOC)
 int tegra_auto_hotplug_init(struct mutex *cpulock);
 void tegra_auto_hotplug_exit(void);
index f3bbbeb..abcec01 100644 (file)
@@ -69,31 +69,46 @@ struct tegra_cooling_device {
        enum cooling_device_id id;
 };
 
+#define MAX_THROT_TABLE_SIZE   (64)
+
 struct throttle_table {
        unsigned int cpu_freq;
        int core_cap_level;
 };
 
-#define MAX_THROT_TABLE_SIZE   (32)
-
 struct balanced_throttle {
-       struct tegra_cooling_device tegra_cdev;
        struct thermal_cooling_device *cdev;
        struct list_head node;
        int is_throttling;
+       int throttle_count;
        int throttle_index;
        int throt_tab_size;
-       struct throttle_table throt_tab[MAX_THROT_TABLE_SIZE];
+       struct throttle_table throt_tab[MAX_THROT_TABLE_SIZE + 1];
 };
 
 #ifdef CONFIG_TEGRA_THERMAL_THROTTLE
+int tegra_throttle_init(struct mutex *cpu_lock);
 struct thermal_cooling_device *balanced_throttle_register(
-       struct balanced_throttle *bthrot);
+               struct balanced_throttle *bthrot,
+               char *type);
+void tegra_throttle_exit(void);
+bool tegra_is_throttling(int *count);
+unsigned int tegra_throttle_governor_speed(unsigned int requested_speed);
 #else
+static inline int tegra_throttle_init(struct mutex *cpu_lock)
+{ return 0; }
 static inline struct thermal_cooling_device *balanced_throttle_register(
-       struct balanced_throttle *bthrot)
-{ return ERR_PTR(-EINVAL); }
-#endif
+               struct balanced_throttle *bthrot,
+               char *type)
+{ return ERR_PTR(-ENODEV); }
+static inline void tegra_throttle_exit(void)
+{}
+static inline bool tegra_is_throttling(int *count)
+{ return false; }
+static inline unsigned int tegra_throttle_governor_speed(
+       unsigned int requested_speed)
+{ return requested_speed; }
+#endif /* CONFIG_TEGRA_THERMAL_THROTTLE */
 
 #ifdef CONFIG_TEGRA_THERMAL
 int tegra_thermal_init(struct tegra_thermal_bind *thermal_binds);