/openbmc/linux/include/linux/usb/ |
H A 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 …]
|
/openbmc/linux/drivers/usb/phy/ |
H A 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 …]
|
H A D | phy-mv-usb.c | 52 static int mv_otg_set_vbus(struct usb_otg *otg, bool on) in mv_otg_set_vbus() argument 54 struct mv_otg *mvotg = container_of(otg->usb_phy, struct mv_otg, phy); in mv_otg_set_vbus() 61 static int mv_otg_set_host(struct usb_otg *otg, in mv_otg_set_host() argument 64 otg->host = host; in mv_otg_set_host() 69 static int mv_otg_set_peripheral(struct usb_otg *otg, in mv_otg_set_peripheral() argument 72 otg->gadget = gadget; in mv_otg_set_peripheral() 194 struct usb_otg *otg = mvotg->phy.otg; in mv_otg_start_host() local 197 if (!otg->host) in mv_otg_start_host() 202 hcd = bus_to_hcd(otg->host); in mv_otg_start_host() 215 struct usb_otg *otg = mvotg->phy.otg; in mv_otg_start_periphrals() local [all …]
|
H A 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 …]
|
H A 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() 243 static void otg_ulpi_init(struct usb_phy *phy, struct usb_otg *otg, in otg_ulpi_init() argument 250 phy->otg = otg; in otg_ulpi_init() 253 otg->usb_phy = phy; in otg_ulpi_init() 254 otg->set_host = ulpi_set_host; in otg_ulpi_init() [all …]
|
H A D | phy-generic.c | 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() 121 otg->gadget); in nop_gpio_vbus_thread() 126 otg->state = OTG_STATE_B_IDLE; in nop_gpio_vbus_thread() 130 otg->gadget); in nop_gpio_vbus_thread() 173 static int nop_set_peripheral(struct usb_otg *otg, struct usb_gadget *gadget) in nop_set_peripheral() argument 175 if (!otg) in nop_set_peripheral() 179 otg->gadget = NULL; in nop_set_peripheral() 183 otg->gadget = gadget; in nop_set_peripheral() 184 if (otg->state == OTG_STATE_B_PERIPHERAL) in nop_set_peripheral() [all …]
|
H A D | phy-gpio-vbus-usb.c | 98 if (!gpio_vbus->phy.otg->gadget) in gpio_vbus_work() 114 gpio_vbus->phy.otg->state = OTG_STATE_B_PERIPHERAL; in gpio_vbus_work() 116 usb_gadget_vbus_connect(gpio_vbus->phy.otg->gadget); in gpio_vbus_work() 126 status, gpio_vbus->phy.otg->gadget); in gpio_vbus_work() 135 usb_gadget_vbus_disconnect(gpio_vbus->phy.otg->gadget); in gpio_vbus_work() 137 gpio_vbus->phy.otg->state = OTG_STATE_B_IDLE; in gpio_vbus_work() 141 status, gpio_vbus->phy.otg->gadget); in gpio_vbus_work() 151 struct usb_otg *otg = gpio_vbus->phy.otg; in gpio_vbus_irq() local 155 otg->gadget ? otg->gadget->name : "none"); in gpio_vbus_irq() 157 if (otg->gadget) in gpio_vbus_irq() [all …]
|
H A D | phy-ab8500-usb.c | 341 ab->phy.otg->default_a = false; in ab8505_usb_link_status_update() 349 ab->phy.otg->state = OTG_STATE_B_IDLE; in ab8505_usb_link_status_update() 382 ab->phy.otg->default_a = true; in ab8505_usb_link_status_update() 451 ab->phy.otg->default_a = false; in ab8500_usb_link_status_update() 456 ab->phy.otg->state = OTG_STATE_B_IDLE; in ab8500_usb_link_status_update() 492 ab->phy.otg->default_a = true; in ab8500_usb_link_status_update() 569 ab->phy.otg->default_a = false; in ab8500_usb_disconnect_irq() 584 ab->phy.otg->default_a = false; in ab8500_usb_disconnect_irq() 620 if (!ab->phy.otg->host) in ab8500_usb_phy_disable_work() 623 if (!ab->phy.otg->gadget) in ab8500_usb_phy_disable_work() [all …]
|
H A D | phy-ulpi-viewport.c | 29 static int ulpi_viewport_read(struct usb_phy *otg, u32 reg) in ulpi_viewport_read() argument 32 void __iomem *view = otg->io_priv; in ulpi_viewport_read() 47 static int ulpi_viewport_write(struct usb_phy *otg, u32 val, u32 reg) in ulpi_viewport_write() argument 50 void __iomem *view = otg->io_priv; in ulpi_viewport_write()
|
/openbmc/linux/drivers/phy/samsung/ |
H A D | phy-exynos5250-usb2.c | 199 u32 otg; in exynos5250_power_on() local 212 otg = readl(drv->reg_phy + EXYNOS_5250_USBOTGSYS); in exynos5250_power_on() 214 otg &= ~EXYNOS_5250_USBOTGSYS_FSEL_MASK; in exynos5250_power_on() 215 otg |= drv->ref_reg_val << EXYNOS_5250_USBOTGSYS_FSEL_SHIFT; in exynos5250_power_on() 217 otg &= ~(EXYNOS_5250_USBOTGSYS_FORCE_SUSPEND | in exynos5250_power_on() 220 otg |= EXYNOS_5250_USBOTGSYS_PHY_SW_RST | in exynos5250_power_on() 225 otg &= ~EXYNOS_5250_USBOTGSYS_REFCLKSEL_MASK; in exynos5250_power_on() 226 otg |= EXYNOS_5250_REFCLKSEL_CLKCORE << in exynos5250_power_on() 228 writel(otg, drv->reg_phy + EXYNOS_5250_USBOTGSYS); in exynos5250_power_on() 230 otg &= ~(EXYNOS_5250_USBOTGSYS_PHY_SW_RST | in exynos5250_power_on() [all …]
|
/openbmc/u-boot/drivers/usb/musb/ |
H A D | omap3.c | 44 static struct omap3_otg_regs *otg; variable 70 l = readl(&otg->revision); in musb_db_otg_regs() 72 l = readl(&otg->sysconfig); in musb_db_otg_regs() 74 l = readl(&otg->sysstatus); in musb_db_otg_regs() 76 l = readl(&otg->interfsel); in musb_db_otg_regs() 78 l = readl(&otg->forcestdby); in musb_db_otg_regs() 106 otg = (struct omap3_otg_regs *)OMAP3_OTG_BASE; in musb_platform_init() 110 OMAP3_OTG_SYSCONFIG_NO_IDLE_MODE, &otg->sysconfig); in musb_platform_init() 113 writel(OMAP3_OTG_INTERFSEL_OMAP, &otg->interfsel); in musb_platform_init() 116 stdby = readl(&otg->forcestdby); in musb_platform_init() [all …]
|
/openbmc/linux/drivers/phy/ti/ |
H A D | phy-dm816x-usb.c | 53 static int dm816x_usb_phy_set_host(struct usb_otg *otg, struct usb_bus *host) in dm816x_usb_phy_set_host() argument 55 otg->host = host; in dm816x_usb_phy_set_host() 57 otg->state = OTG_STATE_UNDEFINED; in dm816x_usb_phy_set_host() 62 static int dm816x_usb_phy_set_peripheral(struct usb_otg *otg, in dm816x_usb_phy_set_peripheral() argument 65 otg->gadget = gadget; in dm816x_usb_phy_set_peripheral() 67 otg->state = OTG_STATE_UNDEFINED; in dm816x_usb_phy_set_peripheral() 180 struct usb_otg *otg; in dm816x_usb_phy_probe() local 212 otg = devm_kzalloc(&pdev->dev, sizeof(*otg), GFP_KERNEL); in dm816x_usb_phy_probe() 213 if (!otg) in dm816x_usb_phy_probe() 219 phy->phy.otg = otg; in dm816x_usb_phy_probe() [all …]
|
H A D | phy-omap-usb2.c | 115 static int omap_usb_set_vbus(struct usb_otg *otg, bool enabled) in omap_usb_set_vbus() argument 117 struct omap_usb *phy = phy_to_omapusb(otg->usb_phy); in omap_usb_set_vbus() 125 static int omap_usb_start_srp(struct usb_otg *otg) in omap_usb_start_srp() argument 127 struct omap_usb *phy = phy_to_omapusb(otg->usb_phy); in omap_usb_start_srp() 135 static int omap_usb_set_host(struct usb_otg *otg, struct usb_bus *host) in omap_usb_set_host() argument 137 otg->host = host; in omap_usb_set_host() 139 otg->state = OTG_STATE_UNDEFINED; in omap_usb_set_host() 144 static int omap_usb_set_peripheral(struct usb_otg *otg, in omap_usb_set_peripheral() argument 147 otg->gadget = gadget; in omap_usb_set_peripheral() 149 otg->state = OTG_STATE_UNDEFINED; in omap_usb_set_peripheral() [all …]
|
H A D | phy-twl4030-usb.c | 645 static int twl4030_set_peripheral(struct usb_otg *otg, in twl4030_set_peripheral() argument 648 if (!otg) in twl4030_set_peripheral() 651 otg->gadget = gadget; in twl4030_set_peripheral() 653 otg->state = OTG_STATE_UNDEFINED; in twl4030_set_peripheral() 658 static int twl4030_set_host(struct usb_otg *otg, struct usb_bus *host) in twl4030_set_host() argument 660 if (!otg) in twl4030_set_host() 663 otg->host = host; in twl4030_set_host() 665 otg->state = OTG_STATE_UNDEFINED; in twl4030_set_host() 689 struct usb_otg *otg; in twl4030_usb_probe() local 707 otg = devm_kzalloc(&pdev->dev, sizeof(*otg), GFP_KERNEL); in twl4030_usb_probe() [all …]
|
/openbmc/linux/drivers/usb/common/ |
H A 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() 208 if (fsm->otg->state == new_state) in otg_set_state() [all …]
|
/openbmc/u-boot/drivers/usb/host/ |
H A D | ehci-faraday.c | 23 struct fotg210_regs otg; member 43 spd = OTGCSR_SPD(readl(®s->otg.otgcsr)); in faraday_ehci_get_port_speed() 106 setbits_le32(®s->otg.otgcsr, OTGCSR_A_BUSDROP); in ehci_hcd_init() 108 clrbits_le32(®s->otg.otgcsr, OTGCSR_A_BUSREQ); in ehci_hcd_init() 111 clrbits_le32(®s->otg.otgcsr, OTGCSR_A_BUSDROP); in ehci_hcd_init() 113 setbits_le32(®s->otg.otgcsr, OTGCSR_A_BUSREQ); in ehci_hcd_init() 116 writel(IMR_IRQLH | IMR_OTG | IMR_DEV, ®s->otg.imr); in ehci_hcd_init() 118 writel(ISR_HOST | ISR_OTG | ISR_DEV, ®s->otg.isr); in ehci_hcd_init()
|
H A D | ohci-lpc32xx.c | 82 static struct otg_regs *otg = (struct otg_regs *)USB_BASE; variable 179 writel(OTG_CLK_I2C_EN, &otg->otg_clk_ctrl); in usb_cpu_init() 180 ret = wait_for_bit_le32(&otg->otg_clk_sts, OTG_CLK_I2C_EN, true, in usb_cpu_init() 199 writel(mask, &otg->otg_clk_ctrl); in usb_cpu_init() 201 ret = wait_for_bit_le32(&otg->otg_clk_sts, mask, true, in usb_cpu_init() 206 setbits_le32(&otg->otg_sts_ctrl, OTG_HOST_EN); in usb_cpu_init() 228 clrbits_le32(&otg->otg_sts_ctrl, OTG_HOST_EN); in usb_cpu_stop()
|
/openbmc/linux/drivers/usb/musb/ |
H A D | tusb6010.c | 346 if (x->otg->default_a || mA < (musb->min_power << 1)) in tusb_draw_power() 465 switch (musb->xceiv->otg->state) { in musb_do_idle() 471 usb_otg_state_string(musb->xceiv->otg->state)); in musb_do_idle() 525 && (musb->xceiv->otg->state == OTG_STATE_A_WAIT_BCON))) { in tusb_musb_try_idle() 527 usb_otg_state_string(musb->xceiv->otg->state)); in tusb_musb_try_idle() 544 usb_otg_state_string(musb->xceiv->otg->state), in tusb_musb_try_idle() 561 struct usb_otg *otg = musb->xceiv->otg; in tusb_musb_set_vbus() local 574 otg->default_a = 1; in tusb_musb_set_vbus() 575 musb->xceiv->otg->state = OTG_STATE_A_WAIT_VRISE; in tusb_musb_set_vbus() 588 switch (musb->xceiv->otg->state) { in tusb_musb_set_vbus() [all …]
|
H A 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 …]
|
/openbmc/linux/drivers/power/supply/ |
H A D | axp288_charger.c | 132 } otg; member 426 if (info->otg.id_short) { in axp288_charger_usb_get_property() 434 if (info->otg.id_short) { in axp288_charger_usb_get_property() 687 container_of(work, struct axp288_chrg_info, otg.work); in axp288_charger_otg_evt_worker() 688 struct extcon_dev *edev = info->otg.cable; in axp288_charger_otg_evt_worker() 698 info->otg.id_short = usb_host; in axp288_charger_otg_evt_worker() 701 ret = axp288_charger_vbus_path_select(info, !info->otg.id_short); in axp288_charger_otg_evt_worker() 710 container_of(nb, struct axp288_chrg_info, otg.id_nb); in axp288_charger_handle_otg_evt() 712 schedule_work(&info->otg.work); in axp288_charger_handle_otg_evt() 828 cancel_work_sync(&info->otg.work); in axp288_charger_cancel_work() [all …]
|
/openbmc/linux/drivers/usb/host/ |
H A D | ehci-mv.c | 37 struct usb_phy *otg; member 176 ehci_mv->otg = devm_usb_get_phy(&pdev->dev, USB_PHY_TYPE_USB2); in mv_ehci_probe() 177 if (IS_ERR(ehci_mv->otg)) { in mv_ehci_probe() 178 retval = PTR_ERR(ehci_mv->otg); in mv_ehci_probe() 189 retval = otg_set_host(ehci_mv->otg->otg, &hcd->self); in mv_ehci_probe() 245 if (!IS_ERR_OR_NULL(ehci_mv->otg)) in mv_ehci_remove() 246 otg_set_host(ehci_mv->otg->otg, NULL); in mv_ehci_remove()
|
H A D | ohci-omap.c | 77 otg_start_hnp(hcd->usb_phy->otg); in start_hnp() 80 hcd->usb_phy->otg->state = OTG_STATE_A_SUSPEND; in start_hnp() 95 int need_transceiver = (config->otg != 0); in ohci_omap_reset() 100 if (config->otg) { in ohci_omap_reset() 101 hcd->self.otg_port = config->otg; in ohci_omap_reset() 113 int status = otg_set_host(hcd->usb_phy->otg, in ohci_omap_reset() 137 if (config->otg || config->rwc) { in ohci_omap_reset() 333 (void) otg_set_host(hcd->usb_phy->otg, 0); in ohci_hcd_omap_remove()
|
/openbmc/linux/drivers/phy/motorola/ |
H A D | phy-cpcap-usb.c | 145 static int cpcap_usb_phy_set_host(struct usb_otg *otg, struct usb_bus *host) in cpcap_usb_phy_set_host() argument 147 otg->host = host; in cpcap_usb_phy_set_host() 149 otg->state = OTG_STATE_UNDEFINED; in cpcap_usb_phy_set_host() 154 static int cpcap_usb_phy_set_peripheral(struct usb_otg *otg, in cpcap_usb_phy_set_peripheral() argument 157 otg->gadget = gadget; in cpcap_usb_phy_set_peripheral() 159 otg->state = OTG_STATE_UNDEFINED; in cpcap_usb_phy_set_peripheral() 614 struct usb_otg *otg; in cpcap_usb_phy_probe() local 631 otg = devm_kzalloc(&pdev->dev, sizeof(*otg), GFP_KERNEL); in cpcap_usb_phy_probe() 632 if (!otg) in cpcap_usb_phy_probe() 638 ddata->phy.otg = otg; in cpcap_usb_phy_probe() [all …]
|
/openbmc/linux/drivers/usb/chipidea/ |
H A D | otg_fsm.c | 66 if (ci->fsm.otg->state == OTG_STATE_A_PERIPHERAL) { in a_bus_req_store() 150 if (ci->fsm.otg->state == OTG_STATE_B_PERIPHERAL) { in b_bus_req_store() 355 if (ci->fsm.otg->state == OTG_STATE_B_IDLE) in b_ssend_srp_tmout() 523 if (!fsm->otg->host) in ci_otg_loc_sof() 526 udev = usb_hub_find_child(fsm->otg->host->root_hub, 1); in ci_otg_loc_sof() 597 ci->fsm.otg->state < OTG_STATE_A_IDLE) in ci_otg_fsm_work() 602 if (ci->fsm.otg->state == OTG_STATE_A_IDLE) { in ci_otg_fsm_work() 623 } else if (ci->fsm.otg->state == OTG_STATE_B_IDLE) { in ci_otg_fsm_work() 632 } else if (ci->fsm.otg->state == OTG_STATE_A_HOST) { in ci_otg_fsm_work() 655 switch (ci->fsm.otg->state) { in ci_otg_fsm_event() [all …]
|
/openbmc/linux/Documentation/devicetree/bindings/usb/ |
H A D | msm-hsusb.txt | 22 "qcom,usb-otg-ci" for chipsets with ChipIdea 45nm PHY 23 "qcom,usb-otg-snps" for chipsets with Synopsys 28nm PHY 48 - qcom,otg-control: OTG control (VBUS and ID notifications) can be one of 53 - dr_mode: One of "host", "peripheral" or "otg". Defaults to "otg" 90 compatible = "qcom,usb-otg-snps"; 107 qcom,otg-control = <1>;
|