usb: phy: patches for v3.6 merge window
We are starting to support multiple USB phys as we should thanks for Kishon's work. DeviceTree support for USB PHYs won't come until discussion with DeviceTree maintainer is finished. Together with that series, we have one fix for twl4030 which missed a IRQF_ONESHOT annotation when requesting a threaded IRQ without a top half handler, and removal of an unused variable compilation warning to isp1301_omap. -----BEGIN PGP SIGNATURE----- Version: GnuPG v1.4.12 (GNU/Linux) iQIcBAABAgAGBQJP8VcOAAoJEIaOsuA1yqREeNYQAIxHOteF78nx5gMwB20agndf vYCOB3Jymc67vcLuEf60lqoVBuQ7bxGsJyx+HlNkKrVQQfF8enL9UBhUDwvmKytm Z1FBVmuA33PxS2aGSODkgafODO6wfnp5USzzYjEG+Hu6Q9Zt4rJ3NYakYFXdbrM3 kT3uZ2uwuOd/B1Pzt8oiMSbiF16kLeX0a6m6C4KEFViX0uGHAe/KqN4b9eSbO41q 16fvfthbAaqqSpEoMusI+kCFLku7ib3CXl5d4kgik7C7+wY08JTDWhWBMIl6wiFz LeDIXfoX0MgEcB3vDszGCf2pgtCNR8rfl/pzuLvr6F6p+Cj6CqtgsfV8HCe43Dzr RI7Fewl1xdz6MztKRBgr75RxqZ6VA91gLWT21nDI72DEBwyBJ1pk882CxkxSLK+b VNtI/La9JZkUqb0PXioD0a4JUVpzw5nLatpw1PXZoLUgSozVXmhDE6Wjhl/jvl4y ZVQVRQn2ZcyNzYY9bG2X08zyDRRvurXFfQ20CfAeBpgvvfccN9e5vGdWVbohwZro Vn1x+fSyb6KqVOeYlzpAKf+UGXE9UM53YKpjFnmrstqUjbL5ByW2pZn5fYgJP08v 9im3SXwvs3Iz2mzwenRFUpI6PDuaTnIWgB7qquFDY1QwFyAKoPJuVN81/iPCisUM bIYQILhqgTNNjsnPmpCr =HwsA -----END PGP SIGNATURE----- Merge tag 'xceiv-for-v3.6' of git://git.kernel.org/pub/scm/linux/kernel/git/balbi/usb into usb-next usb: phy: patches for v3.6 merge window We are starting to support multiple USB phys as we should thanks for Kishon's work. DeviceTree support for USB PHYs won't come until discussion with DeviceTree maintainer is finished. Together with that series, we have one fix for twl4030 which missed a IRQF_ONESHOT annotation when requesting a threaded IRQ without a top half handler, and removal of an unused variable compilation warning to isp1301_omap.
This commit is contained in:
commit
ff9cce8277
38 changed files with 538 additions and 325 deletions
30
include/linux/usb/musb-omap.h
Normal file
30
include/linux/usb/musb-omap.h
Normal file
|
|
@ -0,0 +1,30 @@
|
|||
/*
|
||||
* Copyright (C) 2011-2012 by Texas Instruments
|
||||
*
|
||||
* The Inventra Controller Driver for Linux is free software; you
|
||||
* can redistribute it and/or modify it under the terms of the GNU
|
||||
* General Public License version 2 as published by the Free Software
|
||||
* Foundation.
|
||||
*/
|
||||
|
||||
#ifndef __MUSB_OMAP_H__
|
||||
#define __MUSB_OMAP_H__
|
||||
|
||||
enum omap_musb_vbus_id_status {
|
||||
OMAP_MUSB_UNKNOWN = 0,
|
||||
OMAP_MUSB_ID_GROUND,
|
||||
OMAP_MUSB_ID_FLOAT,
|
||||
OMAP_MUSB_VBUS_VALID,
|
||||
OMAP_MUSB_VBUS_OFF,
|
||||
};
|
||||
|
||||
#if (defined(CONFIG_USB_MUSB_OMAP2PLUS) || \
|
||||
defined(CONFIG_USB_MUSB_OMAP2PLUS_MODULE))
|
||||
void omap_musb_mailbox(enum omap_musb_vbus_id_status status);
|
||||
#else
|
||||
static inline void omap_musb_mailbox(enum omap_musb_vbus_id_status status)
|
||||
{
|
||||
}
|
||||
#endif
|
||||
|
||||
#endif /* __MUSB_OMAP_H__ */
|
||||
|
|
@ -43,6 +43,13 @@ enum usb_phy_events {
|
|||
USB_EVENT_ENUMERATED, /* gadget driver enumerated */
|
||||
};
|
||||
|
||||
/* associate a type with PHY */
|
||||
enum usb_phy_type {
|
||||
USB_PHY_TYPE_UNDEFINED,
|
||||
USB_PHY_TYPE_USB2,
|
||||
USB_PHY_TYPE_USB3,
|
||||
};
|
||||
|
||||
struct usb_phy;
|
||||
|
||||
/* for transceivers connected thru an ULPI interface, the user must
|
||||
|
|
@ -89,6 +96,7 @@ struct usb_phy {
|
|||
const char *label;
|
||||
unsigned int flags;
|
||||
|
||||
enum usb_phy_type type;
|
||||
enum usb_otg_state state;
|
||||
enum usb_phy_events last_event;
|
||||
|
||||
|
|
@ -105,6 +113,9 @@ struct usb_phy {
|
|||
u16 port_status;
|
||||
u16 port_change;
|
||||
|
||||
/* to support controllers that have multiple transceivers */
|
||||
struct list_head head;
|
||||
|
||||
/* initialize/shutdown the OTG controller */
|
||||
int (*init)(struct usb_phy *x);
|
||||
void (*shutdown)(struct usb_phy *x);
|
||||
|
|
@ -121,7 +132,8 @@ struct usb_phy {
|
|||
|
||||
|
||||
/* for board-specific init logic */
|
||||
extern int usb_set_transceiver(struct usb_phy *);
|
||||
extern int usb_add_phy(struct usb_phy *, enum usb_phy_type type);
|
||||
extern void usb_remove_phy(struct usb_phy *);
|
||||
|
||||
#if defined(CONFIG_NOP_USB_XCEIV) || (defined(CONFIG_NOP_USB_XCEIV_MODULE) && defined(MODULE))
|
||||
/* sometimes transceivers are accessed only through e.g. ULPI */
|
||||
|
|
@ -172,16 +184,29 @@ usb_phy_shutdown(struct usb_phy *x)
|
|||
|
||||
/* for usb host and peripheral controller drivers */
|
||||
#ifdef CONFIG_USB_OTG_UTILS
|
||||
extern struct usb_phy *usb_get_transceiver(void);
|
||||
extern void usb_put_transceiver(struct 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);
|
||||
extern void usb_put_phy(struct usb_phy *);
|
||||
extern void devm_usb_put_phy(struct device *dev, struct usb_phy *x);
|
||||
extern const char *otg_state_string(enum usb_otg_state state);
|
||||
#else
|
||||
static inline struct usb_phy *usb_get_transceiver(void)
|
||||
static inline struct usb_phy *usb_get_phy(enum usb_phy_type type)
|
||||
{
|
||||
return NULL;
|
||||
}
|
||||
|
||||
static inline void usb_put_transceiver(struct usb_phy *x)
|
||||
static inline struct usb_phy *devm_usb_get_phy(struct device *dev,
|
||||
enum usb_phy_type type)
|
||||
{
|
||||
return NULL;
|
||||
}
|
||||
|
||||
static inline void usb_put_phy(struct usb_phy *x)
|
||||
{
|
||||
}
|
||||
|
||||
static inline void devm_usb_put_phy(struct device *dev, struct usb_phy *x)
|
||||
{
|
||||
}
|
||||
|
||||
|
|
@ -276,4 +301,15 @@ usb_unregister_notifier(struct usb_phy *x, struct notifier_block *nb)
|
|||
/* for OTG controller drivers (and maybe other stuff) */
|
||||
extern int usb_bus_start_enum(struct usb_bus *bus, unsigned port_num);
|
||||
|
||||
static inline const char *usb_phy_type_string(enum usb_phy_type type)
|
||||
{
|
||||
switch (type) {
|
||||
case USB_PHY_TYPE_USB2:
|
||||
return "USB2 PHY";
|
||||
case USB_PHY_TYPE_USB3:
|
||||
return "USB3 PHY";
|
||||
default:
|
||||
return "UNKNOWN PHY TYPE";
|
||||
}
|
||||
}
|
||||
#endif /* __LINUX_USB_OTG_H */
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue