cvb.h 1.1 KB

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