ARM: rockchip: rk3228: add grf definition
[firefly-linux-kernel-4.4.55.git] / include / linux / rockchip / dvfs.h
index c684cfe0d3af7144b913b0eef439549250222d4d..1aaffbd055ee1a493888da476ed847c865ee763b 100644 (file)
 #include <linux/device.h>
 #include <linux/clk-provider.h>
 
+#define ARM_DVFS_CH    0
+#define GPU_DVFS_CH    1
+#define LOG_DVFS_CH    2
+
 struct dvfs_node;
 typedef int (*dvfs_set_rate_callback)(struct dvfs_node *clk_dvfs_node, unsigned long rate);
 typedef int (*clk_set_rate_callback)(struct clk *clk, unsigned long rate);
@@ -42,7 +46,7 @@ struct vd_node {
        const char              *name;
        const char              *regulator_name;
        int                     volt_time_flag;// =0 ,is no initing checking ,>0 ,support,<0 not support
-       int                     mode_flag;// =0 ,is no initing checking ,>0 ,support,<0 not support
+       int                     mode_flag;// =0 ,is no initing checking ,>0 ,support,<0 not support;
        int                     cur_volt;
        int                     volt_set_flag;
        int                     suspend_volt;
@@ -53,6 +57,7 @@ struct vd_node {
        dvfs_set_rate_callback  vd_dvfs_target;
        unsigned int            n_voltages;
        int volt_list[VD_VOL_LIST_CNT];
+       unsigned int            regu_mode;
 };
 
 /**
@@ -72,6 +77,34 @@ struct pd_node {
        struct vd_node          *vd;
        struct list_head        node;
        struct list_head        clk_list;
+       unsigned int            regu_mode;
+};
+
+struct pvtm_info {
+       const char *compatible;
+       struct cpufreq_frequency_table *pvtm_table;
+       int channel;
+       int process_version;
+       int scan_rate_hz;
+       int sample_time_us;
+       int volt_step_uv;
+       int delta_pvtm_by_volt;
+       int delta_pvtm_by_temp;
+       int volt_margin_uv;
+       int min_volt_uv;
+       int max_volt_uv;
+       int cluster;
+};
+
+struct lkg_adjust_volt_table {
+       int     lkg;
+       int     dlt_volt;
+};
+
+struct lkg_info {
+       int     def_table_lkg;
+       int     min_adjust_freq;
+       struct  lkg_adjust_volt_table *table;
 };
 
 /**
@@ -94,20 +127,37 @@ struct dvfs_node {
        int                     set_volt;       //MV
        int                     enable_count;
        int                     freq_limit_en;  //sign if use limit frequency
+       int                     support_pvtm;
        unsigned int            min_rate;       //limit min frequency
        unsigned int            max_rate;       //limit max frequency
        unsigned long           last_set_rate;
+       unsigned int            channel;
        unsigned int            temp_channel;
        unsigned long           temp_limit_rate;
+       unsigned int        target_temp;
+       unsigned int        temp_limit_enable;
+       unsigned int        min_temp_limit;
+       int                 old_temp;
        struct clk              *clk;
        struct pd_node          *pd;
        struct vd_node          *vd;
        struct list_head        node;
        struct notifier_block   *dvfs_nb;
        struct cpufreq_frequency_table  *dvfs_table;
+       struct cpufreq_frequency_table  *pvtm_table;
        struct cpufreq_frequency_table  *per_temp_limit_table;
        struct cpufreq_frequency_table  *nor_temp_limit_table;
+       struct cpufreq_frequency_table  *virt_temp_limit_table[4];
        clk_set_rate_callback   clk_dvfs_target;
+       struct cpufreq_frequency_table  *regu_mode_table;
+       int                     regu_mode_en;
+       unsigned int            regu_mode;
+       struct pvtm_info        *pvtm_info;
+       int                 lkg_adjust_volt_en;
+       struct lkg_info         lkg_info;
+       unsigned int            cluster;
+       unsigned int        max_limit_freq;
+       unsigned int        pvtm_min_temp;
 };