Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit 7f6283ed authored by Tony Lindgren's avatar Tony Lindgren Committed by Felipe Balbi
Browse files

usb: musb: Set up function pointers for DMA



Set up function pointers for DMA so get closer to
being able to build in all the DMA engines.

Signed-off-by: default avatarTony Lindgren <tony@atomide.com>
Signed-off-by: default avatarFelipe Balbi <balbi@ti.com>
parent f8e9f34f
Loading
Loading
Loading
Loading
+4 −0
Original line number Diff line number Diff line
@@ -443,6 +443,10 @@ static const struct musb_platform_ops am35x_ops = {
	.exit		= am35x_musb_exit,

	.read_fifo	= am35x_read_fifo,
#ifdef CONFIG_USB_INVENTRA_DMA
	.dma_init	= musbhs_dma_controller_create,
	.dma_exit	= musbhs_dma_controller_destroy,
#endif
	.enable		= am35x_musb_enable,
	.disable	= am35x_musb_disable,

+4 −0
Original line number Diff line number Diff line
@@ -478,6 +478,10 @@ static const struct musb_platform_ops bfin_ops = {
	.fifo_mode	= 2,
	.read_fifo	= bfin_read_fifo,
	.write_fifo	= bfin_write_fifo,
#ifdef CONFIG_USB_INVENTRA_DMA
	.dma_init	= musbhs_dma_controller_create,
	.dma_exit	= musbhs_dma_controller_destroy,
#endif
	.enable		= bfin_musb_enable,
	.disable	= bfin_musb_disable,

+6 −3
Original line number Diff line number Diff line
@@ -1297,7 +1297,8 @@ irqreturn_t cppi_interrupt(int irq, void *dev_id)
EXPORT_SYMBOL_GPL(cppi_interrupt);

/* Instantiate a software object representing a DMA controller. */
struct dma_controller *dma_controller_create(struct musb *musb, void __iomem *mregs)
struct dma_controller *
cppi_dma_controller_create(struct musb *musb, void __iomem *mregs)
{
	struct cppi		*controller;
	struct device		*dev = musb->controller;
@@ -1334,7 +1335,7 @@ struct dma_controller *dma_controller_create(struct musb *musb, void __iomem *mr
	if (irq > 0) {
		if (request_irq(irq, cppi_interrupt, 0, "cppi-dma", musb)) {
			dev_err(dev, "request_irq %d failed!\n", irq);
			dma_controller_destroy(&controller->controller);
			musb_dma_controller_destroy(&controller->controller);
			return NULL;
		}
		controller->irq = irq;
@@ -1343,11 +1344,12 @@ struct dma_controller *dma_controller_create(struct musb *musb, void __iomem *mr
	cppi_controller_start(controller);
	return &controller->controller;
}
EXPORT_SYMBOL_GPL(cppi_dma_controller_create);

/*
 *  Destroy a previously-instantiated DMA controller.
 */
void dma_controller_destroy(struct dma_controller *c)
void cppi_dma_controller_destroy(struct dma_controller *c)
{
	struct cppi	*cppi;

@@ -1363,6 +1365,7 @@ void dma_controller_destroy(struct dma_controller *c)

	kfree(cppi);
}
EXPORT_SYMBOL_GPL(cppi_dma_controller_destroy);

/*
 * Context: controller irqlocked, endpoint selected
+4 −0
Original line number Diff line number Diff line
@@ -463,6 +463,10 @@ static const struct musb_platform_ops da8xx_ops = {
	.exit		= da8xx_musb_exit,

	.fifo_mode	= 2,
#ifdef CONFIG_USB_TI_CPPI_DMA
	.dma_init	= cppi_dma_controller_create,
	.dma_exit	= cppi_dma_controller_destroy,
#endif
	.enable		= da8xx_musb_enable,
	.disable	= da8xx_musb_disable,

+4 −0
Original line number Diff line number Diff line
@@ -495,6 +495,10 @@ static const struct musb_platform_ops davinci_ops = {
	.init		= davinci_musb_init,
	.exit		= davinci_musb_exit,

#ifdef CONFIG_USB_TI_CPPI_DMA
	.dma_init	= cppi_dma_controller_create,
	.dma_exit	= cppi_dma_controller_destroy,
#endif
	.enable		= davinci_musb_enable,
	.disable	= davinci_musb_disable,

Loading