aboutsummaryrefslogtreecommitdiffstats
path: root/include/linux/usb/pd.h
diff options
context:
space:
mode:
authorBadhri Jagan Sridharan <badhri@google.com>2017-11-15 17:01:55 -0800
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>2017-12-07 16:03:15 +0100
commit5007e1b5db736e76360047a6974c5cf7beb2d40e (patch)
treee6a2ebf7e5dbfa88cfafb287fefde3b587a13bdb /include/linux/usb/pd.h
parentusb: early: Correct the endpoint type value for bulk in endpoint (diff)
downloadlinux-dev-5007e1b5db736e76360047a6974c5cf7beb2d40e.tar.xz
linux-dev-5007e1b5db736e76360047a6974c5cf7beb2d40e.zip
typec: tcpm: Validate source and sink caps
The source and sink caps should follow the following rules. This patch validates whether the src_caps/snk_caps adheres to it. 6.4.1 Capabilities Message A Capabilities message (Source Capabilities message or Sink Capabilities message) shall have at least one Power Data Object for vSafe5V. The Capabilities message shall also contain the sending Port’s information followed by up to 6 additional Power Data Objects. Power Data Objects in a Capabilities message shall be sent in the following order: 1. The vSafe5V Fixed Supply Object shall always be the first object. 2. The remaining Fixed Supply Objects, if present, shall be sent in voltage order; lowest to highest. 3. The Battery Supply Objects, if present shall be sent in Minimum Voltage order; lowest to highest. 4. The Variable Supply (non-battery) Objects, if present, shall be sent in Minimum Voltage order; lowest to highest. Errors in source/sink_caps of the local port will prevent the port registration. Whereas, errors in source caps of partner device would only log them. Signed-off-by: Badhri Jagan Sridharan <Badhri@google.com> Acked-by: Heikki Krogerus <heikki.krogerus@linux.intel.com> Reviewed-by: Guenter Roeck <linux@roeck-us.net> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
Diffstat (limited to 'include/linux/usb/pd.h')
-rw-r--r--include/linux/usb/pd.h2
1 files changed, 2 insertions, 0 deletions
diff --git a/include/linux/usb/pd.h b/include/linux/usb/pd.h
index e00051ced806..b3d41d7409b3 100644
--- a/include/linux/usb/pd.h
+++ b/include/linux/usb/pd.h
@@ -148,6 +148,8 @@ enum pd_pdo_type {
(PDO_TYPE(PDO_TYPE_FIXED) | (flags) | \
PDO_FIXED_VOLT(mv) | PDO_FIXED_CURR(ma))
+#define VSAFE5V 5000 /* mv units */
+
#define PDO_BATT_MAX_VOLT_SHIFT 20 /* 50mV units */
#define PDO_BATT_MIN_VOLT_SHIFT 10 /* 50mV units */
#define PDO_BATT_MAX_PWR_SHIFT 0 /* 250mW units */