summaryrefslogtreecommitdiffstats
path: root/sound
Commit message (Collapse)AuthorAgeFilesLines
* ASoC: apple: mca: Improve handling of unavailable DMA channelsMartin Povišer2023-02-241-2/+9
| | | | | | | | | | | | When we fail to obtain a DMA channel, don't return a blanket -EINVAL, instead return the original error code if there's one. This makes deferring work as it should. Also don't print an error message for -EPROBE_DEFER. Fixes: 4ec8179c212f ("ASoC: apple: mca: Postpone requesting of DMA channels") Signed-off-by: Martin Povišer <povik+lin@cutebit.org> Link: https://lore.kernel.org/r/20230224153302.45365-3-povik+lin@cutebit.org Signed-off-by: Mark Brown <broonie@kernel.org>
* ASoC: apple: mca: Fix SERDES reset sequenceMartin Povišer2023-02-241-5/+13
| | | | | | | | | | | | | | | | | | | | | Fix the reset sequence of reads and writes that we invoke from within the early trigger. It looks like there never was a SERDES_CONF_SOME_RST bit that should be involved in the reset sequence, and its presence in the driver code is a mistake from earlier. Instead, the reset sequence should go as follows: We should switch the the SERDES unit's SYNC_SEL mux to the value of 7 (so outside the range of 1...6 representing cluster's SYNCGEN units), then raise the RST bit in SERDES_STATUS and wait for it to clear. Properly resetting the SERDES unit fixes frame desynchronization hazard in case of long frames (longer than 4 used slots). The desynchronization manifests itself by rotating the PCM channels. Fixes: 3df5d0d97289 ("ASoC: apple: mca: Start new platform driver") Signed-off-by: Martin Povišer <povik+lin@cutebit.org> Link: https://lore.kernel.org/r/20230224153302.45365-2-povik+lin@cutebit.org Signed-off-by: Mark Brown <broonie@kernel.org>
* ASoC: apple: mca: Fix final status read on SERDES resetMartin Povišer2023-02-241-1/+1
| | | | | | | | | | | From within the early trigger we are doing a reset of the SERDES unit, but the final status read is on a bad address. Add the missing SERDES unit offset in calculation of the address. Fixes: 3df5d0d97289 ("ASoC: apple: mca: Start new platform driver") Signed-off-by: Martin Povišer <povik+lin@cutebit.org> Link: https://lore.kernel.org/r/20230224153302.45365-1-povik+lin@cutebit.org Signed-off-by: Mark Brown <broonie@kernel.org>
* ASoC: adau7118: don't disable regulators on device unbindNuno Sá2023-02-241-18/+1
| | | | | | | | | | | | The regulators are supposed to be controlled through the set_bias_level() component callback. Moreover, the regulators are not enabled during probe and so, this would lead to a regulator unbalanced use count. Fixes: ca514c0f12b02 ("ASOC: Add ADAU7118 8 Channel PDM-to-I2S/TDM Converter driver") Signed-off-by: Nuno Sá <nuno.sa@analog.com> Link: https://lore.kernel.org/r/20230224104551.1139981-1-nuno.sa@analog.com Signed-off-by: Mark Brown <broonie@kernel.org>
* ASoC: Intel: sof_rt5682: Add quirk for Rex board with mx98360a amplifierDharageswari.R2023-02-202-0/+35
| | | | | | | | | | | Add mtl_mx98360a_rt5682 driver data for Chrome Rex board support. Signed-off-by: Dharageswari.R <dharageswari.r@intel.com> Reviewed-by: Pierre-Louis Bossart <pierre-louis.bossart@linux.intel.com> Reviewed-by: Ranjani Sridharan <ranjani.sridharan@linux.intel.com> Signed-off-by: Peter Ujfalusi <peter.ujfalusi@linux.intel.com> Link: https://lore.kernel.org/r/20230220080652.23136-1-peter.ujfalusi@linux.intel.com Signed-off-by: Mark Brown <broonie@kernel.org>
* ASoC: mediatek: mt8188: correct etdm control return valueTrevor Wu2023-02-201-8/+0
| | | | | | | | | | | | | | | In mt8188_etdm_clk_src_sel_put() function, val retrieved by FIELD_PREP is shifted to the corresponding bit filed, so it can compare with the register value directly. Originally, the redundant bit shift of the register value results in the wrong comparison result, so we remove bit shift operation in the patch. Fixes: 2babb4777489 ("ASoC: mediatek: mt8188: support etdm in platform driver") Signed-off-by: Trevor Wu <trevor.wu@mediatek.com> Link: https://lore.kernel.org/r/20230215125017.16044-1-trevor.wu@mediatek.com Signed-off-by: Mark Brown <broonie@kernel.org>
* ASoC: SMA1303: Change the value for right outputKiseok Jo2023-02-201-1/+1
| | | | | | | | | This device can output mono, left or right. LR data should be swapped to output right data. Signed-off-by: Kiseok Jo <kiseok.jo@irondevice.com> Link: https://lore.kernel.org/r/20230217004403.10220-1-kiseok.jo@irondevice.com Signed-off-by: Mark Brown <broonie@kernel.org>
* ASoC: amd: yp: Add OMEN by HP Gaming Laptop 16z-n000 to quirksJoseph Hunkeler2023-02-161-0/+7
| | | | | | | | Enables display microphone on the HP OMEN 16z-n000 (8A42) laptop Signed-off-by: Joseph Hunkeler <jhunkeler@gmail.com> Link: https://lore.kernel.org/r/20230216155007.26143-1-jhunkeler@gmail.com Signed-off-by: Mark Brown <broonie@kernel.org>
* ASoC: rsnd: adg: Fix BRG typosGeert Uytterhoeven2023-02-161-32/+32
| | | | | | | | | | "BRG" stands for "Baud Rate Generator", but is frequently misspelled as "RBG". Signed-off-by: Geert Uytterhoeven <geert+renesas@glider.be> Acked-by: Kuninori Morimoto <kuninori.morimoto.gx@renesas.com> Link: https://lore.kernel.org/r/ac6365c17861d71fbc89d823089db4aafdb763ed.1676470202.git.geert+renesas@glider.be Signed-off-by: Mark Brown <broonie@kernel.org>
* ASoC: da7219: Improve the IRQ process to increase the stabilityDavid Rau2023-02-152-7/+38
| | | | | | | | | | | Remove the sleep control in IRQ thread and create an individual task to handel it for Jack plug in event. This commit improves the control of ground switches in the AAD IRQ. Signed-off-by: David Rau <David.Rau.opensource@dm.renesas.com> Link: https://lore.kernel.org/r/20230215101045.21456-1-David.Rau.opensource@dm.renesas.com Signed-off-by: Mark Brown <broonie@kernel.org>
* ASoC: soc-ac97: Return correct error codesAndy Shevchenko2023-02-151-2/+2
| | | | | | | | | | | | | | With the switching to dev_err_probe(), during the conversion of GPIO calls, the return code is passed is a paratemer to it. At the same time a copy'n'paste mistake was made, so the wrong variable has been taken for the error reporting. Fix this. Fixes: 3ee0d39c50dc ("ASoC: soc-ac97: Convert to agnostic GPIO API") Reported-by: kernel test robot <lkp@intel.com> Reported-by: Dan Carpenter <error27@gmail.com> Signed-off-by: Andy Shevchenko <andriy.shevchenko@linux.intel.com> Link: https://lore.kernel.org/r/20230215132343.35547-1-andriy.shevchenko@linux.intel.com Signed-off-by: Mark Brown <broonie@kernel.org>
* ASoC: cs35l45: Remove separate namespace for tablesCharles Keepax2023-02-154-7/+4
| | | | | | | | | Now tables isn't a separate module, definitely no need to have a separate namespace for it. Signed-off-by: Charles Keepax <ckeepax@opensource.cirrus.com> Link: https://lore.kernel.org/r/20230215105818.3315925-2-ckeepax@opensource.cirrus.com Signed-off-by: Mark Brown <broonie@kernel.org>
* ASoC: cs35l45: Remove separate tables moduleCharles Keepax2023-02-153-12/+1
| | | | | | | | | | | There is no reason to have a separate module for the tables file it just holds regmap callbacks and register patches used by the main part of the driver. Remove the separate module and merge it into the main driver module. Signed-off-by: Charles Keepax <ckeepax@opensource.cirrus.com> Link: https://lore.kernel.org/r/20230215105818.3315925-1-ckeepax@opensource.cirrus.com Signed-off-by: Mark Brown <broonie@kernel.org>
* ASoC: soc-ac97: Convert to agnostic GPIO APIAndy Shevchenko2023-02-141-46/+22
| | | | | | | | | The of_gpio.h is going to be removed. In preparation of that convert the driver to the agnostic API. Signed-off-by: Andy Shevchenko <andriy.shevchenko@linux.intel.com> Link: https://lore.kernel.org/r/20230213161713.1450-1-andriy.shevchenko@linux.intel.com Signed-off-by: Mark Brown <broonie@kernel.org>
* ASoC: SOF: Intel/ipc4: Support for low power playbackMark Brown2023-02-148-11/+113
|\ | | | | | | | | | | | | | | | | | | | | | | Merge series from Peter Ujfalusi <peter.ujfalusi@linux.intel.com>: The following series will enable the the Low Power Audio (LPA) playback on Intel platforms when using IPC4. The support is closely follows how IPC3 supports similar use case. All depending patches are upstream and our CI have been testing this feature for some time without issues.
| * ASoC: SOF: Intel: hda-dsp: Set streaming flag for d0i3Rander Wang2023-02-141-0/+31
| | | | | | | | | | | | | | | | | | | | | | | | | | Enable d0i3 streaming if all the active streams can work in d0i3 state and playback is enabled. Signed-off-by: Rander Wang <rander.wang@intel.com> Reviewed-by: Pierre-Louis Bossart <pierre-louis.bossart@linux.intel.com> Reviewed-by: Ranjani Sridharan <ranjani.sridharan@linux.intel.com> Reviewed-by: Péter Ujfalusi <peter.ujfalusi@linux.intel.com> Signed-off-by: Peter Ujfalusi <peter.ujfalusi@linux.intel.com> Link: https://lore.kernel.org/r/20230214103345.30669-6-peter.ujfalusi@linux.intel.com Signed-off-by: Mark Brown <broonie@kernel.org>
| * ASoC: SOF: Intel: Enable d0i3 work for ipc4Rander Wang2023-02-144-0/+34
| | | | | | | | | | | | | | | | | | | | | | | | Schedule a delayed work for d0i3 entry after every non-pm ipc msg. Signed-off-by: Rander Wang <rander.wang@intel.com> Reviewed-by: Pierre-Louis Bossart <pierre-louis.bossart@linux.intel.com> Reviewed-by: Ranjani Sridharan <ranjani.sridharan@linux.intel.com> Reviewed-by: Péter Ujfalusi <peter.ujfalusi@linux.intel.com> Signed-off-by: Peter Ujfalusi <peter.ujfalusi@linux.intel.com> Link: https://lore.kernel.org/r/20230214103345.30669-5-peter.ujfalusi@linux.intel.com Signed-off-by: Mark Brown <broonie@kernel.org>
| * ASoC: SOF: ipc4: Wake up dsp core before sending ipc msgRander Wang2023-02-141-0/+11
| | | | | | | | | | | | | | | | | | | | | | | | | | | | The driver shall update the power state to D0i0 before sending a generic IPC. Power-related IPCs are the exception to the rule, they may be sent even when the power-state is D0i3 Signed-off-by: Rander Wang <rander.wang@intel.com> Reviewed-by: Pierre-Louis Bossart <pierre-louis.bossart@linux.intel.com> Reviewed-by: Ranjani Sridharan <ranjani.sridharan@linux.intel.com> Reviewed-by: Péter Ujfalusi <peter.ujfalusi@linux.intel.com> Signed-off-by: Peter Ujfalusi <peter.ujfalusi@linux.intel.com> Link: https://lore.kernel.org/r/20230214103345.30669-4-peter.ujfalusi@linux.intel.com Signed-off-by: Mark Brown <broonie@kernel.org>
| * ASoC: SOF: Intel: hda-dsp: use set_pm_gate according to ipc versionRander Wang2023-02-141-11/+4
| | | | | | | | | | | | | | | | | | | | | | | | | | Use set_pm_gate to unify pm gate setting for different ipc version. Signed-off-by: Rander Wang <rander.wang@intel.com> Reviewed-by: Pierre-Louis Bossart <pierre-louis.bossart@linux.intel.com> Reviewed-by: Ranjani Sridharan <ranjani.sridharan@linux.intel.com> Reviewed-by: Péter Ujfalusi <peter.ujfalusi@linux.intel.com> Signed-off-by: Peter Ujfalusi <peter.ujfalusi@linux.intel.com> Link: https://lore.kernel.org/r/20230214103345.30669-3-peter.ujfalusi@linux.intel.com Signed-off-by: Mark Brown <broonie@kernel.org>
| * ASoC: SOF: Introduce a new set_pm_gate() IPC PM opRander Wang2023-02-143-0/+33
| | | | | | | | | | | | | | | | | | | | | | | | | | Set_pm_gate depends on ipc version. This patch defines the ops for both IPC3 and IPC4. Signed-off-by: Rander Wang <rander.wang@intel.com> Reviewed-by: Pierre-Louis Bossart <pierre-louis.bossart@linux.intel.com> Reviewed-by: Ranjani Sridharan <ranjani.sridharan@linux.intel.com> Reviewed-by: Péter Ujfalusi <peter.ujfalusi@linux.intel.com> Signed-off-by: Peter Ujfalusi <peter.ujfalusi@linux.intel.com> Link: https://lore.kernel.org/r/20230214103345.30669-2-peter.ujfalusi@linux.intel.com Signed-off-by: Mark Brown <broonie@kernel.org>
* | ASoC: codecs: wcd934x: Use min macro for comparison and assignmentDeepak R Varma2023-02-141-7/+3
| | | | | | | | | | | | | | | | | | | | | | Simplify code by using min helper macro for logical evaluation and value assignment. The change also facilitates code realignment for improved readability. Proposed change is identified using minmax.cocci Coccinelle script. Signed-off-by: Deepak R Varma <drv@mailo.com> Link: https://lore.kernel.org/r/Y+p2Hn0nrtHiKwPR@ubun2204.myguest.virtualbox.org Signed-off-by: Mark Brown <broonie@kernel.org>
* | ASoC: Intel: Skylake: Fix struct definitionAmadeusz Sławiński2023-02-142-2/+5
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | The kernel is globally removing the ambiguous 0-length and 1-element arrays in favor of flexible arrays, so that we can gain both compile-time and run-time array bounds checking[1]. In this instance, struct skl_cpr_cfg contains struct skl_cpr_gtw_cfg, which defined "config_data" as a 1-element array. However, case present in sound/soc/intel/skylake/skl-topology.h is not a simple one as the structure takes part in IPC communication. Apparently original definition missed one field, which while not used by AudioDSP firmware when there is no additional data, is still expected to be part of an IPC message. Currently this works because of how 'config_data' is declared: 'config_data[1]'. Now when one replaces it with a flexible array there would be one field missing. Update struct declaration to fix this. Reported-by: Sasa Ostrouska <casaxa@gmail.com> Link: https://lore.kernel.org/all/CALFERdwvq5day_sbDfiUsMSZCQu9HG8-SBpOZDNPeMdZGog6XA@mail.gmail.com/ Cc: Pierre-Louis Bossart <pierre-louis.bossart@linux.intel.com> Cc: Liam Girdwood <liam.r.girdwood@linux.intel.com> Cc: Peter Ujfalusi <peter.ujfalusi@linux.intel.com> Cc: Bard Liao <yung-chuan.liao@linux.intel.com> Cc: Ranjani Sridharan <ranjani.sridharan@linux.intel.com> Cc: Kai Vehmanen <kai.vehmanen@linux.intel.com> Cc: Mark Brown <broonie@kernel.org> Cc: Jaroslav Kysela <perex@perex.cz> Cc: Takashi Iwai <tiwai@suse.com> Cc: "Gustavo A. R. Silva" <gustavoars@kernel.org> Cc: alsa-devel@alsa-project.org CC: Kees Cook <keescook@chromium.org> Reviewed-by: Cezary Rojewski <cezary.rojewski@intel.com> Signed-off-by: Amadeusz Sławiński <amadeuszx.slawinski@linux.intel.com> Link: https://lore.kernel.org/r/20230213205223.2679357-1-amadeuszx.slawinski@linux.intel.com Signed-off-by: Mark Brown <broonie@kernel.org>
* | ASoC: tlv320adcx140: extend list of supported sampleratesSteffen Aschbacher2023-02-141-1/+3
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | The 'tlv320adcx140' driver currently supports 3 devices: TLV320ADC3140, TLV320ADC5140 and TLV320ADC6140. All 3 devices, support higher samplerates, up to 768-kHz according to their datasheets. In our applications, we only tested (and worked) with 96 kHz and 192 kHz. This change extends the list of supported sample-rates for these devices with 96 & 192 kHz. References: https://www.ti.com/product/TLV320ADC3140 https://www.ti.com/product/TLV320ADC5140 https://www.ti.com/product/TLV320ADC6140 Signed-off-by: Steffen Aschbacher <steffen.aschbacher@stihl.de> Signed-off-by: Alexandru Ardelean <alex@shruggie.ro> Link: https://lore.kernel.org/r/20230214091051.16323-1-alex@shruggie.ro Signed-off-by: Mark Brown <broonie@kernel.org>
* | ASoC: imx-pcm-rpmsg: Remove unused variableDeepak R Varma2023-02-141-4/+2
| | | | | | | | | | | | | | | | | | | | | | Variable ret is initialed but is never modified or used except for returning the initial value 0. The value can be directly returned instead and the variable definition can be dropped. Issue identified using returnvar.cocci Coccinelle semantic patch. Signed-off-by: Deepak R Varma <drv@mailo.com> Link: https://lore.kernel.org/r/Y+p9r5y9DPSJkPVf@ubun2204.myguest.virtualbox.org Signed-off-by: Mark Brown <broonie@kernel.org>
* | SoC: rt5682s: Disable jack detection interrupt during suspendMatthias Kaehlcke2023-02-142-1/+10
|/ | | | | | | | | | | | | | | | | | | | The rt5682s driver switches its regmap to cache-only when the device suspends and back to regular mode on resume. When the jack detect interrupt fires rt5682s_irq() schedules the jack detect work. This can result in invalid reads from the regmap in cache-only mode if the work runs before the device has resumed: [ 19.672162] rt5682s 2-001a: ASoC: error at soc_component_read_no_lock on rt5682s.2-001a for register: [0x000000f0] -16 Disable the jack detection interrupt during suspend and re-enable it on resume. The driver already schedules the jack detection work on resume, so any state change during suspend is still handled. Signed-off-by: Matthias Kaehlcke <mka@chromium.org> Link: https://lore.kernel.org/r/20230209012002.1.Ib4d6481f1d38a6e7b8c9e04913c02ca88c216cf6@changeid Signed-off-by: Mark Brown <broonie@kernel.org>
* ASoC: codecs: Remove unneeded semicolonYang Li2023-02-131-2/+2
| | | | | | | | | | | | ./sound/soc/codecs/peb2466.c:1851:2-3: Unneeded semicolon ./sound/soc/codecs/peb2466.c:1887:2-3: Unneeded semicolon Reported-by: Abaci Robot <abaci@linux.alibaba.com> Link: https://bugzilla.openanolis.cn/show_bug.cgi?id=4045 Signed-off-by: Yang Li <yang.lee@linux.alibaba.com> Acked-by: Herve Codina <herve.codina@bootlin.com> Link: https://lore.kernel.org/r/20230213010547.105312-1-yang.lee@linux.alibaba.com Signed-off-by: Mark Brown <broonie@kernel.org>
* ASoC: tlv320adcx140: fix 'ti,gpio-config' DT property initSteffen Aschbacher2023-02-131-1/+1
| | | | | | | | | | | | | | | | | | | | | | | When the 'ti,gpio-config' property is not defined, the device_property_count_u32() will return an error, rather than zero. The current check, only handles a return value of zero, which assumes that the property is defined and has nothing defined. This change extends the check to also check for an error case (most likely to be hit by the case that the 'ti,gpio-config' is not defined). In case that the 'ti,gpio-config' and the returned 'gpio_count' is not correct, there is a 'if (gpio_count != ADCX140_NUM_GPIO_CFGS)' check, a few lines lower that will return -EINVAL. This means that someone tried to define 'ti,gpio-config', but with the wrong number of GPIOs. Fixes: d5214321498a ("ASoC: tlv320adcx140: Add support for configuring GPIO pin") Signed-off-by: Steffen Aschbacher <steffen.aschbacher@stihl.de> Signed-off-by: Alexandru Ardelean <alex@shruggie.ro> Link: https://lore.kernel.org/r/20230213073805.14640-1-alex@shruggie.ro Signed-off-by: Mark Brown <broonie@kernel.org>
* ASoC: codecs: Modify error implicit declaration of function ↵Weidong Wang2023-02-131-0/+1
| | | | | | | | | | | 'gpiod_set_value_cansleep' Add select GPIOLIB to the sound/soc/codecs/Kconfig file Signed-off-by: Ben Yi <yijiangtao@awinic.com> Signed-off-by: Weidong Wang <wangweidong.a@awinic.com> Link: https://lore.kernel.org/r/20230213093649.22928-4-wangweidong.a@awinic.com Signed-off-by: Mark Brown <broonie@kernel.org>
* ASoC: codecs: Modify the log print statementWeidong Wang2023-02-131-1/+1
| | | | | | | | | Change hdrlen to hdr_len Signed-off-by: Ben Yi <yijiangtao@awinic.com> Signed-off-by: Weidong Wang <wangweidong.a@awinic.com> Link: https://lore.kernel.org/r/20230213093649.22928-3-wangweidong.a@awinic.com Signed-off-by: Mark Brown <broonie@kernel.org>
* ASoC: codecs: Fixed a spelling error in the function nameWeidong Wang2023-02-131-2/+2
| | | | | | | | | Change the function name aw88395_plack_event to aw88395_playback_event Signed-off-by: Ben Yi <yijiangtao@awinic.com> Signed-off-by: Weidong Wang <wangweidong.a@awinic.com> Link: https://lore.kernel.org/r/20230213093649.22928-2-wangweidong.a@awinic.com Signed-off-by: Mark Brown <broonie@kernel.org>
* ASoC: ep93xx: ignore 0 Hz sysclkAlexander Sverdlin2023-02-131-0/+2
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Commit 2458adb8f92a ("SoC: simple-card-utils: set 0Hz to sysclk when shutdown") added a call to snd_soc_dai_set_sysclk() with 0 Hz frequency. Being propagated further it causes a division by zero in clk-ep93xx driver: Division by zero in kernel. CPU: 0 PID: 52 Comm: aplay Tainted: G W 6.2.0-rc4-... #1 Hardware name: Generic DT based system unwind_backtrace from show_stack+0x10/0x18 show_stack from dump_stack_lvl+0x28/0x34 dump_stack_lvl from __div0+0x10/0x1c __div0 from Ldiv0+0x8/0x1c Ldiv0 from ep93xx_mux_determine_rate+0x78/0x1d0 ep93xx_mux_determine_rate from clk_core_round_rate_nolock+0x48/0xc8 clk_core_round_rate_nolock from clk_core_set_rate_nolock+0x48/0x160 clk_core_set_rate_nolock from clk_set_rate+0x30/0x8c clk_set_rate from ep93xx_i2s_set_sysclk+0x30/0x6c ep93xx_i2s_set_sysclk from snd_soc_dai_set_sysclk+0x3c/0xa4 snd_soc_dai_set_sysclk from asoc_simple_shutdown+0xb8/0x164 asoc_simple_shutdown from snd_soc_link_shutdown+0x44/0x54 snd_soc_link_shutdown from soc_pcm_clean+0x78/0x180 soc_pcm_clean from soc_pcm_close+0x28/0x40 soc_pcm_close from snd_pcm_release_substream.part.0+0x3c/0x84 snd_pcm_release_substream.part.0 from snd_pcm_release+0x40/0x88 snd_pcm_release from __fput+0x74/0x278 There has been commit f1879d7b98dc ("ASoC: rockchip: ignore 0Hz sysclk"), but it prepared by far not all drivers. Signed-off-by: Alexander Sverdlin <alexander.sverdlin@gmail.com> Link: https://lore.kernel.org/r/20230212220923.258414-1-alexander.sverdlin@gmail.com Signed-off-by: Mark Brown <broonie@kernel.org>
* ASoC: rt712-sdca: fix coding style and unconditionally return issuesShuming Fan2023-02-101-5/+17
| | | | | | | | | | This patch fixes 1. coding style issues 2. check if the setting was set already in rt712_sdca_mux_put callback Signed-off-by: Shuming Fan <shumingf@realtek.com> Link: https://lore.kernel.org/r/20230210082141.24077-1-shumingf@realtek.com Signed-off-by: Mark Brown <broonie@kernel.org>
* ASoC: rsnd: core.c: indicate warning if strange TDM width was setKuninori Morimoto2023-02-101-0/+7
| | | | | | | | | | Current rsnd silently uses default TDM width if it was strange settings. It is difficult to notice about it. This patch indicates warning for it. Signed-off-by: Kuninori Morimoto <kuninori.morimoto.gx@renesas.com> Link: https://lore.kernel.org/r/87lel6ksqn.wl-kuninori.morimoto.gx@renesas.com Signed-off-by: Mark Brown <broonie@kernel.org>
* ASoC: qcom: q6dsp and lpass codec stablity fixesMark Brown2023-02-097-69/+101
|\ | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Merge series from Srinivas Kandagatla <srinivas.kandagatla@linaro.org> From q6dsp side issues are around locking of position pointer and handle From LPASS codec side most of the staiblity issues were around runtime pm,: While testing X13s audio, we found multiple stablity issues this patchset fixes these issues. From q6dsp side issues are around locking of position pointer and handle multiple prepare cases along with pulse audio timerbased scheduling workaround. From LPASS codec side most of the staiblity issues were around runtime pm, hitting various issues as the codec was firstly resetting the soundwire block for every clk disable/enable which is taking the slaves out of sync and resulting in re-enumerating. Second issue was around fsgen clk is not brining up the codec out of suspend as it was not added after runtime pm enabled. Final issue was with codec mclk rate which should have been 192KHz same as npl instead of 96KHz. We were getting lucky as wsa drivers are setting the same clk to 192KHz. With this patches, x13s audio is pretty stable.
| * ASoC: codecs: lpass: remove not so useful verbose logSrinivas Kandagatla2023-02-092-6/+2
| | | | | | | | | | | | Signed-off-by: Srinivas Kandagatla <srinivas.kandagatla@linaro.org> Link: https://lore.kernel.org/r/20230209122806.18923-9-srinivas.kandagatla@linaro.org Signed-off-by: Mark Brown <broonie@kernel.org>
| * ASoC: codecs: lpass: do not reset soundwire block on clk enableSrinivas Kandagatla2023-02-094-29/+44
| | | | | | | | | | | | | | | | | | | | resetting soundwire block will put the slaves out of sync and result in re-enumeration during fsgen disable/enable path this is totally unnecessary and resulting fifo overflows. Signed-off-by: Srinivas Kandagatla <srinivas.kandagatla@linaro.org> Link: https://lore.kernel.org/r/20230209122806.18923-8-srinivas.kandagatla@linaro.org Signed-off-by: Mark Brown <broonie@kernel.org>
| * ASoC: codecs: lpass: fix incorrect mclk rateSrinivas Kandagatla2023-02-092-4/+4
| | | | | | | | | | | | | | | | | | | | | | | | | | | | For some reason we ended up with incorrect mclk rate which should be 1920000 instead of 96000, So far we were getting lucky as the same clk is set to 192000 by wsa and va macro. This issue is discovered when there is no wsa macro active and only rx or tx path is tested. Fix this by setting correct rate. Fixes: c39667ddcfc5 ("ASoC: codecs: lpass-tx-macro: add support for lpass tx macro") Fixes: af3d54b99764 ("ASoC: codecs: lpass-rx-macro: add support for lpass rx macro") Signed-off-by: Srinivas Kandagatla <srinivas.kandagatla@linaro.org> Link: https://lore.kernel.org/r/20230209122806.18923-7-srinivas.kandagatla@linaro.org Signed-off-by: Mark Brown <broonie@kernel.org>
| * ASoC: codecs: lpass: register mclk after runtime pmSrinivas Kandagatla2023-02-094-23/+22
| | | | | | | | | | | | | | | | | | | | | | | | | | move mclk out registration after runtime pm is enabled so that the clk framework can resume the codec if it requires to enable the mclk out. Fixes: c96baa2949b2 ("ASoC: codecs: wsa-macro: add runtime pm support") Fixes: 72ad25eabda0 ("ASoC: codecs: va-macro: add runtime pm support") Fixes: 366ff79ed539 ("ASoC: codecs: rx-macro: add runtime pm support") Fixes: 1fb83bc5cf64 ("ASoC: codecs: tx-macro: add runtime pm support") Signed-off-by: Srinivas Kandagatla <srinivas.kandagatla@linaro.org> Link: https://lore.kernel.org/r/20230209122806.18923-6-srinivas.kandagatla@linaro.org Signed-off-by: Mark Brown <broonie@kernel.org>
| * ASoC: qcom: audioreach: fix ADSP ready checkSrinivas Kandagatla2023-02-091-8/+9
| | | | | | | | | | | | | | | | | | | | | | | | | | | | currently q6apm_is_adsp_ready() will only return the cached value of previous result. If we are unlucky and previous result is not-ready then the caller will always get not-ready flag. This is not correct, we should query the dsp of its current state in irrespective of previous reported state. Fixes: 47bc8cf60e92 ("ASoC: qdsp6: audioreach: Add ADSP ready check") Signed-off-by: Srinivas Kandagatla <srinivas.kandagatla@linaro.org> Link: https://lore.kernel.org/r/20230209122806.18923-5-srinivas.kandagatla@linaro.org Signed-off-by: Mark Brown <broonie@kernel.org>
| * ASoC: qcom: q6apm-dai: Add SNDRV_PCM_INFO_BATCH flagSrinivas Kandagatla2023-02-091-2/+4
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | At the moment, playing audio with PulseAudio with the qdsp6 driver results in distorted sound. It seems like its timer-based scheduling does not work properly with qdsp6 since setting tsched=0 in the PulseAudio configuration avoids the issue. Apparently this happens when the pointer() callback is not accurate enough. There is a SNDRV_PCM_INFO_BATCH flag that can be used to stop PulseAudio from using timer-based scheduling by default. According to https://www.alsa-project.org/pipermail/alsa-devel/2014-March/073816.html: The flag is being used in the sense explained in the previous audio meeting -- the data transfer granularity isn't fine enough but aligned to the period size (or less). q6apm-dai reports the position as multiple of prtd->pcm_count = snd_pcm_lib_period_bytes(substream) so it indeed just a multiple of the period size. Therefore adding the flag here seems appropriate and makes audio work out of the box. Comment log inspired by Stephan Gerhold sent for q6asm-dai.c few years back. Fixes: 9b4fe0f1cd79 ("ASoC: qdsp6: audioreach: add q6apm-dai support") Signed-off-by: Srinivas Kandagatla <srinivas.kandagatla@linaro.org> Link: https://lore.kernel.org/r/20230209122806.18923-4-srinivas.kandagatla@linaro.org Signed-off-by: Mark Brown <broonie@kernel.org>
| * ASoC: qcom: q6apm-dai: fix race condition while updating the position pointerSrinivas Kandagatla2023-02-091-1/+15
| | | | | | | | | | | | | | | | | | | | | | | | It is noticed that the position pointer value seems to get a get corrupted due to missing locking between updating and reading. Fix this by adding a spinlock around the position pointer. Fixes: 9b4fe0f1cd79 ("ASoC: qdsp6: audioreach: add q6apm-dai support") Signed-off-by: Srinivas Kandagatla <srinivas.kandagatla@linaro.org> Link: https://lore.kernel.org/r/20230209122806.18923-3-srinivas.kandagatla@linaro.org Signed-off-by: Mark Brown <broonie@kernel.org>
| * ASoC: qcom: q6apm-lpass-dai: unprepare stream if its already preparedSrinivas Kandagatla2023-02-091-0/+5
| | | | | | | | | | | | | | | | | | | | | | | | | | prepare callback can be called multiple times, so unprepare the stream if its already prepared. Without this DSP is not happy to setting the params on a already prepared graph. Fixes: 9b4fe0f1cd79 ("ASoC: qdsp6: audioreach: add q6apm-dai support") Signed-off-by: Srinivas Kandagatla <srinivas.kandagatla@linaro.org> Link: https://lore.kernel.org/r/20230209122806.18923-2-srinivas.kandagatla@linaro.org Signed-off-by: Mark Brown <broonie@kernel.org>
* | ASoC: SOF: ipc4-topology: Configure copier sink formatMark Brown2023-02-093-9/+119
|\ \ | | | | | | | | | | | | | | | | | | | | | Merge series from Peter Ujfalusi <peter.ujfalusi@linux.intel.com>: In a course of creating complicated topologies where multiple output pins of a copier is enabled, we have discovered that additional configuration needs to be sent to the firmware to make the use cases working.
| * | ASoC: SOF: ipc4-topology: set copier sink formatBard Liao2023-02-093-5/+113
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | MOD_INIT_INSTANCE IPC for a copier only contains the sink format for output pin 0. Any additional output pins that are used need to have their sink format set using the LARGE_CONFIG_SET IPC message. Otherwise, firmware will report error or crash due to NULL format is used. Signed-off-by: Bard Liao <yung-chuan.liao@linux.intel.com> Reviewed-by: Ranjani Sridharan <ranjani.sridharan@linux.intel.com> Reviewed-by: Pierre-Louis Bossart <pierre-louis.bossart@linux.intel.com> Reviewed-by: Rander Wang <rander.wang@intel.com> Signed-off-by: Peter Ujfalusi <peter.ujfalusi@linux.intel.com> Link: https://lore.kernel.org/r/20230209142123.17193-3-peter.ujfalusi@linux.intel.com Signed-off-by: Mark Brown <broonie@kernel.org>
| * | ASoC: SOF: ipc4-topology: Print queue IDs in errorRanjani Sridharan2023-02-091-4/+6
| |/ | | | | | | | | | | | | | | | | | | | | | | Print the queue ID's during bind/unbind errors as well to make it easier to see what failed exactly. Signed-off-by: Ranjani Sridharan <ranjani.sridharan@linux.intel.com> Reviewed-by: Péter Ujfalusi <peter.ujfalusi@linux.intel.com> Reviewed-by: Pierre-Louis Bossart <pierre-louis.bossart@linux.intel.com> Signed-off-by: Peter Ujfalusi <peter.ujfalusi@linux.intel.com> Link: https://lore.kernel.org/r/20230209142123.17193-2-peter.ujfalusi@linux.intel.com Signed-off-by: Mark Brown <broonie@kernel.org>
* | Add the Infineon PEB2466 codec supportMark Brown2023-02-093-0/+2085
|\ \ | | | | | | | | | | | | | | | | | | | | | Merge series from Herve Codina <herve.codina@bootlin.com>: The Infineon PEB2466 codec is a programmable DSP-based four channels codec with filters capabilities. It also provides signals as GPIOs.
| * | ASoC: codecs: Add support for the Infineon PEB2466 codecHerve Codina2023-02-093-0/+2085
| |/ | | | | | | | | | | | | | | | | | | The Infineon PEB2466 codec is a programmable DSP-based four channels codec with filters capabilities. It also provides signals as GPIOs. Signed-off-by: Herve Codina <herve.codina@bootlin.com> Link: https://lore.kernel.org/r/20230206144904.91078-3-herve.codina@bootlin.com Signed-off-by: Mark Brown <broonie@kernel.org>
* | ASoC: rt712-sdca: Add RT712 SDCA driver for Jack and Amp topologyShuming Fan2023-02-096-0/+2150
| | | | | | | | | | | | | | | | | | This is the initial codec driver for rt712 SDCA (Jack+Amp topology). The host should connect with rt712 SdW1 interface. Signed-off-by: Shuming Fan <shumingf@realtek.com> Link: https://lore.kernel.org/r/20230207090946.20659-1-shumingf@realtek.com Signed-off-by: Mark Brown <broonie@kernel.org>
* | ASoC: rt5640: Update MCLK rate in set_sysclk()Sameer Pujar2023-02-091-0/+5
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Simple-card/audio-graph-card drivers do not handle MCLK clock when it is specified in the codec device node. The expectation here is that, the codec should actually own up the MCLK clock and do necessary setup in the driver. This is inspired from, commit dbf54a953435 ("ASoC: rt5659: Update MCLK rate in set_sysclk()"). Cc: Oder Chiou <oder_chiou@realtek.com> Signed-off-by: Sameer Pujar <spujar@nvidia.com> Link: https://lore.kernel.org/r/1675953417-8686-2-git-send-email-spujar@nvidia.com Signed-off-by: Mark Brown <broonie@kernel.org>
* | ASoC: SMA1303: Remove the sysclk setting in devicetreeKiseok Jo2023-02-091-35/+2
| | | | | | | | | | | | | | | | | | In SMA1303, this device does not support MCLK. So it need to remove sysclk setting in devicetree. Signed-off-by: Kiseok Jo <kiseok.jo@irondevice.com> Link: https://lore.kernel.org/r/20230209084903.13000-2-kiseok.jo@irondevice.com Signed-off-by: Mark Brown <broonie@kernel.org>