diff options
author | Dimitris Papastamos <dp@opensource.wolfsonmicro.com> | 2013-08-01 04:53:45 -0400 |
---|---|---|
committer | Mark Brown <broonie@linaro.org> | 2013-08-01 05:01:42 -0400 |
commit | d4780eec779c4e6d2fe5963dd2aee0a85d956122 (patch) | |
tree | 849b6697b0d5f3a5773e48a2c575e75b1779caad | |
parent | 4f8b19143d74e1c3360b21640065765a12bafb1b (diff) |
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>
-rw-r--r-- | sound/soc/codecs/wm0010.c | 12 |
1 files changed, 6 insertions, 6 deletions
diff --git a/sound/soc/codecs/wm0010.c b/sound/soc/codecs/wm0010.c index 10adc4145d46..d5ebcb00019b 100644 --- a/sound/soc/codecs/wm0010.c +++ b/sound/soc/codecs/wm0010.c | |||
@@ -420,7 +420,7 @@ static int wm0010_firmware_load(const char *name, struct snd_soc_codec *codec) | |||
420 | xfer->codec = codec; | 420 | xfer->codec = codec; |
421 | list_add_tail(&xfer->list, &xfer_list); | 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 | if (!out) { | 424 | if (!out) { |
425 | dev_err(codec->dev, | 425 | dev_err(codec->dev, |
426 | "Failed to allocate RX buffer\n"); | 426 | "Failed to allocate RX buffer\n"); |
@@ -429,7 +429,7 @@ static int wm0010_firmware_load(const char *name, struct snd_soc_codec *codec) | |||
429 | } | 429 | } |
430 | xfer->t.rx_buf = out; | 430 | xfer->t.rx_buf = out; |
431 | 431 | ||
432 | img = kzalloc(len, GFP_KERNEL); | 432 | img = kzalloc(len, GFP_KERNEL | GFP_DMA); |
433 | if (!img) { | 433 | if (!img) { |
434 | dev_err(codec->dev, | 434 | dev_err(codec->dev, |
435 | "Failed to allocate image buffer\n"); | 435 | "Failed to allocate image buffer\n"); |
@@ -523,14 +523,14 @@ static int wm0010_stage2_load(struct snd_soc_codec *codec) | |||
523 | dev_dbg(codec->dev, "Downloading %zu byte stage 2 loader\n", fw->size); | 523 | dev_dbg(codec->dev, "Downloading %zu byte stage 2 loader\n", fw->size); |
524 | 524 | ||
525 | /* Copy to local buffer first as vmalloc causes problems for dma */ | 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 | if (!img) { | 527 | if (!img) { |
528 | dev_err(codec->dev, "Failed to allocate image buffer\n"); | 528 | dev_err(codec->dev, "Failed to allocate image buffer\n"); |
529 | ret = -ENOMEM; | 529 | ret = -ENOMEM; |
530 | goto abort2; | 530 | goto abort2; |
531 | } | 531 | } |
532 | 532 | ||
533 | out = kzalloc(fw->size, GFP_KERNEL); | 533 | out = kzalloc(fw->size, GFP_KERNEL | GFP_DMA); |
534 | if (!out) { | 534 | if (!out) { |
535 | dev_err(codec->dev, "Failed to allocate output buffer\n"); | 535 | dev_err(codec->dev, "Failed to allocate output buffer\n"); |
536 | ret = -ENOMEM; | 536 | ret = -ENOMEM; |
@@ -670,14 +670,14 @@ static int wm0010_boot(struct snd_soc_codec *codec) | |||
670 | 670 | ||
671 | ret = -ENOMEM; | 671 | ret = -ENOMEM; |
672 | len = pll_rec.length + 8; | 672 | len = pll_rec.length + 8; |
673 | out = kzalloc(len, GFP_KERNEL); | 673 | out = kzalloc(len, GFP_KERNEL | GFP_DMA); |
674 | if (!out) { | 674 | if (!out) { |
675 | dev_err(codec->dev, | 675 | dev_err(codec->dev, |
676 | "Failed to allocate RX buffer\n"); | 676 | "Failed to allocate RX buffer\n"); |
677 | goto abort; | 677 | goto abort; |
678 | } | 678 | } |
679 | 679 | ||
680 | img_swap = kzalloc(len, GFP_KERNEL); | 680 | img_swap = kzalloc(len, GFP_KERNEL | GFP_DMA); |
681 | if (!img_swap) { | 681 | if (!img_swap) { |
682 | dev_err(codec->dev, | 682 | dev_err(codec->dev, |
683 | "Failed to allocate image buffer\n"); | 683 | "Failed to allocate image buffer\n"); |