Skip to content

Commit

Permalink
ANDROID: GKI: usb: phy: Fix ABI diff for usb_phy_type and usb_phy.reset
Browse files Browse the repository at this point in the history
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 5a5e924)
Signed-off-by: Saravana Kannan <saravanak@google.com>
  • Loading branch information
Hemant Kumar authored and surenbaghdasaryan committed Apr 17, 2020
1 parent 42abc3f commit 7edd303
Showing 1 changed file with 25 additions and 0 deletions.
25 changes: 25 additions & 0 deletions include/linux/usb/phy.h
Original file line number Diff line number Diff line change
Expand Up @@ -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,
Expand All @@ -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 */
Expand Down Expand Up @@ -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 */
Expand Down Expand Up @@ -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);
Expand Down

0 comments on commit 7edd303

Please sign in to comment.