drm/i915/icl: Refactor get_ddi_pll using helper func
authorVandita Kulkarni <vandita.kulkarni@intel.com>
Wed, 3 Oct 2018 07:21:58 +0000 (12:51 +0530)
committerRodrigo Vivi <rodrigo.vivi@intel.com>
Tue, 16 Oct 2018 16:00:56 +0000 (09:00 -0700)
Use the existing port-to-id helper function, to refactor
hence making it scalable.

Signed-off-by: Vandita Kulkarni <vandita.kulkarni@intel.com>
Signed-off-by: Mahesh Kumar <mahesh1.kumar@intel.com>
Cc: Lucas De Marchi <lucas.demarchi@intel.com>
Cc: Madhav Chauhan <madhav.chauhan@intel.com>
Reviewed-by: Lucas De Marchi <lucas.demarchi@intel.com>
Signed-off-by: Rodrigo Vivi <rodrigo.vivi@intel.com>
Link: https://patchwork.freedesktop.org/patch/msgid/20181003072203.12848-4-mahesh1.kumar@intel.com
drivers/gpu/drm/i915/intel_display.c
drivers/gpu/drm/i915/intel_dpll_mgr.c
drivers/gpu/drm/i915/intel_dpll_mgr.h

index 9f41645a73ba777459f0f4ce6e5ee5d35d77f36c..93fb961030ae63e9e474f4972f8c1f60a55cc7f0 100644 (file)
@@ -9280,16 +9280,10 @@ static void icelake_get_ddi_pll(struct drm_i915_private *dev_priv,
                        return;
                break;
        case PORT_C:
-               id = DPLL_ID_ICL_MGPLL1;
-               break;
        case PORT_D:
-               id = DPLL_ID_ICL_MGPLL2;
-               break;
        case PORT_E:
-               id = DPLL_ID_ICL_MGPLL3;
-               break;
        case PORT_F:
-               id = DPLL_ID_ICL_MGPLL4;
+               id = icl_port_to_mg_pll_id(port);
                break;
        default:
                MISSING_CASE(port);
index 874646357ad1b668c45021c3610a2ea4838ee759..e96383a74c9aab734ddd61f33efa57cd1130316d 100644 (file)
@@ -2621,7 +2621,7 @@ static enum port icl_mg_pll_id_to_port(enum intel_dpll_id id)
        return id - DPLL_ID_ICL_MGPLL1 + PORT_C;
 }
 
-static enum intel_dpll_id icl_port_to_mg_pll_id(enum port port)
+enum intel_dpll_id icl_port_to_mg_pll_id(enum port port)
 {
        return port - PORT_C + DPLL_ID_ICL_MGPLL1;
 }
index 9c033236f2bab1bb99e07e4fc67871b6e9d71685..58d3fba06076073694e3326d62cbd5719a42c928 100644 (file)
@@ -345,5 +345,6 @@ void intel_dpll_dump_hw_state(struct drm_i915_private *dev_priv,
 int icl_calc_dp_combo_pll_link(struct drm_i915_private *dev_priv,
                               uint32_t pll_id);
 int cnl_hdmi_pll_ref_clock(struct drm_i915_private *dev_priv);
+enum intel_dpll_id icl_port_to_mg_pll_id(enum port port);
 
 #endif /* _INTEL_DPLL_MGR_H_ */