1/*	$NetBSD: priv.h,v 1.3 2021/12/18 23:45:42 riastradh Exp $	*/
2
3/* SPDX-License-Identifier: MIT */
4#ifndef __NVKM_VOLT_PRIV_H__
5#define __NVKM_VOLT_PRIV_H__
6#define nvkm_volt(p) container_of((p), struct nvkm_volt, subdev)
7#include <subdev/volt.h>
8
9void nvkm_volt_ctor(const struct nvkm_volt_func *, struct nvkm_device *,
10		    int index, struct nvkm_volt *);
11int nvkm_volt_new_(const struct nvkm_volt_func *, struct nvkm_device *,
12		   int index, struct nvkm_volt **);
13
14struct nvkm_volt_func {
15	int (*oneinit)(struct nvkm_volt *);
16	int (*volt_get)(struct nvkm_volt *);
17	int (*volt_set)(struct nvkm_volt *, u32 uv);
18	int (*vid_get)(struct nvkm_volt *);
19	int (*vid_set)(struct nvkm_volt *, u8 vid);
20	int (*set_id)(struct nvkm_volt *, u8 id, int condition);
21	int (*speedo_read)(struct nvkm_volt *);
22};
23
24int nvkm_voltgpio_init(struct nvkm_volt *);
25int nvkm_voltgpio_get(struct nvkm_volt *);
26int nvkm_voltgpio_set(struct nvkm_volt *, u8);
27
28int nvkm_voltpwm_init(struct nvkm_volt *volt);
29int nvkm_voltpwm_get(struct nvkm_volt *volt);
30int nvkm_voltpwm_set(struct nvkm_volt *volt, u32 uv);
31
32int gf100_volt_oneinit(struct nvkm_volt *);
33#endif
34