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 { | |||
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 | */ | ||
117 | struct 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 */ |
111 | extern int usb_add_phy(struct usb_phy *, enum usb_phy_type type); | 126 | extern int usb_add_phy(struct usb_phy *, enum usb_phy_type type); |
127 | extern int usb_add_phy_dev(struct usb_phy *); | ||
112 | extern void usb_remove_phy(struct usb_phy *); | 128 | extern 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) | |||
149 | extern struct usb_phy *usb_get_phy(enum usb_phy_type type); | 165 | extern struct usb_phy *usb_get_phy(enum usb_phy_type type); |
150 | extern struct usb_phy *devm_usb_get_phy(struct device *dev, | 166 | extern struct usb_phy *devm_usb_get_phy(struct device *dev, |
151 | enum usb_phy_type type); | 167 | enum usb_phy_type type); |
168 | extern struct usb_phy *usb_get_phy_dev(struct device *dev, u8 index); | ||
169 | extern struct usb_phy *devm_usb_get_phy_dev(struct device *dev, u8 index); | ||
170 | extern struct usb_phy *devm_usb_get_phy_by_phandle(struct device *dev, | ||
171 | const char *phandle, u8 index); | ||
152 | extern void usb_put_phy(struct usb_phy *); | 172 | extern void usb_put_phy(struct usb_phy *); |
153 | extern void devm_usb_put_phy(struct device *dev, struct usb_phy *x); | 173 | extern void devm_usb_put_phy(struct device *dev, struct usb_phy *x); |
174 | extern int usb_bind_phy(const char *dev_name, u8 index, | ||
175 | const char *phy_dev_name); | ||
154 | #else | 176 | #else |
155 | static inline struct usb_phy *usb_get_phy(enum usb_phy_type type) | 177 | static 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 | ||
188 | static inline struct usb_phy *usb_get_phy_dev(struct device *dev, u8 index) | ||
189 | { | ||
190 | return NULL; | ||
191 | } | ||
192 | |||
193 | static inline struct usb_phy *devm_usb_get_phy_dev(struct device *dev, u8 index) | ||
194 | { | ||
195 | return NULL; | ||
196 | } | ||
197 | |||
198 | static 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 | |||
166 | static inline void usb_put_phy(struct usb_phy *x) | 204 | static 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 | ||
212 | static 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 | ||
176 | static inline int | 219 | static inline int |