Lines Matching +full:reg +full:- +full:40 +full:h
1 // SPDX-License-Identifier: GPL-2.0+
6 #include <linux/delay.h>
8 #include <drm/drm_atomic_helper.h>
9 #include <drm/drm_debugfs.h>
10 #include <drm/drm_edid.h>
11 #include <drm/drm_probe_helper.h>
13 #include "lsdc_drv.h"
14 #include "lsdc_output.h"
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 * | +------+ | |______________|
49 if (connector->ddc) { in ls7a2000_connector_get_modes()
73 return &output->encoder; in ls7a2000_connector_get_best_encoder()
83 #define LSDC_HDMI_REG(i, reg) { \ argument
84 .name = __stringify_1(LSDC_HDMI##i##_##reg##_REG), \
85 .offset = LSDC_HDMI##i##_##reg##_REG, \
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()
143 struct drm_device *ddev = connector->dev; in ls7a2000_hdmi0_late_register()
144 struct drm_minor *minor = ddev->primary; in ls7a2000_hdmi0_late_register()
154 struct drm_device *ddev = connector->dev; in ls7a2000_hdmi1_late_register()
155 struct drm_minor *minor = ddev->primary; in ls7a2000_hdmi1_late_register()
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()
189 struct lsdc_device *ldev = to_lsdc(connector->dev); in ls7a2000_hdmi1_connector_detect()
229 struct drm_device *ddev = encoder->dev; 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()
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()
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 * |-------------------+----+-----+----+-----+--------------|
406 * | 170000 ~ 340000 | 10 | 16 | 40 | 1 | 1700 ~ 3400 |
407 * | 85000 ~ 170000 | 10 | 8 | 40 | 2 | 850 ~ 1700 |
408 * | 42500 ~ 85000 | 10 | 4 | 40 | 4 | 425 ~ 850 |
409 * | 21250 ~ 42500 | 10 | 2 | 40 | 8 | 212.5 ~ 425 |
410 * | 20000 ~ 21250 | 10 | 1 | 40 | 16 | 200 ~ 212.5 |
411 * +--------------------------------------------------------+
417 struct drm_device *ddev = &ldev->base; in ls7a2000_hdmi_phy_pll_config()
426 * for example, 10 = (4 * 40) / (8 * 2) in ls7a2000_hdmi_phy_pll_config()
432 (40 << HDMI_PLL_LF_SHIFT) | in ls7a2000_hdmi_phy_pll_config()
436 (40 << HDMI_PLL_LF_SHIFT) | in ls7a2000_hdmi_phy_pll_config()
440 (40 << HDMI_PLL_LF_SHIFT) | in ls7a2000_hdmi_phy_pll_config()
444 (40 << HDMI_PLL_LF_SHIFT) | in ls7a2000_hdmi_phy_pll_config()
448 (40 << HDMI_PLL_LF_SHIFT) | 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()
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()
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()
524 DRM_MODE_ENCODER_TMDS, "encoder-%u", pipe); in ls7a2000_output_init()
528 encoder->possible_crtcs = BIT(pipe); in ls7a2000_output_init()
538 drm_info(ddev, "display pipe-%u has HDMI %s\n", pipe, pipe ? "" : "and/or VGA"); 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()