summaryrefslogtreecommitdiff
path: root/sound/soc/stm/stm32_i2s.c
AgeCommit message (Collapse)AuthorFilesLines
2021-06-17ASoC: stm32: i2s: Use devm_platform_get_and_ioremap_resource()Yang Yingliang1-2/+1
Use devm_platform_get_and_ioremap_resource() to simplify code. Signed-off-by: Yang Yingliang <yangyingliang@huawei.com> Link: https://lore.kernel.org/r/20210617043847.1113092-2-yangyingliang@huawei.com Signed-off-by: Mark Brown <broonie@kernel.org>
2021-02-05ASoC: stm32: i2s: add master clock providerOlivier Moysan1-44/+266
Add master clock generation support in STM32 I2S driver. The master clock provided by I2S can be used to feed a codec. Signed-off-by: Olivier Moysan <olivier.moysan@foss.st.com> Link: https://lore.kernel.org/r/20210205104404.18786-3-olivier.moysan@foss.st.com Signed-off-by: Mark Brown <broonie@kernel.org>
2020-03-18ASoC: stm32: i2s: manage rebind issueOlivier Moysan1-11/+29
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 I2S driver. Signed-off-by: Olivier Moysan <olivier.moysan@st.com> Link: https://lore.kernel.org/r/20200318144125.9163-4-olivier.moysan@st.com Signed-off-by: Mark Brown <broonie@kernel.org>
2020-02-11ASoC: stm32: i2s: improve error management on probe deferralOlivier Moysan1-6/+19
Do not print an error trace when deferring probe for I2S 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-7-olivier.moysan@st.com Signed-off-by: Mark Brown <broonie@kernel.org>
2020-02-11ASoC: stm32: i2s: manage error when getting reset controllerOlivier Moysan1-5/+9
Return an error when the i2s 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-4-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-4/+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-1/+2
Linux 5.2-rc1
2019-05-08ASoC: stm32: i2s: manage identification registersOlivier Moysan1-3/+57
Add support of identification registers in STM32 I2S. Signed-off-by: Olivier Moysan <olivier.moysan@st.com> Signed-off-by: Mark Brown <broonie@kernel.org>
2019-05-08ASoC: stm32: i2s: 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-04-26Merge branch 'asoc-5.1' into asoc-5.2Mark Brown1-2/+3
2019-04-25ASoC: stm32: i2s: return the get_irq errorFabien Dessenne1-2/+3
During probe, return the "get_irq" error value instead of -ENOENT. This allows the driver to be deferred probed if needed. Signed-off-by: Fabien Dessenne <fabien.dessenne@st.com> Signed-off-by: Mark Brown <broonie@kernel.org>
2019-03-18Merge branch 'for-5.1' of ↵Mark Brown1-2/+1
https://git.kernel.org/pub/scm/linux/kernel/git/broonie/sound into asoc-5.2
2019-03-11ASoC: stm32: i2s: fix registers declaration in regmapOlivier Moysan1-2/+1
- Declare SR as volatile, as it is changed by hardware. - Remove TXDR from readable and volatile register list, as it is intended for write accesses only. Signed-off-by: Olivier Moysan <olivier.moysan@st.com> Signed-off-by: Mark Brown <broonie@kernel.org>
2019-03-11ASoC: stm32: i2s: use default dai nameOlivier Moysan1-7/+0
Use default DAI name based on dev_name function. Signed-off-by: Olivier Moysan <olivier.moysan@st.com> Signed-off-by: Mark Brown <broonie@kernel.org>
2019-03-11ASoC: stm32: i2s: improve channel capabilities handlingOlivier Moysan1-6/+4
Use alsa snd_pcm_hw_constraint_single service to manage channels restriction. This provides better status on driver limitations, to the application. Signed-off-by: Olivier Moysan <olivier.moysan@st.com> Signed-off-by: Mark Brown <broonie@kernel.org>
2019-03-11ASoC: stm32: i2s: change trigger tracesOlivier Moysan1-3/+5
Update traces to log capture/playback stream start/stop. Signed-off-by: Olivier Moysan <olivier.moysan@st.com> Signed-off-by: Mark Brown <broonie@kernel.org>
2019-02-26ASoC: stm32: i2s: skip useless write in slave modeOlivier Moysan1-2/+2
Dummy write in capture master mode is used to gate bus clocks. This write is useless in slave mode as the clocks are not managed by slave. Signed-off-by: Olivier Moysan <olivier.moysan@st.com> Signed-off-by: Mark Brown <broonie@kernel.org>
2019-02-26ASoC: stm32: i2s: fix race condition in irq handlerOlivier Moysan1-3/+14
When snd_pcm_stop_xrun() is called in interrupt routine, substream context may have already been released. Add protection on substream context. Signed-off-by: Olivier Moysan <olivier.moysan@st.com> Signed-off-by: Mark Brown <broonie@kernel.org>
2019-02-26ASoC: stm32: i2s: remove useless callbackOlivier Moysan1-11/+0
Clocks do not need to be released on driver removal, as this is already managed before. Remove useless remove callback. Signed-off-by: Olivier Moysan <olivier.moysan@st.com> Signed-off-by: Mark Brown <broonie@kernel.org>
2019-02-26ASoC: stm32: i2s: fix dma configurationOlivier Moysan1-7/+7
DMA configuration is not balanced on start/stop. Move DMA configuration to trigger callback. Signed-off-by: Olivier Moysan <olivier.moysan@st.com> Signed-off-by: Mark Brown <broonie@kernel.org>
2019-02-26ASoC: stm32: i2s: fix stream count managementOlivier Moysan1-7/+5
Move counter handling to trigger start section to manage multiple start/stop events. Signed-off-by: Olivier Moysan <olivier.moysan@st.com> Signed-off-by: Mark Brown <broonie@kernel.org>
2019-02-26ASoC: stm32: i2s: fix 16 bit format supportOlivier Moysan1-1/+1
I2S supports 16 bits data in 32 channel length. However the expected driver behavior, is to set channel length to 16 bits when data format is 16 bits. Signed-off-by: Olivier Moysan <olivier.moysan@st.com> Signed-off-by: Mark Brown <broonie@kernel.org>
2019-02-26ASoC: stm32: i2s: fix IRQ clearingOlivier Moysan1-7/+6
Because of regmap cache, interrupts may not be cleared as expected. Declare IFCR register as write only and make writings to IFCR register unconditional. Signed-off-by: Olivier Moysan <olivier.moysan@st.com> Signed-off-by: Mark Brown <broonie@kernel.org>
2019-02-08SoC: stm32: i2s: manage clock powerOlivier Moysan1-29/+15
Kernel clock management: Enable/disable I2S kernel clock on audio stream startup/shutdown. Peripheral clock management: Manage I2S peripheral clock power through regmap services. Signed-off-by: Olivier Moysan <olivier.moysan@st.com> Signed-off-by: Mark Brown <broonie@kernel.org>
2019-02-08ASoC: stm32: i2s: add power managementOlivier Moysan1-3/+30
Add suspend and resume sleep callbacks, to support system low power modes. 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-05-19ASoC: stm32: Add full duplex support to i2solivier moysan1-41/+46
This patch allows to use i2s interface either as single audio path (rx or tx), or bidirectional audio path. This patch is added separately, as the driver does not follow recommended use of the interface, to support this configuration. Signed-off-by: olivier moysan <olivier.moysan@st.com> Signed-off-by: Mark Brown <broonie@kernel.org>
2017-05-19ASoC: stm32: Add I2S driverolivier moysan1-0/+941
Add I2S ASoC driver for STM32. This version of the driver supports only exclusive playback and capture interface. Signed-off-by: olivier moysan <olivier.moysan@st.com> Signed-off-by: Mark Brown <broonie@kernel.org>