aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorNeil Zhang <zhangwm@marvell.com>2011-12-20 00:20:21 -0500
committerFelipe Balbi <balbi@ti.com>2011-12-20 05:55:06 -0500
commit5e6c86b017691230b6b47f19b7d5449997e8a0b8 (patch)
tree5cf062ef4e2cc910489a03c210188b663e69b7b7
parentc2bbd16b03d036bfeaa3efaae6491132500aa7ec (diff)
usb: gadget: mv_udc: drop ARCH dependency
This patch do the following things: 1. Change the Kconfig information. 2. Rename the driver name. 3. Don't do any type cast to io memory. 4. Add dummy stub for clk framework. Signed-off-by: Neil Zhang <zhangwm@marvell.com> Signed-off-by: Felipe Balbi <balbi@ti.com>
-rw-r--r--drivers/usb/gadget/Kconfig10
-rw-r--r--drivers/usb/gadget/Makefile2
-rw-r--r--drivers/usb/gadget/mv_udc.h2
-rw-r--r--drivers/usb/gadget/mv_udc_core.c17
-rw-r--r--include/linux/platform_data/mv_usb.h12
5 files changed, 25 insertions, 18 deletions
diff --git a/drivers/usb/gadget/Kconfig b/drivers/usb/gadget/Kconfig
index 953b00cd59ff..f1a5409e99f7 100644
--- a/drivers/usb/gadget/Kconfig
+++ b/drivers/usb/gadget/Kconfig
@@ -309,13 +309,13 @@ config USB_S3C_HSUDC
309 309
310 This driver has been tested on S3C2416 and S3C2450 processors. 310 This driver has been tested on S3C2416 and S3C2450 processors.
311 311
312config USB_PXA_U2O 312config USB_MV_UDC
313 tristate "PXA9xx Processor USB2.0 controller" 313 tristate "Marvell USB2.0 Device Controller"
314 depends on ARCH_MMP
315 select USB_GADGET_DUALSPEED 314 select USB_GADGET_DUALSPEED
316 help 315 help
317 PXA9xx Processor series include a high speed USB2.0 device 316 Marvell Socs (including PXA and MMP series) include a high speed
318 controller, which support high speed and full speed USB peripheral. 317 USB2.0 OTG controller, which can be configured as high speed or
318 full speed USB peripheral.
319 319
320config USB_GADGET_DWC3 320config USB_GADGET_DWC3
321 tristate "DesignWare USB3.0 (DRD) Controller" 321 tristate "DesignWare USB3.0 (DRD) Controller"
diff --git a/drivers/usb/gadget/Makefile b/drivers/usb/gadget/Makefile
index b54ac6190890..b7f6eefc3927 100644
--- a/drivers/usb/gadget/Makefile
+++ b/drivers/usb/gadget/Makefile
@@ -27,7 +27,7 @@ obj-$(CONFIG_USB_S3C_HSOTG) += s3c-hsotg.o
27obj-$(CONFIG_USB_S3C_HSUDC) += s3c-hsudc.o 27obj-$(CONFIG_USB_S3C_HSUDC) += s3c-hsudc.o
28obj-$(CONFIG_USB_LANGWELL) += langwell_udc.o 28obj-$(CONFIG_USB_LANGWELL) += langwell_udc.o
29obj-$(CONFIG_USB_EG20T) += pch_udc.o 29obj-$(CONFIG_USB_EG20T) += pch_udc.o
30obj-$(CONFIG_USB_PXA_U2O) += mv_udc.o 30obj-$(CONFIG_USB_MV_UDC) += mv_udc.o
31mv_udc-y := mv_udc_core.o 31mv_udc-y := mv_udc_core.o
32obj-$(CONFIG_USB_CI13XXX_MSM) += ci13xxx_msm.o 32obj-$(CONFIG_USB_CI13XXX_MSM) += ci13xxx_msm.o
33obj-$(CONFIG_USB_FUSB300) += fusb300_udc.o 33obj-$(CONFIG_USB_FUSB300) += fusb300_udc.o
diff --git a/drivers/usb/gadget/mv_udc.h b/drivers/usb/gadget/mv_udc.h
index 3d8404484613..34aadfae723d 100644
--- a/drivers/usb/gadget/mv_udc.h
+++ b/drivers/usb/gadget/mv_udc.h
@@ -180,7 +180,7 @@ struct mv_udc {
180 180
181 struct mv_cap_regs __iomem *cap_regs; 181 struct mv_cap_regs __iomem *cap_regs;
182 struct mv_op_regs __iomem *op_regs; 182 struct mv_op_regs __iomem *op_regs;
183 unsigned int phy_regs; 183 void __iomem *phy_regs;
184 unsigned int max_eps; 184 unsigned int max_eps;
185 struct mv_dqh *ep_dqh; 185 struct mv_dqh *ep_dqh;
186 size_t ep_dqh_size; 186 size_t ep_dqh_size;
diff --git a/drivers/usb/gadget/mv_udc_core.c b/drivers/usb/gadget/mv_udc_core.c
index a3a7664add19..f0596ac533e0 100644
--- a/drivers/usb/gadget/mv_udc_core.c
+++ b/drivers/usb/gadget/mv_udc_core.c
@@ -2128,11 +2128,9 @@ static int __devexit mv_udc_remove(struct platform_device *dev)
2128 2128
2129 if (udc->cap_regs) 2129 if (udc->cap_regs)
2130 iounmap(udc->cap_regs); 2130 iounmap(udc->cap_regs);
2131 udc->cap_regs = NULL;
2132 2131
2133 if (udc->phy_regs) 2132 if (udc->phy_regs)
2134 iounmap((void *)udc->phy_regs); 2133 iounmap(udc->phy_regs);
2135 udc->phy_regs = 0;
2136 2134
2137 if (udc->status_req) { 2135 if (udc->status_req) {
2138 kfree(udc->status_req->req.buf); 2136 kfree(udc->status_req->req.buf);
@@ -2217,8 +2215,8 @@ static int __devinit mv_udc_probe(struct platform_device *dev)
2217 goto err_iounmap_capreg; 2215 goto err_iounmap_capreg;
2218 } 2216 }
2219 2217
2220 udc->phy_regs = (unsigned int)ioremap(r->start, resource_size(r)); 2218 udc->phy_regs = ioremap(r->start, resource_size(r));
2221 if (udc->phy_regs == 0) { 2219 if (udc->phy_regs == NULL) {
2222 dev_err(&dev->dev, "failed to map phy I/O memory\n"); 2220 dev_err(&dev->dev, "failed to map phy I/O memory\n");
2223 retval = -EBUSY; 2221 retval = -EBUSY;
2224 goto err_iounmap_capreg; 2222 goto err_iounmap_capreg;
@@ -2229,7 +2227,8 @@ static int __devinit mv_udc_probe(struct platform_device *dev)
2229 if (retval) 2227 if (retval)
2230 goto err_iounmap_phyreg; 2228 goto err_iounmap_phyreg;
2231 2229
2232 udc->op_regs = (struct mv_op_regs __iomem *)((u32)udc->cap_regs 2230 udc->op_regs =
2231 (struct mv_op_regs __iomem *)((unsigned long)udc->cap_regs
2233 + (readl(&udc->cap_regs->caplength_hciversion) 2232 + (readl(&udc->cap_regs->caplength_hciversion)
2234 & CAPLENGTH_MASK)); 2233 & CAPLENGTH_MASK));
2235 udc->max_eps = readl(&udc->cap_regs->dccparams) & DCCPARAMS_DEN_MASK; 2234 udc->max_eps = readl(&udc->cap_regs->dccparams) & DCCPARAMS_DEN_MASK;
@@ -2389,7 +2388,7 @@ err_free_dma:
2389err_disable_clock: 2388err_disable_clock:
2390 mv_udc_disable_internal(udc); 2389 mv_udc_disable_internal(udc);
2391err_iounmap_phyreg: 2390err_iounmap_phyreg:
2392 iounmap((void *)udc->phy_regs); 2391 iounmap(udc->phy_regs);
2393err_iounmap_capreg: 2392err_iounmap_capreg:
2394 iounmap(udc->cap_regs); 2393 iounmap(udc->cap_regs);
2395err_put_clk: 2394err_put_clk:
@@ -2480,13 +2479,13 @@ static struct platform_driver udc_driver = {
2480 .shutdown = mv_udc_shutdown, 2479 .shutdown = mv_udc_shutdown,
2481 .driver = { 2480 .driver = {
2482 .owner = THIS_MODULE, 2481 .owner = THIS_MODULE,
2483 .name = "pxa-u2o", 2482 .name = "mv-udc",
2484#ifdef CONFIG_PM 2483#ifdef CONFIG_PM
2485 .pm = &mv_udc_pm_ops, 2484 .pm = &mv_udc_pm_ops,
2486#endif 2485#endif
2487 }, 2486 },
2488}; 2487};
2489MODULE_ALIAS("platform:pxa-u2o"); 2488MODULE_ALIAS("platform:mv-udc");
2490 2489
2491MODULE_DESCRIPTION(DRIVER_DESC); 2490MODULE_DESCRIPTION(DRIVER_DESC);
2492MODULE_AUTHOR("Chao Xie <chao.xie@marvell.com>"); 2491MODULE_AUTHOR("Chao Xie <chao.xie@marvell.com>");
diff --git a/include/linux/platform_data/mv_usb.h b/include/linux/platform_data/mv_usb.h
index e9d9149ddf38..a642cf20ad6e 100644
--- a/include/linux/platform_data/mv_usb.h
+++ b/include/linux/platform_data/mv_usb.h
@@ -42,9 +42,17 @@ struct mv_usb_platform_data {
42 /* only valid for HCD. OTG or Host only*/ 42 /* only valid for HCD. OTG or Host only*/
43 unsigned int mode; 43 unsigned int mode;
44 44
45 int (*phy_init)(unsigned int regbase); 45 int (*phy_init)(void __iomem *regbase);
46 void (*phy_deinit)(unsigned int regbase); 46 void (*phy_deinit)(void __iomem *regbase);
47 int (*set_vbus)(unsigned int vbus); 47 int (*set_vbus)(unsigned int vbus);
48}; 48};
49 49
50#ifndef CONFIG_HAVE_CLK
51/* Dummy stub for clk framework */
52#define clk_get(dev, id) NULL
53#define clk_put(clock) do {} while (0)
54#define clk_enable(clock) do {} while (0)
55#define clk_disable(clock) do {} while (0)
56#endif
57
50#endif 58#endif