Lines Matching refs:phy
26 struct usb_phy *phy; member
33 struct usb_phy *phy = NULL; in __usb_find_phy() local
35 list_for_each_entry(phy, list, head) { in __usb_find_phy()
36 if (phy->type != type) in __usb_find_phy()
39 return phy; in __usb_find_phy()
53 if (phy_bind->phy) in __usb_find_phy_dev()
54 return phy_bind->phy; in __usb_find_phy_dev()
65 struct usb_phy *phy; in __of_usb_find_phy() local
70 list_for_each_entry(phy, &phy_list, head) { in __of_usb_find_phy()
71 if (node != phy->dev->of_node) in __of_usb_find_phy()
74 return phy; in __of_usb_find_phy()
82 struct usb_phy *phy = *(struct usb_phy **)res; in devm_usb_phy_release() local
84 usb_put_phy(phy); in devm_usb_phy_release()
92 usb_unregister_notifier(res->phy, res->nb); in devm_usb_phy_release2()
93 usb_put_phy(res->phy); in devm_usb_phy_release2()
98 struct usb_phy **phy = res; in devm_usb_phy_match() local
100 return *phy == match_data; in devm_usb_phy_match()
116 struct usb_phy **ptr, *phy; in devm_usb_get_phy() local
122 phy = usb_get_phy(type); in devm_usb_get_phy()
123 if (!IS_ERR(phy)) { in devm_usb_get_phy()
124 *ptr = phy; in devm_usb_get_phy()
129 return phy; in devm_usb_get_phy()
145 struct usb_phy *phy = NULL; in usb_get_phy() local
150 phy = __usb_find_phy(&phy_list, type); in usb_get_phy()
151 if (IS_ERR(phy) || !try_module_get(phy->dev->driver->owner)) { in usb_get_phy()
154 if (!IS_ERR(phy)) in usb_get_phy()
155 phy = ERR_PTR(-ENODEV); in usb_get_phy()
160 get_device(phy->dev); in usb_get_phy()
165 return phy; in usb_get_phy()
189 struct usb_phy *phy = ERR_PTR(-ENOMEM); in devm_usb_get_phy_by_node() local
201 phy = __of_usb_find_phy(node); in devm_usb_get_phy_by_node()
202 if (IS_ERR(phy)) { in devm_usb_get_phy_by_node()
207 if (!try_module_get(phy->dev->driver->owner)) { in devm_usb_get_phy_by_node()
208 phy = ERR_PTR(-ENODEV); in devm_usb_get_phy_by_node()
213 usb_register_notifier(phy, nb); in devm_usb_get_phy_by_node()
214 ptr->phy = phy; in devm_usb_get_phy_by_node()
218 get_device(phy->dev); in devm_usb_get_phy_by_node()
225 return phy; in devm_usb_get_phy_by_node()
248 struct usb_phy *phy; in devm_usb_get_phy_by_phandle() local
261 phy = devm_usb_get_phy_by_node(dev, node, NULL); in devm_usb_get_phy_by_phandle()
263 return phy; in devm_usb_get_phy_by_phandle()
280 struct usb_phy *phy = NULL; in usb_get_phy_dev() local
285 phy = __usb_find_phy_dev(dev, &phy_bind_list, index); in usb_get_phy_dev()
286 if (IS_ERR(phy) || !try_module_get(phy->dev->driver->owner)) { in usb_get_phy_dev()
288 if (!IS_ERR(phy)) in usb_get_phy_dev()
289 phy = ERR_PTR(-ENODEV); in usb_get_phy_dev()
294 get_device(phy->dev); in usb_get_phy_dev()
299 return phy; in usb_get_phy_dev()
316 struct usb_phy **ptr, *phy; in devm_usb_get_phy_dev() local
322 phy = usb_get_phy_dev(dev, index); in devm_usb_get_phy_dev()
323 if (!IS_ERR(phy)) { in devm_usb_get_phy_dev()
324 *ptr = phy; in devm_usb_get_phy_dev()
329 return phy; in devm_usb_get_phy_dev()
343 void devm_usb_put_phy(struct device *dev, struct usb_phy *phy) in devm_usb_put_phy() argument
347 r = devres_destroy(dev, devm_usb_phy_release, devm_usb_phy_match, phy); in devm_usb_put_phy()
384 struct usb_phy *phy; in usb_add_phy() local
395 list_for_each_entry(phy, &phy_list, head) { in usb_add_phy()
396 if (phy->type == type) { in usb_add_phy()
436 phy_bind->phy = x; in usb_add_phy_dev()
459 if (phy_bind->phy == x) in usb_remove_phy()
460 phy_bind->phy = NULL; in usb_remove_phy()