static int musb_usb_probe(struct udevice *dev) { struct musb_host_data *host = dev_get_priv(dev); struct usb_bus_priv *priv = dev_get_uclass_priv(dev); int ret; priv->desc_before_addr = true; #ifdef CONFIG_USB_MUSB_HOST host->host = musb_init_controller(&musb_plat, NULL, (void *)SUNXI_USB0_BASE); if (!host->host) return -EIO; ret = musb_lowlevel_init(host); if (!ret) printf("Allwinner mUSB OTG (Host)\n"); #else ret = musb_register(&musb_plat, NULL, (void *)SUNXI_USB0_BASE); if (!ret) printf("Allwinner mUSB OTG (Peripheral)\n"); #endif return ret; }
static int musb_usb_probe(struct udevice *dev) { struct usb_bus_priv *priv = dev_get_uclass_priv(dev); struct pic32_musb_data *pdata = dev_get_priv(dev); struct musb_host_data *mdata = &pdata->mdata; struct fdt_resource mc, glue; void *fdt = (void *)gd->fdt_blob; int node = dev->of_offset; void __iomem *mregs; int ret; priv->desc_before_addr = true; ret = fdt_get_named_resource(fdt, node, "reg", "reg-names", "mc", &mc); if (ret < 0) { printf("pic32-musb: resource \"mc\" not found\n"); return ret; } ret = fdt_get_named_resource(fdt, node, "reg", "reg-names", "control", &glue); if (ret < 0) { printf("pic32-musb: resource \"control\" not found\n"); return ret; } mregs = ioremap(mc.start, fdt_resource_size(&mc)); pdata->musb_glue = ioremap(glue.start, fdt_resource_size(&glue)); /* init controller */ #ifdef CONFIG_USB_MUSB_HOST mdata->host = musb_init_controller(&pic32_musb_plat, &pdata->dev, mregs); if (!mdata->host) return -EIO; ret = musb_lowlevel_init(mdata); #else pic32_musb_plat.mode = MUSB_PERIPHERAL; ret = musb_register(&pic32_musb_plat, &pdata->dev, mregs); #endif if (ret == 0) printf("PIC32 MUSB OTG\n"); return ret; }
int musb_usb_probe(struct udevice *dev) { struct musb_host_data *host = dev_get_priv(dev); struct usb_bus_priv *priv = dev_get_uclass_priv(dev); int ret; priv->desc_before_addr = true; if (!host->host) { host->host = musb_init_controller(&musb_plat, NULL, (void *)SUNXI_USB0_BASE); if (!host->host) return -EIO; } ret = musb_lowlevel_init(host); if (ret == 0) printf("MUSB OTG\n"); return ret; }
static int ti_musb_host_probe(struct udevice *dev) { struct musb_host_data *host = dev_get_priv(dev); struct ti_musb_platdata *platdata = dev_get_platdata(dev); struct usb_bus_priv *priv = dev_get_uclass_priv(dev); struct omap_musb_board_data *otg_board_data; int ret; priv->desc_before_addr = true; otg_board_data = &platdata->otg_board_data; host->host = musb_init_controller(&platdata->plat, (struct device *)otg_board_data, platdata->base); if (!host->host) return -EIO; ret = musb_lowlevel_init(host); return ret; }
int usb_lowlevel_init(int index, enum usb_init_type init, void **controller) { return musb_lowlevel_init(&musb_host); }