ASoC: qcom: use correct device pointer in dma allocation
authorSrinivas Kandagatla <srinivas.kandagatla@linaro.org>
Mon, 11 Jan 2016 15:17:23 +0000 (15:17 +0000)
committerMark Brown <broonie@kernel.org>
Mon, 11 Jan 2016 15:29:25 +0000 (15:29 +0000)
commitf5f76ea75dce553631ffb08abc44dcecb68e74d4
tree6b6008c8d6bc0948ec2a9522ca59e5c2cf1b2fdd
parent8005c49d9aea74d382f474ce11afbbc7d7130bec
ASoC: qcom: use correct device pointer in dma allocation

dev pointer in struct snd_soc_pcm_runtime does not have dma_ops set. In
v4.4 kernel dma_ops would end up pointing to dummy_dma_ops in such cases.
So attempting to use such device in allocating coherent memory on aarch64
would fail.

According to commit 1dccb598df549d892b6450c261da54cdd7af44b4 ("arm64:
simplify dma_get_ops") The current behavior of dma_get_ops is to fall
back to the global dma_ops when a device has not set its own dma_ops,
but only for DT based systems.

So, this patch fixes the driver to use correct device pointer while
allocating coherent memory, and also deletes un-necessary dma_mask setup
on soc_runtime->dev.

Without this patch lpass driver would fail with below log:
...
[    6.541542]  ADV7533: lpass_platform_alloc_buffer: Could not allocate DMA buffer
[    6.541914] apq8016-lpass-cpu 7708000.lpass-cpu: ASoC: pcm constructor failed: -12
[    6.548216] qcom-apq8016-sbc 7702000.sound: ASoC: can't create pcm ADV7533 :-12
[    6.555581] qcom-apq8016-sbc 7702000.sound: ASoC: failed to instantiate card -12
[    6.566072] qcom-apq8016-sbc: probe of 7702000.sound failed with error -12
...

Signed-off-by: Srinivas Kandagatla <srinivas.kandagatla@linaro.org>
Signed-off-by: Mark Brown <broonie@kernel.org>
sound/soc/qcom/lpass-platform.c