mirror of
https://github.com/BobTheBlinker/android_kernel_motorola_sm6375.git
synced 2026-10-29 11:11:45 -04:00
usb: typec: tcpm: Ignore CC and vbus changes in PORT_RESET change
commit 901789745a053286e0ced37960d44fa60267b940 upstream. After PORT_RESET, the port is set to the appropriate default_state. Ignore processing CC changes here as this could cause the port to be switched into sink states by default. echo source > /sys/class/typec/port0/port_type Before: [ 154.528547] pending state change PORT_RESET -> PORT_RESET_WAIT_OFF @ 100 ms [ 154.528560] CC1: 0 -> 0, CC2: 3 -> 0 [state PORT_RESET, polarity 0, disconnected] [ 154.528564] state change PORT_RESET -> SNK_UNATTACHED After: [ 151.068814] pending state change PORT_RESET -> PORT_RESET_WAIT_OFF @ 100 ms [rev3 NONE_AMS] [ 151.072440] CC1: 3 -> 0, CC2: 0 -> 0 [state PORT_RESET, polarity 0, disconnected] [ 151.172117] state change PORT_RESET -> PORT_RESET_WAIT_OFF [delayed 100 ms] [ 151.172136] pending state change PORT_RESET_WAIT_OFF -> SRC_UNATTACHED @ 870 ms [rev3 NONE_AMS] [ 152.060106] state change PORT_RESET_WAIT_OFF -> SRC_UNATTACHED [delayed 870 ms] [ 152.060118] Start toggling Signed-off-by: Badhri Jagan Sridharan <[email protected]> Cc: stable <[email protected]> Reviewed-by: Heikki Krogerus <[email protected]> Reviewed-by: Guenter Roeck <[email protected]> Link: https://lore.kernel.org/r/[email protected] Signed-off-by: Greg Kroah-Hartman <[email protected]>
This commit is contained in:
parent
11c2089767
commit
740c938147
1 changed files with 26 additions and 0 deletions
|
|
@ -3768,6 +3768,14 @@ static void _tcpm_cc_change(struct tcpm_port *port, enum typec_cc_status cc1,
|
|||
*/
|
||||
break;
|
||||
|
||||
case PORT_RESET:
|
||||
case PORT_RESET_WAIT_OFF:
|
||||
/*
|
||||
* State set back to default mode once the timer completes.
|
||||
* Ignore CC changes here.
|
||||
*/
|
||||
break;
|
||||
|
||||
default:
|
||||
if (tcpm_port_is_disconnected(port))
|
||||
tcpm_set_state(port, unattached_state(port), 0);
|
||||
|
|
@ -3829,6 +3837,15 @@ static void _tcpm_pd_vbus_on(struct tcpm_port *port)
|
|||
case SRC_TRY_DEBOUNCE:
|
||||
/* Do nothing, waiting for sink detection */
|
||||
break;
|
||||
|
||||
case PORT_RESET:
|
||||
case PORT_RESET_WAIT_OFF:
|
||||
/*
|
||||
* State set back to default mode once the timer completes.
|
||||
* Ignore vbus changes here.
|
||||
*/
|
||||
break;
|
||||
|
||||
default:
|
||||
break;
|
||||
}
|
||||
|
|
@ -3882,10 +3899,19 @@ static void _tcpm_pd_vbus_off(struct tcpm_port *port)
|
|||
case PORT_RESET_WAIT_OFF:
|
||||
tcpm_set_state(port, tcpm_default_state(port), 0);
|
||||
break;
|
||||
|
||||
case SRC_TRY_WAIT:
|
||||
case SRC_TRY_DEBOUNCE:
|
||||
/* Do nothing, waiting for sink detection */
|
||||
break;
|
||||
|
||||
case PORT_RESET:
|
||||
/*
|
||||
* State set back to default mode once the timer completes.
|
||||
* Ignore vbus changes here.
|
||||
*/
|
||||
break;
|
||||
|
||||
default:
|
||||
if (port->pwr_role == TYPEC_SINK &&
|
||||
port->attached)
|
||||
|
|
|
|||
Loading…
Reference in a new issue