summaryrefslogtreecommitdiff
path: root/drivers
diff options
context:
space:
mode:
authorDinh Nguyen <r00091@freescale.com>2009-10-09 07:52:32 -0500
committerDinh Nguyen <r00091@freescale.com>2009-10-10 11:02:07 -0500
commit60420e52d9ed3164ce85b2d237e28709c2de3510 (patch)
tree62abbe89e92df914329adb06b018bae3c39adebb /drivers
parent76a55357b863bb4364cdab0c38aa7e4ce789aef4 (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>
Diffstat (limited to 'drivers')
-rw-r--r--drivers/usb/gadget/Kconfig2
-rw-r--r--drivers/usb/gadget/arcotg_udc.c20
-rw-r--r--drivers/usb/gadget/arcotg_udc.h1
-rw-r--r--drivers/usb/host/ehci-arc.c32
4 files changed, 15 insertions, 40 deletions
diff --git a/drivers/usb/gadget/Kconfig b/drivers/usb/gadget/Kconfig
index 1fe65644ac49..8a54cba983f0 100644
--- a/drivers/usb/gadget/Kconfig
+++ b/drivers/usb/gadget/Kconfig
@@ -534,7 +534,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 4ae2475a319f..367a9b059196 100644
--- a/drivers/usb/gadget/arcotg_udc.c
+++ b/drivers/usb/gadget/arcotg_udc.c
@@ -2715,16 +2715,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;
/*
@@ -2861,8 +2855,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));
@@ -2904,8 +2897,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 3d13b9af6155..f7950c25b45b 100644
--- a/drivers/usb/gadget/arcotg_udc.h
+++ b/drivers/usb/gadget/arcotg_udc.h
@@ -592,7 +592,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 c14c8b3b75c1..dd2929f472e8 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 */
/*
@@ -159,14 +158,6 @@ static 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,
@@ -188,18 +179,13 @@ static 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;
/*
@@ -255,8 +241,7 @@ static 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);
@@ -306,8 +291,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,