summaryrefslogtreecommitdiff
path: root/drivers/usb/pd/usbpd.h
diff options
context:
space:
mode:
Diffstat (limited to 'drivers/usb/pd/usbpd.h')
-rw-r--r--drivers/usb/pd/usbpd.h26
1 files changed, 19 insertions, 7 deletions
diff --git a/drivers/usb/pd/usbpd.h b/drivers/usb/pd/usbpd.h
index fd3f2f33bbc7..b2663add7f3c 100644
--- a/drivers/usb/pd/usbpd.h
+++ b/drivers/usb/pd/usbpd.h
@@ -1,4 +1,4 @@
-/* Copyright (c) 2016, Linux Foundation. All rights reserved.
+/* Copyright (c) 2016-2017, Linux Foundation. All rights reserved.
*
* This program is free software; you can redistribute it and/or modify
* it under the terms of the GNU General Public License version 2 and
@@ -51,18 +51,24 @@ enum pd_msg_type {
SOPII_MSG,
};
+enum pd_spec_rev {
+ USBPD_REV_20 = 1,
+ USBPD_REV_30 = 2,
+};
+
/* enable msg and signal to be received by phy */
#define FRAME_FILTER_EN_SOP BIT(0)
#define FRAME_FILTER_EN_HARD_RESET BIT(5)
struct pd_phy_params {
- void (*signal_cb)(struct usbpd *pd, enum pd_sig_type type);
- void (*msg_rx_cb)(struct usbpd *pd, enum pd_msg_type type,
- u8 *buf, size_t len);
- void (*shutdown_cb)(struct usbpd *pd);
- enum data_role data_role;
+ void (*signal_cb)(struct usbpd *pd, enum pd_sig_type type);
+ void (*msg_rx_cb)(struct usbpd *pd, enum pd_msg_type type,
+ u8 *buf, size_t len);
+ void (*shutdown_cb)(struct usbpd *pd);
+ enum data_role data_role;
enum power_role power_role;
- u8 frame_filter_val;
+ u8 frame_filter_val;
+ u8 spec_rev;
};
#if IS_ENABLED(CONFIG_QPNP_USB_PDPHY)
@@ -71,6 +77,7 @@ int pd_phy_signal(enum pd_sig_type type, unsigned int timeout_ms);
int pd_phy_write(u16 hdr, const u8 *data, size_t data_len,
enum pd_msg_type type, unsigned int timeout_ms);
int pd_phy_update_roles(enum data_role dr, enum power_role pr);
+int pd_phy_update_spec_rev(enum pd_spec_rev rev);
void pd_phy_close(void);
#else
static inline int pd_phy_open(struct pd_phy_params *params)
@@ -94,6 +101,11 @@ static inline int pd_phy_update_roles(enum data_role dr, enum power_role pr)
return -ENODEV;
}
+static inline int pd_phy_update_spec_rev(enum pd_spec_rev rev)
+{
+ return -ENODEV;
+}
+
static inline void pd_phy_close(void)
{
}