usb: musb: Pass fifo_mode in platform data
authorTony Lindgren <tony@atomide.com>
Mon, 24 Nov 2014 19:05:04 +0000 (11:05 -0800)
committerFelipe Balbi <balbi@ti.com>
Tue, 25 Nov 2014 14:47:07 +0000 (08:47 -0600)
This allows setting the correct fifo_mode when multiple
MUSB glue layers are built-in.

Cc: Fabio Baltieri <fabio.baltieri@linaro.org>
Cc: Lee Jones <lee.jones@linaro.org>
Cc: Linus Walleij <linus.walleij@linaro.org>
Cc: Lars-Peter Clausen <lars@metafoo.de>
Acked-by: Apelete Seketeli <apelete@seketeli.net>
Signed-off-by: Tony Lindgren <tony@atomide.com>
Signed-off-by: Felipe Balbi <balbi@ti.com>
drivers/usb/musb/blackfin.c
drivers/usb/musb/da8xx.c
drivers/usb/musb/jz4740.c
drivers/usb/musb/musb_core.c
drivers/usb/musb/ux500.c

index 77f9f5535a88fb14538d2b088191bdf8b24f02d3..a441a2de8619e51d5f639e47332f3ec120d2a4f2 100644 (file)
@@ -474,6 +474,7 @@ static const struct musb_platform_ops bfin_ops = {
        .writew         = bfin_writew,
        .readl          = bfin_readl,
        .writel         = bfin_writel,
+       .fifo_mode      = 2,
        .read_fifo      = bfin_read_fifo,
        .write_fifo     = bfin_write_fifo,
        .enable         = bfin_musb_enable,
index 9a61713009310bcec5d2248fd5d027c28302ac20..9a9c82a4d35d818116bcfcbb5519debbc35b66dc 100644 (file)
@@ -462,6 +462,7 @@ static const struct musb_platform_ops da8xx_ops = {
        .init           = da8xx_musb_init,
        .exit           = da8xx_musb_exit,
 
+       .fifo_mode      = 2,
        .enable         = da8xx_musb_enable,
        .disable        = da8xx_musb_disable,
 
index 40e98747d17faea64ee4f11d47eef908814ba707..bb7b26325a74e11b27ba86f1fab899803cf80f46 100644 (file)
@@ -107,6 +107,7 @@ static int jz4740_musb_exit(struct musb *musb)
 
 static const struct musb_platform_ops jz4740_musb_ops = {
        .quirks         = MUSB_INDEXED_EP,
+       .fifo_mode      = 2,
        .init           = jz4740_musb_init,
        .exit           = jz4740_musb_exit,
 };
index 1ff944a0735909ccac4a4ad959b5201b0a64acc1..1388d99b39e0f38fbf75df0598d4eef643925a5d 100644 (file)
@@ -1116,21 +1116,7 @@ static void musb_shutdown(struct platform_device *pdev)
  * We don't currently use dynamic fifo setup capability to do anything
  * more than selecting one of a bunch of predefined configurations.
  */
-#if defined(CONFIG_USB_MUSB_TUSB6010)                  \
-       || defined(CONFIG_USB_MUSB_TUSB6010_MODULE)     \
-       || defined(CONFIG_USB_MUSB_OMAP2PLUS)           \
-       || defined(CONFIG_USB_MUSB_OMAP2PLUS_MODULE)    \
-       || defined(CONFIG_USB_MUSB_AM35X)               \
-       || defined(CONFIG_USB_MUSB_AM35X_MODULE)        \
-       || defined(CONFIG_USB_MUSB_DSPS)                \
-       || defined(CONFIG_USB_MUSB_DSPS_MODULE)
-static ushort fifo_mode = 4;
-#elif defined(CONFIG_USB_MUSB_UX500)                   \
-       || defined(CONFIG_USB_MUSB_UX500_MODULE)
-static ushort fifo_mode = 5;
-#else
-static ushort fifo_mode = 2;
-#endif
+static ushort fifo_mode;
 
 /* "modprobe ... fifo_mode=1" etc */
 module_param(fifo_mode, ushort, 0);
@@ -2043,6 +2029,11 @@ musb_init_controller(struct device *dev, int nIrq, void __iomem *ctrl)
                musb->io.ep_select = musb_flat_ep_select;
        }
 
+       if (musb->ops->fifo_mode)
+               fifo_mode = musb->ops->fifo_mode;
+       else
+               fifo_mode = 4;
+
        if (musb->ops->fifo_offset)
                musb->io.fifo_offset = musb->ops->fifo_offset;
        else
index 06e8b3523a0a86c31518e6d644b20089c81f48db..abf72728825fad1cce9a1a2aaec1652514c5dfe6 100644 (file)
@@ -191,6 +191,7 @@ static const struct musb_platform_ops ux500_ops = {
        .quirks         = MUSB_INDEXED_EP,
        .init           = ux500_musb_init,
        .exit           = ux500_musb_exit,
+       .fifo_mode      = 5,
 
        .set_vbus       = ux500_musb_set_vbus,
 };