cvb.h 1.4 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667
  1. /*
  2. * Utility functions for parsing Tegra CVB voltage tables
  3. *
  4. * This program is free software; you can redistribute it and/or modify
  5. * it under the terms of the GNU General Public License version 2 as
  6. * published by the Free Software Foundation.
  7. *
  8. * This program is distributed in the hope that 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 __DRIVERS_CLK_TEGRA_CVB_H
  15. #define __DRIVERS_CLK_TEGRA_CVB_H
  16. #include <linux/types.h>
  17. struct device;
  18. #define MAX_DVFS_FREQS 40
  19. struct rail_alignment {
  20. int offset_uv;
  21. int step_uv;
  22. };
  23. struct cvb_coefficients {
  24. int c0;
  25. int c1;
  26. int c2;
  27. };
  28. struct cvb_table_freq_entry {
  29. unsigned long freq;
  30. struct cvb_coefficients coefficients;
  31. };
  32. struct cvb_cpu_dfll_data {
  33. u32 tune0_low;
  34. u32 tune0_high;
  35. u32 tune1;
  36. };
  37. struct cvb_table {
  38. int speedo_id;
  39. int process_id;
  40. int min_millivolts;
  41. int max_millivolts;
  42. struct rail_alignment alignment;
  43. int speedo_scale;
  44. int voltage_scale;
  45. struct cvb_table_freq_entry cvb_table[MAX_DVFS_FREQS];
  46. struct cvb_cpu_dfll_data cpu_dfll_data;
  47. };
  48. const struct cvb_table *tegra_cvb_build_opp_table(
  49. const struct cvb_table *cvb_tables,
  50. size_t sz, int process_id,
  51. int speedo_id, int speedo_value,
  52. unsigned long max_rate,
  53. struct device *opp_dev);
  54. #endif