drm/i915/dsi: abstract intel_dsi_tlpx_ns()
authorJani Nikula <jani.nikula@intel.com>
Mon, 15 Oct 2018 14:27:52 +0000 (17:27 +0300)
committerJani Nikula <jani.nikula@intel.com>
Mon, 22 Oct 2018 06:31:19 +0000 (09:31 +0300)
Will be needed in the future. No functional changes.

Cc: Madhav Chauhan <madhav.chauhan@intel.com>
Cc: Ville Syrjala <ville.syrjala@linux.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/2cb427e5bc2ea88e4226bfcf162b3a6f307e32e1.1539613303.git.jani.nikula@intel.com
drivers/gpu/drm/i915/intel_dsi.c
drivers/gpu/drm/i915/intel_dsi.h
drivers/gpu/drm/i915/intel_dsi_vbt.c

index 4daa1da94047789051a7a2183d4baee18399b76f..a32cc1f4b38435cbc990b4558d5263024d612662 100644 (file)
@@ -15,3 +15,16 @@ int intel_dsi_bitrate(const struct intel_dsi *intel_dsi)
 
        return intel_dsi->pclk * bpp / intel_dsi->lane_count;
 }
+
+int intel_dsi_tlpx_ns(const struct intel_dsi *intel_dsi)
+{
+       switch (intel_dsi->escape_clk_div) {
+       default:
+       case 0:
+               return 50;
+       case 1:
+               return 100;
+       case 2:
+               return 200;
+       }
+}
index 68f14d8f1e1863a14d02fbd983e39ec0eb54435d..0d911a4adfaafdff4ed1e7f57c13aca8144880ae 100644 (file)
@@ -131,6 +131,7 @@ static inline struct intel_dsi *enc_to_intel_dsi(struct drm_encoder *encoder)
 
 /* intel_dsi.c */
 int intel_dsi_bitrate(const struct intel_dsi *intel_dsi);
+int intel_dsi_tlpx_ns(const struct intel_dsi *intel_dsi);
 
 /* vlv_dsi.c */
 void vlv_dsi_wait_for_fifo_empty(struct intel_dsi *intel_dsi, enum port port);
index fdeba8386d531ca2631f68df9d354d82458cd724..b0d8548f0462f228ba95e51197565be5bfc563c5 100644 (file)
@@ -512,21 +512,7 @@ static void vlv_dphy_param_init(struct intel_dsi *intel_dsi)
        u32 lp_to_hs_switch, hs_to_lp_switch;
        u32 mul;
 
-       switch (intel_dsi->escape_clk_div) {
-       case 0:
-               tlpx_ns = 50;
-               break;
-       case 1:
-               tlpx_ns = 100;
-               break;
-
-       case 2:
-               tlpx_ns = 200;
-               break;
-       default:
-               tlpx_ns = 50;
-               break;
-       }
+       tlpx_ns = intel_dsi_tlpx_ns(intel_dsi);
 
        switch (intel_dsi->lane_count) {
        case 1: