drm/rockchip: dw-mipi-dsi: prepare panel after phy init
authorJohn Keeping <[email protected]>
Fri, 24 Feb 2017 12:54:54 +0000 (12:54 +0000)
committerSean Paul <[email protected]>
Wed, 1 Mar 2017 19:48:53 +0000 (14:48 -0500)
Some panels need to be configured with commands sent over the MIPI link,
which they will do in the prepare hook.  Call this after the PHY has
been initialized so that we are able to send commands to the panel.

Signed-off-by: John Keeping <[email protected]>
Reviewed-by: Chris Zhong <[email protected]>
Reviewed-by: Sean Paul <[email protected]>
Signed-off-by: Sean Paul <[email protected]>
Link: http://patchwork.freedesktop.org/patch/msgid/[email protected]
drivers/gpu/drm/rockchip/dw-mipi-dsi.c

index 0c66e6eaf44aaf6334c301da905812c41898cbab..53515404d0ca24ba7b67faefbc96bfd75ada3737 100644 (file)
@@ -898,12 +898,14 @@ static void dw_mipi_dsi_encoder_enable(struct drm_encoder *encoder)
        dw_mipi_dsi_dphy_timing_config(dsi);
        dw_mipi_dsi_dphy_interface_config(dsi);
        dw_mipi_dsi_clear_err(dsi);
-       if (drm_panel_prepare(dsi->panel))
-               dev_err(dsi->dev, "failed to prepare panel\n");
 
        dw_mipi_dsi_phy_init(dsi);
        dw_mipi_dsi_wait_for_two_frames(mode);
 
+       dw_mipi_dsi_set_mode(dsi, DW_MIPI_DSI_CMD_MODE);
+       if (drm_panel_prepare(dsi->panel))
+               dev_err(dsi->dev, "failed to prepare panel\n");
+
        dw_mipi_dsi_set_mode(dsi, DW_MIPI_DSI_VID_MODE);
        drm_panel_enable(dsi->panel);