From 7edd303073c34a7894b61f2dbdae28d9cd326e95 Mon Sep 17 00:00:00 2001 From: Hemant Kumar Date: Wed, 8 Aug 2018 10:38:50 -0700 Subject: [PATCH] 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 Bug: 154275330 (cherry picked from commit 5a5e9243e049f05dfa9610a77c4f43c4eddddc64) Signed-off-by: Saravana Kannan --- include/linux/usb/phy.h | 25 +++++++++++++++++++++++++ 1 file changed, 25 insertions(+) diff --git a/include/linux/usb/phy.h b/include/linux/usb/phy.h index e4de6bc1f69b..6809aaa6dfa4 100644 --- a/include/linux/usb/phy.h +++ b/include/linux/usb/phy.h @@ -15,6 +15,17 @@ #include #include +#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);