intel_dig_port->max_lanes = intel_ddi_max_lanes(intel_dig_port);
intel_dig_port->aux_ch = intel_bios_port_aux_ch(dev_priv, port);
- intel_dig_port->tc_legacy_port = intel_port_is_tc(dev_priv, port) &&
- !port_info->supports_typec_usb &&
- !port_info->supports_tbt;
+ if (intel_port_is_tc(dev_priv, port)) {
+ bool is_legacy = !port_info->supports_typec_usb &&
+ !port_info->supports_tbt;
+
+ intel_tc_port_init(intel_dig_port, is_legacy);
+ }
switch (port) {
case PORT_A:
val = I915_READ(PORT_TX_DFLEXDPPMS);
if (!(val & DP_PHY_MODE_STATUS_COMPLETED(tc_port))) {
- DRM_DEBUG_KMS("DP PHY for TC port %d not ready\n", tc_port);
+ DRM_DEBUG_KMS("Port %s: PHY not ready\n",
+ dig_port->tc_port_name);
WARN_ON(dig_port->tc_legacy_port);
return false;
}
*/
if (dig_port->tc_mode == TC_PORT_DP_ALT &&
!(I915_READ(PORT_TX_DFLEXDPSP) & TC_LIVE_STATE_TC(tc_port))) {
- DRM_DEBUG_KMS("TC PHY %d sudden disconnect.\n", tc_port);
+ DRM_DEBUG_KMS("Port %s: PHY sudden disconnect\n",
+ dig_port->tc_port_name);
icl_tc_phy_disconnect(dig_port);
return false;
}
I915_WRITE(PORT_TX_DFLEXDPCSSS, val);
}
- DRM_DEBUG_KMS("Port %c TC type %s disconnected\n",
- port_name(dig_port->base.port),
+ DRM_DEBUG_KMS("Port %s: mode %s disconnected\n",
+ dig_port->tc_port_name,
tc_port_mode_name(dig_port->tc_mode));
dig_port->tc_mode = TC_PORT_TBT_ALT;
struct intel_digital_port *intel_dig_port,
bool is_legacy, bool is_typec, bool is_tbt)
{
- enum port port = intel_dig_port->base.port;
enum tc_port_mode old_mode = intel_dig_port->tc_mode;
WARN_ON(is_legacy + is_typec + is_tbt != 1);
return;
if (old_mode != intel_dig_port->tc_mode)
- DRM_DEBUG_KMS("Port %c has TC type %s\n", port_name(port),
+ DRM_DEBUG_KMS("Port %s: port has mode %s\n",
+ intel_dig_port->tc_port_name,
tc_port_mode_name(intel_dig_port->tc_mode));
}
*/
if (!dig_port->tc_legacy_port &&
I915_READ(SDEISR) & SDE_TC_HOTPLUG_ICP(tc_port)) {
- DRM_ERROR("VBT incorrectly claims port %c is not TypeC legacy\n",
- port_name(port));
+ DRM_ERROR("Port %s: VBT incorrectly claims port is not TypeC legacy\n",
+ dig_port->tc_port_name);
dig_port->tc_legacy_port = true;
}
is_legacy = dig_port->tc_legacy_port;
return true;
}
+void intel_tc_port_init(struct intel_digital_port *dig_port, bool is_legacy)
+{
+ struct drm_i915_private *i915 = to_i915(dig_port->base.base.dev);
+ enum port port = dig_port->base.port;
+ enum tc_port tc_port = intel_port_to_tc(i915, port);
+
+ if (WARN_ON(tc_port == PORT_TC_NONE))
+ return;
+
+ snprintf(dig_port->tc_port_name, sizeof(dig_port->tc_port_name),
+ "%c/TC#%d", port_name(port), tc_port + 1);
+
+ dig_port->tc_legacy_port = is_legacy;
+}