drm/i915: Sanitize the TypeC connect/detect sequences
authorImre Deak <imre.deak@intel.com>
Fri, 28 Jun 2019 14:36:24 +0000 (17:36 +0300)
committerImre Deak <imre.deak@intel.com>
Mon, 1 Jul 2019 11:50:23 +0000 (14:50 +0300)
commit1cd5ef6ee23cdde8afd53dd72b9f2f789c22f58c
tree0087e71205e9d2458790d30fc83bb0b7adb71e7f
parent424f109f5c5d9c82a16d0c8dc033ff3d513c6e0f
drm/i915: Sanitize the TypeC connect/detect sequences

Make the order during detection more consistent: first reset the TypeC
port mode if needed (adding new helpers for this), then detect any
connected sink.

To check if a port mode reset is needed determine first the target port
mode based on the live status if a sink is already connected or the
PHY status complete flag otherwise.

Add a WARN in legacy mode if unexpectedly we can't set the unsafe mode
or if the FIA doesn't provide the 4 lanes required.

Cc: José Roberto de Souza <jose.souza@intel.com>
Cc: Rodrigo Vivi <rodrigo.vivi@intel.com>
Cc: Paulo Zanoni <paulo.r.zanoni@intel.com>
Cc: Ville Syrjälä <ville.syrjala@linux.intel.com>
Signed-off-by: Imre Deak <imre.deak@intel.com>
Reviewed-by: Ville Syrjälä <ville.syrjala@linux.intel.com>
Reviewed-by: José Roberto de Souza <jose.souza@intel.com>
Link: https://patchwork.freedesktop.org/patch/msgid/20190628143635.22066-13-imre.deak@intel.com
drivers/gpu/drm/i915/display/intel_tc.c