diff options
Diffstat (limited to 'include/linux/usb/phy.h')
| -rw-r--r-- | include/linux/usb/phy.h | 43 | 
1 files changed, 43 insertions, 0 deletions
diff --git a/include/linux/usb/phy.h b/include/linux/usb/phy.h index a29ae1eb9346..15847cbdb512 100644 --- a/include/linux/usb/phy.h +++ b/include/linux/usb/phy.h @@ -106,9 +106,25 @@ struct usb_phy {  			enum usb_device_speed speed);  }; +/** + * struct usb_phy_bind - represent the binding for the phy + * @dev_name: the device name of the device that will bind to the phy + * @phy_dev_name: the device name of the phy + * @index: used if a single controller uses multiple phys + * @phy: reference to the phy + * @list: to maintain a linked list of the binding information + */ +struct usb_phy_bind { +	const char	*dev_name; +	const char	*phy_dev_name; +	u8		index; +	struct usb_phy	*phy; +	struct list_head list; +};  /* 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 */ @@ -149,8 +165,14 @@ 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 struct usb_phy *devm_usb_get_phy_by_phandle(struct device *dev, +	const char *phandle, 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, +				const char *phy_dev_name);  #else  static inline struct usb_phy *usb_get_phy(enum usb_phy_type type)  { @@ -163,6 +185,22 @@ 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 struct usb_phy *devm_usb_get_phy_by_phandle(struct device *dev, +	const char *phandle, u8 index) +{ +	return NULL; +} +  static inline void usb_put_phy(struct usb_phy *x)  {  } @@ -171,6 +209,11 @@ static inline void devm_usb_put_phy(struct device *dev, struct usb_phy *x)  {  } +static inline int usb_bind_phy(const char *dev_name, u8 index, +				const char *phy_dev_name) +{ +	return -EOPNOTSUPP; +}  #endif  static inline int  |