usb: typec: tcpci_maxim: Fix vbus stuck on upon diconnecting sink
authorBadhri Jagan Sridharan <badhri@google.com>
Thu, 29 Oct 2020 06:31:34 +0000 (23:31 -0700)
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Wed, 18 Nov 2020 11:57:49 +0000 (12:57 +0100)
commit2fc58b36e919902ae2f17531783d8debadcc2a27
tree55eac4b170f359410e97d84522b773b30832badd
parenta57d253fc0582d223464705a5103cfb1930a06cd
usb: typec: tcpci_maxim: Fix vbus stuck on upon diconnecting sink

Occasionally, POWER_STATUS.sourcing_vbus takes a while to clear after
writing to  MAX_BUCK_BOOST_OP register. This causes vbus to turn back
on while disconnecting the sink. Overcome this issue by writing into
MAX_BUCK_BOOST_OP during frs while sourcing vbu, instead of always
into the register whenever POWER_STATUS.sourcing_vbus is set.

Signed-off-by: Badhri Jagan Sridharan <badhri@google.com>
Reviewed-by: Heikki Krogerus <heikki.krogerus@linux.intel.com>
Link: https://lore.kernel.org/r/20201029063138.1429760-7-badhri@google.com
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
drivers/usb/typec/tcpm/tcpci_maxim.c