summaryrefslogtreecommitdiffstats
path: root/sound/soc/qcom/lpass-platform.c
Commit message (Collapse)AuthorAgeFilesLines
* ASoC: qcom: clean up indentation, remove extraneous tabColin Ian King2018-11-171-1/+1
| | | | | | | | The return statement is indented too much by one level, fix this by removing the extraneous tab. Signed-off-by: Colin Ian King <colin.king@canonical.com> Signed-off-by: Mark Brown <broonie@kernel.org>
* ASoC: qcom: Use snd_pcm_stop_xrun() helperTakashi Iwai2018-07-041-1/+1
| | | | | | | | | The XRUN trigger from the driver should be done via snd_pcm_stop_xrun(). It fixes the missing stream locking as a gratis, too. Signed-off-by: Takashi Iwai <tiwai@suse.de> Signed-off-by: Mark Brown <broonie@kernel.org>
* ASoC: qcom: lpass-platform: replace platform to componentKuninori Morimoto2018-02-121-19/+23
| | | | | | | Now platform can be replaced to component, let's do it. Signed-off-by: Kuninori Morimoto <kuninori.morimoto.gx@renesas.com> Signed-off-by: Mark Brown <broonie@kernel.org>
* ASoC: qcom: remove duplicate initializations of dma_ch and vColin Ian King2017-09-191-2/+0Star
| | | | | | | | | | | | | | | | dma_ch is being initialized to zero and then immediately afterwards being updated again, so the first initialization is redundant and can be remove. Likewise, the pointer v is being initialized twice, so remove the second duplicate initialization. Cleans up two clang build warnings: warning: Value stored to 'dma_ch' is never read warning: Value stored to 'v' during its initialization is never read Signed-off-by: Colin Ian King <colin.king@canonical.com> Signed-off-by: Mark Brown <broonie@kernel.org>
* ASoC: qcom: make snd_pcm_hardware constBhumika Goyal2017-08-171-1/+1
| | | | | | | | | | Make this const as it is either passed as the 2nd argument to the function snd_soc_set_runtime_hwparams, which is const or used in a copy operation. Done using Coccinelle. Signed-off-by: Bhumika Goyal <bhumirks@gmail.com> Signed-off-by: Mark Brown <broonie@kernel.org>
* ASoC: qcom: make snd_soc_platform_driver constBhumika Goyal2017-08-141-1/+1
| | | | | | | | | Make this const as it is only passed as the 2nd argument to the function devm_snd_soc_register_platform, which is of type const. Done using Coccinelle. Signed-off-by: Bhumika Goyal <bhumirks@gmail.com> Signed-off-by: Mark Brown <broonie@kernel.org>
* ASoC: qcom: Drop __func__ usage from log printsBjorn Andersson2017-01-311-54/+52Star
| | | | | | | | | | The combination of dev_err() and __func__ make most of these log prints over 100 chars long. Remove the usage of __func__ to clean the kernel log and as the usage is not necessary to identify the individual log prints. Signed-off-by: Bjorn Andersson <bjorn.andersson@linaro.org> Signed-off-by: Mark Brown <broonie@kernel.org>
*-. Merge remote-tracking branches 'asoc/topic/of-graph', 'asoc/topic/pxa', ↵Mark Brown2016-12-121-37/+9Star
|\ \ | | | | | | | | | 'asoc/topic/qcom' and 'asoc/topic/rk808' into asoc-next
| | * ASoC: lpass-platform: use dma_ch instead of rdma_ch/wrdma_chSrinivas Kandagatla2016-10-311-37/+9Star
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | This patch cleans up usage of wrdma_ch and rdma_ch variables into a common variable dma_ch, As there is no real use of tracking the dma channel in two different variables based on stream direction. Signed-off-by: Srinivas Kandagatla <srinivas.kandagatla@linaro.org> Acked-by: Kenneth Westfield <kwestfie@codeaurora.org> Signed-off-by: Mark Brown <broonie@kernel.org>
| | |
| \ \
*-. \ \ Merge remote-tracking branches 'asoc/fix/da7219-pops' and 'asoc/fix/qcom' ↵Mark Brown2016-12-121-0/+3
|\ \ \ \ | | |/ / | |/| | | | | | into asoc-linus
| | * | ASoC: lpass-platform: initialize dma channel numberArnd Bergmann2016-11-091-0/+3
| | |/ | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | A bugfix accidentally removed the implicit initialization of the dma channel number, causing undefined behavior when v->alloc_dma_channel is NULL: sound/soc/qcom/lpass-platform.c: In function ‘lpass_platform_pcmops_open’: sound/soc/qcom/lpass-platform.c:83:29: error: ‘dma_ch’ may be used uninitialized in this function [-Werror=maybe-uninitialized] This adds back an explicit initialization to zero, restoring the previous behavior for that case. Fixes: 022d00ee0b55 ("ASoC: lpass-platform: Fix broken pcm data usage") Signed-off-by: Arnd Bergmann <arnd@arndb.de> Acked-by: Kenneth Westfield <kwestfie@codeaurora.org> Signed-off-by: Mark Brown <broonie@kernel.org>
* | / ASoC: lpass-platform: fix uninitialized variableLinus Torvalds2016-11-141-0/+1
| |/ |/| | | | | | | | | | | | | | | | | | | | | | | | | | | | | In commit 022d00ee0b55 ("ASoC: lpass-platform: Fix broken pcm data usage") the stream specific information initialization was broken, with the dma channel information not being initialized if there was no alloc_dma_channel() helper function. Before that, the DMA channel number was implicitly initialized to zero because the backing store was allocated with devm_kzalloc(). When the init code was rewritten, that implicit initialization was lost, and gcc rightfully complains about an uninitialized variable being used. Cc: Srinivas Kandagatla <srinivas.kandagatla@linaro.org> Cc: Mark Brown <broonie@kernel.org> Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
* | ASoC: lpass-platform: Fix broken pcm data usageSrinivas Kandagatla2016-10-311-86/+79Star
|/ | | | | | | | | | | | | | | | | | This patch fixes lpass-platform driver which was broken in v4.9-rc1. lpass_pcm_data data structure holds information specific to stream. Holding a single private pointer to it in global lpass_data will not work, because it would be overwritten by for each pcm instance. This code was breaking playback when we have both playback and capture pcm streams, as playback settings are over written by capture settings. Fix this by moving channel allocation logic out of pcm_new to pcm_open so that we can store the stream specific information in private_data of snd_pcm_runtime. Fixes: 6adcbdcd4b6e ("ASoC: lpass-platform: don't use snd_soc_pcm_set_drvdata()") Signed-off-by: Srinivas Kandagatla <srinivas.kandagatla@linaro.org> Signed-off-by: Mark Brown <broonie@kernel.org>
*-. Merge remote-tracking branches 'asoc/topic/nau8810', 'asoc/topic/of-bool', ↵Mark Brown2016-09-291-7/+7
|\ \ | | | | | | | | | 'asoc/topic/omap' and 'asoc/topic/platform-drvdata' into asoc-next
| | * ASoC: lpass-platform: don't use snd_soc_pcm_set_drvdata()Kuninori Morimoto2016-08-091-7/+7
| |/ | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | snd_soc_pcm_set_drvdata() will set driver data to rtd->dev, but driver data of rtd->dev is already used as "rtd" on soc_post_component_init(). static int soc_post_component_init(xxx) { ... dev_set_drvdata(rtd->dev, rtd); ... } To remove confusion, snd_soc_pcm_set/get_drvdata() should be removed soon. This patch is for it. qcom/lpass-platform.c sets struct lpass_pcm_data to rtd->dev today, but we can replace it to struct lpass_data :: private_data. Signed-off-by: Kuninori Morimoto <kuninori.morimoto.gx@renesas.com> Signed-off-by: Mark Brown <broonie@kernel.org>
* / ASoC: constify snd_pcm_ops structuresJulia Lawall2016-09-121-1/+1
|/ | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Check for snd_pcm_ops structures that are only stored in the ops field of a snd_soc_platform_driver structure or passed as the third argument to snd_pcm_set_ops. The corresponding field or parameter is declared const, so snd_pcm_ops structures that have this property can be declared as const also. The semantic patch that makes this change is as follows: (http://coccinelle.lip6.fr/) // <smpl> @r disable optional_qualifier@ identifier i; position p; @@ static struct snd_pcm_ops i@p = { ... }; @ok1@ identifier r.i; struct snd_soc_platform_driver e; position p; @@ e.ops = &i@p; @ok2@ identifier r.i; expression e1, e2; position p; @@ snd_pcm_set_ops(e1, e2, &i@p) @bad@ position p != {r.p,ok1.p,ok2.p}; identifier r.i; struct snd_pcm_ops e; @@ e@i@p @depends on !bad disable optional_qualifier@ identifier r.i; @@ static +const struct snd_pcm_ops i = { ... }; // </smpl> Signed-off-by: Julia Lawall <Julia.Lawall@lip6.fr> Signed-off-by: Mark Brown <broonie@kernel.org>
* ASoC: qcom: remove IS_ERR_VALUE usage on int.Srinivas Kandagatla2016-03-311-2/+4
| | | | | | | | | | | IS_ERR_VALUE should be used only with unsigned long type, signed types should use comparison 'ret < 0' This patch removes such usages. Reported-by: Dan Carpenter <dan.carpenter@oracle.com> Signed-off-by: Srinivas Kandagatla <srinivas.kandagatla@linaro.org> Signed-off-by: Mark Brown <broonie@kernel.org>
* ASoC: qcom: Fix uninitialized symbol warning.Srinivas Kandagatla2016-03-311-1/+1
| | | | | | | | | | | | | This patch fixes following static checker warning, by initializing the ret to -EINVAL, as one of the code path in lpass_platform_pcm_new() uses this variable uninitialized. sound/soc/qcom/lpass-platform.c:555 lpass_platform_pcm_new() error: uninitialized symbol 'ret'. Reported-by: Dan Carpenter <dan.carpenter@oracle.com> Signed-off-by: Srinivas Kandagatla <srinivas.kandagatla@linaro.org> Signed-off-by: Mark Brown <broonie@kernel.org>
* ASoC: qcom: add mic supportSrinivas Kandagatla2016-02-191-46/+121
| | | | | | | | | | This patch adds mic support to the lpass driver, most of the driver is reused as it is, only the register level access is changed depending on te direction of the stream. Signed-off-by: Srinivas Kandagatla <srinivas.kandagatla@linaro.org> Acked-by: Kenneth Westfield <kwestfie@codeaurora.org> Signed-off-by: Mark Brown <broonie@kernel.org>
* ASoC: qcom: add generic bit masks for RDMA and WRDMASrinivas Kandagatla2016-02-191-25/+29
| | | | | | | | | | | | | | This patch adds generic masks for accessing bits in rdma/wrdma registers. Doing this would simplify the driver and adding capture support would be much simpler. Also there is no point in having same bit masks for bits in both rdma and wrdma registers. This patch also deletes the RDMA specific bit masks and makes the code use the generic bit masks. Signed-off-by: Srinivas Kandagatla <srinivas.kandagatla@linaro.org> Acked-by: Kenneth Westfield <kwestfie@codeaurora.org> Signed-off-by: Mark Brown <broonie@kernel.org>
* ASoC: qcom: pass direction to dma allocationSrinivas Kandagatla2016-02-191-1/+2
| | | | | | | | | | This patch updates the internal dma allocation callbacks to take the stream direction so that it can allocate channels suitable for that stream direction. Before the capture support this was not necessary. Signed-off-by: Srinivas Kandagatla <srinivas.kandagatla@linaro.org> Acked-by: Kenneth Westfield <kwestfie@codeaurora.org> Signed-off-by: Mark Brown <broonie@kernel.org>
* ASoC: qcom: rename rdmactl_audif_start to dmactrl_audif_startSrinivas Kandagatla2016-02-191-2/+2
| | | | | | | | | | This patch renames rdmactl_audif_start to dmactrl_audif_start as this is common for both rdma and wrdma. Without this patch the name would be bit misleading to the readers. Signed-off-by: Srinivas Kandagatla <srinivas.kandagatla@linaro.org> Acked-by: Kenneth Westfield <kwestfie@codeaurora.org> Signed-off-by: Mark Brown <broonie@kernel.org>
* ASoC: qcom: use snd_dma_alloc/free* apisSrinivas Kandagatla2016-02-191-36/+6Star
| | | | | | | | | | There is no point in having local allocation functions when the driver can use snd_dma_alloc/free() apis. This patch replaces the local versions of the dma allocation apis with the snd_dma_alloc/free() apis. Signed-off-by: Srinivas Kandagatla <srinivas.kandagatla@linaro.org> Acked-by: Kenneth Westfield <kwestfie@codeaurora.org> Signed-off-by: Mark Brown <broonie@kernel.org>
* ASoC: qcom: use correct device pointer in dma allocationSrinivas Kandagatla2016-01-111-9/+6Star
| | | | | | | | | | | | | | | | | | | | | | | | | | | | 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>
* ASoC: qcom: Add ability to handle interrupts per dma channelSrinivas Kandagatla2015-05-221-35/+59
| | | | | | | | | | | This patch adds ablity to lpass driver to handle interrupt per dma channel. Without this patch its not possible to use multipl ports on the lpass. Tested-by: Kenneth Westfield <kwestfie@codeaurora.org> Acked-by: Kenneth Westfield <kwestfie@codeaurora.org> Signed-off-by: Srinivas Kandagatla <srinivas.kandagatla@linaro.org> Signed-off-by: Mark Brown <broonie@kernel.org>
* ASoC: qcom: add dma channel control offset to variant dataSrinivas Kandagatla2015-05-221-1/+1
| | | | | | | | | | | This patch adds ability to pass dma channel control bits start offset, which differ in differnet qcom SOCs. On apq8016 dma channel control bits start after an offset of 1. Tested-by: Kenneth Westfield <kwestfie@codeaurora.org> Acked-by: Kenneth Westfield <kwestfie@codeaurora.org> Signed-off-by: Srinivas Kandagatla <srinivas.kandagatla@linaro.org> Signed-off-by: Mark Brown <broonie@kernel.org>
* ASoC: qcom: remove hardcoded dma channelSrinivas Kandagatla2015-05-211-30/+63
| | | | | | | | | | | | This patch removes hardcoded dma channel value in lpass driver, Now the dma channel allocation happens in the SOC specific layer. This will allow different LPASS integrations to use the lpass driver in more generic way. Signed-off-by: Srinivas Kandagatla <srinivas.kandagatla@linaro.org> Tested-by: Kenneth Westfield <kwestfie@codeaurora.org> Acked-by: Kenneth Westfield <kwestfie@codeaurora.org> Signed-off-by: Mark Brown <broonie@kernel.org>
* ASoC: qcom: move ipq806x specific bits out of lpass driver.Srinivas Kandagatla2015-05-211-20/+29
| | | | | | | | | | | | | | This patch tries to make the lpass driver more generic by moving the ipq806x specific bits out of the cpu and platform driver, also allows the SOC specific drivers to add the correct register offsets. This patch also renames the register definition header file into more generic header file. Signed-off-by: Srinivas Kandagatla <srinivas.kandagatla@linaro.org> Tested-by: Kenneth Westfield <kwestfie@codeaurora.org> Acked-by: Kenneth Westfield <kwestfie@codeaurora.org> Signed-off-by: Mark Brown <broonie@kernel.org>
* ASoC: qcom: remove unnecessary header filesSrinivas Kandagatla2015-05-041-6/+0Star
| | | | | | | | This patch removes unnecessary header files in lpass cpu and platform code. Signed-off-by: Srinivas Kandagatla <srinivas.kandagatla@linaro.org> Signed-off-by: Mark Brown <broonie@kernel.org>
* ASoC: qcom: Add LPASS platform driverKenneth Westfield2015-03-051-0/+526
Add platform driver for the Qualcomm Technologies low-power audio subsystem (LPASS) ports. Signed-off-by: Kenneth Westfield <kwestfie@codeaurora.org> Acked-by: Banajit Goswami <bgoswami@codeaurora.org> Signed-off-by: Mark Brown <broonie@kernel.org>