Commit Graph

29 Commits

Author SHA1 Message Date
Arnaud Pouliquen 17d3069ccf
ASoC: stm32: fix sai driver name initialisation
This patch fixes the sai driver structure overwriting which results in
a cpu dai name equal NULL.

Fixes: 3e086ed ("ASoC: stm32: add SAI driver")

Signed-off-by: Arnaud Pouliquen <arnaud.pouliquen@st.com>
Signed-off-by: Mark Brown <broonie@kernel.org>
2019-04-08 13:37:55 +07:00
Olivier Moysan d4180b4c02
ASoC: stm32: sai: fix set_sync service
Add error check on set_sync function return.
Add of_node_put() as of_get_parent() takes a reference
which has to be released.

Signed-off-by: Olivier Moysan <olivier.moysan@st.com>
Signed-off-by: Mark Brown <broonie@kernel.org>
2019-03-03 23:40:13 +00:00
Olivier Moysan 71d9537fad
ASoC: stm32: sai: fix oversampling mode
Set OSR bit if mclk/fs ratio is 512.

Signed-off-by: Olivier Moysan <olivier.moysan@st.com>
Signed-off-by: Mark Brown <broonie@kernel.org>
2019-03-03 23:39:54 +00:00
Olivier Moysan 26f98e82dd
ASoC: stm32: sai: fix race condition in irq handler
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-03-03 23:39:35 +00:00
Olivier Moysan b846819297
ASoC: stm32: sai: fix exposed capabilities in spdif mode
Change capabilities exposed in SAI S/PDIF mode, to match
actually supported formats.
In S/PDIF mode only 32 bits stereo is supported.

Signed-off-by: Olivier Moysan <olivier.moysan@st.com>
Signed-off-by: Mark Brown <broonie@kernel.org>
2019-03-03 23:39:16 +00:00
Olivier Moysan 5f8a1000c3
ASoC: stm32: sai: fix iec958 controls indexation
Allow indexation of sai iec958 controls according
to device id.

Signed-off-by: Olivier Moysan <olivier.moysan@st.com>
Signed-off-by: Mark Brown <broonie@kernel.org>
2019-03-03 23:38:57 +00:00
YueHaibing 70605450fd
ASoC: stm32: sai: remove set but not used variables 'mask, cr1'
Fixes gcc '-Wunused-but-set-variable' warning:

sound/soc/stm/stm32_sai_sub.c: In function 'stm32_sai_configure_clock':
sound/soc/stm/stm32_sai_sub.c:902:11: warning:
 variable 'mask' set but not used [-Wunused-but-set-variable]
sound/soc/stm/stm32_sai_sub.c:902:6: warning:
 variable 'cr1' set but not used [-Wunused-but-set-variable]

It's not used any more after 8307b2afd3 ("ASoC: stm32: sai: set sai as
mclk clock provider")

Signed-off-by: YueHaibing <yuehaibing@huawei.com>
Signed-off-by: Mark Brown <broonie@kernel.org>
2019-02-18 18:23:59 +00:00
Wei Yongjun 496fa3ba0a
ASoC: stm32: sai: fix invalid use of sizeof in stm32_sai_add_mclk_provider()
sizeof() when applied to a pointer typed expression gives the
size of the pointer, not that of the pointed data.

Fixes: 8307b2afd3 ("ASoC: stm32: sai: set sai as mclk clock provider")
Signed-off-by: Wei Yongjun <weiyongjun1@huawei.com>
Signed-off-by: Mark Brown <broonie@kernel.org>
2018-11-13 16:27:48 -08:00
Colin Ian King 6b27e27729
ASoC: stm32: sai: fix less than zero comparison on unsigned int
Currently, the comparison of div < 0 is always false because div is
an unsigned int. Fix this by making div an int.

Detected by CoverityScan, CID#1475309 ("Unsigned compared against 0")

Fixes: 8307b2afd3 "(ASoC: stm32: sai: set sai as mclk clock provider")
Signed-off-by: Colin Ian King <colin.king@canonical.com>
Signed-off-by: Mark Brown <broonie@kernel.org>
2018-11-05 10:33:06 +00:00
Olivier Moysan 6be0f96d79
ASoC: stm32: sai: fix master clock naming
Fixes: 8307b2afd3 ("ASoC: stm32: sai: set sai as mclk clock provider")

Fix warning issued by strncat when bound equals to source length.

Signed-off-by: Olivier Moysan <olivier.moysan@st.com>
Signed-off-by: Mark Brown <broonie@kernel.org>
2018-10-23 10:51:45 +01:00
Olivier Moysan 8307b2afd3
ASoC: stm32: sai: set sai as mclk clock provider
Add master clock generation support in STM32 SAI.
The master clock provided by SAI can be used to feed a codec.

Signed-off-by: Olivier Moysan <olivier.moysan@st.com>
Signed-off-by: Mark Brown <broonie@kernel.org>
2018-10-19 13:12:07 +01:00
Rob Herring 5d585e1e75
ASoC: Convert to using %pOFn instead of device_node.name
In preparation to remove the node name pointer from struct device_node,
convert printf users to use the %pOFn format specifier.

Signed-off-by: Rob Herring <robh@kernel.org>
Signed-off-by: Mark Brown <broonie@kernel.org>
2018-08-28 19:07:00 +01:00
Takashi Iwai b1625fbb3b
ASoC: stm32: Use snd_pcm_stop_xrun() helper
The XRUN trigger from the driver should be done via
snd_pcm_stop_xrun().  It simplifies the locking as well.

Signed-off-by: Takashi Iwai <tiwai@suse.de>
Signed-off-by: Mark Brown <broonie@kernel.org>
2018-07-04 15:41:36 +01:00
olivier moysan 187e01d0d5
ASoC: stm32: sai: add iec958 controls support
Add support of iec958 controls for STM32 SAI.

Signed-off-by: Olivier Moysan <olivier.moysan@st.com>
Signed-off-by: Mark Brown <broonie@kernel.org>
2018-06-18 12:54:38 +01:00
Olivier Moysan 6eb17d7093
ASoC: stm32: sai: Add support of S/PDIF playback
Add support of S/PDIF iec60958 playback on STM32 SAI.

Signed-off-by: olivier moysan <olivier.moysan@st.com>
Signed-off-by: Mark Brown <broonie@kernel.org>
2018-02-26 11:19:04 +00:00
olivier moysan 7e751e375a
ASoC: stm32: sai: fix warning in stm32_sai_set_config()
Fix uninitialized warning introduced by
"Move static settings to DAI init" commit
in stm32_sai_set_config() function.

Signed-off-by: Olivier Moysan <olivier.moysan@st.com>
Signed-off-by: Mark Brown <broonie@kernel.org>
2017-11-02 10:58:57 +00:00
Olivier Moysan 5914d285f6 ASoC: stm32: sai: Add synchronization support
Add Synchronization support for STM32 SAI.

Signed-off-by: olivier moysan <olivier.moysan@st.com>
Signed-off-by: Mark Brown <broonie@kernel.org>
2017-10-21 11:17:49 +01:00
Olivier Moysan 47a8907d7c ASoC: stm32: sai: Remove spurious IRQs on stop
Clear IRQ mask on stream stop to avoid spurious IRQs.

Signed-off-by: Olivier Moysan <olivier.moysan@st.com>
Signed-off-by: Mark Brown <broonie@kernel.org>
2017-10-21 11:17:49 +01:00
Olivier Moysan 61fb4ff703 ASoC: stm32: sai: Move static settings to DAI init
Audio interface direction and protocol settings does not change
at runtime. So, these settings are moved from hw_params
function to dai_probe and set_fmt.

Signed-off-by: olivier moysan <olivier.moysan@st.com>
Signed-off-by: Mark Brown <broonie@kernel.org>
2017-10-21 11:17:49 +01:00
Olivier Moysan a4529d2b88 ASoC: stm32: sai: Fix DMA burst size
Set best burst size tradeoff for 8, 16, 32 bits transfers.

Signed-off-by: olivier moysan <olivier.moysan@st.com>
Signed-off-by: Mark Brown <broonie@kernel.org>
2017-10-21 11:16:32 +01:00
Olivier Moysan d807cdfb48 ASoC: stm32: sai: fix stop management in isr
Add check on substream validity.

Signed-off-by: Olivier Moysan <olivier.moysan@st.com>
Signed-off-by: Mark Brown <broonie@kernel.org>
2017-10-21 11:15:34 +01:00
Dan Carpenter 81321fe9fb ASoC: stm32: sai: remove some stray tabs
This line was accidentally indented too far.

Signed-off-by: Dan Carpenter <dan.carpenter@oracle.com>
Signed-off-by: Mark Brown <broonie@kernel.org>
2017-06-28 18:45:04 +01:00
olivier moysan 03e78a242a ASoC: stm32: sai: add h7 support
Add support of SAI on STM32H7 family.

Signed-off-by: olivier moysan <olivier.moysan@st.com>
Signed-off-by: Mark Brown <broonie@kernel.org>
2017-06-16 18:59:03 +01:00
olivier moysan 701a6ec3a3 ASoC: stm32: sai: manage master clock
Disable master clock by default, and activate
it only when requested.

Signed-off-by: olivier moysan <olivier.moysan@st.com>
Signed-off-by: Mark Brown <broonie@kernel.org>
2017-06-16 18:58:58 +01:00
olivier moysan 1c77603136 ASoC: stm32: sai: fix clock management
Allow peripheral clock enable/disable on regmap accesses.

Signed-off-by: olivier moysan <olivier.moysan@st.com>
Signed-off-by: Mark Brown <broonie@kernel.org>
2017-06-16 18:58:57 +01:00
olivier moysan 4fa17938ea ASoC: stm32: sai: change stop sequence
Disable SAI before stopping DMA data transfers.

Signed-off-by: olivier moysan <olivier.moysan@st.com>
Signed-off-by: Mark Brown <broonie@kernel.org>
2017-06-16 18:58:57 +01:00
olivier moysan 607c61d40b ASoC: stm32: sai: remove spurious trace
Remove spurious trace in sai driver.

Signed-off-by: olivier moysan <olivier.moysan@st.com>
Signed-off-by: Mark Brown <broonie@kernel.org>
2017-06-16 18:58:56 +01:00
olivier moysan 602fdadc54 ASoC: stm32: sai: typo fixes
Fix typos in sai driver.

Signed-off-by: olivier moysan <olivier.moysan@st.com>
Signed-off-by: Mark Brown <broonie@kernel.org>
2017-06-16 18:58:56 +01:00
olivier moysan 3e086edfe0 ASoC: stm32: add SAI driver
This patch implements SAI ASoC driver for STM32.

Signed-off-by: olivier moysan <olivier.moysan@st.com>
Signed-off-by: Mark Brown <broonie@kernel.org>
2017-04-26 16:45:54 +01:00