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

Commit 4bb04396 authored by Vinod Koul's avatar Vinod Koul
Browse files

Merge branch 'topic/dmaengine_cleanups' into for-linus

parents 89b90c09 184ff2aa
Loading
Loading
Loading
Loading
+26 −4
Original line number Diff line number Diff line
@@ -266,7 +266,7 @@ static int dma_memcpy_channels[] = {
			COH901318_CX_CTRL_DDMA_LEGACY | \
			COH901318_CX_CTRL_PRDD_SOURCE)

const struct coh_dma_channel chan_config[U300_DMA_CHANNELS] = {
static const struct coh_dma_channel chan_config[U300_DMA_CHANNELS] = {
	{
		.number = U300_DMA_MSL_TX_0,
		.name = "MSL TX 0",
@@ -1280,6 +1280,7 @@ struct coh901318_desc {
struct coh901318_base {
	struct device *dev;
	void __iomem *virtbase;
	unsigned int irq;
	struct coh901318_pool pool;
	struct powersave pm;
	struct dma_device dma_slave;
@@ -1364,7 +1365,6 @@ static int coh901318_debugfs_read(struct file *file, char __user *buf,
}

static const struct file_operations coh901318_debugfs_status_operations = {
	.owner		= THIS_MODULE,
	.open		= simple_open,
	.read		= coh901318_debugfs_read,
	.llseek		= default_llseek,
@@ -2680,6 +2680,8 @@ static int __init coh901318_probe(struct platform_device *pdev)
	if (err)
		return err;

	base->irq = irq;

	err = coh901318_pool_create(&base->pool, &pdev->dev,
				    sizeof(struct coh901318_lli),
				    32);
@@ -2755,11 +2757,31 @@ static int __init coh901318_probe(struct platform_device *pdev)
	coh901318_pool_destroy(&base->pool);
	return err;
}
static void coh901318_base_remove(struct coh901318_base *base, const int *pick_chans)
{
	int chans_i;
	int i = 0;
	struct coh901318_chan *cohc;

	for (chans_i = 0; pick_chans[chans_i] != -1; chans_i += 2) {
		for (i = pick_chans[chans_i]; i <= pick_chans[chans_i+1]; i++) {
			cohc = &base->chans[i];

			tasklet_kill(&cohc->tasklet);
		}
	}

}

static int coh901318_remove(struct platform_device *pdev)
{
	struct coh901318_base *base = platform_get_drvdata(pdev);

	devm_free_irq(&pdev->dev, base->irq, base);

	coh901318_base_remove(base, dma_slave_channels);
	coh901318_base_remove(base, dma_memcpy_channels);

	of_dma_controller_free(pdev->dev.of_node);
	dma_async_device_unregister(&base->dma_memcpy);
	dma_async_device_unregister(&base->dma_slave);
@@ -2780,13 +2802,13 @@ static struct platform_driver coh901318_driver = {
	},
};

int __init coh901318_init(void)
static int __init coh901318_init(void)
{
	return platform_driver_probe(&coh901318_driver, coh901318_probe);
}
subsys_initcall(coh901318_init);

void __exit coh901318_exit(void)
static void __exit coh901318_exit(void)
{
	platform_driver_unregister(&coh901318_driver);
}
+0 −3
Original line number Diff line number Diff line
@@ -497,16 +497,13 @@ static struct dma_async_tx_descriptor *cppi41_dma_prep_slave_sg(
	struct cppi41_desc *d;
	struct scatterlist *sg;
	unsigned int i;
	unsigned int num;

	num = 0;
	d = c->desc;
	for_each_sg(sgl, sg, sg_len, i) {
		u32 addr;
		u32 len;

		/* We need to use more than one desc once musb supports sg */
		BUG_ON(num > 0);
		addr = lower_32_bits(sg_dma_address(sg));
		len = sg_dma_len(sg);

+14 −0
Original line number Diff line number Diff line
@@ -573,12 +573,26 @@ static int jz4740_dma_probe(struct platform_device *pdev)
	return ret;
}

static void jz4740_cleanup_vchan(struct dma_device *dmadev)
{
	struct jz4740_dmaengine_chan *chan, *_chan;

	list_for_each_entry_safe(chan, _chan,
				&dmadev->channels, vchan.chan.device_node) {
		list_del(&chan->vchan.chan.device_node);
		tasklet_kill(&chan->vchan.task);
	}
}


static int jz4740_dma_remove(struct platform_device *pdev)
{
	struct jz4740_dma_dev *dmadev = platform_get_drvdata(pdev);
	int irq = platform_get_irq(pdev, 0);

	free_irq(irq, dmadev);

	jz4740_cleanup_vchan(&dmadev->ddev);
	dma_async_device_unregister(&dmadev->ddev);
	clk_disable_unprepare(dmadev->clk);

+21 −0
Original line number Diff line number Diff line
@@ -239,6 +239,9 @@ struct edma_cc {
	bool				chmap_exist;
	enum dma_event_q		default_queue;

	unsigned int			ccint;
	unsigned int			ccerrint;

	/*
	 * The slot_inuse bit for each PaRAM slot is clear unless the slot is
	 * in use by Linux or if it is allocated to be used by DSP.
@@ -2283,6 +2286,7 @@ static int edma_probe(struct platform_device *pdev)
			dev_err(dev, "CCINT (%d) failed --> %d\n", irq, ret);
			return ret;
		}
		ecc->ccint = irq;
	}

	irq = platform_get_irq_byname(pdev, "edma3_ccerrint");
@@ -2298,6 +2302,7 @@ static int edma_probe(struct platform_device *pdev)
			dev_err(dev, "CCERRINT (%d) failed --> %d\n", irq, ret);
			return ret;
		}
		ecc->ccerrint = irq;
	}

	ecc->dummy_slot = edma_alloc_slot(ecc, EDMA_SLOT_ANY);
@@ -2388,11 +2393,27 @@ static int edma_probe(struct platform_device *pdev)
	return ret;
}

static void edma_cleanupp_vchan(struct dma_device *dmadev)
{
	struct edma_chan *echan, *_echan;

	list_for_each_entry_safe(echan, _echan,
			&dmadev->channels, vchan.chan.device_node) {
		list_del(&echan->vchan.chan.device_node);
		tasklet_kill(&echan->vchan.task);
	}
}

static int edma_remove(struct platform_device *pdev)
{
	struct device *dev = &pdev->dev;
	struct edma_cc *ecc = dev_get_drvdata(dev);

	devm_free_irq(dev, ecc->ccint, ecc);
	devm_free_irq(dev, ecc->ccerrint, ecc);

	edma_cleanupp_vchan(&ecc->dma_slave);

	if (dev->of_node)
		of_dma_controller_free(dev->of_node);
	dma_async_device_unregister(&ecc->dma_slave);
+24 −0
Original line number Diff line number Diff line
@@ -852,6 +852,17 @@ fsl_edma_irq_init(struct platform_device *pdev, struct fsl_edma_engine *fsl_edma
	return 0;
}

static void fsl_edma_irq_exit(
		struct platform_device *pdev, struct fsl_edma_engine *fsl_edma)
{
	if (fsl_edma->txirq == fsl_edma->errirq) {
		devm_free_irq(&pdev->dev, fsl_edma->txirq, fsl_edma);
	} else {
		devm_free_irq(&pdev->dev, fsl_edma->txirq, fsl_edma);
		devm_free_irq(&pdev->dev, fsl_edma->errirq, fsl_edma);
	}
}

static void fsl_disable_clocks(struct fsl_edma_engine *fsl_edma)
{
	int i;
@@ -984,11 +995,24 @@ static int fsl_edma_probe(struct platform_device *pdev)
	return 0;
}

static void fsl_edma_cleanup_vchan(struct dma_device *dmadev)
{
	struct fsl_edma_chan *chan, *_chan;

	list_for_each_entry_safe(chan, _chan,
				&dmadev->channels, vchan.chan.device_node) {
		list_del(&chan->vchan.chan.device_node);
		tasklet_kill(&chan->vchan.task);
	}
}

static int fsl_edma_remove(struct platform_device *pdev)
{
	struct device_node *np = pdev->dev.of_node;
	struct fsl_edma_engine *fsl_edma = platform_get_drvdata(pdev);

	fsl_edma_irq_exit(pdev, fsl_edma);
	fsl_edma_cleanup_vchan(&fsl_edma->dma_dev);
	of_dma_controller_free(np);
	dma_async_device_unregister(&fsl_edma->dma_dev);
	fsl_disable_clocks(fsl_edma);
Loading