Skip to content

Commit c92493e

Browse files
AngeloGioacchino Del RegnoChun-Kuang Hu
authored andcommitted
drm/mediatek: mtk_hdmi: Move plugged_cb/codec_dev setting to new function
In preparation for splitting common bits of this driver, move the mutex-protected cable plugged callback and codec device setting to a new function called mtk_hdmi_audio_set_plugged_cb(). Reviewed-by: CK Hu <[email protected]> Signed-off-by: AngeloGioacchino Del Regno <[email protected]> Link: https://patchwork.kernel.org/project/dri-devel/patch/[email protected]/ Signed-off-by: Chun-Kuang Hu <[email protected]>
1 parent 332de7d commit c92493e

File tree

1 file changed

+9
-4
lines changed

1 file changed

+9
-4
lines changed

drivers/gpu/drm/mediatek/mtk_hdmi.c

Lines changed: 9 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1582,17 +1582,22 @@ static int mtk_hdmi_audio_get_eld(struct device *dev, void *data, uint8_t *buf,
15821582
return 0;
15831583
}
15841584

1585-
static int mtk_hdmi_audio_hook_plugged_cb(struct device *dev, void *data,
1586-
hdmi_codec_plugged_cb fn,
1585+
static void mtk_hdmi_audio_set_plugged_cb(struct mtk_hdmi *hdmi, hdmi_codec_plugged_cb fn,
15871586
struct device *codec_dev)
15881587
{
1589-
struct mtk_hdmi *hdmi = data;
1590-
15911588
mutex_lock(&hdmi->update_plugged_status_lock);
15921589
hdmi->plugged_cb = fn;
15931590
hdmi->codec_dev = codec_dev;
15941591
mutex_unlock(&hdmi->update_plugged_status_lock);
1592+
}
1593+
1594+
static int mtk_hdmi_audio_hook_plugged_cb(struct device *dev, void *data,
1595+
hdmi_codec_plugged_cb fn,
1596+
struct device *codec_dev)
1597+
{
1598+
struct mtk_hdmi *hdmi = data;
15951599

1600+
mtk_hdmi_audio_set_plugged_cb(hdmi, fn, codec_dev);
15961601
mtk_hdmi_update_plugged_status(hdmi);
15971602

15981603
return 0;

0 commit comments

Comments
 (0)