ANDROID: GKI: usb: phy: Fix ABI diff for usb_phy_type and usb_phy.reset

This is a partial cherry-pick of just the header changes.

Change-Id: I9f349baa5878f7f2a696dc52f048ead54a831c05
Signed-off-by: Hemant Kumar <hemantk@codeaurora.org>
Bug: 154275330
(cherry picked from commit 5a5e9243e0)
Signed-off-by: Saravana Kannan <saravanak@google.com>
This commit is contained in:
Hemant Kumar 2018-08-08 10:38:50 -07:00 committed by Suren Baghdasaryan
parent 42abc3fc10
commit 7edd303073

View file

@ -15,6 +15,17 @@
#include <linux/usb.h>
#include <uapi/linux/usb/charger.h>
#define ENABLE_DP_MANUAL_PULLUP BIT(0)
#define ENABLE_SECONDARY_PHY BIT(1)
#define PHY_HOST_MODE BIT(2)
#define PHY_CHARGER_CONNECTED BIT(3)
#define PHY_VBUS_VALID_OVERRIDE BIT(4)
#define DEVICE_IN_SS_MODE BIT(5)
#define PHY_LANE_A BIT(6)
#define PHY_LANE_B BIT(7)
#define PHY_HSFS_MODE BIT(8)
#define PHY_LS_MODE BIT(9)
enum usb_phy_interface {
USBPHY_INTERFACE_MODE_UNKNOWN,
USBPHY_INTERFACE_MODE_UTMI,
@ -37,6 +48,8 @@ enum usb_phy_type {
USB_PHY_TYPE_UNDEFINED,
USB_PHY_TYPE_USB2,
USB_PHY_TYPE_USB3,
USB_PHY_TYPE_USB3_OR_DP,
USB_PHY_TYPE_USB3_AND_DP,
};
/* OTG defines lots of enumeration states before device reset */
@ -155,6 +168,9 @@ struct usb_phy {
* manually detect the charger type.
*/
enum usb_charger_type (*charger_detect)(struct usb_phy *x);
/* reset the PHY clocks */
int (*reset)(struct usb_phy *x);
};
/* for board-specific init logic */
@ -213,6 +229,15 @@ usb_phy_vbus_off(struct usb_phy *x)
return x->set_vbus(x, false);
}
static inline int
usb_phy_reset(struct usb_phy *x)
{
if (x && x->reset)
return x->reset(x);
return 0;
}
/* for usb host and peripheral controller drivers */
#if IS_ENABLED(CONFIG_USB_PHY)
extern struct usb_phy *usb_get_phy(enum usb_phy_type type);