Skip to content

Commit

Permalink
---
Browse files Browse the repository at this point in the history
yaml
---
r: 226994
b: refs/heads/master
c: 9cb0308
h: refs/heads/master
v: v3
  • Loading branch information
Felipe Balbi committed Dec 10, 2010
1 parent 3d28532 commit ca2f52b
Show file tree
Hide file tree
Showing 10 changed files with 93 additions and 11 deletions.
2 changes: 1 addition & 1 deletion [refs]
Original file line number Diff line number Diff line change
@@ -1,2 +1,2 @@
---
refs/heads/master: 8ceae51ed5d1739d4ed5c4b947d12ff1d7df0e89
refs/heads/master: 9cb0308eec7a965136fe9fc6d1be3548c01a4a1e
2 changes: 1 addition & 1 deletion trunk/arch/blackfin/mach-bf527/boards/ad7160eval.c
Original file line number Diff line number Diff line change
Expand Up @@ -83,7 +83,7 @@ static struct musb_hdrc_platform_data musb_plat = {
static u64 musb_dmamask = ~(u32)0;

static struct platform_device musb_device = {
.name = "musb-hdrc",
.name = "musb-blackfin",
.id = 0,
.dev = {
.dma_mask = &musb_dmamask,
Expand Down
2 changes: 1 addition & 1 deletion trunk/arch/blackfin/mach-bf527/boards/cm_bf527.c
Original file line number Diff line number Diff line change
Expand Up @@ -120,7 +120,7 @@ static struct musb_hdrc_platform_data musb_plat = {
static u64 musb_dmamask = ~(u32)0;

static struct platform_device musb_device = {
.name = "musb-hdrc",
.name = "musb-blackfin",
.id = 0,
.dev = {
.dma_mask = &musb_dmamask,
Expand Down
2 changes: 1 addition & 1 deletion trunk/arch/blackfin/mach-bf527/boards/ezbrd.c
Original file line number Diff line number Diff line change
Expand Up @@ -84,7 +84,7 @@ static struct musb_hdrc_platform_data musb_plat = {
static u64 musb_dmamask = ~(u32)0;

static struct platform_device musb_device = {
.name = "musb-hdrc",
.name = "musb-blackfin",
.id = 0,
.dev = {
.dma_mask = &musb_dmamask,
Expand Down
2 changes: 1 addition & 1 deletion trunk/arch/blackfin/mach-bf527/boards/ezkit.c
Original file line number Diff line number Diff line change
Expand Up @@ -124,7 +124,7 @@ static struct musb_hdrc_platform_data musb_plat = {
static u64 musb_dmamask = ~(u32)0;

static struct platform_device musb_device = {
.name = "musb-hdrc",
.name = "musb-blackfin",
.id = 0,
.dev = {
.dma_mask = &musb_dmamask,
Expand Down
2 changes: 1 addition & 1 deletion trunk/arch/blackfin/mach-bf527/boards/tll6527m.c
Original file line number Diff line number Diff line change
Expand Up @@ -91,7 +91,7 @@ static struct musb_hdrc_platform_data musb_plat = {
static u64 musb_dmamask = ~(u32)0;

static struct platform_device musb_device = {
.name = "musb-hdrc",
.name = "musb-blackfin",
.id = 0,
.dev = {
.dma_mask = &musb_dmamask,
Expand Down
2 changes: 1 addition & 1 deletion trunk/arch/blackfin/mach-bf548/boards/cm_bf548.c
Original file line number Diff line number Diff line change
Expand Up @@ -520,7 +520,7 @@ static struct musb_hdrc_platform_data musb_plat = {
static u64 musb_dmamask = ~(u32)0;

static struct platform_device musb_device = {
.name = "musb-hdrc",
.name = "musb-blackfin",
.id = 0,
.dev = {
.dma_mask = &musb_dmamask,
Expand Down
2 changes: 1 addition & 1 deletion trunk/arch/blackfin/mach-bf548/boards/ezkit.c
Original file line number Diff line number Diff line change
Expand Up @@ -625,7 +625,7 @@ static struct musb_hdrc_platform_data musb_plat = {
static u64 musb_dmamask = ~(u32)0;

static struct platform_device musb_device = {
.name = "musb-hdrc",
.name = "musb-blackfin",
.id = 0,
.dev = {
.dma_mask = &musb_dmamask,
Expand Down
4 changes: 1 addition & 3 deletions trunk/drivers/usb/musb/Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -13,14 +13,12 @@ musb_hdrc-$(CONFIG_USB_MUSB_HDRC_HCD) += musb_virthub.o musb_host.o
musb_hdrc-$(CONFIG_DEBUG_FS) += musb_debugfs.o

# Hardware Glue Layer

musb_hdrc-$(CONFIG_USB_MUSB_BLACKFIN) += blackfin.o

obj-$(CONFIG_USB_MUSB_OMAP2PLUS) += omap2430.o
obj-$(CONFIG_USB_MUSB_AM35X) += am35x.o
obj-$(CONFIG_USB_MUSB_TUSB6010) += tusb6010.o
obj-$(CONFIG_USB_MUSB_DAVINCI) += davinci.o
obj-$(CONFIG_USB_MUSB_DA8XX) += da8xx.o
obj-$(CONFIG_USB_MUSB_BLACKFIN) += blackfin.o

# the kconfig must guarantee that only one of the
# possible I/O schemes will be enabled at a time ...
Expand Down
84 changes: 84 additions & 0 deletions trunk/drivers/usb/musb/blackfin.c
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,8 @@
#include <linux/list.h>
#include <linux/gpio.h>
#include <linux/io.h>
#include <linux/platform_device.h>
#include <linux/dma-mapping.h>

#include <asm/cacheflush.h>

Expand Down Expand Up @@ -442,3 +444,85 @@ const struct musb_platform_ops musb_ops = {
.vbus_status = bfin_musb_vbus_status,
.set_vbus = bfin_musb_set_vbus,
};

static u64 bfin_dmamask = DMA_BIT_MASK(32);

static int __init bfin_probe(struct platform_device *pdev)
{
struct musb_hdrc_platform_data *pdata = pdev->dev.platform_data;
struct platform_device *musb;

int ret = -ENOMEM;

musb = platform_device_alloc("musb-hdrc", -1);
if (!musb) {
dev_err(&pdev->dev, "failed to allocate musb device\n");
goto err0;
}

musb->dev.parent = &pdev->dev;
musb->dev.dma_mask = &bfin_dmamask;
musb->dev.coherent_dma_mask = bfin_dmamask;

platform_set_drvdata(pdev, musb);

ret = platform_device_add_resources(musb, pdev->resource,
pdev->num_resources);
if (ret) {
dev_err(&pdev->dev, "failed to add resources\n");
goto err1;
}

ret = platform_device_add_data(musb, pdata, sizeof(*pdata));
if (ret) {
dev_err(&pdev->dev, "failed to add platform_data\n");
goto err1;
}

ret = platform_device_add(musb);
if (ret) {
dev_err(&pdev->dev, "failed to register musb device\n");
goto err1;
}

return 0;

err1:
platform_device_put(musb);

err0:
return ret;
}

static int __exit bfin_remove(struct platform_device *pdev)
{
struct platform_device *musb = platform_get_drvdata(pdev);

platform_device_del(musb);
platform_device_put(musb);

return 0;
}

static struct platform_driver bfin_driver = {
.remove = __exit_p(bfin_remove),
.driver = {
.name = "musb-bfin",
},
};

MODULE_DESCRIPTION("Blackfin MUSB Glue Layer");
MODULE_AUTHOR("Bryan Wy <cooloney@kernel.org>");
MODULE_LICENSE("GPL v2");

static int __init bfin_init(void)
{
return platform_driver_probe(&bfin_driver, bfin_probe);
}
subsys_initcall(bfin_init);

static void __exit bfin_exit(void)
{
platform_driver_unregister(&bfin_driver);
}
module_exit(bfin_exit);

0 comments on commit ca2f52b

Please sign in to comment.