]> git.baikalelectronics.ru Git - kernel.git/commit
usb: typec: tcpm: Properly handle Alert and Status Messages
authorKyle Tso <kyletso@google.com>
Mon, 31 May 2021 16:49:28 +0000 (00:49 +0800)
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Fri, 4 Jun 2021 11:24:16 +0000 (13:24 +0200)
commitf672b35e76abd38bbc5d84fafd614c0858a4c17c
tree07d2a92b5e3f049219f140a5257f9b8d6e0f79ee
parent3df322cc8dc768b13143f2b579c87e45b45287c3
usb: typec: tcpm: Properly handle Alert and Status Messages

When receiving Alert Message, if it is not unexpected but is
unsupported for some reason, the port should return Not_Supported
Message response.

Also, according to PD3.0 Spec 6.5.2.1.4 Event Flags Field, the
OTP/OVP/OCP flags in the Event Flags field in Status Message no longer
require Get_PPS_Status Message to clear them. Thus remove it when
receiving Status Message with those flags being set.

In addition, add the missing AMS operations for Status Message.

Fixes: cadd3f80de5b ("typec: tcpm: Add support for sink PPS related messages")
Fixes: c6f582cf3944 ("usb: typec: tcpm: AMS and Collision Avoidance")
Signed-off-by: Kyle Tso <kyletso@google.com>
Link: https://lore.kernel.org/r/20210531164928.2368606-1-kyletso@google.com
Cc: stable <stable@vger.kernel.org>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
drivers/usb/typec/tcpm/tcpm.c
include/linux/usb/pd_ext_sdb.h