mirror of
https://github.com/torvalds/linux.git
synced 2026-05-27 16:44:58 +02:00
drm/amd/display/dc: add support for oem i2c in atom_firmware_info_v3_1
The fields are marked as reserved in atom_firmware_info_v3_1, but thet contain valid data in all of the vbios images I've looked at so add parse these fields as per atom_firmware_info_v3_2. The offsets are the same and the reset of the structure is the same. v2: squash in NULL checks Reviewed-by: Harry Wentland <harry.wentland@amd.com> Signed-off-by: Alex Deucher <alexander.deucher@amd.com>
This commit is contained in:
parent
3d5470c973
commit
d957d4a3f8
|
|
@ -1778,6 +1778,7 @@ static enum bp_result get_firmware_info_v3_1(
|
|||
struct dc_firmware_info *info)
|
||||
{
|
||||
struct atom_firmware_info_v3_1 *firmware_info;
|
||||
struct atom_firmware_info_v3_2 *firmware_info32;
|
||||
struct atom_display_controller_info_v4_1 *dce_info = NULL;
|
||||
|
||||
if (!info)
|
||||
|
|
@ -1785,11 +1786,13 @@ static enum bp_result get_firmware_info_v3_1(
|
|||
|
||||
firmware_info = GET_IMAGE(struct atom_firmware_info_v3_1,
|
||||
DATA_TABLES(firmwareinfo));
|
||||
firmware_info32 = GET_IMAGE(struct atom_firmware_info_v3_2,
|
||||
DATA_TABLES(firmwareinfo));
|
||||
|
||||
dce_info = GET_IMAGE(struct atom_display_controller_info_v4_1,
|
||||
DATA_TABLES(dce_info));
|
||||
|
||||
if (!firmware_info || !dce_info)
|
||||
if (!firmware_info || !firmware_info32 || !dce_info)
|
||||
return BP_RESULT_BADBIOSTABLE;
|
||||
|
||||
memset(info, 0, sizeof(*info));
|
||||
|
|
@ -1817,7 +1820,15 @@ static enum bp_result get_firmware_info_v3_1(
|
|||
bp->cmd_tbl.get_smu_clock_info(bp, SMU9_SYSPLL0_ID) * 10;
|
||||
}
|
||||
|
||||
info->oem_i2c_present = false;
|
||||
/* These fields are marked as reserved in v3_1, but they appear to be populated
|
||||
* properly.
|
||||
*/
|
||||
if (firmware_info32 && firmware_info32->board_i2c_feature_id == 0x2) {
|
||||
info->oem_i2c_present = true;
|
||||
info->oem_i2c_obj_id = firmware_info32->board_i2c_feature_gpio_id;
|
||||
} else {
|
||||
info->oem_i2c_present = false;
|
||||
}
|
||||
|
||||
return BP_RESULT_OK;
|
||||
}
|
||||
|
|
|
|||
Loading…
Reference in New Issue
Block a user