summaryrefslogtreecommitdiffstats
path: root/include/linux/dmaengine.h
diff options
context:
space:
mode:
Diffstat (limited to 'include/linux/dmaengine.h')
-rw-r--r--include/linux/dmaengine.h51
1 files changed, 44 insertions, 7 deletions
diff --git a/include/linux/dmaengine.h b/include/linux/dmaengine.h
index 6f94b5cbd97c..8ab3bafc2332 100644
--- a/include/linux/dmaengine.h
+++ b/include/linux/dmaengine.h
@@ -607,11 +607,38 @@ enum dmaengine_alignment {
607}; 607};
608 608
609/** 609/**
610 * struct dma_slave_map - associates slave device and it's slave channel with
611 * parameter to be used by a filter function
612 * @devname: name of the device
613 * @slave: slave channel name
614 * @param: opaque parameter to pass to struct dma_filter.fn
615 */
616struct dma_slave_map {
617 const char *devname;
618 const char *slave;
619 void *param;
620};
621
622/**
623 * struct dma_filter - information for slave device/channel to filter_fn/param
624 * mapping
625 * @fn: filter function callback
626 * @mapcnt: number of slave device/channel in the map
627 * @map: array of channel to filter mapping data
628 */
629struct dma_filter {
630 dma_filter_fn fn;
631 int mapcnt;
632 const struct dma_slave_map *map;
633};
634
635/**
610 * struct dma_device - info on the entity supplying DMA services 636 * struct dma_device - info on the entity supplying DMA services
611 * @chancnt: how many DMA channels are supported 637 * @chancnt: how many DMA channels are supported
612 * @privatecnt: how many DMA channels are requested by dma_request_channel 638 * @privatecnt: how many DMA channels are requested by dma_request_channel
613 * @channels: the list of struct dma_chan 639 * @channels: the list of struct dma_chan
614 * @global_node: list_head for global dma_device_list 640 * @global_node: list_head for global dma_device_list
641 * @filter: information for device/slave to filter function/param mapping
615 * @cap_mask: one or more dma_capability flags 642 * @cap_mask: one or more dma_capability flags
616 * @max_xor: maximum number of xor sources, 0 if no capability 643 * @max_xor: maximum number of xor sources, 0 if no capability
617 * @max_pq: maximum number of PQ sources and PQ-continue capability 644 * @max_pq: maximum number of PQ sources and PQ-continue capability
@@ -667,6 +694,7 @@ struct dma_device {
667 unsigned int privatecnt; 694 unsigned int privatecnt;
668 struct list_head channels; 695 struct list_head channels;
669 struct list_head global_node; 696 struct list_head global_node;
697 struct dma_filter filter;
670 dma_cap_mask_t cap_mask; 698 dma_cap_mask_t cap_mask;
671 unsigned short max_xor; 699 unsigned short max_xor;
672 unsigned short max_pq; 700 unsigned short max_pq;
@@ -1142,9 +1170,11 @@ enum dma_status dma_wait_for_async_tx(struct dma_async_tx_descriptor *tx);
1142void dma_issue_pending_all(void); 1170void dma_issue_pending_all(void);
1143struct dma_chan *__dma_request_channel(const dma_cap_mask_t *mask, 1171struct dma_chan *__dma_request_channel(const dma_cap_mask_t *mask,
1144 dma_filter_fn fn, void *fn_param); 1172 dma_filter_fn fn, void *fn_param);
1145struct dma_chan *dma_request_slave_channel_reason(struct device *dev,
1146 const char *name);
1147struct dma_chan *dma_request_slave_channel(struct device *dev, const char *name); 1173struct dma_chan *dma_request_slave_channel(struct device *dev, const char *name);
1174
1175struct dma_chan *dma_request_chan(struct device *dev, const char *name);
1176struct dma_chan *dma_request_chan_by_mask(const dma_cap_mask_t *mask);
1177
1148void dma_release_channel(struct dma_chan *chan); 1178void dma_release_channel(struct dma_chan *chan);
1149int dma_get_slave_caps(struct dma_chan *chan, struct dma_slave_caps *caps); 1179int dma_get_slave_caps(struct dma_chan *chan, struct dma_slave_caps *caps);
1150#else 1180#else
@@ -1168,16 +1198,21 @@ static inline struct dma_chan *__dma_request_channel(const dma_cap_mask_t *mask,
1168{ 1198{
1169 return NULL; 1199 return NULL;
1170} 1200}
1171static inline struct dma_chan *dma_request_slave_channel_reason(
1172 struct device *dev, const char *name)
1173{
1174 return ERR_PTR(-ENODEV);
1175}
1176static inline struct dma_chan *dma_request_slave_channel(struct device *dev, 1201static inline struct dma_chan *dma_request_slave_channel(struct device *dev,
1177 const char *name) 1202 const char *name)
1178{ 1203{
1179 return NULL; 1204 return NULL;
1180} 1205}
1206static inline struct dma_chan *dma_request_chan(struct device *dev,
1207 const char *name)
1208{
1209 return ERR_PTR(-ENODEV);
1210}
1211static inline struct dma_chan *dma_request_chan_by_mask(
1212 const dma_cap_mask_t *mask)
1213{
1214 return ERR_PTR(-ENODEV);
1215}
1181static inline void dma_release_channel(struct dma_chan *chan) 1216static inline void dma_release_channel(struct dma_chan *chan)
1182{ 1217{
1183} 1218}
@@ -1188,6 +1223,8 @@ static inline int dma_get_slave_caps(struct dma_chan *chan,
1188} 1223}
1189#endif 1224#endif
1190 1225
1226#define dma_request_slave_channel_reason(dev, name) dma_request_chan(dev, name)
1227
1191static inline int dmaengine_desc_set_reuse(struct dma_async_tx_descriptor *tx) 1228static inline int dmaengine_desc_set_reuse(struct dma_async_tx_descriptor *tx)
1192{ 1229{
1193 struct dma_slave_caps caps; 1230 struct dma_slave_caps caps;