Skip to content

Commit 26c691a

Browse files
AngeloGioacchino Del RegnoChun-Kuang Hu
authored andcommitted
drm/mediatek: mtk_hdmi: Move output init to mtk_hdmi_register_audio_driver()
In preparation for moving the common bits of this driver, merge the contents of mtk_hdmi_output_init in mtk_hdmi_register_audio_driver function to aggregate all of the initial audio setup together in the same function and to make it clear that all of the setup that is performed in mtk_hdmi_output_init is specifically related only to audio and not video. 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 7485be9 commit 26c691a

File tree

1 file changed

+8
-19
lines changed

1 file changed

+8
-19
lines changed

drivers/gpu/drm/mediatek/mtk_hdmi.c

Lines changed: 8 additions & 19 deletions
Original file line numberDiff line numberDiff line change
@@ -1025,20 +1025,6 @@ static int mtk_hdmi_setup_vendor_specific_infoframe(struct mtk_hdmi *hdmi,
10251025
return 0;
10261026
}
10271027

1028-
static int mtk_hdmi_output_init(struct mtk_hdmi *hdmi)
1029-
{
1030-
struct hdmi_audio_param *aud_param = &hdmi->aud_param;
1031-
1032-
aud_param->aud_codec = HDMI_AUDIO_CODING_TYPE_PCM;
1033-
aud_param->aud_sample_size = HDMI_AUDIO_SAMPLE_SIZE_16;
1034-
aud_param->aud_input_type = HDMI_AUD_INPUT_I2S;
1035-
aud_param->aud_i2s_fmt = HDMI_I2S_MODE_I2S_24BIT;
1036-
aud_param->aud_mclk = HDMI_AUD_MCLK_128FS;
1037-
aud_param->aud_input_chan_type = HDMI_AUD_CHAN_TYPE_2_0;
1038-
1039-
return 0;
1040-
}
1041-
10421028
static void mtk_hdmi_audio_enable(struct mtk_hdmi *hdmi)
10431029
{
10441030
mtk_hdmi_hw_send_aud_packet(hdmi, true);
@@ -1616,6 +1602,7 @@ static void mtk_hdmi_unregister_audio_driver(void *data)
16161602
static int mtk_hdmi_register_audio_driver(struct device *dev)
16171603
{
16181604
struct mtk_hdmi *hdmi = dev_get_drvdata(dev);
1605+
struct hdmi_audio_param *aud_param = &hdmi->aud_param;
16191606
struct hdmi_codec_pdata codec_data = {
16201607
.ops = &mtk_hdmi_audio_codec_ops,
16211608
.max_i2s_channels = 2,
@@ -1625,6 +1612,13 @@ static int mtk_hdmi_register_audio_driver(struct device *dev)
16251612
};
16261613
int ret;
16271614

1615+
aud_param->aud_codec = HDMI_AUDIO_CODING_TYPE_PCM;
1616+
aud_param->aud_sample_size = HDMI_AUDIO_SAMPLE_SIZE_16;
1617+
aud_param->aud_input_type = HDMI_AUD_INPUT_I2S;
1618+
aud_param->aud_i2s_fmt = HDMI_I2S_MODE_I2S_24BIT;
1619+
aud_param->aud_mclk = HDMI_AUD_MCLK_128FS;
1620+
aud_param->aud_input_chan_type = HDMI_AUD_CHAN_TYPE_2_0;
1621+
16281622
hdmi->audio_pdev = platform_device_register_data(dev,
16291623
HDMI_CODEC_DRV_NAME,
16301624
PLATFORM_DEVID_AUTO,
@@ -1666,11 +1660,6 @@ static int mtk_hdmi_probe(struct platform_device *pdev)
16661660
mutex_init(&hdmi->update_plugged_status_lock);
16671661
platform_set_drvdata(pdev, hdmi);
16681662

1669-
ret = mtk_hdmi_output_init(hdmi);
1670-
if (ret)
1671-
return dev_err_probe(dev, ret,
1672-
"Failed to initialize hdmi output\n");
1673-
16741663
ret = mtk_hdmi_register_audio_driver(dev);
16751664
if (ret)
16761665
return dev_err_probe(dev, ret,

0 commit comments

Comments
 (0)