From 05ac10dd6862a3fcce33d2203fbb2ef285e3ca87 Mon Sep 17 00:00:00 2001 From: Felipe Balbi Date: Thu, 2 Dec 2010 08:49:26 +0200 Subject: usb: musb: trivial search and replace patch change all ocurrences of musb_hdrc to musb-hdrc. We will call glue layer drivers musb-, so in order to keep things somewhat standard, let's change the underscore into a dash. Signed-off-by: Felipe Balbi --- include/linux/usb/musb.h | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'include/linux/usb/musb.h') diff --git a/include/linux/usb/musb.h b/include/linux/usb/musb.h index ee2dd1d506ed..e2191d4db4dd 100644 --- a/include/linux/usb/musb.h +++ b/include/linux/usb/musb.h @@ -3,7 +3,7 @@ * Inventra (Multidrop) Highspeed Dual-Role Controllers: (M)HDRC. * * Board initialization should put one of these into dev->platform_data, - * probably on some platform_device named "musb_hdrc". It encapsulates + * probably on some platform_device named "musb-hdrc". It encapsulates * key configuration differences between boards. */ -- cgit v1.2.3 From f7ec94370f417fedad4db1054228ef958d48b926 Mon Sep 17 00:00:00 2001 From: Felipe Balbi Date: Thu, 2 Dec 2010 09:48:58 +0200 Subject: usb: musb: pass platform_ops via platform_data ... then we don't need to export any symbols from glue layer to musb_core. Signed-off-by: Felipe Balbi --- drivers/usb/musb/am35x.c | 4 +++- drivers/usb/musb/blackfin.c | 4 +++- drivers/usb/musb/da8xx.c | 4 +++- drivers/usb/musb/davinci.c | 4 +++- drivers/usb/musb/musb_core.c | 2 +- drivers/usb/musb/musb_core.h | 2 -- drivers/usb/musb/omap2430.c | 4 +++- drivers/usb/musb/tusb6010.c | 4 +++- include/linux/usb/musb.h | 3 +++ 9 files changed, 22 insertions(+), 9 deletions(-) (limited to 'include/linux/usb/musb.h') diff --git a/drivers/usb/musb/am35x.c b/drivers/usb/musb/am35x.c index 355883c5ffed..e372c87f37e2 100644 --- a/drivers/usb/musb/am35x.c +++ b/drivers/usb/musb/am35x.c @@ -530,7 +530,7 @@ void musb_read_fifo(struct musb_hw_ep *hw_ep, u16 len, u8 *dst) } } -const struct musb_platform_ops musb_ops = { +static const struct musb_platform_ops am35x_ops = { .init = am35x_musb_init, .exit = am35x_musb_exit, @@ -572,6 +572,8 @@ static int __init am35x_probe(struct platform_device *pdev) glue->dev = &pdev->dev; glue->musb = musb; + pdata->platform_ops = &am35x_ops; + platform_set_drvdata(pdev, glue); ret = platform_device_add_resources(musb, pdev->resource, diff --git a/drivers/usb/musb/blackfin.c b/drivers/usb/musb/blackfin.c index 02eded21d171..03cb001c0e19 100644 --- a/drivers/usb/musb/blackfin.c +++ b/drivers/usb/musb/blackfin.c @@ -436,7 +436,7 @@ static int bfin_musb_exit(struct musb *musb) return 0; } -const struct musb_platform_ops musb_ops = { +static const struct musb_platform_ops bfin_ops = { .init = bfin_musb_init, .exit = bfin_musb_exit, @@ -479,6 +479,8 @@ static int __init bfin_probe(struct platform_device *pdev) glue->dev = &pdev->dev; glue->musb = musb; + pdata->platform_ops = &bfin_ops; + platform_set_drvdata(pdev, glue); ret = platform_device_add_resources(musb, pdev->resource, diff --git a/drivers/usb/musb/da8xx.c b/drivers/usb/musb/da8xx.c index 94ddfe01d673..45ccac3aad9d 100644 --- a/drivers/usb/musb/da8xx.c +++ b/drivers/usb/musb/da8xx.c @@ -475,7 +475,7 @@ static int da8xx_musb_exit(struct musb *musb) return 0; } -const struct musb_platform_ops musb_ops = { +static const struct musb_platform_ops da8xx_ops = { .init = da8xx_musb_init, .exit = da8xx_musb_exit, @@ -517,6 +517,8 @@ static int __init da8xx_probe(struct platform_device *pdev) glue->dev = &pdev->dev; glue->musb = musb; + pdata->platform_ops = &da8xx_ops; + platform_set_drvdata(pdev, glue); ret = platform_device_add_resources(musb, pdev->resource, diff --git a/drivers/usb/musb/davinci.c b/drivers/usb/musb/davinci.c index 661870a1cd4d..831a04dd5a53 100644 --- a/drivers/usb/musb/davinci.c +++ b/drivers/usb/musb/davinci.c @@ -510,7 +510,7 @@ static int davinci_musb_exit(struct musb *musb) return 0; } -const struct musb_platform_ops musb_ops = { +static const struct musb_platform_ops davinci_ops = { .init = davinci_musb_init, .exit = davinci_musb_exit, @@ -551,6 +551,8 @@ static int __init davinci_probe(struct platform_device *pdev) glue->dev = &pdev->dev; glue->musb = musb; + pdata->platform_ops = &davinci_ops; + platform_set_drvdata(pdev, glue); ret = platform_device_add_resources(musb, pdev->resource, diff --git a/drivers/usb/musb/musb_core.c b/drivers/usb/musb/musb_core.c index 1ca14f90c994..dcc77ef6cfff 100644 --- a/drivers/usb/musb/musb_core.c +++ b/drivers/usb/musb/musb_core.c @@ -1897,7 +1897,6 @@ allocate_instance(struct device *dev, } musb->controller = dev; - musb->ops = &musb_ops; return musb; } @@ -1997,6 +1996,7 @@ bad_config: musb->board_set_power = plat->set_power; musb->set_clock = plat->set_clock; musb->min_power = plat->min_power; + musb->ops = plat->platform_ops; /* Clock usage is chip-specific ... functional clock (DaVinci, * OMAP2430), or PHY ref (some TUSB6010 boards). All this core diff --git a/drivers/usb/musb/musb_core.h b/drivers/usb/musb/musb_core.h index 9594b9d1d27b..fac1eab3c59f 100644 --- a/drivers/usb/musb/musb_core.h +++ b/drivers/usb/musb/musb_core.h @@ -281,8 +281,6 @@ struct musb_platform_ops { void (*set_vbus)(struct musb *musb, int on); }; -extern const struct musb_platform_ops musb_ops; - /* * struct musb_hw_ep - endpoint hardware (bidirectional) * diff --git a/drivers/usb/musb/omap2430.c b/drivers/usb/musb/omap2430.c index bca9df7557a4..2eea1703e630 100644 --- a/drivers/usb/musb/omap2430.c +++ b/drivers/usb/musb/omap2430.c @@ -333,7 +333,7 @@ static int omap2430_musb_exit(struct musb *musb) return 0; } -const struct musb_platform_ops musb_ops = { +static const struct musb_platform_ops omap2430_ops = { .init = omap2430_musb_init, .exit = omap2430_musb_exit, @@ -378,6 +378,8 @@ static int __init omap2430_probe(struct platform_device *pdev) glue->dev = &pdev->dev; glue->musb = musb; + pdata->platform_ops = &omap2430_ops; + platform_set_drvdata(pdev, glue); ret = platform_device_add_resources(musb, pdev->resource, diff --git a/drivers/usb/musb/tusb6010.c b/drivers/usb/musb/tusb6010.c index 2ff78d6b2eff..d6b832641c53 100644 --- a/drivers/usb/musb/tusb6010.c +++ b/drivers/usb/musb/tusb6010.c @@ -1178,7 +1178,7 @@ static int tusb_musb_exit(struct musb *musb) return 0; } -const struct musb_platform_ops musb_ops = { +static const struct musb_platform_ops tusb_ops = { .init = tusb_musb_init, .exit = tusb_musb_exit, @@ -1221,6 +1221,8 @@ static int __init tusb_probe(struct platform_device *pdev) glue->dev = &pdev->dev; glue->musb = musb; + pdata->platform_ops = &tusb_ops; + platform_set_drvdata(pdev, glue); ret = platform_device_add_resources(musb, pdev->resource, diff --git a/include/linux/usb/musb.h b/include/linux/usb/musb.h index e2191d4db4dd..6f4e5014cf5e 100644 --- a/include/linux/usb/musb.h +++ b/include/linux/usb/musb.h @@ -126,6 +126,9 @@ struct musb_hdrc_platform_data { /* Architecture specific board data */ void *board_data; + + /* Platform specific struct musb_ops pointer */ + const void *platform_ops; }; -- cgit v1.2.3 From 3b7029670d39d22f288ece95254e9ba5ceddd6ba Mon Sep 17 00:00:00 2001 From: Felipe Balbi Date: Thu, 2 Dec 2010 09:51:00 +0200 Subject: usb: musb: mark ->set_clock deprecated ... we will completely drop that need by moving clock handling to platform glue layer. Marking as deprecated will allow us to catch all users easily. Signed-off-by: Felipe Balbi --- include/linux/usb/musb.h | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'include/linux/usb/musb.h') diff --git a/include/linux/usb/musb.h b/include/linux/usb/musb.h index 6f4e5014cf5e..0b72b5741645 100644 --- a/include/linux/usb/musb.h +++ b/include/linux/usb/musb.h @@ -119,7 +119,7 @@ struct musb_hdrc_platform_data { int (*set_power)(int state); /* Turn device clock on or off */ - int (*set_clock)(struct clk *clock, int is_on); + int (*set_clock)(struct clk *clock, int is_on) __deprecated; /* MUSB configuration-specific details */ struct musb_hdrc_config *config; -- cgit v1.2.3 From fa56df915d101770a495569473b4c13b1904087b Mon Sep 17 00:00:00 2001 From: Felipe Balbi Date: Thu, 2 Dec 2010 10:55:29 +0200 Subject: usb: musb: drop the set_clock magic now that platform glue layer handles clock completely, that function is completely useless for us. Drop it. Signed-off-by: Felipe Balbi --- drivers/usb/musb/musb_core.h | 2 -- include/linux/usb/musb.h | 3 --- 2 files changed, 5 deletions(-) (limited to 'include/linux/usb/musb.h') diff --git a/drivers/usb/musb/musb_core.h b/drivers/usb/musb/musb_core.h index 6c8e9630fb19..1e538675ab86 100644 --- a/drivers/usb/musb/musb_core.h +++ b/drivers/usb/musb/musb_core.h @@ -455,8 +455,6 @@ struct musb { u8 board_mode; /* enum musb_mode */ int (*board_set_power)(int state); - int (*set_clock)(struct clk *clk, int is_active); - u8 min_power; /* vbus for periph, in mA/2 */ bool is_host; diff --git a/include/linux/usb/musb.h b/include/linux/usb/musb.h index 0b72b5741645..0b0e383035e5 100644 --- a/include/linux/usb/musb.h +++ b/include/linux/usb/musb.h @@ -118,9 +118,6 @@ struct musb_hdrc_platform_data { /* Power the device on or off */ int (*set_power)(int state); - /* Turn device clock on or off */ - int (*set_clock)(struct clk *clock, int is_on) __deprecated; - /* MUSB configuration-specific details */ struct musb_hdrc_config *config; -- cgit v1.2.3