void hdmi_mode_set(state_struct *state, int vic, int format, int color_depth, int temp)
{
- GENERAL_Read_Register_response regresp;
int ret;
/* B/W Balance Type: 0 no data, 1 IT601, 2 ITU709 */
ret = CDN_API_HDMITX_SetVic_blocking(state, vic, color_depth, format);
pr_info("CDN_API_HDMITX_SetVic_blocking ret = %d\n", ret);
- /* adjust the vsync/hsync polarity */
- CDN_API_General_Read_Register_blocking(
- state, ADDR_SOURCE_VIF + (HSYNC2VSYNC_POL_CTRL << 2), ®resp);
- pr_info("Initial HSYNC2VSYNC_POL_CTRL: 0x%x\n", regresp.val);
- if ((regresp.val & 0x6) != 0) {
- __raw_writel(0x4, state->mem.ss_base);
- }
msleep(50);
}
return 0;
}
-static void imx_hdp_plmux_config(struct imx_hdp *hdp, struct drm_display_mode *mode)
+static void imx_hdp_state_init(struct imx_hdp *hdp)
{
+ state_struct *state = &hdp->state;
+
+ memset(state, 0, sizeof(state_struct));
+ mutex_init(&state->mutex);
+
+ state->mem.regs_base = hdp->regs_base;
+ state->mem.ss_base = hdp->ss_base;
+ state->rw = hdp->rw;
+}
+
+static void imx8qm_pixel_link_mux(state_struct *state, struct drm_display_mode *mode)
+{
+ struct imx_hdp *hdp = state_to_imx_hdp(state);
u32 val;
val = 4; /* RGB */
writel(val, hdp->ss_base + CSR_PIXEL_LINK_MUX_CTL);
}
-static void imx_hdp_state_init(struct imx_hdp *hdp)
-{
- state_struct *state = &hdp->state;
-
- memset(state, 0, sizeof(state_struct));
- mutex_init(&state->mutex);
-
- state->mem.regs_base = hdp->regs_base;
- state->mem.ss_base = hdp->ss_base;
- state->rw = hdp->rw;
-}
-
int imx8qm_pixel_link_init(state_struct *state)
{
struct imx_hdp *hdp = state_to_imx_hdp(state);
imx_hdp_call(hdp, pixel_clock_enable, &hdp->clks);
- imx_hdp_plmux_config(hdp, mode);
+ /* Config pixel link mux */
+ imx_hdp_call(hdp, pixel_link_mux, &hdp->state, mode);
+ /* mode set */
ret = imx_hdp_call(hdp, phy_init, &hdp->state, dp_vic, 1, 8);
if (ret < 0) {
DRM_ERROR("Failed to initialise HDP PHY\n");
.phy_reset = imx8qm_phy_reset,
.pixel_link_init = imx8qm_pixel_link_init,
.pixel_link_deinit = imx8qm_pixel_link_deinit,
+ .pixel_link_mux = imx8qm_pixel_link_mux,
.clock_init = imx8qm_clock_init,
.ipg_clock_set_rate = imx8qm_ipg_clock_set_rate,
.phy_reset = imx8qm_phy_reset,
.pixel_link_init = imx8qm_pixel_link_init,
.pixel_link_deinit = imx8qm_pixel_link_deinit,
+ .pixel_link_mux = imx8qm_pixel_link_mux,
.clock_init = imx8qm_clock_init,
.set_clock_root = imx8qm_hdmi_set_clock_root,