summaryrefslogtreecommitdiff
path: root/sound/soc/qcom
AgeCommit message (Collapse)Author
2021-10-28ASoC: qdsp6: audioreach: Fix clang -Wimplicit-fallthroughNathan Chancellor
Clang warns: sound/soc/qcom/qdsp6/topology.c:465:3: warning: unannotated fall-through between switch labels [-Wimplicit-fallthrough] default: ^ sound/soc/qcom/qdsp6/topology.c:465:3: note: insert 'break;' to avoid fall-through default: ^ break; 1 warning generated. Clang is a little more pedantic than GCC, which permits implicit fallthroughs to cases that contain just break or return. Clang's version is more in line with the kernel's own stance in deprecated.rst, which states that all switch/case blocks must end in either break, fallthrough, continue, goto, or return. Add the missing break to fix the warning. Link: https://github.com/ClangBuiltLinux/linux/issues/1495 Signed-off-by: Nathan Chancellor <nathan@kernel.org> Link: https://lore.kernel.org/r/20211027190823.4057382-1-nathan@kernel.org Signed-off-by: Mark Brown <broonie@kernel.org>
2021-10-26ASoC: qdsp6: audioreach: add support for q6prm-clocksSrinivas Kandagatla
Add q6prm clocks using existing qdsp6-audio-clock driver Signed-off-by: Srinivas Kandagatla <srinivas.kandagatla@linaro.org> Reviewed-by: Pierre-Louis Bossart <pierre-louis.bossart@linux.intel.com> Link: https://lore.kernel.org/r/20211026111655.1702-18-srinivas.kandagatla@linaro.org Signed-off-by: Mark Brown <broonie@kernel.org>
2021-10-26ASoC: qdsp6: audioreach: add q6prm supportSrinivas Kandagatla
Add support to q6prm (Proxy Resource Manager) module used for clock resources Signed-off-by: Srinivas Kandagatla <srinivas.kandagatla@linaro.org> Reviewed-by: Pierre-Louis Bossart <pierre-louis.bossart@linux.intel.com> Link: https://lore.kernel.org/r/20211026111655.1702-17-srinivas.kandagatla@linaro.org Signed-off-by: Mark Brown <broonie@kernel.org>
2021-10-26ASoC: qdsp6: audioreach: add q6apm lpass dai supportSrinivas Kandagatla
Add support to Audio port dais on LPASS Audio IP using existing common q6dsp-lpass-ports. Signed-off-by: Srinivas Kandagatla <srinivas.kandagatla@linaro.org> Reviewed-by: Pierre-Louis Bossart <pierre-louis.bossart@linux.intel.com> Link: https://lore.kernel.org/r/20211026111655.1702-16-srinivas.kandagatla@linaro.org Signed-off-by: Mark Brown <broonie@kernel.org>
2021-10-26ASoC: qdsp6: audioreach: add q6apm-dai supportSrinivas Kandagatla
Add support to pcm dais in Audio Process Manager. Signed-off-by: Srinivas Kandagatla <srinivas.kandagatla@linaro.org> Reviewed-by: Pierre-Louis Bossart <pierre-louis.bossart@linux.intel.com> Link: https://lore.kernel.org/r/20211026111655.1702-15-srinivas.kandagatla@linaro.org Signed-off-by: Mark Brown <broonie@kernel.org>
2021-10-26ASoC: qdsp6: audioreach: add topology supportSrinivas Kandagatla
Add ASoC topology support in audioreach Signed-off-by: Srinivas Kandagatla <srinivas.kandagatla@linaro.org> Reviewed-by: Pierre-Louis Bossart <pierre-louis.bossart@linux.intel.com> Link: https://lore.kernel.org/r/20211026111655.1702-14-srinivas.kandagatla@linaro.org Signed-off-by: Mark Brown <broonie@kernel.org>
2021-10-26ASoC: qdsp6: audioreach: add Kconfig and MakefileSrinivas Kandagatla
Now that all the code for audioreach and q6apm are in at this point to be able to compile, start adding Kconfig and Makefile changes. Signed-off-by: Srinivas Kandagatla <srinivas.kandagatla@linaro.org> Reviewed-by: Pierre-Louis Bossart <pierre-louis.bossart@linux.intel.com> Link: https://lore.kernel.org/r/20211026111655.1702-13-srinivas.kandagatla@linaro.org Signed-off-by: Mark Brown <broonie@kernel.org>
2021-10-26ASoC: qdsp6: audioreach: add module configuration command helpersSrinivas Kandagatla
Audioreach module configuration helpers, which will be used by the q6apm-dai driver. Signed-off-by: Srinivas Kandagatla <srinivas.kandagatla@linaro.org> Reviewed-by: Pierre-Louis Bossart <pierre-louis.bossart@linux.intel.com> Link: https://lore.kernel.org/r/20211026111655.1702-12-srinivas.kandagatla@linaro.org Signed-off-by: Mark Brown <broonie@kernel.org>
2021-10-26ASoC: qdsp6: audioreach: add q6apm supportSrinivas Kandagatla
Add support to q6apm (Audio Process Manager) component which is core Audioreach service running in the DSP. Signed-off-by: Srinivas Kandagatla <srinivas.kandagatla@linaro.org> Reviewed-by: Pierre-Louis Bossart <pierre-louis.bossart@linux.intel.com> Link: https://lore.kernel.org/r/20211026111655.1702-11-srinivas.kandagatla@linaro.org Signed-off-by: Mark Brown <broonie@kernel.org>
2021-10-26ASoC: qdsp6: audioreach: add basic pkt alloc supportSrinivas Kandagatla
Add basic helper functions for AudioReach. Signed-off-by: Srinivas Kandagatla <srinivas.kandagatla@linaro.org> Reviewed-by: Pierre-Louis Bossart <pierre-louis.bossart@linux.intel.com> Link: https://lore.kernel.org/r/20211026111655.1702-10-srinivas.kandagatla@linaro.org Signed-off-by: Mark Brown <broonie@kernel.org>
2021-10-26ASoC: qdsp6: q6afe-clocks: move audio-clocks to common fileSrinivas Kandagatla
Move common parts of q6afe-clocks to q6dsp-lpass-clocks so that we could reuse most of the driver for new Q6DSP audio frameworks. This is to make the code reuseable for new Q6DSP AudioReach framework. Signed-off-by: Srinivas Kandagatla <srinivas.kandagatla@linaro.org> Reviewed-by: Pierre-Louis Bossart <pierre-louis.bossart@linux.intel.com> Link: https://lore.kernel.org/r/20211026111655.1702-6-srinivas.kandagatla@linaro.org Signed-off-by: Mark Brown <broonie@kernel.org>
2021-10-26ASoC: qdsp6: q6afe-dai: move lpass audio ports to common fileSrinivas Kandagatla
Various Q6DSP frameworks will use LPASS Audio IP, so move all the hardware specific details to a common file so that they could be reused across multiple Q6DSP frameworks. In this case all the audio ports definitions can be moved to a common file to be able to reuse across multiple Q6DSP frameworks. Signed-off-by: Srinivas Kandagatla <srinivas.kandagatla@linaro.org> Reviewed-by: Pierre-Louis Bossart <pierre-louis.bossart@linux.intel.com> Link: https://lore.kernel.org/r/20211026111655.1702-5-srinivas.kandagatla@linaro.org Signed-off-by: Mark Brown <broonie@kernel.org>
2021-10-25ASoC: qcom: common: Respect status = "disabled" on DAI link nodesStephan Gerhold
At the moment, the DAI link nodes in the device tree always have to be specified completely in each device tree. However, the available interfaces (e.g. Primary/Secondary/Tertiary/Quaternary MI2S) are common for all devices of a SoC, so the majority of the definitions can be placed in a common device tree include to reduce boilerplate. Make it possible to define such stubs in device tree includes by respecting the "status" property for the DAI link nodes. This is a trivial change that just requires switching to the _available_ OF functions that check the "status" property additionally. This allows defining a stub like: sound_dai_quaternary: dai-link-quaternary { link-name = "Quaternary MI2S"; status = "disabled"; /* Needs extra codec configuration */ cpu { sound-dai = <&q6afedai QUATERNARY_MI2S_RX>; }; platform { sound-dai = <&q6routing>; }; }; where the codec would be filled in by the device-specific device tree. For existing device trees this change does not make any difference. A missing "status" property is treated like status = "okay". Cc: Srinivas Kandagatla <srinivas.kandagatla@linaro.org> Signed-off-by: Stephan Gerhold <stephan@gerhold.net> Reviewed-by: Srinivas Kandagatla <srinivas.kandagatla@linaro.org> Link: https://lore.kernel.org/r/20211025105503.49444-1-stephan@gerhold.net Signed-off-by: Mark Brown <broonie@kernel.org>
2021-10-22ASoC: fix unmet dependency on GPIOLIBJulian Braha
When SND_SOC_SC7180 or SND_SOC_STORM is selected, and GPIOLIB is not selected, Kbuild gives the following warning: WARNING: unmet direct dependencies detected for SND_SOC_MAX98357A Depends on [n]: SOUND [=y] && !UML && SND [=y] && SND_SOC [=y] && GPIOLIB [=n] Selected by [y]: - SND_SOC_STORM [=y] && SOUND [=y] && !UML && SND [=y] && SND_SOC [=y] && SND_SOC_QCOM [=y] - SND_SOC_SC7180 [=y] && SOUND [=y] && !UML && SND [=y] && SND_SOC [=y] && SND_SOC_QCOM [=y] && I2C [=y] This is because SND_SOC_MAX98357A is selected by SND_SOC_STORM and SND_SOC_SC7180, but these config options do not select or depend on GPIOLIB, despite SND_SOC_MAX98357A depending on GPIOLIB. These unmet dependency bugs were detected by Kismet, a static analysis tool for Kconfig. Please advise if this is not the appropriate solution. Signed-off-by: Julian Braha <julianbraha@gmail.com> Link: https://lore.kernel.org/r/20211010215627.17869-1-julianbraha@gmail.com Signed-off-by: Mark Brown <broonie@kernel.org>
2021-10-18ASoC: qcom: sm8250: Add Jack supportSrinivas Kandagatla
WCD938X on SM8250 MTP is connected via TX macro which has MBHC support, So add this jack support in the soundcard driver too. Signed-off-by: Srinivas Kandagatla <srinivas.kandagatla@linaro.org> Link: https://lore.kernel.org/r/20211006172745.22103-3-srinivas.kandagatla@linaro.org Signed-off-by: Mark Brown <broonie@kernel.org>
2021-10-18ASoC: qcom: sm8250: add support for TX and RX Macro daisSrinivas Kandagatla
On SM8250 MTP boards WCD938x codec is connected via TX and RX Macros, so add support for this dais in the soundcard driver. Signed-off-by: Srinivas Kandagatla <srinivas.kandagatla@linaro.org> Link: https://lore.kernel.org/r/20211006172745.22103-2-srinivas.kandagatla@linaro.org Signed-off-by: Mark Brown <broonie@kernel.org>
2021-10-01ASoC: qcom: apq8096: Constify static snd_soc_opsRikard Falkeborn
The struct iapq8096_ops is only assigned to the ops field in the snd_soc_dai_link struct which is a pointer to const struct snd_soc_ops. Make it const to allow the compiler to put it in read-only memory. Signed-off-by: Rikard Falkeborn <rikard.falkeborn@gmail.com> Link: https://lore.kernel.org/r/20211001115030.10402-1-rikard.falkeborn@gmail.com Signed-off-by: Mark Brown <broonie@kernel.org>
2021-09-21ASoC: qdsp6: q6afe-dai: Fix spelling mistake "Fronend" -> "Frontend"Colin Ian King
There is a spelling mistake in the module description. Fix it. Signed-off-by: Colin Ian King <colin.king@canonical.com> Reviewed-by: Srinivas Kandagatla <srinivas.kandagatla@linaro.org> Link: https://lore.kernel.org/r/20210920184152.18109-1-colin.king@canonical.com Signed-off-by: Mark Brown <broonie@kernel.org>
2021-08-30Merge tag 'asoc-v5.15' of ↵Takashi Iwai
https://git.kernel.org/pub/scm/linux/kernel/git/broonie/sound into for-linus ASoC: Updates for v5.15 Quite a quiet release this time, mostly a combination of cleanups and a good set of new drivers. - Lots of cleanups and improvements to the Intel drivers, including some new systems support. - New support for AMD Vangoh, CUI CMM-4030D-261, Mediatek Mt8195, Renesas RZ/G2L Mediatek Mt8195, RealTek RT101P, Renesas RZ/G2L,, Rockchip RK3568 S/PDIF.
2021-08-09ASoC: qdsp6: q6adm: fix cppcheck warnings for unnecessary initializationSrinivas Kandagatla
cppcheck reports below warning. q6adm.c:475]: (style) Variable 'matrix_map' is reassigned a value before the old one has been used. This is due to unnecessary initialization of variable matrix_map, which is now removed as part of this patch. Signed-off-by: Srinivas Kandagatla <srinivas.kandagatla@linaro.org> Link: https://lore.kernel.org/r/20210809123137.14456-3-srinivas.kandagatla@linaro.org Signed-off-by: Mark Brown <broonie@kernel.org>
2021-08-09ASoC: qdsp6: q6asm: fix cppcheck warnings for unnecessary initializationSrinivas Kandagatla
cppcheck reports below warning. q6asm.c:1631: (style) Variable 'port' is reassigned a value before the old one has been used. This is due to unnecessary initialization of variable port, which is now removed as part of this patch. Signed-off-by: Srinivas Kandagatla <srinivas.kandagatla@linaro.org> Link: https://lore.kernel.org/r/20210809123137.14456-2-srinivas.kandagatla@linaro.org Signed-off-by: Mark Brown <broonie@kernel.org>
2021-08-09ASoC: qcom: apq8016_sbc: Add SEC_MI2S supportVincent Knecht
This patch adds external codec support on secondary mi2s. It is used for headphones on some devices, eg. alcatel-idol347. Signed-off-by: Vincent Knecht <vincent.knecht@mailoo.org> Reviewed-by: Srinivas Kandagatla <srinivas.kandagatla@linaro.org> Link: https://lore.kernel.org/r/20210806114116.895473-1-vincent.knecht@mailoo.org Signed-off-by: Mark Brown <broonie@kernel.org>
2021-08-04ASoC: qcom: qdsp6: Use managed buffer allocationTakashi Iwai
This patch simplifies the buffer pre-allocation code of qcom qdsp6 driver with the standard managed buffer helper. It uses the newly introduced fixed-size buffer allocation helper. Cc: Srinivas Kandagatla <srinivas.kandagatla@linaro.org> Cc: Banajit Goswami <bgoswami@codeaurora.org> Acked-by: Mark Brown <broonie@kernel.org> Tested-by: Srinivas Kandagatla <srinivas.kandagatla@linaro.org> Link: https://lore.kernel.org/r/20210802072815.13551-15-tiwai@suse.de Signed-off-by: Takashi Iwai <tiwai@suse.de>
2021-08-04ASoC: qcom: lpass: Use managed buffer allocationTakashi Iwai
This patch simplifies the buffer pre-allocation code of qcom lpass driver with the standard managed buffer helper. It uses the newly introduced fixed-size buffer allocation helper. Cc: Srinivas Kandagatla <srinivas.kandagatla@linaro.org> Cc: Banajit Goswami <bgoswami@codeaurora.org> Acked-by: Mark Brown <broonie@kernel.org> Link: https://lore.kernel.org/r/20210802072815.13551-14-tiwai@suse.de Signed-off-by: Takashi Iwai <tiwai@suse.de>
2021-06-24ASoC: qcom: lpass-cpu: mark IRQ_CLEAR register as volatile and readableSrinivas Kandagatla
Currently IRQ_CLEAR register is marked as write-only, however using regmap_update_bits on this register will have some side effects. so mark IRQ_CLEAR register appropriately as readable and volatile. Fixes: da0363f7bfd3 ("ASoC: qcom: Fix for DMA interrupt clear reg overwriting") Reported-by: Marek Szyprowski <m.szyprowski@samsung.com> Tested-by: Marek Szyprowski <m.szyprowski@samsung.com> Tested-by: Srinivasa Rao Mandadapu <srivasam@codeaurora.org> Signed-off-by: Srinivas Kandagatla <srinivas.kandagatla@linaro.org> Link: https://lore.kernel.org/r/20210624092153.5771-1-srinivas.kandagatla@linaro.org Signed-off-by: Mark Brown <broonie@kernel.org>
2021-06-23Merge series "ASoC: tlv320aic32x4: Add support for TAS2505" from Claudius ↵Mark Brown
Heine <ch@denx.de>: Hi, this is v2 from my patchset that add support for the TAS2505 to the tlv320aic32x4 driver. kind regards, Claudius Changes from v1: - clarified commit message of first patch, which add the type value to the struct - removed unnecessary code to put and get speaker volume - removed 'Gain' from 'HP Driver Playback Volume' control - fixed rebase issues Claudius Heine (3): ASoC: tlv320aic32x4: add type to device private data struct ASoC: tlv320aic32x4: add support for TAS2505 ASoC: tlv320aic32x4: dt-bindings: add TAS2505 to compatible .../bindings/sound/tlv320aic32x4.txt | 1 + sound/soc/codecs/tlv320aic32x4-i2c.c | 22 ++- sound/soc/codecs/tlv320aic32x4-spi.c | 23 ++- sound/soc/codecs/tlv320aic32x4.c | 139 +++++++++++++++++- sound/soc/codecs/tlv320aic32x4.h | 10 ++ 5 files changed, 186 insertions(+), 9 deletions(-) base-commit: 70585216fe7730d9fb5453d3e2804e149d0fe201 -- 2.32.0
2021-06-21ASoC: qcom: lpass-cpu: Use devm_platform_get_and_ioremap_resource()Yang Yingliang
Use devm_platform_get_and_ioremap_resource() to simplify code. Signed-off-by: Yang Yingliang <yangyingliang@huawei.com> Link: https://lore.kernel.org/r/20210615140711.1676704-2-yangyingliang@huawei.com Signed-off-by: Mark Brown <broonie@kernel.org>
2021-06-21ASoC: qcom: apq8016_sbc: Use devm_platform_get_and_ioremap_resource()Yang Yingliang
Use devm_platform_get_and_ioremap_resource() to simplify code. Signed-off-by: Yang Yingliang <yangyingliang@huawei.com> Link: https://lore.kernel.org/r/20210615140711.1676704-1-yangyingliang@huawei.com Signed-off-by: Mark Brown <broonie@kernel.org>
2021-06-15ASoC: qdsp6: q6routing: Add Quinary MI2S portsGabriel David
This patch adds MI2S mixers to Quinary ports Signed-off-by: Gabriel David <ultracoolguy@disroot.org> Reviewed-by: Srinivas Kandagatla <srinivas.kandagatla@linaro.org> Link: https://lore.kernel.org/r/20210605022206.13226-5-ultracoolguy@disroot.org Signed-off-by: Mark Brown <broonie@kernel.org>
2021-06-15ASoC: qdsp6: q6afe-dai: Add Quinary MI2S portsGabriel David
This patch adds support to Quinary MI2S ports supported in AFE. Signed-off-by: Gabriel David <ultracoolguy@disroot.org> Reviewed-by: Srinivas Kandagatla <srinivas.kandagatla@linaro.org> Link: https://lore.kernel.org/r/20210605022206.13226-4-ultracoolguy@disroot.org Signed-off-by: Mark Brown <broonie@kernel.org>
2021-06-15ASoC: qdsp6: q6afe: Add Quinary MI2S portsGabriel David
This patch adds support for the Quinary MI2S ports on LPASS. Signed-off-by: Gabriel David <ultracoolguy@disroot.org> Reviewed-by: Srinivas Kandagatla <srinivas.kandagatla@linaro.org> Link: https://lore.kernel.org/r/20210605022206.13226-3-ultracoolguy@disroot.org Signed-off-by: Mark Brown <broonie@kernel.org>
2021-06-14ASoC: qcom: Add four speaker support on MI2S secondarySrinivasa Rao Mandadapu
Add four speaker support on MI2S secondary block by using I2S SD1 line on gpio52 pin, and add channel map control support in the lpass-cpu audio driver. Signed-off-by: Srinivasa Rao Mandadapu <srivasam@codeaurora.org> Reviewed-by: Srinivas Kandagatla <srinivas.kandagatla@linaro.org> Link: https://lore.kernel.org/r/20210609133039.4648-1-srivasam@codeaurora.org Signed-off-by: Mark Brown <broonie@kernel.org>
2021-06-14ASoC: qcom: Fix for DMA interrupt clear reg overwritingSrinivasa Rao Mandadapu
The DMA interrupt clear register overwritten during simultaneous playback and capture in lpass platform interrupt handler. It's causing playback or capture stuck in similtaneous plaback on speaker and capture on dmic test. Update appropriate reg fields of corresponding channel instead of entire register write. Fixes: commit c5c8635a04711 ("ASoC: qcom: Add LPASS platform driver") Signed-off-by: Srinivasa Rao Mandadapu <srivasam@codeaurora.org> Reviewed-by: Srinivas Kandagatla <srinivas.kandagatla@linaro.org> Link: https://lore.kernel.org/r/20210609072310.26099-1-srivasam@codeaurora.org Signed-off-by: Mark Brown <broonie@kernel.org>
2021-06-07ASoC: qcom: lpass-cpu: Fix pop noise during audio capture beginSrinivasa Rao Mandadapu
This patch fixes PoP noise of around 15ms observed during audio capture begin. Enables BCLK and LRCLK in snd_soc_dai_ops prepare call for introducing some delay before capture start. (am from https://patchwork.kernel.org/patch/12276369/) (also found at https://lore.kernel.org/r/20210524142114.18676-1-srivasam@codeaurora.org) Co-developed-by: Judy Hsiao <judyhsiao@chromium.org> Signed-off-by: Judy Hsiao <judyhsiao@chromium.org> Signed-off-by: Srinivasa Rao Mandadapu <srivasam@codeaurora.org> Reviewed-by: Srinivas Kandagatla <srinivas.kandagatla@linaro.org> Link: https://lore.kernel.org/r/20210604154545.1198337-1-judyhsiao@chromium.org Signed-off-by: Mark Brown <broonie@kernel.org>
2021-06-04ASoC: qcom: sdm845: add jack support for WCD934xSrinivas Kandagatla
Signed-off-by: Srinivas Kandagatla <srinivas.kandagatla@linaro.org> Link: https://lore.kernel.org/r/20210604115230.23259-5-srinivas.kandagatla@linaro.org Signed-off-by: Mark Brown <broonie@kernel.org>
2021-06-01ASoC: qcom: q6asm-dai: Constify static struct snd_compress_opsRikard Falkeborn
The snd_compress_ops structs are only stored in the compress_ops field of a snd_soc_component_driver struct, so make it const to allow the compiler to put it in read-only memory. Signed-off-by: Rikard Falkeborn <rikard.falkeborn@gmail.com> Reviewed-by: Srinivas Kandagatla <srinivas.kandagatla@linaro.org> Link: https://lore.kernel.org/r/20210526231013.46530-5-rikard.falkeborn@gmail.com Signed-off-by: Mark Brown <broonie@kernel.org>
2021-05-21ASoC: qcom: lpass-cpu: Use optional clk APIsStephen Boyd
This driver spits out a warning for me at boot: sc7180-lpass-cpu 62f00000.lpass: asoc_qcom_lpass_cpu_platform_probe() error getting optional null: -2 but it looks like it is all an optional clk. Use the optional clk APIs here so that we don't see this message and everything else is the same. Cc: Srinivas Kandagatla <srinivas.kandagatla@linaro.org> Cc: Banajit Goswami <bgoswami@codeaurora.org> Fixes: 3e53ac8230c1 ("ASoC: qcom: make osr clock optional") Signed-off-by: Stephen Boyd <swboyd@chromium.org> Reviewed-by: Srinivas Kandagatla <srinivas.kandagatla@linaro.org> Link: https://lore.kernel.org/r/20210520014807.3749797-1-swboyd@chromium.org Signed-off-by: Mark Brown <broonie@kernel.org>
2021-03-31Merge tag 'mute-led-rework' of ↵Mark Brown
https://git.kernel.org/pub/scm/linux/kernel/git/tiwai/sound into asoc-5.13 ALSA: control - add generic LED API This patchset tries to resolve the diversity in the audio LED control among the ALSA drivers. A new control layer registration is introduced which allows to run additional operations on top of the elementary ALSA sound controls. A new control access group (three bits in the access flags) was introduced to carry the LED group information for the sound controls. The low-level sound drivers can just mark those controls using this access group. This information is not exported to the user space, but user space can manage the LED sound control associations through sysfs (last patch) per Mark's request. It makes things fully configurable in the kernel and user space (UCM). The actual state ('route') evaluation is really easy (the minimal value check for all channels / controls / cards). If there's more complicated logic for a given hardware, the card driver may eventually export a new read-only sound control for the LED group and do the logic itself. The new LED trigger control code is completely separated and possibly optional (there's no symbol dependency). The full code separation allows eventually to move this LED trigger control to the user space in future. Actually it replaces the already present functionality in the kernel space (HDA drivers) and allows a quick adoption for the recent hardware (ASoC codecs including SoundWire). snd_ctl_led 24576 0 The sound driver implementation is really easy: 1) call snd_ctl_led_request() when control LED layer should be automatically activated / it calls module_request("snd-ctl-led") on demand / 2) mark all related kcontrols with SNDRV_CTL_ELEM_ACCESS_SPK_LED or SNDRV_CTL_ELEM_ACCESS_MIC_LED Link: https://lore.kernel.org/r/20210317172945.842280-1-perex@perex.cz Signed-off-by: Takashi Iwai <tiwai@suse.de>
2021-03-30ASoC: q6afe-clocks: fix reprobing of the driverDmitry Baryshkov
Q6afe-clocks driver can get reprobed. For example if the APR services are restarted after the firmware crash. However currently Q6afe-clocks driver will oops because hw.init will get cleared during first _probe call. Rewrite the driver to fill the clock data at runtime rather than using big static array of clocks. Signed-off-by: Dmitry Baryshkov <dmitry.baryshkov@linaro.org> Reviewed-by: Srinivas Kandagatla <srinivas.kandagatla@linaro.org> Reviewed-by: Stephen Boyd <sboyd@kernel.org> Fixes: 520a1c396d19 ("ASoC: q6afe-clocks: add q6afe clock controller") Link: https://lore.kernel.org/r/20210327092857.3073879-1-dmitry.baryshkov@linaro.org Signed-off-by: Mark Brown <broonie@kernel.org>
2021-03-11ASoC: qcom: lpass-cpu: Fix lpass dai ids parseSrinivasa Rao Mandadapu
The max boundary check while parsing dai ids makes sound card registration fail after common up dai ids. Fixes: cd3484f7f138 ("ASoC: qcom: Fix broken support to MI2S TERTIARY and QUATERNARY") Signed-off-by: Srinivasa Rao Mandadapu <srivasam@codeaurora.org> Link: https://lore.kernel.org/r/20210311154557.24978-1-srivasam@codeaurora.org Signed-off-by: Mark Brown <broonie@kernel.org>
2021-03-10ASoC: qcom: q6dsp: fix kernel-doc warningPierre-Louis Bossart
make W=1 warning: sound/soc/qcom/qdsp6/q6afe.c:1460: warning: expecting prototype for q6afe_dam_port_prepare(). Prototype was for q6afe_cdc_dma_port_prepare() instead Signed-off-by: Pierre-Louis Bossart <pierre-louis.bossart@linux.intel.com> Link: https://lore.kernel.org/r/20210302205926.49063-10-pierre-louis.bossart@linux.intel.com Signed-off-by: Mark Brown <broonie@kernel.org>
2021-03-10Merge series "ASoC: qcom: remove cppcheck warnings" from Pierre-Louis ↵Mark Brown
Bossart <pierre-louis.bossart@linux.intel.com>: Second batch of cleanups for Qualcomm SOCs and codecs. The only functional change is the addition of a missing error check in the last patch. Pierre-Louis Bossart (10): ASoC: qcom: lpass-hdmi: remove useless return ASoC: qcom: lpass-platform: remove useless assignment ASoC: qcom: q6dsp-dai: clarify expression ASoC: qcom: q6afe: remove useless assignments ASoC: qcom: q6afe: align function prototype ASoC: qcom: q6asm: align function prototypes ASoC: wcd-clsh-v2: align function prototypes ASoC: wcd9335: clarify return value ASoC: wcd934x: remove useless return ASoC: lpass-wsa-macro: add missing test sound/soc/codecs/lpass-wsa-macro.c | 2 ++ sound/soc/codecs/wcd-clsh-v2.h | 6 +++--- sound/soc/codecs/wcd9335.c | 2 +- sound/soc/codecs/wcd934x.c | 2 -- sound/soc/qcom/lpass-hdmi.c | 4 ---- sound/soc/qcom/lpass-platform.c | 2 +- sound/soc/qcom/qdsp6/q6afe-dai.c | 2 +- sound/soc/qcom/qdsp6/q6afe.c | 5 ++--- sound/soc/qcom/qdsp6/q6afe.h | 2 +- sound/soc/qcom/qdsp6/q6asm.h | 6 +++--- 10 files changed, 14 insertions(+), 19 deletions(-) -- 2.25.1
2021-03-10ASoC: constify of_phandle_args in snd_soc_get_dai_name()Krzysztof Kozlowski
The pointer to of_phandle_args passed to snd_soc_get_dai_name() and of_xlate_dai_name() implementations is not modified. Since it is being used only to translate passed OF node to a DAI name, it should not be modified, so mark it as const for correctness and safer code. Signed-off-by: Krzysztof Kozlowski <krzk@kernel.org> Link: https://lore.kernel.org/r/20210221153024.453583-1-krzk@kernel.org Signed-off-by: Mark Brown <broonie@kernel.org>
2021-03-10ASoC: qcom: q6asm: align function prototypesPierre-Louis Bossart
cppcheck warnings: sound/soc/qcom/qdsp6/q6asm.c:502:16: style:inconclusive: Function 'q6asm_map_memory_regions' argument 4 names different: declaration 'bufsz' definition 'period_sz'. [funcArgNamesDifferent] size_t period_sz, unsigned int periods) ^ sound/soc/qcom/qdsp6/q6asm.h:150:16: note: Function 'q6asm_map_memory_regions' argument 4 names different: declaration 'bufsz' definition 'period_sz'. size_t bufsz, unsigned int bufcnt); ^ sound/soc/qcom/qdsp6/q6asm.c:502:16: note: Function 'q6asm_map_memory_regions' argument 4 names different: declaration 'bufsz' definition 'period_sz'. size_t period_sz, unsigned int periods) ^ sound/soc/qcom/qdsp6/q6asm.c:502:40: style:inconclusive: Function 'q6asm_map_memory_regions' argument 5 names different: declaration 'bufcnt' definition 'periods'. [funcArgNamesDifferent] size_t period_sz, unsigned int periods) ^ sound/soc/qcom/qdsp6/q6asm.h:150:36: note: Function 'q6asm_map_memory_regions' argument 5 names different: declaration 'bufcnt' definition 'periods'. size_t bufsz, unsigned int bufcnt); ^ sound/soc/qcom/qdsp6/q6asm.c:502:40: note: Function 'q6asm_map_memory_regions' argument 5 names different: declaration 'bufcnt' definition 'periods'. size_t period_sz, unsigned int periods) ^ sound/soc/qcom/qdsp6/q6asm.c:823:47: style:inconclusive: Function 'q6asm_get_session_id' argument 1 names different: declaration 'ac' definition 'c'. [funcArgNamesDifferent] int q6asm_get_session_id(struct audio_client *c) ^ sound/soc/qcom/qdsp6/q6asm.h:146:47: note: Function 'q6asm_get_session_id' argument 1 names different: declaration 'ac' definition 'c'. int q6asm_get_session_id(struct audio_client *ac); ^ sound/soc/qcom/qdsp6/q6asm.c:823:47: note: Function 'q6asm_get_session_id' argument 1 names different: declaration 'ac' definition 'c'. int q6asm_get_session_id(struct audio_client *c) ^ sound/soc/qcom/qdsp6/q6asm.c:1573:52: style:inconclusive: Function 'q6asm_write_async' argument 6 names different: declaration 'flags' definition 'wflags'. [funcArgNamesDifferent] uint32_t msw_ts, uint32_t lsw_ts, uint32_t wflags) ^ sound/soc/qcom/qdsp6/q6asm.h:100:52: note: Function 'q6asm_write_async' argument 6 names different: declaration 'flags' definition 'wflags'. uint32_t msw_ts, uint32_t lsw_ts, uint32_t flags); ^ sound/soc/qcom/qdsp6/q6asm.c:1573:52: note: Function 'q6asm_write_async' argument 6 names different: declaration 'flags' definition 'wflags'. uint32_t msw_ts, uint32_t lsw_ts, uint32_t wflags) ^ Signed-off-by: Pierre-Louis Bossart <pierre-louis.bossart@linux.intel.com> Reviewed-by: Srinivas Kandagatla <srinivas.kandagatla@linaro.org> Link: https://lore.kernel.org/r/20210218222916.89809-7-pierre-louis.bossart@linux.intel.com Signed-off-by: Mark Brown <broonie@kernel.org>
2021-03-10ASoC: qcom: q6afe: align function prototypePierre-Louis Bossart
cppcheck warning: sound/soc/qcom/qdsp6/q6afe.c:1101:63: style:inconclusive: Function 'q6afe_set_lpass_clock' argument 3 names different: declaration 'clk_src' definition 'attri'. [funcArgNamesDifferent] int q6afe_set_lpass_clock(struct device *dev, int clk_id, int attri, ^ sound/soc/qcom/qdsp6/q6afe.h:236:63: note: Function 'q6afe_set_lpass_clock' argument 3 names different: declaration 'clk_src' definition 'attri'. int q6afe_set_lpass_clock(struct device *dev, int clk_id, int clk_src, ^ sound/soc/qcom/qdsp6/q6afe.c:1101:63: note: Function 'q6afe_set_lpass_clock' argument 3 names different: declaration 'clk_src' definition 'attri'. int q6afe_set_lpass_clock(struct device *dev, int clk_id, int attri, ^ Signed-off-by: Pierre-Louis Bossart <pierre-louis.bossart@linux.intel.com> Reviewed-by: Srinivas Kandagatla <srinivas.kandagatla@linaro.org> Link: https://lore.kernel.org/r/20210218222916.89809-6-pierre-louis.bossart@linux.intel.com Signed-off-by: Mark Brown <broonie@kernel.org>
2021-03-10ASoC: qcom: q6afe: remove useless assignmentsPierre-Louis Bossart
cppcheck warnings: sound/soc/qcom/qdsp6/q6afe.c:848:25: note: Assignment 'p=NULL', assigned value is 0 struct q6afe_port *p = NULL; ^ sound/soc/qcom/qdsp6/q6afe.c:854:7: note: Null pointer dereference if (p->token == token) { ^ sound/soc/qcom/qdsp6/q6afe.c:939:8: style: Redundant initialization for 'wait'. The initialized value is overwritten before it is read. [redundantInitialization] wait = &port->wait; ^ sound/soc/qcom/qdsp6/q6afe.c:933:26: note: wait is initialized wait_queue_head_t *wait = &port->wait; ^ sound/soc/qcom/qdsp6/q6afe.c:939:8: note: wait is overwritten wait = &port->wait; ^ sound/soc/qcom/qdsp6/q6afe.c:1191:10: style: Redundant initialization for 'port_id'. The initialized value is overwritten before it is read. [redundantInitialization] port_id = port->id; ^ sound/soc/qcom/qdsp6/q6afe.c:1186:14: note: port_id is initialized int port_id = port->id; ^ sound/soc/qcom/qdsp6/q6afe.c:1191:10: note: port_id is overwritten port_id = port->id; ^ Signed-off-by: Pierre-Louis Bossart <pierre-louis.bossart@linux.intel.com> Reviewed-by: Srinivas Kandagatla <srinivas.kandagatla@linaro.org> Link: https://lore.kernel.org/r/20210218222916.89809-5-pierre-louis.bossart@linux.intel.com Signed-off-by: Mark Brown <broonie@kernel.org>
2021-03-10ASoC: qcom: q6dsp-dai: clarify expressionPierre-Louis Bossart
cppcheck warning: sound/soc/qcom/qdsp6/q6afe-dai.c:264:35: style: Clarify calculation precedence for '&' and '?'. [clarifyCalculation] tdm->slot_mask = (dai->id & 0x1 ? tx_mask : rx_mask) & cap_mask; ^ Signed-off-by: Pierre-Louis Bossart <pierre-louis.bossart@linux.intel.com> Reviewed-by: Srinivas Kandagatla <srinivas.kandagatla@linaro.org> Link: https://lore.kernel.org/r/20210218222916.89809-4-pierre-louis.bossart@linux.intel.com Signed-off-by: Mark Brown <broonie@kernel.org>
2021-03-10ASoC: qcom: lpass-platform: remove useless assignmentPierre-Louis Bossart
cppcheck warning: sound/soc/qcom/lpass-platform.c:791:10: style: Variable 'ret' is assigned a value that is never used. [unreadVariable] int ret = -EINVAL; ^ Signed-off-by: Pierre-Louis Bossart <pierre-louis.bossart@linux.intel.com> Reviewed-by: Srinivas Kandagatla <srinivas.kandagatla@linaro.org> Link: https://lore.kernel.org/r/20210218222916.89809-3-pierre-louis.bossart@linux.intel.com Signed-off-by: Mark Brown <broonie@kernel.org>
2021-03-10ASoC: qcom: lpass-hdmi: remove useless returnPierre-Louis Bossart
cppcheck warning: sound/soc/qcom/lpass-hdmi.c:189:9: warning: Identical condition and return expression 'ret', return value is always 0 [identicalConditionAfterEarlyExit] return ret; ^ sound/soc/qcom/lpass-hdmi.c:186:6: note: If condition 'ret' is true, the function will return/exit if (ret) ^ sound/soc/qcom/lpass-hdmi.c:189:9: note: Returning identical expression 'ret' return ret; ^ sound/soc/qcom/lpass-hdmi.c:206:9: warning: Identical condition and return expression 'ret', return value is always 0 [identicalConditionAfterEarlyExit] return ret; ^ sound/soc/qcom/lpass-hdmi.c:203:6: note: If condition 'ret' is true, the function will return/exit if (ret) ^ sound/soc/qcom/lpass-hdmi.c:206:9: note: Returning identical expression 'ret' return ret; ^ Signed-off-by: Pierre-Louis Bossart <pierre-louis.bossart@linux.intel.com> Reviewed-by: Srinivas Kandagatla <srinivas.kandagatla@linaro.org> Link: https://lore.kernel.org/r/20210218222916.89809-2-pierre-louis.bossart@linux.intel.com Signed-off-by: Mark Brown <broonie@kernel.org>
2021-03-10ASoC: qcom: sdm845: Fix array out of range on rx slim channelsSrinivas Kandagatla
WCD934x has only 13 RX SLIM ports however we are setting it as 16 in set_channel_map, this will lead to array out of bounds error! Orignally caught by enabling USBAN array out of bounds check: Fixes: 5caf64c633a3 ("ASoC: qcom: sdm845: add support to DB845c and Lenovo Yoga") Reported-by: John Stultz <john.stultz@linaro.org> Signed-off-by: Srinivas Kandagatla <srinivas.kandagatla@linaro.org> Link: https://lore.kernel.org/r/20210309142129.14182-3-srinivas.kandagatla@linaro.org Signed-off-by: Mark Brown <broonie@kernel.org>