tc_port
#define TC_LIVE_STATE_TBT(tc_port) (1 << ((tc_port) * 8 + 6))
#define TC_LIVE_STATE_TC(tc_port) (1 << ((tc_port) * 8 + 5))
#define DP_LANE_ASSIGNMENT_SHIFT(tc_port) ((tc_port) * 8)
#define DP_LANE_ASSIGNMENT_MASK(tc_port) (0xf << ((tc_port) * 8))
#define DP_LANE_ASSIGNMENT(tc_port, x) ((x) << ((tc_port) * 8))
#define DP_PHY_MODE_STATUS_COMPLETED(tc_port) (1 << (tc_port))
#define DP_PHY_MODE_STATUS_NOT_SAFE(tc_port) (1 << (tc_port))
#define MG_MISC_SUS0(tc_port) \
_MMIO(_PORT(tc_port, MG_MISC_SUS0_PORT1, MG_MISC_SUS0_PORT2))
#define DFLEXDPMLE1_DPMLETC_MASK(tc_port) (0xf << (4 * (tc_port)))
#define DFLEXDPMLE1_DPMLETC_ML0(tc_port) (1 << (4 * (tc_port)))
#define DFLEXDPMLE1_DPMLETC_ML1_0(tc_port) (3 << (4 * (tc_port)))
#define DFLEXDPMLE1_DPMLETC_ML3(tc_port) (8 << (4 * (tc_port)))
#define DFLEXDPMLE1_DPMLETC_ML3_2(tc_port) (12 << (4 * (tc_port)))
#define DFLEXDPMLE1_DPMLETC_ML3_0(tc_port) (15 << (4 * (tc_port)))
#define GEN11_TC_HOTPLUG(tc_port) (1 << ((tc_port) + 16))
#define GEN11_TBT_HOTPLUG(tc_port) (1 << (tc_port))
#define GEN11_HOTPLUG_CTL_ENABLE(tc_port) (8 << (tc_port) * 4)
#define GEN11_HOTPLUG_CTL_LONG_DETECT(tc_port) (2 << (tc_port) * 4)
#define GEN11_HOTPLUG_CTL_SHORT_DETECT(tc_port) (1 << (tc_port) * 4)
#define GEN11_HOTPLUG_CTL_NO_DETECT(tc_port) (0 << (tc_port) * 4)
#define SDE_TC_HOTPLUG_ICP(tc_port) (1 << ((tc_port) + 24))
#define ICP_TC_HPD_ENABLE(tc_port) (8 << (tc_port) * 4)
#define ICP_TC_HPD_LONG_DETECT(tc_port) (2 << (tc_port) * 4)
#define ICP_TC_HPD_SHORT_DETECT(tc_port) (1 << (tc_port) * 4)
#define ICL_DPCLKA_CFGCR0_TC_CLK_OFF(tc_port) (1 << ((tc_port) == PORT_TC4 ? \
21 : (tc_port) + 12))
enum tc_port tc_port = intel_port_to_tc(dev_priv, port);
return ICL_DPCLKA_CFGCR0_TC_CLK_OFF(tc_port);
enum tc_port intel_port_to_tc(struct drm_i915_private *dev_priv, enum port port)
enum tc_port tc_port = intel_port_to_tc(dev_priv, dig_port->base.port);
if (tc_port == PORT_TC_NONE || dig_port->tc_type != TC_PORT_TYPEC)
DP_LANE_ASSIGNMENT_MASK(tc_port)) >>
DP_LANE_ASSIGNMENT_SHIFT(tc_port);
enum tc_port tc_port = intel_port_to_tc(dev_priv, port);
if (tc_port == PORT_TC_NONE || intel_dig_port->tc_type == TC_PORT_TBT)
DP_LANE_ASSIGNMENT_MASK(tc_port)) >>
DP_LANE_ASSIGNMENT_SHIFT(tc_port);
enum tc_port tc_port = intel_port_to_tc(dev_priv, port);
if (tc_port == PORT_TC_NONE)
val = I915_READ(MG_MISC_SUS0(tc_port));
I915_WRITE(MG_MISC_SUS0(tc_port), val);
enum tc_port tc_port = intel_port_to_tc(dev_priv, port);
if (tc_port == PORT_TC_NONE)
val = I915_READ(MG_MISC_SUS0(tc_port));
I915_WRITE(MG_MISC_SUS0(tc_port), val);
enum tc_port tc_port = intel_port_to_tc(dev_priv, dig_port->base.port);
if (!(val & DP_PHY_MODE_STATUS_COMPLETED(tc_port))) {
DRM_DEBUG_KMS("DP PHY for TC port %d not ready\n", tc_port);
if (!(val & DP_PHY_MODE_STATUS_NOT_SAFE(tc_port))) {
val |= DP_PHY_MODE_STATUS_NOT_SAFE(tc_port);
!(I915_READ(PORT_TX_DFLEXDPSP) & TC_LIVE_STATE_TC(tc_port))) {
DRM_DEBUG_KMS("TC PHY %d sudden disconnect.\n", tc_port);
val &= ~DP_PHY_MODE_STATUS_NOT_SAFE(tc_port);
enum tc_port tc_port = intel_port_to_tc(dev_priv, dig_port->base.port);
if (val & DP_PHY_MODE_STATUS_NOT_SAFE(tc_port)) {
val &= ~DP_PHY_MODE_STATUS_NOT_SAFE(tc_port);
enum tc_port tc_port = intel_port_to_tc(dev_priv, port);
is_legacy = I915_READ(SDEISR) & SDE_TC_HOTPLUG_ICP(tc_port);
is_typec = dpsp & TC_LIVE_STATE_TC(tc_port);
is_tbt = dpsp & TC_LIVE_STATE_TBT(tc_port);
enum tc_port intel_port_to_tc(struct drm_i915_private *dev_priv,