aboutsummaryrefslogtreecommitdiff
path: root/sound/soc/sti
AgeCommit message (Collapse)AuthorFilesLines
2024-07-29ASoC: sti: add missing probe entry for player and readerJerome Audu4-1/+4
This patch addresses a regression in the ASoC STI drivers that was introduced in Linux version 6.6.y. The issue originated from a series of patches (see https://lore.kernel.org/all/[email protected]/) that unintentionally omitted necessary probe functions for the player and reader components. Probe function in `sound/soc/sti/sti_uniperif.c:415` is being replaced by another probe function located at `sound/soc/sti/sti_uniperif.c:453`, which should instead be derived from the player and reader components. This patch correctly reinserts the missing probe entries, restoring the intended functionality. Fixes: 9f625f5e6cf9 ("ASoC: sti: merge DAI call back functions into ops") Signed-off-by: Jerome Audu <[email protected]> Link: https://patch.msgid.link/[email protected] Signed-off-by: Mark Brown <[email protected]>
2024-05-08ASoC: sti: Use *-y instead of *-objs in MakefileTakashi Iwai1-1/+1
*-objs suffix is reserved rather for (user-space) host programs while usually *-y suffix is used for kernel drivers (although *-objs works for that purpose for now). Let's correct the old usages of *-objs in Makefiles. Signed-off-by: Takashi Iwai <[email protected]> Link: https://lore.kernel.org/r/[email protected] Signed-off-by: Mark Brown <[email protected]>
2023-11-13ASoC: sti-uniperf: Use default pcm_config insteadKeguang Zhang1-6/+1
The sti-uniperf pcm_config is the same as the default pcm_config. Since commit 43556516fffe ("ASoC: soc-generic-dmaengine-pcm: Use default config when none is given"), passing a NULL pointer could let this driver use the default config. Signed-off-by: Keguang Zhang <[email protected]> Link: https://lore.kernel.org/r/[email protected] Signed-off-by: Mark Brown <[email protected]>
2023-08-14ASoC: sti: merge DAI call back functions into opsKuninori Morimoto1-1/+5
ALSA SoC merges DAI call backs into .ops. This patch merge these into one. Signed-off-by: Kuninori Morimoto <[email protected]> Link: https://lore.kernel.org/r/[email protected] Signed-off-by: Mark Brown <[email protected]>
2022-06-27ASoC: sti-uniperf: Migrate to new style legacy DAI naming flagCharles Keepax1-1/+2
Change the legacy DAI naming flag from opting in to the new scheme (non_legacy_dai_naming), to opting out of it (legacy_dai_naming). This driver appears to be on the CPU side of the DAI link and currently uses the legacy naming, so add the new flag. Signed-off-by: Charles Keepax <[email protected]> Link: https://lore.kernel.org/r/[email protected] Signed-off-by: Mark Brown <[email protected]>
2022-03-16ASoC: sti: Fix deadlock via snd_pcm_stop_xrun() callTakashi Iwai2-4/+4
This is essentially a revert of the commit dc865fb9e7c2 ("ASoC: sti: Use snd_pcm_stop_xrun() helper"), which converted the manual snd_pcm_stop() calls with snd_pcm_stop_xrun(). The commit above introduced a deadlock as snd_pcm_stop_xrun() itself takes the PCM stream lock while the caller already holds it. Since the conversion was done only for consistency reason and the open-call with snd_pcm_stop() to the XRUN state is a correct usage, let's revert the commit back as the fix. Fixes: dc865fb9e7c2 ("ASoC: sti: Use snd_pcm_stop_xrun() helper") Reported-by: Daniel Palmer <[email protected]> Cc: Arnaud POULIQUEN <[email protected]> Cc: <[email protected]> Link: https://lore.kernel.org/r/[email protected] Signed-off-by: Takashi Iwai <[email protected]> Reviewed-by: Arnaud Pouliquen <[email protected]> Link: https://lore.kernel.org/r/[email protected] Signed-off-by: Mark Brown <[email protected]>
2021-06-17ASoC: sti: sti_uniperif: Use devm_platform_get_and_ioremap_resource()Yang Yingliang1-10/+2
Use devm_platform_get_and_ioremap_resource() to simplify code. Signed-off-by: Yang Yingliang <[email protected]> Link: https://lore.kernel.org/r/[email protected] Signed-off-by: Mark Brown <[email protected]>
2021-04-13ASoC: sti: sti_uniperif: add missing MODULE_DEVICE_TABLEChen Lifu1-0/+1
This patch adds missing MODULE_DEVICE_TABLE definition which generates correct modalias for automatic loading of this driver when it is built as an external module. Reported-by: Hulk Robot <[email protected]> Signed-off-by: Chen Lifu <[email protected]> Reviewed-by: Arnaud Pouliquen <[email protected]> Link: https://lore.kernel.org/r/[email protected] Signed-off-by: Mark Brown <[email protected]>
2021-03-31ASoC: sti: uniperif: align function prototypesPierre-Louis Bossart1-2/+2
cppcheck warning: sound/soc/sti/uniperif_player.c:1049:24: style:inconclusive: Function 'uni_player_init' argument 2 names different: declaration 'uni_player' definition 'player'. [funcArgNamesDifferent] struct uniperif *player) ^ sound/soc/sti/uniperif.h:1375:24: note: Function 'uni_player_init' argument 2 names different: declaration 'uni_player' definition 'player'. struct uniperif *uni_player); ^ sound/soc/sti/uniperif_player.c:1049:24: note: Function 'uni_player_init' argument 2 names different: declaration 'uni_player' definition 'player'. struct uniperif *player) ^ sound/soc/sti/uniperif_reader.c:411:24: style:inconclusive: Function 'uni_reader_init' argument 2 names different: declaration 'uni_reader' definition 'reader'. [funcArgNamesDifferent] struct uniperif *reader) ^ sound/soc/sti/uniperif.h:1380:24: note: Function 'uni_reader_init' argument 2 names different: declaration 'uni_reader' definition 'reader'. struct uniperif *uni_reader); ^ sound/soc/sti/uniperif_reader.c:411:24: note: Function 'uni_reader_init' argument 2 names different: declaration 'uni_reader' definition 'reader'. struct uniperif *reader) ^ Signed-off-by: Pierre-Louis Bossart <[email protected]> Reviewed-by: Arnaud Pouliquen <[email protected]> Link: https://lore.kernel.org/r/[email protected] Signed-off-by: Mark Brown <[email protected]>
2021-03-31ASoC: sti: sti_uniperif: add missing error checkPierre-Louis Bossart1-0/+2
cppcheck warning: sound/soc/sti/sti_uniperif.c:490:6: style: Variable 'ret' is reassigned a value before the old one has been used. [redundantAssignment] ret = devm_snd_soc_register_component(&pdev->dev, ^ sound/soc/sti/sti_uniperif.c:486:6: note: ret is assigned ret = sti_uniperiph_cpu_dai_of(node, priv); ^ sound/soc/sti/sti_uniperif.c:490:6: note: ret is overwritten ret = devm_snd_soc_register_component(&pdev->dev, ^ sti_uniperiph_cpu_dai_of() can return -EINVAL which seems like a good-enough reason to bail. Signed-off-by: Pierre-Louis Bossart <[email protected]> Reviewed-by: Arnaud Pouliquen <[email protected]> Link: https://lore.kernel.org/r/[email protected] Signed-off-by: Mark Brown <[email protected]>
2020-07-10ASoC: sti: uniperif: fix 'defined by not used' warningPierre-Louis Bossart1-1/+1
Fix W=1 warning. The table uni_tdm_hw is declared in a header included by multiple C file. This isn't really a good practice but for now using __maybe_unused makes the following warning go away. sound/soc/sti/sti_uniperif.c:12: sound/soc/sti/uniperif.h:1351:38: warning: ‘uni_tdm_hw’ defined but not used [-Wunused-const-variable=] 1351 | static const struct snd_pcm_hardware uni_tdm_hw = { | ^~~~~~~~~~ Signed-off-by: Pierre-Louis Bossart <[email protected]> Acked-by: Arnaud Pouliquen <[email protected]> Link: https://lore.kernel.org/r/[email protected] Signed-off-by: Mark Brown <[email protected]>
2020-01-21ASoC: sti: sti_uniperif: move .suspend/.resume to componentKuninori Morimoto1-6/+6
There is no big difference at implementation for .suspend/.resume between DAI driver and Component driver. But because some driver is using DAI version, thus ALSA SoC needs to keep supporting it, hence, framework becoming verbose. If we can switch all DAI driver .suspend/.resume to Component driver, we can remove verbose code from ALSA SoC. Driver is getting its private data via dai->dev. But dai->dev and component->dev are same dev, thus, we can convert these. For same reason, we can convert dai->active to component->active if necessary. This patch moves DAI driver .suspend/.resume to Component driver Signed-off-by: Kuninori Morimoto <[email protected]> Link: https://lore.kernel.org/r/[email protected] Signed-off-by: Mark Brown <[email protected]>
2020-01-13ASoC: sti: fix possible sleep-in-atomicArnaud Pouliquen1-3/+4
Change mutex and spinlock management to avoid sleep in atomic issue. Signed-off-by: Arnaud Pouliquen <[email protected]> Link: https://lore.kernel.org/r/[email protected] Signed-off-by: Mark Brown <[email protected]>
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 <[email protected]> Cc: Mark Brown <[email protected]> Cc: Jaroslav Kysela <[email protected]> Cc: Takashi Iwai <[email protected]> Cc: [email protected] Cc: Greg Kroah-Hartman <[email protected]> Signed-off-by: Stephen Boyd <[email protected]> Link: https://lore.kernel.org/r/[email protected] Signed-off-by: Mark Brown <[email protected]>
2019-05-30treewide: Replace GPLv2 boilerplate/reference with SPDX - rule 194Thomas Gleixner4-4/+4
Based on 1 normalized pattern(s): license terms gnu general public license gpl version 2 extracted by the scancode license scanner the SPDX license identifier GPL-2.0-only has been chosen to replace the boilerplate/reference in 161 file(s). Signed-off-by: Thomas Gleixner <[email protected]> Reviewed-by: Allison Randal <[email protected]> Reviewed-by: Alexios Zavras <[email protected]> Reviewed-by: Steve Winslow <[email protected]> Reviewed-by: Richard Fontana <[email protected]> Cc: [email protected] Link: https://lkml.kernel.org/r/[email protected] Signed-off-by: Greg Kroah-Hartman <[email protected]>
2019-05-21treewide: Add SPDX license identifier - Makefile/KconfigThomas Gleixner2-0/+2
Add SPDX license identifiers to all Make/Kconfig files which: - Have no license information of any form These files fall under the project license, GPL v2 only. The resulting SPDX license identifier is: GPL-2.0-only Signed-off-by: Thomas Gleixner <[email protected]> Signed-off-by: Greg Kroah-Hartman <[email protected]>
2018-07-04ASoC: sti: Use snd_pcm_stop_xrun() helperTakashi Iwai2-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 <[email protected]> Signed-off-by: Mark Brown <[email protected]>
2017-04-30ASoC: sti: Fix error handling if of_clk_get() failsDan Carpenter1-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 <[email protected]> Acked-by: Arnaud POULIQUEN <[email protected]> Signed-off-by: Mark Brown <[email protected]>
2017-04-06ASoC: STI: Fix null ptr deference in IRQ handlerArnaud Pouliquen3-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 <[email protected]> Signed-off-by: Mark Brown <[email protected]>
2017-03-24ASoC: STI: Fix reader substream pointer setArnaud Pouliquen1-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 <[email protected]> Signed-off-by: Mark Brown <[email protected]>
2016-12-12Merge remote-tracking branches 'asoc/topic/stac9766', 'asoc/topic/sti', ↵Mark Brown4-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 startArnaud Pouliquen1-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 <[email protected]> Signed-off-by: Mark Brown <[email protected]>
2016-10-26ASoC: sti: clean unused includeArnaud Pouliquen2-4/+0
Signed-off-by: Arnaud Pouliquen <[email protected]> Signed-off-by: Mark Brown <[email protected]>
2016-10-26ASoC: sti: reset refactoringArnaud Pouliquen4-45/+29
Reset is common to player and reader, migrate function in sti_uniperif.c Signed-off-by: Arnaud Pouliquen <[email protected]> Signed-off-by: Mark Brown <[email protected]>
2016-10-26ASoC: sti: fix errors managementArnaud Pouliquen3-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 <[email protected]> Signed-off-by: Mark Brown <[email protected]>
2016-09-19ASoC: sti: fix missing clk_disable_unprepare() on error in uni_player_start()Wei Yongjun1-1/+3
Fix the missing clk_disable_unprepare() before return from uni_player_start() in the error handling case. Signed-off-by: Wei Yongjun <[email protected]> Acked-by: Arnaud Pouliquen <[email protected]> Signed-off-by: Mark Brown <[email protected]>
2016-09-14ASoC: sti: suppress inappropriate DT fieldsArnaud Pouliquen4-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 <[email protected]> Signed-off-by: Mark Brown <[email protected]>
2016-06-13ASoC: sti: fix return value check in uni_player_parse_dt_audio_glue()Wei Yongjun1-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 <[email protected]> Signed-off-by: Mark Brown <[email protected]>
2016-04-18ASoC: sti: select player for I2S/TDM TX busMoise Gergaud2-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 <[email protected]> Acked-by: Arnaud Pouliquen <[email protected]> Signed-off-by: Mark Brown <[email protected]>
2016-04-12ASoC: sti: unip reader tdm modeMoise Gergaud1-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 <[email protected]> Acked-by: Arnaud Pouliquen <[email protected]> Signed-off-by: Mark Brown <[email protected]>
2016-04-12ASoC: sti: unip player tdm modeMoise Gergaud3-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 <[email protected]> Acked-by: Arnaud Pouliquen <[email protected]> Signed-off-by: Mark Brown <[email protected]>
2016-04-12ASoC: sti: helper functions to fix tdm runtime paramsMoise Gergaud2-0/+52
Signed-off-by: Moise Gergaud <[email protected]> Acked-by: Arnaud Pouliquen <[email protected]> Signed-off-by: Mark Brown <[email protected]>
2016-04-12ASoC: sti: helper functions for unip tdm slots configurationMoise Gergaud2-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 <[email protected]> Acked-by: Arnaud Pouliquen <[email protected]> Signed-off-by: Mark Brown <[email protected]>
2016-04-12ASoC: sti: define tdm type & default tdm hw configMoise Gergaud1-1/+27
Signed-off-by: Moise Gergaud <[email protected]> Acked-by: Arnaud Pouliquen <[email protected]> Signed-off-by: Mark Brown <[email protected]>
2016-04-12ASoC: sti: rename unip player type into common player & reader typeMoise Gergaud2-25/+25
Signed-off-by: Moise Gergaud <[email protected]> Acked-by: Arnaud Pouliquen <[email protected]> Signed-off-by: Mark Brown <[email protected]>
2016-04-12ASoC: sti: macro for uniperif tdm regs accessMoise Gergaud1-0/+112
Signed-off-by: Moise Gergaud <[email protected]> Acked-by: Arnaud Pouliquen <[email protected]> Signed-off-by: Mark Brown <[email protected]>
2016-03-31ASoC: sti: correct typo errorsMoise Gergaud1-11/+11
Signed-off-by: Moise Gergaud <[email protected]> Acked-by: Arnaud Pouliquen <[email protected]> Signed-off-by: Mark Brown <[email protected]>
2015-12-23Merge remote-tracking branches 'asoc/topic/samsung', 'asoc/topic/sh', ↵Mark Brown1-2/+1
'asoc/topic/ssm2518' and 'asoc/topic/sti' into asoc-next
2015-11-25ASoC: sti: set iec958 channel status sampling freqMoise Gergaud1-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 <[email protected]> Acked-by: Arnaud Pouliquen <[email protected]> Signed-off-by: Mark Brown <[email protected]>
2015-11-19ASoC: sti: set player private dataMoise Gergaud1-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 <[email protected]> Acked-by: Arnaud Pouliquen <[email protected]> Signed-off-by: Mark Brown <[email protected]>
2015-11-19ASoC: sti: rename ST proprietary DT propertiesMoise Gergaud2-4/+4
"st," prefix has been added for ST proprietary DT properties. Signed-off-by: Moise Gergaud <[email protected]> Acked-by: Arnaud Pouliquen <[email protected]> Signed-off-by: Mark Brown <[email protected]>
2015-11-19ASoC: sti: remove wrong error messageMoise Gergaud1-1/+0
Signed-off-by: Moise Gergaud <[email protected]> Acked-by: Arnaud Pouliquen <[email protected]> Signed-off-by: Mark Brown <[email protected]>
2015-09-10ASoC: sti: check return of of_property_readArnaud Pouliquen2-5/+15
Add check on of_property_read to return error when DT required property is not defined. Signed-off-by: Arnaud Pouliquen <[email protected]> Signed-off-by: Mark Brown <[email protected]>
2015-08-30ASoC: sti_uniperif: Ensure component is unregistered when unload moduleAxel Lin1-3/+3
Use devm_snd_soc_register_component to ensure component is unregistered when unload the module. Signed-off-by: Axel Lin <[email protected]> Signed-off-by: Mark Brown <[email protected]>
2015-08-07ASoC: sti: Add IEC controlArnaud Pouliquen1-4/+73
Add control to configure IEC60958 settings. Signed-off-by: Arnaud Pouliquen <[email protected]> Signed-off-by: Mark Brown <[email protected]>
2015-07-29ASoC: uniperf: Staticise local symbolsLars-Peter Clausen1-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 <[email protected]> Acked-by: Arnaud Pouliquen <[email protected]> Signed-off-by: Mark Brown <[email protected]>
2015-07-29ASoC: uniperf: Add missing __iomem annotationLars-Peter Clausen1-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 <[email protected]> Acked-by: Arnaud Pouliquen <[email protected]> Signed-off-by: Mark Brown <[email protected]>
2015-07-21ASoC: sti: error handling bug in sti_uniperiph_cpu_dai_of()Dan Carpenter1-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 <[email protected]> Signed-off-by: Mark Brown <[email protected]>
2015-07-20ASoC: sti-uniperf: Fix implicit inclusion of pinctrlMark Brown1-0/+1
Reported-by: Stephen Rothwell <[email protected]> Signed-off-by: Mark Brown <[email protected]>
2015-07-17ASoC: sti: sti_uniperiph_dai_create_ctrl() can be statickbuild test robot3-5/+5
Signed-off-by: Fengguang Wu <[email protected]> Signed-off-by: Mark Brown <[email protected]>