usb: typec: intel_pmc_mux: Check the port status before connect
authorHeikki Krogerus <heikki.krogerus@linux.intel.com>
Mon, 7 Sep 2020 14:24:27 +0000 (17:24 +0300)
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Mon, 7 Sep 2020 15:07:50 +0000 (17:07 +0200)
commit43d596e3227655b40272474a76e1bca878cb56b6
tree00bdc27a4262311338ab562f2549e3212085cb50
parent5df7ef7d32fec1d6d1c34dbec019b461a12ce870
usb: typec: intel_pmc_mux: Check the port status before connect

The PMC microcontroller that we use for configuration, does
not supply any status information back. For port status we
need to talk to another controller on the board called IOM
(I/O manager).

By checking the port status before configuring the muxes, we
can make sure that we do not reconfigure the port after
bootup when the system firmware (for example BIOS) has
already configured it.

Using the status information also to check if DisplayPort
HPD is still asserted when the cable plug is disconnected,
and clearing it if it is.

Signed-off-by: Heikki Krogerus <heikki.krogerus@linux.intel.com>
Reviewed-by: Rajmohan Mani <rajmohan.mani@intel.com>
Reviewed-by: Utkarsh Patel <utkarsh.h.patel@intel.com>
Tested-by: Utkarsh Patel <utkarsh.h.patel@intel.com>
Link: https://lore.kernel.org/r/20200907142428.35838-2-heikki.krogerus@linux.intel.com
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
drivers/usb/typec/mux/intel_pmc_mux.c