diff options
author | Abhinav Kumar <abhinavk@codeaurora.org> | 2020-11-03 04:10:23 +0300 |
---|---|---|
committer | Rob Clark <robdclark@chromium.org> | 2020-11-10 23:41:19 +0300 |
commit | e8c765811b1064c200829eacf237ac8c25e79cd0 (patch) | |
tree | 8d40598e19d01b10ce684957046d6b5e0e88c384 /drivers/gpu/drm/msm/dp | |
parent | 26b8d66a399e625f3aa2c02ccbab1bff2e00040c (diff) | |
download | linux-e8c765811b1064c200829eacf237ac8c25e79cd0.tar.xz |
drm/msm/dp: do not notify audio subsystem if sink doesn't support audio
For sinks that do not support audio, there is no need to notify
audio subsystem of the connection event.
This will make sure that audio routes only to the primary display
when connected to such sinks.
changes in v2:
- Added fixes tag
- Removed nested if condition and removed usage of global pointer
Fixes: d13e36d7d222 ("drm/msm/dp: add audio support for Display Port on MSM")
Signed-off-by: Abhinav Kumar <abhinavk@codeaurora.org>
Signed-off-by: Rob Clark <robdclark@chromium.org>
Diffstat (limited to 'drivers/gpu/drm/msm/dp')
-rw-r--r-- | drivers/gpu/drm/msm/dp/dp_display.c | 9 |
1 files changed, 8 insertions, 1 deletions
diff --git a/drivers/gpu/drm/msm/dp/dp_display.c b/drivers/gpu/drm/msm/dp/dp_display.c index c5c38e013c07..e9cb8783f08b 100644 --- a/drivers/gpu/drm/msm/dp/dp_display.c +++ b/drivers/gpu/drm/msm/dp/dp_display.c @@ -585,7 +585,14 @@ static int dp_connect_pending_timeout(struct dp_display_private *dp, u32 data) static void dp_display_handle_plugged_change(struct msm_dp *dp_display, bool plugged) { - if (dp_display->plugged_cb && dp_display->codec_dev) + struct dp_display_private *dp; + + dp = container_of(dp_display, + struct dp_display_private, dp_display); + + /* notify audio subsystem only if sink supports audio */ + if (dp_display->plugged_cb && dp_display->codec_dev && + dp->audio_supported) dp_display->plugged_cb(dp_display->codec_dev, plugged); } |