提交 9bd2bae1 编写于 作者: R Rex Zhu 提交者: Alex Deucher

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

Reviewed-by: NAlex Deucher <alexander.deucher@amd.com>
Signed-off-by: NRex Zhu <Rex.Zhu@amd.com>
Signed-off-by: NAlex Deucher <alexander.deucher@amd.com>
上级 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% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册
新手
引导
客服 返回
顶部