1 /* SPDX-License-Identifier: GPL-2.0 */ 2 #ifndef __NVBIOS_VOLT_H__ 3 #define __NVBIOS_VOLT_H__ 4 5 enum nvbios_volt_type { 6 NVBIOS_VOLT_GPIO = 0, 7 NVBIOS_VOLT_PWM, 8 }; 9 10 struct nvbios_volt { 11 enum nvbios_volt_type type; 12 u32 min; 13 u32 max; 14 u32 base; 15 16 /* GPIO mode */ 17 bool ranged; 18 u8 vidmask; 19 s16 step; 20 21 /* PWM mode */ 22 u32 pwm_freq; 23 u32 pwm_range; 24 }; 25 26 u32 nvbios_volt_table(struct nvkm_bios *, u8 *ver, u8 *hdr, u8 *cnt, u8 *len); 27 u32 nvbios_volt_parse(struct nvkm_bios *, u8 *ver, u8 *hdr, u8 *cnt, u8 *len, 28 struct nvbios_volt *); 29 30 struct nvbios_volt_entry { 31 u32 voltage; 32 u8 vid; 33 }; 34 35 u32 nvbios_volt_entry(struct nvkm_bios *, int idx, u8 *ver, u8 *len); 36 u32 nvbios_volt_entry_parse(struct nvkm_bios *, int idx, u8 *ver, u8 *len, 37 struct nvbios_volt_entry *); 38 #endif 39