drm/i915/icl: Use helper functions to classify the ports
Use intel_port_is_tc and intel_port_is_combophy functions to replace the individual port checks from port C to F and port A to B respectively. 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: Rodrigo Vivi <rodrigo.vivi@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-5-mahesh1.kumar@intel.com
This commit is contained in:

committed by
Rodrigo Vivi

parent
cb6caf7e39
commit
8ea59e6739
@@ -9269,24 +9269,17 @@ static void icelake_get_ddi_pll(struct drm_i915_private *dev_priv,
|
||||
u32 temp;
|
||||
|
||||
/* TODO: TBT pll not implemented. */
|
||||
switch (port) {
|
||||
case PORT_A:
|
||||
case PORT_B:
|
||||
if (intel_port_is_combophy(dev_priv, port)) {
|
||||
temp = I915_READ(DPCLKA_CFGCR0_ICL) &
|
||||
DPCLKA_CFGCR0_DDI_CLK_SEL_MASK(port);
|
||||
id = temp >> DPCLKA_CFGCR0_DDI_CLK_SEL_SHIFT(port);
|
||||
|
||||
if (WARN_ON(id != DPLL_ID_ICL_DPLL0 && id != DPLL_ID_ICL_DPLL1))
|
||||
return;
|
||||
break;
|
||||
case PORT_C:
|
||||
case PORT_D:
|
||||
case PORT_E:
|
||||
case PORT_F:
|
||||
} else if (intel_port_is_tc(dev_priv, port)) {
|
||||
id = icl_port_to_mg_pll_id(port);
|
||||
break;
|
||||
default:
|
||||
MISSING_CASE(port);
|
||||
} else {
|
||||
WARN(1, "Invalid port %x\n", port);
|
||||
return;
|
||||
}
|
||||
|
||||
|
Reference in New Issue
Block a user