Lines Matching +full:hdmi +full:- +full:connector
1 // SPDX-License-Identifier: GPL-2.0+
18 * Display pipe 0 is attached with a built-in transparent VGA encoder and
19 * a built-in HDMI encoder.
20 * Display pipe 1 has only one built-in HDMI encoder connected.
22 * | +-----+ | | |
23 * | CRTC0 -+--> | VGA | ----> VGA Connector ---> | VGA Monitor |<---+
24 * | | +-----+ | |_____________| |
26 * | | +------+ | | | |
27 * | +--> | HDMI | ----> HDMI Connector --> | HDMI Monitor |<--+
28 * | +------+ | |______________| |
29 * | +------+ | |
30 * | | i2c6 | <-------------------------------------------+
31 * | +------+ |
35 * | +------+ |
36 * | | i2c7 | <--------------------------------+
37 * | +------+ | |
39 * | +------+ | | |
40 * | CRTC1 ---> | HDMI | ----> HDMI Connector ---> | HDMI Monitor |
41 * | +------+ | |______________|
45 static int ls7a2000_connector_get_modes(struct drm_connector *connector) in ls7a2000_connector_get_modes() argument
49 if (connector->ddc) { in ls7a2000_connector_get_modes()
52 drm_edid = drm_edid_read(connector); in ls7a2000_connector_get_modes()
53 drm_edid_connector_update(connector, drm_edid); in ls7a2000_connector_get_modes()
54 num = drm_edid_connector_add_modes(connector); in ls7a2000_connector_get_modes()
60 num = drm_add_modes_noedid(connector, 1920, 1200); in ls7a2000_connector_get_modes()
62 drm_set_preferred_mode(connector, 1024, 768); in ls7a2000_connector_get_modes()
68 ls7a2000_connector_get_best_encoder(struct drm_connector *connector, in ls7a2000_connector_get_best_encoder() argument
71 struct lsdc_output *output = connector_to_lsdc_output(connector); in ls7a2000_connector_get_best_encoder()
73 return &output->encoder; in ls7a2000_connector_get_best_encoder()
114 struct drm_info_node *node = (struct drm_info_node *)m->private; in ls7a2000_hdmi_encoder_regs_show()
115 struct drm_device *ddev = node->minor->dev; in ls7a2000_hdmi_encoder_regs_show()
119 preg = (const struct lsdc_reg32 *)node->info_ent->data; in ls7a2000_hdmi_encoder_regs_show()
121 while (preg->name) { in ls7a2000_hdmi_encoder_regs_show()
122 u32 offset = preg->offset; in ls7a2000_hdmi_encoder_regs_show()
125 preg->name, offset, lsdc_rreg32(ldev, offset)); in ls7a2000_hdmi_encoder_regs_show()
140 static void ls7a2000_hdmi0_late_register(struct drm_connector *connector, in ls7a2000_hdmi0_late_register() argument
143 struct drm_device *ddev = connector->dev; in ls7a2000_hdmi0_late_register()
144 struct drm_minor *minor = ddev->primary; in ls7a2000_hdmi0_late_register()
151 static void ls7a2000_hdmi1_late_register(struct drm_connector *connector, in ls7a2000_hdmi1_late_register() argument
154 struct drm_device *ddev = connector->dev; in ls7a2000_hdmi1_late_register()
155 struct drm_minor *minor = ddev->primary; in ls7a2000_hdmi1_late_register()
165 ls7a2000_hdmi0_vga_connector_detect(struct drm_connector *connector, bool force) in ls7a2000_hdmi0_vga_connector_detect() argument
167 struct drm_device *ddev = connector->dev; in ls7a2000_hdmi0_vga_connector_detect()
176 if (connector->ddc) { in ls7a2000_hdmi0_vga_connector_detect()
177 if (drm_probe_ddc(connector->ddc)) in ls7a2000_hdmi0_vga_connector_detect()
187 ls7a2000_hdmi1_connector_detect(struct drm_connector *connector, bool force) in ls7a2000_hdmi1_connector_detect() argument
189 struct lsdc_device *ldev = to_lsdc(connector->dev); in ls7a2000_hdmi1_connector_detect()
221 /* Even though some board has only one hdmi on display pipe 1,
229 struct drm_device *ddev = encoder->dev; in ls7a2000_hdmi0_encoder_reset()
241 /* help the hdmi phy to get out of reset state */ in ls7a2000_hdmi0_encoder_reset()
246 drm_dbg(ddev, "HDMI-0 Reset\n"); in ls7a2000_hdmi0_encoder_reset()
251 struct drm_device *ddev = encoder->dev; in ls7a2000_hdmi1_encoder_reset()
263 /* help the hdmi phy to get out of reset state */ in ls7a2000_hdmi1_encoder_reset()
268 drm_dbg(ddev, "HDMI-1 Reset\n"); in ls7a2000_hdmi1_encoder_reset()
287 unsigned int index = dispipe->index; in ls7a2000_hdmi_set_avi_infoframe()
288 struct drm_device *ddev = encoder->dev; in ls7a2000_hdmi_set_avi_infoframe()
297 &output->connector, in ls7a2000_hdmi_set_avi_infoframe()
328 drm_dbg(ddev, "Update HDMI-%u avi infoframe\n", index); in ls7a2000_hdmi_set_avi_infoframe()
338 unsigned int index = dispipe->index; in ls7a2000_hdmi_atomic_disable()
339 struct drm_device *ddev = encoder->dev; in ls7a2000_hdmi_atomic_disable()
343 /* Disable the hdmi phy */ in ls7a2000_hdmi_atomic_disable()
348 /* Disable the hdmi interface */ in ls7a2000_hdmi_atomic_disable()
353 drm_dbg(ddev, "HDMI-%u disabled\n", index); in ls7a2000_hdmi_atomic_disable()
359 struct drm_device *ddev = encoder->dev; in ls7a2000_hdmi_atomic_enable()
363 unsigned int index = dispipe->index; in ls7a2000_hdmi_atomic_enable()
390 drm_dbg(ddev, "HDMI-%u enabled\n", index); in ls7a2000_hdmi_atomic_enable()
403 * +--------------------------------------------------------+
405 * |-------------------+----+-----+----+-----+--------------|
411 * +--------------------------------------------------------+
417 struct drm_device *ddev = &ldev->base; in ls7a2000_hdmi_phy_pll_config()
425 * Most of time, loongson HDMI require M = 10 in ls7a2000_hdmi_phy_pll_config()
459 drm_dbg(ddev, "Fin of HDMI-%u: %d kHz\n", index, fin); in ls7a2000_hdmi_phy_pll_config()
461 /* Wait hdmi phy pll lock */ in ls7a2000_hdmi_phy_pll_config()
466 drm_dbg(ddev, "Setting HDMI-%u PLL take %d cycles\n", in ls7a2000_hdmi_phy_pll_config()
476 drm_err(ddev, "Setting HDMI-%u PLL failed\n", index); in ls7a2000_hdmi_phy_pll_config()
485 unsigned int index = dispipe->index; in ls7a2000_hdmi_atomic_mode_set()
486 struct drm_device *ddev = encoder->dev; in ls7a2000_hdmi_atomic_mode_set()
488 struct drm_display_mode *mode = &crtc_state->mode; in ls7a2000_hdmi_atomic_mode_set()
490 ls7a2000_hdmi_phy_pll_config(ldev, mode->clock, index); in ls7a2000_hdmi_atomic_mode_set()
494 drm_dbg(ddev, "%s modeset finished\n", encoder->name); in ls7a2000_hdmi_atomic_mode_set()
506 * 1) Most of board export one vga + hdmi output interface.
507 * 2) Yet, Some boards export double hdmi output interface.
508 * 3) Still have boards export three output(2 hdmi + 1 vga).
510 * So let's hook hdmi helper funcs to all display pipe, don't miss.
511 * writing hdmi register do no harms.
518 struct lsdc_output *output = &dispipe->output; in ls7a2000_output_init()
519 struct drm_encoder *encoder = &output->encoder; in ls7a2000_output_init()
520 struct drm_connector *connector = &output->connector; in ls7a2000_output_init() local
524 DRM_MODE_ENCODER_TMDS, "encoder-%u", pipe); in ls7a2000_output_init()
528 encoder->possible_crtcs = BIT(pipe); in ls7a2000_output_init()
532 ret = drm_connector_init_with_ddc(ddev, connector, in ls7a2000_output_init()
538 drm_info(ddev, "display pipe-%u has HDMI %s\n", pipe, pipe ? "" : "and/or VGA"); in ls7a2000_output_init()
540 drm_connector_helper_add(connector, &ls7a2000_connector_helpers); in ls7a2000_output_init()
542 drm_connector_attach_encoder(connector, encoder); in ls7a2000_output_init()
544 connector->polled = DRM_CONNECTOR_POLL_CONNECT | in ls7a2000_output_init()
547 connector->interlace_allowed = 0; in ls7a2000_output_init()
548 connector->doublescan_allowed = 0; in ls7a2000_output_init()