aboutsummaryrefslogtreecommitdiffstats
path: root/include/linux/usb/phy.h
diff options
context:
space:
mode:
Diffstat (limited to 'include/linux/usb/phy.h')
-rw-r--r--include/linux/usb/phy.h43
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 {
106 enum usb_device_speed speed); 106 enum usb_device_speed speed);
107}; 107};
108 108
109/**
110 * struct usb_phy_bind - represent the binding for the phy
111 * @dev_name: the device name of the device that will bind to the phy
112 * @phy_dev_name: the device name of the phy
113 * @index: used if a single controller uses multiple phys
114 * @phy: reference to the phy
115 * @list: to maintain a linked list of the binding information
116 */
117struct usb_phy_bind {
118 const char *dev_name;
119 const char *phy_dev_name;
120 u8 index;
121 struct usb_phy *phy;
122 struct list_head list;
123};
109 124
110/* for board-specific init logic */ 125/* for board-specific init logic */
111extern int usb_add_phy(struct usb_phy *, enum usb_phy_type type); 126extern int usb_add_phy(struct usb_phy *, enum usb_phy_type type);
127extern int usb_add_phy_dev(struct usb_phy *);
112extern void usb_remove_phy(struct usb_phy *); 128extern void usb_remove_phy(struct usb_phy *);
113 129
114/* helpers for direct access thru low-level io interface */ 130/* helpers for direct access thru low-level io interface */
@@ -149,8 +165,14 @@ usb_phy_shutdown(struct usb_phy *x)
149extern struct usb_phy *usb_get_phy(enum usb_phy_type type); 165extern struct usb_phy *usb_get_phy(enum usb_phy_type type);
150extern struct usb_phy *devm_usb_get_phy(struct device *dev, 166extern struct usb_phy *devm_usb_get_phy(struct device *dev,
151 enum usb_phy_type type); 167 enum usb_phy_type type);
168extern struct usb_phy *usb_get_phy_dev(struct device *dev, u8 index);
169extern struct usb_phy *devm_usb_get_phy_dev(struct device *dev, u8 index);
170extern struct usb_phy *devm_usb_get_phy_by_phandle(struct device *dev,
171 const char *phandle, u8 index);
152extern void usb_put_phy(struct usb_phy *); 172extern void usb_put_phy(struct usb_phy *);
153extern void devm_usb_put_phy(struct device *dev, struct usb_phy *x); 173extern void devm_usb_put_phy(struct device *dev, struct usb_phy *x);
174extern int usb_bind_phy(const char *dev_name, u8 index,
175 const char *phy_dev_name);
154#else 176#else
155static inline struct usb_phy *usb_get_phy(enum usb_phy_type type) 177static inline struct usb_phy *usb_get_phy(enum usb_phy_type type)
156{ 178{
@@ -163,6 +185,22 @@ static inline struct usb_phy *devm_usb_get_phy(struct device *dev,
163 return NULL; 185 return NULL;
164} 186}
165 187
188static inline struct usb_phy *usb_get_phy_dev(struct device *dev, u8 index)
189{
190 return NULL;
191}
192
193static inline struct usb_phy *devm_usb_get_phy_dev(struct device *dev, u8 index)
194{
195 return NULL;
196}
197
198static inline struct usb_phy *devm_usb_get_phy_by_phandle(struct device *dev,
199 const char *phandle, u8 index)
200{
201 return NULL;
202}
203
166static inline void usb_put_phy(struct usb_phy *x) 204static inline void usb_put_phy(struct usb_phy *x)
167{ 205{
168} 206}
@@ -171,6 +209,11 @@ static inline void devm_usb_put_phy(struct device *dev, struct usb_phy *x)
171{ 209{
172} 210}
173 211
212static inline int usb_bind_phy(const char *dev_name, u8 index,
213 const char *phy_dev_name)
214{
215 return -EOPNOTSUPP;
216}
174#endif 217#endif
175 218
176static inline int 219static inline int