volt.h 1.2 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344
  1. /* SPDX-License-Identifier: GPL-2.0 */
  2. #ifndef __NVKM_VOLT_H__
  3. #define __NVKM_VOLT_H__
  4. #include <core/subdev.h>
  5. struct nvkm_volt {
  6. const struct nvkm_volt_func *func;
  7. struct nvkm_subdev subdev;
  8. u8 vid_mask;
  9. u8 vid_nr;
  10. struct {
  11. u32 uv;
  12. u8 vid;
  13. } vid[256];
  14. u32 max_uv;
  15. u32 min_uv;
  16. /*
  17. * These are fully functional map entries creating a sw ceiling for
  18. * the voltage. These all can describe different kind of curves, so
  19. * that for any given temperature a different one can return the lowest
  20. * value of all three.
  21. */
  22. u8 max0_id;
  23. u8 max1_id;
  24. u8 max2_id;
  25. int speedo;
  26. };
  27. int nvkm_volt_map(struct nvkm_volt *volt, u8 id, u8 temperature);
  28. int nvkm_volt_map_min(struct nvkm_volt *volt, u8 id);
  29. int nvkm_volt_get(struct nvkm_volt *);
  30. int nvkm_volt_set_id(struct nvkm_volt *, u8 id, u8 min_id, u8 temp,
  31. int condition);
  32. int nv40_volt_new(struct nvkm_device *, int, struct nvkm_volt **);
  33. int gf100_volt_new(struct nvkm_device *, int, struct nvkm_volt **);
  34. int gk104_volt_new(struct nvkm_device *, int, struct nvkm_volt **);
  35. int gk20a_volt_new(struct nvkm_device *, int, struct nvkm_volt **);
  36. int gm20b_volt_new(struct nvkm_device *, int, struct nvkm_volt **);
  37. #endif