Lines Matching +full:bcm2711 +full:- +full:hdmi +full:- +full:i2c
1 // SPDX-License-Identifier: GPL-2.0-only
10 * DOC: VC4 Falcon HDMI module
12 * The HDMI core has a state machine and a PHY. On BCM2835, most of
16 * HDMI infoframes are kept within a small packet ram, where each
19 * HDMI audio is implemented entirely within the HDMI IP block. A
20 * register in the HDMI encoder takes SPDIF frames from the DMA engine
21 * and transfers them over an internal MAI (multi-channel audio
25 * The driver's HDMI encoder does not yet support power management.
26 * The HDMI encoder's power domain and the HSM/pixel clocks are kept
27 * continuously running, and only the HDMI logic and packet ram are
30 * The driver does not yet support CEC control, though the HDMI
45 #include <linux/i2c.h>
52 #include <sound/hdmi-codec.h>
116 struct drm_display_info *display = &vc4_hdmi->connector.display_info; in vc4_hdmi_supports_scrambling()
118 lockdep_assert_held(&vc4_hdmi->mutex); in vc4_hdmi_supports_scrambling()
120 if (!display->is_hdmi) in vc4_hdmi_supports_scrambling()
123 if (!display->hdmi.scdc.supported || in vc4_hdmi_supports_scrambling()
124 !display->hdmi.scdc.scrambling.supported) in vc4_hdmi_supports_scrambling()
141 struct drm_debugfs_entry *entry = m->private; in vc4_hdmi_debugfs_regs()
142 struct vc4_hdmi *vc4_hdmi = entry->file.data; in vc4_hdmi_debugfs_regs()
143 struct drm_device *drm = vc4_hdmi->connector.dev; in vc4_hdmi_debugfs_regs()
148 return -ENODEV; in vc4_hdmi_debugfs_regs()
150 drm_print_regset32(&p, &vc4_hdmi->hdmi_regset); in vc4_hdmi_debugfs_regs()
151 drm_print_regset32(&p, &vc4_hdmi->hd_regset); in vc4_hdmi_debugfs_regs()
152 drm_print_regset32(&p, &vc4_hdmi->cec_regset); in vc4_hdmi_debugfs_regs()
153 drm_print_regset32(&p, &vc4_hdmi->csc_regset); in vc4_hdmi_debugfs_regs()
154 drm_print_regset32(&p, &vc4_hdmi->dvp_regset); in vc4_hdmi_debugfs_regs()
155 drm_print_regset32(&p, &vc4_hdmi->phy_regset); in vc4_hdmi_debugfs_regs()
156 drm_print_regset32(&p, &vc4_hdmi->ram_regset); in vc4_hdmi_debugfs_regs()
157 drm_print_regset32(&p, &vc4_hdmi->rm_regset); in vc4_hdmi_debugfs_regs()
166 struct drm_device *drm = vc4_hdmi->connector.dev; in vc4_hdmi_reset()
172 * connector->dev pointer might not be initialised yet. in vc4_hdmi_reset()
177 spin_lock_irqsave(&vc4_hdmi->hw_lock, flags); in vc4_hdmi_reset()
191 spin_unlock_irqrestore(&vc4_hdmi->hw_lock, flags); in vc4_hdmi_reset()
199 struct drm_device *drm = vc4_hdmi->connector.dev; in vc5_hdmi_reset()
205 * connector->dev pointer might not be initialised yet. in vc5_hdmi_reset()
210 reset_control_reset(vc4_hdmi->reset); in vc5_hdmi_reset()
212 spin_lock_irqsave(&vc4_hdmi->hw_lock, flags); in vc5_hdmi_reset()
219 spin_unlock_irqrestore(&vc4_hdmi->hw_lock, flags); in vc5_hdmi_reset()
228 struct drm_device *drm = vc4_hdmi->connector.dev; in vc4_hdmi_cec_update_clk_div()
244 cec_rate = clk_get_rate(vc4_hdmi->cec_clock); in vc4_hdmi_cec_update_clk_div()
246 spin_lock_irqsave(&vc4_hdmi->hw_lock, flags); in vc4_hdmi_cec_update_clk_div()
259 spin_unlock_irqrestore(&vc4_hdmi->hw_lock, flags); in vc4_hdmi_cec_update_clk_div()
275 state = drm_atomic_state_alloc(crtc->dev); in reset_pipe()
277 return -ENOMEM; in reset_pipe()
279 state->acquire_ctx = ctx; in reset_pipe()
287 crtc_state->connectors_changed = true; in reset_pipe()
311 drm = connector->dev; in vc4_hdmi_reset_link()
312 ret = drm_modeset_lock(&drm->mode_config.connection_mutex, ctx); in vc4_hdmi_reset_link()
316 conn_state = connector->state; in vc4_hdmi_reset_link()
317 crtc = conn_state->crtc; in vc4_hdmi_reset_link()
321 ret = drm_modeset_lock(&crtc->mutex, ctx); in vc4_hdmi_reset_link()
325 crtc_state = crtc->state; in vc4_hdmi_reset_link()
326 if (!crtc_state->active) in vc4_hdmi_reset_link()
330 mutex_lock(&vc4_hdmi->mutex); in vc4_hdmi_reset_link()
333 mutex_unlock(&vc4_hdmi->mutex); in vc4_hdmi_reset_link()
337 scrambling_needed = vc4_hdmi_mode_needs_scrambling(&vc4_hdmi->saved_adjusted_mode, in vc4_hdmi_reset_link()
338 vc4_hdmi->output_bpc, in vc4_hdmi_reset_link()
339 vc4_hdmi->output_format); in vc4_hdmi_reset_link()
341 mutex_unlock(&vc4_hdmi->mutex); in vc4_hdmi_reset_link()
345 if (conn_state->commit && in vc4_hdmi_reset_link()
346 !try_wait_for_completion(&conn_state->commit->hw_done)) { in vc4_hdmi_reset_link()
347 mutex_unlock(&vc4_hdmi->mutex); in vc4_hdmi_reset_link()
351 ret = drm_scdc_readb(connector->ddc, SCDC_TMDS_CONFIG, &config); in vc4_hdmi_reset_link()
354 mutex_unlock(&vc4_hdmi->mutex); in vc4_hdmi_reset_link()
359 mutex_unlock(&vc4_hdmi->mutex); in vc4_hdmi_reset_link()
363 mutex_unlock(&vc4_hdmi->mutex); in vc4_hdmi_reset_link()
366 * HDMI 2.0 says that one should not send scrambled data in vc4_hdmi_reset_link()
381 struct drm_connector *connector = &vc4_hdmi->connector; in vc4_hdmi_handle_hotplug()
386 * NOTE: This function should really be called with vc4_hdmi->mutex in vc4_hdmi_handle_hotplug()
400 cec_phys_addr_invalidate(vc4_hdmi->cec_adap); in vc4_hdmi_handle_hotplug()
404 drm_edid = drm_edid_read_ddc(connector, vc4_hdmi->ddc); in vc4_hdmi_handle_hotplug()
407 cec_s_phys_addr(vc4_hdmi->cec_adap, in vc4_hdmi_handle_hotplug()
408 connector->display_info.source_physical_address, false); in vc4_hdmi_handle_hotplug()
417 if (ret == -EDEADLK) { in vc4_hdmi_handle_hotplug()
435 * NOTE: This function should really take vc4_hdmi->mutex, but in vc4_hdmi_connector_detect_ctx()
445 ret = pm_runtime_resume_and_get(&vc4_hdmi->pdev->dev); in vc4_hdmi_connector_detect_ctx()
447 drm_err_once(connector->dev, "Failed to retain HDMI power domain: %d\n", in vc4_hdmi_connector_detect_ctx()
452 if (vc4_hdmi->hpd_gpio) { in vc4_hdmi_connector_detect_ctx()
453 if (gpiod_get_value_cansleep(vc4_hdmi->hpd_gpio)) in vc4_hdmi_connector_detect_ctx()
456 if (vc4_hdmi->variant->hp_detect && in vc4_hdmi_connector_detect_ctx()
457 vc4_hdmi->variant->hp_detect(vc4_hdmi)) in vc4_hdmi_connector_detect_ctx()
462 pm_runtime_put(&vc4_hdmi->pdev->dev); in vc4_hdmi_connector_detect_ctx()
470 struct vc4_dev *vc4 = to_vc4_dev(connector->dev); in vc4_hdmi_connector_get_modes()
475 * NOTE: This function should really take vc4_hdmi->mutex, but doing so in vc4_hdmi_connector_get_modes()
485 drm_edid = drm_edid_read_ddc(connector, vc4_hdmi->ddc); in vc4_hdmi_connector_get_modes()
487 cec_s_phys_addr(vc4_hdmi->cec_adap, in vc4_hdmi_connector_get_modes()
488 connector->display_info.source_physical_address, false); in vc4_hdmi_connector_get_modes()
495 if (!vc4->hvs->vc5_hdmi_enable_hdmi_20) { in vc4_hdmi_connector_get_modes()
496 struct drm_device *drm = connector->dev; in vc4_hdmi_connector_get_modes()
499 list_for_each_entry(mode, &connector->probed_modes, head) { in vc4_hdmi_connector_get_modes()
517 struct drm_crtc *crtc = new_state->crtc; in vc4_hdmi_connector_atomic_check()
522 if (old_state->tv.margins.left != new_state->tv.margins.left || in vc4_hdmi_connector_atomic_check()
523 old_state->tv.margins.right != new_state->tv.margins.right || in vc4_hdmi_connector_atomic_check()
524 old_state->tv.margins.top != new_state->tv.margins.top || in vc4_hdmi_connector_atomic_check()
525 old_state->tv.margins.bottom != new_state->tv.margins.bottom) { in vc4_hdmi_connector_atomic_check()
548 if (old_state->colorspace != new_state->colorspace) { in vc4_hdmi_connector_atomic_check()
555 crtc_state->mode_changed = true; in vc4_hdmi_connector_atomic_check()
564 __drm_atomic_helper_connector_hdmi_reset(connector, connector->state); in vc4_hdmi_connector_reset()
586 struct drm_connector *connector = &vc4_hdmi->connector; in vc4_hdmi_connector_init()
587 struct drm_encoder *encoder = &vc4_hdmi->encoder.base; in vc4_hdmi_connector_init()
591 if (vc4_hdmi->variant->supports_hdr) in vc4_hdmi_connector_init()
599 vc4_hdmi->ddc, in vc4_hdmi_connector_init()
613 if (connector->funcs->reset) in vc4_hdmi_connector_init()
614 connector->funcs->reset(connector); in vc4_hdmi_connector_init()
628 connector->polled = (DRM_CONNECTOR_POLL_CONNECT | in vc4_hdmi_connector_init()
631 connector->interlace_allowed = 1; in vc4_hdmi_connector_init()
632 connector->doublescan_allowed = 0; in vc4_hdmi_connector_init()
633 connector->stereo_allowed = 1; in vc4_hdmi_connector_init()
648 struct drm_device *drm = vc4_hdmi->connector.dev; in vc4_hdmi_stop_packet()
649 u32 packet_id = type - 0x80; in vc4_hdmi_stop_packet()
655 return -ENODEV; in vc4_hdmi_stop_packet()
657 spin_lock_irqsave(&vc4_hdmi->hw_lock, flags); in vc4_hdmi_stop_packet()
660 spin_unlock_irqrestore(&vc4_hdmi->hw_lock, flags); in vc4_hdmi_stop_packet()
676 struct drm_device *drm = connector->dev; in vc4_hdmi_write_infoframe()
677 u32 packet_id = type - 0x80; in vc4_hdmi_write_infoframe()
679 &vc4_hdmi->variant->registers[HDMI_RAM_PACKET_START]; in vc4_hdmi_write_infoframe()
680 u32 packet_reg = ram_packet_start->offset + VC4_HDMI_PACKET_STRIDE * packet_id; in vc4_hdmi_write_infoframe()
681 u32 packet_reg_next = ram_packet_start->offset + in vc4_hdmi_write_infoframe()
684 ram_packet_start->reg); in vc4_hdmi_write_infoframe()
695 ret = -ENOMEM; in vc4_hdmi_write_infoframe()
711 spin_lock_irqsave(&vc4_hdmi->hw_lock, flags); in vc4_hdmi_write_infoframe()
730 * infoframe and triggers a checksum error on hdmi analyser in vc4_hdmi_write_infoframe()
738 spin_unlock_irqrestore(&vc4_hdmi->hw_lock, flags); in vc4_hdmi_write_infoframe()
755 struct drm_connector *connector = &vc4_hdmi->connector; in vc4_hdmi_enable_scrambling()
756 struct drm_device *drm = connector->dev; in vc4_hdmi_enable_scrambling()
757 const struct drm_display_mode *mode = &vc4_hdmi->saved_adjusted_mode; in vc4_hdmi_enable_scrambling()
761 lockdep_assert_held(&vc4_hdmi->mutex); in vc4_hdmi_enable_scrambling()
767 vc4_hdmi->output_bpc, in vc4_hdmi_enable_scrambling()
768 vc4_hdmi->output_format)) in vc4_hdmi_enable_scrambling()
777 spin_lock_irqsave(&vc4_hdmi->hw_lock, flags); in vc4_hdmi_enable_scrambling()
780 spin_unlock_irqrestore(&vc4_hdmi->hw_lock, flags); in vc4_hdmi_enable_scrambling()
784 vc4_hdmi->scdc_enabled = true; in vc4_hdmi_enable_scrambling()
786 queue_delayed_work(system_wq, &vc4_hdmi->scrambling_work, in vc4_hdmi_enable_scrambling()
793 struct drm_connector *connector = &vc4_hdmi->connector; in vc4_hdmi_disable_scrambling()
794 struct drm_device *drm = connector->dev; in vc4_hdmi_disable_scrambling()
798 lockdep_assert_held(&vc4_hdmi->mutex); in vc4_hdmi_disable_scrambling()
800 if (!vc4_hdmi->scdc_enabled) in vc4_hdmi_disable_scrambling()
803 vc4_hdmi->scdc_enabled = false; in vc4_hdmi_disable_scrambling()
805 if (delayed_work_pending(&vc4_hdmi->scrambling_work)) in vc4_hdmi_disable_scrambling()
806 cancel_delayed_work_sync(&vc4_hdmi->scrambling_work); in vc4_hdmi_disable_scrambling()
811 spin_lock_irqsave(&vc4_hdmi->hw_lock, flags); in vc4_hdmi_disable_scrambling()
814 spin_unlock_irqrestore(&vc4_hdmi->hw_lock, flags); in vc4_hdmi_disable_scrambling()
827 struct drm_connector *connector = &vc4_hdmi->connector; in vc4_hdmi_scrambling_wq()
835 queue_delayed_work(system_wq, &vc4_hdmi->scrambling_work, in vc4_hdmi_scrambling_wq()
843 struct drm_device *drm = vc4_hdmi->connector.dev; in vc4_hdmi_encoder_post_crtc_disable()
847 mutex_lock(&vc4_hdmi->mutex); in vc4_hdmi_encoder_post_crtc_disable()
849 vc4_hdmi->packet_ram_enabled = false; in vc4_hdmi_encoder_post_crtc_disable()
854 spin_lock_irqsave(&vc4_hdmi->hw_lock, flags); in vc4_hdmi_encoder_post_crtc_disable()
860 spin_unlock_irqrestore(&vc4_hdmi->hw_lock, flags); in vc4_hdmi_encoder_post_crtc_disable()
864 spin_lock_irqsave(&vc4_hdmi->hw_lock, flags); in vc4_hdmi_encoder_post_crtc_disable()
867 spin_unlock_irqrestore(&vc4_hdmi->hw_lock, flags); in vc4_hdmi_encoder_post_crtc_disable()
874 mutex_unlock(&vc4_hdmi->mutex); in vc4_hdmi_encoder_post_crtc_disable()
881 struct drm_device *drm = vc4_hdmi->connector.dev; in vc4_hdmi_encoder_post_crtc_powerdown()
886 mutex_lock(&vc4_hdmi->mutex); in vc4_hdmi_encoder_post_crtc_powerdown()
891 spin_lock_irqsave(&vc4_hdmi->hw_lock, flags); in vc4_hdmi_encoder_post_crtc_powerdown()
894 spin_unlock_irqrestore(&vc4_hdmi->hw_lock, flags); in vc4_hdmi_encoder_post_crtc_powerdown()
896 if (vc4_hdmi->variant->phy_disable) in vc4_hdmi_encoder_post_crtc_powerdown()
897 vc4_hdmi->variant->phy_disable(vc4_hdmi); in vc4_hdmi_encoder_post_crtc_powerdown()
899 clk_disable_unprepare(vc4_hdmi->pixel_bvb_clock); in vc4_hdmi_encoder_post_crtc_powerdown()
900 clk_disable_unprepare(vc4_hdmi->pixel_clock); in vc4_hdmi_encoder_post_crtc_powerdown()
902 ret = pm_runtime_put(&vc4_hdmi->pdev->dev); in vc4_hdmi_encoder_post_crtc_powerdown()
909 mutex_unlock(&vc4_hdmi->mutex); in vc4_hdmi_encoder_post_crtc_powerdown()
916 struct drm_device *drm = vc4_hdmi->connector.dev; in vc4_hdmi_csc_setup()
924 spin_lock_irqsave(&vc4_hdmi->hw_lock, flags); in vc4_hdmi_csc_setup()
929 if (state->hdmi.is_limited_range) { in vc4_hdmi_csc_setup()
932 * Apply a colorspace conversion to squash 0-255 down in vc4_hdmi_csc_setup()
933 * to 16-235. The matrix here is: in vc4_hdmi_csc_setup()
956 spin_unlock_irqrestore(&vc4_hdmi->hw_lock, flags); in vc4_hdmi_csc_setup()
969 * Full range - unity
985 * colorspace conversion to squash 0-255 down to 16-235.
1009 * [ -0.168736 -0.331264 0.500000 128 ]
1010 * [ 0.500000 -0.418688 -0.081312 128 ]
1020 * [ -0.147644 -0.289856 0.437500 128 ]
1021 * [ 0.437500 -0.366352 -0.071148 128 ]
1040 * [ -0.114572 -0.385428 0.500000 128 ]
1041 * [ 0.500000 -0.454153 -0.045847 128 ]
1052 * [ -0.100268 -0.337232 0.437500 128 ]
1053 * [ 0.437500 -0.397386 -0.040114 128 ]
1072 * [ -0.139630 -0.360370 0.500000 128 ]
1073 * [ 0.500000 -0.459786 -0.040214 128 ]
1083 * [ -0.122176 -0.315324 0.437500 128 ]
1084 * [ 0.437500 -0.402312 -0.035188 128 ]
1095 lockdep_assert_held(&vc4_hdmi->hw_lock); in vc5_hdmi_set_csc_coeffs()
1108 lockdep_assert_held(&vc4_hdmi->hw_lock); in vc5_hdmi_set_csc_coeffs_swap()
1151 struct drm_device *drm = vc4_hdmi->connector.dev; in vc5_hdmi_csc_setup()
1152 unsigned int lim_range = state->hdmi.is_limited_range ? 1 : 0; in vc5_hdmi_csc_setup()
1165 spin_lock_irqsave(&vc4_hdmi->hw_lock, flags); in vc5_hdmi_csc_setup()
1167 switch (state->hdmi.output_format) { in vc5_hdmi_csc_setup()
1169 csc = vc5_hdmi_find_yuv_csc_coeffs(vc4_hdmi, state->colorspace, !!lim_range); in vc5_hdmi_csc_setup()
1175 csc = vc5_hdmi_find_yuv_csc_coeffs(vc4_hdmi, state->colorspace, !!lim_range); in vc5_hdmi_csc_setup()
1206 spin_unlock_irqrestore(&vc4_hdmi->hw_lock, flags); in vc5_hdmi_csc_setup()
1215 struct drm_device *drm = vc4_hdmi->connector.dev; in vc4_hdmi_set_timings()
1216 bool hsync_pos = mode->flags & DRM_MODE_FLAG_PHSYNC; in vc4_hdmi_set_timings()
1217 bool vsync_pos = mode->flags & DRM_MODE_FLAG_PVSYNC; in vc4_hdmi_set_timings()
1218 bool interlaced = mode->flags & DRM_MODE_FLAG_INTERLACE; in vc4_hdmi_set_timings()
1219 u32 pixel_rep = (mode->flags & DRM_MODE_FLAG_DBLCLK) ? 2 : 1; in vc4_hdmi_set_timings()
1220 u32 verta = (VC4_SET_FIELD(mode->crtc_vsync_end - mode->crtc_vsync_start, in vc4_hdmi_set_timings()
1222 VC4_SET_FIELD(mode->crtc_vsync_start - mode->crtc_vdisplay, in vc4_hdmi_set_timings()
1224 VC4_SET_FIELD(mode->crtc_vdisplay, VC4_HDMI_VERTA_VAL)); in vc4_hdmi_set_timings()
1226 VC4_SET_FIELD(mode->crtc_vtotal - mode->crtc_vsync_end + in vc4_hdmi_set_timings()
1230 VC4_SET_FIELD(mode->crtc_vtotal - in vc4_hdmi_set_timings()
1231 mode->crtc_vsync_end, in vc4_hdmi_set_timings()
1240 spin_lock_irqsave(&vc4_hdmi->hw_lock, flags); in vc4_hdmi_set_timings()
1245 VC4_SET_FIELD(mode->hdisplay * pixel_rep, in vc4_hdmi_set_timings()
1249 VC4_SET_FIELD((mode->htotal - in vc4_hdmi_set_timings()
1250 mode->hsync_end) * pixel_rep, in vc4_hdmi_set_timings()
1252 VC4_SET_FIELD((mode->hsync_end - in vc4_hdmi_set_timings()
1253 mode->hsync_start) * pixel_rep, in vc4_hdmi_set_timings()
1255 VC4_SET_FIELD((mode->hsync_start - in vc4_hdmi_set_timings()
1256 mode->hdisplay) * pixel_rep, in vc4_hdmi_set_timings()
1267 reg |= VC4_SET_FIELD(pixel_rep - 1, VC4_HDMI_MISC_CONTROL_PIXEL_REP); in vc4_hdmi_set_timings()
1270 spin_unlock_irqrestore(&vc4_hdmi->hw_lock, flags); in vc4_hdmi_set_timings()
1279 struct drm_device *drm = vc4_hdmi->connector.dev; in vc5_hdmi_set_timings()
1280 bool hsync_pos = mode->flags & DRM_MODE_FLAG_PHSYNC; in vc5_hdmi_set_timings()
1281 bool vsync_pos = mode->flags & DRM_MODE_FLAG_PVSYNC; in vc5_hdmi_set_timings()
1282 bool interlaced = mode->flags & DRM_MODE_FLAG_INTERLACE; in vc5_hdmi_set_timings()
1283 u32 pixel_rep = (mode->flags & DRM_MODE_FLAG_DBLCLK) ? 2 : 1; in vc5_hdmi_set_timings()
1284 u32 verta = (VC4_SET_FIELD(mode->crtc_vsync_end - mode->crtc_vsync_start, in vc5_hdmi_set_timings()
1286 VC4_SET_FIELD(mode->crtc_vsync_start - mode->crtc_vdisplay, in vc5_hdmi_set_timings()
1288 VC4_SET_FIELD(mode->crtc_vdisplay, VC5_HDMI_VERTA_VAL)); in vc5_hdmi_set_timings()
1289 u32 vertb = (VC4_SET_FIELD(mode->htotal >> (2 - pixel_rep), in vc5_hdmi_set_timings()
1291 VC4_SET_FIELD(mode->crtc_vtotal - mode->crtc_vsync_end + in vc5_hdmi_set_timings()
1295 VC4_SET_FIELD(mode->crtc_vtotal - in vc5_hdmi_set_timings()
1296 mode->crtc_vsync_end, in vc5_hdmi_set_timings()
1306 spin_lock_irqsave(&vc4_hdmi->hw_lock, flags); in vc5_hdmi_set_timings()
1311 VC4_SET_FIELD(mode->hdisplay * pixel_rep, in vc5_hdmi_set_timings()
1313 VC4_SET_FIELD((mode->hsync_start - in vc5_hdmi_set_timings()
1314 mode->hdisplay) * pixel_rep, in vc5_hdmi_set_timings()
1318 VC4_SET_FIELD((mode->htotal - in vc5_hdmi_set_timings()
1319 mode->hsync_end) * pixel_rep, in vc5_hdmi_set_timings()
1321 VC4_SET_FIELD((mode->hsync_end - in vc5_hdmi_set_timings()
1322 mode->hsync_start) * pixel_rep, in vc5_hdmi_set_timings()
1331 switch (state->hdmi.output_bpc) { in vc5_hdmi_set_timings()
1345 * YCC422 is always 36-bit and not considered deep colour so in vc5_hdmi_set_timings()
1348 if (state->hdmi.output_format == HDMI_COLORSPACE_YUV422) { in vc5_hdmi_set_timings()
1372 reg |= VC4_SET_FIELD(pixel_rep - 1, VC5_HDMI_MISC_CONTROL_PIXEL_REP); in vc5_hdmi_set_timings()
1377 spin_unlock_irqrestore(&vc4_hdmi->hw_lock, flags); in vc5_hdmi_set_timings()
1384 struct drm_device *drm = vc4_hdmi->connector.dev; in vc4_hdmi_recenter_fifo()
1393 spin_lock_irqsave(&vc4_hdmi->hw_lock, flags); in vc4_hdmi_recenter_fifo()
1403 spin_unlock_irqrestore(&vc4_hdmi->hw_lock, flags); in vc4_hdmi_recenter_fifo()
1407 spin_lock_irqsave(&vc4_hdmi->hw_lock, flags); in vc4_hdmi_recenter_fifo()
1414 spin_unlock_irqrestore(&vc4_hdmi->hw_lock, flags); in vc4_hdmi_recenter_fifo()
1428 struct drm_device *drm = vc4_hdmi->connector.dev; in vc4_hdmi_encoder_pre_crtc_configure()
1429 struct drm_connector *connector = &vc4_hdmi->connector; in vc4_hdmi_encoder_pre_crtc_configure()
1432 const struct drm_display_mode *mode = &vc4_hdmi->saved_adjusted_mode; in vc4_hdmi_encoder_pre_crtc_configure()
1433 unsigned long long tmds_char_rate = conn_state->hdmi.tmds_char_rate; in vc4_hdmi_encoder_pre_crtc_configure()
1439 mutex_lock(&vc4_hdmi->mutex); in vc4_hdmi_encoder_pre_crtc_configure()
1444 ret = pm_runtime_resume_and_get(&vc4_hdmi->pdev->dev); in vc4_hdmi_encoder_pre_crtc_configure()
1451 * As stated in RPi's vc4 firmware "HDMI state machine (HSM) clock must in vc4_hdmi_encoder_pre_crtc_configure()
1453 * simulation. Otherwise, exact value is unimportant for HDMI in vc4_hdmi_encoder_pre_crtc_configure()
1460 * both clocks. Which, for RPi0-3 implies a maximum pixel clock of in vc4_hdmi_encoder_pre_crtc_configure()
1469 ret = clk_set_min_rate(vc4_hdmi->hsm_clock, hsm_rate); in vc4_hdmi_encoder_pre_crtc_configure()
1475 ret = clk_set_rate(vc4_hdmi->pixel_clock, tmds_char_rate); in vc4_hdmi_encoder_pre_crtc_configure()
1481 ret = clk_prepare_enable(vc4_hdmi->pixel_clock); in vc4_hdmi_encoder_pre_crtc_configure()
1497 ret = clk_set_min_rate(vc4_hdmi->pixel_bvb_clock, bvb_rate); in vc4_hdmi_encoder_pre_crtc_configure()
1503 ret = clk_prepare_enable(vc4_hdmi->pixel_bvb_clock); in vc4_hdmi_encoder_pre_crtc_configure()
1509 if (vc4_hdmi->variant->phy_init) in vc4_hdmi_encoder_pre_crtc_configure()
1510 vc4_hdmi->variant->phy_init(vc4_hdmi, conn_state); in vc4_hdmi_encoder_pre_crtc_configure()
1512 spin_lock_irqsave(&vc4_hdmi->hw_lock, flags); in vc4_hdmi_encoder_pre_crtc_configure()
1519 spin_unlock_irqrestore(&vc4_hdmi->hw_lock, flags); in vc4_hdmi_encoder_pre_crtc_configure()
1521 if (vc4_hdmi->variant->set_timings) in vc4_hdmi_encoder_pre_crtc_configure()
1522 vc4_hdmi->variant->set_timings(vc4_hdmi, conn_state, mode); in vc4_hdmi_encoder_pre_crtc_configure()
1526 mutex_unlock(&vc4_hdmi->mutex); in vc4_hdmi_encoder_pre_crtc_configure()
1531 clk_disable_unprepare(vc4_hdmi->pixel_clock); in vc4_hdmi_encoder_pre_crtc_configure()
1533 pm_runtime_put(&vc4_hdmi->pdev->dev); in vc4_hdmi_encoder_pre_crtc_configure()
1537 mutex_unlock(&vc4_hdmi->mutex); in vc4_hdmi_encoder_pre_crtc_configure()
1545 struct drm_device *drm = vc4_hdmi->connector.dev; in vc4_hdmi_encoder_pre_crtc_enable()
1546 struct drm_connector *connector = &vc4_hdmi->connector; in vc4_hdmi_encoder_pre_crtc_enable()
1547 const struct drm_display_mode *mode = &vc4_hdmi->saved_adjusted_mode; in vc4_hdmi_encoder_pre_crtc_enable()
1553 mutex_lock(&vc4_hdmi->mutex); in vc4_hdmi_encoder_pre_crtc_enable()
1558 if (vc4_hdmi->variant->csc_setup) in vc4_hdmi_encoder_pre_crtc_enable()
1559 vc4_hdmi->variant->csc_setup(vc4_hdmi, conn_state, mode); in vc4_hdmi_encoder_pre_crtc_enable()
1561 spin_lock_irqsave(&vc4_hdmi->hw_lock, flags); in vc4_hdmi_encoder_pre_crtc_enable()
1563 spin_unlock_irqrestore(&vc4_hdmi->hw_lock, flags); in vc4_hdmi_encoder_pre_crtc_enable()
1568 mutex_unlock(&vc4_hdmi->mutex); in vc4_hdmi_encoder_pre_crtc_enable()
1575 struct drm_connector *connector = &vc4_hdmi->connector; in vc4_hdmi_encoder_post_crtc_enable()
1576 struct drm_device *drm = connector->dev; in vc4_hdmi_encoder_post_crtc_enable()
1577 const struct drm_display_mode *mode = &vc4_hdmi->saved_adjusted_mode; in vc4_hdmi_encoder_post_crtc_enable()
1578 struct drm_display_info *display = &vc4_hdmi->connector.display_info; in vc4_hdmi_encoder_post_crtc_enable()
1579 bool hsync_pos = mode->flags & DRM_MODE_FLAG_PHSYNC; in vc4_hdmi_encoder_post_crtc_enable()
1580 bool vsync_pos = mode->flags & DRM_MODE_FLAG_PVSYNC; in vc4_hdmi_encoder_post_crtc_enable()
1585 mutex_lock(&vc4_hdmi->mutex); in vc4_hdmi_encoder_post_crtc_enable()
1590 spin_lock_irqsave(&vc4_hdmi->hw_lock, flags); in vc4_hdmi_encoder_post_crtc_enable()
1603 if (display->is_hdmi) { in vc4_hdmi_encoder_post_crtc_enable()
1608 spin_unlock_irqrestore(&vc4_hdmi->hw_lock, flags); in vc4_hdmi_encoder_post_crtc_enable()
1622 spin_unlock_irqrestore(&vc4_hdmi->hw_lock, flags); in vc4_hdmi_encoder_post_crtc_enable()
1630 if (display->is_hdmi) { in vc4_hdmi_encoder_post_crtc_enable()
1631 spin_lock_irqsave(&vc4_hdmi->hw_lock, flags); in vc4_hdmi_encoder_post_crtc_enable()
1639 spin_unlock_irqrestore(&vc4_hdmi->hw_lock, flags); in vc4_hdmi_encoder_post_crtc_enable()
1640 vc4_hdmi->packet_ram_enabled = true; in vc4_hdmi_encoder_post_crtc_enable()
1651 mutex_unlock(&vc4_hdmi->mutex); in vc4_hdmi_encoder_post_crtc_enable()
1660 mutex_lock(&vc4_hdmi->mutex); in vc4_hdmi_encoder_atomic_mode_set()
1661 drm_mode_copy(&vc4_hdmi->saved_adjusted_mode, in vc4_hdmi_encoder_atomic_mode_set()
1662 &crtc_state->adjusted_mode); in vc4_hdmi_encoder_atomic_mode_set()
1663 vc4_hdmi->output_bpc = conn_state->hdmi.output_bpc; in vc4_hdmi_encoder_atomic_mode_set()
1664 vc4_hdmi->output_format = conn_state->hdmi.output_format; in vc4_hdmi_encoder_atomic_mode_set()
1665 mutex_unlock(&vc4_hdmi->mutex); in vc4_hdmi_encoder_atomic_mode_set()
1674 struct vc4_dev *vc4 = to_vc4_dev(connector->dev); in vc4_hdmi_connector_clock_valid()
1676 if (clock > vc4_hdmi->variant->max_pixel_clock) in vc4_hdmi_connector_clock_valid()
1679 if (!vc4->hvs->vc5_hdmi_enable_hdmi_20 && clock > HDMI_14_MAX_TMDS_CLK) in vc4_hdmi_connector_clock_valid()
1683 if (!vc4->hvs->vc5_hdmi_enable_4096by2160 && in vc4_hdmi_connector_clock_valid()
1684 mode->hdisplay > 3840 && mode->vdisplay >= 2160 && in vc4_hdmi_connector_clock_valid()
1704 struct drm_display_mode *mode = &crtc_state->adjusted_mode; in vc4_hdmi_encoder_atomic_check()
1705 unsigned long long tmds_char_rate = mode->clock * 1000; in vc4_hdmi_encoder_atomic_check()
1708 if (vc4_hdmi->variant->unsupported_odd_h_timings) { in vc4_hdmi_encoder_atomic_check()
1709 if (mode->flags & DRM_MODE_FLAG_DBLCLK) { in vc4_hdmi_encoder_atomic_check()
1716 if ((mode->hsync_start - mode->hdisplay) & 1) in vc4_hdmi_encoder_atomic_check()
1717 mode->hsync_start--; in vc4_hdmi_encoder_atomic_check()
1718 if ((mode->hsync_end - mode->hsync_start) & 1) in vc4_hdmi_encoder_atomic_check()
1719 mode->hsync_end--; in vc4_hdmi_encoder_atomic_check()
1723 if ((mode->hdisplay % 2) || (mode->hsync_start % 2) || in vc4_hdmi_encoder_atomic_check()
1724 (mode->hsync_end % 2) || (mode->htotal % 2)) in vc4_hdmi_encoder_atomic_check()
1725 return -EINVAL; in vc4_hdmi_encoder_atomic_check()
1735 if (vc4_hdmi->disable_wifi_frequencies && in vc4_hdmi_encoder_atomic_check()
1738 mode->clock = 238560; in vc4_hdmi_encoder_atomic_check()
1739 tmds_char_rate = mode->clock * 1000; in vc4_hdmi_encoder_atomic_check()
1752 if (vc4_hdmi->variant->unsupported_odd_h_timings && in vc4_hdmi_encoder_mode_valid()
1753 !(mode->flags & DRM_MODE_FLAG_DBLCLK) && in vc4_hdmi_encoder_mode_valid()
1754 ((mode->hdisplay % 2) || (mode->hsync_start % 2) || in vc4_hdmi_encoder_mode_valid()
1755 (mode->hsync_end % 2) || (mode->htotal % 2))) in vc4_hdmi_encoder_mode_valid()
1759 return vc4_hdmi_connector_clock_valid(&vc4_hdmi->connector, mode, rate); in vc4_hdmi_encoder_mode_valid()
1770 struct drm_device *drm = encoder->dev; in vc4_hdmi_late_register()
1772 const struct vc4_hdmi_variant *variant = vc4_hdmi->variant; in vc4_hdmi_late_register()
1774 drm_debugfs_add_file(drm, variant->debugfs_name, in vc4_hdmi_late_register()
1810 struct drm_device *drm = vc4_hdmi->connector.dev; in vc5_hdmi_hp_detect()
1818 spin_lock_irqsave(&vc4_hdmi->hw_lock, flags); in vc5_hdmi_hp_detect()
1820 spin_unlock_irqrestore(&vc4_hdmi->hw_lock, flags); in vc5_hdmi_hp_detect()
1827 /* HDMI audio codec callbacks */
1831 struct drm_device *drm = vc4_hdmi->connector.dev; in vc4_hdmi_audio_set_mai_clock()
1840 hsm_clock = clk_get_rate(vc4_hdmi->audio_clock); in vc4_hdmi_audio_set_mai_clock()
1848 spin_lock_irqsave(&vc4_hdmi->hw_lock, flags); in vc4_hdmi_audio_set_mai_clock()
1851 VC4_SET_FIELD(m - 1, VC4_HD_MAI_SMP_M)); in vc4_hdmi_audio_set_mai_clock()
1852 spin_unlock_irqrestore(&vc4_hdmi->hw_lock, flags); in vc4_hdmi_audio_set_mai_clock()
1859 const struct drm_display_mode *mode = &vc4_hdmi->saved_adjusted_mode; in vc4_hdmi_set_n_cts()
1863 lockdep_assert_held(&vc4_hdmi->mutex); in vc4_hdmi_set_n_cts()
1864 lockdep_assert_held(&vc4_hdmi->hw_lock); in vc4_hdmi_set_n_cts()
1867 tmp = (u64)(mode->clock * 1000) * n; in vc4_hdmi_set_n_cts()
1893 struct drm_display_info *display = &vc4_hdmi->connector.display_info; in vc4_hdmi_audio_can_stream()
1895 lockdep_assert_held(&vc4_hdmi->mutex); in vc4_hdmi_audio_can_stream()
1901 if (!display->is_hdmi) in vc4_hdmi_audio_can_stream()
1910 struct drm_device *drm = vc4_hdmi->connector.dev; in vc4_hdmi_audio_startup()
1915 mutex_lock(&vc4_hdmi->mutex); in vc4_hdmi_audio_startup()
1918 ret = -ENODEV; in vc4_hdmi_audio_startup()
1923 ret = -ENODEV; in vc4_hdmi_audio_startup()
1927 vc4_hdmi->audio.streaming = true; in vc4_hdmi_audio_startup()
1929 spin_lock_irqsave(&vc4_hdmi->hw_lock, flags); in vc4_hdmi_audio_startup()
1936 spin_unlock_irqrestore(&vc4_hdmi->hw_lock, flags); in vc4_hdmi_audio_startup()
1938 if (vc4_hdmi->variant->phy_rng_enable) in vc4_hdmi_audio_startup()
1939 vc4_hdmi->variant->phy_rng_enable(vc4_hdmi); in vc4_hdmi_audio_startup()
1944 mutex_unlock(&vc4_hdmi->mutex); in vc4_hdmi_audio_startup()
1951 struct device *dev = &vc4_hdmi->pdev->dev; in vc4_hdmi_audio_reset()
1955 lockdep_assert_held(&vc4_hdmi->mutex); in vc4_hdmi_audio_reset()
1957 vc4_hdmi->audio.streaming = false; in vc4_hdmi_audio_reset()
1962 spin_lock_irqsave(&vc4_hdmi->hw_lock, flags); in vc4_hdmi_audio_reset()
1968 spin_unlock_irqrestore(&vc4_hdmi->hw_lock, flags); in vc4_hdmi_audio_reset()
1974 struct drm_device *drm = vc4_hdmi->connector.dev; in vc4_hdmi_audio_shutdown()
1978 mutex_lock(&vc4_hdmi->mutex); in vc4_hdmi_audio_shutdown()
1983 spin_lock_irqsave(&vc4_hdmi->hw_lock, flags); in vc4_hdmi_audio_shutdown()
1990 spin_unlock_irqrestore(&vc4_hdmi->hw_lock, flags); in vc4_hdmi_audio_shutdown()
1992 if (vc4_hdmi->variant->phy_rng_disable) in vc4_hdmi_audio_shutdown()
1993 vc4_hdmi->variant->phy_rng_disable(vc4_hdmi); in vc4_hdmi_audio_shutdown()
1995 vc4_hdmi->audio.streaming = false; in vc4_hdmi_audio_shutdown()
2001 mutex_unlock(&vc4_hdmi->mutex); in vc4_hdmi_audio_shutdown()
2042 /* HDMI audio codec callbacks */
2048 struct drm_device *drm = vc4_hdmi->connector.dev; in vc4_hdmi_audio_prepare()
2049 struct drm_connector *connector = &vc4_hdmi->connector; in vc4_hdmi_audio_prepare()
2050 unsigned int sample_rate = params->sample_rate; in vc4_hdmi_audio_prepare()
2051 unsigned int channels = params->channels; in vc4_hdmi_audio_prepare()
2061 sample_rate, params->sample_width, channels); in vc4_hdmi_audio_prepare()
2063 mutex_lock(&vc4_hdmi->mutex); in vc4_hdmi_audio_prepare()
2066 ret = -ENODEV; in vc4_hdmi_audio_prepare()
2071 ret = -EINVAL; in vc4_hdmi_audio_prepare()
2077 spin_lock_irqsave(&vc4_hdmi->hw_lock, flags); in vc4_hdmi_audio_prepare()
2085 if (params->iec.status[0] & IEC958_AES0_NONAUDIO && in vc4_hdmi_audio_prepare()
2086 params->channels == 8) in vc4_hdmi_audio_prepare()
2096 /* The B frame identifier should match the value used by alsa-lib (8) */ in vc4_hdmi_audio_prepare()
2102 channel_mask = GENMASK(channels - 1, 0); in vc4_hdmi_audio_prepare()
2118 channel_map = vc4_hdmi->variant->channel_map(vc4_hdmi, channel_mask); in vc4_hdmi_audio_prepare()
2124 spin_unlock_irqrestore(&vc4_hdmi->hw_lock, flags); in vc4_hdmi_audio_prepare()
2127 ¶ms->cea); in vc4_hdmi_audio_prepare()
2134 mutex_unlock(&vc4_hdmi->mutex); in vc4_hdmi_audio_prepare()
2140 .name = "vc4-hdmi-cpu-dai-component",
2148 snd_soc_dai_init_dma_data(dai, &vc4_hdmi->audio.dma_data, NULL); in vc4_hdmi_audio_cpu_dai_probe()
2158 .name = "vc4-hdmi-cpu-dai",
2173 .chan_names[SNDRV_PCM_STREAM_PLAYBACK] = "audio-rx",
2181 struct drm_connector *connector = &vc4_hdmi->connector; in vc4_hdmi_audio_get_eld()
2183 mutex_lock(&vc4_hdmi->mutex); in vc4_hdmi_audio_get_eld()
2184 memcpy(buf, connector->eld, min(sizeof(connector->eld), len)); in vc4_hdmi_audio_get_eld()
2185 mutex_unlock(&vc4_hdmi->mutex); in vc4_hdmi_audio_get_eld()
2207 platform_device_unregister(vc4_hdmi->audio.codec_pdev); in vc4_hdmi_audio_codec_release()
2208 vc4_hdmi->audio.codec_pdev = NULL; in vc4_hdmi_audio_codec_release()
2214 &vc4_hdmi->variant->registers[HDMI_MAI_DATA]; in vc4_hdmi_audio_init()
2215 struct snd_soc_dai_link *dai_link = &vc4_hdmi->audio.link; in vc4_hdmi_audio_init()
2216 struct snd_soc_card *card = &vc4_hdmi->audio.card; in vc4_hdmi_audio_init()
2217 struct device *dev = &vc4_hdmi->pdev->dev; in vc4_hdmi_audio_init()
2243 if (!of_find_property(dev->of_node, "dmas", &len) || !len) { in vc4_hdmi_audio_init()
2245 "'dmas' DT property is missing or empty, no HDMI audio\n"); in vc4_hdmi_audio_init()
2249 if (mai_data->reg != VC4_HD) { in vc4_hdmi_audio_init()
2251 return -EINVAL; in vc4_hdmi_audio_init()
2261 index = of_property_match_string(dev->of_node, "reg-names", "hd"); in vc4_hdmi_audio_init()
2262 /* Before BCM2711, we don't have a named register range */ in vc4_hdmi_audio_init()
2266 addr = of_get_address(dev->of_node, index, NULL, NULL); in vc4_hdmi_audio_init()
2268 return -EINVAL; in vc4_hdmi_audio_init()
2270 vc4_hdmi->audio.dma_data.addr = be32_to_cpup(addr) + mai_data->offset; in vc4_hdmi_audio_init()
2271 vc4_hdmi->audio.dma_data.addr_width = DMA_SLAVE_BUSWIDTH_4_BYTES; in vc4_hdmi_audio_init()
2272 vc4_hdmi->audio.dma_data.maxburst = 2; in vc4_hdmi_audio_init()
2275 * NOTE: Strictly speaking, we should probably use a DRM-managed in vc4_hdmi_audio_init()
2280 * when registering, even when using non-device-managed in vc4_hdmi_audio_init()
2283 * If we call snd_soc_unregister_component() in a DRM-managed in vc4_hdmi_audio_init()
2284 * action, the device-managed actions have already been executed in vc4_hdmi_audio_init()
2287 * Using device-managed hooks here probably leaves us open to a in vc4_hdmi_audio_init()
2294 * Then, the vc4_hdmi structure is DRM-managed and thus only in vc4_hdmi_audio_init()
2316 dev_err(dev, "Couldn't register the HDMI codec: %ld\n", PTR_ERR(codec_pdev)); in vc4_hdmi_audio_init()
2319 vc4_hdmi->audio.codec_pdev = codec_pdev; in vc4_hdmi_audio_init()
2325 dai_link->cpus = &vc4_hdmi->audio.cpu; in vc4_hdmi_audio_init()
2326 dai_link->codecs = &vc4_hdmi->audio.codec; in vc4_hdmi_audio_init()
2327 dai_link->platforms = &vc4_hdmi->audio.platform; in vc4_hdmi_audio_init()
2329 dai_link->num_cpus = 1; in vc4_hdmi_audio_init()
2330 dai_link->num_codecs = 1; in vc4_hdmi_audio_init()
2331 dai_link->num_platforms = 1; in vc4_hdmi_audio_init()
2333 dai_link->name = "MAI"; in vc4_hdmi_audio_init()
2334 dai_link->stream_name = "MAI PCM"; in vc4_hdmi_audio_init()
2335 dai_link->codecs->dai_name = "i2s-hifi"; in vc4_hdmi_audio_init()
2336 dai_link->cpus->dai_name = dev_name(dev); in vc4_hdmi_audio_init()
2337 dai_link->codecs->name = dev_name(&codec_pdev->dev); in vc4_hdmi_audio_init()
2338 dai_link->platforms->name = dev_name(dev); in vc4_hdmi_audio_init()
2340 card->dai_link = dai_link; in vc4_hdmi_audio_init()
2341 card->num_links = 1; in vc4_hdmi_audio_init()
2342 card->name = vc4_hdmi->variant->card_name; in vc4_hdmi_audio_init()
2343 card->driver_name = "vc4-hdmi"; in vc4_hdmi_audio_init()
2344 card->dev = dev; in vc4_hdmi_audio_init()
2345 card->owner = THIS_MODULE; in vc4_hdmi_audio_init()
2349 * stores a pointer to the snd card object in dev->driver_data. This in vc4_hdmi_audio_init()
2350 * means we cannot use it for something else. The hdmi back-pointer is in vc4_hdmi_audio_init()
2351 * now stored in card->drvdata and should be retrieved with in vc4_hdmi_audio_init()
2366 struct drm_connector *connector = &vc4_hdmi->connector; in vc4_hdmi_hpd_irq_thread()
2367 struct drm_device *dev = connector->dev; in vc4_hdmi_hpd_irq_thread()
2369 if (dev && dev->registered) in vc4_hdmi_hpd_irq_thread()
2377 struct drm_connector *connector = &vc4_hdmi->connector; in vc4_hdmi_hotplug_init()
2378 struct platform_device *pdev = vc4_hdmi->pdev; in vc4_hdmi_hotplug_init()
2381 if (vc4_hdmi->variant->external_irq_controller) { in vc4_hdmi_hotplug_init()
2382 unsigned int hpd_con = platform_get_irq_byname(pdev, "hpd-connected"); in vc4_hdmi_hotplug_init()
2383 unsigned int hpd_rm = platform_get_irq_byname(pdev, "hpd-removed"); in vc4_hdmi_hotplug_init()
2385 ret = devm_request_threaded_irq(&pdev->dev, hpd_con, in vc4_hdmi_hotplug_init()
2388 "vc4 hdmi hpd connected", vc4_hdmi); in vc4_hdmi_hotplug_init()
2392 ret = devm_request_threaded_irq(&pdev->dev, hpd_rm, in vc4_hdmi_hotplug_init()
2395 "vc4 hdmi hpd disconnected", vc4_hdmi); in vc4_hdmi_hotplug_init()
2399 connector->polled = DRM_CONNECTOR_POLL_HPD; in vc4_hdmi_hotplug_init()
2410 if (vc4_hdmi->cec_rx_msg.len) in vc4_cec_irq_handler_rx_thread()
2411 cec_received_msg(vc4_hdmi->cec_adap, in vc4_cec_irq_handler_rx_thread()
2412 &vc4_hdmi->cec_rx_msg); in vc4_cec_irq_handler_rx_thread()
2421 if (vc4_hdmi->cec_tx_ok) { in vc4_cec_irq_handler_tx_thread()
2422 cec_transmit_done(vc4_hdmi->cec_adap, CEC_TX_STATUS_OK, in vc4_cec_irq_handler_tx_thread()
2429 cec_transmit_done(vc4_hdmi->cec_adap, CEC_TX_STATUS_NACK, in vc4_cec_irq_handler_tx_thread()
2440 if (vc4_hdmi->cec_irq_was_rx) in vc4_cec_irq_handler_thread()
2450 struct drm_device *dev = vc4_hdmi->connector.dev; in vc4_cec_read_msg()
2451 struct cec_msg *msg = &vc4_hdmi->cec_rx_msg; in vc4_cec_read_msg()
2454 lockdep_assert_held(&vc4_hdmi->hw_lock); in vc4_cec_read_msg()
2456 msg->len = 1 + ((cntrl1 & VC4_HDMI_CEC_REC_WRD_CNT_MASK) >> in vc4_cec_read_msg()
2459 if (msg->len > 16) { in vc4_cec_read_msg()
2460 drm_err(dev, "Attempting to read too much data (%d)\n", msg->len); in vc4_cec_read_msg()
2464 for (i = 0; i < msg->len; i += 4) { in vc4_cec_read_msg()
2467 msg->msg[i] = val & 0xff; in vc4_cec_read_msg()
2468 msg->msg[i + 1] = (val >> 8) & 0xff; in vc4_cec_read_msg()
2469 msg->msg[i + 2] = (val >> 16) & 0xff; in vc4_cec_read_msg()
2470 msg->msg[i + 3] = (val >> 24) & 0xff; in vc4_cec_read_msg()
2489 lockdep_assert_held(&vc4_hdmi->hw_lock); in vc4_cec_irq_handler_tx_bare_locked()
2492 vc4_hdmi->cec_tx_ok = cntrl1 & VC4_HDMI_CEC_TX_STATUS_GOOD; in vc4_cec_irq_handler_tx_bare_locked()
2504 spin_lock(&vc4_hdmi->hw_lock); in vc4_cec_irq_handler_tx_bare()
2506 spin_unlock(&vc4_hdmi->hw_lock); in vc4_cec_irq_handler_tx_bare()
2515 lockdep_assert_held(&vc4_hdmi->hw_lock); in vc4_cec_irq_handler_rx_bare_locked()
2528 vc4_hdmi->cec_rx_msg.len = 0; in vc4_cec_irq_handler_rx_bare_locked()
2545 spin_lock(&vc4_hdmi->hw_lock); in vc4_cec_irq_handler_rx_bare()
2547 spin_unlock(&vc4_hdmi->hw_lock); in vc4_cec_irq_handler_rx_bare()
2573 spin_lock(&vc4_hdmi->hw_lock); in vc4_cec_irq_handler()
2575 vc4_hdmi->cec_irq_was_rx = cntrl5 & VC4_HDMI_CEC_RX_CEC_INT; in vc4_cec_irq_handler()
2576 if (vc4_hdmi->cec_irq_was_rx) in vc4_cec_irq_handler()
2582 spin_unlock(&vc4_hdmi->hw_lock); in vc4_cec_irq_handler()
2590 struct drm_device *drm = vc4_hdmi->connector.dev; in vc4_hdmi_cec_enable()
2606 ret = pm_runtime_resume_and_get(&vc4_hdmi->pdev->dev); in vc4_hdmi_cec_enable()
2612 mutex_lock(&vc4_hdmi->mutex); in vc4_hdmi_cec_enable()
2614 spin_lock_irqsave(&vc4_hdmi->hw_lock, flags); in vc4_hdmi_cec_enable()
2643 if (!vc4_hdmi->variant->external_irq_controller) in vc4_hdmi_cec_enable()
2646 spin_unlock_irqrestore(&vc4_hdmi->hw_lock, flags); in vc4_hdmi_cec_enable()
2648 mutex_unlock(&vc4_hdmi->mutex); in vc4_hdmi_cec_enable()
2657 struct drm_device *drm = vc4_hdmi->connector.dev; in vc4_hdmi_cec_disable()
2669 mutex_lock(&vc4_hdmi->mutex); in vc4_hdmi_cec_disable()
2671 spin_lock_irqsave(&vc4_hdmi->hw_lock, flags); in vc4_hdmi_cec_disable()
2673 if (!vc4_hdmi->variant->external_irq_controller) in vc4_hdmi_cec_disable()
2679 spin_unlock_irqrestore(&vc4_hdmi->hw_lock, flags); in vc4_hdmi_cec_disable()
2681 mutex_unlock(&vc4_hdmi->mutex); in vc4_hdmi_cec_disable()
2683 pm_runtime_put(&vc4_hdmi->pdev->dev); in vc4_hdmi_cec_disable()
2701 struct drm_device *drm = vc4_hdmi->connector.dev; in vc4_hdmi_cec_adap_log_addr()
2713 mutex_lock(&vc4_hdmi->mutex); in vc4_hdmi_cec_adap_log_addr()
2714 spin_lock_irqsave(&vc4_hdmi->hw_lock, flags); in vc4_hdmi_cec_adap_log_addr()
2718 spin_unlock_irqrestore(&vc4_hdmi->hw_lock, flags); in vc4_hdmi_cec_adap_log_addr()
2719 mutex_unlock(&vc4_hdmi->mutex); in vc4_hdmi_cec_adap_log_addr()
2730 struct drm_device *dev = vc4_hdmi->connector.dev; in vc4_hdmi_cec_adap_transmit()
2737 return -ENODEV; in vc4_hdmi_cec_adap_transmit()
2739 if (msg->len > 16) { in vc4_hdmi_cec_adap_transmit()
2740 drm_err(dev, "Attempting to transmit too much data (%d)\n", msg->len); in vc4_hdmi_cec_adap_transmit()
2742 return -ENOMEM; in vc4_hdmi_cec_adap_transmit()
2745 mutex_lock(&vc4_hdmi->mutex); in vc4_hdmi_cec_adap_transmit()
2747 spin_lock_irqsave(&vc4_hdmi->hw_lock, flags); in vc4_hdmi_cec_adap_transmit()
2749 for (i = 0; i < msg->len; i += 4) in vc4_hdmi_cec_adap_transmit()
2751 (msg->msg[i]) | in vc4_hdmi_cec_adap_transmit()
2752 (msg->msg[i + 1] << 8) | in vc4_hdmi_cec_adap_transmit()
2753 (msg->msg[i + 2] << 16) | in vc4_hdmi_cec_adap_transmit()
2754 (msg->msg[i + 3] << 24)); in vc4_hdmi_cec_adap_transmit()
2760 val |= (msg->len - 1) << VC4_HDMI_CEC_MESSAGE_LENGTH_SHIFT; in vc4_hdmi_cec_adap_transmit()
2765 spin_unlock_irqrestore(&vc4_hdmi->hw_lock, flags); in vc4_hdmi_cec_adap_transmit()
2766 mutex_unlock(&vc4_hdmi->mutex); in vc4_hdmi_cec_adap_transmit()
2782 cec_unregister_adapter(vc4_hdmi->cec_adap); in vc4_hdmi_cec_release()
2783 vc4_hdmi->cec_adap = NULL; in vc4_hdmi_cec_release()
2789 struct platform_device *pdev = vc4_hdmi->pdev; in vc4_hdmi_cec_init()
2790 struct device *dev = &pdev->dev; in vc4_hdmi_cec_init()
2793 if (!of_property_present(dev->of_node, "interrupts")) { in vc4_hdmi_cec_init()
2798 vc4_hdmi->cec_adap = cec_allocate_adapter(&vc4_hdmi_cec_adap_ops, in vc4_hdmi_cec_init()
2800 vc4_hdmi->variant->card_name, in vc4_hdmi_cec_init()
2803 ret = PTR_ERR_OR_ZERO(vc4_hdmi->cec_adap); in vc4_hdmi_cec_init()
2807 cec_fill_conn_info_from_drm(&conn_info, &vc4_hdmi->connector); in vc4_hdmi_cec_init()
2808 cec_s_conn_info(vc4_hdmi->cec_adap, &conn_info); in vc4_hdmi_cec_init()
2810 if (vc4_hdmi->variant->external_irq_controller) { in vc4_hdmi_cec_init()
2811 ret = devm_request_threaded_irq(dev, platform_get_irq_byname(pdev, "cec-rx"), in vc4_hdmi_cec_init()
2814 "vc4 hdmi cec rx", vc4_hdmi); in vc4_hdmi_cec_init()
2818 ret = devm_request_threaded_irq(dev, platform_get_irq_byname(pdev, "cec-tx"), in vc4_hdmi_cec_init()
2821 "vc4 hdmi cec tx", vc4_hdmi); in vc4_hdmi_cec_init()
2828 "vc4 hdmi cec", vc4_hdmi); in vc4_hdmi_cec_init()
2833 ret = cec_register_adapter(vc4_hdmi->cec_adap, &pdev->dev); in vc4_hdmi_cec_init()
2838 * NOTE: Strictly speaking, we should probably use a DRM-managed in vc4_hdmi_cec_init()
2846 * By the time the device-managed hook is executed, we will give in vc4_hdmi_cec_init()
2855 * used to be our HDMI controller. If we get a CEC call at that in vc4_hdmi_cec_init()
2856 * moment, we could end up with a use-after-free. Fortunately, in vc4_hdmi_cec_init()
2867 cec_delete_adapter(vc4_hdmi->cec_adap); in vc4_hdmi_cec_init()
2890 const struct vc4_hdmi_variant *variant = vc4_hdmi->variant; in vc4_hdmi_build_regset()
2896 regs = kcalloc(variant->num_registers, sizeof(*regs), in vc4_hdmi_build_regset()
2899 return -ENOMEM; in vc4_hdmi_build_regset()
2901 for (i = 0; i < variant->num_registers; i++) { in vc4_hdmi_build_regset()
2902 const struct vc4_hdmi_register *field = &variant->registers[i]; in vc4_hdmi_build_regset()
2904 if (field->reg != reg) in vc4_hdmi_build_regset()
2907 regs[count].name = field->name; in vc4_hdmi_build_regset()
2908 regs[count].offset = field->offset; in vc4_hdmi_build_regset()
2914 return -ENOMEM; in vc4_hdmi_build_regset()
2916 regset->base = __vc4_hdmi_get_field_base(vc4_hdmi, reg); in vc4_hdmi_build_regset()
2917 regset->regs = new_regs; in vc4_hdmi_build_regset()
2918 regset->nregs = count; in vc4_hdmi_build_regset()
2930 struct platform_device *pdev = vc4_hdmi->pdev; in vc4_hdmi_init_resources()
2931 struct device *dev = &pdev->dev; in vc4_hdmi_init_resources()
2934 vc4_hdmi->hdmicore_regs = vc4_ioremap_regs(pdev, 0); in vc4_hdmi_init_resources()
2935 if (IS_ERR(vc4_hdmi->hdmicore_regs)) in vc4_hdmi_init_resources()
2936 return PTR_ERR(vc4_hdmi->hdmicore_regs); in vc4_hdmi_init_resources()
2938 vc4_hdmi->hd_regs = vc4_ioremap_regs(pdev, 1); in vc4_hdmi_init_resources()
2939 if (IS_ERR(vc4_hdmi->hd_regs)) in vc4_hdmi_init_resources()
2940 return PTR_ERR(vc4_hdmi->hd_regs); in vc4_hdmi_init_resources()
2942 ret = vc4_hdmi_build_regset(drm, vc4_hdmi, &vc4_hdmi->hd_regset, VC4_HD); in vc4_hdmi_init_resources()
2946 ret = vc4_hdmi_build_regset(drm, vc4_hdmi, &vc4_hdmi->hdmi_regset, VC4_HDMI); in vc4_hdmi_init_resources()
2950 vc4_hdmi->pixel_clock = devm_clk_get(dev, "pixel"); in vc4_hdmi_init_resources()
2951 if (IS_ERR(vc4_hdmi->pixel_clock)) { in vc4_hdmi_init_resources()
2952 ret = PTR_ERR(vc4_hdmi->pixel_clock); in vc4_hdmi_init_resources()
2953 if (ret != -EPROBE_DEFER) in vc4_hdmi_init_resources()
2958 vc4_hdmi->hsm_clock = devm_clk_get(dev, "hdmi"); in vc4_hdmi_init_resources()
2959 if (IS_ERR(vc4_hdmi->hsm_clock)) { in vc4_hdmi_init_resources()
2960 drm_err(drm, "Failed to get HDMI state machine clock\n"); in vc4_hdmi_init_resources()
2961 return PTR_ERR(vc4_hdmi->hsm_clock); in vc4_hdmi_init_resources()
2963 vc4_hdmi->audio_clock = vc4_hdmi->hsm_clock; in vc4_hdmi_init_resources()
2964 vc4_hdmi->cec_clock = vc4_hdmi->hsm_clock; in vc4_hdmi_init_resources()
2972 struct platform_device *pdev = vc4_hdmi->pdev; in vc5_hdmi_init_resources()
2973 struct device *dev = &pdev->dev; in vc5_hdmi_init_resources()
2977 res = platform_get_resource_byname(pdev, IORESOURCE_MEM, "hdmi"); in vc5_hdmi_init_resources()
2979 return -ENODEV; in vc5_hdmi_init_resources()
2981 vc4_hdmi->hdmicore_regs = devm_ioremap(dev, res->start, in vc5_hdmi_init_resources()
2983 if (!vc4_hdmi->hdmicore_regs) in vc5_hdmi_init_resources()
2984 return -ENOMEM; in vc5_hdmi_init_resources()
2988 return -ENODEV; in vc5_hdmi_init_resources()
2990 vc4_hdmi->hd_regs = devm_ioremap(dev, res->start, resource_size(res)); in vc5_hdmi_init_resources()
2991 if (!vc4_hdmi->hd_regs) in vc5_hdmi_init_resources()
2992 return -ENOMEM; in vc5_hdmi_init_resources()
2996 return -ENODEV; in vc5_hdmi_init_resources()
2998 vc4_hdmi->cec_regs = devm_ioremap(dev, res->start, resource_size(res)); in vc5_hdmi_init_resources()
2999 if (!vc4_hdmi->cec_regs) in vc5_hdmi_init_resources()
3000 return -ENOMEM; in vc5_hdmi_init_resources()
3004 return -ENODEV; in vc5_hdmi_init_resources()
3006 vc4_hdmi->csc_regs = devm_ioremap(dev, res->start, resource_size(res)); in vc5_hdmi_init_resources()
3007 if (!vc4_hdmi->csc_regs) in vc5_hdmi_init_resources()
3008 return -ENOMEM; in vc5_hdmi_init_resources()
3012 return -ENODEV; in vc5_hdmi_init_resources()
3014 vc4_hdmi->dvp_regs = devm_ioremap(dev, res->start, resource_size(res)); in vc5_hdmi_init_resources()
3015 if (!vc4_hdmi->dvp_regs) in vc5_hdmi_init_resources()
3016 return -ENOMEM; in vc5_hdmi_init_resources()
3020 return -ENODEV; in vc5_hdmi_init_resources()
3022 vc4_hdmi->phy_regs = devm_ioremap(dev, res->start, resource_size(res)); in vc5_hdmi_init_resources()
3023 if (!vc4_hdmi->phy_regs) in vc5_hdmi_init_resources()
3024 return -ENOMEM; in vc5_hdmi_init_resources()
3028 return -ENODEV; in vc5_hdmi_init_resources()
3030 vc4_hdmi->ram_regs = devm_ioremap(dev, res->start, resource_size(res)); in vc5_hdmi_init_resources()
3031 if (!vc4_hdmi->ram_regs) in vc5_hdmi_init_resources()
3032 return -ENOMEM; in vc5_hdmi_init_resources()
3036 return -ENODEV; in vc5_hdmi_init_resources()
3038 vc4_hdmi->rm_regs = devm_ioremap(dev, res->start, resource_size(res)); in vc5_hdmi_init_resources()
3039 if (!vc4_hdmi->rm_regs) in vc5_hdmi_init_resources()
3040 return -ENOMEM; in vc5_hdmi_init_resources()
3042 vc4_hdmi->hsm_clock = devm_clk_get(dev, "hdmi"); in vc5_hdmi_init_resources()
3043 if (IS_ERR(vc4_hdmi->hsm_clock)) { in vc5_hdmi_init_resources()
3044 drm_err(drm, "Failed to get HDMI state machine clock\n"); in vc5_hdmi_init_resources()
3045 return PTR_ERR(vc4_hdmi->hsm_clock); in vc5_hdmi_init_resources()
3048 vc4_hdmi->pixel_bvb_clock = devm_clk_get(dev, "bvb"); in vc5_hdmi_init_resources()
3049 if (IS_ERR(vc4_hdmi->pixel_bvb_clock)) { in vc5_hdmi_init_resources()
3051 return PTR_ERR(vc4_hdmi->pixel_bvb_clock); in vc5_hdmi_init_resources()
3054 vc4_hdmi->audio_clock = devm_clk_get(dev, "audio"); in vc5_hdmi_init_resources()
3055 if (IS_ERR(vc4_hdmi->audio_clock)) { in vc5_hdmi_init_resources()
3057 return PTR_ERR(vc4_hdmi->audio_clock); in vc5_hdmi_init_resources()
3060 vc4_hdmi->cec_clock = devm_clk_get(dev, "cec"); in vc5_hdmi_init_resources()
3061 if (IS_ERR(vc4_hdmi->cec_clock)) { in vc5_hdmi_init_resources()
3063 return PTR_ERR(vc4_hdmi->cec_clock); in vc5_hdmi_init_resources()
3066 vc4_hdmi->reset = devm_reset_control_get(dev, NULL); in vc5_hdmi_init_resources()
3067 if (IS_ERR(vc4_hdmi->reset)) { in vc5_hdmi_init_resources()
3068 drm_err(drm, "Failed to get HDMI reset line\n"); in vc5_hdmi_init_resources()
3069 return PTR_ERR(vc4_hdmi->reset); in vc5_hdmi_init_resources()
3072 ret = vc4_hdmi_build_regset(drm, vc4_hdmi, &vc4_hdmi->hdmi_regset, VC4_HDMI); in vc5_hdmi_init_resources()
3076 ret = vc4_hdmi_build_regset(drm, vc4_hdmi, &vc4_hdmi->hd_regset, VC4_HD); in vc5_hdmi_init_resources()
3080 ret = vc4_hdmi_build_regset(drm, vc4_hdmi, &vc4_hdmi->cec_regset, VC5_CEC); in vc5_hdmi_init_resources()
3084 ret = vc4_hdmi_build_regset(drm, vc4_hdmi, &vc4_hdmi->csc_regset, VC5_CSC); in vc5_hdmi_init_resources()
3088 ret = vc4_hdmi_build_regset(drm, vc4_hdmi, &vc4_hdmi->dvp_regset, VC5_DVP); in vc5_hdmi_init_resources()
3092 ret = vc4_hdmi_build_regset(drm, vc4_hdmi, &vc4_hdmi->phy_regset, VC5_PHY); in vc5_hdmi_init_resources()
3096 ret = vc4_hdmi_build_regset(drm, vc4_hdmi, &vc4_hdmi->ram_regset, VC5_RAM); in vc5_hdmi_init_resources()
3100 ret = vc4_hdmi_build_regset(drm, vc4_hdmi, &vc4_hdmi->rm_regset, VC5_RM); in vc5_hdmi_init_resources()
3111 clk_disable_unprepare(vc4_hdmi->hsm_clock); in vc4_hdmi_runtime_suspend()
3124 ret = clk_prepare_enable(vc4_hdmi->hsm_clock); in vc4_hdmi_runtime_resume()
3129 * Whenever the RaspberryPi boots without an HDMI monitor in vc4_hdmi_runtime_resume()
3137 rate = clk_get_rate(vc4_hdmi->hsm_clock); in vc4_hdmi_runtime_resume()
3139 ret = -EINVAL; in vc4_hdmi_runtime_resume()
3143 if (vc4_hdmi->variant->reset) in vc4_hdmi_runtime_resume()
3144 vc4_hdmi->variant->reset(vc4_hdmi); in vc4_hdmi_runtime_resume()
3147 spin_lock_irqsave(&vc4_hdmi->hw_lock, flags); in vc4_hdmi_runtime_resume()
3152 spin_unlock_irqrestore(&vc4_hdmi->hw_lock, flags); in vc4_hdmi_runtime_resume()
3156 if (!vc4_hdmi->variant->external_irq_controller) { in vc4_hdmi_runtime_resume()
3157 spin_lock_irqsave(&vc4_hdmi->hw_lock, flags); in vc4_hdmi_runtime_resume()
3159 spin_unlock_irqrestore(&vc4_hdmi->hw_lock, flags); in vc4_hdmi_runtime_resume()
3166 clk_disable_unprepare(vc4_hdmi->hsm_clock); in vc4_hdmi_runtime_resume()
3174 put_device(&vc4_hdmi->ddc->dev); in vc4_hdmi_put_ddc_device()
3189 return -ENOMEM; in vc4_hdmi_bind()
3191 ret = drmm_mutex_init(drm, &vc4_hdmi->mutex); in vc4_hdmi_bind()
3195 spin_lock_init(&vc4_hdmi->hw_lock); in vc4_hdmi_bind()
3196 INIT_DELAYED_WORK(&vc4_hdmi->scrambling_work, vc4_hdmi_scrambling_wq); in vc4_hdmi_bind()
3199 encoder = &vc4_hdmi->encoder.base; in vc4_hdmi_bind()
3200 vc4_hdmi->encoder.type = variant->encoder_type; in vc4_hdmi_bind()
3201 vc4_hdmi->encoder.pre_crtc_configure = vc4_hdmi_encoder_pre_crtc_configure; in vc4_hdmi_bind()
3202 vc4_hdmi->encoder.pre_crtc_enable = vc4_hdmi_encoder_pre_crtc_enable; in vc4_hdmi_bind()
3203 vc4_hdmi->encoder.post_crtc_enable = vc4_hdmi_encoder_post_crtc_enable; in vc4_hdmi_bind()
3204 vc4_hdmi->encoder.post_crtc_disable = vc4_hdmi_encoder_post_crtc_disable; in vc4_hdmi_bind()
3205 vc4_hdmi->encoder.post_crtc_powerdown = vc4_hdmi_encoder_post_crtc_powerdown; in vc4_hdmi_bind()
3206 vc4_hdmi->pdev = pdev; in vc4_hdmi_bind()
3207 vc4_hdmi->variant = variant; in vc4_hdmi_bind()
3215 if (variant->max_pixel_clock > HDMI_14_MAX_TMDS_CLK) in vc4_hdmi_bind()
3216 vc4_hdmi->scdc_enabled = true; in vc4_hdmi_bind()
3218 ret = variant->init_resources(drm, vc4_hdmi); in vc4_hdmi_bind()
3222 ddc_node = of_parse_phandle(dev->of_node, "ddc", 0); in vc4_hdmi_bind()
3225 return -ENODEV; in vc4_hdmi_bind()
3228 vc4_hdmi->ddc = of_find_i2c_adapter_by_node(ddc_node); in vc4_hdmi_bind()
3230 if (!vc4_hdmi->ddc) { in vc4_hdmi_bind()
3231 drm_err(drm, "Failed to get ddc i2c adapter by node\n"); in vc4_hdmi_bind()
3232 return -EPROBE_DEFER; in vc4_hdmi_bind()
3240 * we'll use the HDMI core's register. in vc4_hdmi_bind()
3242 vc4_hdmi->hpd_gpio = devm_gpiod_get_optional(dev, "hpd", GPIOD_IN); in vc4_hdmi_bind()
3243 if (IS_ERR(vc4_hdmi->hpd_gpio)) { in vc4_hdmi_bind()
3244 return PTR_ERR(vc4_hdmi->hpd_gpio); in vc4_hdmi_bind()
3247 vc4_hdmi->disable_wifi_frequencies = in vc4_hdmi_bind()
3248 of_property_read_bool(dev->of_node, "wifi-2.4ghz-coexistence"); in vc4_hdmi_bind()
3262 if ((of_device_is_compatible(dev->of_node, "brcm,bcm2711-hdmi0") || in vc4_hdmi_bind()
3263 of_device_is_compatible(dev->of_node, "brcm,bcm2711-hdmi1")) && in vc4_hdmi_bind()
3265 clk_prepare_enable(vc4_hdmi->pixel_clock); in vc4_hdmi_bind()
3266 clk_prepare_enable(vc4_hdmi->hsm_clock); in vc4_hdmi_bind()
3267 clk_prepare_enable(vc4_hdmi->pixel_bvb_clock); in vc4_hdmi_bind()
3311 return component_add(&pdev->dev, &vc4_hdmi_ops); in vc4_hdmi_dev_probe()
3316 component_del(&pdev->dev, &vc4_hdmi_ops); in vc4_hdmi_dev_remove()
3322 .card_name = "vc4-hdmi",
3342 .card_name = "vc4-hdmi-0",
3371 .card_name = "vc4-hdmi-1",
3398 { .compatible = "brcm,bcm2835-hdmi", .data = &bcm2835_variant },
3399 { .compatible = "brcm,bcm2711-hdmi0", .data = &bcm2711_hdmi0_variant },
3400 { .compatible = "brcm,bcm2711-hdmi1", .data = &bcm2711_hdmi1_variant },