Commit d4780eec authored by Dimitris Papastamos's avatar Dimitris Papastamos Committed by Mark Brown

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: default avatarDimitris Papastamos <dp@opensource.wolfsonmicro.com>
Signed-off-by: default avatarMark Brown <broonie@linaro.org>
parent 4f8b1914
...@@ -420,7 +420,7 @@ static int wm0010_firmware_load(const char *name, struct snd_soc_codec *codec) ...@@ -420,7 +420,7 @@ static int wm0010_firmware_load(const char *name, struct snd_soc_codec *codec)
xfer->codec = codec; xfer->codec = codec;
list_add_tail(&xfer->list, &xfer_list); list_add_tail(&xfer->list, &xfer_list);
out = kzalloc(len, GFP_KERNEL); out = kzalloc(len, GFP_KERNEL | GFP_DMA);
if (!out) { if (!out) {
dev_err(codec->dev, dev_err(codec->dev,
"Failed to allocate RX buffer\n"); "Failed to allocate RX buffer\n");
...@@ -429,7 +429,7 @@ static int wm0010_firmware_load(const char *name, struct snd_soc_codec *codec) ...@@ -429,7 +429,7 @@ static int wm0010_firmware_load(const char *name, struct snd_soc_codec *codec)
} }
xfer->t.rx_buf = out; xfer->t.rx_buf = out;
img = kzalloc(len, GFP_KERNEL); img = kzalloc(len, GFP_KERNEL | GFP_DMA);
if (!img) { if (!img) {
dev_err(codec->dev, dev_err(codec->dev,
"Failed to allocate image buffer\n"); "Failed to allocate image buffer\n");
...@@ -523,14 +523,14 @@ static int wm0010_stage2_load(struct snd_soc_codec *codec) ...@@ -523,14 +523,14 @@ static int wm0010_stage2_load(struct snd_soc_codec *codec)
dev_dbg(codec->dev, "Downloading %zu byte stage 2 loader\n", fw->size); dev_dbg(codec->dev, "Downloading %zu byte stage 2 loader\n", fw->size);
/* Copy to local buffer first as vmalloc causes problems for dma */ /* Copy to local buffer first as vmalloc causes problems for dma */
img = kzalloc(fw->size, GFP_KERNEL); img = kzalloc(fw->size, GFP_KERNEL | GFP_DMA);
if (!img) { if (!img) {
dev_err(codec->dev, "Failed to allocate image buffer\n"); dev_err(codec->dev, "Failed to allocate image buffer\n");
ret = -ENOMEM; ret = -ENOMEM;
goto abort2; goto abort2;
} }
out = kzalloc(fw->size, GFP_KERNEL); out = kzalloc(fw->size, GFP_KERNEL | GFP_DMA);
if (!out) { if (!out) {
dev_err(codec->dev, "Failed to allocate output buffer\n"); dev_err(codec->dev, "Failed to allocate output buffer\n");
ret = -ENOMEM; ret = -ENOMEM;
...@@ -670,14 +670,14 @@ static int wm0010_boot(struct snd_soc_codec *codec) ...@@ -670,14 +670,14 @@ static int wm0010_boot(struct snd_soc_codec *codec)
ret = -ENOMEM; ret = -ENOMEM;
len = pll_rec.length + 8; len = pll_rec.length + 8;
out = kzalloc(len, GFP_KERNEL); out = kzalloc(len, GFP_KERNEL | GFP_DMA);
if (!out) { if (!out) {
dev_err(codec->dev, dev_err(codec->dev,
"Failed to allocate RX buffer\n"); "Failed to allocate RX buffer\n");
goto abort; goto abort;
} }
img_swap = kzalloc(len, GFP_KERNEL); img_swap = kzalloc(len, GFP_KERNEL | GFP_DMA);
if (!img_swap) { if (!img_swap) {
dev_err(codec->dev, dev_err(codec->dev,
"Failed to allocate image buffer\n"); "Failed to allocate image buffer\n");
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment