Skip to content

Commit a015b18

Browse files
maquefelarndb
authored andcommitted
dmaengine: cirrus: remove platform code
Remove DMA platform header, from now on we use device tree for DMA clients. Acked-by: Vinod Koul <[email protected]> Signed-off-by: Nikita Shubin <[email protected]> Tested-by: Alexander Sverdlin <[email protected]> Signed-off-by: Arnd Bergmann <[email protected]>
1 parent 29ed9ce commit a015b18

File tree

2 files changed

+46
-102
lines changed

2 files changed

+46
-102
lines changed

drivers/dma/ep93xx_dma.c

Lines changed: 46 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -17,6 +17,7 @@
1717
#include <linux/clk.h>
1818
#include <linux/init.h>
1919
#include <linux/interrupt.h>
20+
#include <linux/dma-mapping.h>
2021
#include <linux/dmaengine.h>
2122
#include <linux/module.h>
2223
#include <linux/mod_devicetable.h>
@@ -25,8 +26,6 @@
2526
#include <linux/platform_device.h>
2627
#include <linux/slab.h>
2728

28-
#include <linux/platform_data/dma-ep93xx.h>
29-
3029
#include "dmaengine.h"
3130

3231
/* M2P registers */
@@ -106,6 +105,26 @@
106105
#define DMA_MAX_CHAN_BYTES 0xffff
107106
#define DMA_MAX_CHAN_DESCRIPTORS 32
108107

108+
/*
109+
* M2P channels.
110+
*
111+
* Note that these values are also directly used for setting the PPALLOC
112+
* register.
113+
*/
114+
#define EP93XX_DMA_I2S1 0
115+
#define EP93XX_DMA_I2S2 1
116+
#define EP93XX_DMA_AAC1 2
117+
#define EP93XX_DMA_AAC2 3
118+
#define EP93XX_DMA_AAC3 4
119+
#define EP93XX_DMA_I2S3 5
120+
#define EP93XX_DMA_UART1 6
121+
#define EP93XX_DMA_UART2 7
122+
#define EP93XX_DMA_UART3 8
123+
#define EP93XX_DMA_IRDA 9
124+
/* M2M channels */
125+
#define EP93XX_DMA_SSP 10
126+
#define EP93XX_DMA_IDE 11
127+
109128
enum ep93xx_dma_type {
110129
M2P_DMA,
111130
M2M_DMA,
@@ -242,6 +261,31 @@ static struct ep93xx_dma_chan *to_ep93xx_dma_chan(struct dma_chan *chan)
242261
return container_of(chan, struct ep93xx_dma_chan, chan);
243262
}
244263

264+
static inline bool ep93xx_dma_chan_is_m2p(struct dma_chan *chan)
265+
{
266+
if (device_is_compatible(chan->device->dev, "cirrus,ep9301-dma-m2p"))
267+
return true;
268+
269+
return !strcmp(dev_name(chan->device->dev), "ep93xx-dma-m2p");
270+
}
271+
272+
/*
273+
* ep93xx_dma_chan_direction - returns direction the channel can be used
274+
*
275+
* This function can be used in filter functions to find out whether the
276+
* channel supports given DMA direction. Only M2P channels have such
277+
* limitation, for M2M channels the direction is configurable.
278+
*/
279+
static inline enum dma_transfer_direction
280+
ep93xx_dma_chan_direction(struct dma_chan *chan)
281+
{
282+
if (!ep93xx_dma_chan_is_m2p(chan))
283+
return DMA_TRANS_NONE;
284+
285+
/* even channels are for TX, odd for RX */
286+
return (chan->chan_id % 2 == 0) ? DMA_MEM_TO_DEV : DMA_DEV_TO_MEM;
287+
}
288+
245289
/**
246290
* ep93xx_dma_set_active - set new active descriptor chain
247291
* @edmac: channel

include/linux/platform_data/dma-ep93xx.h

Lines changed: 0 additions & 100 deletions
This file was deleted.

0 commit comments

Comments
 (0)