Skip to content

Commit 12701ce

Browse files
Badhri Jagan Sridharangregkh
authored andcommitted
usb: typec: tcpm: Fix SINK_DISCOVERY current limit for Rp-default
This is a regression introduced by 1373fef ("usb: typec: tcpm: Allow slow charging loops to comply to pSnkStby") When Source advertises Rp-default, tcpm would request 500mA when in SINK_DISCOVERY, Type-C spec advises the sink to follow BC1.2 current limits when Rp-default is advertised. [12750.503381] Requesting mux state 1, usb-role 2, orientation 1 [12750.503837] state change SNK_ATTACHED -> SNK_STARTUP [rev3 NONE_AMS] [12751.003891] state change SNK_STARTUP -> SNK_DISCOVERY [12751.003900] Setting voltage/current limit 5000 mV 500 mA This patch restores the behavior where the tcpm would request 0mA when Rp-default is advertised by the source. [   73.174252] Requesting mux state 1, usb-role 2, orientation 1 [   73.174749] state change SNK_ATTACHED -> SNK_STARTUP [rev3 NONE_AMS] [   73.674800] state change SNK_STARTUP -> SNK_DISCOVERY [   73.674808] Setting voltage/current limit 5000 mV 0 mA During SNK_DISCOVERY, Cap the current limit to PD_P_SNK_STDBY_MW / 5 only for slow_charger_loop case. Fixes: 1373fef ("usb: typec: tcpm: Allow slow charging loops to comply to pSnkStby") Reviewed-by: Guenter Roeck <[email protected]> Acked-by: Heikki Krogerus <[email protected]> Signed-off-by: Badhri Jagan Sridharan <[email protected]> Link: https://lore.kernel.org/r/[email protected] Signed-off-by: Greg Kroah-Hartman <[email protected]>
1 parent 3c12878 commit 12701ce

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

drivers/usb/typec/tcpm/tcpm.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4085,7 +4085,7 @@ static void run_state_machine(struct tcpm_port *port)
40854085
if (port->vbus_present) {
40864086
u32 current_lim = tcpm_get_current_limit(port);
40874087

4088-
if (port->slow_charger_loop || (current_lim > PD_P_SNK_STDBY_MW / 5))
4088+
if (port->slow_charger_loop && (current_lim > PD_P_SNK_STDBY_MW / 5))
40894089
current_lim = PD_P_SNK_STDBY_MW / 5;
40904090
tcpm_set_current_limit(port, current_lim, 5000);
40914091
tcpm_set_charge(port, true);

0 commit comments

Comments
 (0)