usb: typec: tcpm: Relax disconnect threshold during power negotiation
authorKyle Tso <kyletso@google.com>
Wed, 16 Jun 2021 09:01:02 +0000 (17:01 +0800)
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Thu, 17 Jun 2021 13:39:14 +0000 (15:39 +0200)
commit2b537cf877eae6d2f2f102052290676e40b74a1d
tree154256d07441268be75a93d769a8633f854cc38f
parentfed09e0bf9f0622a54f3963f959d914fa817f8a6
usb: typec: tcpm: Relax disconnect threshold during power negotiation

If the voltage is being decreased in power negotiation, the Source will
set the power supply to operate at the new voltage level before sending
PS_RDY. Relax the threshold before sending Request Message so that it
will not race with Source which begins to adjust the voltage right after
it sends Accept Message (PPS) or tSrcTransition (25~35ms) after it sends
Accept Message (non-PPS).

The real threshold will be set after Sink receives PS_RDY Message.

Fixes: f321a02caebd ("usb: typec: tcpm: Implement enabling Auto Discharge disconnect support")
Cc: stable <stable@vger.kernel.org>
Cc: Badhri Jagan Sridharan <badhri@google.com>
Reviewed-by: Badhri Jagan Sridharan <badhri@google.com>
Acked-by: Heikki Krogerus <heikki.krogerus@linux.intel.com>
Signed-off-by: Kyle Tso <kyletso@google.com>
Link: https://lore.kernel.org/r/20210616090102.1897674-1-kyletso@google.com
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
drivers/usb/typec/tcpm/tcpm.c