diff options
author | Maxime Ripard <maxime.ripard@free-electrons.com> | 2014-11-17 08:42:14 -0500 |
---|---|---|
committer | Vinod Koul <vinod.koul@intel.com> | 2014-12-22 01:58:58 -0500 |
commit | 2258b67543eaed7b55afe62c84324a2bc7bd4c33 (patch) | |
tree | 38578b50b7230cd686b1932b7840a5a81ed4a674 /drivers/dma/ep93xx_dma.c | |
parent | aa7c09b65beed65f007605853592342d9a615890 (diff) |
dmaengine: ep93xx: Split device_control
Split the device_control callback of the Cirrus Logic EP93xx driver to make use
of the newly introduced callbacks, that will eventually be used to retrieve
slave capabilities.
Signed-off-by: Maxime Ripard <maxime.ripard@free-electrons.com>
Signed-off-by: Vinod Koul <vinod.koul@intel.com>
Diffstat (limited to 'drivers/dma/ep93xx_dma.c')
-rw-r--r-- | drivers/dma/ep93xx_dma.c | 41 |
1 files changed, 7 insertions, 34 deletions
diff --git a/drivers/dma/ep93xx_dma.c b/drivers/dma/ep93xx_dma.c index 7650470196c4..a8bcbb5bc0ed 100644 --- a/drivers/dma/ep93xx_dma.c +++ b/drivers/dma/ep93xx_dma.c | |||
@@ -1164,13 +1164,14 @@ fail: | |||
1164 | 1164 | ||
1165 | /** | 1165 | /** |
1166 | * ep93xx_dma_terminate_all - terminate all transactions | 1166 | * ep93xx_dma_terminate_all - terminate all transactions |
1167 | * @edmac: channel | 1167 | * @chan: channel |
1168 | * | 1168 | * |
1169 | * Stops all DMA transactions. All descriptors are put back to the | 1169 | * Stops all DMA transactions. All descriptors are put back to the |
1170 | * @edmac->free_list and callbacks are _not_ called. | 1170 | * @edmac->free_list and callbacks are _not_ called. |
1171 | */ | 1171 | */ |
1172 | static int ep93xx_dma_terminate_all(struct ep93xx_dma_chan *edmac) | 1172 | static int ep93xx_dma_terminate_all(struct dma_chan *chan) |
1173 | { | 1173 | { |
1174 | struct ep93xx_dma_chan *edmac = to_ep93xx_dma_chan(chan); | ||
1174 | struct ep93xx_dma_desc *desc, *_d; | 1175 | struct ep93xx_dma_desc *desc, *_d; |
1175 | unsigned long flags; | 1176 | unsigned long flags; |
1176 | LIST_HEAD(list); | 1177 | LIST_HEAD(list); |
@@ -1194,9 +1195,10 @@ static int ep93xx_dma_terminate_all(struct ep93xx_dma_chan *edmac) | |||
1194 | return 0; | 1195 | return 0; |
1195 | } | 1196 | } |
1196 | 1197 | ||
1197 | static int ep93xx_dma_slave_config(struct ep93xx_dma_chan *edmac, | 1198 | static int ep93xx_dma_slave_config(struct dma_chan *chan, |
1198 | struct dma_slave_config *config) | 1199 | struct dma_slave_config *config) |
1199 | { | 1200 | { |
1201 | struct ep93xx_dma_chan *edmac = to_ep93xx_dma_chan(chan); | ||
1200 | enum dma_slave_buswidth width; | 1202 | enum dma_slave_buswidth width; |
1201 | unsigned long flags; | 1203 | unsigned long flags; |
1202 | u32 addr, ctrl; | 1204 | u32 addr, ctrl; |
@@ -1242,36 +1244,6 @@ static int ep93xx_dma_slave_config(struct ep93xx_dma_chan *edmac, | |||
1242 | } | 1244 | } |
1243 | 1245 | ||
1244 | /** | 1246 | /** |
1245 | * ep93xx_dma_control - manipulate all pending operations on a channel | ||
1246 | * @chan: channel | ||
1247 | * @cmd: control command to perform | ||
1248 | * @arg: optional argument | ||
1249 | * | ||
1250 | * Controls the channel. Function returns %0 in case of success or negative | ||
1251 | * error in case of failure. | ||
1252 | */ | ||
1253 | static int ep93xx_dma_control(struct dma_chan *chan, enum dma_ctrl_cmd cmd, | ||
1254 | unsigned long arg) | ||
1255 | { | ||
1256 | struct ep93xx_dma_chan *edmac = to_ep93xx_dma_chan(chan); | ||
1257 | struct dma_slave_config *config; | ||
1258 | |||
1259 | switch (cmd) { | ||
1260 | case DMA_TERMINATE_ALL: | ||
1261 | return ep93xx_dma_terminate_all(edmac); | ||
1262 | |||
1263 | case DMA_SLAVE_CONFIG: | ||
1264 | config = (struct dma_slave_config *)arg; | ||
1265 | return ep93xx_dma_slave_config(edmac, config); | ||
1266 | |||
1267 | default: | ||
1268 | break; | ||
1269 | } | ||
1270 | |||
1271 | return -ENOSYS; | ||
1272 | } | ||
1273 | |||
1274 | /** | ||
1275 | * ep93xx_dma_tx_status - check if a transaction is completed | 1247 | * ep93xx_dma_tx_status - check if a transaction is completed |
1276 | * @chan: channel | 1248 | * @chan: channel |
1277 | * @cookie: transaction specific cookie | 1249 | * @cookie: transaction specific cookie |
@@ -1352,7 +1324,8 @@ static int __init ep93xx_dma_probe(struct platform_device *pdev) | |||
1352 | dma_dev->device_free_chan_resources = ep93xx_dma_free_chan_resources; | 1324 | dma_dev->device_free_chan_resources = ep93xx_dma_free_chan_resources; |
1353 | dma_dev->device_prep_slave_sg = ep93xx_dma_prep_slave_sg; | 1325 | dma_dev->device_prep_slave_sg = ep93xx_dma_prep_slave_sg; |
1354 | dma_dev->device_prep_dma_cyclic = ep93xx_dma_prep_dma_cyclic; | 1326 | dma_dev->device_prep_dma_cyclic = ep93xx_dma_prep_dma_cyclic; |
1355 | dma_dev->device_control = ep93xx_dma_control; | 1327 | dma_dev->device_config = ep93xx_dma_slave_config; |
1328 | dma_dev->device_terminate_all = ep93xx_dma_terminate_all; | ||
1356 | dma_dev->device_issue_pending = ep93xx_dma_issue_pending; | 1329 | dma_dev->device_issue_pending = ep93xx_dma_issue_pending; |
1357 | dma_dev->device_tx_status = ep93xx_dma_tx_status; | 1330 | dma_dev->device_tx_status = ep93xx_dma_tx_status; |
1358 | 1331 | ||