/Linux-v4.19/include/linux/usb/ |
D | otg.h | 28 int (*set_host)(struct usb_otg *otg, struct usb_bus *host); 31 int (*set_peripheral)(struct usb_otg *otg, 35 int (*set_vbus)(struct usb_otg *otg, bool enabled); 38 int (*start_srp)(struct usb_otg *otg); 41 int (*start_hnp)(struct usb_otg *otg); 64 otg_start_hnp(struct usb_otg *otg) in otg_start_hnp() argument 66 if (otg && otg->start_hnp) in otg_start_hnp() 67 return otg->start_hnp(otg); in otg_start_hnp() 74 otg_set_vbus(struct usb_otg *otg, bool enabled) in otg_set_vbus() argument 76 if (otg && otg->set_vbus) in otg_set_vbus() [all …]
|
/Linux-v4.19/drivers/usb/phy/ |
D | phy-isp1301-omap.c | 224 return usb_otg_state_string(isp->phy.otg->state); in state_name() 239 isp->phy.otg->state = OTG_STATE_UNDEFINED; in power_down() 268 if (!isp->phy.otg->host) in host_suspend() 274 dev = isp->phy.otg->host->controller; in host_suspend() 286 if (!isp->phy.otg->host) in host_resume() 289 dev = isp->phy.otg->host->controller; in host_resume() 296 isp->phy.otg->gadget->b_hnp_enable = 0; in gadget_suspend() 297 isp->phy.otg->gadget->a_hnp_support = 0; in gadget_suspend() 298 isp->phy.otg->gadget->a_alt_hnp_support = 0; in gadget_suspend() 299 return usb_gadget_vbus_disconnect(isp->phy.otg->gadget); in gadget_suspend() [all …]
|
D | phy-tahvo.c | 77 switch (tu->phy.otg->state) { in check_vbus_state() 80 if (tu->phy.otg->gadget) in check_vbus_state() 81 usb_gadget_vbus_connect(tu->phy.otg->gadget); in check_vbus_state() 82 tu->phy.otg->state = OTG_STATE_B_PERIPHERAL; in check_vbus_state() 90 tu->phy.otg->state = OTG_STATE_A_HOST; in check_vbus_state() 97 switch (tu->phy.otg->state) { in check_vbus_state() 99 if (tu->phy.otg->gadget) in check_vbus_state() 100 usb_gadget_vbus_disconnect(tu->phy.otg->gadget); in check_vbus_state() 101 tu->phy.otg->state = OTG_STATE_B_IDLE; in check_vbus_state() 105 tu->phy.otg->state = OTG_STATE_A_IDLE; in check_vbus_state() [all …]
|
D | phy-mv-usb.c | 51 static int mv_otg_set_vbus(struct usb_otg *otg, bool on) in mv_otg_set_vbus() argument 53 struct mv_otg *mvotg = container_of(otg->usb_phy, struct mv_otg, phy); in mv_otg_set_vbus() 60 static int mv_otg_set_host(struct usb_otg *otg, in mv_otg_set_host() argument 63 otg->host = host; in mv_otg_set_host() 68 static int mv_otg_set_peripheral(struct usb_otg *otg, in mv_otg_set_peripheral() argument 71 otg->gadget = gadget; in mv_otg_set_peripheral() 196 struct usb_otg *otg = mvotg->phy.otg; in mv_otg_start_host() local 199 if (!otg->host) in mv_otg_start_host() 204 hcd = bus_to_hcd(otg->host); in mv_otg_start_host() 217 struct usb_otg *otg = mvotg->phy.otg; in mv_otg_start_periphrals() local [all …]
|
D | phy-generic.c | 105 struct usb_otg *otg = nop->phy.otg; in nop_gpio_vbus_thread() local 115 otg->state = OTG_STATE_B_PERIPHERAL; in nop_gpio_vbus_thread() 122 otg->gadget); in nop_gpio_vbus_thread() 127 otg->state = OTG_STATE_B_IDLE; in nop_gpio_vbus_thread() 131 otg->gadget); in nop_gpio_vbus_thread() 174 static int nop_set_peripheral(struct usb_otg *otg, struct usb_gadget *gadget) in nop_set_peripheral() argument 176 if (!otg) in nop_set_peripheral() 180 otg->gadget = NULL; in nop_set_peripheral() 184 otg->gadget = gadget; in nop_set_peripheral() 185 if (otg->state == OTG_STATE_B_PERIPHERAL) in nop_set_peripheral() [all …]
|
D | phy-gpio-vbus-usb.c | 104 if (!gpio_vbus->phy.otg->gadget) in gpio_vbus_work() 121 gpio_vbus->phy.otg->state = OTG_STATE_B_PERIPHERAL; in gpio_vbus_work() 123 usb_gadget_vbus_connect(gpio_vbus->phy.otg->gadget); in gpio_vbus_work() 133 status, gpio_vbus->phy.otg->gadget); in gpio_vbus_work() 142 usb_gadget_vbus_disconnect(gpio_vbus->phy.otg->gadget); in gpio_vbus_work() 144 gpio_vbus->phy.otg->state = OTG_STATE_B_IDLE; in gpio_vbus_work() 148 status, gpio_vbus->phy.otg->gadget); in gpio_vbus_work() 159 struct usb_otg *otg = gpio_vbus->phy.otg; in gpio_vbus_irq() local 163 otg->gadget ? otg->gadget->name : "none"); in gpio_vbus_irq() 165 if (otg->gadget) in gpio_vbus_irq() [all …]
|
D | phy-fsl-usb.c | 258 if ((fsl_otg_dev->phy.otg->state == OTG_STATE_B_SRP_INIT) && in b_srp_end() 271 if (!fsl_otg_dev->phy.otg->host->b_hnp_enable) in a_wait_enum() 459 struct usb_otg *otg = fsm->otg; in fsl_otg_start_host() local 462 container_of(otg->usb_phy, struct fsl_otg, phy); in fsl_otg_start_host() 465 if (!otg->host) in fsl_otg_start_host() 467 dev = otg->host->controller; in fsl_otg_start_host() 526 struct usb_otg *otg = fsm->otg; in fsl_otg_start_gadget() local 529 if (!otg->gadget || !otg->gadget->dev.parent) in fsl_otg_start_gadget() 533 dev = otg->gadget->dev.parent; in fsl_otg_start_gadget() 550 static int fsl_otg_set_host(struct usb_otg *otg, struct usb_bus *host) in fsl_otg_set_host() argument [all …]
|
D | phy-ulpi.c | 199 static int ulpi_set_host(struct usb_otg *otg, struct usb_bus *host) in ulpi_set_host() argument 201 struct usb_phy *phy = otg->usb_phy; in ulpi_set_host() 205 otg->host = NULL; in ulpi_set_host() 209 otg->host = host; in ulpi_set_host() 225 static int ulpi_set_vbus(struct usb_otg *otg, bool on) in ulpi_set_vbus() argument 227 struct usb_phy *phy = otg->usb_phy; in ulpi_set_vbus() 248 struct usb_otg *otg; in otg_ulpi_create() local 254 otg = kzalloc(sizeof(*otg), GFP_KERNEL); in otg_ulpi_create() 255 if (!otg) { in otg_ulpi_create() 263 phy->otg = otg; in otg_ulpi_create() [all …]
|
D | phy-ab8500-usb.c | 339 ab->phy.otg->default_a = false; in ab8505_usb_link_status_update() 347 ab->phy.otg->state = OTG_STATE_B_IDLE; in ab8505_usb_link_status_update() 378 ab->phy.otg->default_a = true; in ab8505_usb_link_status_update() 428 ab->phy.otg->default_a = false; in ab8500_usb_link_status_update() 433 ab->phy.otg->state = OTG_STATE_B_IDLE; in ab8500_usb_link_status_update() 467 ab->phy.otg->default_a = true; in ab8500_usb_link_status_update() 540 ab->phy.otg->default_a = false; in ab8500_usb_disconnect_irq() 555 ab->phy.otg->default_a = false; in ab8500_usb_disconnect_irq() 586 if (!ab->phy.otg->host) in ab8500_usb_phy_disable_work() 589 if (!ab->phy.otg->gadget) in ab8500_usb_phy_disable_work() [all …]
|
D | phy-ulpi-viewport.c | 35 static int ulpi_viewport_read(struct usb_phy *otg, u32 reg) in ulpi_viewport_read() argument 38 void __iomem *view = otg->io_priv; in ulpi_viewport_read() 53 static int ulpi_viewport_write(struct usb_phy *otg, u32 val, u32 reg) in ulpi_viewport_write() argument 56 void __iomem *view = otg->io_priv; in ulpi_viewport_write()
|
/Linux-v4.19/drivers/phy/samsung/ |
D | phy-exynos5250-usb2.c | 204 u32 otg; in exynos5250_power_on() local 217 otg = readl(drv->reg_phy + EXYNOS_5250_USBOTGSYS); in exynos5250_power_on() 219 otg &= ~EXYNOS_5250_USBOTGSYS_FSEL_MASK; in exynos5250_power_on() 220 otg |= drv->ref_reg_val << EXYNOS_5250_USBOTGSYS_FSEL_SHIFT; in exynos5250_power_on() 222 otg &= ~(EXYNOS_5250_USBOTGSYS_FORCE_SUSPEND | in exynos5250_power_on() 225 otg |= EXYNOS_5250_USBOTGSYS_PHY_SW_RST | in exynos5250_power_on() 230 otg &= ~EXYNOS_5250_USBOTGSYS_REFCLKSEL_MASK; in exynos5250_power_on() 231 otg |= EXYNOS_5250_REFCLKSEL_CLKCORE << in exynos5250_power_on() 233 writel(otg, drv->reg_phy + EXYNOS_5250_USBOTGSYS); in exynos5250_power_on() 235 otg &= ~(EXYNOS_5250_USBOTGSYS_PHY_SW_RST | in exynos5250_power_on() [all …]
|
/Linux-v4.19/Documentation/devicetree/bindings/phy/ |
D | phy-rockchip-inno-usb2.txt | 28 The sub-node name is used to identify host or otg port, 30 * "otg-port" : the name of otg port. 38 * "otg-id" : for the otg id interrupt. 39 * "otg-bvalid" : for the otg vbus interrupt. 40 * "linestate" : for the host/otg linestate interrupt. 42 * "otg-mux" : otg-port interrupt, which mux otg-id/otg-bvalid/linestate 64 u2phy_otg: otg-port { 69 interrupt-names = "otg-id", "otg-bvalid", "linestate";
|
/Linux-v4.19/drivers/phy/ti/ |
D | phy-omap-usb2.c | 63 static int omap_usb_set_vbus(struct usb_otg *otg, bool enabled) in omap_usb_set_vbus() argument 65 struct omap_usb *phy = phy_to_omapusb(otg->usb_phy); in omap_usb_set_vbus() 73 static int omap_usb_start_srp(struct usb_otg *otg) in omap_usb_start_srp() argument 75 struct omap_usb *phy = phy_to_omapusb(otg->usb_phy); in omap_usb_start_srp() 83 static int omap_usb_set_host(struct usb_otg *otg, struct usb_bus *host) in omap_usb_set_host() argument 85 otg->host = host; in omap_usb_set_host() 87 otg->state = OTG_STATE_UNDEFINED; in omap_usb_set_host() 92 static int omap_usb_set_peripheral(struct usb_otg *otg, in omap_usb_set_peripheral() argument 95 otg->gadget = gadget; in omap_usb_set_peripheral() 97 otg->state = OTG_STATE_UNDEFINED; in omap_usb_set_peripheral() [all …]
|
D | phy-dm816x-usb.c | 62 static int dm816x_usb_phy_set_host(struct usb_otg *otg, struct usb_bus *host) in dm816x_usb_phy_set_host() argument 64 otg->host = host; in dm816x_usb_phy_set_host() 66 otg->state = OTG_STATE_UNDEFINED; in dm816x_usb_phy_set_host() 71 static int dm816x_usb_phy_set_peripheral(struct usb_otg *otg, in dm816x_usb_phy_set_peripheral() argument 74 otg->gadget = gadget; in dm816x_usb_phy_set_peripheral() 76 otg->state = OTG_STATE_UNDEFINED; in dm816x_usb_phy_set_peripheral() 190 struct usb_otg *otg; in dm816x_usb_phy_probe() local 225 otg = devm_kzalloc(&pdev->dev, sizeof(*otg), GFP_KERNEL); in dm816x_usb_phy_probe() 226 if (!otg) in dm816x_usb_phy_probe() 232 phy->phy.otg = otg; in dm816x_usb_phy_probe() [all …]
|
D | phy-twl4030-usb.c | 623 static int twl4030_set_peripheral(struct usb_otg *otg, in twl4030_set_peripheral() argument 626 if (!otg) in twl4030_set_peripheral() 629 otg->gadget = gadget; in twl4030_set_peripheral() 631 otg->state = OTG_STATE_UNDEFINED; in twl4030_set_peripheral() 636 static int twl4030_set_host(struct usb_otg *otg, struct usb_bus *host) in twl4030_set_host() argument 638 if (!otg) in twl4030_set_host() 641 otg->host = host; in twl4030_set_host() 643 otg->state = OTG_STATE_UNDEFINED; in twl4030_set_host() 666 struct usb_otg *otg; in twl4030_usb_probe() local 684 otg = devm_kzalloc(&pdev->dev, sizeof(*otg), GFP_KERNEL); in twl4030_usb_probe() [all …]
|
/Linux-v4.19/arch/arm/mach-pxa/ |
D | pxa3xx-ulpi.c | 36 struct usb_phy *otg; member 82 static int pxa310_ulpi_read(struct usb_phy *otg, u32 reg) in pxa310_ulpi_read() argument 101 static int pxa310_ulpi_write(struct usb_phy *otg, u32 val, u32 reg) in pxa310_ulpi_write() argument 142 err = usb_phy_init(u2d->otg); in pxa310_start_otg_host_transcvr() 148 err = otg_set_vbus(u2d->otg->otg, 1); in pxa310_start_otg_host_transcvr() 154 err = otg_set_host(u2d->otg->otg, host); in pxa310_start_otg_host_transcvr() 192 otg_set_host(u2d->otg->otg, NULL); in pxa310_stop_otg_hc() 193 otg_set_vbus(u2d->otg->otg, 0); in pxa310_stop_otg_hc() 194 usb_phy_shutdown(u2d->otg); in pxa310_stop_otg_hc() 224 u2d->otg = otg_ulpi_create(&pxa310_ulpi_access_ops, ulpi_mode); in pxa310_otg_init() [all …]
|
/Linux-v4.19/drivers/usb/musb/ |
D | musb_virthub.c | 46 musb->xceiv->otg->state = OTG_STATE_A_HOST; in musb_host_finish_resume() 53 struct usb_otg *otg = musb->xceiv->otg; in musb_port_suspend() local 88 switch (musb->xceiv->otg->state) { in musb_port_suspend() 90 musb->xceiv->otg->state = OTG_STATE_A_SUSPEND; in musb_port_suspend() 91 musb->is_active = otg->host->b_hnp_enable; in musb_port_suspend() 99 musb->xceiv->otg->state = OTG_STATE_B_WAIT_ACON; in musb_port_suspend() 100 musb->is_active = otg->host->b_hnp_enable; in musb_port_suspend() 105 usb_otg_state_string(musb->xceiv->otg->state)); in musb_port_suspend() 126 if (musb->xceiv->otg->state == OTG_STATE_B_IDLE) { in musb_port_reset() 199 struct usb_otg *otg = musb->xceiv->otg; in musb_root_disconnect() local [all …]
|
D | tusb6010.c | 340 if (x->otg->default_a || mA < (musb->min_power << 1)) in tusb_draw_power() 459 switch (musb->xceiv->otg->state) { in musb_do_idle() 465 usb_otg_state_string(musb->xceiv->otg->state)); in musb_do_idle() 518 && (musb->xceiv->otg->state == OTG_STATE_A_WAIT_BCON))) { in tusb_musb_try_idle() 520 usb_otg_state_string(musb->xceiv->otg->state)); in tusb_musb_try_idle() 537 usb_otg_state_string(musb->xceiv->otg->state), in tusb_musb_try_idle() 554 struct usb_otg *otg = musb->xceiv->otg; in tusb_musb_set_vbus() local 567 otg->default_a = 1; in tusb_musb_set_vbus() 568 musb->xceiv->otg->state = OTG_STATE_A_WAIT_VRISE; in tusb_musb_set_vbus() 581 switch (musb->xceiv->otg->state) { in tusb_musb_set_vbus() [all …]
|
D | am35x.c | 133 usb_otg_state_string(musb->xceiv->otg->state)); in otg_timer() 136 switch (musb->xceiv->otg->state) { in otg_timer() 143 musb->xceiv->otg->state = OTG_STATE_B_IDLE; in otg_timer() 146 musb->xceiv->otg->state = OTG_STATE_A_IDLE; in otg_timer() 151 musb->xceiv->otg->state = OTG_STATE_A_WAIT_VRISE; in otg_timer() 160 musb->xceiv->otg->state = OTG_STATE_A_IDLE; in otg_timer() 177 musb->xceiv->otg->state == OTG_STATE_A_WAIT_BCON)) { in am35x_musb_try_idle() 179 usb_otg_state_string(musb->xceiv->otg->state)); in am35x_musb_try_idle() 192 usb_otg_state_string(musb->xceiv->otg->state), in am35x_musb_try_idle() 261 musb->xceiv->otg->state = OTG_STATE_A_WAIT_VFALL; in am35x_musb_interrupt() [all …]
|
D | da8xx.c | 135 usb_otg_state_string(musb->xceiv->otg->state)); in otg_timer() 138 switch (musb->xceiv->otg->state) { in otg_timer() 145 musb->xceiv->otg->state = OTG_STATE_B_IDLE; in otg_timer() 148 musb->xceiv->otg->state = OTG_STATE_A_IDLE; in otg_timer() 163 musb->xceiv->otg->state = OTG_STATE_A_WAIT_VRISE; in otg_timer() 185 musb->xceiv->otg->state = OTG_STATE_A_IDLE; in otg_timer() 202 musb->xceiv->otg->state == OTG_STATE_A_WAIT_BCON)) { in da8xx_musb_try_idle() 204 usb_otg_state_string(musb->xceiv->otg->state)); in da8xx_musb_try_idle() 217 usb_otg_state_string(musb->xceiv->otg->state), in da8xx_musb_try_idle() 277 musb->xceiv->otg->state = OTG_STATE_A_WAIT_VFALL; in da8xx_musb_interrupt() [all …]
|
/Linux-v4.19/drivers/usb/common/ |
D | usb-otg-fsm.c | 74 if (fsm->otg->gadget) in otg_leave_state() 75 fsm->otg->gadget->host_request_flag = 0; in otg_leave_state() 105 if (fsm->otg->gadget) in otg_leave_state() 106 fsm->otg->gadget->host_request_flag = 0; in otg_leave_state() 125 enum usb_otg_state state = fsm->otg->state; in otg_hnp_polling_work() 132 udev = usb_hub_find_child(fsm->otg->host->root_hub, 1); in otg_hnp_polling_work() 134 dev_err(fsm->otg->host->controller, in otg_hnp_polling_work() 169 if (!fsm->otg->host->b_hnp_enable) { in otg_hnp_polling_work() 177 fsm->otg->host->b_hnp_enable = 1; in otg_hnp_polling_work() 204 if (fsm->otg->state == new_state) in otg_set_state() [all …]
|
/Linux-v4.19/drivers/usb/host/ |
D | ehci-mv.c | 28 struct usb_phy *otg; member 207 ehci_mv->otg = devm_usb_get_phy(&pdev->dev, USB_PHY_TYPE_USB2); in mv_ehci_probe() 208 if (IS_ERR(ehci_mv->otg)) { in mv_ehci_probe() 209 retval = PTR_ERR(ehci_mv->otg); in mv_ehci_probe() 220 retval = otg_set_host(ehci_mv->otg->otg, &hcd->self); in mv_ehci_probe() 271 if (!IS_ERR_OR_NULL(ehci_mv->otg)) in mv_ehci_remove() 272 otg_set_host(ehci_mv->otg->otg, NULL); in mv_ehci_remove()
|
D | ehci-mxc.c | 117 if (pdata->otg) { in ehci_mxc_drv_probe() 118 pdata->otg->io_priv = hcd->regs + ULPI_VIEWPORT_OFFSET; in ehci_mxc_drv_probe() 119 ret = usb_phy_init(pdata->otg); in ehci_mxc_drv_probe() 125 ret = otg_set_vbus(pdata->otg->otg, 1); in ehci_mxc_drv_probe() 168 if (pdata && pdata->otg) in ehci_mxc_drv_remove() 169 usb_phy_shutdown(pdata->otg); in ehci_mxc_drv_remove()
|
/Linux-v4.19/drivers/phy/motorola/ |
D | phy-cpcap-usb.c | 152 static int cpcap_usb_phy_set_host(struct usb_otg *otg, struct usb_bus *host) in cpcap_usb_phy_set_host() argument 154 otg->host = host; in cpcap_usb_phy_set_host() 156 otg->state = OTG_STATE_UNDEFINED; in cpcap_usb_phy_set_host() 161 static int cpcap_usb_phy_set_peripheral(struct usb_otg *otg, in cpcap_usb_phy_set_peripheral() argument 164 otg->gadget = gadget; in cpcap_usb_phy_set_peripheral() 166 otg->state = OTG_STATE_UNDEFINED; in cpcap_usb_phy_set_peripheral() 566 struct usb_otg *otg; in cpcap_usb_phy_probe() local 583 otg = devm_kzalloc(&pdev->dev, sizeof(*otg), GFP_KERNEL); in cpcap_usb_phy_probe() 584 if (!otg) in cpcap_usb_phy_probe() 590 ddata->phy.otg = otg; in cpcap_usb_phy_probe() [all …]
|
/Linux-v4.19/drivers/power/supply/ |
D | axp288_charger.c | 134 } otg; member 408 if (info->otg.id_short) { in axp288_charger_usb_get_property() 419 if (info->otg.id_short) { in axp288_charger_usb_get_property() 615 container_of(work, struct axp288_chrg_info, otg.work); in axp288_charger_otg_evt_worker() 616 struct extcon_dev *edev = info->otg.cable; in axp288_charger_otg_evt_worker() 626 info->otg.id_short = usb_host; in axp288_charger_otg_evt_worker() 629 ret = axp288_charger_vbus_path_select(info, !info->otg.id_short); in axp288_charger_otg_evt_worker() 638 container_of(nb, struct axp288_chrg_info, otg.id_nb); in axp288_charger_handle_otg_evt() 640 schedule_work(&info->otg.work); in axp288_charger_handle_otg_evt() 739 cancel_work_sync(&info->otg.work); in axp288_charger_cancel_work() [all …]
|