Re: [PATCH 11/22] usb: musb: split da8xx to its own platform_driver

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



Hello.

On 02-12-2010 12:25, Felipe Balbi wrote:

Just adding its own platform_driver, not really
using it yet.

When all HW glue layers are converted, more 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@xxxxxx>
[...]

diff --git a/arch/arm/mach-davinci/usb.c b/arch/arm/mach-davinci/usb.c
index a9939ac..5d06b52 100644
--- a/arch/arm/mach-davinci/usb.c
+++ b/arch/arm/mach-davinci/usb.c
@@ -97,6 +97,9 @@ void __init davinci_setup_usb(unsigned mA, unsigned potpgt_ms)
  	} else	/* other devices don't have dedicated CPPI IRQ */
  		usb_dev.num_resources = 2;

+	if (cpu_is_davinci_da830() || cpu_is_davinci_da850())
+		usb_dev.name = "musb-da8xx";

Er, we need a separate platfrom device for DA8xx now... Wait! davinci_setup_usb() doesn't register platform device for DA8xx, da8xx_register_usb20() does it. This is completely wrong then...

diff --git a/drivers/usb/musb/da8xx.c b/drivers/usb/musb/da8xx.c
index b4be7f2..d44032e 100644
--- a/drivers/usb/musb/da8xx.c
+++ b/drivers/usb/musb/da8xx.c
[...]
@@ -480,3 +482,88 @@ struct musb_platform_ops musb_ops = {

  	.set_vbus	= da8xx_set_vbus,
  };
+
+static u64 da8xx_dmamask = DMA_BIT_MASK(32);
+
+static int __init da8xx_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		=&da8xx_dmamask;
+	musb->dev.coherent_dma_mask	= da8xx_dmamask;

   Same comments about DMA masks as in the DaVinci glue...

+err2:
+	platform_device_put(musb);
+
+err1:
+	platform_device_del(musb);
+
+err0:
+	return ret;
+}
+
+static int __exit da8xx_remove(struct platform_device *pdev)
+{
+	struct platform_device		*musb = platform_get_drvdata(pdev);
+
+	platform_device_put(musb);
+	platform_device_del(musb);

   Same comments about cleanup as for DaVinci...

+MODULE_DESCRIPTION("OMAP2PLUS MUSB Glue Layer");
+MODULE_AUTHOR("Felipe Balbi<balbi@xxxxxx>");

   Well, I thought I was the author...

+MODULE_LICENSE("GPL v2");

WBR, Sergei
--
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


[Index of Archives]     [Linux Media]     [Linux Input]     [Linux Audio Users]     [Yosemite News]     [Linux Kernel]     [Linux SCSI]     [Old Linux USB Devel Archive]

  Powered by Linux