提交 61fb192a 编写于 作者: A Alex Deucher

drm/radeon/dpm: add a helper to encode pcie lane setting

convert from number of lanes to register setting.
Signed-off-by: NAlex Deucher <alexander.deucher@amd.com>
上级 c4453e66
......@@ -1246,3 +1246,13 @@ u16 r600_get_pcie_lane_support(struct radeon_device *rdev,
return 16;
}
}
u8 r600_encode_pci_lane_width(u32 lanes)
{
u8 encoded_lanes[] = { 0, 1, 2, 0, 3, 0, 0, 0, 4, 0, 0, 0, 5, 0, 0, 0, 6 };
if (lanes > 16)
return 0;
return encoded_lanes[lanes];
}
......@@ -227,5 +227,6 @@ enum radeon_pcie_gen r600_get_pcie_gen_support(struct radeon_device *rdev,
u16 r600_get_pcie_lane_support(struct radeon_device *rdev,
u16 asic_lanes,
u16 default_lanes);
u8 r600_encode_pci_lane_width(u32 lanes);
#endif
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册