aboutsummaryrefslogtreecommitdiffstats
path: root/include/linux
diff options
context:
space:
mode:
Diffstat (limited to 'include/linux')
-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 c47c68e535e8..d50a6b51a73d 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
@@ -666,6 +693,7 @@ struct dma_device {
666 unsigned int privatecnt; 693 unsigned int privatecnt;
667 struct list_head channels; 694 struct list_head channels;
668 struct list_head global_node; 695 struct list_head global_node;
696 struct dma_filter filter;
669 dma_cap_mask_t cap_mask; 697 dma_cap_mask_t cap_mask;
670 unsigned short max_xor; 698 unsigned short max_xor;
671 unsigned short max_pq; 699 unsigned short max_pq;
@@ -1140,9 +1168,11 @@ enum dma_status dma_wait_for_async_tx(struct dma_async_tx_descriptor *tx);
1140void dma_issue_pending_all(void); 1168void dma_issue_pending_all(void);
1141struct dma_chan *__dma_request_channel(const dma_cap_mask_t *mask, 1169struct dma_chan *__dma_request_channel(const dma_cap_mask_t *mask,
1142 dma_filter_fn fn, void *fn_param); 1170 dma_filter_fn fn, void *fn_param);
1143struct dma_chan *dma_request_slave_channel_reason(struct device *dev,
1144 const char *name);
1145struct dma_chan *dma_request_slave_channel(struct device *dev, const char *name); 1171struct dma_chan *dma_request_slave_channel(struct device *dev, const char *name);
1172
1173struct dma_chan *dma_request_chan(struct device *dev, const char *name);
1174struct dma_chan *dma_request_chan_by_mask(const dma_cap_mask_t *mask);
1175
1146void dma_release_channel(struct dma_chan *chan); 1176void dma_release_channel(struct dma_chan *chan);
1147int dma_get_slave_caps(struct dma_chan *chan, struct dma_slave_caps *caps); 1177int dma_get_slave_caps(struct dma_chan *chan, struct dma_slave_caps *caps);
1148#else 1178#else
@@ -1166,16 +1196,21 @@ static inline struct dma_chan *__dma_request_channel(const dma_cap_mask_t *mask,
1166{ 1196{
1167 return NULL; 1197 return NULL;
1168} 1198}
1169static inline struct dma_chan *dma_request_slave_channel_reason(
1170 struct device *dev, const char *name)
1171{
1172 return ERR_PTR(-ENODEV);
1173}
1174static inline struct dma_chan *dma_request_slave_channel(struct device *dev, 1199static inline struct dma_chan *dma_request_slave_channel(struct device *dev,
1175 const char *name) 1200 const char *name)
1176{ 1201{
1177 return NULL; 1202 return NULL;
1178} 1203}
1204static inline struct dma_chan *dma_request_chan(struct device *dev,
1205 const char *name)
1206{
1207 return ERR_PTR(-ENODEV);
1208}
1209static inline struct dma_chan *dma_request_chan_by_mask(
1210 const dma_cap_mask_t *mask)
1211{
1212 return ERR_PTR(-ENODEV);
1213}
1179static inline void dma_release_channel(struct dma_chan *chan) 1214static inline void dma_release_channel(struct dma_chan *chan)
1180{ 1215{
1181} 1216}
@@ -1186,6 +1221,8 @@ static inline int dma_get_slave_caps(struct dma_chan *chan,
1186} 1221}
1187#endif 1222#endif
1188 1223
1224#define dma_request_slave_channel_reason(dev, name) dma_request_chan(dev, name)
1225
1189static inline int dmaengine_desc_set_reuse(struct dma_async_tx_descriptor *tx) 1226static inline int dmaengine_desc_set_reuse(struct dma_async_tx_descriptor *tx)
1190{ 1227{
1191 struct dma_slave_caps caps; 1228 struct dma_slave_caps caps;