aboutsummaryrefslogtreecommitdiffstats
path: root/Documentation
diff options
context:
space:
mode:
authorYang Hongyang <yanghy@cn.fujitsu.com>2009-04-06 22:01:19 -0400
committerLinus Torvalds <torvalds@linux-foundation.org>2009-04-07 11:31:12 -0400
commit2c5510d4e84988ea95f86488d1e23244284bc1ed (patch)
tree1eeedfd703c3d48b6da4552ee227d94a85f822b9 /Documentation
parent2f4f27d42a301ed147e50c2edbcd27bb8990bc8e (diff)
dma-mapping: update the old macro DMA_nBIT_MASK related documentations
Update the old macro DMA_nBIT_MASK related documentations Signed-off-by: Yang Hongyang<yanghy@cn.fujitsu.com> Signed-off-by: Andrew Morton <akpm@linux-foundation.org> Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
Diffstat (limited to 'Documentation')
-rw-r--r--Documentation/DMA-mapping.txt18
-rw-r--r--Documentation/DocBook/writing-an-alsa-driver.tmpl8
2 files changed, 13 insertions, 13 deletions
diff --git a/Documentation/DMA-mapping.txt b/Documentation/DMA-mapping.txt
index b2a4d6d244d9..01f24e94bdb6 100644
--- a/Documentation/DMA-mapping.txt
+++ b/Documentation/DMA-mapping.txt
@@ -136,7 +136,7 @@ exactly why.
136The standard 32-bit addressing PCI device would do something like 136The standard 32-bit addressing PCI device would do something like
137this: 137this:
138 138
139 if (pci_set_dma_mask(pdev, DMA_32BIT_MASK)) { 139 if (pci_set_dma_mask(pdev, DMA_BIT_MASK(32))) {
140 printk(KERN_WARNING 140 printk(KERN_WARNING
141 "mydev: No suitable DMA available.\n"); 141 "mydev: No suitable DMA available.\n");
142 goto ignore_this_device; 142 goto ignore_this_device;
@@ -155,9 +155,9 @@ all 64-bits when accessing streaming DMA:
155 155
156 int using_dac; 156 int using_dac;
157 157
158 if (!pci_set_dma_mask(pdev, DMA_64BIT_MASK)) { 158 if (!pci_set_dma_mask(pdev, DMA_BIT_MASK(64))) {
159 using_dac = 1; 159 using_dac = 1;
160 } else if (!pci_set_dma_mask(pdev, DMA_32BIT_MASK)) { 160 } else if (!pci_set_dma_mask(pdev, DMA_BIT_MASK(32))) {
161 using_dac = 0; 161 using_dac = 0;
162 } else { 162 } else {
163 printk(KERN_WARNING 163 printk(KERN_WARNING
@@ -170,14 +170,14 @@ the case would look like this:
170 170
171 int using_dac, consistent_using_dac; 171 int using_dac, consistent_using_dac;
172 172
173 if (!pci_set_dma_mask(pdev, DMA_64BIT_MASK)) { 173 if (!pci_set_dma_mask(pdev, DMA_BIT_MASK(64))) {
174 using_dac = 1; 174 using_dac = 1;
175 consistent_using_dac = 1; 175 consistent_using_dac = 1;
176 pci_set_consistent_dma_mask(pdev, DMA_64BIT_MASK); 176 pci_set_consistent_dma_mask(pdev, DMA_BIT_MASK(64));
177 } else if (!pci_set_dma_mask(pdev, DMA_32BIT_MASK)) { 177 } else if (!pci_set_dma_mask(pdev, DMA_BIT_MASK(32))) {
178 using_dac = 0; 178 using_dac = 0;
179 consistent_using_dac = 0; 179 consistent_using_dac = 0;
180 pci_set_consistent_dma_mask(pdev, DMA_32BIT_MASK); 180 pci_set_consistent_dma_mask(pdev, DMA_BIT_MASK(32));
181 } else { 181 } else {
182 printk(KERN_WARNING 182 printk(KERN_WARNING
183 "mydev: No suitable DMA available.\n"); 183 "mydev: No suitable DMA available.\n");
@@ -192,7 +192,7 @@ check the return value from pci_set_consistent_dma_mask().
192Finally, if your device can only drive the low 24-bits of 192Finally, if your device can only drive the low 24-bits of
193address during PCI bus mastering you might do something like: 193address during PCI bus mastering you might do something like:
194 194
195 if (pci_set_dma_mask(pdev, DMA_24BIT_MASK)) { 195 if (pci_set_dma_mask(pdev, DMA_BIT_MASK(24))) {
196 printk(KERN_WARNING 196 printk(KERN_WARNING
197 "mydev: 24-bit DMA addressing not available.\n"); 197 "mydev: 24-bit DMA addressing not available.\n");
198 goto ignore_this_device; 198 goto ignore_this_device;
@@ -213,7 +213,7 @@ most specific mask.
213 213
214Here is pseudo-code showing how this might be done: 214Here is pseudo-code showing how this might be done:
215 215
216 #define PLAYBACK_ADDRESS_BITS DMA_32BIT_MASK 216 #define PLAYBACK_ADDRESS_BITS DMA_BIT_MASK(32)
217 #define RECORD_ADDRESS_BITS 0x00ffffff 217 #define RECORD_ADDRESS_BITS 0x00ffffff
218 218
219 struct my_sound_card *card; 219 struct my_sound_card *card;
diff --git a/Documentation/DocBook/writing-an-alsa-driver.tmpl b/Documentation/DocBook/writing-an-alsa-driver.tmpl
index 46b08fef3744..7a2e0e98986a 100644
--- a/Documentation/DocBook/writing-an-alsa-driver.tmpl
+++ b/Documentation/DocBook/writing-an-alsa-driver.tmpl
@@ -1137,8 +1137,8 @@
1137 if (err < 0) 1137 if (err < 0)
1138 return err; 1138 return err;
1139 /* check PCI availability (28bit DMA) */ 1139 /* check PCI availability (28bit DMA) */
1140 if (pci_set_dma_mask(pci, DMA_28BIT_MASK) < 0 || 1140 if (pci_set_dma_mask(pci, DMA_BIT_MASK(28)) < 0 ||
1141 pci_set_consistent_dma_mask(pci, DMA_28BIT_MASK) < 0) { 1141 pci_set_consistent_dma_mask(pci, DMA_BIT_MASK(28)) < 0) {
1142 printk(KERN_ERR "error to set 28bit mask DMA\n"); 1142 printk(KERN_ERR "error to set 28bit mask DMA\n");
1143 pci_disable_device(pci); 1143 pci_disable_device(pci);
1144 return -ENXIO; 1144 return -ENXIO;
@@ -1252,8 +1252,8 @@
1252 err = pci_enable_device(pci); 1252 err = pci_enable_device(pci);
1253 if (err < 0) 1253 if (err < 0)
1254 return err; 1254 return err;
1255 if (pci_set_dma_mask(pci, DMA_28BIT_MASK) < 0 || 1255 if (pci_set_dma_mask(pci, DMA_BIT_MASK(28)) < 0 ||
1256 pci_set_consistent_dma_mask(pci, DMA_28BIT_MASK) < 0) { 1256 pci_set_consistent_dma_mask(pci, DMA_BIT_MASK(28)) < 0) {
1257 printk(KERN_ERR "error to set 28bit mask DMA\n"); 1257 printk(KERN_ERR "error to set 28bit mask DMA\n");
1258 pci_disable_device(pci); 1258 pci_disable_device(pci);
1259 return -ENXIO; 1259 return -ENXIO;