aboutsummaryrefslogtreecommitdiffstatshomepage
path: root/sound/soc/stm/stm32_spdifrx.c (follow)
AgeCommit message (Collapse)AuthorFilesLines
2020-03-27Merge branch 'for-5.6' of https://git.kernel.org/pub/scm/linux/kernel/git/broonie/sound into asoc-5.7Mark Brown1-0/+2
2020-03-18ASoC: stm32: spdifrx: manage rebind issueOlivier Moysan1-30/+32
The commit e894efef9ac7 ("ASoC: core: add support to card rebind") allows to rebind the sound card after a rebind of one of its component. With this commit, the sound card is actually rebound, but may be no more functional. Corrections: - Call snd_dmaengine_pcm_register() before snd_soc_register_component(). - Call snd_dmaengine_pcm_unregister() and snd_soc_unregister_component() explicitly from SPDFIRX driver. Signed-off-by: Olivier Moysan <olivier.moysan@st.com> Link: https://lore.kernel.org/r/20200318144125.9163-3-olivier.moysan@st.com Signed-off-by: Mark Brown <broonie@kernel.org>
2020-03-18ASoC: stm32: spdifrx: fix regmap status checkOlivier Moysan1-0/+2
Release resources when exiting on error. Fixes: 1a5c0b28fc56 ("ASoC: stm32: spdifrx: manage identification registers") Signed-off-by: Olivier Moysan <olivier.moysan@st.com> Link: https://lore.kernel.org/r/20200318144125.9163-2-olivier.moysan@st.com Signed-off-by: Mark Brown <broonie@kernel.org>
2020-02-11ASoC: stm32: spdifrx: improve error management on probe deferralOlivier Moysan1-4/+11
Do not print an error trace when deferring probe for SPDIFRX driver. Signed-off-by: Etienne Carriere <etienne.carriere@st.com> Signed-off-by: Olivier Moysan <olivier.moysan@st.com> Link: https://lore.kernel.org/r/20200203100814.22944-6-olivier.moysan@st.com Signed-off-by: Mark Brown <broonie@kernel.org>
2020-02-11ASoC: stm32: spdifrx: manage error when getting reset controllerOlivier Moysan1-5/+9
Return an error when the SPDIFRX driver fails to get a reset controller. Also add an error trace, except on probe defer status. Signed-off-by: Etienne Carriere <etienne.carriere@st.com> Signed-off-by: Olivier Moysan <olivier.moysan@st.com> Link: https://lore.kernel.org/r/20200203100814.22944-3-olivier.moysan@st.com Signed-off-by: Mark Brown <broonie@kernel.org>
2019-12-24ASoC: stm32: spdifrx: fix input pin state managementOlivier Moysan1-4/+0
Changing input state in iec capture control is not safe, as the pin state may be changed concurrently by ASoC framework. Remove pin state handling in iec capture control. Note: This introduces a restriction on capture control, when pin sleep state is defined in device tree. In this case channel status can be captured only when an audio stream capture is active. Fixes: f68c2a682d44 ("ASoC: stm32: spdifrx: add power management") Signed-off-by: Olivier Moysan <olivier.moysan@st.com> Link: https://lore.kernel.org/r/20191204154333.7152-4-olivier.moysan@st.com Signed-off-by: Mark Brown <broonie@kernel.org>
2019-12-24ASoC: stm32: spdifrx: fix race condition in irq handlerOlivier Moysan1-5/+19
When snd_pcm_stop() is called in interrupt routine, substream context may have already been released. Add protection on substream context. Fixes: 03e4d5d56fa5 ("ASoC: stm32: Add SPDIFRX support") Signed-off-by: Olivier Moysan <olivier.moysan@st.com> Link: https://lore.kernel.org/r/20191204154333.7152-3-olivier.moysan@st.com Signed-off-by: Mark Brown <broonie@kernel.org>
2019-12-24ASoC: stm32: spdifrx: fix inconsistent lock stateOlivier Moysan1-5/+7
In current spdifrx driver locks may be requested as follows: - request lock on iec capture control, when starting synchronization. - request lock in interrupt context, when spdifrx stop is called from IRQ handler. Take lock with IRQs disabled, to avoid the possible deadlock. Lockdep report: [ 74.278059] ================================ [ 74.282306] WARNING: inconsistent lock state [ 74.290120] -------------------------------- ... [ 74.314373] CPU0 [ 74.314377] ---- [ 74.314381] lock(&(&spdifrx->lock)->rlock); [ 74.314396] <Interrupt> [ 74.314400] lock(&(&spdifrx->lock)->rlock); Fixes: 03e4d5d56fa5 ("ASoC: stm32: Add SPDIFRX support") Signed-off-by: Olivier Moysan <olivier.moysan@st.com> Link: https://lore.kernel.org/r/20191204154333.7152-2-olivier.moysan@st.com Signed-off-by: Mark Brown <broonie@kernel.org>
2019-10-14ASoC: stm32: spdifrx: retry synchronization in sync stateOlivier Moysan1-2/+16
When STM32 SPDIFRX is in sync state, allow multiple synchro attempts, instead of exiting on first unsuccessful trial. This is useful when spdif signal is not immediately available on input. This also allows Pulseaudio to check iec capture device availability when no signal is present. Signed-off-by: Olivier Moysan <olivier.moysan@st.com> Link: https://lore.kernel.org/r/20191011084816.14279-1-olivier.moysan@st.com Signed-off-by: Mark Brown <broonie@kernel.org>
2019-08-02ASoC: Remove dev_err() usage after platform_get_irq()Stephen Boyd1-3/+1
We don't need dev_err() messages when platform_get_irq() fails now that platform_get_irq() prints an error message itself when something goes wrong. Let's remove these prints with a simple semantic patch. // <smpl> @@ expression ret; struct platform_device *E; @@ ret = ( platform_get_irq(E, ...) | platform_get_irq_byname(E, ...) ); if ( \( ret < 0 \| ret <= 0 \) ) { ( -if (ret != -EPROBE_DEFER) -{ ... -dev_err(...); -... } | ... -dev_err(...); ) ... } // </smpl> While we're here, remove braces on if statements that only have one statement (manually). Cc: Liam Girdwood <lgirdwood@gmail.com> Cc: Mark Brown <broonie@kernel.org> Cc: Jaroslav Kysela <perex@perex.cz> Cc: Takashi Iwai <tiwai@suse.com> Cc: alsa-devel@alsa-project.org Cc: Greg Kroah-Hartman <gregkh@linuxfoundation.org> Signed-off-by: Stephen Boyd <swboyd@chromium.org> Link: https://lore.kernel.org/r/20190730181557.90391-50-swboyd@chromium.org Signed-off-by: Mark Brown <broonie@kernel.org>
2019-06-26Merge tag 'v5.2-rc6' into asoc-5.3Mark Brown1-11/+1
Linux 5.2-rc6
2019-05-30treewide: Replace GPLv2 boilerplate/reference with SPDX - rule 174Thomas Gleixner1-11/+1
Based on 1 normalized pattern(s): this program is free software you can redistribute it and or modify it under the terms of the gnu general public license version 2 as published by the free software foundation this program is distributed in the hope that it will be useful but without any warranty without even the implied warranty of merchantability or fitness for a particular purpose see the gnu general public license for more details extracted by the scancode license scanner the SPDX license identifier GPL-2.0-only has been chosen to replace the boilerplate/reference in 655 file(s). Signed-off-by: Thomas Gleixner <tglx@linutronix.de> Reviewed-by: Allison Randal <allison@lohutok.net> Reviewed-by: Kate Stewart <kstewart@linuxfoundation.org> Reviewed-by: Richard Fontana <rfontana@redhat.com> Cc: linux-spdx@vger.kernel.org Link: https://lkml.kernel.org/r/20190527070034.575739538@linutronix.de Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2019-05-20Merge tag 'v5.2-rc1' into asoc-5.3Mark Brown1-2/+3
Linux 5.2-rc1
2019-05-06ASoC: stm32: spdifrx: manage identification registersOlivier Moysan1-2/+35
Add support of identification registers in STM32 SPDIFRX. Signed-off-by: Olivier Moysan <olivier.moysan@st.com> Signed-off-by: Mark Brown <broonie@kernel.org>
2019-05-06ASoC: stm32: spdifrx: change trace level on iec controlOlivier Moysan1-1/+1
Change trace level to debug to avoid spurious messages. Return quietly when accessing iec958 control, while no S/PDIF signal is available. Signed-off-by: Olivier Moysan <olivier.moysan@st.com> Signed-off-by: Mark Brown <broonie@kernel.org>
2019-05-06ASoC: stm32: spdifrx: update pcm hardware constraintsOlivier Moysan1-1/+2
- Set period minimum size. Ensure at least 5ms period up to 48kHz/16 bits to prevent underrun/overrun. - Remove MDMA constraints on period maximum size and set period maximum to half the buffer maximum size. Signed-off-by: Olivier Moysan <olivier.moysan@st.com> Signed-off-by: Mark Brown <broonie@kernel.org>
2019-03-18ASoC: stm32: spdifrx: add power managementOlivier Moysan1-3/+39
Add suspend and resume sleep callbacks to STM32 SPDIFRX driver, to support system low power modes. Signed-off-by: Olivier Moysan <olivier.moysan@st.com> Signed-off-by: Mark Brown <broonie@kernel.org>
2018-02-12ASoC: stm32: spdifrx: Use default dai nameolivier moysan1-1/+0
Use dai name provided by framework from dev_name() function. Signed-off-by: olivier moysan <olivier.moysan@st.com> Signed-off-by: Mark Brown <broonie@kernel.org>
2018-02-12ASoC: stm32: spdifrx: fix typo in function name.olivier moysan1-3/+3
Fix function name prefix for naming consistency. Signed-off-by: olivier moysan <olivier.moysan@st.com> Signed-off-by: Mark Brown <broonie@kernel.org>
2017-11-06ASoC: stm32: spdifrx: fix control DMA error managementolivier moysan1-8/+7
Fix DMA channel request error handling. Signed-off-by: Olivier Moysan <olivier.moysan@st.com> Signed-off-by: Mark Brown <broonie@kernel.org>
2017-11-06ASoC: stm32: spdifrx: fix 16 bits captureolivier moysan1-2/+6
Change DMA bus width to manage properly 16 bits packed format. Signed-off-by: Olivier Moysan <olivier.moysan@st.com> Signed-off-by: Mark Brown <broonie@kernel.org>
2017-07-19ASoC: stm32: explicitly request exclusive reset controlPhilipp Zabel1-1/+1
Commit a53e35db70d1 ("reset: Ensure drivers are explicit when requesting reset lines") started to transition the reset control request API calls to explicitly state whether the driver needs exclusive or shared reset control behavior. Convert all drivers requesting exclusive resets to the explicit API call so the temporary transition helpers can be removed. No functional changes. Cc: Liam Girdwood <lgirdwood@gmail.com> Cc: Mark Brown <broonie@kernel.org> Cc: Maxime Coquelin <mcoquelin.stm32@gmail.com> Cc: Alexandre Torgue <alexandre.torgue@st.com> Cc: alsa-devel@alsa-project.org Signed-off-by: Philipp Zabel <p.zabel@pengutronix.de> Signed-off-by: Mark Brown <broonie@kernel.org>
2017-06-21ASoC: stm32: Add SPDIFRX supportolivier moysan1-0/+998
Add SPDIFRX support to STM32. Signed-off-by: olivier moysan <olivier.moysan@st.com> Signed-off-by: Mark Brown <broonie@kernel.org>