aboutsummaryrefslogtreecommitdiffstats
path: root/include/linux
diff options
context:
space:
mode:
authorLinus Torvalds <torvalds@linux-foundation.org>2013-05-09 12:46:45 -0400
committerLinus Torvalds <torvalds@linux-foundation.org>2013-05-09 12:46:45 -0400
commit1763e735b0a093a6747078b3bd101f079e576ab6 (patch)
tree75203a3229977d12dc5a5990d1122e7a3d5f30fc /include/linux
parentb29bdba51924f6fd5971352ba111784dee3a5853 (diff)
parent3065c194670b61e213656ce25976d7c8a95e3c93 (diff)
Merge branch 'for-linus' of git://git.infradead.org/users/vkoul/slave-dma
Pull slave-dmaengine updates from Vinod Koul: "This time we have dmatest improvements from Andy along with dw_dmac fixes. He has also done support for acpi for dmanegine. Also we have bunch of fixes going in DT support for dmanegine for various folks. Then Haswell and other ioat changes from Dave and SUDMAC support from Shimoda." * 'for-linus' of git://git.infradead.org/users/vkoul/slave-dma: (53 commits) dma: tegra: implement suspend/resume callbacks dma:of: Use a mutex to protect the of_dma_list dma: of: Fix of_node reference leak dmaengine: sirf: move driver init from module_init to subsys_initcall sudmac: add support for SUDMAC dma: sh: add Kconfig at_hdmac: move to generic DMA binding ioatdma: ioat3_alloc_sed can be static ioatdma: Adding write back descriptor error status support for ioatdma 3.3 ioatdma: S1200 platforms ioatdma channel 2 and 3 falsely advertise RAID cap ioatdma: Adding support for 16 src PQ ops and super extended descriptors ioatdma: Removing hw bug workaround for CB3.x .2 and earlier dw_dmac: add ACPI support dmaengine: call acpi_dma_request_slave_channel as well dma: acpi-dma: introduce ACPI DMA helpers dma: of: Remove unnecessary list_empty check DMA: OF: Check properties value before running be32_to_cpup() on it DMA: of: Constant names ioatdma: skip silicon bug workaround for pq_align for cb3.3 ioatdma: Removing PQ val disable for cb3.3 ...
Diffstat (limited to 'include/linux')
-rw-r--r--include/linux/acpi_dma.h116
-rw-r--r--include/linux/dmaengine.h15
-rw-r--r--include/linux/of_dma.h10
-rw-r--r--include/linux/sudmac.h52
4 files changed, 180 insertions, 13 deletions
diff --git a/include/linux/acpi_dma.h b/include/linux/acpi_dma.h
new file mode 100644
index 000000000000..d09deabc7bf6
--- /dev/null
+++ b/include/linux/acpi_dma.h
@@ -0,0 +1,116 @@
1/*
2 * ACPI helpers for DMA request / controller
3 *
4 * Based on of_dma.h
5 *
6 * Copyright (C) 2013, Intel Corporation
7 * Author: Andy Shevchenko <andriy.shevchenko@linux.intel.com>
8 *
9 * This program is free software; you can redistribute it and/or modify
10 * it under the terms of the GNU General Public License version 2 as
11 * published by the Free Software Foundation.
12 */
13
14#ifndef __LINUX_ACPI_DMA_H
15#define __LINUX_ACPI_DMA_H
16
17#include <linux/list.h>
18#include <linux/device.h>
19#include <linux/dmaengine.h>
20
21/**
22 * struct acpi_dma_spec - slave device DMA resources
23 * @chan_id: channel unique id
24 * @slave_id: request line unique id
25 * @dev: struct device of the DMA controller to be used in the filter
26 * function
27 */
28struct acpi_dma_spec {
29 int chan_id;
30 int slave_id;
31 struct device *dev;
32};
33
34/**
35 * struct acpi_dma - representation of the registered DMAC
36 * @dma_controllers: linked list node
37 * @dev: struct device of this controller
38 * @acpi_dma_xlate: callback function to find a suitable channel
39 * @data: private data used by a callback function
40 */
41struct acpi_dma {
42 struct list_head dma_controllers;
43 struct device *dev;
44 struct dma_chan *(*acpi_dma_xlate)
45 (struct acpi_dma_spec *, struct acpi_dma *);
46 void *data;
47};
48
49/* Used with acpi_dma_simple_xlate() */
50struct acpi_dma_filter_info {
51 dma_cap_mask_t dma_cap;
52 dma_filter_fn filter_fn;
53};
54
55#ifdef CONFIG_DMA_ACPI
56
57int acpi_dma_controller_register(struct device *dev,
58 struct dma_chan *(*acpi_dma_xlate)
59 (struct acpi_dma_spec *, struct acpi_dma *),
60 void *data);
61int acpi_dma_controller_free(struct device *dev);
62int devm_acpi_dma_controller_register(struct device *dev,
63 struct dma_chan *(*acpi_dma_xlate)
64 (struct acpi_dma_spec *, struct acpi_dma *),
65 void *data);
66void devm_acpi_dma_controller_free(struct device *dev);
67
68struct dma_chan *acpi_dma_request_slave_chan_by_index(struct device *dev,
69 size_t index);
70struct dma_chan *acpi_dma_request_slave_chan_by_name(struct device *dev,
71 const char *name);
72
73struct dma_chan *acpi_dma_simple_xlate(struct acpi_dma_spec *dma_spec,
74 struct acpi_dma *adma);
75#else
76
77static inline int acpi_dma_controller_register(struct device *dev,
78 struct dma_chan *(*acpi_dma_xlate)
79 (struct acpi_dma_spec *, struct acpi_dma *),
80 void *data)
81{
82 return -ENODEV;
83}
84static inline int acpi_dma_controller_free(struct device *dev)
85{
86 return -ENODEV;
87}
88static inline int devm_acpi_dma_controller_register(struct device *dev,
89 struct dma_chan *(*acpi_dma_xlate)
90 (struct acpi_dma_spec *, struct acpi_dma *),
91 void *data)
92{
93 return -ENODEV;
94}
95static inline void devm_acpi_dma_controller_free(struct device *dev)
96{
97}
98
99static inline struct dma_chan *acpi_dma_request_slave_chan_by_index(
100 struct device *dev, size_t index)
101{
102 return NULL;
103}
104static inline struct dma_chan *acpi_dma_request_slave_chan_by_name(
105 struct device *dev, const char *name)
106{
107 return NULL;
108}
109
110#define acpi_dma_simple_xlate NULL
111
112#endif
113
114#define acpi_dma_request_slave_channel acpi_dma_request_slave_chan_by_index
115
116#endif /* __LINUX_ACPI_DMA_H */
diff --git a/include/linux/dmaengine.h b/include/linux/dmaengine.h
index 91ac8da25020..96d3e4ab11a9 100644
--- a/include/linux/dmaengine.h
+++ b/include/linux/dmaengine.h
@@ -967,8 +967,9 @@ enum dma_status dma_sync_wait(struct dma_chan *chan, dma_cookie_t cookie);
967#ifdef CONFIG_DMA_ENGINE 967#ifdef CONFIG_DMA_ENGINE
968enum dma_status dma_wait_for_async_tx(struct dma_async_tx_descriptor *tx); 968enum dma_status dma_wait_for_async_tx(struct dma_async_tx_descriptor *tx);
969void dma_issue_pending_all(void); 969void dma_issue_pending_all(void);
970struct dma_chan *__dma_request_channel(dma_cap_mask_t *mask, dma_filter_fn fn, void *fn_param); 970struct dma_chan *__dma_request_channel(const dma_cap_mask_t *mask,
971struct dma_chan *dma_request_slave_channel(struct device *dev, char *name); 971 dma_filter_fn fn, void *fn_param);
972struct dma_chan *dma_request_slave_channel(struct device *dev, const char *name);
972void dma_release_channel(struct dma_chan *chan); 973void dma_release_channel(struct dma_chan *chan);
973#else 974#else
974static inline enum dma_status dma_wait_for_async_tx(struct dma_async_tx_descriptor *tx) 975static inline enum dma_status dma_wait_for_async_tx(struct dma_async_tx_descriptor *tx)
@@ -978,13 +979,13 @@ static inline enum dma_status dma_wait_for_async_tx(struct dma_async_tx_descript
978static inline void dma_issue_pending_all(void) 979static inline void dma_issue_pending_all(void)
979{ 980{
980} 981}
981static inline struct dma_chan *__dma_request_channel(dma_cap_mask_t *mask, 982static inline struct dma_chan *__dma_request_channel(const dma_cap_mask_t *mask,
982 dma_filter_fn fn, void *fn_param) 983 dma_filter_fn fn, void *fn_param)
983{ 984{
984 return NULL; 985 return NULL;
985} 986}
986static inline struct dma_chan *dma_request_slave_channel(struct device *dev, 987static inline struct dma_chan *dma_request_slave_channel(struct device *dev,
987 char *name) 988 const char *name)
988{ 989{
989 return NULL; 990 return NULL;
990} 991}
@@ -1005,9 +1006,9 @@ struct dma_chan *net_dma_find_channel(void);
1005 __dma_request_slave_channel_compat(&(mask), x, y, dev, name) 1006 __dma_request_slave_channel_compat(&(mask), x, y, dev, name)
1006 1007
1007static inline struct dma_chan 1008static inline struct dma_chan
1008*__dma_request_slave_channel_compat(dma_cap_mask_t *mask, dma_filter_fn fn, 1009*__dma_request_slave_channel_compat(const dma_cap_mask_t *mask,
1009 void *fn_param, struct device *dev, 1010 dma_filter_fn fn, void *fn_param,
1010 char *name) 1011 struct device *dev, char *name)
1011{ 1012{
1012 struct dma_chan *chan; 1013 struct dma_chan *chan;
1013 1014
diff --git a/include/linux/of_dma.h b/include/linux/of_dma.h
index d15073e080dd..364dda734877 100644
--- a/include/linux/of_dma.h
+++ b/include/linux/of_dma.h
@@ -25,7 +25,6 @@ struct of_dma {
25 struct dma_chan *(*of_dma_xlate) 25 struct dma_chan *(*of_dma_xlate)
26 (struct of_phandle_args *, struct of_dma *); 26 (struct of_phandle_args *, struct of_dma *);
27 void *of_dma_data; 27 void *of_dma_data;
28 int use_count;
29}; 28};
30 29
31struct of_dma_filter_info { 30struct of_dma_filter_info {
@@ -38,9 +37,9 @@ extern int of_dma_controller_register(struct device_node *np,
38 struct dma_chan *(*of_dma_xlate) 37 struct dma_chan *(*of_dma_xlate)
39 (struct of_phandle_args *, struct of_dma *), 38 (struct of_phandle_args *, struct of_dma *),
40 void *data); 39 void *data);
41extern int of_dma_controller_free(struct device_node *np); 40extern void of_dma_controller_free(struct device_node *np);
42extern struct dma_chan *of_dma_request_slave_channel(struct device_node *np, 41extern struct dma_chan *of_dma_request_slave_channel(struct device_node *np,
43 char *name); 42 const char *name);
44extern struct dma_chan *of_dma_simple_xlate(struct of_phandle_args *dma_spec, 43extern struct dma_chan *of_dma_simple_xlate(struct of_phandle_args *dma_spec,
45 struct of_dma *ofdma); 44 struct of_dma *ofdma);
46#else 45#else
@@ -52,13 +51,12 @@ static inline int of_dma_controller_register(struct device_node *np,
52 return -ENODEV; 51 return -ENODEV;
53} 52}
54 53
55static inline int of_dma_controller_free(struct device_node *np) 54static inline void of_dma_controller_free(struct device_node *np)
56{ 55{
57 return -ENODEV;
58} 56}
59 57
60static inline struct dma_chan *of_dma_request_slave_channel(struct device_node *np, 58static inline struct dma_chan *of_dma_request_slave_channel(struct device_node *np,
61 char *name) 59 const char *name)
62{ 60{
63 return NULL; 61 return NULL;
64} 62}
diff --git a/include/linux/sudmac.h b/include/linux/sudmac.h
new file mode 100644
index 000000000000..377b8a5788fa
--- /dev/null
+++ b/include/linux/sudmac.h
@@ -0,0 +1,52 @@
1/*
2 * Header for the SUDMAC driver
3 *
4 * Copyright (C) 2013 Renesas Solutions Corp.
5 *
6 * This is free software; you can redistribute it and/or modify
7 * it under the terms of version 2 of the GNU General Public License as
8 * published by the Free Software Foundation.
9 */
10#ifndef SUDMAC_H
11#define SUDMAC_H
12
13#include <linux/dmaengine.h>
14#include <linux/shdma-base.h>
15#include <linux/types.h>
16
17/* Used by slave DMA clients to request DMA to/from a specific peripheral */
18struct sudmac_slave {
19 struct shdma_slave shdma_slave; /* Set by the platform */
20};
21
22/*
23 * Supplied by platforms to specify, how a DMA channel has to be configured for
24 * a certain peripheral
25 */
26struct sudmac_slave_config {
27 int slave_id;
28};
29
30struct sudmac_channel {
31 unsigned long offset;
32 unsigned long config;
33 unsigned long wait; /* The configuable range is 0 to 3 */
34 unsigned long dint_end_bit;
35};
36
37struct sudmac_pdata {
38 const struct sudmac_slave_config *slave;
39 int slave_num;
40 const struct sudmac_channel *channel;
41 int channel_num;
42};
43
44/* Definitions for the sudmac_channel.config */
45#define SUDMAC_TX_BUFFER_MODE BIT(0)
46#define SUDMAC_RX_END_MODE BIT(1)
47
48/* Definitions for the sudmac_channel.dint_end_bit */
49#define SUDMAC_DMA_BIT_CH0 BIT(0)
50#define SUDMAC_DMA_BIT_CH1 BIT(1)
51
52#endif