]> git.baikalelectronics.ru Git - kernel.git/commit
usb: typec: tcpm: Allow slow charging loops to comply to pSnkStby
authorBadhri Jagan Sridharan <badhri@google.com>
Wed, 14 Apr 2021 02:39:59 +0000 (19:39 -0700)
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Wed, 14 Apr 2021 14:27:29 +0000 (16:27 +0200)
commit291c01e6e60c27069579dc16da6fb352a85252ef
tree262f8cdbd7c3b5bffa56a29ef2d8bd526b7ed162
parent6cb98bad8e586fdd26421e487b8f85fa92fc2ee8
usb: typec: tcpm: Allow slow charging loops to comply to pSnkStby

When a PD charger advertising Rp-3.0 is connected to a sink port, the
sink port current limit would 3A, during SNK_DISCOVERY, till power
negotiation starts. Once the negotiation starts the power limit needs
to drop down to pSnkStby(500mA @ 5V) and to negotiated current limit
once the explicit contract is in place. Not all charging loops can ramp
up to 3A and drop down to 500mA within tSnkStdby which is 15ms. The port
partner might hard reset if tSnkStdby is not met.

To solve this problem, this patch introduces slow-charger-loop which
when set makes the port request PD_P_SNK_STDBY_MW upon entering
SNK_DISCOVERY(instead of 3A or the 1.5A during SNK_DISCOVERY) and the
actual currrent limit after RX of PD_CTRL_PSRDY for PD link or during
SNK_READY for non-pd link.

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