drm/stm: dsi: add power on/off phy ops
authorYannick Fertré <yannick.fertre@st.com>
Mon, 27 May 2019 10:21:39 +0000 (12:21 +0200)
committerAndrzej Hajda <a.hajda@samsung.com>
Wed, 12 Jun 2019 07:09:18 +0000 (09:09 +0200)
These new physical operations are helpful to power_on/off the dsi
wrapper. If the dsi wrapper is powered in video mode, the display
controller (ltdc) register access will hang when DSI fifos are full.

Signed-off-by: Yannick Fertré <yannick.fertre@st.com>
Acked-by: Philippe Cornu <philippe.cornu@st.com>
Tested-by: Philippe Cornu <philippe.cornu@st.com>
Reviewed-by: Andrzej Hajda <a.hajda@samsung.com>
Signed-off-by: Andrzej Hajda <a.hajda@samsung.com>
Link: https://patchwork.freedesktop.org/patch/msgid/1558952499-15418-3-git-send-email-yannick.fertre@st.com
drivers/gpu/drm/stm/dw_mipi_dsi-stm.c

index 01db020c8953f452fa85b701f73f8e78871e498f..0ab32fee6c1ba0f9a225b5c64deccf41721597b0 100644 (file)
@@ -210,10 +210,27 @@ static int dw_mipi_dsi_phy_init(void *priv_data)
        if (ret)
                DRM_DEBUG_DRIVER("!TIMEOUT! waiting PLL, let's continue\n");
 
+       return 0;
+}
+
+static void dw_mipi_dsi_phy_power_on(void *priv_data)
+{
+       struct dw_mipi_dsi_stm *dsi = priv_data;
+
+       DRM_DEBUG_DRIVER("\n");
+
        /* Enable the DSI wrapper */
        dsi_set(dsi, DSI_WCR, WCR_DSIEN);
+}
 
-       return 0;
+static void dw_mipi_dsi_phy_power_off(void *priv_data)
+{
+       struct dw_mipi_dsi_stm *dsi = priv_data;
+
+       DRM_DEBUG_DRIVER("\n");
+
+       /* Disable the DSI wrapper */
+       dsi_clear(dsi, DSI_WCR, WCR_DSIEN);
 }
 
 static int
@@ -287,6 +304,8 @@ dw_mipi_dsi_get_lane_mbps(void *priv_data, const struct drm_display_mode *mode,
 
 static const struct dw_mipi_dsi_phy_ops dw_mipi_dsi_stm_phy_ops = {
        .init = dw_mipi_dsi_phy_init,
+       .power_on = dw_mipi_dsi_phy_power_on,
+       .power_off = dw_mipi_dsi_phy_power_off,
        .get_lane_mbps = dw_mipi_dsi_get_lane_mbps,
 };