1b7019ac5SIlia Mirkin /* SPDX-License-Identifier: MIT */ 2de3aaa66SBen Skeggs #ifndef __NVKM_VOLT_H__ 3de3aaa66SBen Skeggs #define __NVKM_VOLT_H__ 4c39f472eSBen Skeggs #include <core/subdev.h> 5c39f472eSBen Skeggs 6de3aaa66SBen Skeggs struct nvkm_volt { 7437b2296SBen Skeggs const struct nvkm_volt_func *func; 86052dc57SBen Skeggs struct nvkm_subdev subdev; 9c39f472eSBen Skeggs 10c39f472eSBen Skeggs u8 vid_mask; 11c39f472eSBen Skeggs u8 vid_nr; 12c39f472eSBen Skeggs struct { 13c39f472eSBen Skeggs u32 uv; 14c39f472eSBen Skeggs u8 vid; 15c39f472eSBen Skeggs } vid[256]; 16437bb44dSKarol Herbst 17437bb44dSKarol Herbst u32 max_uv; 18437bb44dSKarol Herbst u32 min_uv; 194a4555a7SKarol Herbst 204a4555a7SKarol Herbst /* 214a4555a7SKarol Herbst * These are fully functional map entries creating a sw ceiling for 224a4555a7SKarol Herbst * the voltage. These all can describe different kind of curves, so 234a4555a7SKarol Herbst * that for any given temperature a different one can return the lowest 244a4555a7SKarol Herbst * value of all three. 254a4555a7SKarol Herbst */ 264a4555a7SKarol Herbst u8 max0_id; 274a4555a7SKarol Herbst u8 max1_id; 284a4555a7SKarol Herbst u8 max2_id; 2908de5743SKarol Herbst 3008de5743SKarol Herbst int speedo; 31c39f472eSBen Skeggs }; 32c39f472eSBen Skeggs 331f7f3d91SKarol Herbst int nvkm_volt_map(struct nvkm_volt *volt, u8 id, u8 temperature); 3417d063dbSKarol Herbst int nvkm_volt_map_min(struct nvkm_volt *volt, u8 id); 35437b2296SBen Skeggs int nvkm_volt_get(struct nvkm_volt *); 368d08c264SKarol Herbst int nvkm_volt_set_id(struct nvkm_volt *, u8 id, u8 min_id, u8 temp, 378d08c264SKarol Herbst int condition); 38c39f472eSBen Skeggs 39*d07be5d7SBen Skeggs int nv40_volt_new(struct nvkm_device *, enum nvkm_subdev_type, int inst, struct nvkm_volt **); 40*d07be5d7SBen Skeggs int gf100_volt_new(struct nvkm_device *, enum nvkm_subdev_type, int inst, struct nvkm_volt **); 41*d07be5d7SBen Skeggs int gf117_volt_new(struct nvkm_device *, enum nvkm_subdev_type, int inst, struct nvkm_volt **); 42*d07be5d7SBen Skeggs int gk104_volt_new(struct nvkm_device *, enum nvkm_subdev_type, int inst, struct nvkm_volt **); 43*d07be5d7SBen Skeggs int gk20a_volt_new(struct nvkm_device *, enum nvkm_subdev_type, int inst, struct nvkm_volt **); 44*d07be5d7SBen Skeggs int gm20b_volt_new(struct nvkm_device *, enum nvkm_subdev_type, int inst, struct nvkm_volt **); 45c39f472eSBen Skeggs #endif 46