Merge tag 'trace-v5.11-rc2' of git://git.kernel.org/pub/scm/linux/kernel/git/rostedt...
[linux/fpc-iii.git] / drivers / clk / tegra / cvb.h
blob750095fe97d7e32033599d0aec0c279eb7166c24
1 /* SPDX-License-Identifier: GPL-2.0-only */
2 /*
3 * Utility functions for parsing Tegra CVB voltage tables
4 */
6 #ifndef __DRIVERS_CLK_TEGRA_CVB_H
7 #define __DRIVERS_CLK_TEGRA_CVB_H
9 #include <linux/types.h>
11 struct device;
13 #define MAX_DVFS_FREQS 40
15 struct rail_alignment {
16 int offset_uv;
17 int step_uv;
20 struct cvb_coefficients {
21 int c0;
22 int c1;
23 int c2;
26 struct cvb_table_freq_entry {
27 unsigned long freq;
28 struct cvb_coefficients coefficients;
31 struct cvb_cpu_dfll_data {
32 u32 tune0_low;
33 u32 tune0_high;
34 u32 tune1;
35 unsigned int tune_high_min_millivolts;
38 struct cvb_table {
39 int speedo_id;
40 int process_id;
42 int min_millivolts;
43 int max_millivolts;
45 int speedo_scale;
46 int voltage_scale;
47 struct cvb_table_freq_entry entries[MAX_DVFS_FREQS];
48 struct cvb_cpu_dfll_data cpu_dfll_data;
51 const struct cvb_table *
52 tegra_cvb_add_opp_table(struct device *dev, const struct cvb_table *cvb_tables,
53 size_t count, struct rail_alignment *align,
54 int process_id, int speedo_id, int speedo_value,
55 unsigned long max_freq);
56 void tegra_cvb_remove_opp_table(struct device *dev,
57 const struct cvb_table *table,
58 unsigned long max_freq);
60 #endif