linux-stable/include/linux/usb/pd_ext_sdb.h
Kyle Tso 063933f47a 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: 64f7c494a3 ("typec: tcpm: Add support for sink PPS related messages")
Fixes: 0908c5aca3 ("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>
2021-06-04 13:24:16 +02:00

27 lines
698 B
C

// SPDX-License-Identifier: GPL-2.0+
/*
* Copyright (c) 2017 Dialog Semiconductor
*
* Author: Adam Thomson <Adam.Thomson.Opensource@diasemi.com>
*/
#ifndef __LINUX_USB_PD_EXT_SDB_H
#define __LINUX_USB_PD_EXT_SDB_H
/* SDB : Status Data Block */
enum usb_pd_ext_sdb_fields {
USB_PD_EXT_SDB_INTERNAL_TEMP = 0,
USB_PD_EXT_SDB_PRESENT_INPUT,
USB_PD_EXT_SDB_PRESENT_BATT_INPUT,
USB_PD_EXT_SDB_EVENT_FLAGS,
USB_PD_EXT_SDB_TEMP_STATUS,
USB_PD_EXT_SDB_DATA_SIZE,
};
/* Event Flags */
#define USB_PD_EXT_SDB_EVENT_OCP BIT(1)
#define USB_PD_EXT_SDB_EVENT_OTP BIT(2)
#define USB_PD_EXT_SDB_EVENT_OVP BIT(3)
#define USB_PD_EXT_SDB_EVENT_CF_CV_MODE BIT(4)
#endif /* __LINUX_USB_PD_EXT_SDB_H */