Commit 9bd2bae1 authored by Rex Zhu's avatar Rex Zhu Committed by Alex Deucher

drm/amd/pp: Add a helper to convert VID to voltage value

Reviewed-by: default avatarAlex Deucher <alexander.deucher@amd.com>
Signed-off-by: default avatarRex Zhu <Rex.Zhu@amd.com>
Signed-off-by: default avatarAlex Deucher <alexander.deucher@amd.com>
parent 64b9342f
...@@ -60,6 +60,11 @@ uint8_t convert_to_vid(uint16_t vddc) ...@@ -60,6 +60,11 @@ uint8_t convert_to_vid(uint16_t vddc)
return (uint8_t) ((6200 - (vddc * VOLTAGE_SCALE)) / 25); return (uint8_t) ((6200 - (vddc * VOLTAGE_SCALE)) / 25);
} }
uint16_t convert_to_vddc(uint8_t vid)
{
return (uint16_t) ((6200 - (vid * 25)) / VOLTAGE_SCALE);
}
static int phm_get_pci_bus_devfn(struct pp_hwmgr *hwmgr, static int phm_get_pci_bus_devfn(struct pp_hwmgr *hwmgr,
struct cgs_system_info *sys_info) struct cgs_system_info *sys_info)
{ {
......
...@@ -42,6 +42,7 @@ struct pp_atomctrl_voltage_table; ...@@ -42,6 +42,7 @@ struct pp_atomctrl_voltage_table;
#define VOLTAGE_SCALE 4 #define VOLTAGE_SCALE 4
uint8_t convert_to_vid(uint16_t vddc); uint8_t convert_to_vid(uint16_t vddc);
uint16_t convert_to_vddc(uint8_t vid);
enum DISPLAY_GAP { enum DISPLAY_GAP {
DISPLAY_GAP_VBLANK_OR_WM = 0, /* Wait for vblank or MCHG watermark. */ DISPLAY_GAP_VBLANK_OR_WM = 0, /* Wait for vblank or MCHG watermark. */
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment