Lines Matching +full:mt8173 +full:- +full:cec

1 // SPDX-License-Identifier: GPL-2.0-only
7 #include <linux/arm-smccc.h>
24 #include <sound/hdmi-codec.h>
193 return readl(hdmi->regs + offset); in mtk_hdmi_read()
198 writel(val, hdmi->regs + offset); in mtk_hdmi_write()
203 void __iomem *reg = hdmi->regs + offset; in mtk_hdmi_clear_bits()
213 void __iomem *reg = hdmi->regs + offset; in mtk_hdmi_set_bits()
223 void __iomem *reg = hdmi->regs + offset; in mtk_hdmi_mask()
242 * MT8173 HDMI hardware has an output control bit to enable/disable HDMI in mtk_hdmi_hw_make_reg_writable()
247 if (hdmi->conf && hdmi->conf->tz_disabled) in mtk_hdmi_hw_make_reg_writable()
248 regmap_update_bits(hdmi->sys_regmap, in mtk_hdmi_hw_make_reg_writable()
249 hdmi->sys_offset + HDMI_SYS_CFG20, in mtk_hdmi_hw_make_reg_writable()
255 regmap_update_bits(hdmi->sys_regmap, hdmi->sys_offset + HDMI_SYS_CFG20, in mtk_hdmi_hw_make_reg_writable()
257 regmap_update_bits(hdmi->sys_regmap, hdmi->sys_offset + HDMI_SYS_CFG1C, in mtk_hdmi_hw_make_reg_writable()
263 regmap_update_bits(hdmi->sys_regmap, hdmi->sys_offset + HDMI_SYS_CFG20, in mtk_hdmi_hw_1p4_version_enable()
279 regmap_update_bits(hdmi->sys_regmap, hdmi->sys_offset + HDMI_SYS_CFG1C, in mtk_hdmi_hw_reset()
281 regmap_update_bits(hdmi->sys_regmap, hdmi->sys_offset + HDMI_SYS_CFG1C, in mtk_hdmi_hw_reset()
284 regmap_update_bits(hdmi->sys_regmap, hdmi->sys_offset + HDMI_SYS_CFG1C, in mtk_hdmi_hw_reset()
322 dev_dbg(hdmi->dev, in mtk_hdmi_hw_send_info_frame()
344 dev_err(hdmi->dev, "Unknown infoframe type %d\n", frame_type); in mtk_hdmi_hw_send_info_frame()
367 regmap_update_bits(hdmi->sys_regmap, hdmi->sys_offset + HDMI_SYS_CFG20, in mtk_hdmi_hw_config_sys()
370 regmap_update_bits(hdmi->sys_regmap, hdmi->sys_offset + HDMI_SYS_CFG20, in mtk_hdmi_hw_config_sys()
376 regmap_update_bits(hdmi->sys_regmap, hdmi->sys_offset + HDMI_SYS_CFG20, in mtk_hdmi_hw_set_deep_color_mode()
415 if (mode->flags & DRM_MODE_FLAG_INTERLACE && in mtk_hdmi_hw_msic_setting()
416 mode->clock == 74250 && in mtk_hdmi_hw_msic_setting()
417 mode->vdisplay == 1080) in mtk_hdmi_hw_msic_setting()
656 /* Recommended N values from HDMI specification, tables 7-1 to 7-3 */
668 * hdmi_recommended_n() - Return N value recommended by HDMI specification
677 for (i = 0; i < ARRAY_SIZE(hdmi_rec_n_table) - 1; i++) { in hdmi_recommended_n()
685 return recommended->n[0]; in hdmi_recommended_n()
687 return recommended->n[1]; in hdmi_recommended_n()
689 return recommended->n[2]; in hdmi_recommended_n()
691 return recommended->n[1] * 2; in hdmi_recommended_n()
693 return recommended->n[2] * 2; in hdmi_recommended_n()
695 return recommended->n[1] * 4; in hdmi_recommended_n()
697 return recommended->n[2] * 4; in hdmi_recommended_n()
759 dev_dbg(hdmi->dev, "%s: sample_rate=%u, clock=%d, cts=%u, n=%u\n", in mtk_hdmi_hw_aud_set_ncts()
843 ret = clk_set_rate(hdmi->clk[MTK_HDMI_CLK_HDMI_PLL], clock); in mtk_hdmi_video_change_vpll()
845 dev_err(hdmi->dev, "Failed to set PLL to %u Hz: %d\n", clock, in mtk_hdmi_video_change_vpll()
850 rate = clk_get_rate(hdmi->clk[MTK_HDMI_CLK_HDMI_PLL]); in mtk_hdmi_video_change_vpll()
853 dev_warn(hdmi->dev, "Want PLL %u Hz, got %lu Hz\n", clock, in mtk_hdmi_video_change_vpll()
856 dev_dbg(hdmi->dev, "Want PLL %u Hz, got %lu Hz\n", clock, rate); in mtk_hdmi_video_change_vpll()
869 mtk_hdmi_hw_enable_dvi_mode(hdmi, hdmi->dvi_mode); in mtk_hdmi_video_set_display_mode()
885 if (hdmi->aud_param.aud_input_type == HDMI_AUD_INPUT_SPDIF && in mtk_hdmi_aud_set_input()
886 hdmi->aud_param.aud_codec == HDMI_AUDIO_CODING_TYPE_DST) { in mtk_hdmi_aud_set_input()
888 } else if (hdmi->aud_param.aud_i2s_fmt == HDMI_I2S_MODE_LJT_24BIT) { in mtk_hdmi_aud_set_input()
889 hdmi->aud_param.aud_i2s_fmt = HDMI_I2S_MODE_LJT_16BIT; in mtk_hdmi_aud_set_input()
892 mtk_hdmi_hw_aud_set_i2s_fmt(hdmi, hdmi->aud_param.aud_i2s_fmt); in mtk_hdmi_aud_set_input()
895 dst = ((hdmi->aud_param.aud_input_type == HDMI_AUD_INPUT_SPDIF) && in mtk_hdmi_aud_set_input()
896 (hdmi->aud_param.aud_codec == HDMI_AUDIO_CODING_TYPE_DST)); in mtk_hdmi_aud_set_input()
899 if (hdmi->aud_param.aud_input_type == HDMI_AUD_INPUT_SPDIF) in mtk_hdmi_aud_set_input()
902 chan_type = hdmi->aud_param.aud_input_chan_type; in mtk_hdmi_aud_set_input()
905 mtk_hdmi_hw_aud_set_input_type(hdmi, hdmi->aud_param.aud_input_type); in mtk_hdmi_aud_set_input()
911 unsigned int sample_rate = hdmi->aud_param.codec_params.sample_rate; in mtk_hdmi_aud_set_src()
917 if (hdmi->aud_param.aud_input_type == HDMI_AUD_INPUT_I2S) { in mtk_hdmi_aud_set_src()
926 return -EINVAL; in mtk_hdmi_aud_set_src()
928 mtk_hdmi_hw_aud_set_mclk(hdmi, hdmi->aud_param.aud_mclk); in mtk_hdmi_aud_set_src()
936 return -EINVAL; in mtk_hdmi_aud_set_src()
941 mtk_hdmi_hw_aud_set_ncts(hdmi, sample_rate, display_mode->clock); in mtk_hdmi_aud_set_src()
956 hdmi->aud_param.codec_params.iec.status); in mtk_hdmi_aud_output_config()
974 hdmi->curr_conn, mode); in mtk_hdmi_setup_avi_infoframe()
976 dev_err(hdmi->dev, in mtk_hdmi_setup_avi_infoframe()
983 dev_err(hdmi->dev, "Failed to pack AVI infoframe: %zd\n", err); in mtk_hdmi_setup_avi_infoframe()
1001 dev_err(hdmi->dev, "Failed to initialize SPD infoframe: %zd\n", in mtk_hdmi_setup_spd_infoframe()
1008 dev_err(hdmi->dev, "Failed to pack SDP infoframe: %zd\n", err); in mtk_hdmi_setup_spd_infoframe()
1024 dev_err(hdmi->dev, "Failed to setup audio infoframe: %zd\n", in mtk_hdmi_setup_audio_infoframe()
1033 hdmi->aud_param.aud_input_chan_type); in mtk_hdmi_setup_audio_infoframe()
1037 dev_err(hdmi->dev, "Failed to pack audio infoframe: %zd\n", in mtk_hdmi_setup_audio_infoframe()
1054 hdmi->curr_conn, mode); in mtk_hdmi_setup_vendor_specific_infoframe()
1056 dev_err(hdmi->dev, in mtk_hdmi_setup_vendor_specific_infoframe()
1063 dev_err(hdmi->dev, "Failed to pack vendor infoframe: %zd\n", in mtk_hdmi_setup_vendor_specific_infoframe()
1074 struct hdmi_audio_param *aud_param = &hdmi->aud_param; in mtk_hdmi_output_init()
1076 hdmi->csp = HDMI_COLORSPACE_RGB; in mtk_hdmi_output_init()
1077 aud_param->aud_codec = HDMI_AUDIO_CODING_TYPE_PCM; in mtk_hdmi_output_init()
1078 aud_param->aud_sample_size = HDMI_AUDIO_SAMPLE_SIZE_16; in mtk_hdmi_output_init()
1079 aud_param->aud_input_type = HDMI_AUD_INPUT_I2S; in mtk_hdmi_output_init()
1080 aud_param->aud_i2s_fmt = HDMI_I2S_MODE_I2S_24BIT; in mtk_hdmi_output_init()
1081 aud_param->aud_mclk = HDMI_AUD_MCLK_128FS; in mtk_hdmi_output_init()
1082 aud_param->aud_input_chan_type = HDMI_AUD_CHAN_TYPE_2_0; in mtk_hdmi_output_init()
1090 hdmi->audio_enable = true; in mtk_hdmi_audio_enable()
1096 hdmi->audio_enable = false; in mtk_hdmi_audio_disable()
1102 if (!hdmi->audio_enable) { in mtk_hdmi_audio_set_param()
1103 dev_err(hdmi->dev, "hdmi audio is in disable state!\n"); in mtk_hdmi_audio_set_param()
1104 return -EINVAL; in mtk_hdmi_audio_set_param()
1106 dev_dbg(hdmi->dev, "codec:%d, input:%d, channel:%d, fs:%d\n", in mtk_hdmi_audio_set_param()
1107 param->aud_codec, param->aud_input_type, in mtk_hdmi_audio_set_param()
1108 param->aud_input_chan_type, param->codec_params.sample_rate); in mtk_hdmi_audio_set_param()
1109 memcpy(&hdmi->aud_param, param, sizeof(*param)); in mtk_hdmi_audio_set_param()
1110 return mtk_hdmi_aud_output_config(hdmi, &hdmi->mode); in mtk_hdmi_audio_set_param()
1121 phy_power_off(hdmi->phy); in mtk_hdmi_output_set_display_mode()
1124 mode->clock * 1000); in mtk_hdmi_output_set_display_mode()
1126 dev_err(hdmi->dev, "Failed to set vpll: %d\n", ret); in mtk_hdmi_output_set_display_mode()
1131 phy_power_on(hdmi->phy); in mtk_hdmi_output_set_display_mode()
1154 hdmi->clk[i] = of_clk_get_by_name(np, in mtk_hdmi_get_all_clk()
1156 if (IS_ERR(hdmi->clk[i])) in mtk_hdmi_get_all_clk()
1157 return PTR_ERR(hdmi->clk[i]); in mtk_hdmi_get_all_clk()
1166 ret = clk_prepare_enable(hdmi->clk[MTK_HDMI_CLK_AUD_BCLK]); in mtk_hdmi_clk_enable_audio()
1170 ret = clk_prepare_enable(hdmi->clk[MTK_HDMI_CLK_AUD_SPDIF]); in mtk_hdmi_clk_enable_audio()
1176 clk_disable_unprepare(hdmi->clk[MTK_HDMI_CLK_AUD_BCLK]); in mtk_hdmi_clk_enable_audio()
1182 clk_disable_unprepare(hdmi->clk[MTK_HDMI_CLK_AUD_BCLK]); in mtk_hdmi_clk_disable_audio()
1183 clk_disable_unprepare(hdmi->clk[MTK_HDMI_CLK_AUD_SPDIF]); in mtk_hdmi_clk_disable_audio()
1191 mutex_lock(&hdmi->update_plugged_status_lock); in mtk_hdmi_update_plugged_status()
1192 connected = mtk_cec_hpd_high(hdmi->cec_dev); in mtk_hdmi_update_plugged_status()
1193 if (hdmi->plugged_cb && hdmi->codec_dev) in mtk_hdmi_update_plugged_status()
1194 hdmi->plugged_cb(hdmi->codec_dev, connected); in mtk_hdmi_update_plugged_status()
1195 mutex_unlock(&hdmi->update_plugged_status_lock); in mtk_hdmi_update_plugged_status()
1213 dev_dbg(hdmi->dev, "xres=%d, yres=%d, refresh=%d, intl=%d clock=%d\n", in mtk_hdmi_bridge_mode_valid()
1214 mode->hdisplay, mode->vdisplay, drm_mode_vrefresh(mode), in mtk_hdmi_bridge_mode_valid()
1215 !!(mode->flags & DRM_MODE_FLAG_INTERLACE), mode->clock * 1000); in mtk_hdmi_bridge_mode_valid()
1217 if (hdmi->conf) { in mtk_hdmi_bridge_mode_valid()
1218 if (hdmi->conf->cea_modes_only && !drm_match_cea_mode(mode)) in mtk_hdmi_bridge_mode_valid()
1221 if (hdmi->conf->max_mode_clock && in mtk_hdmi_bridge_mode_valid()
1222 mode->clock > hdmi->conf->max_mode_clock) in mtk_hdmi_bridge_mode_valid()
1226 if (mode->clock < 27000) in mtk_hdmi_bridge_mode_valid()
1228 if (mode->clock > 297000) in mtk_hdmi_bridge_mode_valid()
1238 if (hdmi && hdmi->bridge.encoder && hdmi->bridge.encoder->dev) { in mtk_hdmi_hpd_event()
1242 drm_helper_hpd_irq_event(hdmi->bridge.encoder->dev); in mtk_hdmi_hpd_event()
1243 drm_bridge_hpd_notify(&hdmi->bridge, status); in mtk_hdmi_hpd_event()
1264 if (!hdmi->ddc_adpt) in mtk_hdmi_bridge_edid_read()
1266 drm_edid = drm_edid_read_ddc(connector, hdmi->ddc_adpt); in mtk_hdmi_bridge_edid_read()
1269 * FIXME: This should use !connector->display_info.has_audio (or in mtk_hdmi_bridge_edid_read()
1270 * !connector->display_info.is_hdmi) from a path that has read in mtk_hdmi_bridge_edid_read()
1275 hdmi->dvi_mode = !drm_detect_monitor_audio(edid); in mtk_hdmi_bridge_edid_read()
1290 return -EINVAL; in mtk_hdmi_bridge_attach()
1293 if (hdmi->next_bridge) { in mtk_hdmi_bridge_attach()
1294 ret = drm_bridge_attach(bridge->encoder, hdmi->next_bridge, in mtk_hdmi_bridge_attach()
1300 mtk_cec_set_hpd_event(hdmi->cec_dev, mtk_hdmi_hpd_event, hdmi->dev); in mtk_hdmi_bridge_attach()
1317 if (!hdmi->enabled) in mtk_hdmi_bridge_atomic_disable()
1320 phy_power_off(hdmi->phy); in mtk_hdmi_bridge_atomic_disable()
1321 clk_disable_unprepare(hdmi->clk[MTK_HDMI_CLK_HDMI_PIXEL]); in mtk_hdmi_bridge_atomic_disable()
1322 clk_disable_unprepare(hdmi->clk[MTK_HDMI_CLK_HDMI_PLL]); in mtk_hdmi_bridge_atomic_disable()
1324 hdmi->curr_conn = NULL; in mtk_hdmi_bridge_atomic_disable()
1326 hdmi->enabled = false; in mtk_hdmi_bridge_atomic_disable()
1334 if (!hdmi->powered) in mtk_hdmi_bridge_atomic_post_disable()
1340 hdmi->powered = false; in mtk_hdmi_bridge_atomic_post_disable()
1349 dev_dbg(hdmi->dev, "cur info: name:%s, hdisplay:%d\n", in mtk_hdmi_bridge_mode_set()
1350 adjusted_mode->name, adjusted_mode->hdisplay); in mtk_hdmi_bridge_mode_set()
1351 dev_dbg(hdmi->dev, "hsync_start:%d,hsync_end:%d, htotal:%d", in mtk_hdmi_bridge_mode_set()
1352 adjusted_mode->hsync_start, adjusted_mode->hsync_end, in mtk_hdmi_bridge_mode_set()
1353 adjusted_mode->htotal); in mtk_hdmi_bridge_mode_set()
1354 dev_dbg(hdmi->dev, "hskew:%d, vdisplay:%d\n", in mtk_hdmi_bridge_mode_set()
1355 adjusted_mode->hskew, adjusted_mode->vdisplay); in mtk_hdmi_bridge_mode_set()
1356 dev_dbg(hdmi->dev, "vsync_start:%d, vsync_end:%d, vtotal:%d", in mtk_hdmi_bridge_mode_set()
1357 adjusted_mode->vsync_start, adjusted_mode->vsync_end, in mtk_hdmi_bridge_mode_set()
1358 adjusted_mode->vtotal); in mtk_hdmi_bridge_mode_set()
1359 dev_dbg(hdmi->dev, "vscan:%d, flag:%d\n", in mtk_hdmi_bridge_mode_set()
1360 adjusted_mode->vscan, adjusted_mode->flags); in mtk_hdmi_bridge_mode_set()
1362 drm_mode_copy(&hdmi->mode, adjusted_mode); in mtk_hdmi_bridge_mode_set()
1373 hdmi->powered = true; in mtk_hdmi_bridge_atomic_pre_enable()
1381 mtk_hdmi_setup_spd_infoframe(hdmi, "mediatek", "On-chip HDMI"); in mtk_hdmi_send_infoframe()
1382 if (mode->flags & DRM_MODE_FLAG_3D_MASK) in mtk_hdmi_send_infoframe()
1389 struct drm_atomic_state *state = old_state->base.state; in mtk_hdmi_bridge_atomic_enable()
1393 hdmi->curr_conn = drm_atomic_get_new_connector_for_encoder(state, in mtk_hdmi_bridge_atomic_enable()
1394 bridge->encoder); in mtk_hdmi_bridge_atomic_enable()
1396 mtk_hdmi_output_set_display_mode(hdmi, &hdmi->mode); in mtk_hdmi_bridge_atomic_enable()
1397 clk_prepare_enable(hdmi->clk[MTK_HDMI_CLK_HDMI_PLL]); in mtk_hdmi_bridge_atomic_enable()
1398 clk_prepare_enable(hdmi->clk[MTK_HDMI_CLK_HDMI_PIXEL]); in mtk_hdmi_bridge_atomic_enable()
1399 phy_power_on(hdmi->phy); in mtk_hdmi_bridge_atomic_enable()
1400 mtk_hdmi_send_infoframe(hdmi, &hdmi->mode); in mtk_hdmi_bridge_atomic_enable()
1402 hdmi->enabled = true; in mtk_hdmi_bridge_atomic_enable()
1424 struct device *dev = &pdev->dev; in mtk_hdmi_dt_parse_pdata()
1425 struct device_node *np = dev->of_node; in mtk_hdmi_dt_parse_pdata()
1434 if (ret != -EPROBE_DEFER) in mtk_hdmi_dt_parse_pdata()
1440 /* The CEC module handles HDMI hotplug detection */ in mtk_hdmi_dt_parse_pdata()
1441 cec_np = of_get_compatible_child(np->parent, "mediatek,mt8173-cec"); in mtk_hdmi_dt_parse_pdata()
1443 dev_err(dev, "Failed to find CEC node\n"); in mtk_hdmi_dt_parse_pdata()
1444 return -EINVAL; in mtk_hdmi_dt_parse_pdata()
1449 dev_err(hdmi->dev, "Waiting for CEC device %pOF\n", in mtk_hdmi_dt_parse_pdata()
1452 return -EPROBE_DEFER; in mtk_hdmi_dt_parse_pdata()
1455 hdmi->cec_dev = &cec_pdev->dev; in mtk_hdmi_dt_parse_pdata()
1458 * The mediatek,syscon-hdmi property contains a phandle link to the in mtk_hdmi_dt_parse_pdata()
1462 regmap = syscon_regmap_lookup_by_phandle(np, "mediatek,syscon-hdmi"); in mtk_hdmi_dt_parse_pdata()
1463 ret = of_property_read_u32_index(np, "mediatek,syscon-hdmi", 1, in mtk_hdmi_dt_parse_pdata()
1464 &hdmi->sys_offset); in mtk_hdmi_dt_parse_pdata()
1473 hdmi->sys_regmap = regmap; in mtk_hdmi_dt_parse_pdata()
1476 hdmi->regs = devm_ioremap_resource(dev, mem); in mtk_hdmi_dt_parse_pdata()
1477 if (IS_ERR(hdmi->regs)) { in mtk_hdmi_dt_parse_pdata()
1478 ret = PTR_ERR(hdmi->regs); in mtk_hdmi_dt_parse_pdata()
1484 ret = -EINVAL; in mtk_hdmi_dt_parse_pdata()
1488 if (!of_device_is_compatible(remote, "hdmi-connector")) { in mtk_hdmi_dt_parse_pdata()
1489 hdmi->next_bridge = of_drm_find_bridge(remote); in mtk_hdmi_dt_parse_pdata()
1490 if (!hdmi->next_bridge) { in mtk_hdmi_dt_parse_pdata()
1493 ret = -EPROBE_DEFER; in mtk_hdmi_dt_parse_pdata()
1498 i2c_np = of_parse_phandle(remote, "ddc-i2c-bus", 0); in mtk_hdmi_dt_parse_pdata()
1500 dev_err(dev, "Failed to find ddc-i2c-bus node in %pOF\n", in mtk_hdmi_dt_parse_pdata()
1503 ret = -EINVAL; in mtk_hdmi_dt_parse_pdata()
1508 hdmi->ddc_adpt = of_find_i2c_adapter_by_node(i2c_np); in mtk_hdmi_dt_parse_pdata()
1510 if (!hdmi->ddc_adpt) { in mtk_hdmi_dt_parse_pdata()
1512 ret = -EINVAL; in mtk_hdmi_dt_parse_pdata()
1518 put_device(hdmi->cec_dev); in mtk_hdmi_dt_parse_pdata()
1532 unsigned int chan = params->cea.channels; in mtk_hdmi_audio_hw_params()
1534 dev_dbg(hdmi->dev, "%s: %u Hz, %d bit, %d channels\n", __func__, in mtk_hdmi_audio_hw_params()
1535 params->sample_rate, params->sample_width, chan); in mtk_hdmi_audio_hw_params()
1537 if (!hdmi->bridge.encoder) in mtk_hdmi_audio_hw_params()
1538 return -ENODEV; in mtk_hdmi_audio_hw_params()
1554 dev_err(hdmi->dev, "channel[%d] not supported!\n", chan); in mtk_hdmi_audio_hw_params()
1555 return -EINVAL; in mtk_hdmi_audio_hw_params()
1558 switch (params->sample_rate) { in mtk_hdmi_audio_hw_params()
1568 dev_err(hdmi->dev, "rate[%d] not supported!\n", in mtk_hdmi_audio_hw_params()
1569 params->sample_rate); in mtk_hdmi_audio_hw_params()
1570 return -EINVAL; in mtk_hdmi_audio_hw_params()
1573 switch (daifmt->fmt) { in mtk_hdmi_audio_hw_params()
1587 dev_err(hdmi->dev, "%s: Invalid DAI format %d\n", __func__, in mtk_hdmi_audio_hw_params()
1588 daifmt->fmt); in mtk_hdmi_audio_hw_params()
1589 return -EINVAL; in mtk_hdmi_audio_hw_params()
1634 if (hdmi->enabled) in mtk_hdmi_audio_get_eld()
1635 memcpy(buf, hdmi->curr_conn->eld, min(sizeof(hdmi->curr_conn->eld), len)); in mtk_hdmi_audio_get_eld()
1647 mutex_lock(&hdmi->update_plugged_status_lock); in mtk_hdmi_audio_hook_plugged_cb()
1648 hdmi->plugged_cb = fn; in mtk_hdmi_audio_hook_plugged_cb()
1649 hdmi->codec_dev = codec_dev; in mtk_hdmi_audio_hook_plugged_cb()
1650 mutex_unlock(&hdmi->update_plugged_status_lock); in mtk_hdmi_audio_hook_plugged_cb()
1683 hdmi->audio_pdev = platform_device_register_data(dev, in mtk_hdmi_register_audio_driver()
1688 if (IS_ERR(hdmi->audio_pdev)) in mtk_hdmi_register_audio_driver()
1689 return PTR_ERR(hdmi->audio_pdev); in mtk_hdmi_register_audio_driver()
1692 hdmi->audio_pdev); in mtk_hdmi_register_audio_driver()
1703 struct device *dev = &pdev->dev; in mtk_hdmi_probe()
1708 return -ENOMEM; in mtk_hdmi_probe()
1710 hdmi->dev = dev; in mtk_hdmi_probe()
1711 hdmi->conf = of_device_get_match_data(dev); in mtk_hdmi_probe()
1717 hdmi->phy = devm_phy_get(dev, "hdmi"); in mtk_hdmi_probe()
1718 if (IS_ERR(hdmi->phy)) in mtk_hdmi_probe()
1719 return dev_err_probe(dev, PTR_ERR(hdmi->phy), in mtk_hdmi_probe()
1722 mutex_init(&hdmi->update_plugged_status_lock); in mtk_hdmi_probe()
1735 hdmi->bridge.funcs = &mtk_hdmi_bridge_funcs; in mtk_hdmi_probe()
1736 hdmi->bridge.of_node = pdev->dev.of_node; in mtk_hdmi_probe()
1737 hdmi->bridge.ops = DRM_BRIDGE_OP_DETECT | DRM_BRIDGE_OP_EDID in mtk_hdmi_probe()
1739 hdmi->bridge.type = DRM_MODE_CONNECTOR_HDMIA; in mtk_hdmi_probe()
1740 drm_bridge_add(&hdmi->bridge); in mtk_hdmi_probe()
1744 drm_bridge_remove(&hdmi->bridge); in mtk_hdmi_probe()
1756 drm_bridge_remove(&hdmi->bridge); in mtk_hdmi_remove()
1797 { .compatible = "mediatek,mt2701-hdmi",
1800 { .compatible = "mediatek,mt8167-hdmi",
1803 { .compatible = "mediatek,mt8173-hdmi",
1813 .name = "mediatek-drm-hdmi",