diff options
author | Kishon Vijay Abraham I <kishon@ti.com> | 2013-01-25 08:03:22 +0530 |
---|---|---|
committer | Felipe Balbi <balbi@ti.com> | 2013-01-25 10:20:14 +0200 |
commit | 0fa4fab4ee46470ccd463c83be95434936942e05 (patch) | |
tree | 8ec5a2696ea94334b0625b27f15e329eb0c4ff93 /include/linux/usb | |
parent | b4a83e4df1bc864e89d3bb90e97f9caab656545d (diff) |
usb: otg: utils: add facilities in phy lib to support multiple PHYs of same type
In order to add support for multipe PHY's of the same type, new API's
for adding PHY and getting PHY has been added. Now the binding
information for the PHY and controller should be done in platform file
using usb_bind_phy API. And for getting a PHY, the device pointer of the
USB controller and an index should be passed. Based on the binding
information that is added in the platform file, usb_get_phy_dev will return the
appropriate PHY.
Already existing API's to add and get phy by type is not removed. These
API's are deprecated and will be removed once all the platforms start to
use the new API.
Signed-off-by: Kishon Vijay Abraham I <kishon@ti.com>
Signed-off-by: Felipe Balbi <balbi@ti.com>
Diffstat (limited to 'include/linux/usb')
-rw-r--r-- | include/linux/usb/phy.h | 13 |
1 files changed, 13 insertions, 0 deletions
diff --git a/include/linux/usb/phy.h b/include/linux/usb/phy.h index a812ed5a1691..359db7de61e4 100644 --- a/include/linux/usb/phy.h +++ b/include/linux/usb/phy.h @@ -124,6 +124,7 @@ struct usb_phy_bind { /* for board-specific init logic */ extern int usb_add_phy(struct usb_phy *, enum usb_phy_type type); +extern int usb_add_phy_dev(struct usb_phy *); extern void usb_remove_phy(struct usb_phy *); /* helpers for direct access thru low-level io interface */ @@ -164,6 +165,8 @@ usb_phy_shutdown(struct usb_phy *x) 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 struct usb_phy *usb_get_phy_dev(struct device *dev, u8 index); +extern struct usb_phy *devm_usb_get_phy_dev(struct device *dev, u8 index); extern void usb_put_phy(struct usb_phy *); extern void devm_usb_put_phy(struct device *dev, struct usb_phy *x); extern int usb_bind_phy(const char *dev_name, u8 index, @@ -180,6 +183,16 @@ static inline struct usb_phy *devm_usb_get_phy(struct device *dev, return NULL; } +static inline struct usb_phy *usb_get_phy_dev(struct device *dev, u8 index) +{ + return NULL; +} + +static inline struct usb_phy *devm_usb_get_phy_dev(struct device *dev, u8 index) +{ + return NULL; +} + static inline void usb_put_phy(struct usb_phy *x) { } |