mirror of
https://github.com/hardkernel/linux.git
synced 2026-06-05 18:41:58 +09:00
drm/msm/dp: unregister audio driver during unbind
[ Upstream commit85c636284c] 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:d13e36d7d2("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> Signed-off-by: Sasha Levin <sashal@kernel.org>
This commit is contained in:
committed by
Greg Kroah-Hartman
parent
6867c4b5db
commit
ccde7016d1
@@ -593,6 +593,18 @@ static struct hdmi_codec_pdata codec_data = {
|
|||||||
.i2s = 1,
|
.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,
|
int dp_register_audio_driver(struct device *dev,
|
||||||
struct dp_audio *dp_audio)
|
struct dp_audio *dp_audio)
|
||||||
{
|
{
|
||||||
|
|||||||
@@ -53,6 +53,8 @@ struct dp_audio *dp_audio_get(struct platform_device *pdev,
|
|||||||
int dp_register_audio_driver(struct device *dev,
|
int dp_register_audio_driver(struct device *dev,
|
||||||
struct dp_audio *dp_audio);
|
struct dp_audio *dp_audio);
|
||||||
|
|
||||||
|
void dp_unregister_audio_driver(struct device *dev, struct dp_audio *dp_audio);
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* dp_audio_put()
|
* dp_audio_put()
|
||||||
*
|
*
|
||||||
|
|||||||
@@ -323,6 +323,7 @@ static void dp_display_unbind(struct device *dev, struct device *master,
|
|||||||
kthread_stop(dp->ev_tsk);
|
kthread_stop(dp->ev_tsk);
|
||||||
|
|
||||||
dp_power_client_deinit(dp->power);
|
dp_power_client_deinit(dp->power);
|
||||||
|
dp_unregister_audio_driver(dev, dp->audio);
|
||||||
dp_aux_unregister(dp->aux);
|
dp_aux_unregister(dp->aux);
|
||||||
dp->drm_dev = NULL;
|
dp->drm_dev = NULL;
|
||||||
dp->aux->drm_dev = NULL;
|
dp->aux->drm_dev = NULL;
|
||||||
|
|||||||
Reference in New Issue
Block a user