aboutsummaryrefslogtreecommitdiff
path: root/sound/soc/sti
AgeCommit message (Collapse)AuthorFilesLines
2018-07-04ASoC: sti: Use snd_pcm_stop_xrun() helperGravatar Takashi Iwai 2-4/+4
The XRUN trigger from the driver should be done via snd_pcm_stop_xrun(). It fixes the missing stream locking as a gratis, too. Signed-off-by: Takashi Iwai <tiwai@suse.de> Signed-off-by: Mark Brown <broonie@kernel.org>
2017-04-30ASoC: sti: Fix error handling if of_clk_get() failsGravatar Dan Carpenter 1-1/+1
We intended to return here. The current code has a static checker warning because we set "ret" but don't use it. Fixes: 76c2145ded6b ("ASoC: sti: Add CPU DAI driver for playback") Signed-off-by: Dan Carpenter <dan.carpenter@oracle.com> Acked-by: Arnaud POULIQUEN <arnaud.pouliquen@st.com> Signed-off-by: Mark Brown <broonie@kernel.org>
2017-04-06ASoC: STI: Fix null ptr deference in IRQ handlerGravatar Arnaud Pouliquen 3-15/+45
With RTlinux a race condition has been found that leads to NULL ptr crash: - On CPU 0: uni_player_irq_handler is called to treat XRUN "(player->state == UNIPERIF_STATE_STOPPED)" is FALSE so status is checked, dev_err(player->dev, "FIFO underflow error detected") is printed and then snd_pcm_stream_lock should be called to lock stream for stopping. - On CPU 1: application stop and close the stream. Issue is that the stop and shutdown functions are executed while "FIFO underflow error detected" is printed. So when CPU 0 calls snd_pcm_stream_lock, player->substream is already null. Signed-off-by: Arnaud Pouliquen <arnaud.pouliquen@st.com> Signed-off-by: Mark Brown <broonie@kernel.org>
2017-03-24ASoC: STI: Fix reader substream pointer setGravatar Arnaud Pouliquen 1-0/+3
reader->substream is used in IRQ handler for error case but is never set. Set value to pcm substream on DAI startup and clean it on dai shutdown. Signed-off-by: Arnaud Pouliquen <arnaud.pouliquen@st.com> Signed-off-by: Mark Brown <broonie@kernel.org>
2016-12-12Merge remote-tracking branches 'asoc/topic/stac9766', 'asoc/topic/sti', ↵Gravatar Mark Brown 4-92/+85
'asoc/topic/sti-codec', 'asoc/topic/sunxi' and 'asoc/topic/tegra' into asoc-next
2016-10-26ASoC: sti: fix channel status update after playback startGravatar Arnaud Pouliquen 1-1/+5
If 'IEC958 Playback Default' control is updated during playback, Channel status needs to be set according to the runtime structure. Signed-off-by: Arnaud Pouliquen <arnaud.pouliquen@st.com> Signed-off-by: Mark Brown <broonie@kernel.org>
2016-10-26ASoC: sti: clean unused includeGravatar Arnaud Pouliquen 2-4/+0
Signed-off-by: Arnaud Pouliquen <arnaud.pouliquen@st.com> Signed-off-by: Mark Brown <broonie@kernel.org>
2016-10-26ASoC: sti: reset refactoringGravatar Arnaud Pouliquen 4-45/+29
Reset is common to player and reader, migrate function in sti_uniperif.c Signed-off-by: Arnaud Pouliquen <arnaud.pouliquen@st.com> Signed-off-by: Mark Brown <broonie@kernel.org>
2016-10-26ASoC: sti: fix errors managementGravatar Arnaud Pouliquen 3-45/+58
Add missing error messages. Propagate error of uni_reader_init and uni_reader_init. Add return at end of dev_err strings. Signed-off-by: Arnaud Pouliquen <arnaud.pouliquen@st.com> Signed-off-by: Mark Brown <broonie@kernel.org>
2016-09-19ASoC: sti: fix missing clk_disable_unprepare() on error in uni_player_start()Gravatar Wei Yongjun 1-1/+3
Fix the missing clk_disable_unprepare() before return from uni_player_start() in the error handling case. Signed-off-by: Wei Yongjun <weiyongjun1@huawei.com> Acked-by: Arnaud Pouliquen <arnaud.pouliquen@st.com> Signed-off-by: Mark Brown <broonie@kernel.org>
2016-09-14ASoC: sti: suppress inappropriate DT fieldsGravatar Arnaud Pouliquen 4-143/+140
Update to suppress some DT nodes that can be handled in driver using compatible string. "dai-name", "st,version"and "st,mode" are suppressed "st,tdm-mode" is added to handle TDM mode. Signed-off-by: Arnaud Pouliquen <arnaud.pouliquen@st.com> Signed-off-by: Mark Brown <broonie@kernel.org>
2016-06-13ASoC: sti: fix return value check in uni_player_parse_dt_audio_glue()Gravatar Wei Yongjun 1-2/+2
In case of error, the function syscon_regmap_lookup_by_phandle() returns ERR_PTR() and never returns NULL. The NULL test in the return value check should be replaced with IS_ERR(). Signed-off-by: Wei Yongjun <yongjun_wei@trendmicro.com.cn> Signed-off-by: Mark Brown <broonie@kernel.org>
2016-04-18ASoC: sti: select player for I2S/TDM TX busGravatar Moise Gergaud 2-14/+29
By default, player#0 is connected to I2S/TDM TX bus. This patch connects player#1 to I2S/TDM TX bus. Signed-off-by: Moise Gergaud <moise.gergaud@st.com> Acked-by: Arnaud Pouliquen <arnaud.pouliquen@st.com> Signed-off-by: Mark Brown <broonie@kernel.org>
2016-04-12ASoC: sti: unip reader tdm modeGravatar Moise Gergaud 1-61/+168
Here are the changes to enable reader tdm mode: - When TDM_ENABLE is set to 1, the i2s format should be automatically configured. Unfortunately this is not the case (HW bug). Then, we shall force DATA_SIZE setting. - Compute the transfer size for tdm mode: transfer size = user frame size - Manage tdm slots configuration given in DT. - Refine the hw param (channels & format) according to tdm slot config. Signed-off-by: Moise Gergaud <moise.gergaud@st.com> Acked-by: Arnaud Pouliquen <arnaud.pouliquen@st.com> Signed-off-by: Mark Brown <broonie@kernel.org>
2016-04-12ASoC: sti: unip player tdm modeGravatar Moise Gergaud 3-18/+110
here are the changes to enable player tdm mode: - When TDM_ENABLE is set to 1, the i2s format should be automatically configured. Unfortunately this is not the case (HW bug). Then, we shall force DATA_SIZE setting. - Compute the transfer size for tdm mode: transfer size = user frame size - Manage tdm slots configuration given in DT. - Don't use mclk-fs when unip in tdm mode; use tdm slot config to compute frame size and to set mclk rate. - Refine the hw param (channels & format) according to tdm slot config. Signed-off-by: Moise Gergaud <moise.gergaud@st.com> Acked-by: Arnaud Pouliquen <arnaud.pouliquen@st.com> Signed-off-by: Mark Brown <broonie@kernel.org>
2016-04-12ASoC: sti: helper functions to fix tdm runtime paramsGravatar Moise Gergaud 2-0/+52
Signed-off-by: Moise Gergaud <moise.gergaud@st.com> Acked-by: Arnaud Pouliquen <arnaud.pouliquen@st.com> Signed-off-by: Mark Brown <broonie@kernel.org>
2016-04-12ASoC: sti: helper functions for unip tdm slots configurationGravatar Moise Gergaud 2-0/+113
- sti_uniperiph_set_tdm_slot: store tdm slot config in unip context - sti_uniperiph_get_tdm_word_pos: configure unip tdm slots pos regs Signed-off-by: Moise Gergaud <moise.gergaud@st.com> Acked-by: Arnaud Pouliquen <arnaud.pouliquen@st.com> Signed-off-by: Mark Brown <broonie@kernel.org>
2016-04-12ASoC: sti: define tdm type & default tdm hw configGravatar Moise Gergaud 1-1/+27
Signed-off-by: Moise Gergaud <moise.gergaud@st.com> Acked-by: Arnaud Pouliquen <arnaud.pouliquen@st.com> Signed-off-by: Mark Brown <broonie@kernel.org>
2016-04-12ASoC: sti: rename unip player type into common player & reader typeGravatar Moise Gergaud 2-25/+25
Signed-off-by: Moise Gergaud <moise.gergaud@st.com> Acked-by: Arnaud Pouliquen <arnaud.pouliquen@st.com> Signed-off-by: Mark Brown <broonie@kernel.org>
2016-04-12ASoC: sti: macro for uniperif tdm regs accessGravatar Moise Gergaud 1-0/+112
Signed-off-by: Moise Gergaud <moise.gergaud@st.com> Acked-by: Arnaud Pouliquen <arnaud.pouliquen@st.com> Signed-off-by: Mark Brown <broonie@kernel.org>
2016-03-31ASoC: sti: correct typo errorsGravatar Moise Gergaud 1-11/+11
Signed-off-by: Moise Gergaud <moise.gergaud@st.com> Acked-by: Arnaud Pouliquen <arnaud.pouliquen@st.com> Signed-off-by: Mark Brown <broonie@kernel.org>
2015-12-23Merge remote-tracking branches 'asoc/topic/samsung', 'asoc/topic/sh', ↵Gravatar Mark Brown 1-2/+1
'asoc/topic/ssm2518' and 'asoc/topic/sti' into asoc-next
2015-11-25ASoC: sti: set iec958 channel status sampling freqGravatar Moise Gergaud 1-2/+1
Previously, the iec958 channels status sampling freq was set only if not already set. It means that it is not updated for next PCM sessions. With this patch, we ensure the iec958 channels status sampling freq is set to the runtime rate for each PCM session. Signed-off-by: Moise Gergaud <moise.gergaud@st.com> Acked-by: Arnaud Pouliquen <arnaud.pouliquen@st.com> Signed-off-by: Mark Brown <broonie@kernel.org>
2015-11-19ASoC: sti: set player private dataGravatar Moise Gergaud 1-0/+3
Set substream player private data. substream player private data is used in uni_player_irq_handler to lock, stop & unlock the stream when interrupt indicates underflow/overflow. If not set, then segmentation fault occurs. Signed-off-by: Moise Gergaud <moise.gergaud@st.com> Acked-by: Arnaud Pouliquen <arnaud.pouliquen@st.com> Signed-off-by: Mark Brown <broonie@kernel.org>
2015-11-19ASoC: sti: rename ST proprietary DT propertiesGravatar Moise Gergaud 2-4/+4
"st," prefix has been added for ST proprietary DT properties. Signed-off-by: Moise Gergaud <moise.gergaud@st.com> Acked-by: Arnaud Pouliquen <arnaud.pouliquen@st.com> Signed-off-by: Mark Brown <broonie@kernel.org>
2015-11-19ASoC: sti: remove wrong error messageGravatar Moise Gergaud 1-1/+0
Signed-off-by: Moise Gergaud <moise.gergaud@st.com> Acked-by: Arnaud Pouliquen <arnaud.pouliquen@st.com> Signed-off-by: Mark Brown <broonie@kernel.org>
2015-09-10ASoC: sti: check return of of_property_readGravatar Arnaud Pouliquen 2-5/+15
Add check on of_property_read to return error when DT required property is not defined. Signed-off-by: Arnaud Pouliquen <arnaud.pouliquen@st.com> Signed-off-by: Mark Brown <broonie@kernel.org>
2015-08-30ASoC: sti_uniperif: Ensure component is unregistered when unload moduleGravatar Axel Lin 1-3/+3
Use devm_snd_soc_register_component to ensure component is unregistered when unload the module. Signed-off-by: Axel Lin <axel.lin@ingics.com> Signed-off-by: Mark Brown <broonie@kernel.org>
2015-08-07ASoC: sti: Add IEC controlGravatar Arnaud Pouliquen 1-4/+73
Add control to configure IEC60958 settings. Signed-off-by: Arnaud Pouliquen <arnaud.pouliquen@st.com> Signed-off-by: Mark Brown <broonie@kernel.org>
2015-07-29ASoC: uniperf: Staticise local symbolsGravatar Lars-Peter Clausen 1-1/+1
uni_player_dai_ops is not used outside of this file so it should be static. Fixes the following sparse warning: sound/soc/sti/uniperif_player.c:959:30: warning: symbol 'uni_player_dai_ops' was not declared. Should it be static? Signed-off-by: Lars-Peter Clausen <lars@metafoo.de> Acked-by: Arnaud Pouliquen <arnaud.pouliquen@st.com> Signed-off-by: Mark Brown <broonie@kernel.org>
2015-07-29ASoC: uniperf: Add missing __iomem annotationGravatar Lars-Peter Clausen 1-1/+1
base referes to a iomem region, so it should have the __iomem annotation. Fixes the following warnings from sparse: sound/soc/sti/sti_uniperif.c:169:19: warning: incorrect type in assignment (different address spaces) sound/soc/sti/sti_uniperif.c:169:19: expected void *base sound/soc/sti/sti_uniperif.c:169:19: got void [noderef] <asn:2>* sound/soc/sti/uniperif_player.c:104:18: warning: incorrect type in argument 1 (different address spaces) sound/soc/sti/uniperif_player.c:104:18: expected void const volatile [noderef] <asn:2>*addr sound/soc/sti/uniperif_player.c:104:18: got void * [...] Signed-off-by: Lars-Peter Clausen <lars@metafoo.de> Acked-by: Arnaud Pouliquen <arnaud.pouliquen@st.com> Signed-off-by: Mark Brown <broonie@kernel.org>
2015-07-21ASoC: sti: error handling bug in sti_uniperiph_cpu_dai_of()Gravatar Dan Carpenter 1-1/+1
There is a stray '!' which means the condition is never true. Fixes: f3bd847eb0a7 ('ASoC: sti: Add uniperipheral dai driver') Signed-off-by: Dan Carpenter <dan.carpenter@oracle.com> Signed-off-by: Mark Brown <broonie@kernel.org>
2015-07-20ASoC: sti-uniperf: Fix implicit inclusion of pinctrlGravatar Mark Brown 1-0/+1
Reported-by: Stephen Rothwell <sfr@canb.auug.org.au> Signed-off-by: Mark Brown <broonie@kernel.org>
2015-07-17ASoC: sti: sti_uniperiph_dai_create_ctrl() can be staticGravatar kbuild test robot 3-5/+5
Signed-off-by: Fengguang Wu <fengguang.wu@intel.com> Signed-off-by: Mark Brown <broonie@kernel.org>
2015-07-16ASoC: sti: Add clock adjustement controlGravatar Arnaud Pouliquen 2-1/+150
Add capability to adjust player clock, for clocks drift management. Signed-off-by: Arnaud Pouliquen <arnaud.pouliquen@st.com> Signed-off-by: Mark Brown <broonie@kernel.org>
2015-07-16ASoC: Add ability to build sti driversGravatar Arnaud Pouliquen 2-0/+15
Define the platform and codec drivers, and how to build them. Signed-off-by: Arnaud Pouliquen <arnaud.pouliquen@st.com> Signed-off-by: Mark Brown <broonie@kernel.org>
2015-07-16ASoC: sti: Add uniperipheral dai driverGravatar Arnaud Pouliquen 2-0/+262
ASoc uniperipheral dai driver that manages uniperipheral DAIs and registers associated generic dma engine platform. Signed-off-by: Arnaud Pouliquen <arnaud.pouliquen@st.com> Signed-off-by: Mark Brown <broonie@kernel.org>
2015-07-16ASoC: sti: Add CPU DAI driver for captureGravatar Arnaud Pouliquen 2-0/+365
Add code to manage Uniperipheral reader IP instances. These DAIs are dedicated to capture and support I2S and IEC modes. Signed-off-by: Arnaud Pouliquen <arnaud.pouliquen@st.com> Signed-off-by: Mark Brown <broonie@kernel.org>
2015-07-16ASoC: sti: minor corrections for uniplayerGravatar Arnaud Pouliquen 1-3/+7
Minor corrections after code review. Signed-off-by: Arnaud Pouliquen <arnaud.pouliquen@st.com> Signed-off-by: Mark Brown <broonie@kernel.org>
2015-07-10ASoC: sti: Add CPU DAI driver for playbackGravatar Arnaud Pouliquen 2-0/+1006
Add code to manage Uniperipheral player IP instances. These DAIs are dedicated to playback and support I2S and IEC modes. Signed-off-by: Arnaud Pouliquen <arnaud.pouliquen@st.com> Signed-off-by: Mark Brown <broonie@kernel.org>
2015-07-10ASoC: sti: Add uniperipheral header fileGravatar Arnaud Pouliquen 1-0/+1099
Add the Uniperipheral header file for uniperipheral IPs registers definition. Signed-off-by: Arnaud Pouliquen <arnaud.pouliquen@st.com> Signed-off-by: Mark Brown <broonie@kernel.org>