aboutsummaryrefslogtreecommitdiffstats
path: root/include/linux/usb/phy.h
diff options
context:
space:
mode:
authorGreg Kroah-Hartman <gregkh@linuxfoundation.org>2013-04-05 15:18:00 -0700
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>2013-04-05 15:18:00 -0700
commit64dc9e2e7320f079b97c46b106133b58b8e18d40 (patch)
treeab010dc1337d44e29c2b32b7f11788620a91fe4f /include/linux/usb/phy.h
parentUSB: keyspan: add a sanity test on "len" (diff)
parentusb: gadget: nokia: include f_ecm.c (diff)
downloadlinux-dev-64dc9e2e7320f079b97c46b106133b58b8e18d40.tar.xz
linux-dev-64dc9e2e7320f079b97c46b106133b58b8e18d40.zip
Merge tag 'usb-for-v3.10' of git://git.kernel.org/pub/scm/linux/kernel/git/balbi/usb into usb-next
Felipe writes: usb: patches for v3.10 merge window Here is the big Gadget & PHY pull request. Many of us have been really busy lately getting multiple drivers to a better position. Since this pull request is so large, I will divide it in sections so it's easier to grasp what's included. - cleanups: . UDC drivers no longer touch gadget->dev, that's now udc-core responsibility . Many more UDC drivers converted to usb_gadget_map/unmap_request() . UDC drivers no longer initialize DMA-related fields from gadget's device structure . UDC drivers don't touch gadget.dev.driver directly . UDC drivers don't assign gadget.dev.release directly . Removal of some unused DMA_ADDR_INVALID . Introduction of CONFIG_USB_PHY . All phy drivers have been moved to drivers/usb/phy and renamed to a common naming scheme . Fix PHY layer so it never returns a NULL pointer, also fix all callers to avoid using IS_ERR_OR_NULL() . Sparse fixes all over the place . drivers/usb/otg/ has been deleted . Marvel drivers (mv_udc, ehci-mv, mv_otg and mv_u3d) improved clock usage - new features: . UDC core now provides a generic way for tracking and reporting UDC's state (not attached, resuming, suspended, addressed, default, etc) . twl4030-usb learned that it shouldn't be enabled during init . Full DT support for DWC3 has been implemented . ab8500-usb learned about pinctrl framework . nop PHY learned about DeviceTree and regulators . DWC3 learned about suspend/resume . DWC3 can now be compiled in host-only and gadget-only (as well as DRD) configurations . UVC now enables streaming endpoint based on negotiated speed . isp1301 now implements the PHY API properly . configfs-based interface for gadget drivers which will lead to the removal of all code which just combines functions together to build functional gadget drivers. . f_serial and f_obex were converted to new configfs interface while maintaining old interface around. - non-critical fixes: . UVC gadget driver got fixes for Endpoint usage and stream calculation . ab8500-usb fixed unbalanced clock and regulator API usage . twl4030-usb got a fix for when OMAP3 is booted with cable connected . fusb300_udc got a fix for DMA usage . UVC got fixes for two assertions of the USB Video Class Compliance specification revision 1.1 . build warning issues caused by recent addition of __must_check to regulator API These are all changes which deserve a mention, all other changes are related to these one or minor spelling fixes and other similar tasks. Signed-of-by: Felipe Balbi <balbi@ti.com>
Diffstat (limited to 'include/linux/usb/phy.h')
-rw-r--r--include/linux/usb/phy.h33
1 files changed, 27 insertions, 6 deletions
diff --git a/include/linux/usb/phy.h b/include/linux/usb/phy.h
index 15847cbdb512..6b5978f57633 100644
--- a/include/linux/usb/phy.h
+++ b/include/linux/usb/phy.h
@@ -91,6 +91,9 @@ struct usb_phy {
int (*init)(struct usb_phy *x);
void (*shutdown)(struct usb_phy *x);
+ /* enable/disable VBUS */
+ int (*set_vbus)(struct usb_phy *x, int on);
+
/* effective for B devices, ignored for A-peripheral */
int (*set_power)(struct usb_phy *x,
unsigned mA);
@@ -160,8 +163,26 @@ usb_phy_shutdown(struct usb_phy *x)
x->shutdown(x);
}
+static inline int
+usb_phy_vbus_on(struct usb_phy *x)
+{
+ if (!x->set_vbus)
+ return 0;
+
+ return x->set_vbus(x, true);
+}
+
+static inline int
+usb_phy_vbus_off(struct usb_phy *x)
+{
+ if (!x->set_vbus)
+ return 0;
+
+ return x->set_vbus(x, false);
+}
+
/* for usb host and peripheral controller drivers */
-#ifdef CONFIG_USB_OTG_UTILS
+#if IS_ENABLED(CONFIG_USB_PHY)
extern struct usb_phy *usb_get_phy(enum usb_phy_type type);
extern struct usb_phy *devm_usb_get_phy(struct device *dev,
enum usb_phy_type type);
@@ -176,29 +197,29 @@ extern int usb_bind_phy(const char *dev_name, u8 index,
#else
static inline struct usb_phy *usb_get_phy(enum usb_phy_type type)
{
- return NULL;
+ return ERR_PTR(-ENXIO);
}
static inline struct usb_phy *devm_usb_get_phy(struct device *dev,
enum usb_phy_type type)
{
- return NULL;
+ return ERR_PTR(-ENXIO);
}
static inline struct usb_phy *usb_get_phy_dev(struct device *dev, u8 index)
{
- return NULL;
+ return ERR_PTR(-ENXIO);
}
static inline struct usb_phy *devm_usb_get_phy_dev(struct device *dev, u8 index)
{
- return NULL;
+ return ERR_PTR(-ENXIO);
}
static inline struct usb_phy *devm_usb_get_phy_by_phandle(struct device *dev,
const char *phandle, u8 index)
{
- return NULL;
+ return ERR_PTR(-ENXIO);
}
static inline void usb_put_phy(struct usb_phy *x)