summaryrefslogtreecommitdiff
path: root/drivers/gpu/drm/nouveau/include/nvkm/subdev/bios/volt.h
blob: b0df610cec2b5ba3a28966092ec53726ef9e00d9 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
#ifndef __NVBIOS_VOLT_H__
#define __NVBIOS_VOLT_H__

enum nvbios_volt_type {
	NVBIOS_VOLT_GPIO = 0,
	NVBIOS_VOLT_PWM,
};

struct nvbios_volt {
	enum nvbios_volt_type type;
	u32 min;
	u32 max;
	u32 base;

	/* GPIO mode */
	u8  vidmask;
	s16 step;

	/* PWM mode */
	u32 pwm_freq;
	u32 pwm_range;
};

u16 nvbios_volt_table(struct nvkm_bios *, u8 *ver, u8 *hdr, u8 *cnt, u8 *len);
u16 nvbios_volt_parse(struct nvkm_bios *, u8 *ver, u8 *hdr, u8 *cnt, u8 *len,
		      struct nvbios_volt *);

struct nvbios_volt_entry {
	u32 voltage;
	u8  vid;
};

u16 nvbios_volt_entry(struct nvkm_bios *, int idx, u8 *ver, u8 *len);
u16 nvbios_volt_entry_parse(struct nvkm_bios *, int idx, u8 *ver, u8 *len,
			    struct nvbios_volt_entry *);
#endif