1 #ifndef __NVKM_VOLT_H__
2 #define __NVKM_VOLT_H__
3 #include <core/subdev.h>
11 struct nvkm_subdev base;
13 int (*vid_get)(struct nvkm_volt *);
14 int (*get)(struct nvkm_volt *);
15 int (*vid_set)(struct nvkm_volt *, u8 vid);
16 int (*set)(struct nvkm_volt *, u32 uv);
17 int (*set_id)(struct nvkm_volt *, u8 id, int condition);
27 static inline struct nvkm_volt *
30 return (void *)nvkm_subdev(obj, NVDEV_SUBDEV_VOLT);
33 #define nvkm_volt_create(p, e, o, d) \
34 nvkm_volt_create_((p), (e), (o), sizeof(**d), (void **)d)
35 #define nvkm_volt_destroy(p) ({ \
36 struct nvkm_volt *v = (p); \
37 _nvkm_volt_dtor(nv_object(v)); \
39 #define nvkm_volt_init(p) ({ \
40 struct nvkm_volt *v = (p); \
41 _nvkm_volt_init(nv_object(v)); \
43 #define nvkm_volt_fini(p,s) \
44 nvkm_subdev_fini((p), (s))
46 int nvkm_volt_create_(struct nvkm_object *, struct nvkm_object *,
47 struct nvkm_oclass *, int, void **);
48 void _nvkm_volt_dtor(struct nvkm_object *);
49 int _nvkm_volt_init(struct nvkm_object *);
50 #define _nvkm_volt_fini _nvkm_subdev_fini
52 extern struct nvkm_oclass nv40_volt_oclass;
53 extern struct nvkm_oclass gk20a_volt_oclass;
55 int nvkm_voltgpio_init(struct nvkm_volt *);
56 int nvkm_voltgpio_get(struct nvkm_volt *);
57 int nvkm_voltgpio_set(struct nvkm_volt *, u8);