ARM: rockchip: rk3228: add grf definition
[firefly-linux-kernel-4.4.55.git] / include / linux / rockchip / dvfs.h
index 209374a211825590c0448694b63e19f98f3b5391..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);
@@ -76,6 +80,33 @@ struct pd_node {
        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;
+};
+
 /**
  * struct dvfs_node:   To Store All dvfs clocks' info
  * @name:              Dvfs clock's Name
@@ -96,17 +127,24 @@ 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];
@@ -114,6 +152,12 @@ struct dvfs_node {
        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;
 };