Commit | Line | Data |
---|---|---|
1802d0be | 1 | /* SPDX-License-Identifier: GPL-2.0-only */ |
fa63aa3d TT |
2 | /* |
3 | * Utility functions for parsing Tegra CVB voltage tables | |
fa63aa3d TT |
4 | */ |
5 | ||
6 | #ifndef __DRIVERS_CLK_TEGRA_CVB_H | |
7 | #define __DRIVERS_CLK_TEGRA_CVB_H | |
8 | ||
9 | #include <linux/types.h> | |
10 | ||
11 | struct device; | |
12 | ||
13 | #define MAX_DVFS_FREQS 40 | |
14 | ||
15 | struct rail_alignment { | |
16 | int offset_uv; | |
17 | int step_uv; | |
18 | }; | |
19 | ||
20 | struct cvb_coefficients { | |
21 | int c0; | |
22 | int c1; | |
23 | int c2; | |
24 | }; | |
25 | ||
26 | struct cvb_table_freq_entry { | |
27 | unsigned long freq; | |
28 | struct cvb_coefficients coefficients; | |
29 | }; | |
30 | ||
31 | struct cvb_cpu_dfll_data { | |
32 | u32 tune0_low; | |
33 | u32 tune0_high; | |
34 | u32 tune1; | |
2b2dbc2f | 35 | unsigned int tune_high_min_millivolts; |
fa63aa3d TT |
36 | }; |
37 | ||
38 | struct cvb_table { | |
39 | int speedo_id; | |
40 | int process_id; | |
41 | ||
42 | int min_millivolts; | |
43 | int max_millivolts; | |
fa63aa3d TT |
44 | |
45 | int speedo_scale; | |
46 | int voltage_scale; | |
e8f6a68c | 47 | struct cvb_table_freq_entry entries[MAX_DVFS_FREQS]; |
fa63aa3d TT |
48 | struct cvb_cpu_dfll_data cpu_dfll_data; |
49 | }; | |
50 | ||
e8f6a68c TR |
51 | const struct cvb_table * |
52 | tegra_cvb_add_opp_table(struct device *dev, const struct cvb_table *cvb_tables, | |
b3cf8d06 JL |
53 | size_t count, struct rail_alignment *align, |
54 | int process_id, int speedo_id, int speedo_value, | |
55 | unsigned long max_freq); | |
f7c42d98 TR |
56 | void tegra_cvb_remove_opp_table(struct device *dev, |
57 | const struct cvb_table *table, | |
58 | unsigned long max_freq); | |
fa63aa3d TT |
59 | |
60 | #endif |