Skip to content

Commit

Permalink
drm/amd/display: Read resource_straps from registers for DCE12
Browse files Browse the repository at this point in the history
Now that the registers exist, assign them to the resource_straps struct.

v2: Fix indentation
v3: Fix trailing whitespace and checkpatch warnings.

bug: https://bugs.freedesktop.org/show_bug.cgi?id=103404
Reviewed-by: Harry Wentland <harry.wentland@amd.com>
Signed-off-by: Leo (Sunpeng) Li <sunpeng.li@amd.com>
Signed-off-by: Alex Deucher <alexander.deucher@amd.com>
  • Loading branch information
Leo (Sunpeng) Li authored and Alex Deucher committed Nov 2, 2017
1 parent b7fa851 commit 4a74635
Showing 1 changed file with 13 additions and 6 deletions.
19 changes: 13 additions & 6 deletions drivers/gpu/drm/amd/display/dc/dce120/dce120_resource.c
Original file line number Diff line number Diff line change
Expand Up @@ -501,12 +501,19 @@ static void read_dce_straps(
struct dc_context *ctx,
struct resource_straps *straps)
{
/* TODO: Registers are missing */
/*REG_GET_2(CC_DC_HDMI_STRAPS,
HDMI_DISABLE, &straps->hdmi_disable,
AUDIO_STREAM_NUMBER, &straps->audio_stream_number);
REG_GET(DC_PINSTRAPS, DC_PINSTRAPS_AUDIO, &straps->dc_pinstraps_audio);*/
uint32_t reg_val = dm_read_reg_soc15(ctx, mmCC_DC_MISC_STRAPS, 0);

straps->audio_stream_number = get_reg_field_value(reg_val,
CC_DC_MISC_STRAPS,
AUDIO_STREAM_NUMBER);
straps->hdmi_disable = get_reg_field_value(reg_val,
CC_DC_MISC_STRAPS,
HDMI_DISABLE);

reg_val = dm_read_reg_soc15(ctx, mmDC_PINSTRAPS, 0);
straps->dc_pinstraps_audio = get_reg_field_value(reg_val,
DC_PINSTRAPS,
DC_PINSTRAPS_AUDIO);
}

static struct audio *create_audio(
Expand Down

0 comments on commit 4a74635

Please sign in to comment.