Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit 7edd3030 authored by Hemant Kumar's avatar Hemant Kumar Committed by Suren Baghdasaryan
Browse files

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: default avatarHemant Kumar <hemantk@codeaurora.org>
Bug: 154275330
(cherry picked from commit 5a5e9243)
Signed-off-by: default avatarSaravana Kannan <saravanak@google.com>
parent 42abc3fc
Loading
Loading
Loading
Loading
+25 −0
Original line number Diff line number Diff line
@@ -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);