aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorFelipe Balbi <balbi@ti.com>2010-12-02 02:21:05 -0500
committerFelipe Balbi <balbi@ti.com>2010-12-10 03:21:16 -0500
commit9cb0308eec7a965136fe9fc6d1be3548c01a4a1e (patch)
tree7aa08956e8396c0e4fa77c94d0af62bbca5cf022
parent8ceae51ed5d1739d4ed5c4b947d12ff1d7df0e89 (diff)
usb: musb: split blackfin to its own platform_driver
Just adding its own platform_driver, not really using it yet. Later patches will come to split power management code from musb_core and move it completely to HW glue layer. Signed-off-by: Felipe Balbi <balbi@ti.com>
-rw-r--r--arch/blackfin/mach-bf527/boards/ad7160eval.c2
-rw-r--r--arch/blackfin/mach-bf527/boards/cm_bf527.c2
-rw-r--r--arch/blackfin/mach-bf527/boards/ezbrd.c2
-rw-r--r--arch/blackfin/mach-bf527/boards/ezkit.c2
-rw-r--r--arch/blackfin/mach-bf527/boards/tll6527m.c2
-rw-r--r--arch/blackfin/mach-bf548/boards/cm_bf548.c2
-rw-r--r--arch/blackfin/mach-bf548/boards/ezkit.c2
-rw-r--r--drivers/usb/musb/Makefile4
-rw-r--r--drivers/usb/musb/blackfin.c84
9 files changed, 92 insertions, 10 deletions
diff --git a/arch/blackfin/mach-bf527/boards/ad7160eval.c b/arch/blackfin/mach-bf527/boards/ad7160eval.c
index ec9f2612be1..52295fff557 100644
--- a/arch/blackfin/mach-bf527/boards/ad7160eval.c
+++ b/arch/blackfin/mach-bf527/boards/ad7160eval.c
@@ -83,7 +83,7 @@ static struct musb_hdrc_platform_data musb_plat = {
83static u64 musb_dmamask = ~(u32)0; 83static u64 musb_dmamask = ~(u32)0;
84 84
85static struct platform_device musb_device = { 85static struct platform_device musb_device = {
86 .name = "musb-hdrc", 86 .name = "musb-blackfin",
87 .id = 0, 87 .id = 0,
88 .dev = { 88 .dev = {
89 .dma_mask = &musb_dmamask, 89 .dma_mask = &musb_dmamask,
diff --git a/arch/blackfin/mach-bf527/boards/cm_bf527.c b/arch/blackfin/mach-bf527/boards/cm_bf527.c
index a7627dee688..50533edc399 100644
--- a/arch/blackfin/mach-bf527/boards/cm_bf527.c
+++ b/arch/blackfin/mach-bf527/boards/cm_bf527.c
@@ -120,7 +120,7 @@ static struct musb_hdrc_platform_data musb_plat = {
120static u64 musb_dmamask = ~(u32)0; 120static u64 musb_dmamask = ~(u32)0;
121 121
122static struct platform_device musb_device = { 122static struct platform_device musb_device = {
123 .name = "musb-hdrc", 123 .name = "musb-blackfin",
124 .id = 0, 124 .id = 0,
125 .dev = { 125 .dev = {
126 .dma_mask = &musb_dmamask, 126 .dma_mask = &musb_dmamask,
diff --git a/arch/blackfin/mach-bf527/boards/ezbrd.c b/arch/blackfin/mach-bf527/boards/ezbrd.c
index d1df634e24c..d06177b5fe2 100644
--- a/arch/blackfin/mach-bf527/boards/ezbrd.c
+++ b/arch/blackfin/mach-bf527/boards/ezbrd.c
@@ -84,7 +84,7 @@ static struct musb_hdrc_platform_data musb_plat = {
84static u64 musb_dmamask = ~(u32)0; 84static u64 musb_dmamask = ~(u32)0;
85 85
86static struct platform_device musb_device = { 86static struct platform_device musb_device = {
87 .name = "musb-hdrc", 87 .name = "musb-blackfin",
88 .id = 0, 88 .id = 0,
89 .dev = { 89 .dev = {
90 .dma_mask = &musb_dmamask, 90 .dma_mask = &musb_dmamask,
diff --git a/arch/blackfin/mach-bf527/boards/ezkit.c b/arch/blackfin/mach-bf527/boards/ezkit.c
index 5983abd8a7e..35a88a5a501 100644
--- a/arch/blackfin/mach-bf527/boards/ezkit.c
+++ b/arch/blackfin/mach-bf527/boards/ezkit.c
@@ -124,7 +124,7 @@ static struct musb_hdrc_platform_data musb_plat = {
124static u64 musb_dmamask = ~(u32)0; 124static u64 musb_dmamask = ~(u32)0;
125 125
126static struct platform_device musb_device = { 126static struct platform_device musb_device = {
127 .name = "musb-hdrc", 127 .name = "musb-blackfin",
128 .id = 0, 128 .id = 0,
129 .dev = { 129 .dev = {
130 .dma_mask = &musb_dmamask, 130 .dma_mask = &musb_dmamask,
diff --git a/arch/blackfin/mach-bf527/boards/tll6527m.c b/arch/blackfin/mach-bf527/boards/tll6527m.c
index 284ec1f4413..130861bd258 100644
--- a/arch/blackfin/mach-bf527/boards/tll6527m.c
+++ b/arch/blackfin/mach-bf527/boards/tll6527m.c
@@ -91,7 +91,7 @@ static struct musb_hdrc_platform_data musb_plat = {
91static u64 musb_dmamask = ~(u32)0; 91static u64 musb_dmamask = ~(u32)0;
92 92
93static struct platform_device musb_device = { 93static struct platform_device musb_device = {
94 .name = "musb-hdrc", 94 .name = "musb-blackfin",
95 .id = 0, 95 .id = 0,
96 .dev = { 96 .dev = {
97 .dma_mask = &musb_dmamask, 97 .dma_mask = &musb_dmamask,
diff --git a/arch/blackfin/mach-bf548/boards/cm_bf548.c b/arch/blackfin/mach-bf548/boards/cm_bf548.c
index f52334519a2..4c2ee678909 100644
--- a/arch/blackfin/mach-bf548/boards/cm_bf548.c
+++ b/arch/blackfin/mach-bf548/boards/cm_bf548.c
@@ -520,7 +520,7 @@ static struct musb_hdrc_platform_data musb_plat = {
520static u64 musb_dmamask = ~(u32)0; 520static u64 musb_dmamask = ~(u32)0;
521 521
522static struct platform_device musb_device = { 522static struct platform_device musb_device = {
523 .name = "musb-hdrc", 523 .name = "musb-blackfin",
524 .id = 0, 524 .id = 0,
525 .dev = { 525 .dev = {
526 .dma_mask = &musb_dmamask, 526 .dma_mask = &musb_dmamask,
diff --git a/arch/blackfin/mach-bf548/boards/ezkit.c b/arch/blackfin/mach-bf548/boards/ezkit.c
index e2c851bef99..4f03fbc4c9b 100644
--- a/arch/blackfin/mach-bf548/boards/ezkit.c
+++ b/arch/blackfin/mach-bf548/boards/ezkit.c
@@ -625,7 +625,7 @@ static struct musb_hdrc_platform_data musb_plat = {
625static u64 musb_dmamask = ~(u32)0; 625static u64 musb_dmamask = ~(u32)0;
626 626
627static struct platform_device musb_device = { 627static struct platform_device musb_device = {
628 .name = "musb-hdrc", 628 .name = "musb-blackfin",
629 .id = 0, 629 .id = 0,
630 .dev = { 630 .dev = {
631 .dma_mask = &musb_dmamask, 631 .dma_mask = &musb_dmamask,
diff --git a/drivers/usb/musb/Makefile b/drivers/usb/musb/Makefile
index d2a01291788..61f46affcf7 100644
--- a/drivers/usb/musb/Makefile
+++ b/drivers/usb/musb/Makefile
@@ -13,14 +13,12 @@ musb_hdrc-$(CONFIG_USB_MUSB_HDRC_HCD) += musb_virthub.o musb_host.o
13musb_hdrc-$(CONFIG_DEBUG_FS) += musb_debugfs.o 13musb_hdrc-$(CONFIG_DEBUG_FS) += musb_debugfs.o
14 14
15# Hardware Glue Layer 15# Hardware Glue Layer
16
17musb_hdrc-$(CONFIG_USB_MUSB_BLACKFIN) += blackfin.o
18
19obj-$(CONFIG_USB_MUSB_OMAP2PLUS) += omap2430.o 16obj-$(CONFIG_USB_MUSB_OMAP2PLUS) += omap2430.o
20obj-$(CONFIG_USB_MUSB_AM35X) += am35x.o 17obj-$(CONFIG_USB_MUSB_AM35X) += am35x.o
21obj-$(CONFIG_USB_MUSB_TUSB6010) += tusb6010.o 18obj-$(CONFIG_USB_MUSB_TUSB6010) += tusb6010.o
22obj-$(CONFIG_USB_MUSB_DAVINCI) += davinci.o 19obj-$(CONFIG_USB_MUSB_DAVINCI) += davinci.o
23obj-$(CONFIG_USB_MUSB_DA8XX) += da8xx.o 20obj-$(CONFIG_USB_MUSB_DA8XX) += da8xx.o
21obj-$(CONFIG_USB_MUSB_BLACKFIN) += blackfin.o
24 22
25# the kconfig must guarantee that only one of the 23# the kconfig must guarantee that only one of the
26# possible I/O schemes will be enabled at a time ... 24# possible I/O schemes will be enabled at a time ...
diff --git a/drivers/usb/musb/blackfin.c b/drivers/usb/musb/blackfin.c
index 9874501d642..b0968201d84 100644
--- a/drivers/usb/musb/blackfin.c
+++ b/drivers/usb/musb/blackfin.c
@@ -15,6 +15,8 @@
15#include <linux/list.h> 15#include <linux/list.h>
16#include <linux/gpio.h> 16#include <linux/gpio.h>
17#include <linux/io.h> 17#include <linux/io.h>
18#include <linux/platform_device.h>
19#include <linux/dma-mapping.h>
18 20
19#include <asm/cacheflush.h> 21#include <asm/cacheflush.h>
20 22
@@ -442,3 +444,85 @@ const struct musb_platform_ops musb_ops = {
442 .vbus_status = bfin_musb_vbus_status, 444 .vbus_status = bfin_musb_vbus_status,
443 .set_vbus = bfin_musb_set_vbus, 445 .set_vbus = bfin_musb_set_vbus,
444}; 446};
447
448static u64 bfin_dmamask = DMA_BIT_MASK(32);
449
450static int __init bfin_probe(struct platform_device *pdev)
451{
452 struct musb_hdrc_platform_data *pdata = pdev->dev.platform_data;
453 struct platform_device *musb;
454
455 int ret = -ENOMEM;
456
457 musb = platform_device_alloc("musb-hdrc", -1);
458 if (!musb) {
459 dev_err(&pdev->dev, "failed to allocate musb device\n");
460 goto err0;
461 }
462
463 musb->dev.parent = &pdev->dev;
464 musb->dev.dma_mask = &bfin_dmamask;
465 musb->dev.coherent_dma_mask = bfin_dmamask;
466
467 platform_set_drvdata(pdev, musb);
468
469 ret = platform_device_add_resources(musb, pdev->resource,
470 pdev->num_resources);
471 if (ret) {
472 dev_err(&pdev->dev, "failed to add resources\n");
473 goto err1;
474 }
475
476 ret = platform_device_add_data(musb, pdata, sizeof(*pdata));
477 if (ret) {
478 dev_err(&pdev->dev, "failed to add platform_data\n");
479 goto err1;
480 }
481
482 ret = platform_device_add(musb);
483 if (ret) {
484 dev_err(&pdev->dev, "failed to register musb device\n");
485 goto err1;
486 }
487
488 return 0;
489
490err1:
491 platform_device_put(musb);
492
493err0:
494 return ret;
495}
496
497static int __exit bfin_remove(struct platform_device *pdev)
498{
499 struct platform_device *musb = platform_get_drvdata(pdev);
500
501 platform_device_del(musb);
502 platform_device_put(musb);
503
504 return 0;
505}
506
507static struct platform_driver bfin_driver = {
508 .remove = __exit_p(bfin_remove),
509 .driver = {
510 .name = "musb-bfin",
511 },
512};
513
514MODULE_DESCRIPTION("Blackfin MUSB Glue Layer");
515MODULE_AUTHOR("Bryan Wy <cooloney@kernel.org>");
516MODULE_LICENSE("GPL v2");
517
518static int __init bfin_init(void)
519{
520 return platform_driver_probe(&bfin_driver, bfin_probe);
521}
522subsys_initcall(bfin_init);
523
524static void __exit bfin_exit(void)
525{
526 platform_driver_unregister(&bfin_driver);
527}
528module_exit(bfin_exit);