cvb.h 1.5 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869
  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 entries[MAX_DVFS_FREQS];
  46. struct cvb_cpu_dfll_data cpu_dfll_data;
  47. };
  48. const struct cvb_table *
  49. tegra_cvb_add_opp_table(struct device *dev, const struct cvb_table *cvb_tables,
  50. size_t count, int process_id, int speedo_id,
  51. int speedo_value, unsigned long max_freq);
  52. void tegra_cvb_remove_opp_table(struct device *dev,
  53. const struct cvb_table *table,
  54. unsigned long max_freq);
  55. #endif