msm: mdss: dp: fix audio stream header

Program the correct number of channels for header byte 3 in
audio stream to avoid issues related to audio channels.

Change-Id: I1de32403efc42d8fde8ac2096ae021e795707aae
Signed-off-by: Ajay Singh Parmar <aparmar@codeaurora.org>
This commit is contained in:
Ajay Singh Parmar 2017-01-06 16:40:16 -08:00 committed by Gerrit - the friendly Code Review server
parent 80612605ed
commit 7d6cf4f289
3 changed files with 10 additions and 9 deletions

View file

@ -1,4 +1,4 @@
/* Copyright (c) 2012-2016 The Linux Foundation. All rights reserved.
/* Copyright (c) 2012-2017, The Linux Foundation. All rights reserved.
*
* This program is free software; you can redistribute it and/or modify
* it under the terms of the GNU General Public License version 2 and
@ -905,7 +905,7 @@ static int dp_audio_info_setup(struct platform_device *pdev,
return -ENODEV;
}
mdss_dp_audio_setup_sdps(&dp_ctrl->ctrl_io);
mdss_dp_audio_setup_sdps(&dp_ctrl->ctrl_io, params->num_of_channels);
mdss_dp_config_audio_acr_ctrl(&dp_ctrl->ctrl_io, dp_ctrl->link_rate);
mdss_dp_set_safe_to_exit_level(&dp_ctrl->ctrl_io, dp_ctrl->lane_cnt);
mdss_dp_audio_enable(&dp_ctrl->ctrl_io, true);

View file

@ -1,4 +1,4 @@
/* Copyright (c) 2016, The Linux Foundation. All rights reserved.
/* Copyright (c) 2016-2017, The Linux Foundation. All rights reserved.
*
* This program is free software; you can redistribute it and/or modify
* it under the terms of the GNU General Public License version 2 and
@ -1113,7 +1113,8 @@ static u8 mdss_dp_calculate_parity_byte(u32 data)
return parityByte;
}
static void mdss_dp_audio_setup_audio_stream_sdp(struct dss_io_data *ctrl_io)
static void mdss_dp_audio_setup_audio_stream_sdp(struct dss_io_data *ctrl_io,
u32 num_of_channels)
{
u32 value = 0;
u32 new_value = 0;
@ -1141,7 +1142,7 @@ static void mdss_dp_audio_setup_audio_stream_sdp(struct dss_io_data *ctrl_io)
/* Config header and parity byte 3 */
value = readl_relaxed(ctrl_io->base + MMSS_DP_AUDIO_STREAM_1);
new_value = 0x01;
new_value = num_of_channels - 1;
parity_byte = mdss_dp_calculate_parity_byte(new_value);
value |= ((new_value << HEADER_BYTE_3_BIT)
| (parity_byte << PARITY_BYTE_3_BIT));
@ -1309,7 +1310,7 @@ static void mdss_dp_audio_setup_isrc_sdp(struct dss_io_data *ctrl_io)
writel_relaxed(0x0, ctrl_io->base + MMSS_DP_AUDIO_ISRC_4);
}
void mdss_dp_audio_setup_sdps(struct dss_io_data *ctrl_io)
void mdss_dp_audio_setup_sdps(struct dss_io_data *ctrl_io, u32 num_of_channels)
{
u32 sdp_cfg = 0;
u32 sdp_cfg2 = 0;
@ -1335,7 +1336,7 @@ void mdss_dp_audio_setup_sdps(struct dss_io_data *ctrl_io)
writel_relaxed(sdp_cfg2, ctrl_io->base + MMSS_DP_SDP_CFG2);
mdss_dp_audio_setup_audio_stream_sdp(ctrl_io);
mdss_dp_audio_setup_audio_stream_sdp(ctrl_io, num_of_channels);
mdss_dp_audio_setup_audio_timestamp_sdp(ctrl_io);
mdss_dp_audio_setup_audio_infoframe_sdp(ctrl_io);
mdss_dp_audio_setup_copy_management_sdp(ctrl_io);

View file

@ -1,4 +1,4 @@
/* Copyright (c) 2016, The Linux Foundation. All rights reserved.
/* Copyright (c) 2016-2017, The Linux Foundation. All rights reserved.
*
* This program is free software; you can redistribute it and/or modify
* it under the terms of the GNU General Public License version 2 and
@ -312,7 +312,7 @@ void mdss_dp_phy_share_lane_config(struct dss_io_data *phy_io,
u8 orientation, u8 ln_cnt);
void mdss_dp_config_audio_acr_ctrl(struct dss_io_data *ctrl_io,
char link_rate);
void mdss_dp_audio_setup_sdps(struct dss_io_data *ctrl_io);
void mdss_dp_audio_setup_sdps(struct dss_io_data *ctrl_io, u32 num_of_channels);
void mdss_dp_audio_enable(struct dss_io_data *ctrl_io, bool enable);
void mdss_dp_audio_select_core(struct dss_io_data *ctrl_io);
void mdss_dp_audio_set_sample_rate(struct dss_io_data *ctrl_io,