diff options
author | Rob Herring <r.herring@freescale.com> | 2009-10-14 14:09:27 -0500 |
---|---|---|
committer | Alejandro Gonzalez <alex.gonzalez@digi.com> | 2010-02-12 17:19:20 +0100 |
commit | c23b14cd9138fc2c96dfdb74e6443cec608ce9ae (patch) | |
tree | 245b39733059182d0f91716628b0607f59493f36 /drivers/usb | |
parent | 130f57083126c182f61cea73282fb486a433e010 (diff) |
ENGR00116558: MX233: USB pin detect
MX233: Restructure the STMP378xxx USB Host and Gadget device structures
to be similar to MXC structures. Enable fsl_otg_arc driver to work on
MX233 platform. Remove FSL_USB2_DONT_REMAP requirement.
Signed-off-by: Dinh Nguyen <Dinh.Nguyen@freescale.com>
Conflicts:
arch/arm/mach-stmp3xxx/Kconfig
arch/arm/mach-stmp3xxx/Makefile
arch/arm/mach-stmp3xxx/devices.c
arch/arm/mach-stmp3xxx/include/mach/stmp3xxx.h
arch/arm/mach-stmp3xxx/stmp378x_devb.c
Diffstat (limited to 'drivers/usb')
-rw-r--r-- | drivers/usb/gadget/Kconfig | 2 | ||||
-rw-r--r-- | drivers/usb/gadget/arcotg_udc.c | 20 | ||||
-rw-r--r-- | drivers/usb/gadget/arcotg_udc.h | 1 | ||||
-rw-r--r-- | drivers/usb/host/ehci-arc.c | 32 |
4 files changed, 15 insertions, 40 deletions
diff --git a/drivers/usb/gadget/Kconfig b/drivers/usb/gadget/Kconfig index 83d395de165c..0c89ffbcb93a 100644 --- a/drivers/usb/gadget/Kconfig +++ b/drivers/usb/gadget/Kconfig @@ -609,7 +609,7 @@ endchoice config USB_OTG boolean "OTG Support" depends on (USB_GADGET_OMAP && ARCH_OMAP_OTG && USB_OHCI_HCD) || \ - (USB_GADGET_ARC && ARCH_MXC && USB_EHCI_HCD) + (USB_GADGET_ARC && (ARCH_MXC || ARCH_STMP3XXX) && USB_EHCI_HCD) help The most notable feature of USB OTG is support for a "Dual-Role" device, which can act as either a device diff --git a/drivers/usb/gadget/arcotg_udc.c b/drivers/usb/gadget/arcotg_udc.c index 64a62158b2a4..acc1b9508da9 100644 --- a/drivers/usb/gadget/arcotg_udc.c +++ b/drivers/usb/gadget/arcotg_udc.c @@ -2713,16 +2713,10 @@ static int __init fsl_udc_probe(struct platform_device *pdev) } #endif - if ((pdata->port_enables & FSL_USB2_DONT_REMAP) == 0) { - dr_regs = ioremap(res->start, resource_size(res)); - if (!dr_regs) { - ret = -ENOMEM; - goto err1; - } - udc_controller->dr_remapped = !0; - } else { - dr_regs = (void *)res->start; - dev_warn(&pdev->dev, "does not remap its address space\n"); + dr_regs = ioremap(res->start, resource_size(res)); + if (!dr_regs) { + ret = -ENOMEM; + goto err1; } pdata->regs = (void *)dr_regs; /* @@ -2859,8 +2853,7 @@ err2: if (pdata->platform_uninit) pdata->platform_uninit(pdata); err2a: - if (udc_controller->dr_remapped) - iounmap((u8 __iomem *)dr_regs); + iounmap((u8 __iomem *)dr_regs); err1: if (!udc_controller->transceiver) release_mem_region(res->start, resource_size(res)); @@ -2902,8 +2895,7 @@ static int __exit fsl_udc_remove(struct platform_device *pdev) #endif dma_pool_destroy(udc_controller->td_pool); free_irq(udc_controller->irq, udc_controller); - if (udc_controller->dr_remapped) - iounmap((u8 __iomem *)dr_regs); + iounmap((u8 __iomem *)dr_regs); #ifndef CONFIG_USB_OTG res = platform_get_resource(pdev, IORESOURCE_MEM, 0); diff --git a/drivers/usb/gadget/arcotg_udc.h b/drivers/usb/gadget/arcotg_udc.h index 82bde01db428..d8d33eb7156e 100644 --- a/drivers/usb/gadget/arcotg_udc.h +++ b/drivers/usb/gadget/arcotg_udc.h @@ -594,7 +594,6 @@ struct fsl_udc { unsigned stopped:1; unsigned remote_wakeup:1; unsigned already_stopped:1; - unsigned dr_remapped:1; struct ep_queue_head *ep_qh; /* Endpoints Queue-Head */ struct fsl_req *status_req; /* ep0 status request */ diff --git a/drivers/usb/host/ehci-arc.c b/drivers/usb/host/ehci-arc.c index 17a0f5def731..78d6e9145328 100644 --- a/drivers/usb/host/ehci-arc.c +++ b/drivers/usb/host/ehci-arc.c @@ -28,7 +28,6 @@ extern struct resource *otg_get_resources(void); -static int regs_remapped /* = 0 */; #undef EHCI_PROC_PTC #ifdef EHCI_PROC_PTC /* /proc PORTSC:PTC support */ /* @@ -158,14 +157,6 @@ int usb_hcd_fsl_probe(const struct hc_driver *driver, } else #endif { - if ((pdev->dev.parent) && - (to_platform_device(pdev->dev.parent)->resource)) { - pdev->resource = - to_platform_device(pdev->dev.parent)->resource; - pdev->num_resources = - to_platform_device(pdev->dev.parent)->num_resources; - } - res = platform_get_resource(pdev, IORESOURCE_IRQ, 0); if (!res) { dev_err(&pdev->dev, @@ -187,18 +178,13 @@ int usb_hcd_fsl_probe(const struct hc_driver *driver, } } - if (!(pdata->port_enables & FSL_USB2_DONT_REMAP)) { - hcd->regs = ioremap(hcd->rsrc_start, hcd->rsrc_len); - - if (hcd->regs == NULL) { - dev_dbg(&pdev->dev, "error mapping memory\n"); - retval = -EFAULT; - goto err3; - } - regs_remapped = 1; - } else - hcd->regs = (void __iomem *)(u32)(hcd->rsrc_start); + hcd->regs = ioremap(hcd->rsrc_start, hcd->rsrc_len); + if (hcd->regs == NULL) { + dev_dbg(&pdev->dev, "error mapping memory\n"); + retval = -EFAULT; + goto err3; + } pdata->regs = hcd->regs; /* @@ -254,8 +240,7 @@ int usb_hcd_fsl_probe(const struct hc_driver *driver, return retval; err4: - if (regs_remapped) - iounmap(hcd->regs); + iounmap(hcd->regs); err3: if (pdata->operating_mode != FSL_USB2_DR_OTG) release_mem_region(hcd->rsrc_start, hcd->rsrc_len); @@ -305,8 +290,7 @@ static void usb_hcd_fsl_remove(struct usb_hcd *hcd, if (pdata->platform_uninit) pdata->platform_uninit(pdata); - if (regs_remapped) - iounmap(hcd->regs); + iounmap(hcd->regs); } static void fsl_setup_phy(struct ehci_hcd *ehci, |