xref: /openbmc/linux/drivers/gpu/drm/nouveau/nvkm/subdev/volt/priv.h (revision d0034a7a4ac7fae708146ac0059b9c47a1543f0d)
1b7019ac5SIlia Mirkin /* SPDX-License-Identifier: MIT */
2437b2296SBen Skeggs #ifndef __NVKM_VOLT_PRIV_H__
3437b2296SBen Skeggs #define __NVKM_VOLT_PRIV_H__
4437b2296SBen Skeggs #define nvkm_volt(p) container_of((p), struct nvkm_volt, subdev)
5437b2296SBen Skeggs #include <subdev/volt.h>
6437b2296SBen Skeggs 
7*d07be5d7SBen Skeggs void nvkm_volt_ctor(const struct nvkm_volt_func *, struct nvkm_device *, enum nvkm_subdev_type, int,
8*d07be5d7SBen Skeggs 		    struct nvkm_volt *);
9*d07be5d7SBen Skeggs int nvkm_volt_new_(const struct nvkm_volt_func *, struct nvkm_device *, enum nvkm_subdev_type, int,
10*d07be5d7SBen Skeggs 		   struct nvkm_volt **);
11437b2296SBen Skeggs 
12437b2296SBen Skeggs struct nvkm_volt_func {
1308de5743SKarol Herbst 	int (*oneinit)(struct nvkm_volt *);
144c58a05bSMartin Peres 	int (*volt_get)(struct nvkm_volt *);
154c58a05bSMartin Peres 	int (*volt_set)(struct nvkm_volt *, u32 uv);
16437b2296SBen Skeggs 	int (*vid_get)(struct nvkm_volt *);
17437b2296SBen Skeggs 	int (*vid_set)(struct nvkm_volt *, u8 vid);
18437b2296SBen Skeggs 	int (*set_id)(struct nvkm_volt *, u8 id, int condition);
1908de5743SKarol Herbst 	int (*speedo_read)(struct nvkm_volt *);
20437b2296SBen Skeggs };
21437b2296SBen Skeggs 
22437b2296SBen Skeggs int nvkm_voltgpio_init(struct nvkm_volt *);
23437b2296SBen Skeggs int nvkm_voltgpio_get(struct nvkm_volt *);
24437b2296SBen Skeggs int nvkm_voltgpio_set(struct nvkm_volt *, u8);
251531dbbbSMartin Peres 
261531dbbbSMartin Peres int nvkm_voltpwm_init(struct nvkm_volt *volt);
271531dbbbSMartin Peres int nvkm_voltpwm_get(struct nvkm_volt *volt);
281531dbbbSMartin Peres int nvkm_voltpwm_set(struct nvkm_volt *volt, u32 uv);
2908de5743SKarol Herbst 
3008de5743SKarol Herbst int gf100_volt_oneinit(struct nvkm_volt *);
31437b2296SBen Skeggs #endif
32