usb: typec: tcpm: Query Source partner for FRS capability only if it is DRP
Subsystems (3)
PATCH 1/1 usb: typec: tcpm: Query Source partner for FRS capability only if it is DRP
Source-only port partner will always respond NOT_SUPPORTED to GET_SINK_CAP. Avoid this redundant AMS by bailing out querying the FRS capability if the Source port partner is not DRP.
Signed-off-by Kyle Tso <[email protected]>
--- drivers/usb/typec/tcpm/tcpm.c | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-)
drivers/usb/typec/tcpm/tcpm.c +2 -1
@@ -4401,7 +4401,8 @@ static void run_state_machine(struct tcpm_port *port)tcpm_set_current_limit (port,tcpm_get_current_limit (port),5000 );tcpm_swap_complete (port,0 );tcpm_typec_connect (port); -mod_enable_frs_delayed_work (port,0 ); +if (port->pd_capable && port->source_caps[0 ] &PDO_FIXED_DUAL_ROLE ) +mod_enable_frs_delayed_work (port,0 );tcpm_pps_complete (port, port->pps_status);if (port->ams !=NONE_AMS )
Signature · 1 line
2.43.0.472.g3155946c3a-goog
Quoted 5 lines · Kyle Tso
Source-only port partner will always respond
NOT_SUPPORTEDtoGET_SINK_CAP. Avoid this redundant AMS by bailing out querying the FRS capability if the Source port partner is not DRP.Signed-off-by Kyle Tso <[email protected]>
Reviewed-by Heikki Krogerus <[email protected]>
Quoted 20 lines
--- drivers/usb/typec/tcpm/tcpm.c | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-)drivers/usb/typec/tcpm/tcpm.c +2
-1@@ -4401,7 +4401,8 @@ static void run_state_machine(struct tcpm_port *port)tcpm_set_current_limit (port,tcpm_get_current_limit (port),5000 );tcpm_swap_complete (port,0 );tcpm_typec_connect (port); -mod_enable_frs_delayed_work (port,0 ); +if (port->pd_capable && port->source_caps[0 ] &PDO_FIXED_DUAL_ROLE ) +mod_enable_frs_delayed_work (port,0 );tcpm_pps_complete (port, port->pps_status);if (port->ams !=NONE_AMS )Signature · 1 line
2.43.0.472.g3155946c3a-goog
Signature · 1 line
heikki
Quoted 5 lines · Kyle Tso
Source-only port partner will always respond
NOT_SUPPORTEDtoGET_SINK_CAP. Avoid this redundant AMS by bailing out querying the FRS capability if the Source port partner is not DRP.Signed-off-by Kyle Tso <[email protected]>
Reviewed-by Guenter Roeck <[email protected]>
Quoted 18 lines
--- drivers/usb/typec/tcpm/tcpm.c | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-)drivers/usb/typec/tcpm/tcpm.c +2
-1@@ -4401,7 +4401,8 @@ static void run_state_machine(struct tcpm_port *port)tcpm_set_current_limit (port,tcpm_get_current_limit (port),5000 );tcpm_swap_complete (port,0 );tcpm_typec_connect (port); -mod_enable_frs_delayed_work (port,0 ); +if (port->pd_capable && port->source_caps[0 ] &PDO_FIXED_DUAL_ROLE ) +mod_enable_frs_delayed_work (port,0 );tcpm_pps_complete (port, port->pps_status);if (port->ams !=NONE_AMS )