drm/bridge/synopsys: dsi: add power on/off optional phy ops
authorYannick Fertré <yannick.fertre@st.com>
Mon, 27 May 2019 10:21:38 +0000 (12:21 +0200)
committerAndrzej Hajda <a.hajda@samsung.com>
Wed, 12 Jun 2019 07:09:18 +0000 (09:09 +0200)
Add power on & off optional physical operation functions, helpful to
program specific registers of the DSI physical part.

Signed-off-by: Yannick Fertré <yannick.fertre@st.com>
Reviewed-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-2-git-send-email-yannick.fertre@st.com
drivers/gpu/drm/bridge/synopsys/dw-mipi-dsi.c
include/drm/bridge/dw_mipi_dsi.h

index a79c87bd0147a52a08085f2ce51fbf8194c52fc1..281c58bab1a1b718beb4c9f23f971730eea950bb 100644 (file)
@@ -778,6 +778,10 @@ static void dw_mipi_dsi_clear_err(struct dw_mipi_dsi *dsi)
 static void dw_mipi_dsi_bridge_post_disable(struct drm_bridge *bridge)
 {
        struct dw_mipi_dsi *dsi = bridge_to_dsi(bridge);
+       const struct dw_mipi_dsi_phy_ops *phy_ops = dsi->plat_data->phy_ops;
+
+       if (phy_ops->power_off)
+               phy_ops->power_off(dsi->plat_data->priv_data);
 
        /*
         * Switch to command mode before panel-bridge post_disable &
@@ -877,11 +881,15 @@ static void dw_mipi_dsi_bridge_mode_set(struct drm_bridge *bridge,
 static void dw_mipi_dsi_bridge_enable(struct drm_bridge *bridge)
 {
        struct dw_mipi_dsi *dsi = bridge_to_dsi(bridge);
+       const struct dw_mipi_dsi_phy_ops *phy_ops = dsi->plat_data->phy_ops;
 
        /* Switch to video mode for panel-bridge enable & panel enable */
        dw_mipi_dsi_set_mode(dsi, MIPI_DSI_MODE_VIDEO);
        if (dsi->slave)
                dw_mipi_dsi_set_mode(dsi->slave, MIPI_DSI_MODE_VIDEO);
+
+       if (phy_ops->power_on)
+               phy_ops->power_on(dsi->plat_data->priv_data);
 }
 
 static enum drm_mode_status
index 92cf9d1e1655f689fbf314c2d653ee84b7ce3466..be8cdc2bf67de5a9c834417064c7a8a8c917b503 100644 (file)
@@ -22,6 +22,8 @@ struct platform_device;
 
 struct dw_mipi_dsi_phy_ops {
        int (*init)(void *priv_data);
+       void (*power_on)(void *priv_data);
+       void (*power_off)(void *priv_data);
        int (*get_lane_mbps)(void *priv_data,
                             const struct drm_display_mode *mode,
                             unsigned long mode_flags, u32 lanes, u32 format,