aboutsummaryrefslogtreecommitdiff
path: root/drivers/usb
diff options
context:
space:
mode:
Diffstat (limited to 'drivers/usb')
-rw-r--r--drivers/usb/gadget/Makefile17
-rw-r--r--drivers/usb/gadget/f_fastboot.c1
-rw-r--r--drivers/usb/host/ehci-generic.c6
-rw-r--r--drivers/usb/host/ehci-hcd.c66
-rw-r--r--drivers/usb/host/ehci-msm.c4
-rw-r--r--drivers/usb/host/ehci-mx6.c6
-rw-r--r--drivers/usb/host/ehci-pci.c4
-rw-r--r--drivers/usb/host/ehci.h4
-rw-r--r--drivers/usb/host/ohci-generic.c56
9 files changed, 21 insertions, 143 deletions
diff --git a/drivers/usb/gadget/Makefile b/drivers/usb/gadget/Makefile
index dd09ee0195..9c04403da3 100644
--- a/drivers/usb/gadget/Makefile
+++ b/drivers/usb/gadget/Makefile
@@ -21,7 +21,6 @@ obj-$(CONFIG_USB_GADGET_DWC2_OTG) += dwc2_udc_otg.o
obj-$(CONFIG_USB_GADGET_DWC2_OTG_PHY) += dwc2_udc_otg_phy.o
obj-$(CONFIG_USB_GADGET_FOTG210) += fotg210.o
obj-$(CONFIG_USB_GADGET_MAX3420) += max3420_udc.o
-obj-$(CONFIG_CI_UDC) += ci_udc.o
ifndef CONFIG_SPL_BUILD
obj-$(CONFIG_USB_GADGET_DOWNLOAD) += g_dnl.o
obj-$(CONFIG_USB_FUNCTION_THOR) += f_thor.o
@@ -33,14 +32,12 @@ obj-$(CONFIG_USB_FUNCTION_ROCKUSB) += f_rockusb.o
obj-$(CONFIG_USB_FUNCTION_ACM) += f_acm.o
endif
endif
-ifdef CONFIG_USB_ETHER
-obj-y += ether.o
+
+obj-$(CONFIG_CI_UDC) += ci_udc.o
+
+obj-$(CONFIG_USB_ETHER) += ether.o
obj-$(CONFIG_USB_ETH_RNDIS) += rndis.o
-obj-$(CONFIG_CI_UDC) += ci_udc.o
-else
+
# Devices not related to the new gadget layer depend on CONFIG_USB_DEVICE
-ifdef CONFIG_USB_DEVICE
-obj-y += core.o
-obj-y += ep0.o
-endif
-endif
+# This is really only N900 and USBTTY now.
+obj-$(CONFIG_USB_DEVICE) += core.o ep0.o
diff --git a/drivers/usb/gadget/f_fastboot.c b/drivers/usb/gadget/f_fastboot.c
index d0e92c7a07..07b1681c8a 100644
--- a/drivers/usb/gadget/f_fastboot.c
+++ b/drivers/usb/gadget/f_fastboot.c
@@ -544,6 +544,7 @@ static void rx_handler_command(struct usb_ep *ep, struct usb_request *req)
case FASTBOOT_COMMAND_REBOOT_FASTBOOTD:
case FASTBOOT_COMMAND_REBOOT_RECOVERY:
fastboot_func->in_req->complete = compl_do_reset;
+ g_dnl_trigger_detach();
break;
#if CONFIG_IS_ENABLED(FASTBOOT_UUU_SUPPORT)
case FASTBOOT_COMMAND_ACMD:
diff --git a/drivers/usb/host/ehci-generic.c b/drivers/usb/host/ehci-generic.c
index 75c73bfe4e..a765a307a3 100644
--- a/drivers/usb/host/ehci-generic.c
+++ b/drivers/usb/host/ehci-generic.c
@@ -96,7 +96,7 @@ static int ehci_usb_probe(struct udevice *dev)
if (err)
goto reset_err;
- err = ehci_setup_phy(dev, &priv->phy, 0);
+ err = generic_setup_phy(dev, &priv->phy, 0);
if (err)
goto regulator_err;
@@ -111,7 +111,7 @@ static int ehci_usb_probe(struct udevice *dev)
return 0;
phy_err:
- ret = ehci_shutdown_phy(dev, &priv->phy);
+ ret = generic_shutdown_phy(&priv->phy);
if (ret)
dev_err(dev, "failed to shutdown usb phy (ret=%d)\n", ret);
@@ -141,7 +141,7 @@ static int ehci_usb_remove(struct udevice *dev)
if (ret)
return ret;
- ret = ehci_shutdown_phy(dev, &priv->phy);
+ ret = generic_shutdown_phy(&priv->phy);
if (ret)
return ret;
diff --git a/drivers/usb/host/ehci-hcd.c b/drivers/usb/host/ehci-hcd.c
index d30f2a0d13..9139d61dd0 100644
--- a/drivers/usb/host/ehci-hcd.c
+++ b/drivers/usb/host/ehci-hcd.c
@@ -1767,69 +1767,3 @@ struct dm_usb_ops ehci_usb_ops = {
};
#endif
-
-#ifdef CONFIG_PHY
-int ehci_setup_phy(struct udevice *dev, struct phy *phy, int index)
-{
- int ret;
-
- if (!phy)
- return 0;
-
- ret = generic_phy_get_by_index(dev, index, phy);
- if (ret) {
- if (ret != -ENOENT) {
- dev_err(dev, "failed to get usb phy\n");
- return ret;
- }
- } else {
- ret = generic_phy_init(phy);
- if (ret) {
- dev_dbg(dev, "failed to init usb phy\n");
- return ret;
- }
-
- ret = generic_phy_power_on(phy);
- if (ret) {
- dev_dbg(dev, "failed to power on usb phy\n");
- return generic_phy_exit(phy);
- }
- }
-
- return 0;
-}
-
-int ehci_shutdown_phy(struct udevice *dev, struct phy *phy)
-{
- int ret = 0;
-
- if (!phy)
- return 0;
-
- if (generic_phy_valid(phy)) {
- ret = generic_phy_power_off(phy);
- if (ret) {
- dev_dbg(dev, "failed to power off usb phy\n");
- return ret;
- }
-
- ret = generic_phy_exit(phy);
- if (ret) {
- dev_dbg(dev, "failed to power off usb phy\n");
- return ret;
- }
- }
-
- return 0;
-}
-#else
-int ehci_setup_phy(struct udevice *dev, struct phy *phy, int index)
-{
- return 0;
-}
-
-int ehci_shutdown_phy(struct udevice *dev, struct phy *phy)
-{
- return 0;
-}
-#endif
diff --git a/drivers/usb/host/ehci-msm.c b/drivers/usb/host/ehci-msm.c
index d160cf019d..dd0d153500 100644
--- a/drivers/usb/host/ehci-msm.c
+++ b/drivers/usb/host/ehci-msm.c
@@ -56,7 +56,7 @@ static int ehci_usb_probe(struct udevice *dev)
hcor = (struct ehci_hcor *)((phys_addr_t)hccr +
HC_LENGTH(ehci_readl(&(hccr)->cr_capbase)));
- ret = ehci_setup_phy(dev, &p->phy, 0);
+ ret = generic_setup_phy(dev, &p->phy, 0);
if (ret)
return ret;
@@ -81,7 +81,7 @@ static int ehci_usb_remove(struct udevice *dev)
/* Stop controller. */
clrbits_le32(&ehci->usbcmd, CMD_RUN);
- ret = ehci_shutdown_phy(dev, &p->phy);
+ ret = generic_shutdown_phy(&p->phy);
if (ret)
return ret;
diff --git a/drivers/usb/host/ehci-mx6.c b/drivers/usb/host/ehci-mx6.c
index e30449b55e..fa2ca2a1d9 100644
--- a/drivers/usb/host/ehci-mx6.c
+++ b/drivers/usb/host/ehci-mx6.c
@@ -726,7 +726,7 @@ static int ehci_usb_probe(struct udevice *dev)
mdelay(10);
#if defined(CONFIG_PHY)
- ret = ehci_setup_phy(dev, &priv->phy, 0);
+ ret = generic_setup_phy(dev, &priv->phy, 0);
if (ret)
goto err_regulator;
#endif
@@ -743,7 +743,7 @@ static int ehci_usb_probe(struct udevice *dev)
err_phy:
#if defined(CONFIG_PHY)
- ehci_shutdown_phy(dev, &priv->phy);
+ generic_shutdown_phy(&priv->phy);
err_regulator:
#endif
#if CONFIG_IS_ENABLED(DM_REGULATOR)
@@ -767,7 +767,7 @@ int ehci_usb_remove(struct udevice *dev)
ehci_deregister(dev);
#if defined(CONFIG_PHY)
- ehci_shutdown_phy(dev, &priv->phy);
+ generic_shutdown_phy(&priv->phy);
#endif
#if CONFIG_IS_ENABLED(DM_REGULATOR)
diff --git a/drivers/usb/host/ehci-pci.c b/drivers/usb/host/ehci-pci.c
index 1ab306147f..e98ab31261 100644
--- a/drivers/usb/host/ehci-pci.c
+++ b/drivers/usb/host/ehci-pci.c
@@ -31,7 +31,7 @@ static int ehci_pci_init(struct udevice *dev, struct ehci_hccr **ret_hccr,
int ret;
u32 cmd;
- ret = ehci_setup_phy(dev, &priv->phy, 0);
+ ret = generic_setup_phy(dev, &priv->phy, 0);
if (ret)
return ret;
@@ -149,7 +149,7 @@ static int ehci_pci_remove(struct udevice *dev)
if (ret)
return ret;
- return ehci_shutdown_phy(dev, &priv->phy);
+ return generic_shutdown_phy(&priv->phy);
}
static const struct udevice_id ehci_pci_ids[] = {
diff --git a/drivers/usb/host/ehci.h b/drivers/usb/host/ehci.h
index 5170044a3a..5770d35b46 100644
--- a/drivers/usb/host/ehci.h
+++ b/drivers/usb/host/ehci.h
@@ -295,9 +295,5 @@ int ehci_register(struct udevice *dev, struct ehci_hccr *hccr,
int ehci_deregister(struct udevice *dev);
extern struct dm_usb_ops ehci_usb_ops;
-/* EHCI PHY functions */
-int ehci_setup_phy(struct udevice *dev, struct phy *phy, int index);
-int ehci_shutdown_phy(struct udevice *dev, struct phy *phy);
-
#include <linux/bitops.h>
#endif /* USB_EHCI_H */
diff --git a/drivers/usb/host/ohci-generic.c b/drivers/usb/host/ohci-generic.c
index 5d23058aaf..2d8d38ce9a 100644
--- a/drivers/usb/host/ohci-generic.c
+++ b/drivers/usb/host/ohci-generic.c
@@ -23,56 +23,6 @@ struct generic_ohci {
int reset_count; /* number of reset in reset list */
};
-static int ohci_setup_phy(struct udevice *dev, int index)
-{
- struct generic_ohci *priv = dev_get_priv(dev);
- int ret;
-
- ret = generic_phy_get_by_index(dev, index, &priv->phy);
- if (ret) {
- if (ret != -ENOENT) {
- dev_err(dev, "failed to get usb phy\n");
- return ret;
- }
- } else {
- ret = generic_phy_init(&priv->phy);
- if (ret) {
- dev_dbg(dev, "failed to init usb phy\n");
- return ret;
- }
-
- ret = generic_phy_power_on(&priv->phy);
- if (ret) {
- dev_dbg(dev, "failed to power on usb phy\n");
- return generic_phy_exit(&priv->phy);
- }
- }
-
- return 0;
-}
-
-static int ohci_shutdown_phy(struct udevice *dev)
-{
- struct generic_ohci *priv = dev_get_priv(dev);
- int ret = 0;
-
- if (generic_phy_valid(&priv->phy)) {
- ret = generic_phy_power_off(&priv->phy);
- if (ret) {
- dev_dbg(dev, "failed to power off usb phy\n");
- return ret;
- }
-
- ret = generic_phy_exit(&priv->phy);
- if (ret) {
- dev_dbg(dev, "failed to power off usb phy\n");
- return ret;
- }
- }
-
- return 0;
-}
-
static int ohci_usb_probe(struct udevice *dev)
{
struct ohci_regs *regs = dev_read_addr_ptr(dev);
@@ -135,7 +85,7 @@ static int ohci_usb_probe(struct udevice *dev)
goto clk_err;
}
- err = ohci_setup_phy(dev, 0);
+ err = generic_setup_phy(dev, &priv->phy, 0);
if (err)
goto reset_err;
@@ -146,7 +96,7 @@ static int ohci_usb_probe(struct udevice *dev)
return 0;
phy_err:
- ret = ohci_shutdown_phy(dev);
+ ret = generic_shutdown_phy(&priv->phy);
if (ret)
dev_err(dev, "failed to shutdown usb phy\n");
@@ -171,7 +121,7 @@ static int ohci_usb_remove(struct udevice *dev)
if (ret)
return ret;
- ret = ohci_shutdown_phy(dev);
+ ret = generic_shutdown_phy(&priv->phy);
if (ret)
return ret;