drm/i915/dsi: abstract get pclk platform differences
authorJani Nikula <jani.nikula@intel.com>
Fri, 8 Jan 2016 10:45:39 +0000 (12:45 +0200)
committerJani Nikula <jani.nikula@intel.com>
Fri, 8 Jan 2016 11:25:12 +0000 (13:25 +0200)
Hide away the platform differences in intel_dsi_get_pckl() within
intel_dsi_pll.c. No functional changes.

Reviewed-by: Ville Syrjälä <ville.syrjala@linux.intel.com>
Signed-off-by: Jani Nikula <jani.nikula@intel.com>
Link: http://patchwork.freedesktop.org/patch/msgid/1452249940-2605-1-git-send-email-jani.nikula@intel.com
drivers/gpu/drm/i915/intel_dsi.c
drivers/gpu/drm/i915/intel_dsi.h
drivers/gpu/drm/i915/intel_dsi_pll.c

index 4ab168dd36bf9fd72fa0d8f9a2d32e81c9ff0402..328cd58cb5fec9fd89fe24080bcf64f025e7e9ea 100644 (file)
@@ -702,7 +702,7 @@ static bool intel_dsi_get_hw_state(struct intel_encoder *encoder,
 static void intel_dsi_get_config(struct intel_encoder *encoder,
                                 struct intel_crtc_state *pipe_config)
 {
-       u32 pclk = 0;
+       u32 pclk;
        DRM_DEBUG_KMS("\n");
 
        pipe_config->has_dsi_encoder = true;
@@ -713,12 +713,7 @@ static void intel_dsi_get_config(struct intel_encoder *encoder,
         */
        pipe_config->dpll_hw_state.dpll_md = 0;
 
-       if (IS_BROXTON(encoder->base.dev))
-               pclk = bxt_get_dsi_pclk(encoder, pipe_config->pipe_bpp);
-       else if (IS_VALLEYVIEW(encoder->base.dev) ||
-                IS_CHERRYVIEW(encoder->base.dev))
-               pclk = vlv_get_dsi_pclk(encoder, pipe_config->pipe_bpp);
-
+       pclk = intel_dsi_get_pclk(encoder, pipe_config->pipe_bpp);
        if (!pclk)
                return;
 
index 02551ff228c22e32751b2e34803668432e7c6d64..de7be7f3fb42c8167fa4c9b677de4c163750c64e 100644 (file)
@@ -126,8 +126,7 @@ static inline struct intel_dsi *enc_to_intel_dsi(struct drm_encoder *encoder)
 
 extern void intel_enable_dsi_pll(struct intel_encoder *encoder);
 extern void intel_disable_dsi_pll(struct intel_encoder *encoder);
-extern u32 vlv_get_dsi_pclk(struct intel_encoder *encoder, int pipe_bpp);
-extern u32 bxt_get_dsi_pclk(struct intel_encoder *encoder, int pipe_bpp);
+extern u32 intel_dsi_get_pclk(struct intel_encoder *encoder, int pipe_bpp);
 extern void intel_dsi_reset_clocks(struct intel_encoder *encoder,
                                                        enum port port);
 
index fbd2b51810ca0f2223a0129a3beac9bbb1433c61..4c5bb7dd95a2acf375ee4a6ded46156521cb7a3b 100644 (file)
@@ -322,7 +322,7 @@ static void assert_bpp_mismatch(int pixel_format, int pipe_bpp)
             bpp, pipe_bpp);
 }
 
-u32 vlv_get_dsi_pclk(struct intel_encoder *encoder, int pipe_bpp)
+static u32 vlv_dsi_get_pclk(struct intel_encoder *encoder, int pipe_bpp)
 {
        struct drm_i915_private *dev_priv = encoder->base.dev->dev_private;
        struct intel_dsi *intel_dsi = enc_to_intel_dsi(&encoder->base);
@@ -384,7 +384,7 @@ u32 vlv_get_dsi_pclk(struct intel_encoder *encoder, int pipe_bpp)
        return pclk;
 }
 
-u32 bxt_get_dsi_pclk(struct intel_encoder *encoder, int pipe_bpp)
+static u32 bxt_dsi_get_pclk(struct intel_encoder *encoder, int pipe_bpp)
 {
        u32 pclk;
        u32 dsi_clk;
@@ -419,6 +419,14 @@ u32 bxt_get_dsi_pclk(struct intel_encoder *encoder, int pipe_bpp)
        return pclk;
 }
 
+u32 intel_dsi_get_pclk(struct intel_encoder *encoder, int pipe_bpp)
+{
+       if (IS_BROXTON(encoder->base.dev))
+               return bxt_dsi_get_pclk(encoder, pipe_bpp);
+       else
+               return vlv_dsi_get_pclk(encoder, pipe_bpp);
+}
+
 static void vlv_dsi_reset_clocks(struct intel_encoder *encoder, enum port port)
 {
        u32 temp;