summaryrefslogtreecommitdiffstats
path: root/sound
Commit message (Collapse)AuthorAgeFilesLines
* ASoC: q6asm-dai: add gapless supportSrinivas Kandagatla2020-08-172-6/+98
| | | | | | | | | | | | | | | Add support to gapless playback by implementing metadata, next_track, drain and partial drain support. Gapless on Q6ASM is implemented by opening 2 streams in a single q6asm stream and toggling them on next track. Signed-off-by: Srinivas Kandagatla <srinivas.kandagatla@linaro.org> Tested-by: Vinod Koul <vkoul@kernel.org> Reviewed-by: Pierre-Louis Bossart <pierre-louis.bossart@linux.intel.com> Reviewed-by: Vinod Koul <vkoul@kernel.org> Link: https://lore.kernel.org/r/20200727093806.17089-10-srinivas.kandagatla@linaro.org Signed-off-by: Mark Brown <broonie@kernel.org>
* ASoC: q6asm-dai: prepare set params to accept profile changeSrinivas Kandagatla2020-08-171-64/+85
| | | | | | | | | | | | | | | | rearrange code so that it will be easy to change the codec profile at runtime. This means moving exiting set_params to an internal wrapper which can be called when codec profile changes. This is also preparing the code for easy to use in gapless cases. Signed-off-by: Srinivas Kandagatla <srinivas.kandagatla@linaro.org> Tested-by: Vinod Koul <vkoul@kernel.org> Reviewed-by: Pierre-Louis Bossart <pierre-louis.bossart@linux.intel.com> Reviewed-by: Vinod Koul <vkoul@kernel.org> Link: https://lore.kernel.org/r/20200727093806.17089-9-srinivas.kandagatla@linaro.org Signed-off-by: Mark Brown <broonie@kernel.org>
* ASoC: q6asm-dai: add next track metadata supportSrinivas Kandagatla2020-08-171-0/+26
| | | | | | | | | | | This patch adds support to metadata required to do a gapless playback. Signed-off-by: Srinivas Kandagatla <srinivas.kandagatla@linaro.org> Tested-by: Vinod Koul <vkoul@kernel.org> Reviewed-by: Pierre-Louis Bossart <pierre-louis.bossart@linux.intel.com> Reviewed-by: Vinod Koul <vkoul@kernel.org> Link: https://lore.kernel.org/r/20200727093806.17089-8-srinivas.kandagatla@linaro.org Signed-off-by: Mark Brown <broonie@kernel.org>
* ASoC: q6asm: add support to gapless flag in q6asm openSrinivas Kandagatla2020-08-173-4/+6
| | | | | | | | | | | This patch adds support to gapless flag to q6asm_open_write(). Signed-off-by: Srinivas Kandagatla <srinivas.kandagatla@linaro.org> Tested-by: Vinod Koul <vkoul@kernel.org> Reviewed-by: Pierre-Louis Bossart <pierre-louis.bossart@linux.intel.com> Reviewed-by: Vinod Koul <vkoul@kernel.org> Link: https://lore.kernel.org/r/20200727093806.17089-7-srinivas.kandagatla@linaro.org Signed-off-by: Mark Brown <broonie@kernel.org>
* ASoC: q6asm: add support to remove intial and trailing silenceSrinivas Kandagatla2020-08-172-0/+59
| | | | | | | | | | | | | This patch adds support to ASM_DATA_CMD_REMOVE_INITIAL_SILENCE and ASM_DATA_CMD_REMOVE_TRAILING_SILENCE q6asm command to support compressed metadata for gapless playback. Signed-off-by: Srinivas Kandagatla <srinivas.kandagatla@linaro.org> Tested-by: Vinod Koul <vkoul@kernel.org> Reviewed-by: Pierre-Louis Bossart <pierre-louis.bossart@linux.intel.com> Reviewed-by: Vinod Koul <vkoul@kernel.org> Link: https://lore.kernel.org/r/20200727093806.17089-6-srinivas.kandagatla@linaro.org Signed-off-by: Mark Brown <broonie@kernel.org>
* ASoC: q6asm: add length to write command tokenSrinivas Kandagatla2020-08-173-4/+10
| | | | | | | | | | | | | | | Add length to write command packet token so that we can track exactly how many bytes are consumed by DSP in the command reply. This is useful in some use-cases where the end of the file/stream is not aligned with period size. Signed-off-by: Srinivas Kandagatla <srinivas.kandagatla@linaro.org> Tested-by: Vinod Koul <vkoul@kernel.org> Reviewed-by: Pierre-Louis Bossart <pierre-louis.bossart@linux.intel.com> Reviewed-by: Vinod Koul <vkoul@kernel.org> Link: https://lore.kernel.org/r/20200727093806.17089-5-srinivas.kandagatla@linaro.org Signed-off-by: Mark Brown <broonie@kernel.org>
* ASoC: q6asm: use flags directly from q6asm-daiSrinivas Kandagatla2020-08-173-9/+5
| | | | | | | | | | | | | | use flags set by q6asm-dais directly! This will be useful gapless case where write needs a special flag to indicate that last buffer. Signed-off-by: Srinivas Kandagatla <srinivas.kandagatla@linaro.org> Tested-by: Vinod Koul <vkoul@kernel.org> Reviewed-by: Pierre-Louis Bossart <pierre-louis.bossart@linux.intel.com> Reviewed-by: Vinod Koul <vkoul@kernel.org> Link: https://lore.kernel.org/r/20200727093806.17089-4-srinivas.kandagatla@linaro.org Signed-off-by: Mark Brown <broonie@kernel.org>
* ASoC: q6asm: make commands specific to streamsSrinivas Kandagatla2020-08-173-80/+129
| | | | | | | | | | | | | | | | | | | Each ASM session can have multiple streams attached to it, current design was to allow only one static stream id 1 per each session. However for use-case like gapless, we would need 2 streams to open per session. This patch converts all the q6asm apis to take stream id as argument to allow multiple streams to open on a single session, This is useful for gapless playback cases. Now the dai driver can specify which stream id for each command. Signed-off-by: Srinivas Kandagatla <srinivas.kandagatla@linaro.org> Tested-by: Vinod Koul <vkoul@kernel.org> Reviewed-by: Pierre-Louis Bossart <pierre-louis.bossart@linux.intel.com> Reviewed-by: Vinod Koul <vkoul@kernel.org> Link: https://lore.kernel.org/r/20200727093806.17089-3-srinivas.kandagatla@linaro.org Signed-off-by: Mark Brown <broonie@kernel.org>
* ASoC: q6asm: rename misleading session id variableSrinivas Kandagatla2020-08-171-5/+5
| | | | | | | | | | | | Each q6asm session can have multiple streams, mixing usage of these names in variable are bit misleading to reader, so rename them accordingly. Signed-off-by: Srinivas Kandagatla <srinivas.kandagatla@linaro.org> Tested-by: Vinod Koul <vkoul@kernel.org> Reviewed-by: Pierre-Louis Bossart <pierre-louis.bossart@linux.intel.com> Reviewed-by: Vinod Koul <vkoul@kernel.org> Link: https://lore.kernel.org/r/20200727093806.17089-2-srinivas.kandagatla@linaro.org Signed-off-by: Mark Brown <broonie@kernel.org>
* Merge existing fixes from asoc/for-5.9Mark Brown2020-08-1717-243/+266
|\
| * ASoC: intel: Fix memleak in sst_media_openDinghao Liu2020-08-171-2/+3
| | | | | | | | | | | | | | | | | | | | | | | | When power_up_sst() fails, stream needs to be freed just like when try_module_get() fails. However, current code is returning directly and ends up leaking memory. Fixes: 0121327c1a68b ("ASoC: Intel: mfld-pcm: add control for powering up/down dsp") Signed-off-by: Dinghao Liu <dinghao.liu@zju.edu.cn> Acked-by: Pierre-Louis Bossart <pierre-louis.bossart@linux.intel.com> Link: https://lore.kernel.org/r/20200813084112.26205-1-dinghao.liu@zju.edu.cn Signed-off-by: Mark Brown <broonie@kernel.org>
| * ASoC: wm8994: Avoid attempts to read unreadable registersSylwester Nawrocki2020-08-171-0/+4
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | The driver supports WM1811, WM8994, WM8958 devices but according to documentation and the regmap definitions the WM8958_DSP2_* registers are only available on WM8958. In current code these registers are being accessed as if they were available on all the three chips. When starting playback on WM1811 CODEC multiple errors like: "wm8994-codec wm8994-codec: ASoC: error at soc_component_read_no_lock on wm8994-codec: -5" can be seen, which is caused by attempts to read an unavailable WM8958_DSP2_PROGRAM register. The issue has been uncovered by recent commit "e2329ee ASoC: soc-component: add soc_component_err()". This patch adds a check in wm8958_aif_ev() callback so the DSP2 handling is only done for WM8958. Signed-off-by: Sylwester Nawrocki <s.nawrocki@samsung.com> Acked-by: Charles Keepax <ckeepax@opensource.cirrus.com> Link: https://lore.kernel.org/r/20200731173834.23832-1-s.nawrocki@samsung.com Signed-off-by: Mark Brown <broonie@kernel.org>
| * ASoC: msm8916-wcd-analog: fix register Interrupt offsetSrinivas Kandagatla2020-08-171-2/+2
| | | | | | | | | | | | | | | | | | | | | | | | | | For some reason interrupt set and clear register offsets are not set correctly. This patch corrects them! Fixes: 585e881e5b9e ("ASoC: codecs: Add msm8916-wcd analog codec") Signed-off-by: Srinivas Kandagatla <srinivas.kandagatla@linaro.org> Tested-by: Stephan Gerhold <stephan@gerhold.net> Reviewed-by: Stephan Gerhold <stephan@gerhold.net> Link: https://lore.kernel.org/r/20200811103452.20448-1-srinivas.kandagatla@linaro.org Signed-off-by: Mark Brown <broonie@kernel.org>
| * ASoC: wm8994: Prevent access to invalid VU register bits on WM1811Sylwester Nawrocki2020-08-171-16/+44
| | | | | | | | | | | | | | | | | | | | | | | | | | The ADC2 and DAC2 are not available on WM1811 device. This patch moves the ADC2, DAC2 VU bitfields to a separate array so we can skip accessing them and avoid unreadable register access on WM1811. This allows to get rid of warnings during boot like: wm8994-codec: ASoC: error at soc_component_read_no_lock on wm8994-codec: -5 Signed-off-by: Sylwester Nawrocki <s.nawrocki@samsung.com> Link: https://lore.kernel.org/r/20200804141043.11425-1-s.nawrocki@samsung.com Signed-off-by: Mark Brown <broonie@kernel.org>
| * ASoC: q6routing: add dummy register read/write functionSrinivas Kandagatla2020-08-111-0/+16
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Most of the DAPM widgets for DSP ASoC components reuse reg field of the widgets for its internal calculations, however these are not real registers. So read/writes to these numbers are not really valid. However ASoC core will read these registers to get default state during startup. With recent changes to ASoC core, every register read/write failures are reported very verbosely. Prior to this fails to reads are totally ignored, so we never saw any error messages. To fix this add dummy read/write function to return default value. Fixes: e3a33673e845 ("ASoC: qdsp6: q6routing: Add q6routing driver") Reported-by: John Stultz <john.stultz@linaro.org> Signed-off-by: Srinivas Kandagatla <srinivas.kandagatla@linaro.org> Link: https://lore.kernel.org/r/20200811120205.21805-2-srinivas.kandagatla@linaro.org Signed-off-by: Mark Brown <broonie@kernel.org>
| * ASoC: q6afe-dai: mark all widgets registers as SND_SOC_NOPMSrinivas Kandagatla2020-08-111-105/+105
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Looks like the q6afe-dai dapm widget registers are set as "0", which is a not correct. As this registers will be read by ASoC core during startup which will throw up errors, Fix this by making the registers as SND_SOC_NOPM as these should be never used. With recent changes to ASoC core, every register read/write failures are reported very verbosely. Prior to this fails to reads are totally ignored, so we never saw any error messages. Fixes: 24c4cbcfac09 ("ASoC: qdsp6: q6afe: Add q6afe dai driver") Reported-by: John Stultz <john.stultz@linaro.org> Signed-off-by: Srinivas Kandagatla <srinivas.kandagatla@linaro.org> Link: https://lore.kernel.org/r/20200811120205.21805-1-srinivas.kandagatla@linaro.org Signed-off-by: Mark Brown <broonie@kernel.org>
| * ASoC: Make soc_component_read() returning an error code againTakashi Iwai2020-08-111-1/+1
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Along with the recent unification of snd_soc_component_read*() functions, the behavior of snd_soc_component_read() was changed slightly; namely it returns the register read value directly, and even if an error happens, it returns zero (but it prints an error message). That said, the caller side can't know whether it's an error or not any longer. Ideally this shouldn't matter much, but in practice this seems causing a regression, as John reported. And, grepping the tree revealed that there are still plenty of callers that do check the error code, so we'll need to deal with them in anyway. As a quick band-aid over the regression, this patch changes the return value of snd_soc_component_read() again to the negative error code. It can't work, obviously, for 32bit register values, but it should be enough for the known regressions, so far. Fixes: cf6e26c71bfd ("ASoC: soc-component: merge snd_soc_component_read() and snd_soc_component_read32()") Reported-by: John Stultz <john.stultz@linaro.org> Signed-off-by: Takashi Iwai <tiwai@suse.de> Link: https://lore.kernel.org/r/20200810134631.19742-1-tiwai@suse.de Signed-off-by: Mark Brown <broonie@kernel.org>
| * ASoC: amd: Replacing component->name with codec_dai->name.Ravulapati Vishnu vardhan rao2020-08-101-1/+1
| | | | | | | | | | | | | | | | | | | | | | | | | | Replacing string compare with "codec_dai->name" instead of comparing with "codec_dai->component->name" in hw_params because, Here the component name for codec RT1015 is "i2c-10EC5682:00" and will never be "rt1015-aif1" as it is codec-dai->name. So, strcmp() always compares and fails to set the sysclk,pll,bratio for expected codec-dai="rt1015-aif1". Signed-off-by: Ravulapati Vishnu vardhan rao <Vishnuvardhanrao.Ravulapati@amd.com> Link: https://lore.kernel.org/r/20200807161046.17932-1-Vishnuvardhanrao.Ravulapati@amd.com Signed-off-by: Mark Brown <broonie@kernel.org>
| * Merge series "ASoC: tegra: Fix compile warning with CONFIG_PM=n" from ↵Mark Brown2020-08-035-10/+10
| |\ | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Takashi Iwai <tiwai@suse.de>: Hi, this is a trivial patch set to add the missing __maybe_unused for covering the compile warnings with CONFIG_PM=n. Takashi === Takashi Iwai (5): ASoC: tegra: tegra186_dspk: Fix compile warning with CONFIG_PM=n ASoC: tegra: tegra210_admaif: Fix compile warning with CONFIG_PM=n ASoC: tegra: tegra210_ahub: Fix compile warning with CONFIG_PM=n ASoC: tegra: tegra210_dmic: Fix compile warning with CONFIG_PM=n ASoC: tegra: tegra210_i2s: Fix compile warning with CONFIG_PM=n sound/soc/tegra/tegra186_dspk.c | 4 ++-- sound/soc/tegra/tegra210_admaif.c | 4 ++-- sound/soc/tegra/tegra210_ahub.c | 4 ++-- sound/soc/tegra/tegra210_dmic.c | 4 ++-- sound/soc/tegra/tegra210_i2s.c | 4 ++-- 5 files changed, 10 insertions(+), 10 deletions(-) -- 2.16.4
| | * ASoC: tegra: tegra210_i2s: Fix compile warning with CONFIG_PM=nTakashi Iwai2020-08-031-2/+2
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Fix trivial compile warnings wrt unused functions by adding __maybe_unused prefix: sound/soc/tegra/tegra210_i2s.c:167:12: warning: 'tegra210_i2s_runtime_suspend' defined but not used [-Wunused-function] sound/soc/tegra/tegra210_i2s.c:179:12: warning: 'tegra210_i2s_runtime_resume' defined but not used [-Wunused-function] Fixes: c0bfa98349d1 ("ASoC: tegra: Add Tegra210 based I2S driver") Signed-off-by: Takashi Iwai <tiwai@suse.de> Link: https://lore.kernel.org/r/20200803141850.23713-6-tiwai@suse.de Signed-off-by: Mark Brown <broonie@kernel.org>
| | * ASoC: tegra: tegra210_dmic: Fix compile warning with CONFIG_PM=nTakashi Iwai2020-08-031-2/+2
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Fix trivial compile warnings wrt unused functions by adding __maybe_unused prefix: sound/soc/tegra/tegra210_dmic.c:43:12: warning: 'tegra210_dmic_runtime_suspend' defined but not used [-Wunused-function] sound/soc/tegra/tegra210_dmic.c:55:12: warning: 'tegra210_dmic_runtime_resume' defined but not used [-Wunused-function] Fixes: 8c8ff982e9e2 ("ASoC: tegra: Add Tegra210 based DMIC driver") Signed-off-by: Takashi Iwai <tiwai@suse.de> Link: https://lore.kernel.org/r/20200803141850.23713-5-tiwai@suse.de Signed-off-by: Mark Brown <broonie@kernel.org>
| | * ASoC: tegra: tegra210_ahub: Fix compile warning with CONFIG_PM=nTakashi Iwai2020-08-031-2/+2
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Fix trivial compile warnings wrt unused functions by adding __maybe_unused prefix: sound/soc/tegra/tegra210_ahub.c:567:12: warning: 'tegra_ahub_runtime_suspend' defined but not used [-Wunused-function] sound/soc/tegra/tegra210_ahub.c:579:12: warning: 'tegra_ahub_runtime_resume' defined but not used [-Wunused-function] Fixes: 16e1bcc2caf4 ("ASoC: tegra: Add Tegra210 based AHUB driver") Signed-off-by: Takashi Iwai <tiwai@suse.de> Link: https://lore.kernel.org/r/20200803141850.23713-4-tiwai@suse.de Signed-off-by: Mark Brown <broonie@kernel.org>
| | * ASoC: tegra: tegra210_admaif: Fix compile warning with CONFIG_PM=nTakashi Iwai2020-08-031-2/+2
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Fix trivial compile warnings wrt unused functions by adding __maybe_unused prefix: sound/soc/tegra/tegra210_admaif.c:232:12: warning: 'tegra_admaif_runtime_resume' defined but not used [-Wunused-function] sound/soc/tegra/tegra210_ahub.c:567:12: warning: 'tegra_ahub_runtime_suspend' defined but not used [-Wunused-function] Fixes: f74028e159bb ("ASoC: tegra: Add Tegra210 based ADMAIF driver") Signed-off-by: Takashi Iwai <tiwai@suse.de> Link: https://lore.kernel.org/r/20200803141850.23713-3-tiwai@suse.de Signed-off-by: Mark Brown <broonie@kernel.org>
| | * ASoC: tegra: tegra186_dspk: Fix compile warning with CONFIG_PM=nTakashi Iwai2020-08-031-2/+2
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Fix trivial compile warnings wrt unused functions by adding __maybe_unused prefix: sound/soc/tegra/tegra186_dspk.c:74:12: warning: 'tegra186_dspk_runtime_suspend' defined but not used [-Wunused-function] sound/soc/tegra/tegra186_dspk.c:86:12: warning: 'tegra186_dspk_runtime_resume' defined but not used [-Wunused-function] Fixes: 327ef6470266 ("ASoC: tegra: Add Tegra186 based DSPK driver") Signed-off-by: Takashi Iwai <tiwai@suse.de> Link: https://lore.kernel.org/r/20200803141850.23713-2-tiwai@suse.de Signed-off-by: Mark Brown <broonie@kernel.org>
| * | ASoC: fsl: Fix unused variable warningTakashi Iwai2020-08-031-1/+0
| |/ | | | | | | | | | | | | | | | | | | | | | | | | The variable rtd was left unused in psc_dma_free(), even unnoticed during conversion to a new style: sound/soc/fsl/mpc5200_dma.c:342:30: warning: unused variable 'rtd' [-Wunused-variable] Drop the superfluous one. Fixes: 6d1048bc1152 ("ASoC: fsl: mpc5200_dma: remove snd_pcm_ops") Signed-off-by: Takashi Iwai <tiwai@suse.de> Link: https://lore.kernel.org/r/20200803144630.9615-1-tiwai@suse.de Signed-off-by: Mark Brown <broonie@kernel.org>
| * ASoC: amd: renoir: restore two more registers during resumeHui Wang2020-08-031-20/+9
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Recently we found an issue about the suspend and resume. If dmic is recording the sound, and we run suspend and resume, after the resume, the dmic can't work well anymore. we need to close the app and reopen the app, then the dmic could record the sound again. For example, we run "arecord -D hw:CARD=acp,DEV=0 -f S32_LE -c 2 -r 48000 test.wav", then suspend and resume, after the system resume back, we speak to the dmic. then stop the arecord, use aplay to play the test.wav, we could hear the sound recorded after resume is weird, it is not what we speak to the dmic. I found two registers are set in the dai_hw_params(), if the two registers are set during the resume, this issue could be fixed. Move the code of the dai_hw_params() into the pdm_dai_trigger(), then these two registers will be set during resume since pdm_dai_trigger() will be called during resume. And delete the empty function dai_hw_params(). Signed-off-by: Hui Wang <hui.wang@canonical.com> Reviewed-by: Vijendar Mukunda <Vijendar.Mukunda@amd.com> Cc: stable@vger.kernel.org Link: https://lore.kernel.org/r/20200730123138.5659-1-hui.wang@canonical.com Signed-off-by: Mark Brown <broonie@kernel.org>
| * ASoC: wm8962: Do not remove ADDITIONAL_CONTROL_4 from readable register listFabio Estevam2020-08-031-1/+1
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Removing ADDITIONAL_CONTROL_4 from the list of readable registers cause audio distortion. This change was sent as a comment below the --- line when submitting commit 658bb297e393 ("ASoC: wm8962: Do not access WM8962_GPIO_BASE"), so it was not supposed to get merged. Keep WM8962_ADDITIONAL_CONTROL_4 inside wm8962_readable_register() to fix the regression. Fixes: 658bb297e393 ("ASoC: wm8962: Do not access WM8962_GPIO_BASE") Reported-by: Shengjiu Wang <shengjiu.wang@gmail.com> Signed-off-by: Fabio Estevam <festevam@gmail.com> Link: https://lore.kernel.org/r/20200803115233.19034-1-festevam@gmail.com Signed-off-by: Mark Brown <broonie@kernel.org>
| * ASoC: fsl-asoc-card: Remove fsl_asoc_card_set_bias_level functionShengjiu Wang2020-08-031-84/+70
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | With this case: aplay -Dhw:x 16khz.wav 24khz.wav There is sound distortion for 24khz.wav. The reason is that setting PLL of WM8962 with set_bias_level function, the bias level is not changed when 24khz.wav is played, then the PLL won't be reset, the clock is not correct, so distortion happens. The resolution of this issue is to remove fsl_asoc_card_set_bias_level. Move PLL configuration to hw_params and hw_free. After removing fsl_asoc_card_set_bias_level, also test WM8960 case, it can work. Fixes: 708b4351f08c ("ASoC: fsl: Add Freescale Generic ASoC Sound Card with ASRC support") Signed-off-by: Shengjiu Wang <shengjiu.wang@nxp.com> Acked-by: Nicolin Chen <nicoleotsuka@gmail.com> Link: https://lore.kernel.org/r/1596420811-16690-1-git-send-email-shengjiu.wang@nxp.com Signed-off-by: Mark Brown <broonie@kernel.org>
* | Merge tag 'sound-fix-5.9-rc1' of ↵Linus Torvalds2020-08-1412-12/+92
|\ \ | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | git://git.kernel.org/pub/scm/linux/kernel/git/tiwai/sound Pull sound fixes from Takashi Iwai: "All device-specific small fixes and quirks mostly for usual suspects, USB-audio and HD-audio" * tag 'sound-fix-5.9-rc1' of git://git.kernel.org/pub/scm/linux/kernel/git/tiwai/sound: ALSA: echoaudio: Fix potential Oops in snd_echo_resume() ALSA: hda/hdmi: Use force connectivity quirk on another HP desktop ALSA: hda/realtek - Fix unused variable warning ALSA: hda - reverse the setting value in the micmute_led_set ALSA: echoaduio: Drop superfluous volatile modifier ALSA: usb-audio: Disable Lenovo P620 Rear line-in volume control ALSA: usb-audio: add quirk for Pioneer DDJ-RB ALSA: usb-audio: work around streaming quirk for MacroSilicon MS2109 ALSA: hda - fix the micmute led status for Lenovo ThinkCentre AIO ALSA: usb-audio: fix overeager device match for MacroSilicon MS2109 ALSA: hda/realtek: Fix pin default on Intel NUC 8 Rugged ALSA: usb-audio: Creative USB X-Fi Pro SB1095 volume knob support ALSA: usb-audio: fix spelling mistake "buss" -> "bus"
| * | ALSA: echoaudio: Fix potential Oops in snd_echo_resume()Dinghao Liu2020-08-131-2/+0
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Freeing chip on error may lead to an Oops at the next time the system goes to resume. Fix this by removing all snd_echo_free() calls on error. Fixes: 47b5d028fdce8 ("ALSA: Echoaudio - Add suspend support #2") Signed-off-by: Dinghao Liu <dinghao.liu@zju.edu.cn> Link: https://lore.kernel.org/r/20200813074632.17022-1-dinghao.liu@zju.edu.cn Signed-off-by: Takashi Iwai <tiwai@suse.de>
| * | ALSA: hda/hdmi: Use force connectivity quirk on another HP desktopKai-Heng Feng2020-08-121-0/+1
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | There's another HP desktop has buggy BIOS which flags the Port Connectivity bit as no connection. Apply force connectivity quirk to enable DP/HDMI audio. Signed-off-by: Kai-Heng Feng <kai.heng.feng@canonical.com> Link: https://lore.kernel.org/r/20200811095336.32396-1-kai.heng.feng@canonical.com Signed-off-by: Takashi Iwai <tiwai@suse.de>
| * | ALSA: hda/realtek - Fix unused variable warningTakashi Iwai2020-08-121-2/+0
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | The previous fix forgot to remove the unused variable that triggers a compile warning now: sound/pci/hda/patch_realtek.c: In function 'alc285_fixup_hp_gpio_led': sound/pci/hda/patch_realtek.c:4163:19: warning: unused variable 'spec' [-Wunused-variable] Fix it. Fixes: 404690649e6a ("ALSA: hda - reverse the setting value in the micmute_led_set") Reported-by: Stephen Rothwell <sfr@canb.auug.org.au> Link: https://lore.kernel.org/r/20200812070256.32145-1-tiwai@suse.de Signed-off-by: Takashi Iwai <tiwai@suse.de>
| * | ALSA: hda - reverse the setting value in the micmute_led_setHui Wang2020-08-111-4/+1
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Before the micmute_led_set() is introduced, the function of alc_gpio_micmute_update() will set the gpio value with the !micmute_led.led_value, and the machines have the correct micmute led status. After the micmute_led_set() is introduced, it sets the gpio value with !!micmute_led.led_value, so the led status is not correct anymore, we need to set micmute_led_polarity = 1 to workaround it. Now we fix the micmute_led_set() and remove micmute_led_polarity = 1. Fixes: 87dc36482cab ("ALSA: hda/realtek - Add LED class support for micmute LED") Reported-and-suggested-by: Kai-Heng Feng <kai.heng.feng@canonical.com> Cc: <stable@vger.kernel.org> Signed-off-by: Hui Wang <hui.wang@canonical.com> Link: https://lore.kernel.org/r/20200811122430.6546-1-hui.wang@canonical.com Signed-off-by: Takashi Iwai <tiwai@suse.de>
| * | ALSA: echoaduio: Drop superfluous volatile modifierTakashi Iwai2020-08-112-3/+2
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | The dsp_registers field of struct echoaduio has the volatile modifier, but it's basically superfluous; the field is accessed only for the base pointer of readl() and writel(), hence marking with __iomem alone should suffice. OTOH, having the volatile prefix causes a compile warning like: sound/pci/echoaudio/echoaudio.c:1878:14: warning: passing argument 1 of 'iounmap' discards 'volatile' qualifier from pointer target type [-Wdiscarded-qualifiers] So it's better to drop this superfluous modifier. Link: https://lore.kernel.org/r/20200803143958.24324-1-tiwai@suse.de Signed-off-by: Takashi Iwai <tiwai@suse.de>
| * | ALSA: usb-audio: Disable Lenovo P620 Rear line-in volume controlKai-Heng Feng2020-08-101-0/+1
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | The USB device (0x17aa:0x1046) that support Lenovo P620 rear panel line-in claim to support volume control, but it doens't seem to have an AMP, so when line-in volume lowers below 80, nothing gets recorded anymore. Disable the volume control to workaround the issue. Fixes: f8c11eb7da4a ("ALSA: usb-audio: Add support for Lenovo ThinkStation P620") Signed-off-by: Kai-Heng Feng <kai.heng.feng@canonical.com> Link: https://lore.kernel.org/r/20200810133108.31580-1-kai.heng.feng@canonical.com Signed-off-by: Takashi Iwai <tiwai@suse.de>
| * | ALSA: usb-audio: add quirk for Pioneer DDJ-RBHector Martin2020-08-101-0/+56
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | This is just another Pioneer device with fixed endpoints. Input is dummy but used as feedback (it always returns silence). Cc: stable@vger.kernel.org Signed-off-by: Hector Martin <marcan@marcan.st> Link: https://lore.kernel.org/r/20200810082502.225979-1-marcan@marcan.st Signed-off-by: Takashi Iwai <tiwai@suse.de>
| * | ALSA: usb-audio: work around streaming quirk for MacroSilicon MS2109Hector Martin2020-08-104-0/+11
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Further investigation of the L-R swap problem on the MS2109 reveals that the problem isn't that the channels are swapped, but rather that they are swapped and also out of phase by one sample. In other words, the issue is actually that the very first frame that comes from the hardware is a half-frame containing only the right channel, and after that everything becomes offset. So introduce a new quirk field to drop the very first 2 bytes that come in after the format is configured and a capture stream starts. This puts the channels in phase and in the correct order. Cc: stable@vger.kernel.org Signed-off-by: Hector Martin <marcan@marcan.st> Link: https://lore.kernel.org/r/20200810082400.225858-1-marcan@marcan.st Signed-off-by: Takashi Iwai <tiwai@suse.de>
| * | ALSA: hda - fix the micmute led status for Lenovo ThinkCentre AIOHui Wang2020-08-101-0/+1
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | After installing the Ubuntu Linux, the micmute led status is not correct. Users expect that the led is on if the capture is disabled, but with the current kernel, the led is off with the capture disabled. We tried the old linux kernel like linux-4.15, there is no this issue. It looks like we introduced this issue when switching to the led_cdev. Cc: <stable@vger.kernel.org> Signed-off-by: Hui Wang <hui.wang@canonical.com> Link: https://lore.kernel.org/r/20200810021659.7429-1-hui.wang@canonical.com Signed-off-by: Takashi Iwai <tiwai@suse.de>
| * | ALSA: usb-audio: fix overeager device match for MacroSilicon MS2109Hector Martin2020-08-101-1/+7
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Matching by device matches all interfaces, which breaks the video/HID portions of the device depending on module load order. Fixes: e337bf19f6af ("ALSA: usb-audio: add quirk for MacroSilicon MS2109") Cc: stable@vger.kernel.org Signed-off-by: Hector Martin <marcan@marcan.st> Link: https://lore.kernel.org/r/20200810045319.128745-1-marcan@marcan.st Signed-off-by: Takashi Iwai <tiwai@suse.de>
| * | ALSA: hda/realtek: Fix pin default on Intel NUC 8 RuggedKai-Heng Feng2020-08-071-0/+11
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | The jack on Intel NUC 8 Rugged rear panel doesn't work. The spec [1] states that the jack supports both headphone and microphone, so override a Pin Complex which has both Amp-In and Amp-Out to make the jack work. Node 0x1b fits the requirement, and user confirmed the jack now works with new pin config. [1] https://www.intel.com/content/dam/support/us/en/documents/mini-pcs/NUC8CCH_TechProdSpec.pdf BugLink: https://bugs.launchpad.net/bugs/1875199 Signed-off-by: Kai-Heng Feng <kai.heng.feng@canonical.com> Link: https://lore.kernel.org/r/20200807080514.15293-1-kai.heng.feng@canonical.com Signed-off-by: Takashi Iwai <tiwai@suse.de>
| * | ALSA: usb-audio: Creative USB X-Fi Pro SB1095 volume knob supportMirko Dietrich2020-08-061-0/+1
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Adds an entry for Creative USB X-Fi to the rc_config array in mixer_quirks.c to allow use of volume knob on the device. Adds support for newer X-Fi Pro card, known as "Model No. SB1095" with USB ID "041e:3263" Signed-off-by: Mirko Dietrich <buzz@l4m1.de> Cc: <stable@vger.kernel.org> Link: https://lore.kernel.org/r/20200806124850.20334-1-buzz@l4m1.de Signed-off-by: Takashi Iwai <tiwai@suse.de>
| * | ALSA: usb-audio: fix spelling mistake "buss" -> "bus"Colin Ian King2020-08-061-1/+1
| | | | | | | | | | | | | | | | | | | | | | | | | | | There is a spelling mistake in a usb_audio_dbg debug message. Also replace "param" with "parameter". Fix these. Signed-off-by: Colin Ian King <colin.king@canonical.com> Link: https://lore.kernel.org/r/20200806105134.46447-1-colin.king@canonical.com Signed-off-by: Takashi Iwai <tiwai@suse.de>
* | | Merge tag 'sound-5.9-rc1' of ↵Linus Torvalds2020-08-06605-5275/+15715
|\| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | git://git.kernel.org/pub/scm/linux/kernel/git/tiwai/sound Pull sound updates from Takashi Iwai: "This became wide and scattered updates all over the sound tree as diffstat shows: lots of (still ongoing) refactoring works in ASoC, fixes and cleanups caught by static analysis, inclusive term conversions as well as lots of new drivers. Below are highlights: ASoC core: - API cleanups and conversions to the unified mute_stream() call - Simplify I/O helper functions - Use helper macros to retrieve RTD from substreams ASoC drivers: - Lots of fixes and cleanups in Intel ASoC drivers - Lots of new stuff: Freescale MQS and i.MX6sx, Intel KeemBay I2S, Maxim MAX98360A and MAX98373 SoundWire, various Mediatek boards, nVidia Tegra 186 and 210, RealTek RL6231, Samsung Midas and Aries boards, TI J721e EVM ALSA core: - Minor code refacotring for SG-buffer handling HD-audio: - Generalization of mute-LED handling with LED classdev - Intel silent stream support for HDMI - Device-specific fixes: CA0132, Loongson-3 Others: - Usual USB- and HD-audio quirks for various devices - Fixes for echoaudio DMA position handling - Various documents and trivial fixes for sparse warnings - Conversion to adopt inclusive terms" * tag 'sound-5.9-rc1' of git://git.kernel.org/pub/scm/linux/kernel/git/tiwai/sound: (479 commits) ALSA: pci: delete repeated words in comments ALSA: isa: delete repeated words in comments ALSA: hda/tegra: Add 100us dma stop delay ALSA: hda: Add dma stop delay variable ASoC: hda/tegra: Set buffer alignment to 128 bytes ALSA: seq: oss: Serialize ioctls ALSA: hda/hdmi: Add quirk to force connectivity ALSA: usb-audio: add startech usb audio dock name ALSA: usb-audio: Add support for Lenovo ThinkStation P620 Revert "ALSA: hda: call runtime_allow() for all hda controllers" ALSA: hda/ca0132 - Fix AE-5 microphone selection commands. ALSA: hda/ca0132 - Add new quirk ID for Recon3D. ALSA: hda/ca0132 - Fix ZxR Headphone gain control get value. ALSA: hda/realtek: Add alc269/alc662 pin-tables for Loongson-3 laptops ALSA: docs: fix typo ALSA: doc: use correct config variable name ASoC: core: Two step component registration ASoC: core: Simplify snd_soc_component_initialize declaration ASoC: core: Relocate and expose snd_soc_component_initialize ASoC: sh: Replace 'select' DMADEVICES 'with depends on' ...
| * | ALSA: pci: delete repeated words in commentsRandy Dunlap2020-08-067-7/+7
| | | | | | | | | | | | | | | | | | | | | | | | | | | Drop duplicated words in sound/pci/. {and, the, at} Signed-off-by: Randy Dunlap <rdunlap@infradead.org> Link: https://lore.kernel.org/r/20200806021926.32418-1-rdunlap@infradead.org Signed-off-by: Takashi Iwai <tiwai@suse.de>
| * | ALSA: isa: delete repeated words in commentsRandy Dunlap2020-08-062-2/+2
| | | | | | | | | | | | | | | | | | | | | | | | | | | Drop duplicated words in sound/isa/. {be, bit} Signed-off-by: Randy Dunlap <rdunlap@infradead.org> Link: https://lore.kernel.org/r/20200806021916.32369-1-rdunlap@infradead.org Signed-off-by: Takashi Iwai <tiwai@suse.de>
| * | ALSA: hda/tegra: Add 100us dma stop delayMohan Kumar2020-08-051-0/+1
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Tegra HDA has audio data buffer for upto tens of frames, this buffer can help to avoid underflow. HW will keep issuing new data fetch request when buffers are not full and current BDL is not done. When SW disable DMA RUN bit for a stream, HW can't cancel the already issued data fetch request and hence it can't stop DMA. HW has to wait for all issued data fetch request get data returned before it stops DMA. This HW behavior is not in sync with HDA spec which says DMA RUN bit should be cleared within 1 audio frame. For Tegra, DMA RUN bit was active for more than one audio frame, due to this the timeout in snd_hdac_stream_sync function is not helping. When Stream reset set and clear happens during DMA RUN bit active state it results in Memory Decode error. Unfortunately, there is no way to detect when these data accesses have completed, but testing has shown that a 100us delay between Stream reset set and clear operation for Tegra avoids the memory decode error. Therefore, adding a 100us dma stop delay. Signed-off-by: Mohan Kumar <mkumard@nvidia.com> Link: https://lore.kernel.org/r/20200805095221.5476-4-mkumard@nvidia.com Signed-off-by: Takashi Iwai <tiwai@suse.de>
| * | ALSA: hda: Add dma stop delay variableMohan Kumar2020-08-051-0/+7
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | A variable dma_stop_delay is added as a new member in hdac_bus structure to avoid memory decode error incase DMA RUN bit is not disabled in the given timeout from snd_hdac_stream_sync function and followed by stream reset which results in memory decode error between reset set and clear operation. Signed-off-by: Mohan Kumar <mkumard@nvidia.com> Link: https://lore.kernel.org/r/20200805095221.5476-3-mkumard@nvidia.com Signed-off-by: Takashi Iwai <tiwai@suse.de>
| * | ASoC: hda/tegra: Set buffer alignment to 128 bytesMohan Kumar2020-08-051-0/+2
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Set chip->align_buffer_size to 1 for Tegra platforms to make the buffer alignment to be multiple of 128 bytes. This fix is applied as gstreamer alsasink gets stuck with the default buffer-time and latency-time parameters with 4 byte buffer alignment. Signed-off-by: Mohan Kumar <mkumard@nvidia.com> Link: https://lore.kernel.org/r/20200805095221.5476-2-mkumard@nvidia.com Signed-off-by: Takashi Iwai <tiwai@suse.de>
| * | ALSA: seq: oss: Serialize ioctlsTakashi Iwai2020-08-051-1/+7
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Some ioctls via OSS sequencer API may race and lead to UAF when the port create and delete are performed concurrently, as spotted by a couple of syzkaller cases. This patch is an attempt to address it by serializing the ioctls with the existing register_mutex. Basically OSS sequencer API is an obsoleted interface and was designed without much consideration of the concurrency. There are very few applications with it, and the concurrent performance isn't asked, hence this "big hammer" approach should be good enough. Reported-by: syzbot+1a54a94bd32716796edd@syzkaller.appspotmail.com Reported-by: syzbot+9d2abfef257f3e2d4713@syzkaller.appspotmail.com Suggested-by: Hillf Danton <hdanton@sina.com> Cc: <stable@vger.kernel.org> Link: https://lore.kernel.org/r/20200804185815.2453-1-tiwai@suse.de Signed-off-by: Takashi Iwai <tiwai@suse.de>
| * | ALSA: hda/hdmi: Add quirk to force connectivityKai-Heng Feng2020-08-041-1/+15
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | HDMI on some platforms doesn't enable audio support because its Port Connectivity [31:30] is set to AC_JACK_PORT_NONE: Node 0x05 [Pin Complex] wcaps 0x40778d: 8-Channels Digital Amp-Out CP Amp-Out caps: ofs=0x00, nsteps=0x00, stepsize=0x00, mute=1 Amp-Out vals: [0x00 0x00] Pincap 0x0b000094: OUT Detect HBR HDMI DP Pin Default 0x58560010: [N/A] Digital Out at Int HDMI Conn = Digital, Color = Unknown DefAssociation = 0x1, Sequence = 0x0 Pin-ctls: 0x40: OUT Unsolicited: tag=00, enabled=0 Power states: D0 D3 EPSS Power: setting=D0, actual=D0 Devices: 0 Connection: 3 0x02 0x03* 0x04 For now, use a quirk to force connectivity based on SSID. If there are more platforms affected by the same issue, we can eye for a more generic solution. Signed-off-by: Kai-Heng Feng <kai.heng.feng@canonical.com> Link: https://lore.kernel.org/r/20200804155836.16252-1-kai.heng.feng@canonical.com Signed-off-by: Takashi Iwai <tiwai@suse.de>