soc: rockchip: fixed compilation error
[firefly-linux-kernel-4.4.55.git] / include / soc / rockchip / scpi.h
1 /*
2  * Copyright (C) 2017, Fuzhou Rockchip Electronics Co., Ltd
3  *
4  * This program is free software; you can redistribute it and/or modify it
5  * under the terms and conditions of the GNU General Public License,
6  * version 2, as published by the Free Software Foundation.
7  *
8  * This program is distributed in the hope it will be useful, but WITHOUT
9  * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
10  * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for
11  * more details.
12  */
13
14 #ifndef __SOC_ROCKCHIP_SCPI_H
15 #define __SOC_ROCKCHIP_SCPI_H
16
17 #include <linux/rockchip/common.h>
18
19 #ifdef CONFIG_RK3368_SCPI_PROTOCOL
20 struct scpi_opp_entry {
21         u32 freq_hz;
22         u32 volt_mv;
23 } __packed;
24
25 struct scpi_opp {
26         struct scpi_opp_entry *opp;
27         u32 latency; /* in usecs */
28         int count;
29 } __packed;
30
31 unsigned long scpi_clk_get_val(u16 clk_id);
32 int scpi_clk_set_val(u16 clk_id, unsigned long rate);
33 int scpi_dvfs_get_idx(u8 domain);
34 int scpi_dvfs_set_idx(u8 domain, u8 idx);
35 struct scpi_opp *scpi_dvfs_get_opps(u8 domain);
36 int scpi_get_sensor(char *name);
37 int scpi_get_sensor_value(u16 sensor, u32 *val);
38 int scpi_sys_set_jtagmux_on_off(u32 en);
39 int scpi_sys_set_mcu_state_suspend(void);
40 int scpi_sys_set_mcu_state_resume(void);
41
42 int scpi_ddr_init(u32 dram_speed_bin, u32 freq, u32 lcdc_type,
43                   u32 addr_mcu_el3);
44 int scpi_ddr_set_clk_rate(u32 rate, u32 lcdc_type);
45 int scpi_ddr_send_timing(u32 *p, u32 size);
46 int scpi_ddr_round_rate(u32 m_hz);
47 int scpi_ddr_set_auto_self_refresh(u32 en);
48 int scpi_ddr_bandwidth_get(struct ddr_bw_info *ddr_bw_ch0,
49                            struct ddr_bw_info *ddr_bw_ch1);
50 int scpi_ddr_get_clk_rate(void);
51 int scpi_thermal_get_temperature(void);
52 int scpi_thermal_set_clk_cycle(u32 cycle);
53 #else
54 static inline unsigned long scpi_clk_get_val(u16 clk_id)
55 {
56         return -EPERM;
57 }
58
59 static inline int scpi_clk_set_val(u16 clk_id, unsigned long rate)
60 {
61         return -EPERM;
62 }
63
64 static inline int scpi_dvfs_get_idx(u8 domain)
65 {
66         return -EPERM;
67 }
68
69 static inline int scpi_dvfs_set_idx(u8 domain, u8 idx)
70 {
71         return -EPERM;
72 }
73
74 static inline struct scpi_opp *scpi_dvfs_get_opps(u8 domain)
75 {
76         return ERR_PTR(-EPERM);
77 }
78
79 static inline int scpi_get_sensor(char *name)
80 {
81         return -EPERM;
82 }
83
84 static inline int scpi_get_sensor_value(u16 sensor, u32 *val)
85 {
86         return -EPERM;
87 }
88
89 static inline int scpi_sys_set_jtagmux_on_off(u32 en)
90 {
91         return -EPERM;
92 }
93
94 static inline int scpi_sys_set_mcu_state_suspend(void)
95 {
96         return -EPERM;
97 }
98
99 static inline int scpi_sys_set_mcu_state_resume(void)
100 {
101         return -EPERM;
102 }
103
104 static inline int scpi_ddr_init(u32 dram_speed_bin, u32 freq, u32 lcdc_type,
105                                 u32 addr_mcu_el3)
106 {
107         return -EPERM;
108 }
109
110 static inline int scpi_ddr_set_clk_rate(u32 rate, u32 lcdc_type)
111 {
112         return -EPERM;
113 }
114
115 static inline int scpi_ddr_send_timing(u32 *p, u32 size)
116 {
117         return -EPERM;
118 }
119
120 static inline int scpi_ddr_round_rate(u32 m_hz)
121 {
122         return -EPERM;
123 }
124
125 static inline int scpi_ddr_set_auto_self_refresh(u32 en)
126 {
127         return -EPERM;
128 }
129
130 static inline int scpi_ddr_bandwidth_get(struct ddr_bw_info *ddr_bw_ch0,
131                                          struct ddr_bw_info *ddr_bw_ch1)
132 {
133         return -EPERM;
134 }
135
136 static inline int scpi_ddr_get_clk_rate(void)
137 {
138         return -EPERM;
139 }
140
141 static inline int scpi_thermal_get_temperature(void)
142 {
143         return -EPERM;
144 }
145
146 static inline int scpi_thermal_set_clk_cycle(u32 cycle)
147 {
148         return -EPERM;
149 }
150 #endif
151 #endif