import PULS_20160108
[GitHub/mt8127/android_kernel_alcatel_ttab.git] / drivers / cpufreq / cpufreq_governor.h
index e16a96130cb3491d30f376728144cdca92e441cd..c412cbe582042fea730a02ae958c652e1f8583a3 100644 (file)
@@ -40,6 +40,9 @@
 /* Ondemand Sampling types */
 enum {OD_NORMAL_SAMPLE, OD_SUB_SAMPLE};
 
+/* Hotplug Sampling types */
+enum {HP_NORMAL_SAMPLE, HP_SUB_SAMPLE};
+
 /*
  * Macro for creating governors sysfs routines
  *
@@ -127,6 +130,7 @@ static void *get_cpu_dbs_info_s(int cpu)                            \
  * cdbs: common dbs
  * od_*: On-demand governor
  * cs_*: Conservative governor
+ * hp_*: Hotplug governor
  */
 
 /* Per cpu structures */
@@ -163,9 +167,19 @@ struct cs_cpu_dbs_info_s {
        unsigned int enable:1;
 };
 
+struct hp_cpu_dbs_info_s {
+       struct cpu_dbs_common_info cdbs;
+       struct cpufreq_frequency_table *freq_table;
+       unsigned int freq_lo;
+       unsigned int freq_lo_jiffies;
+       unsigned int freq_hi_jiffies;
+       unsigned int rate_mult;
+       unsigned int sample_type:1;
+};
+
 /* Per policy Governers sysfs tunables */
 struct od_dbs_tuners {
-       unsigned int ignore_nice;
+       unsigned int ignore_nice_load;
        unsigned int sampling_rate;
        unsigned int sampling_down_factor;
        unsigned int up_threshold;
@@ -175,7 +189,7 @@ struct od_dbs_tuners {
 };
 
 struct cs_dbs_tuners {
-       unsigned int ignore_nice;
+       unsigned int ignore_nice_load;
        unsigned int sampling_rate;
        unsigned int sampling_down_factor;
        unsigned int up_threshold;
@@ -183,12 +197,40 @@ struct cs_dbs_tuners {
        unsigned int freq_step;
 };
 
+struct hp_dbs_tuners {
+       unsigned int ignore_nice_load;
+       unsigned int sampling_rate;
+       unsigned int sampling_down_factor;
+       unsigned int up_threshold;
+       unsigned int adj_up_threshold;
+       unsigned int powersave_bias;
+       unsigned int io_is_busy;
+// <<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<
+        unsigned int down_differential;
+       unsigned int cpu_up_threshold;
+       unsigned int cpu_down_differential;
+       unsigned int cpu_up_avg_times;
+       unsigned int cpu_down_avg_times;
+       unsigned int cpu_num_limit;
+       unsigned int cpu_num_base;
+       unsigned int is_cpu_hotplug_disable;
+       unsigned int cpu_input_boost_enable;
+       unsigned int cpu_input_boost_num;
+       unsigned int cpu_rush_boost_enable;
+       unsigned int cpu_rush_boost_num;
+       unsigned int cpu_rush_threshold;
+       unsigned int cpu_rush_tlp_times;
+       unsigned int cpu_rush_avg_times;
+// >>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>
+};
+
 /* Common Governer data across policies */
 struct dbs_data;
 struct common_dbs_data {
        /* Common across governors */
        #define GOV_ONDEMAND            0
        #define GOV_CONSERVATIVE        1
+        #define GOV_HOTPLUG            2
        int governor;
        struct attribute_group *attr_group_gov_sys; /* one governor - system */
        struct attribute_group *attr_group_gov_pol; /* one governor - policy */
@@ -230,6 +272,14 @@ struct cs_ops {
        struct notifier_block *notifier_block;
 };
 
+struct hp_ops {
+       void (*powersave_bias_init_cpu)(int cpu);
+       unsigned int (*powersave_bias_target)(struct cpufreq_policy *policy,
+                       unsigned int freq_next, unsigned int relation);
+       void (*freq_increase)(struct cpufreq_policy *p, unsigned int freq);
+       struct input_handler *input_handler; // <-XXX
+};
+
 static inline int delay_for_sampling_rate(unsigned int sampling_rate)
 {
        int delay = usecs_to_jiffies(sampling_rate);
@@ -256,7 +306,6 @@ static ssize_t show_sampling_rate_min_gov_pol                               \
        return sprintf(buf, "%u\n", dbs_data->min_sampling_rate);       \
 }
 
-u64 get_cpu_idle_time(unsigned int cpu, u64 *wall, int io_busy);
 void dbs_check_cpu(struct dbs_data *dbs_data, int cpu);
 bool need_load_eval(struct cpu_dbs_common_info *cdbs,
                unsigned int sampling_rate);
@@ -268,4 +317,8 @@ void od_register_powersave_bias_handler(unsigned int (*f)
                (struct cpufreq_policy *, unsigned int, unsigned int),
                unsigned int powersave_bias);
 void od_unregister_powersave_bias_handler(void);
+void hp_register_powersave_bias_handler(unsigned int (*f)
+               (struct cpufreq_policy *, unsigned int, unsigned int),
+               unsigned int powersave_bias);
+void hp_unregister_powersave_bias_handler(void);
 #endif /* _CPUFREQ_GOVERNOR_H */