Commit d4780eec779c4e6d2fe5963dd2aee0a85d956122

Authored by Dimitris Papastamos
Committed by Mark Brown
1 parent 4f8b19143d

ASoC: wm0010: Use DMA-safe memory for SPI transfers

We should be allocating our buffers for the SPI transfers
from the DMA zone.

Signed-off-by: Dimitris Papastamos <dp@opensource.wolfsonmicro.com>
Signed-off-by: Mark Brown <broonie@linaro.org>

Showing 1 changed file with 6 additions and 6 deletions Side-by-side Diff

sound/soc/codecs/wm0010.c
... ... @@ -420,7 +420,7 @@
420 420 xfer->codec = codec;
421 421 list_add_tail(&xfer->list, &xfer_list);
422 422  
423   - out = kzalloc(len, GFP_KERNEL);
  423 + out = kzalloc(len, GFP_KERNEL | GFP_DMA);
424 424 if (!out) {
425 425 dev_err(codec->dev,
426 426 "Failed to allocate RX buffer\n");
... ... @@ -429,7 +429,7 @@
429 429 }
430 430 xfer->t.rx_buf = out;
431 431  
432   - img = kzalloc(len, GFP_KERNEL);
  432 + img = kzalloc(len, GFP_KERNEL | GFP_DMA);
433 433 if (!img) {
434 434 dev_err(codec->dev,
435 435 "Failed to allocate image buffer\n");
436 436  
... ... @@ -523,14 +523,14 @@
523 523 dev_dbg(codec->dev, "Downloading %zu byte stage 2 loader\n", fw->size);
524 524  
525 525 /* Copy to local buffer first as vmalloc causes problems for dma */
526   - img = kzalloc(fw->size, GFP_KERNEL);
  526 + img = kzalloc(fw->size, GFP_KERNEL | GFP_DMA);
527 527 if (!img) {
528 528 dev_err(codec->dev, "Failed to allocate image buffer\n");
529 529 ret = -ENOMEM;
530 530 goto abort2;
531 531 }
532 532  
533   - out = kzalloc(fw->size, GFP_KERNEL);
  533 + out = kzalloc(fw->size, GFP_KERNEL | GFP_DMA);
534 534 if (!out) {
535 535 dev_err(codec->dev, "Failed to allocate output buffer\n");
536 536 ret = -ENOMEM;
537 537  
... ... @@ -670,14 +670,14 @@
670 670  
671 671 ret = -ENOMEM;
672 672 len = pll_rec.length + 8;
673   - out = kzalloc(len, GFP_KERNEL);
  673 + out = kzalloc(len, GFP_KERNEL | GFP_DMA);
674 674 if (!out) {
675 675 dev_err(codec->dev,
676 676 "Failed to allocate RX buffer\n");
677 677 goto abort;
678 678 }
679 679  
680   - img_swap = kzalloc(len, GFP_KERNEL);
  680 + img_swap = kzalloc(len, GFP_KERNEL | GFP_DMA);
681 681 if (!img_swap) {
682 682 dev_err(codec->dev,
683 683 "Failed to allocate image buffer\n");