diff mbox series

[v4,15/30] drm/i915/display: Use _PICK_EVEN_2RANGES() in DP AUX regs

Message ID 20230915174651.1928176-16-lucas.demarchi@intel.com (mailing list archive)
State New, archived
Headers show
Series Enable Lunar Lake display | expand

Commit Message

Lucas De Marchi Sept. 15, 2023, 5:46 p.m. UTC
XELPDP_DP_AUX_CH_CTL() and XELPDP_DP_AUX_CH_DATA() use 2 ranges. Prefer
using _PICK_EVEN_2RANGES() over PICK().

Signed-off-by: Lucas De Marchi <lucas.demarchi@intel.com>
Reviewed-by: Matt Roper <matthew.d.roper@intel.com>
---
 .../gpu/drm/i915/display/intel_dp_aux_regs.h  | 30 +++++++------------
 1 file changed, 10 insertions(+), 20 deletions(-)
diff mbox series

Patch

diff --git a/drivers/gpu/drm/i915/display/intel_dp_aux_regs.h b/drivers/gpu/drm/i915/display/intel_dp_aux_regs.h
index 4503d94115d7..1e9e018a2a48 100644
--- a/drivers/gpu/drm/i915/display/intel_dp_aux_regs.h
+++ b/drivers/gpu/drm/i915/display/intel_dp_aux_regs.h
@@ -19,18 +19,13 @@ 
 #define _DPB_AUX_CH_CTL			(DISPLAY_MMIO_BASE(dev_priv) + 0x64110)
 #define _XELPDP_USBC1_AUX_CH_CTL	0x16f210
 #define _XELPDP_USBC2_AUX_CH_CTL	0x16f410
-#define _XELPDP_USBC3_AUX_CH_CTL	0x16f610
-#define _XELPDP_USBC4_AUX_CH_CTL	0x16f810
 #define DP_AUX_CH_CTL(aux_ch)		_MMIO_PORT(aux_ch, _DPA_AUX_CH_CTL,	\
 						   _DPB_AUX_CH_CTL)
-#define XELPDP_DP_AUX_CH_CTL(aux_ch)	_MMIO(_PICK(aux_ch, \
-						    _DPA_AUX_CH_CTL, \
-						    _DPB_AUX_CH_CTL, \
-						    0, /* port/aux_ch C is non-existent */ \
-						    _XELPDP_USBC1_AUX_CH_CTL, \
-						    _XELPDP_USBC2_AUX_CH_CTL, \
-						    _XELPDP_USBC3_AUX_CH_CTL, \
-						    _XELPDP_USBC4_AUX_CH_CTL))
+#define XELPDP_DP_AUX_CH_CTL(aux_ch)						\
+		_MMIO(_PICK_EVEN_2RANGES(aux_ch, AUX_CH_USBC1,			\
+					 _DPA_AUX_CH_CTL, _DPB_AUX_CH_CTL,	\
+					 _XELPDP_USBC1_AUX_CH_CTL,		\
+					 _XELPDP_USBC2_AUX_CH_CTL))
 #define   DP_AUX_CH_CTL_SEND_BUSY		REG_BIT(31)
 #define   DP_AUX_CH_CTL_DONE			REG_BIT(30)
 #define   DP_AUX_CH_CTL_INTERRUPT		REG_BIT(29)
@@ -68,17 +63,12 @@ 
 #define _DPB_AUX_CH_DATA1		(DISPLAY_MMIO_BASE(dev_priv) + 0x64114)
 #define _XELPDP_USBC1_AUX_CH_DATA1	0x16f214
 #define _XELPDP_USBC2_AUX_CH_DATA1	0x16f414
-#define _XELPDP_USBC3_AUX_CH_DATA1	0x16f614
-#define _XELPDP_USBC4_AUX_CH_DATA1	0x16f814
 #define DP_AUX_CH_DATA(aux_ch, i)	_MMIO(_PORT(aux_ch, _DPA_AUX_CH_DATA1,	\
 						    _DPB_AUX_CH_DATA1) + (i) * 4) /* 5 registers */
-#define XELPDP_DP_AUX_CH_DATA(aux_ch, i)	_MMIO(_PICK(aux_ch, \
-							    _DPA_AUX_CH_DATA1, \
-							    _DPB_AUX_CH_DATA1, \
-							    0, /* port/aux_ch C is non-existent */ \
-							    _XELPDP_USBC1_AUX_CH_DATA1, \
-							    _XELPDP_USBC2_AUX_CH_DATA1, \
-							    _XELPDP_USBC3_AUX_CH_DATA1, \
-							    _XELPDP_USBC4_AUX_CH_DATA1) + (i) * 4)
+#define XELPDP_DP_AUX_CH_DATA(aux_ch, i)					\
+		_MMIO(_PICK_EVEN_2RANGES(aux_ch, AUX_CH_USBC1,			\
+					 _DPA_AUX_CH_DATA1, _DPB_AUX_CH_DATA1,	\
+					 _XELPDP_USBC1_AUX_CH_DATA1,		\
+					 _XELPDP_USBC2_AUX_CH_DATA1) + (i) * 4) /* 5 registers */
 
 #endif /* __INTEL_DP_AUX_REGS_H__ */