summaryrefslogtreecommitdiff
path: root/drivers/staging/typec/pd.h
diff options
context:
space:
mode:
authorGreg Kroah-Hartman <gregkh@linuxfoundation.org>2017-05-22 09:56:55 +0300
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>2017-05-22 09:56:55 +0300
commitb4a338d2b3cafa1be68d4e1903203c7e08a38ee5 (patch)
tree069f3753af1cda34c36a7627000ab46ef5c51c83 /drivers/staging/typec/pd.h
parent34cfb106d1f8a746fcccbe61c852f705dcdceaa2 (diff)
parent08332893e37af6ae779367e78e444f8f9571511d (diff)
downloadlinux-b4a338d2b3cafa1be68d4e1903203c7e08a38ee5.tar.xz
Merge 4.12-rc2 into char-misc-next
We want the fixes in here as well to handle merge issues. Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
Diffstat (limited to 'drivers/staging/typec/pd.h')
-rw-r--r--drivers/staging/typec/pd.h10
1 files changed, 10 insertions, 0 deletions
diff --git a/drivers/staging/typec/pd.h b/drivers/staging/typec/pd.h
index 8d97bdb95f23..510ef7279900 100644
--- a/drivers/staging/typec/pd.h
+++ b/drivers/staging/typec/pd.h
@@ -92,6 +92,16 @@ static inline unsigned int pd_header_type_le(__le16 header)
return pd_header_type(le16_to_cpu(header));
}
+static inline unsigned int pd_header_msgid(u16 header)
+{
+ return (header >> PD_HEADER_ID_SHIFT) & PD_HEADER_ID_MASK;
+}
+
+static inline unsigned int pd_header_msgid_le(__le16 header)
+{
+ return pd_header_msgid(le16_to_cpu(header));
+}
+
#define PD_MAX_PAYLOAD 7
struct pd_message {