|
@@ -22,7 +22,7 @@ struct dp_audio_private {
|
|
|
struct dp_panel *panel;
|
|
|
|
|
|
bool ack_enabled;
|
|
|
- bool session_on;
|
|
|
+ atomic_t session_on;
|
|
|
bool engine_on;
|
|
|
|
|
|
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)
|
|
|
{
|
|
|
+ if (!atomic_read(&audio->session_on)) {
|
|
|
+ pr_warn("session inactive\n");
|
|
|
+ return;
|
|
|
+ }
|
|
|
+
|
|
|
/* always program stream 0 first before actual stream cfg */
|
|
|
audio->catalog->stream_id = DP_STREAM_0;
|
|
|
audio->catalog->config_sdp(audio->catalog);
|
|
@@ -314,6 +319,11 @@ static void dp_audio_setup_acr(struct dp_audio_private *audio)
|
|
|
u32 select = 0;
|
|
|
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) {
|
|
|
case DP_LINK_BW_1_62:
|
|
|
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;
|
|
|
|
|
|
+ audio->engine_on = enable;
|
|
|
+ if (!atomic_read(&audio->session_on)) {
|
|
|
+ pr_warn("session inactive. enable=%d\n", enable);
|
|
|
+ return;
|
|
|
+ }
|
|
|
catalog->data = enable;
|
|
|
catalog->enable(catalog);
|
|
|
|
|
|
- audio->engine_on = enable;
|
|
|
}
|
|
|
|
|
|
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;
|
|
|
}
|
|
|
|
|
|
- return audio->session_on;
|
|
|
+ return atomic_read(&audio->session_on);
|
|
|
end:
|
|
|
return rc;
|
|
|
}
|
|
@@ -709,7 +723,7 @@ static int dp_audio_on(struct dp_audio *dp_audio)
|
|
|
|
|
|
ext = &audio->ext_audio_data;
|
|
|
|
|
|
- audio->session_on = true;
|
|
|
+ atomic_set(&audio->session_on, 1);
|
|
|
|
|
|
rc = dp_audio_config(audio, EXT_DISPLAY_CABLE_CONNECT);
|
|
|
if (rc)
|
|
@@ -751,7 +765,7 @@ static int dp_audio_off(struct dp_audio *dp_audio)
|
|
|
end:
|
|
|
dp_audio_config(audio, EXT_DISPLAY_CABLE_DISCONNECT);
|
|
|
|
|
|
- audio->session_on = false;
|
|
|
+ atomic_set(&audio->session_on, 0);
|
|
|
audio->engine_on = false;
|
|
|
|
|
|
dp_audio_deregister_ext_disp(audio);
|