diff options
author | Srinivas Kandagatla <srinivas.kandagatla@linaro.org> | 2023-04-21 17:56:57 +0300 |
---|---|---|
committer | Abhinav Kumar <quic_abhinavk@quicinc.com> | 2023-04-27 02:45:35 +0300 |
commit | 85c636284cb63b7740b4ae98881ace92158068d3 (patch) | |
tree | 95b7f12eacf80ba7213380ca1ae9981c9bbff81c /drivers/gpu/drm/msm/dp/dp_audio.c | |
parent | 16eb51aba0a72b8f60c6b98d1493844230293450 (diff) | |
download | linux-85c636284cb63b7740b4ae98881ace92158068d3.tar.xz |
drm/msm/dp: unregister audio driver during unbind
while binding the code always registers a audio driver, however there
is no corresponding unregistration done in unbind. This leads to multiple
redundant audio platform devices if dp_display_bind and dp_display_unbind
happens multiple times during startup. On X13s platform this resulted in
6 to 9 audio codec device instead of just 3 codec devices for 3 dp ports.
Fix this by unregistering codecs on unbind.
Signed-off-by: Srinivas Kandagatla <srinivas.kandagatla@linaro.org>
Fixes: d13e36d7d222 ("drm/msm/dp: add audio support for Display Port on MSM")
Reviewed-by: Abhinav Kumar <quic_abhinavk@quicinc.com>
Patchwork: https://patchwork.freedesktop.org/patch/533324/
Link: https://lore.kernel.org/r/20230421145657.12186-1-srinivas.kandagatla@linaro.org
Signed-off-by: Abhinav Kumar <quic_abhinavk@quicinc.com>
Diffstat (limited to 'drivers/gpu/drm/msm/dp/dp_audio.c')
-rw-r--r-- | drivers/gpu/drm/msm/dp/dp_audio.c | 12 |
1 files changed, 12 insertions, 0 deletions
diff --git a/drivers/gpu/drm/msm/dp/dp_audio.c b/drivers/gpu/drm/msm/dp/dp_audio.c index 6666783e1468..1245c7aa49df 100644 --- a/drivers/gpu/drm/msm/dp/dp_audio.c +++ b/drivers/gpu/drm/msm/dp/dp_audio.c @@ -593,6 +593,18 @@ static struct hdmi_codec_pdata codec_data = { .i2s = 1, }; +void dp_unregister_audio_driver(struct device *dev, struct dp_audio *dp_audio) +{ + struct dp_audio_private *audio_priv; + + audio_priv = container_of(dp_audio, struct dp_audio_private, dp_audio); + + if (audio_priv->audio_pdev) { + platform_device_unregister(audio_priv->audio_pdev); + audio_priv->audio_pdev = NULL; + } +} + int dp_register_audio_driver(struct device *dev, struct dp_audio *dp_audio) { |