usb: typec: tcpm: Query Source partner for FRS capability only if it is DRP
authorKyle Tso <kyletso@google.com>
Tue, 5 Dec 2023 07:47:46 +0000 (15:47 +0800)
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Fri, 15 Dec 2023 12:53:58 +0000 (13:53 +0100)
commit7d530f4cc0632056d9f8f207245aa3d91a25d168
tree0e03a2da9aa1fca8bbd28b06019c87511642d3b4
parent70e6163d17dd501ef27680eeb80d78b2cf823c5e
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 <kyletso@google.com>
Reviewed-by: Heikki Krogerus <heikki.krogerus@linux.intel.com>
Reviewed-by: Guenter Roeck <linux@roeck-us.net>
Link: https://lore.kernel.org/r/20231205074747.1821297-1-kyletso@google.com
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
drivers/usb/typec/tcpm/tcpm.c