disp: msm: dp: add session check for audio register programming
Add a check to ensure that audio registers are programmed only when the DP timing engine (audio session) is enabled. This will reduce the likelihood of un-clocked register access for audio related operations. Change-Id: I6fe59cf53dc721b5470ad4cf7d84e8606800a246 CRs-Fixed: 2465406 Signed-off-by: Tatenda Chipeperekwa <tatendac@codeaurora.org>
This commit is contained in:
@@ -22,7 +22,7 @@ struct dp_audio_private {
|
|||||||
struct dp_panel *panel;
|
struct dp_panel *panel;
|
||||||
|
|
||||||
bool ack_enabled;
|
bool ack_enabled;
|
||||||
bool session_on;
|
atomic_t session_on;
|
||||||
bool engine_on;
|
bool engine_on;
|
||||||
|
|
||||||
u32 channels;
|
u32 channels;
|
||||||
@@ -293,6 +293,11 @@ static void dp_audio_isrc_sdp(struct dp_audio_private *audio)
|
|||||||
|
|
||||||
static void dp_audio_setup_sdp(struct dp_audio_private *audio)
|
static void dp_audio_setup_sdp(struct dp_audio_private *audio)
|
||||||
{
|
{
|
||||||
|
if (!atomic_read(&audio->session_on)) {
|
||||||
|
pr_warn("session inactive\n");
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
|
||||||
/* always program stream 0 first before actual stream cfg */
|
/* always program stream 0 first before actual stream cfg */
|
||||||
audio->catalog->stream_id = DP_STREAM_0;
|
audio->catalog->stream_id = DP_STREAM_0;
|
||||||
audio->catalog->config_sdp(audio->catalog);
|
audio->catalog->config_sdp(audio->catalog);
|
||||||
@@ -314,6 +319,11 @@ static void dp_audio_setup_acr(struct dp_audio_private *audio)
|
|||||||
u32 select = 0;
|
u32 select = 0;
|
||||||
struct dp_catalog_audio *catalog = audio->catalog;
|
struct dp_catalog_audio *catalog = audio->catalog;
|
||||||
|
|
||||||
|
if (!atomic_read(&audio->session_on)) {
|
||||||
|
pr_warn("session inactive\n");
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
|
||||||
switch (audio->dp_audio.bw_code) {
|
switch (audio->dp_audio.bw_code) {
|
||||||
case DP_LINK_BW_1_62:
|
case DP_LINK_BW_1_62:
|
||||||
select = 0;
|
select = 0;
|
||||||
@@ -341,10 +351,14 @@ static void dp_audio_enable(struct dp_audio_private *audio, bool enable)
|
|||||||
{
|
{
|
||||||
struct dp_catalog_audio *catalog = audio->catalog;
|
struct dp_catalog_audio *catalog = audio->catalog;
|
||||||
|
|
||||||
|
audio->engine_on = enable;
|
||||||
|
if (!atomic_read(&audio->session_on)) {
|
||||||
|
pr_warn("session inactive. enable=%d\n", enable);
|
||||||
|
return;
|
||||||
|
}
|
||||||
catalog->data = enable;
|
catalog->data = enable;
|
||||||
catalog->enable(catalog);
|
catalog->enable(catalog);
|
||||||
|
|
||||||
audio->engine_on = enable;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
static struct dp_audio_private *dp_audio_get_data(struct platform_device *pdev)
|
static struct dp_audio_private *dp_audio_get_data(struct platform_device *pdev)
|
||||||
@@ -444,7 +458,7 @@ static int dp_audio_get_cable_status(struct platform_device *pdev, u32 vote)
|
|||||||
goto end;
|
goto end;
|
||||||
}
|
}
|
||||||
|
|
||||||
return audio->session_on;
|
return atomic_read(&audio->session_on);
|
||||||
end:
|
end:
|
||||||
return rc;
|
return rc;
|
||||||
}
|
}
|
||||||
@@ -709,7 +723,7 @@ static int dp_audio_on(struct dp_audio *dp_audio)
|
|||||||
|
|
||||||
ext = &audio->ext_audio_data;
|
ext = &audio->ext_audio_data;
|
||||||
|
|
||||||
audio->session_on = true;
|
atomic_set(&audio->session_on, 1);
|
||||||
|
|
||||||
rc = dp_audio_config(audio, EXT_DISPLAY_CABLE_CONNECT);
|
rc = dp_audio_config(audio, EXT_DISPLAY_CABLE_CONNECT);
|
||||||
if (rc)
|
if (rc)
|
||||||
@@ -751,7 +765,7 @@ static int dp_audio_off(struct dp_audio *dp_audio)
|
|||||||
end:
|
end:
|
||||||
dp_audio_config(audio, EXT_DISPLAY_CABLE_DISCONNECT);
|
dp_audio_config(audio, EXT_DISPLAY_CABLE_DISCONNECT);
|
||||||
|
|
||||||
audio->session_on = false;
|
atomic_set(&audio->session_on, 0);
|
||||||
audio->engine_on = false;
|
audio->engine_on = false;
|
||||||
|
|
||||||
dp_audio_deregister_ext_disp(audio);
|
dp_audio_deregister_ext_disp(audio);
|
||||||
|
Reference in New Issue
Block a user