drm/i915/icl: Use the same pll functions for dsi
authorVandita Kulkarni <vandita.kulkarni@intel.com>
Thu, 29 Nov 2018 14:12:20 +0000 (16:12 +0200)
committerJani Nikula <jani.nikula@intel.com>
Mon, 3 Dec 2018 13:53:58 +0000 (15:53 +0200)
The same pll manager functions can be used to enable dpll for
mipi. Hence enabling the IO power and esc clock as part of pre pll
enable call.

v2 by Jani:
- fix function parameter indent (Madhav)

Signed-off-by: Vandita Kulkarni <vandita.kulkarni@intel.com>
Reviewed-by: Madhav Chauhan <madhav.chauhan@intel.com>
Signed-off-by: Jani Nikula <jani.nikula@intel.com>
Link: https://patchwork.freedesktop.org/patch/msgid/07db5b1ce59c00295fad8a8e81908d59d8d76915.1543500286.git.jani.nikula@intel.com
drivers/gpu/drm/i915/icl_dsi.c

index a40083a..9d6cbe3 100644 (file)
@@ -800,17 +800,22 @@ static void gen11_dsi_powerup_panel(struct intel_encoder *encoder)
        wait_for_cmds_dispatched_to_panel(encoder);
 }
 
-static void gen11_dsi_pre_enable(struct intel_encoder *encoder,
-                                const struct intel_crtc_state *pipe_config,
-                                const struct drm_connector_state *conn_state)
+static void gen11_dsi_pre_pll_enable(struct intel_encoder *encoder,
+                                    const struct intel_crtc_state *pipe_config,
+                                    const struct drm_connector_state *conn_state)
 {
-       struct intel_dsi *intel_dsi = enc_to_intel_dsi(&encoder->base);
-
        /* step2: enable IO power */
        gen11_dsi_enable_io_power(encoder);
 
        /* step3: enable DSI PLL */
        gen11_dsi_program_esc_clk_div(encoder);
+}
+
+static void gen11_dsi_pre_enable(struct intel_encoder *encoder,
+                                const struct intel_crtc_state *pipe_config,
+                                const struct drm_connector_state *conn_state)
+{
+       struct intel_dsi *intel_dsi = enc_to_intel_dsi(&encoder->base);
 
        /* step4: enable DSI port and DPHY */
        gen11_dsi_enable_port_and_phy(encoder, pipe_config);
@@ -1028,6 +1033,7 @@ void icl_dsi_init(struct drm_i915_private *dev_priv)
        drm_encoder_init(dev, &encoder->base, &gen11_dsi_encoder_funcs,
                         DRM_MODE_ENCODER_DSI, "DSI %c", port_name(port));
 
+       encoder->pre_pll_enable = gen11_dsi_pre_pll_enable;
        encoder->pre_enable = gen11_dsi_pre_enable;
        encoder->disable = gen11_dsi_disable;
        encoder->port = port;