From: Ming Lei <tom.leiming@xxxxxxxxx> Each hw controller may have different fifo configuraion, so passing fifo_mode from hw glue is very reasonable. Signed-off-by: Ming Lei <tom.leiming@xxxxxxxxx> --- drivers/usb/musb/am35x.c | 1 + drivers/usb/musb/blackfin.c | 1 + drivers/usb/musb/da8xx.c | 1 + drivers/usb/musb/davinci.c | 1 + drivers/usb/musb/musb_core.c | 11 ++++------- drivers/usb/musb/musb_core.h | 2 ++ drivers/usb/musb/omap2430.c | 1 + drivers/usb/musb/tusb6010.c | 1 + 8 files changed, 12 insertions(+), 7 deletions(-) diff --git a/drivers/usb/musb/am35x.c b/drivers/usb/musb/am35x.c index 6ab6ed2..20231f3 100644 --- a/drivers/usb/musb/am35x.c +++ b/drivers/usb/musb/am35x.c @@ -442,6 +442,7 @@ static void am35x_musb_read_fifo(struct musb_hw_ep *hw_ep, u16 len, u8 *dst) } static const struct musb_platform_ops am35x_ops = { + .fifo_mode = 4, .init = am35x_musb_init, .exit = am35x_musb_exit, diff --git a/drivers/usb/musb/blackfin.c b/drivers/usb/musb/blackfin.c index 6d61349..f6127ef8 100644 --- a/drivers/usb/musb/blackfin.c +++ b/drivers/usb/musb/blackfin.c @@ -416,6 +416,7 @@ static int bfin_musb_exit(struct musb *musb) } static const struct musb_platform_ops bfin_ops = { + .fifo_mode = 2, .init = bfin_musb_init, .exit = bfin_musb_exit, diff --git a/drivers/usb/musb/da8xx.c b/drivers/usb/musb/da8xx.c index 616da28..5cc7881 100644 --- a/drivers/usb/musb/da8xx.c +++ b/drivers/usb/musb/da8xx.c @@ -470,6 +470,7 @@ static int da8xx_musb_exit(struct musb *musb) } static const struct musb_platform_ops da8xx_ops = { + .fifo_mode = 2, .init = da8xx_musb_init, .exit = da8xx_musb_exit, diff --git a/drivers/usb/musb/davinci.c b/drivers/usb/musb/davinci.c index 6987899..3c7f39a 100644 --- a/drivers/usb/musb/davinci.c +++ b/drivers/usb/musb/davinci.c @@ -505,6 +505,7 @@ static int davinci_musb_exit(struct musb *musb) } static const struct musb_platform_ops davinci_ops = { + .fifo_mode = 2, .init = davinci_musb_init, .exit = davinci_musb_exit, diff --git a/drivers/usb/musb/musb_core.c b/drivers/usb/musb/musb_core.c index cf8895a..2f73002 100644 --- a/drivers/usb/musb/musb_core.c +++ b/drivers/usb/musb/musb_core.c @@ -1061,15 +1061,10 @@ 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_OMAP2PLUS) \ - || defined(CONFIG_USB_MUSB_AM35X) -static ushort __devinitdata fifo_mode = 4; -#else -static ushort __devinitdata fifo_mode = 2; -#endif +static short __devinitdata fifo_mode = -1; /* "modprobe ... fifo_mode=1" etc */ -module_param(fifo_mode, ushort, 0); +module_param(fifo_mode, short, 0); MODULE_PARM_DESC(fifo_mode, "initial endpoint configuration"); /* @@ -1990,6 +1985,8 @@ bad_config: musb->board_set_power = plat->set_power; musb->min_power = plat->min_power; musb->ops = plat->platform_ops; + if (fifo_mode == -1) + fifo_mode = musb->ops->fifo_mode; /* The musb_platform_init() call: * - adjusts musb->mregs and musb->isr if needed, diff --git a/drivers/usb/musb/musb_core.h b/drivers/usb/musb/musb_core.h index bfbd72e..6667fa2 100644 --- a/drivers/usb/musb/musb_core.h +++ b/drivers/usb/musb/musb_core.h @@ -255,6 +255,7 @@ enum musb_g_ep0_state { /** * struct musb_platform_ops - Operations passed to musb_core by HW glue layer + * @fifo_mode: which fifo_mode is taken by me * @init: turns on clocks, sets up platform-specific registers, etc * @exit: undoes @init * @set_mode: forcefully changes operating mode @@ -266,6 +267,7 @@ enum musb_g_ep0_state { * @write_fifo: write data into musb fifo in PIO */ struct musb_platform_ops { + short fifo_mode; int (*init)(struct musb *musb); int (*exit)(struct musb *musb); diff --git a/drivers/usb/musb/omap2430.c b/drivers/usb/musb/omap2430.c index 09a9d57..f3a2d48 100644 --- a/drivers/usb/musb/omap2430.c +++ b/drivers/usb/musb/omap2430.c @@ -283,6 +283,7 @@ static int omap2430_musb_exit(struct musb *musb) } static const struct musb_platform_ops omap2430_ops = { + .fifo_mode = 4, .init = omap2430_musb_init, .exit = omap2430_musb_exit, diff --git a/drivers/usb/musb/tusb6010.c b/drivers/usb/musb/tusb6010.c index 3427298..926c6b4 100644 --- a/drivers/usb/musb/tusb6010.c +++ b/drivers/usb/musb/tusb6010.c @@ -1164,6 +1164,7 @@ static int tusb_musb_exit(struct musb *musb) } static const struct musb_platform_ops tusb_ops = { + .fifo_mode = 4, .init = tusb_musb_init, .exit = tusb_musb_exit, -- 1.7.3 -- To unsubscribe from this list: send the line "unsubscribe linux-usb" in the body of a message to majordomo@xxxxxxxxxxxxxxx More majordomo info at http://vger.kernel.org/majordomo-info.html