Skip to content

Commit

Permalink
Merge tag 'musb-for-v3.8' of git://git.kernel.org/pub/scm/linux/kerne…
Browse files Browse the repository at this point in the history
…l/git/balbi/usb into usb-next

USB musb merge from Felipe:

"usb: musb: patches for v3.8 merge window

We have here the usual set of cleanups for the MUSB driver; a
big set of patches converting platform_device_del() and
platform_device_put() into platform_device_unregister().

Another big set was applied converting to module_platform_driver()
macro in order to reduce some boilerplate code from all glue
layers.

Other than that, we had a series fixing one known silicon errata
where we couldn't read a few registers. In order to fix that
we're now using shadow variables for reads and only writing
to the registers which are known to break functionality when
read."
  • Loading branch information
Greg Kroah-Hartman committed Nov 12, 2012
2 parents 8e06c6a + d928cd2 commit 3a3f2e5
Show file tree
Hide file tree
Showing 16 changed files with 192 additions and 357 deletions.
8 changes: 4 additions & 4 deletions Documentation/devicetree/bindings/usb/am33xx-usb.txt
Original file line number Diff line number Diff line change
Expand Up @@ -3,12 +3,12 @@ AM33XX MUSB GLUE
- ti,hwmods : must be "usb_otg_hs"
- multipoint : Should be "1" indicating the musb controller supports
multipoint. This is a MUSB configuration-specific setting.
- num_eps : Specifies the number of endpoints. This is also a
- num-eps : Specifies the number of endpoints. This is also a
MUSB configuration-specific setting. Should be set to "16"
- ram_bits : Specifies the ram address size. Should be set to "12"
- port0_mode : Should be "3" to represent OTG. "1" signifies HOST and "2"
- ram-bits : Specifies the ram address size. Should be set to "12"
- port0-mode : Should be "3" to represent OTG. "1" signifies HOST and "2"
represents PERIPHERAL.
- port1_mode : Should be "1" to represent HOST. "3" signifies OTG and "2"
- port1-mode : Should be "1" to represent HOST. "3" signifies OTG and "2"
represents PERIPHERAL.
- power : Should be "250". This signifies the controller can supply upto
500mA when operating in host mode.
34 changes: 4 additions & 30 deletions drivers/usb/musb/am35x.c
Original file line number Diff line number Diff line change
Expand Up @@ -465,26 +465,17 @@ static int __devinit am35x_probe(struct platform_device *pdev)
struct clk *clk;

int ret = -ENOMEM;
int musbid;

glue = kzalloc(sizeof(*glue), GFP_KERNEL);
if (!glue) {
dev_err(&pdev->dev, "failed to allocate glue context\n");
goto err0;
}

/* get the musb id */
musbid = musb_get_id(&pdev->dev, GFP_KERNEL);
if (musbid < 0) {
dev_err(&pdev->dev, "failed to allocate musb id\n");
ret = -ENOMEM;
goto err1;
}

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

phy_clk = clk_get(&pdev->dev, "fck");
Expand Down Expand Up @@ -513,7 +504,6 @@ static int __devinit am35x_probe(struct platform_device *pdev)
goto err6;
}

musb->id = musbid;
musb->dev.parent = &pdev->dev;
musb->dev.dma_mask = &am35x_dmamask;
musb->dev.coherent_dma_mask = am35x_dmamask;
Expand Down Expand Up @@ -563,9 +553,6 @@ static int __devinit am35x_probe(struct platform_device *pdev)
err3:
platform_device_put(musb);

err2:
musb_put_id(&pdev->dev, musbid);

err1:
kfree(glue);

Expand All @@ -577,9 +564,7 @@ static int __devexit am35x_remove(struct platform_device *pdev)
{
struct am35x_glue *glue = platform_get_drvdata(pdev);

musb_put_id(&pdev->dev, glue->musb->id);
platform_device_del(glue->musb);
platform_device_put(glue->musb);
platform_device_unregister(glue->musb);
clk_disable(glue->clk);
clk_disable(glue->phy_clk);
clk_put(glue->clk);
Expand Down Expand Up @@ -654,15 +639,4 @@ static struct platform_driver am35x_driver = {
MODULE_DESCRIPTION("AM35x MUSB Glue Layer");
MODULE_AUTHOR("Ajay Kumar Gupta <ajay.gupta@ti.com>");
MODULE_LICENSE("GPL v2");

static int __init am35x_init(void)
{
return platform_driver_register(&am35x_driver);
}
module_init(am35x_init);

static void __exit am35x_exit(void)
{
platform_driver_unregister(&am35x_driver);
}
module_exit(am35x_exit);
module_platform_driver(am35x_driver);
34 changes: 4 additions & 30 deletions drivers/usb/musb/blackfin.c
Original file line number Diff line number Diff line change
Expand Up @@ -455,29 +455,19 @@ static int __devinit bfin_probe(struct platform_device *pdev)
struct bfin_glue *glue;

int ret = -ENOMEM;
int musbid;

glue = kzalloc(sizeof(*glue), GFP_KERNEL);
if (!glue) {
dev_err(&pdev->dev, "failed to allocate glue context\n");
goto err0;
}

/* get the musb id */
musbid = musb_get_id(&pdev->dev, GFP_KERNEL);
if (musbid < 0) {
dev_err(&pdev->dev, "failed to allocate musb id\n");
ret = -ENOMEM;
goto err1;
}

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

musb->id = musbid;
musb->dev.parent = &pdev->dev;
musb->dev.dma_mask = &bfin_dmamask;
musb->dev.coherent_dma_mask = bfin_dmamask;
Expand Down Expand Up @@ -513,9 +503,6 @@ static int __devinit bfin_probe(struct platform_device *pdev)
err3:
platform_device_put(musb);

err2:
musb_put_id(&pdev->dev, musbid);

err1:
kfree(glue);

Expand All @@ -527,9 +514,7 @@ static int __devexit bfin_remove(struct platform_device *pdev)
{
struct bfin_glue *glue = platform_get_drvdata(pdev);

musb_put_id(&pdev->dev, glue->musb->id);
platform_device_del(glue->musb);
platform_device_put(glue->musb);
platform_device_unregister(glue->musb);
kfree(glue);

return 0;
Expand Down Expand Up @@ -585,15 +570,4 @@ static struct platform_driver bfin_driver = {
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_register(&bfin_driver);
}
module_init(bfin_init);

static void __exit bfin_exit(void)
{
platform_driver_unregister(&bfin_driver);
}
module_exit(bfin_exit);
module_platform_driver(bfin_driver);
1 change: 1 addition & 0 deletions drivers/usb/musb/cppi_dma.c
Original file line number Diff line number Diff line change
Expand Up @@ -1314,6 +1314,7 @@ irqreturn_t cppi_interrupt(int irq, void *dev_id)

return IRQ_HANDLED;
}
EXPORT_SYMBOL_GPL(cppi_interrupt);

/* Instantiate a software object representing a DMA controller. */
struct dma_controller *__devinit
Expand Down
34 changes: 4 additions & 30 deletions drivers/usb/musb/da8xx.c
Original file line number Diff line number Diff line change
Expand Up @@ -480,26 +480,17 @@ static int __devinit da8xx_probe(struct platform_device *pdev)
struct clk *clk;

int ret = -ENOMEM;
int musbid;

glue = kzalloc(sizeof(*glue), GFP_KERNEL);
if (!glue) {
dev_err(&pdev->dev, "failed to allocate glue context\n");
goto err0;
}

/* get the musb id */
musbid = musb_get_id(&pdev->dev, GFP_KERNEL);
if (musbid < 0) {
dev_err(&pdev->dev, "failed to allocate musb id\n");
ret = -ENOMEM;
goto err1;
}

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

clk = clk_get(&pdev->dev, "usb20");
Expand All @@ -515,7 +506,6 @@ static int __devinit da8xx_probe(struct platform_device *pdev)
goto err4;
}

musb->id = musbid;
musb->dev.parent = &pdev->dev;
musb->dev.dma_mask = &da8xx_dmamask;
musb->dev.coherent_dma_mask = da8xx_dmamask;
Expand Down Expand Up @@ -558,9 +548,6 @@ static int __devinit da8xx_probe(struct platform_device *pdev)
err3:
platform_device_put(musb);

err2:
musb_put_id(&pdev->dev, musbid);

err1:
kfree(glue);

Expand All @@ -572,9 +559,7 @@ static int __devexit da8xx_remove(struct platform_device *pdev)
{
struct da8xx_glue *glue = platform_get_drvdata(pdev);

musb_put_id(&pdev->dev, glue->musb->id);
platform_device_del(glue->musb);
platform_device_put(glue->musb);
platform_device_unregister(glue->musb);
clk_disable(glue->clk);
clk_put(glue->clk);
kfree(glue);
Expand All @@ -593,15 +578,4 @@ static struct platform_driver da8xx_driver = {
MODULE_DESCRIPTION("DA8xx/OMAP-L1x MUSB Glue Layer");
MODULE_AUTHOR("Sergei Shtylyov <sshtylyov@ru.mvista.com>");
MODULE_LICENSE("GPL v2");

static int __init da8xx_init(void)
{
return platform_driver_register(&da8xx_driver);
}
module_init(da8xx_init);

static void __exit da8xx_exit(void)
{
platform_driver_unregister(&da8xx_driver);
}
module_exit(da8xx_exit);
module_platform_driver(da8xx_driver);
34 changes: 4 additions & 30 deletions drivers/usb/musb/davinci.c
Original file line number Diff line number Diff line change
Expand Up @@ -512,26 +512,17 @@ static int __devinit davinci_probe(struct platform_device *pdev)
struct clk *clk;

int ret = -ENOMEM;
int musbid;

glue = kzalloc(sizeof(*glue), GFP_KERNEL);
if (!glue) {
dev_err(&pdev->dev, "failed to allocate glue context\n");
goto err0;
}

/* get the musb id */
musbid = musb_get_id(&pdev->dev, GFP_KERNEL);
if (musbid < 0) {
dev_err(&pdev->dev, "failed to allocate musb id\n");
ret = -ENOMEM;
goto err1;
}

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

clk = clk_get(&pdev->dev, "usb");
Expand All @@ -547,7 +538,6 @@ static int __devinit davinci_probe(struct platform_device *pdev)
goto err4;
}

musb->id = musbid;
musb->dev.parent = &pdev->dev;
musb->dev.dma_mask = &davinci_dmamask;
musb->dev.coherent_dma_mask = davinci_dmamask;
Expand Down Expand Up @@ -590,9 +580,6 @@ static int __devinit davinci_probe(struct platform_device *pdev)
err3:
platform_device_put(musb);

err2:
musb_put_id(&pdev->dev, musbid);

err1:
kfree(glue);

Expand All @@ -604,9 +591,7 @@ static int __devexit davinci_remove(struct platform_device *pdev)
{
struct davinci_glue *glue = platform_get_drvdata(pdev);

musb_put_id(&pdev->dev, glue->musb->id);
platform_device_del(glue->musb);
platform_device_put(glue->musb);
platform_device_unregister(glue->musb);
clk_disable(glue->clk);
clk_put(glue->clk);
kfree(glue);
Expand All @@ -625,15 +610,4 @@ static struct platform_driver davinci_driver = {
MODULE_DESCRIPTION("DaVinci MUSB Glue Layer");
MODULE_AUTHOR("Felipe Balbi <balbi@ti.com>");
MODULE_LICENSE("GPL v2");

static int __init davinci_init(void)
{
return platform_driver_register(&davinci_driver);
}
module_init(davinci_init);

static void __exit davinci_exit(void)
{
platform_driver_unregister(&davinci_driver);
}
module_exit(davinci_exit);
module_platform_driver(davinci_driver);
Loading

0 comments on commit 3a3f2e5

Please sign in to comment.