Lines Matching defs:phy
33 struct usb_phy phy;
98 if (!gpio_vbus->phy.otg->gadget)
114 gpio_vbus->phy.otg->state = OTG_STATE_B_PERIPHERAL;
115 gpio_vbus->phy.last_event = status;
116 usb_gadget_vbus_connect(gpio_vbus->phy.otg->gadget);
125 atomic_notifier_call_chain(&gpio_vbus->phy.notifier,
126 status, gpio_vbus->phy.otg->gadget);
127 usb_phy_set_event(&gpio_vbus->phy, USB_EVENT_ENUMERATED);
135 usb_gadget_vbus_disconnect(gpio_vbus->phy.otg->gadget);
137 gpio_vbus->phy.otg->state = OTG_STATE_B_IDLE;
138 gpio_vbus->phy.last_event = status;
140 atomic_notifier_call_chain(&gpio_vbus->phy.notifier,
141 status, gpio_vbus->phy.otg->gadget);
142 usb_phy_set_event(&gpio_vbus->phy, USB_EVENT_NONE);
151 struct usb_otg *otg = gpio_vbus->phy.otg;
172 gpio_vbus = container_of(otg->usb_phy, struct gpio_vbus_data, phy);
202 static int gpio_vbus_set_power(struct usb_phy *phy, unsigned mA)
206 gpio_vbus = container_of(phy, struct gpio_vbus_data, phy);
208 if (phy->otg->state == OTG_STATE_B_PERIPHERAL)
214 static int gpio_vbus_set_suspend(struct usb_phy *phy, int suspend)
218 gpio_vbus = container_of(phy, struct gpio_vbus_data, phy);
226 return gpio_vbus_set_power(phy, suspend ? 0 : gpio_vbus->mA);
244 gpio_vbus->phy.otg = devm_kzalloc(&pdev->dev, sizeof(struct usb_otg),
246 if (!gpio_vbus->phy.otg)
251 gpio_vbus->phy.label = "gpio-vbus";
252 gpio_vbus->phy.dev = gpio_vbus->dev;
253 gpio_vbus->phy.set_power = gpio_vbus_set_power;
254 gpio_vbus->phy.set_suspend = gpio_vbus_set_suspend;
256 gpio_vbus->phy.otg->state = OTG_STATE_UNDEFINED;
257 gpio_vbus->phy.otg->usb_phy = &gpio_vbus->phy;
258 gpio_vbus->phy.otg->set_peripheral = gpio_vbus_set_peripheral;
316 err = usb_add_phy(&gpio_vbus->phy, USB_PHY_TYPE_USB2);
335 usb_remove_phy(&gpio_vbus->phy);