summaryrefslogtreecommitdiff
path: root/drivers/video/fbdev/msm
diff options
context:
space:
mode:
authorAjay Singh Parmar <aparmar@codeaurora.org>2017-01-06 16:40:16 -0800
committerGerrit - the friendly Code Review server <code-review@localhost>2017-01-17 17:47:52 -0800
commit7d6cf4f28990b59d476b2a7e889632b2d62e302f (patch)
treef250616185037f7af72fece57cca26b90eb7fcb1 /drivers/video/fbdev/msm
parent80612605edd74022aa335cdce5e3fc568eee8403 (diff)
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>
Diffstat (limited to 'drivers/video/fbdev/msm')
-rw-r--r--drivers/video/fbdev/msm/mdss_dp.c4
-rw-r--r--drivers/video/fbdev/msm/mdss_dp_util.c11
-rw-r--r--drivers/video/fbdev/msm/mdss_dp_util.h4
3 files changed, 10 insertions, 9 deletions
diff --git a/drivers/video/fbdev/msm/mdss_dp.c b/drivers/video/fbdev/msm/mdss_dp.c
index ccf8a0d34a6c..24deef6ba047 100644
--- a/drivers/video/fbdev/msm/mdss_dp.c
+++ b/drivers/video/fbdev/msm/mdss_dp.c
@@ -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);
diff --git a/drivers/video/fbdev/msm/mdss_dp_util.c b/drivers/video/fbdev/msm/mdss_dp_util.c
index a7f42ba8c261..80a83716488b 100644
--- a/drivers/video/fbdev/msm/mdss_dp_util.c
+++ b/drivers/video/fbdev/msm/mdss_dp_util.c
@@ -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);
diff --git a/drivers/video/fbdev/msm/mdss_dp_util.h b/drivers/video/fbdev/msm/mdss_dp_util.h
index fcb9a77db67c..1434ea3f0163 100644
--- a/drivers/video/fbdev/msm/mdss_dp_util.h
+++ b/drivers/video/fbdev/msm/mdss_dp_util.h
@@ -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,