- 03 Feb, 2023 1 commit
-
-
Trevor Wu authored
Some Smatch static checker warning like below was found. sound/soc/mediatek/mt8188/mt8188-dai-etdm.c:2487 mt8188_dai_etdm_parse_of() warn: 'ret' returned from snprintf() might be larger than 48 2479 for (i = 0; i < MT8188_AFE_IO_ETDM_NUM; i++) { 2480 dai_id = ETDM_TO_DAI_ID(i); 2481 etdm_data = afe_priv->dai_priv[dai_id]; 2482 2483 ret = snprintf(prop, sizeof(prop), 2484 "mediatek,%s-multi-pin-mode", 2485 of_afe_etdms[i].name); 2486 if (ret < 0) { --> 2487 dev_err(afe->dev, "%s snprintf err=%d\n", 2488 In linux kernel, snprintf() never returns negatives. On the other hand, the format string like "mediatek,%s-multi-pin-mode" must be smaller than sizeof(prop)=48. After discussing in the mail thread[1], I remove the dead code to fix the Smatch warnings. [1]: https://lore.kernel.org/all/Y9EdBg641tJDDrt%2F@kili/Signed-off-by: Trevor Wu <trevor.wu@mediatek.com> Link: https://lore.kernel.org/r/20230202103704.15626-1-trevor.wu@mediatek.comSigned-off-by: Mark Brown <broonie@kernel.org>
-
- 02 Feb, 2023 9 commits
-
-
Nathan Chancellor authored
Clang warns: ../sound/soc/atmel/mchp-spdifrx.c:455:3: error: variable 'mr' is uninitialized when used here [-Werror,-Wuninitialized] mr |= SPDIFRX_MR_ENDIAN_BIG; ^~ ../sound/soc/atmel/mchp-spdifrx.c:432:8: note: initialize the variable 'mr' to silence this warning u32 mr; ^ = 0 1 error generated. Zero initialize mr so that these bitwise OR and assignment operation works unconditionally. Fixes: fa09fa60 ("ASoC: mchp-spdifrx: fix controls which rely on rsr register") Link: https://github.com/ClangBuiltLinux/linux/issues/1797Signed-off-by: Nathan Chancellor <nathan@kernel.org> Reviewed-by: Claudiu Beznea <claudiu.beznea@microchip.com> Link: https://lore.kernel.org/r/20230202-mchp-spdifrx-fix-uninit-mr-v1-1-629a045d7a2f@kernel.orgSigned-off-by: Mark Brown <broonie@kernel.org>
-
Mark Brown authored
Merge series from Mario Limonciello <mario.limonciello@amd.com>: It's been reported that a number of laptops have a low volume level from the digital microphone compared to Windows. AMD offers a register that can adjust the gain for PDM which is not configured at maximum gain by default. To fix this change the default for all 3 drivers to raise the gain but also offer a module parameter. The module parameter can be used for debugging if the gain is too high on a given laptop. This is intentionally split into multiple patches for default and parameter so that if the default really does behave better universally we can bring it back to stable too later.
-
Colin Ian King authored
There are spelling mistakes in dev_err messages. Fix them. Signed-off-by: Colin Ian King <colin.i.king@gmail.com> Link: https://lore.kernel.org/r/20230202103236.270057-1-colin.i.king@gmail.comSigned-off-by: Mark Brown <broonie@kernel.org>
-
Mario Limonciello authored
In case of regressions for any users that the new pdm_gain value is too high and for additional debugging, introduce a module parameter that would let them configure it. This parameter should be removed in the future: * If it's determined that the parameter is not needed, just hardcode the correct value as before * If users do end up using it to debug and report different values we should introduce a config knob that can have policy set by ucm. Signed-off-by: Mario Limonciello <mario.limonciello@amd.com> Reviewed-by: Jaroslav Kysela <perex@perex.cz> Link: https://lore.kernel.org/r/20230131184653.10216-7-mario.limonciello@amd.comSigned-off-by: Mark Brown <broonie@kernel.org>
-
Mario Limonciello authored
No issues have been reported yet for DMIC audio level on ps platforms, but as problems were found both on YC (Rembrandt) and Renoir based designs it's very likely they happen on ps too. Increase the PDM gain to solve this problem. Signed-off-by: Mario Limonciello <mario.limonciello@amd.com> Reviewed-by: Jaroslav Kysela <perex@perex.cz> Link: https://lore.kernel.org/r/20230131184653.10216-6-mario.limonciello@amd.comSigned-off-by: Mark Brown <broonie@kernel.org>
-
Mario Limonciello authored
In case of regressions for any users that the new pdm_gain value is too high and for additional debugging, introduce a module parameter that would let them configure it. This parameter should be removed in the future: * If it's determined that the parameter is not needed, just hardcode the correct value as before * If users do end up using it to debug and report different values we should introduce a config knob that can have policy set by ucm. Signed-off-by: Mario Limonciello <mario.limonciello@amd.com> Reviewed-by: Jaroslav Kysela <perex@perex.cz> Link: https://lore.kernel.org/r/20230131184653.10216-5-mario.limonciello@amd.comSigned-off-by: Mark Brown <broonie@kernel.org>
-
Mario Limonciello authored
A similar issue that was reported on Rembrandt based laptops with low DMIC volume is also being reported for Barcelo based laptops that use renoir acp3x. Increase the PDM gain to overcome this problem. Signed-off-by: Mario Limonciello <mario.limonciello@amd.com> Reviewed-by: Jaroslav Kysela <perex@perex.cz> Link: https://lore.kernel.org/r/20230131184653.10216-4-mario.limonciello@amd.comSigned-off-by: Mark Brown <broonie@kernel.org>
-
Mario Limonciello authored
In case of regressions for any users that the new pdm_gain value is too high and for additional debugging, introduce a module parameter that would let them configure it. This parameter should be removed in the future: * If it's determined that the parameter is not needed, just hardcode the correct value as before * If users do end up using it to debug and report different values we should introduce a config knob that can have policy set by ucm. Signed-off-by: Mario Limonciello <mario.limonciello@amd.com> Reviewed-by: Jaroslav Kysela <perex@perex.cz> Link: https://lore.kernel.org/r/20230131184653.10216-3-mario.limonciello@amd.comSigned-off-by: Mark Brown <broonie@kernel.org>
-
Mario Limonciello authored
A number of users for Lenovo Rembrandt based laptops are reporting that the microphone is too quiet relative to Windows with a dual boot. Increase the PDM gain to overcome this problem. Signed-off-by: Mario Limonciello <mario.limonciello@amd.com> Reviewed-by: Jaroslav Kysela <perex@perex.cz> Link: https://lore.kernel.org/r/20230131184653.10216-2-mario.limonciello@amd.comSigned-off-by: Mark Brown <broonie@kernel.org>
-
- 01 Feb, 2023 18 commits
-
-
Christophe Branchereau authored
Both the DAC and ADC have digital gain controls available for their mixers, which go from -31 to 0db by step of 1db. Signed-off-by: Christophe Branchereau <cbranchereau@gmail.com> Link: https://lore.kernel.org/r/20230122210703.2552384-1-cbranchereau@gmail.comSigned-off-by: Mark Brown <broonie@kernel.org>
-
Kuninori Morimoto authored
This patch is tested on V4H White Hawk + ARD-AUDIO-DA7212 Signed-off-by: Linh Phung <linh.phung.jy@renesas.com> Signed-off-by: Kuninori Morimoto <kuninori.morimoto.gx@renesas.com> Link: https://lore.kernel.org/r/87o7qe5ej5.wl-kuninori.morimoto.gx@renesas.comSigned-off-by: Mark Brown <broonie@kernel.org>
-
Kuninori Morimoto authored
Document R-Car V4H (R8A779G0), and R-Car Gen4 SoC bindings. Link: https://lore.kernel.org/r/87zga6t5r4.wl-kuninori.morimoto.gx@renesas.comSigned-off-by: Kuninori Morimoto <kuninori.morimoto.gx@renesas.com> Link: https://lore.kernel.org/r/87pmau5ejk.wl-kuninori.morimoto.gx@renesas.comSigned-off-by: Mark Brown <broonie@kernel.org>
-
Kuninori Morimoto authored
This patch tidyups rsnd_dma_probe(), but there is no effect. This is prepare for Gen4 support. Signed-off-by: Kuninori Morimoto <kuninori.morimoto.gx@renesas.com> Link: https://lore.kernel.org/r/87r0va5elq.wl-kuninori.morimoto.gx@renesas.comSigned-off-by: Mark Brown <broonie@kernel.org>
-
Kuninori Morimoto authored
This patch tidyups rsnd_dma_addr(), but there is no effect. This is prepare for Gen4 support. Signed-off-by: Kuninori Morimoto <kuninori.morimoto.gx@renesas.com> Link: https://lore.kernel.org/r/87sffq5elx.wl-kuninori.morimoto.gx@renesas.comSigned-off-by: Mark Brown <broonie@kernel.org>
-
Kuninori Morimoto authored
ADG need to know output rate of 44.1kHz/48kHz. It is using single variable for each, but this patch changes it to array. Nothing is changed by this patch. This is prepare for R-Car Gen4 support. Signed-off-by: Kuninori Morimoto <kuninori.morimoto.gx@renesas.com> Link: https://lore.kernel.org/r/87tu065em3.wl-kuninori.morimoto.gx@renesas.comSigned-off-by: Mark Brown <broonie@kernel.org>
-
Kuninori Morimoto authored
Current adg.c is assuming number of clkin/clkout are fixed, but it is not correct on Gen4. This patch uses clkin/out_size to handling it. This is prepare for R-Car Gen4 support. Signed-off-by: Kuninori Morimoto <kuninori.morimoto.gx@renesas.com> Link: https://lore.kernel.org/r/87v8km5em7.wl-kuninori.morimoto.gx@renesas.comSigned-off-by: Mark Brown <broonie@kernel.org>
-
Kuninori Morimoto authored
This patch moves clkout_name to top of the file to handling both clkin/clkout in the same place. This is prepare for R-Car Gen4 support. Signed-off-by: Kuninori Morimoto <kuninori.morimoto.gx@renesas.com> Link: https://lore.kernel.org/r/87wn525emc.wl-kuninori.morimoto.gx@renesas.comSigned-off-by: Mark Brown <broonie@kernel.org>
-
Kuninori Morimoto authored
Current adg.c is usig "clk" as clock IN, but is using "clkout" for clock OUT. This patch arranges "clk" to "clkin". This is prepare for R-Car Gen4 support. Signed-off-by: Kuninori Morimoto <kuninori.morimoto.gx@renesas.com> Link: https://lore.kernel.org/r/87y1pi5emh.wl-kuninori.morimoto.gx@renesas.comSigned-off-by: Mark Brown <broonie@kernel.org>
-
Kuninori Morimoto authored
The flag LRCLK_ASYNC / AUDIO_OUT_48 had been added to handling special case of Salvator-X board, but it is not used on upstream. It makes code complex today, let's remove these. Signed-off-by: Kuninori Morimoto <kuninori.morimoto.gx@renesas.com> Link: https://lore.kernel.org/r/87zg9y5emm.wl-kuninori.morimoto.gx@renesas.comSigned-off-by: Mark Brown <broonie@kernel.org>
-
Kuninori Morimoto authored
This patch follows clkin debug message style on clkout. Signed-off-by: Kuninori Morimoto <kuninori.morimoto.gx@renesas.com> Link: https://lore.kernel.org/r/871qna6t77.wl-kuninori.morimoto.gx@renesas.comSigned-off-by: Mark Brown <broonie@kernel.org>
-
Kuninori Morimoto authored
Some SoC can't handle all requested hw rule. In such case, it will indicate like below, but it is unclear why it didn't work to user. This patch indicates warning in such case once, because player will try to similar rule many times. # aplay sound.wav Playing WAVE 'sound.wav' : Signed 16 bit Little Endian, Rate 48000 Hz, Stereo aplay: aplay.c: 1359: set_params: Assertion `err >= 0' failed. Aborted by signal Aborted... Signed-off-by: Kuninori Morimoto <kuninori.morimoto.gx@renesas.com> Link: https://lore.kernel.org/r/87357q6t7b.wl-kuninori.morimoto.gx@renesas.comSigned-off-by: Mark Brown <broonie@kernel.org>
-
Kuninori Morimoto authored
rsnd_ssi_master_clk_start() indicates error message if it couldn't handle requested clock/rate, but it is not caring all cases. This patch cares it. Signed-off-by: Kuninori Morimoto <kuninori.morimoto.gx@renesas.com> Link: https://lore.kernel.org/r/874js66t7g.wl-kuninori.morimoto.gx@renesas.comSigned-off-by: Mark Brown <broonie@kernel.org>
-
Kuninori Morimoto authored
commit b43b8ae8 ("ASoC: rsnd: protect mod->status") removed RSND_DEBUG_NO_DAI_CALL and rsnd_dbg_dai_call(), but these are still exist on rsnd.h. This patch removes it. Fixes: b43b8ae8 ("ASoC: rsnd: protect mod->status") Signed-off-by: Kuninori Morimoto <kuninori.morimoto.gx@renesas.com> Link: https://lore.kernel.org/r/875ycm6t7l.wl-kuninori.morimoto.gx@renesas.comSigned-off-by: Mark Brown <broonie@kernel.org>
-
Kuninori Morimoto authored
commit 1f9c82b5 ("ASoC: rsnd: add debugfs support") added CONFIG_DEBUG_FS related definitions on rsnd.h, but it should be added inside of RSND_H. This patch fixup it. Fixes: 1f9c82b5 ("ASoC: rsnd: add debugfs support") Signed-off-by: Kuninori Morimoto <kuninori.morimoto.gx@renesas.com> Link: https://lore.kernel.org/r/877cx26t7r.wl-kuninori.morimoto.gx@renesas.comSigned-off-by: Mark Brown <broonie@kernel.org>
-
Kuninori Morimoto authored
Current rsnd sets "channels_min" which is used from snd_soc_dai_stream_valid() without checking DT playback/capture property. Thus, "aplay -l" or "arecord -l" will indicate un-exising device. This patch checks DT proerty and do nothing playback/capture settings if not exist. Signed-off-by: Kuninori Morimoto <kuninori.morimoto.gx@renesas.com> Link: https://lore.kernel.org/r/878rhi6t7x.wl-kuninori.morimoto.gx@renesas.comSigned-off-by: Mark Brown <broonie@kernel.org>
-
Yassine Oudjana authored
Set driver name to allow matching different UCM2 configurations for the multiple devices sharing the same APQ8096 ASoC. Signed-off-by: Yassine Oudjana <y.oudjana@protonmail.com> Link: https://lore.kernel.org/r/20220622061106.35071-1-y.oudjana@protonmail.comSigned-off-by: Mark Brown <broonie@kernel.org>
-
Kuninori Morimoto authored
Current ASoC has many helper function. Link: https://lore.kernel.org/r/20230201111415.67bd4b7e@canb.auug.org.auReported-by: Stephen Rothwell <sfr@canb.auug.org.au> Signed-off-by: Kuninori Morimoto <kuninori.morimoto.gx@renesas.com> Link: https://lore.kernel.org/r/87bkme6vp5.wl-kuninori.morimoto.gx@renesas.comSigned-off-by: Mark Brown <broonie@kernel.org>
-
- 31 Jan, 2023 12 commits
-
-
Mark Brown authored
Merge series from Stefan Binding <sbinding@opensource.cirrus.com>: The CS42L42 has a SoundWire interface for control and audio. This chain of patches adds support for this. Patches #1 .. #5 split out various changes to the existing code that are needed for adding Soundwire. These are mostly around clocking and supporting the separate probe and enumeration stages in SoundWire. Patches #6 .. #8 actually adds the SoundWire handling.
-
Mark Brown authored
Merge series from Kuninori Morimoto <kuninori.morimoto.gx@renesas.com>: struct snd_soc_dai need to have info for playback/capture, but it is using "playback/capture_xxx" or "tx/tx_xxx" or array. This kind of random definition is very difficult to read. This patch-set add helper functions and each driver use it. And cleanup the definition.
-
Mark Brown authored
Merge series from Claudiu Beznea <claudiu.beznea@microchip.com>: This series adds runtime PM support for Microchip SPDIFRX driver. Along with it I added few fixes identified while going though the code and playing with Microchip SPDIFRX controller.
-
Mark Brown authored
Merge series from wangweidong.a@awinic.com: The Awinic AW88395 is an I2S/TDM input, high efficiency digital Smart K audio amplifier with an integrated 10.25V smart boost converter. Add a DT schema for describing Awinic AW88395 audio amplifiers. They are controlled using I2C
-
Mark Brown authored
Merge series from Herve Codina <herve.codina@bootlin.com>: The Renesas IDT821034 codec is four channel PCM codec with on-chip filters and programmable gain setting. It also provides SLIC (Subscriber Line Interface Circuit) signals as GPIOs.
-
Stefan Binding authored
Since clock stop causes bus reset on Intel controllers, we need to wait for the debounce interval on resume, to ensure all the interrupt status registers are set correctly. Signed-off-by: Stefan Binding <sbinding@opensource.cirrus.com> Reviewed-by: Pierre-Louis Bossart <pierre-louis.bossart@linux.intel.com> Link: https://lore.kernel.org/r/20230127165111.3010960-9-sbinding@opensource.cirrus.comSigned-off-by: Mark Brown <broonie@kernel.org>
-
Richard Fitzgerald authored
idle_bias_on was set because cs42l42 has a "VMID" type pseudo-midrail supply (named FILT+), and these typically take a long time to charge. But the driver never enabled pm_runtime so it would never have powered- down the cs42l42 anyway. In fact, FILT+ can charge to operating voltage within 12.5 milliseconds of enabling HP or ADC. This time is already covered by the startup delay of the HP/ADC. The datasheet warning about FILT+ taking up to 1 second to charge only applies in the special cases that either the PLL is started or DETECT_MODE set to non-zero while both HP and ADC are off. The driver never does either of these. Removing idle_bias_on allows the Soundwire host controller to suspend if there isn't a snd_soc_jack handler registered. Signed-off-by: Richard Fitzgerald <rf@opensource.cirrus.com> Signed-off-by: Stefan Binding <sbinding@opensource.cirrus.com> Reviewed-by: Pierre-Louis Bossart <pierre-louis.bossart@linux.intel.com> Link: https://lore.kernel.org/r/20230127165111.3010960-8-sbinding@opensource.cirrus.comSigned-off-by: Mark Brown <broonie@kernel.org>
-
Richard Fitzgerald authored
This adds support for using CS42L42 as a SoundWire device. SoundWire-specifics are kept separate from the I2S implementation as much as possible, aiming to limit the risk of breaking the I2C+I2S support. There are some important differences in the silicon behaviour between I2S and SoundWire mode that are reflected in the implementation: - ASP (I2S) most not be used in SoundWire mode because the two interfaces share pins. - The SoundWire capture (record) port only supports 1 channel. It does not have left-to-right duplication like the ASP. - DP2 can only be prepared if the HP has powered-up. DP1 can only be prepared if the ADC has powered-up. (This ordering restriction does not exist for ASPs.) The SoundWire core port-prepare step is triggered by the DAI-link prepare(). This happens before the codec DAI prepare() or the DAPM sequence so these cannot be used to enable HP/ADC. Instead the HP/ADC enable/disable are done during the port_prep callback. - The SRCs are an integral part of the audio chain but in silicon their power control is linked to the ASP. There is no equivalent power link to SoundWire DPs so the driver must take "manual" control of SRC power. - The SoundWire control registers occupy the lower part of the SoundWire address space so cs42l42 registers are offset by 0x8000 (non-paged) in SoundWire mode. - Register addresses are 8-bit paged in I2C mode but 16-bit unpaged in SoundWire. - Special procedures are needed on register read/writes to (a) ensure that the previous internal bus transaction has completed, and (b) handle delayed read results, when the read value could not be returned within the SoundWire read command. There are also some differences in driver implementation between I2S and SoundWire operation: - CS42L42 I2S does not runtime_suspend, but runtime_suspend/resume support has been added into the driver in SoundWire mode as the most convenient way to power-up the bus manager and to handle the unattach_request condition, though the CS42L42 chip does not itself suspend or resume. - Intel SoundWire host controllers have a low-power clock-stop mode that requires resetting all peripherals when resuming. This means that the interrupt registers will be reset in between the interrupt being generated and the interrupt being handled, and since the interrupt status is debounced, these values may not be accurate immediately, and may cause spurious unplug events before settling. - As in I2S mode, the PLL is only used while audio is active because of clocking quirks in the silicon. For SoundWire the cs42l42_pll_config() is deferred until the DAI prepare(), to allow the cs42l42_bus_config() callback to set the SCLK. Signed-off-by: Richard Fitzgerald <rf@opensource.cirrus.com> Signed-off-by: Stefan Binding <sbinding@opensource.cirrus.com> Reviewed-by: Pierre-Louis Bossart <pierre-louis.bossart@linux.intel.com> Link: https://lore.kernel.org/r/20230127165111.3010960-7-sbinding@opensource.cirrus.comSigned-off-by: Mark Brown <broonie@kernel.org>
-
Richard Fitzgerald authored
Export functions that will be needed by a SoundWire module. Signed-off-by: Richard Fitzgerald <rf@opensource.cirrus.com> Signed-off-by: Stefan Binding <sbinding@opensource.cirrus.com> Reviewed-by: Pierre-Louis Bossart <pierre-louis.bossart@linux.intel.com> Link: https://lore.kernel.org/r/20230127165111.3010960-6-sbinding@opensource.cirrus.comSigned-off-by: Mark Brown <broonie@kernel.org>
-
Richard Fitzgerald authored
Setup of the ASP (audio serial port) was being done as a side-effect of cs42l42_pll_config() and forces a restriction on the ratio of sample_rate to bit_clock that is invalid for Soundwire. Move the ASP setup into a dedicated function. Signed-off-by: Richard Fitzgerald <rf@opensource.cirrus.com> Signed-off-by: Stefan Binding <sbinding@opensource.cirrus.com> Reviewed-by: Pierre-Louis Bossart <pierre-louis.bossart@linux.intel.com> Link: https://lore.kernel.org/r/20230127165111.3010960-5-sbinding@opensource.cirrus.comSigned-off-by: Mark Brown <broonie@kernel.org>
-
Richard Fitzgerald authored
The chosen clocking configuration must give an internal MCLK (MCLKint) that is an integer multiple of the sample rate. On I2S each of the supported bit clock frequencies can only be generated from one sample rate group (either the 44100 or the 48000) so the code could use only the bitclock to look up a PLL config. The relationship between sample rate and bitclock frequency is more complex on Soundwire and so it is possible to set a frame shape to generate a bitclock from the "wrong" group. For example 2*147 with a 48000 sample rate would give a bitclock of 14112000 which on I2S could only be derived from a 44100 sample rate. Signed-off-by: Richard Fitzgerald <rf@opensource.cirrus.com> Signed-off-by: Stefan Binding <sbinding@opensource.cirrus.com> Reviewed-by: Pierre-Louis Bossart <pierre-louis.bossart@linux.intel.com> Link: https://lore.kernel.org/r/20230127165111.3010960-4-sbinding@opensource.cirrus.comSigned-off-by: Mark Brown <broonie@kernel.org>
-
Richard Fitzgerald authored
The SOFT_RESET_REBOOT register is needed to recover CS42L42 state after a Soundwire bus reset. This is required to be set whenever there is severe/hard bus reset. Signed-off-by: Richard Fitzgerald <rf@opensource.cirrus.com> Signed-off-by: Stefan Binding <sbinding@opensource.cirrus.com> Reviewed-by: Pierre-Louis Bossart <pierre-louis.bossart@linux.intel.com> Link: https://lore.kernel.org/r/20230127165111.3010960-3-sbinding@opensource.cirrus.comSigned-off-by: Mark Brown <broonie@kernel.org>
-