priv.h 1.0 KB
Newer Older
1 2 3 4 5 6 7 8 9 10 11
#ifndef __NVKM_VOLT_PRIV_H__
#define __NVKM_VOLT_PRIV_H__
#define nvkm_volt(p) container_of((p), struct nvkm_volt, subdev)
#include <subdev/volt.h>

void nvkm_volt_ctor(const struct nvkm_volt_func *, struct nvkm_device *,
		    int index, struct nvkm_volt *);
int nvkm_volt_new_(const struct nvkm_volt_func *, struct nvkm_device *,
		   int index, struct nvkm_volt **);

struct nvkm_volt_func {
K
Karol Herbst 已提交
12
	int (*oneinit)(struct nvkm_volt *);
13 14
	int (*volt_get)(struct nvkm_volt *);
	int (*volt_set)(struct nvkm_volt *, u32 uv);
15 16 17
	int (*vid_get)(struct nvkm_volt *);
	int (*vid_set)(struct nvkm_volt *, u8 vid);
	int (*set_id)(struct nvkm_volt *, u8 id, int condition);
K
Karol Herbst 已提交
18
	int (*speedo_read)(struct nvkm_volt *);
19 20 21 22 23
};

int nvkm_voltgpio_init(struct nvkm_volt *);
int nvkm_voltgpio_get(struct nvkm_volt *);
int nvkm_voltgpio_set(struct nvkm_volt *, u8);
24 25 26 27

int nvkm_voltpwm_init(struct nvkm_volt *volt);
int nvkm_voltpwm_get(struct nvkm_volt *volt);
int nvkm_voltpwm_set(struct nvkm_volt *volt, u32 uv);
K
Karol Herbst 已提交
28 29

int gf100_volt_oneinit(struct nvkm_volt *);
30
#endif