Lines Matching full:otg
18 #include <linux/usb/otg.h>
78 static int nop_set_vbus(struct usb_otg *otg, bool enable) in nop_set_vbus() argument
81 struct usb_phy_generic *nop = dev_get_drvdata(otg->usb_phy->dev); in nop_set_vbus()
104 struct usb_otg *otg = nop->phy.otg; in nop_gpio_vbus_thread() local
114 otg->state = OTG_STATE_B_PERIPHERAL; in nop_gpio_vbus_thread()
118 otg->gadget); in nop_gpio_vbus_thread()
121 otg->state = OTG_STATE_B_IDLE; in nop_gpio_vbus_thread()
125 otg->gadget); in nop_gpio_vbus_thread()
168 static int nop_set_peripheral(struct usb_otg *otg, struct usb_gadget *gadget) in nop_set_peripheral() argument
170 if (!otg) in nop_set_peripheral()
174 otg->gadget = NULL; in nop_set_peripheral()
178 otg->gadget = gadget; in nop_set_peripheral()
179 if (otg->state == OTG_STATE_B_PERIPHERAL) in nop_set_peripheral()
180 atomic_notifier_call_chain(&otg->usb_phy->notifier, in nop_set_peripheral()
181 USB_EVENT_VBUS, otg->gadget); in nop_set_peripheral()
183 otg->state = OTG_STATE_B_IDLE; in nop_set_peripheral()
187 static int nop_set_host(struct usb_otg *otg, struct usb_bus *host) in nop_set_host() argument
189 if (!otg) in nop_set_host()
193 otg->host = NULL; in nop_set_host()
197 otg->host = host; in nop_set_host()
233 nop->phy.otg = devm_kzalloc(dev, sizeof(*nop->phy.otg), in usb_phy_gen_create_phy()
235 if (!nop->phy.otg) in usb_phy_gen_create_phy()
272 nop->phy.otg->state = OTG_STATE_UNDEFINED; in usb_phy_gen_create_phy()
273 nop->phy.otg->usb_phy = &nop->phy; in usb_phy_gen_create_phy()
274 nop->phy.otg->set_host = nop_set_host; in usb_phy_gen_create_phy()
275 nop->phy.otg->set_peripheral = nop_set_peripheral; in usb_phy_gen_create_phy()
276 nop->phy.otg->set_vbus = nop_set_vbus; in usb_phy_gen_create_phy()
307 nop->phy.otg->state = gpiod_get_value(nop->gpiod_vbus) ? in usb_phy_generic_probe()