summaryrefslogtreecommitdiffstats
path: root/sound/soc/amd/acp
Commit message (Collapse)AuthorAgeFilesLines
* ASoC: amd: acp: Add kcontrols and widgets per-codec in common codeAlper Nebi Yasak2023-08-183-44/+67
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Commit 7ac3404c2e21 ("ASoC: amd: acp: Map missing jack kcontrols") adds card kcontrols and DAPM widgets corresponding to jacks for Headphone and Headset Mic. But these were already being added in acp-legacy-mach.c and acp-sof-mach.c, so this causes a probe error: sof_mach rt5682s-hs-rt1019: control 2:0:0:Headphone Jack Switch:0 is already present sof_mach rt5682s-hs-rt1019: ASoC: Failed to add Headphone Jack Switch: -16 sof_mach rt5682s-hs-rt1019: devm_snd_soc_register_card(sof-rt5682s-hs-rt1019) failed: -16 sof_mach: probe of rt5682s-hs-rt1019 failed with error -16 Removing the new duplicates from the common code might be enough to fix the issue. But some of the codecs use different kcontrols and widgets. NAU8821 alone has an "Int Mic". MAX98360A has a single "Spk", while RT1019 has "Left Spk" and "Right Spk" (and two codec instances with name prefixes). Since there are per-codec differences, add the kcontrols and widgets in the common code as each dai-link is being initialized, instead of in the two machine drivers' probe(). Also, MAX98388 has Left and Right instances, but uses a single "SPK" widget. That seems weird, so normalize it to use two widgets (one per each instance like RT1019) while we're adding controls. Fixes: 7ac3404c2e21 ("ASoC: amd: acp: Map missing jack kcontrols") Signed-off-by: Alper Nebi Yasak <alpernebiyasak@gmail.com> Link: https://lore.kernel.org/r/20230818080314.32991-1-alpernebiyasak@gmail.com Signed-off-by: Mark Brown <broonie@kernel.org>
* ASoC: amd: merge DAI call back functions into opsKuninori Morimoto2023-08-144-18/+12
| | | | | | | | | ALSA SoC merges DAI call backs into .ops. This patch merge these into one. Signed-off-by: Kuninori Morimoto <kuninori.morimoto.gx@renesas.com> Link: https://lore.kernel.org/r/87pm3xb0va.wl-kuninori.morimoto.gx@renesas.com Signed-off-by: Mark Brown <broonie@kernel.org>
* ASoC: amd: acp: Map missing jack kcontrolsAlper Nebi Yasak2023-08-071-44/+182
| | | | | | | | | | | | | This driver does not properly map jack pins to kcontrols that PulseAudio and PipeWire need to handle jack detection events. The RT5682, RT5682s, NAU8825 and NAU8821 codecs used here can detect Headphone and Headset Mic connections. Expose both to userspace as kcontrols and add the necessary widgets. Split the jack and pin structs per-codec to accommodate for per-codec differences. Signed-off-by: Alper Nebi Yasak <alpernebiyasak@gmail.com> Link: https://lore.kernel.org/r/20230802175737.263412-4-alpernebiyasak@gmail.com Signed-off-by: Mark Brown <broonie@kernel.org>
* ASoC: amd: acp: fix SND_SOC_AMD_ACP_PCI depdenenciesArnd Bergmann2023-07-191-0/+1
| | | | | | | | | | | | | | | | | | | | | | The new PM functions require code that is part of the snd-acp-legacy-common module: x86_64-linux-ld: sound/soc/amd/acp/acp-pci.o: in function `snd_acp_resume': acp-pci.c:(.text+0x23): undefined reference to `acp_init' x86_64-linux-ld: acp-pci.c:(.text+0x58): undefined reference to `acp_enable_interrupts' x86_64-linux-ld: sound/soc/amd/acp/acp-pci.o: in function `snd_acp_suspend': acp-pci.c:(.text+0x89): undefined reference to `acp_deinit' x86_64-linux-ld: sound/soc/amd/acp/acp-pci.o: in function `acp_pci_remove': acp-pci.c:(.text+0xec): undefined reference to `acp_deinit' x86_64-linux-ld: sound/soc/amd/acp/acp-pci.o: in function `acp_pci_probe': acp-pci.c:(.text+0x26b): undefined reference to `acp_init' Select that Kconfig symbol as is done for the other frontends. Fixes: 088a40980efbc ("ASoC: amd: acp: add pm ops support for acp pci driver") Signed-off-by: Arnd Bergmann <arnd@arndb.de> Link: https://lore.kernel.org/r/20230719130846.633701-1-arnd@kernel.org Signed-off-by: Mark Brown <broonie@kernel.org>
* ASoC: amd: acp: delete unnecessary NULL checkDan Carpenter2023-07-181-12/+10
| | | | | | | | | The list iterator can't be NULL. Delete the check and pull the code in one tab. Signed-off-by: Dan Carpenter <dan.carpenter@linaro.org> Link: https://lore.kernel.org/r/b0c5b0ca-68da-47e6-a8b0-e0714f0de119@moroto.mountain Signed-off-by: Mark Brown <broonie@kernel.org>
* ASoC: amd: acp: clean up some inconsistent indentingsYang Li2023-07-131-2/+2
| | | | | | | | | | sound/soc/amd/acp/acp-rembrandt.c:283 rmb_pcm_resume() warn: inconsistent indenting Reported-by: Abaci Robot <abaci@linux.alibaba.com> Closes: https://bugzilla.openanolis.cn/show_bug.cgi?id=5863 Signed-off-by: Yang Li <yang.lee@linux.alibaba.com> Link: https://lore.kernel.org/r/20230713065106.21564-1-yang.lee@linux.alibaba.com Signed-off-by: Mark Brown <broonie@kernel.org>
* Refactor acp legacy driver and addMark Brown2023-07-1210-253/+531
|\ | | | | | | | | | | | | Merge series from Syed Saba Kareem <Syed.SabaKareem@amd.com>: This patch series to refactor acp leagacy driver and add pm ops support for rembrandt platforms.
| * ASoC: amd: acp: add pm ops support for rembrandt platformSyed Saba Kareem2023-07-093-1/+258
| | | | | | | | | | | | | | | | Add pm ops for rembrandt platform. Signed-off-by: Syed Saba Kareem <Syed.SabaKareem@amd.com> Link: https://lore.kernel.org/r/20230626135515.1252063-11-Syed.SabaKareem@amd.com Signed-off-by: Mark Brown <broonie@kernel.org>
| * ASoC: amd: acp: move pdm macros to common header fileSyed Saba Kareem2023-07-092-12/+12
| | | | | | | | | | | | | | | | | | Move pdm related macros from pdm file to common header file so that it can be used across different files. Signed-off-by: Syed Saba Kareem <Syed.SabaKareem@amd.com> Link: https://lore.kernel.org/r/20230626135515.1252063-10-Syed.SabaKareem@amd.com Signed-off-by: Mark Brown <broonie@kernel.org>
| * ASoC: amd: acp: store the pdm stream channel maskSyed Saba Kareem2023-07-092-0/+2
| | | | | | | | | | | | | | | | | | Store the pdm stream channel mask, it will be used during system level resume. Signed-off-by: Syed Saba Kareem <Syed.SabaKareem@amd.com> Link: https://lore.kernel.org/r/20230626135515.1252063-9-Syed.SabaKareem@amd.com Signed-off-by: Mark Brown <broonie@kernel.org>
| * ASoC: amd: acp: export config_acp_dma() and config_pte_for_stream() symbolsSyed Saba Kareem2023-07-091-2/+4
| | | | | | | | | | | | | | | | | | | | Export config_acp_dma() and config_pte_for_stream() functions. These functions will be used to restore stream configuration during system level resume. Signed-off-by: Syed Saba Kareem <Syed.SabaKareem@amd.com> Link: https://lore.kernel.org/r/20230626135515.1252063-8-Syed.SabaKareem@amd.com Signed-off-by: Mark Brown <broonie@kernel.org>
| * ASoC: amd: acp: store xfer_resolution of the streamSyed Saba Kareem2023-07-092-0/+4
| | | | | | | | | | | | | | | | | | | | Store the 'xfer_resolution' of the stream in private data structure, it will be used to reprogram the xfer_resolution for the active stream during system level resume. Signed-off-by: Syed Saba Kareem <Syed.SabaKareem@amd.com> Link: https://lore.kernel.org/r/20230626135515.1252063-7-Syed.SabaKareem@amd.com Signed-off-by: Mark Brown <broonie@kernel.org>
| * ASoC: amd: acp: add pm ops support for acp pci driverSyed Saba Kareem2023-07-091-0/+46
| | | | | | | | | | | | | | | | Add pm ops support for common acp pci driver. Signed-off-by: Syed Saba Kareem <Syed.SabaKareem@amd.com> Link: https://lore.kernel.org/r/20230626135515.1252063-6-Syed.SabaKareem@amd.com Signed-off-by: Mark Brown <broonie@kernel.org>
| * ASoC: amd: acp: store platform device reference created in pci probe callSyed Saba Kareem2023-07-092-1/+2
| | | | | | | | | | | | | | | | | | Store the platform device reference created in pci driver, it will be used in restoring the interrupts during system level resume. Signed-off-by: Syed Saba Kareem <Syed.SabaKareem@amd.com> Link: https://lore.kernel.org/r/20230626135515.1252063-5-Syed.SabaKareem@amd.com Signed-off-by: Mark Brown <broonie@kernel.org>
| * ASoC: amd: acp: remove the redundant acp enable/disable interrupts functionsSyed Saba Kareem2023-07-095-44/+29
| | | | | | | | | | | | | | | | | | | | Instead of having individual acp enable/disable interrupts functions for each platform, implement common place holder to handle the same for all AMD platforms. Signed-off-by: Syed Saba Kareem <Syed.SabaKareem@amd.com> Link: https://lore.kernel.org/r/20230626135515.1252063-4-Syed.SabaKareem@amd.com Signed-off-by: Mark Brown <broonie@kernel.org>
| * ASoC: amd: acp: add acp i2s master clock generation for rembrandt platformSyed Saba Kareem2023-07-093-0/+48
| | | | | | | | | | | | | | | | | | Add acp i2s master clock generation logic for rembrandt platform. Signed-off-by: V Sujith Kumar Reddy <vsujithkumar.reddy@amd.com> Signed-off-by: Syed Saba Kareem <Syed.SabaKareem@amd.com> Link: https://lore.kernel.org/r/20230626135515.1252063-3-Syed.SabaKareem@amd.com Signed-off-by: Mark Brown <broonie@kernel.org>
| * ASoC: amd: acp: refactor the acp init and de-init sequenceSyed Saba Kareem2023-07-097-202/+135
| | | | | | | | | | | | | | | | | | | | | | Remove the individual acp init and de-init functions from different variants of acp pci driver(for renoir/rembrandt platforms) and use a common file to define callbacks and refactor the callbacks to support existing platforms. Signed-off-by: Syed Saba Kareem <Syed.SabaKareem@amd.com> Link: https://lore.kernel.org/r/20230626135515.1252063-2-Syed.SabaKareem@amd.com Signed-off-by: Mark Brown <broonie@kernel.org>
* | ASoC: amd: Add acpi machine id's for vangogh platformVenkata Prasad Potturu2023-07-091-0/+16
| | | | | | | | | | | | | | | | | | Add acpi machine id's for vangogh platform and configure driver data to enable SOF sound card support on newer boards. Signed-off-by: Venkata Prasad Potturu <venkataprasad.potturu@amd.com> Link: https://lore.kernel.org/r/20230707120730.1948445-4-venkataprasad.potturu@amd.com Signed-off-by: Mark Brown <broonie@kernel.org>
* | ASoC: amd: acp: Add machine driver support for max98388 codecVenkata Prasad Potturu2023-07-093-0/+102
| | | | | | | | | | | | | | | | | | In newer platforms max98388 codec as amplifier codec. Add support for maxim codec in generic machine driver. Signed-off-by: Venkata Prasad Potturu <venkataprasad.potturu@amd.com> Link: https://lore.kernel.org/r/20230707120730.1948445-3-venkataprasad.potturu@amd.com Signed-off-by: Mark Brown <broonie@kernel.org>
* | ASoC: amd: acp: Add machine driver support for nau8821 codecVenkata Prasad Potturu2023-07-093-0/+169
|/ | | | | | | | | In newer variants nau8821 as primary codec. Add support for nau8821 codec in generic machine driver. Signed-off-by: Venkata Prasad Potturu <venkataprasad.potturu@amd.com> Link: https://lore.kernel.org/r/20230707120730.1948445-2-venkataprasad.potturu@amd.com Signed-off-by: Mark Brown <broonie@kernel.org>
* ASoC: amd: acp: fix for invalid dai id handling in acp_get_byte_count()Vijendar Mukunda2023-06-261-3/+4
| | | | | | | | | | | For invalid dai id, instead of returning -EINVAL return bytes count as zero in acp_get_byte_count() function. Fixes: 623621a9f9e1 ("ASoC: amd: Add common framework to support I2S on ACP SOC") Signed-off-by: Vijendar Mukunda <Vijendar.Mukunda@amd.com> Link: https://lore.kernel.org/r/20230626105356.2580125-6-Vijendar.Mukunda@amd.com Signed-off-by: Mark Brown <broonie@kernel.org>
* ASoC: amd: acp: remove acp poweroff functionSyed Saba Kareem2023-06-222-42/+0
| | | | | | | | | BIOS invokes ACP Power off sequence based on ACP device state. Remove redundant code from ACP PCI driver for ACP Power off sequence. Signed-off-by: Syed Saba Kareem <Syed.SabaKareem@amd.com> Link: https://lore.kernel.org/r/Message-Id: <20230622152406.3709231-4-Syed.SabaKareem@amd.com> Signed-off-by: Mark Brown <broonie@kernel.org>
* ASoC: amd: acp: clear pdm dma interrupt maskSyed Saba Kareem2023-06-221-1/+1
| | | | | | | | | | | Clear pdm dma interrupt mask in acp_dmic_shutdown(). 'Fixes: c32bd332ce5c9 ("ASoC: amd: acp: Add generic support for PDM controller on ACP")' Signed-off-by: Syed Saba Kareem <Syed.SabaKareem@amd.com> Link: https://lore.kernel.org/r/Message-Id: <20230622152406.3709231-1-Syed.SabaKareem@amd.com> Signed-off-by: Mark Brown <broonie@kernel.org>
* ASoC: do not include pm_runtime.h if not usedClaudiu Beznea2023-05-232-2/+0
| | | | | | | | | | Do not include pm_runtime.h header in files where APIs exported by pm_runtime.h are not used. Signed-off-by: Claudiu Beznea <claudiu.beznea@microchip.com> Acked-by: Jarkko Nikula <jarkko.nikula@bitmer.com> # for omap-mcbsp-st.c Link: https://lore.kernel.org/r/20230517094903.2895238-2-claudiu.beznea@microchip.com Signed-off-by: Mark Brown <broonie@kernel.org>
* ASoC: amd: use asoc_dummy_dlcKuninori Morimoto2023-05-081-25/+18
| | | | | | | | Now we can share asoc_dummy_dlc. This patch use it. Signed-off-by: Kuninori Morimoto <kuninori.morimoto.gx@renesas.com Link: https://lore.kernel.org/r/875y9m0zwz.wl-kuninori.morimoto.gx@renesas.com Signed-off-by: Mark Brown <broonie@kernel.org
* ASoC: amd: acp: renoir: Convert to platform remove callback returning voidUwe Kleine-König2023-03-201-3/+2
| | | | | | | | | | | | | | | | | | | The .remove() callback for a platform driver returns an int which makes many driver authors wrongly assume it's possible to do error handling by returning an error code. However the value returned is (mostly) ignored and this typically results in resource leaks. To improve here there is a quest to make the remove callback return void. In the first step of this quest all drivers are converted to .remove_new() which already returns void. Trivially convert this driver from always returning zero in the remove callback to the void returning variant. Signed-off-by: Uwe Kleine-König <u.kleine-koenig@pengutronix.de> Acked-by: Takashi Iwai <tiwai@suse.de> Acked-by: Nicolas Ferre <nicolas.ferre@microchip.com> Link: https://lore.kernel.org/r/20230315150745.67084-18-u.kleine-koenig@pengutronix.de Signed-off-by: Mark Brown <broonie@kernel.org>
* ASoC: amd: acp: rembrandt: Convert to platform remove callback returning voidUwe Kleine-König2023-03-201-3/+2
| | | | | | | | | | | | | | | | | | | The .remove() callback for a platform driver returns an int which makes many driver authors wrongly assume it's possible to do error handling by returning an error code. However the value returned is (mostly) ignored and this typically results in resource leaks. To improve here there is a quest to make the remove callback return void. In the first step of this quest all drivers are converted to .remove_new() which already returns void. Trivially convert this driver from always returning zero in the remove callback to the void returning variant. Signed-off-by: Uwe Kleine-König <u.kleine-koenig@pengutronix.de> Acked-by: Takashi Iwai <tiwai@suse.de> Acked-by: Nicolas Ferre <nicolas.ferre@microchip.com> Link: https://lore.kernel.org/r/20230315150745.67084-17-u.kleine-koenig@pengutronix.de Signed-off-by: Mark Brown <broonie@kernel.org>
* ASoC: amd: acp: rembrandt: Drop if blocks with always false conditionUwe Kleine-König2023-03-201-7/+1
| | | | | | | | | | | | | | | | | | rembrandt_audio_remove() is only called after a successful call to rembrandt_audio_probe(). With the latter it's sure that dev_get_platdata() returns a non-NULL value and also that ->base is non-NULL. So the corresponding check can be dropped. While touching these lines join declaration and assignment into a single line and make use of dev = &pdev->dev; This prepares converting platform driver remove callbacks to return void. Signed-off-by: Uwe Kleine-König <u.kleine-koenig@pengutronix.de> Acked-by: Takashi Iwai <tiwai@suse.de> Acked-by: Nicolas Ferre <nicolas.ferre@microchip.com> Link: https://lore.kernel.org/r/20230315150745.67084-3-u.kleine-koenig@pengutronix.de Signed-off-by: Mark Brown <broonie@kernel.org>
* ASoC: amd: acp: Refactor bit width calculationVenkata Prasad Potturu2023-01-301-4/+4
| | | | | | | | | | Refactor bit width calculation using params_physical_width() instead hard-code values. Signed-off-by: Venkata Prasad Potturu <venkataprasad.potturu@amd.com> Link: https://lore.kernel.org/r/20230130100104.4076640-1-venkataprasad.potturu@amd.com Reviewed-by: Peter Ujfalusi <peter.ujfalusi@linux.intel.com> Signed-off-by: Mark Brown <broonie@kernel.org>
* ASoC: amd: acp: Enable i2s tdm support for skyrim platformsVenkata Prasad Potturu2023-01-114-0/+31
| | | | | | | | Enable i2s tdm support for skyrim platform using dmi quirks. Signed-off-by: Venkata Prasad Potturu <venkataprasad.potturu@amd.com> Link: https://lore.kernel.org/r/20230109132104.1259479-6-venkataprasad.potturu@amd.com Signed-off-by: Mark Brown <broonie@kernel.org>
* ASoC: amd: acp: Add i2s tdm support in machine driverVenkata Prasad Potturu2023-01-114-14/+162
| | | | | | | | Add i2s tdm support for amd platforms. Signed-off-by: Venkata Prasad Potturu <venkataprasad.potturu@amd.com> Link: https://lore.kernel.org/r/20230109132104.1259479-5-venkataprasad.potturu@amd.com Signed-off-by: Mark Brown <broonie@kernel.org>
* ASoC: amd: acp: Refactor i2s clocks programming sequenceVenkata Prasad Potturu2023-01-111-75/+94
| | | | | | | | | Refactor i2s clock values based on hw_params and use srate and bclk_ratio variables in clock enable API instead hard-code values. Signed-off-by: Venkata Prasad Potturu <venkataprasad.potturu@amd.com> Link: https://lore.kernel.org/r/20230109132104.1259479-4-venkataprasad.potturu@amd.com Signed-off-by: Mark Brown <broonie@kernel.org>
* ASoC: amd: acp: Refactor dai format implementationVenkata Prasad Potturu2023-01-111-30/+122
| | | | | | | | | Refactor dai format implementation in dai_link specific snd_soc_ops. Signed-off-by: Venkata Prasad Potturu <venkataprasad.potturu@amd.com> Link: https://lore.kernel.org/r/20230109132104.1259479-3-venkataprasad.potturu@amd.com Signed-off-by: Mark Brown <broonie@kernel.org>
* ASoC: amd: acp: Add new cpu dai's in machine driverVenkata Prasad Potturu2023-01-111-4/+8
| | | | | | | | | | | | when using same cpu dai for 2 different dai links below error is reported. error: can't find BE for DAI ACPHS_VIRTUAL1.OUT To avoid this error add new cpu dai. Signed-off-by: Venkata Prasad Potturu <venkataprasad.potturu@amd.com> Link: https://lore.kernel.org/r/20230109132104.1259479-2-venkataprasad.potturu@amd.com Signed-off-by: Mark Brown <broonie@kernel.org>
* ASoC: amd: acp: Fix possible UAF in acp_dma_openGaosheng Cui2022-11-181-4/+4
| | | | | | | | | | | | | | | | | | | Smatch report warning as follows: sound/soc/amd/acp/acp-platform.c:199 acp_dma_open() warn: '&stream->list' not removed from list If snd_pcm_hw_constraint_integer() fails in acp_dma_open(), stream will be freed, but stream->list will not be removed from adata->stream_list, then list traversal may cause UAF. Fix by adding the newly allocated stream to the list once it's fully initialised. Fixes: 7929985cfe36 ("ASoC: amd: acp: Initialize list to store acp_stream during pcm_open") Signed-off-by: Gaosheng Cui <cuigaosheng1@huawei.com> Link: https://lore.kernel.org/r/20221118030056.3135960-1-cuigaosheng1@huawei.com Signed-off-by: Mark Brown <broonie@kernel.org>
* ASoC: amd: acp: Add setbias level for rt5682s codec in machine driverVenkata Prasad Potturu2022-10-191-6/+56
| | | | | | | | | | Add set_bais_level function for rt5682s codec to enable bclk and lrclk before codec widgets power on and disable bclk and lrclk after widgets power down, to avoid pop noise Signed-off-by: Venkata Prasad Potturu <venkataprasad.potturu@amd.com> Link: https://lore.kernel.org/r/20220921090750.3833256-1-venkataprasad.potturu@amd.com Signed-off-by: Mark Brown <broonie@kernel.org>
* ASoC: amd: acp: Add TDM slots setting support for ACP I2S controllerVenkata Prasad Potturu2022-10-181-1/+15
| | | | | | | | | Modify set tdm slot function to set ACP I2S controller slots in tdm mode based on number of slots. Signed-off-by: Venkata Prasad Potturu <venkataprasad.potturu@amd.com> Link: https://lore.kernel.org/r/20221018122711.2559452-1-venkataprasad.potturu@amd.com Signed-off-by: Mark Brown <broonie@kernel.org>
* ASoC: amd: acp: use function devm_kcalloc() instead of devm_kzalloc()ye xingchen2022-09-191-2/+2
| | | | | | | | | | Use 2-factor multiplication argument form devm_kcalloc() instead of devm_kzalloc(). Reported-by: Zeal Robot <zealci@zte.com.cn> Signed-off-by: ye xingchen <ye.xingchen@zte.com.cn> Link: https://lore.kernel.org/r/20220916062027.152815-1-ye.xingchen@zte.com.cn Signed-off-by: Mark Brown <broonie@kernel.org>
* ASoC: amd: acp: use devm_kcalloc() instead of devm_kzalloc()ye xingchen2022-09-191-1/+1
| | | | | | | | | | Use 2-factor multiplication argument form devm_kcalloc() instead of devm_kzalloc(). Reported-by: Zeal Robot <zealci@zte.com.cn> Signed-off-by: ye xingchen <ye.xingchen@zte.com.cn> Link: https://lore.kernel.org/r/20220916061906.152434-1-ye.xingchen@zte.com.cn Signed-off-by: Mark Brown <broonie@kernel.org>
* ASoC: amd: acp: Modify dai_id macros to be more genericVenkata Prasad Potturu2022-08-281-3/+3
| | | | | | | | Change dai_id macros to make I2S instances in order. Signed-off-by: Venkata Prasad Potturu <venkataprasad.potturu@amd.com> Link: https://lore.kernel.org/r/20220826064250.3302260-1-venkataprasad.potturu@amd.com Signed-off-by: Mark Brown <broonie@kernel.org>
* ASoC: amd: acp: remove unnecessary NULL checksDan Carpenter2022-08-191-2/+2
| | | | | | | | The list iterator can never be NULL. Delete the bogus NULL checks. Signed-off-by: Dan Carpenter <dan.carpenter@oracle.com> Link: https://lore.kernel.org/r/Yv8ePUuBfzaRu6xV@kili Signed-off-by: Mark Brown <broonie@kernel.org>
* ASoC: amd: acp: add a label to make error path more cleanYang Yingliang2022-08-191-6/+5
| | | | | | | | Move platform_device_unregister() to a new label to make code more clean. Signed-off-by: Yang Yingliang <yangyingliang@huawei.com> Link: https://lore.kernel.org/r/20220819073758.1273160-3-yangyingliang@huawei.com Signed-off-by: Mark Brown <broonie@kernel.org>
* ASoC: amd: acp: switch to use dev_err_probe()Yang Yingliang2022-08-191-4/+3
| | | | | | | | Use dev_err_probe() to simplify code and print error code. Signed-off-by: Yang Yingliang <yangyingliang@huawei.com> Link: https://lore.kernel.org/r/20220819073758.1273160-2-yangyingliang@huawei.com Signed-off-by: Mark Brown <broonie@kernel.org>
* ASoC: amd: acp: add missing platform_device_unregister() in acp_pci_probe()Yang Yingliang2022-08-191-0/+1
| | | | | | | | | Add missing platform_device_unregister() in error path in acp_pci_probe(). Fixes: c49f5e74a11e ("ASoC: amd: acp: Add error handling cases") Signed-off-by: Yang Yingliang <yangyingliang@huawei.com> Link: https://lore.kernel.org/r/20220819073758.1273160-1-yangyingliang@huawei.com Signed-off-by: Mark Brown <broonie@kernel.org>
* ASoC: amd: acp: Add TDM support for acp i2s streamVenkata Prasad Potturu2022-08-152-1/+91
| | | | | | | | | | Add callback and code changes to enable ACP I2S controller in TDM mode. Add new fields in acp_stream and acp_dev_data struct to configure tdm related registers for ACP i2s controllers. Signed-off-by: Venkata Prasad Potturu <venkataprasad.potturu@amd.com> Link: https://lore.kernel.org/r/20220810132913.1181247-3-venkataprasad.potturu@amd.com Signed-off-by: Mark Brown <broonie@kernel.org>
* ASoC: amd: acp: Initialize list to store acp_stream during pcm_openAjit Kumar Pandey2022-08-152-22/+22
| | | | | | | | | | | | | | | We are currently allocating acp_stream during pcm_open and saving it in static array corresponds to array index calculated based on cpu dai->driver id. This approach will fail if we have single dai linked to multiple pcm device as we will have same dai->driver id or array index for multiple pcm open. Initialize new linked list stream_list to store opened pcm stream info dynamically. Signed-off-by: Ajit Kumar Pandey <AjitKumar.Pandey@amd.com> Signed-off-by: Venkata Prasad Potturu <venkataprasad.potturu@amd.com> Reviewed-by: Vijendar Mukunda <Vijendar.Mukunda@amd.com> Link: https://lore.kernel.org/r/20220810132913.1181247-2-venkataprasad.potturu@amd.com Signed-off-by: Mark Brown <broonie@kernel.org>
* ASoC: amd: acp: Fix initialization of ext_intr_stat1 in i2s_irq_handler()Nathan Chancellor2022-07-261-1/+1
| | | | | | | | | | | | | | | | | | | | | | | Clang warns: ../sound/soc/amd/acp/acp-platform.c:117:19: error: variable 'ext_intr_stat1' is uninitialized when used here [-Werror,-Wuninitialized] if (stream && (ext_intr_stat1 & stream->irq_bit)) { ^~~~~~~~~~~~~~ ../sound/soc/amd/acp/acp-platform.c:97:35: note: initialize the variable 'ext_intr_stat1' to silence this warning u32 ext_intr_stat, ext_intr_stat1, i; ^ = 0 1 error generated. The variable was not properly renamed, correct it to resolve the warning. Fixes: 93f53881473c ("ASoC: amd: acp: Modify local variables name to generic") Link: https://github.com/ClangBuiltLinux/linux/issues/1675 Signed-off-by: Nathan Chancellor <nathan@kernel.org> Reviewed-by: Tom Rix <trix@redhat.com> Link: https://lore.kernel.org/r/20220725180539.1315066-1-nathan@kernel.org Signed-off-by: Mark Brown <broonie@kernel.org>
* ASoC: amd: acp: Add error handling casesVenkata Prasad Potturu2022-07-211-4/+20
| | | | | | | | | Add error handling in acp pci driver probe function. Signed-off-by: Venkata Prasad Potturu <venkataprasad.potturu@amd.com> Reviewed-by: Vijendar Mukunda <Vijendar.Mukunda@amd.com> Link: https://lore.kernel.org/r/20220721062043.3016985-5-venkataprasad.potturu@amd.com Signed-off-by: Mark Brown <broonie@kernel.org>
* ASoC: amd: acp: Modify const resource struct variable to genericVenkata Prasad Potturu2022-07-211-5/+4
| | | | | | | | | | Change platform specific constant resource structure variable to generic name. Signed-off-by: Venkata Prasad Potturu <venkataprasad.potturu@amd.com> Reviewed-by: Vijendar Mukunda <Vijendar.Mukunda@amd.com> Link: https://lore.kernel.org/r/20220721062043.3016985-4-venkataprasad.potturu@amd.com Signed-off-by: Mark Brown <broonie@kernel.org>
* ASoC: amd: acp: Drop superfluous mmap callbackVenkata Prasad Potturu2022-07-211-8/+0
| | | | | | | | | | Remove mmap callback as ASoC AMD drivers just call the standard mmap handler. Signed-off-by: Venkata Prasad Potturu <venkataprasad.potturu@amd.com> Reviewed-by: Vijendar Mukunda <Vijendar.Mukunda@amd.com> Link: https://lore.kernel.org/r/20220721062043.3016985-2-venkataprasad.potturu@amd.com Signed-off-by: Mark Brown <broonie@kernel.org>