Back to home page

OSCL-LXR

 
 

    


0001 /* SPDX-License-Identifier: MIT */
0002 #ifndef __NVKM_VOLT_H__
0003 #define __NVKM_VOLT_H__
0004 #include <core/subdev.h>
0005 
0006 struct nvkm_volt {
0007     const struct nvkm_volt_func *func;
0008     struct nvkm_subdev subdev;
0009 
0010     u8 vid_mask;
0011     u8 vid_nr;
0012     struct {
0013         u32 uv;
0014         u8 vid;
0015     } vid[256];
0016 
0017     u32 max_uv;
0018     u32 min_uv;
0019 
0020     /*
0021      * These are fully functional map entries creating a sw ceiling for
0022      * the voltage. These all can describe different kind of curves, so
0023      * that for any given temperature a different one can return the lowest
0024      * value of all three.
0025      */
0026     u8 max0_id;
0027     u8 max1_id;
0028     u8 max2_id;
0029 
0030     int speedo;
0031 };
0032 
0033 int nvkm_volt_map(struct nvkm_volt *volt, u8 id, u8 temperature);
0034 int nvkm_volt_map_min(struct nvkm_volt *volt, u8 id);
0035 int nvkm_volt_get(struct nvkm_volt *);
0036 int nvkm_volt_set_id(struct nvkm_volt *, u8 id, u8 min_id, u8 temp,
0037              int condition);
0038 
0039 int nv40_volt_new(struct nvkm_device *, enum nvkm_subdev_type, int inst, struct nvkm_volt **);
0040 int gf100_volt_new(struct nvkm_device *, enum nvkm_subdev_type, int inst, struct nvkm_volt **);
0041 int gf117_volt_new(struct nvkm_device *, enum nvkm_subdev_type, int inst, struct nvkm_volt **);
0042 int gk104_volt_new(struct nvkm_device *, enum nvkm_subdev_type, int inst, struct nvkm_volt **);
0043 int gk20a_volt_new(struct nvkm_device *, enum nvkm_subdev_type, int inst, struct nvkm_volt **);
0044 int gm20b_volt_new(struct nvkm_device *, enum nvkm_subdev_type, int inst, struct nvkm_volt **);
0045 #endif