- Jan 31, 2023
-
-
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.com Signed-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.com Signed-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.com Signed-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.com Signed-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.com Signed-off-by:
Mark Brown <broonie@kernel.org>
-
- Jan 30, 2023
-
-
Steffen Aschbacher authored
Set the reserved bit 7 in the ANALOG_CTRL_REG for the TAS5720A-Q1 device, when probing. The datasheet mentions that the bit should be 1 during reset/powerup. The device did not initialize before setting this value to 1. So, this could be a quirk of this device. Or it could be a quirk with the board on which it was tested. That is why this patch is separate from the patch that adds support for the TAS5720A-Q1 device. Signed-off-by:
Steffen Aschbacher <steffen.aschbacher@stihl.de> Signed-off-by:
Alexandru Ardelean <alex@shruggie.ro> Link: https://lore.kernel.org/r/20230128082744.41849-3-alex@shruggie.ro Signed-off-by:
Mark Brown <broonie@kernel.org>
-
Steffen Aschbacher authored
This change adds support the TAS5720A-Q1 audio codec, in the same driver as tas5720. Functionally, this driver is pretty similar to it's TAS5720x variant. The first 3 registers are the same, so the main control and device identification can happen with these registers. The next registers differ. This variant offers control (in the registers) for 2 speakers, which is implemented here (in a basic manner). Signed-off-by:
Steffen Aschbacher <steffen.aschbacher@stihl.de> Signed-off-by:
Alexandru Ardelean <alex@shruggie.ro> Link: https://lore.kernel.org/r/20230128082744.41849-2-alex@shruggie.ro Signed-off-by:
Mark Brown <broonie@kernel.org>
-
Alexandru Ardelean authored
This is to be re-used in tas5720_mute() (which is part of the dai_ops) and also in the tas5720_fault_check_work() hook. The benefit here isn't too great (now). It's only when we add support for a new device with a slightly different regmap that this becomes more useful. Signed-off-by:
Alexandru Ardelean <alex@shruggie.ro> Link: https://lore.kernel.org/r/20230128082744.41849-1-alex@shruggie.ro Signed-off-by:
Mark Brown <broonie@kernel.org>
-
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/20230130092157.36446-1-colin.i.king@gmail.com Signed-off-by:
Mark Brown <broonie@kernel.org>
-
- Jan 28, 2023
-
-
KiseokJo authored
Signed-off-by:
KiseokJo <kiseok.jo@irondevice.com> Reported-by:
Mark Brown <broonie@kernel.org> Link: https://lore.kernel.org/r/20230126020156.3252-3-kiseok.jo@irondevice.com Signed-off-by:
Mark Brown <broonie@kernel.org>
-
- Jan 27, 2023
-
-
Astrid Rost authored
Add set_jack and get_jack_type to allow simple-card-utils to add a jack for it. Signed-off-by:
Astrid Rost <astrid.rost@axis.com> Link: https://lore.kernel.org/r/20230123135913.2720991-4-astrid.rost@axis.com Signed-off-by:
Mark Brown <broonie@kernel.org>
-
- Jan 25, 2023
-
-
Krzysztof Kozlowski authored
Remove unneeded includes from wsa881x and wsa883x drivers. The drivers do not reference anything from the headers. Signed-off-by:
Krzysztof Kozlowski <krzysztof.kozlowski@linaro.org> Link: https://lore.kernel.org/r/20230124163953.345949-3-krzysztof.kozlowski@linaro.org Signed-off-by:
Mark Brown <broonie@kernel.org>
-
Krzysztof Kozlowski authored
The struct sdw_port_config is not modified, so make it a const for code safety. Signed-off-by:
Krzysztof Kozlowski <krzysztof.kozlowski@linaro.org> Link: https://lore.kernel.org/r/20230124163953.345949-2-krzysztof.kozlowski@linaro.org Signed-off-by:
Mark Brown <broonie@kernel.org>
-
Krzysztof Kozlowski authored
The struct sdw_slave_ops is not modified and sdw_driver takes pointer to const, so make it a const for code safety. Signed-off-by:
Krzysztof Kozlowski <krzysztof.kozlowski@linaro.org> Link: https://lore.kernel.org/r/20230124163953.345949-1-krzysztof.kozlowski@linaro.org Signed-off-by:
Mark Brown <broonie@kernel.org>
-
- Jan 16, 2023
-
-
Krzysztof Kozlowski authored
The shutdown GPIO is active low (SD_N), but this depends on actual board layout. Linux drivers should only care about logical state, where high (1) means shutdown and low (0) means do not shutdown. Invert the GPIO to match logical value while preserving backwards DTB compatibility. It is not possible to detect whether ACTIVE_HIGH flag in DTB is because it is an old DTB (using incorrect flag) or it is a new DTB with a correct hardware pin polarity description. Therefore the solution prioritizes backwards compatibility while relying on relevant DTS being upstreamed. Signed-off-by:
Krzysztof Kozlowski <krzysztof.kozlowski@linaro.org> Link: https://lore.kernel.org/r/20230102114152.297305-4-krzysztof.kozlowski@linaro.org Signed-off-by:
Mark Brown <broonie@kernel.org>
-
Krzysztof Kozlowski authored
Code can be a bit simpler with dev_err_probe(). Signed-off-by:
Krzysztof Kozlowski <krzysztof.kozlowski@linaro.org> Link: https://lore.kernel.org/r/20230102114152.297305-3-krzysztof.kozlowski@linaro.org Signed-off-by:
Mark Brown <broonie@kernel.org>
-
Krzysztof Kozlowski authored
The probe already stores pointer to &pdev->dev, so use it to make the code a bit easier to read. Signed-off-by:
Krzysztof Kozlowski <krzysztof.kozlowski@linaro.org> Link: https://lore.kernel.org/r/20230102114152.297305-2-krzysztof.kozlowski@linaro.org Signed-off-by:
Mark Brown <broonie@kernel.org>
-
Krzysztof Kozlowski authored
The probe already stores pointer to &pdev->dev, so use it to make the code a bit easier to read. Signed-off-by:
Krzysztof Kozlowski <krzysztof.kozlowski@linaro.org> Link: https://lore.kernel.org/r/20230102114152.297305-1-krzysztof.kozlowski@linaro.org Signed-off-by:
Mark Brown <broonie@kernel.org>
-
- Jan 09, 2023
-
-
Ajye Huang authored
commit dcc2c012 ("ASoC: Fix gpiolib dependencies") removed a series of unnecessary dependencies on GPIOLIB when the gpio was optional. A similar simplification seems valid for nau8315, so remove the dependency as well. This will avoid the following warning WARNING: unmet direct dependencies detected for SND_SOC_NAU8315 Depends on [n]: SOUND [=y] && !UML && SND [=y] && SND_SOC [=y] && GPIOLIB [=n] Selected by [y]: - SND_SOC_INTEL_SOF_NAU8825_MACH [=y] && SOUND [=y] && !UML && SND [=y] && SND_SOC [=y] && SND_SOC_INTEL_MACH [=y] && (SND_SOC_SOF_HDA_LINK [=y] || SND_SOC_SOF_BAYTRAIL [=n]) && I2C [=y] && ACPI [=y] && SND_HDA_CODEC_HDMI [=y] && SND_SOC_SOF_HDA_AUDIO_CODEC [=y] && (MFD_INTEL_LPSS [=n] || COMPILE_TEST [=y]) Reported-by:
kernel test robot <lkp@intel.com> Signed-off-by:
Ajye Huang <ajye_huang@compal.corp-partner.google.com> Link: https://lore.kernel.org/r/20230108114351.539786-1-ajye_huang@compal.corp-partner.google.com Signed-off-by:
Mark Brown <broonie@kernel.org>
-
Emanuele Ghidoli authored
Allow configuring the two loudspeaker outputs as a single Bridge Tied Load output getting higher output power. Signed-off-by:
Emanuele Ghidoli <emanuele.ghidoli@toradex.com> Signed-off-by:
Francesco Dolcini <francesco.dolcini@toradex.com> Link: https://lore.kernel.org/r/20230104140412.35575-4-francesco@dolcini.it Signed-off-by:
Mark Brown <broonie@kernel.org>
-
- Dec 29, 2022
-
-
Emanuele Ghidoli authored
Restore volume after charge pump and PGA activation to ensure that volume settings are correctly applied when re-enabling codec from SND_SOC_BIAS_OFF state. CLASS_W, CHARGE_PUMP and POWER_MANAGEMENT_2 register configuration affect how the volume register are applied and must be configured first. Fixes: a91eb199 ("ASoC: Initial WM8904 CODEC driver") Link: https://lore.kernel.org/all/c7864c35-738c-a867-a6a6-ddf9f98df7e7@gmail.com/ Signed-off-by:
Emanuele Ghidoli <emanuele.ghidoli@toradex.com> Signed-off-by:
Francesco Dolcini <francesco.dolcini@toradex.com> Acked-by:
Charles Keepax <ckeepax@opensource.cirrus.com> Link: https://lore.kernel.org/r/20221223080247.7258-1-francesco@dolcini.it Signed-off-by:
Mark Brown <broonie@kernel.org>
-
ChiYuan Huang authored
RT9120 uses PM runtime autosuspend to decrease the frequently on/off spent time. This exists one case, when pcm is closed and dev PM is waiting for autosuspend time expired to enter runtime suspend state. At the mean time, system is going to enter suspend, dev PM runtime suspend won't be called. It makes the rt9120 suspend consumption current not as expected. This patch can fix the rt9120 dev PM issue during runtime autosuspend and system suspend by binding dev PM runtime and ASoC component PM. Fixes: 80b949f3 ("ASoC: rt9120: Use pm_runtime and regcache to optimize 'pwdnn' logic") Signed-off-by:
ChiYuan Huang <cy_huang@richtek.com> Link: https://lore.kernel.org/r/1672301033-3675-1-git-send-email-u0084500@gmail.com Signed-off-by:
Mark Brown <broonie@kernel.org>
-
- Dec 25, 2022
-
-
Ondrej Jirman authored
LOUT output can produce either single-ended stereo signals, or mono differential signal. Some applications are wired to use LOUT in mono differential mode. Allow to configure it via device property. Signed-off-by:
Ondrej Jirman <megi@xff.cz> Signed-off-by:
Jarrah Gosbell <kernel@undef.tools> Link: https://lore.kernel.org/r/20221209105621.39237-1-kernel@undef.tools Signed-off-by:
Mark Brown <broonie@kernel.org>
-
Lukasz Majewski authored
The wm8940 provides the chip ID information via I2C. In this patch this information is read and if not matching expected value, the probe function is aborted. This prevents from using (i.e. inserting) other wm89* modules which use the same I2C bus address. Signed-off-by:
Lukasz Majewski <lukma@denx.de> Acked-by:
Charles Keepax <ckeepax@opensource.cirrus.com> Link: https://lore.kernel.org/r/20221216094624.3849278-3-lukma@denx.de Signed-off-by:
Mark Brown <broonie@kernel.org>
-
Lukasz Majewski authored
This patch enables support for internal wm8940's PLL and proper divider to set proper value for 256x fs clock. This approach is more flexible and replaces hardcoded clock values and makes the codec work with the simple-card driver. Card drivers calling set_pll() and set_clkdiv() directly are unaffected. For the reference - code in this commit is based on: 51b2bb3f ("ASoC: wm8974: configure pll and mclk divider automatically") Signed-off-by:
Lukasz Majewski <lukma@denx.de> Acked-by:
Charles Keepax <ckeepax@opensource.cirrus.com> Link: https://lore.kernel.org/r/20221216094624.3849278-2-lukma@denx.de Signed-off-by:
Mark Brown <broonie@kernel.org>
-
Lukasz Majewski authored
The lack of platform data in the contemporary Linux shall not be the reason to display warnings to the kernel logs. Signed-off-by:
Lukasz Majewski <lukma@denx.de> Acked-by:
Charles Keepax <ckeepax@opensource.cirrus.com> Link: https://lore.kernel.org/r/20221216094624.3849278-1-lukma@denx.de Signed-off-by:
Mark Brown <broonie@kernel.org>
-
David Rau authored
This adds the DAI mono mode support and set the frame width to 32 Signed-off-by:
Piotr Wojtaszczyk <piotr.wojtaszczyk@timesys.com> Tested-by:
David Rau <David.Rau.opensource@dm.renesas.com> Signed-off-by:
David Rau <David.Rau.opensource@dm.renesas.com> Link: https://lore.kernel.org/r/20221214044058.6289-1-David.Rau.opensource@dm.renesas.com Signed-off-by:
Mark Brown <broonie@kernel.org>
-
Shuming Fan authored
This patch adds another jack detection mode for JD2 with an external resistor of 100k. Signed-off-by:
Shuming Fan <shumingf@realtek.com> Link: https://lore.kernel.org/r/20221223055846.3285-1-shumingf@realtek.com Signed-off-by:
Mark Brown <broonie@kernel.org>
-
Uwe Kleine-König authored
A remove callback just returning 0 is equivalent to no remove callback at all. So drop the useless function. Signed-off-by:
Uwe Kleine-König <u.kleine-koenig@pengutronix.de> Link: https://lore.kernel.org/r/20221212205406.3771071-12-u.kleine-koenig@pengutronix.de Signed-off-by:
Mark Brown <broonie@kernel.org>
-
Uwe Kleine-König authored
A remove callback just returning 0 is equivalent to no remove callback at all. So drop the useless function. Signed-off-by:
Uwe Kleine-König <u.kleine-koenig@pengutronix.de> Link: https://lore.kernel.org/r/20221212205406.3771071-11-u.kleine-koenig@pengutronix.de Signed-off-by:
Mark Brown <broonie@kernel.org>
-
Uwe Kleine-König authored
A remove callback just returning 0 is equivalent to no remove callback at all. So drop the useless function. Signed-off-by:
Uwe Kleine-König <u.kleine-koenig@pengutronix.de> Link: https://lore.kernel.org/r/20221212205406.3771071-10-u.kleine-koenig@pengutronix.de Signed-off-by:
Mark Brown <broonie@kernel.org>
-
Uwe Kleine-König authored
A remove callback just returning 0 is equivalent to no remove callback at all. So drop the useless function. Signed-off-by:
Uwe Kleine-König <u.kleine-koenig@pengutronix.de> Link: https://lore.kernel.org/r/20221212205406.3771071-9-u.kleine-koenig@pengutronix.de Signed-off-by:
Mark Brown <broonie@kernel.org>
-
Uwe Kleine-König authored
A remove callback just returning 0 is equivalent to no remove callback at all. So drop the useless function. Signed-off-by:
Uwe Kleine-König <u.kleine-koenig@pengutronix.de> Link: https://lore.kernel.org/r/20221212205406.3771071-8-u.kleine-koenig@pengutronix.de Signed-off-by:
Mark Brown <broonie@kernel.org>
-
Uwe Kleine-König authored
A remove callback just returning 0 is equivalent to no remove callback at all. So drop the useless function. Signed-off-by:
Uwe Kleine-König <u.kleine-koenig@pengutronix.de> Link: https://lore.kernel.org/r/20221212205406.3771071-7-u.kleine-koenig@pengutronix.de Signed-off-by:
Mark Brown <broonie@kernel.org>
-
Uwe Kleine-König authored
A remove callback just returning 0 is equivalent to no remove callback at all. So drop the useless function. Signed-off-by:
Uwe Kleine-König <u.kleine-koenig@pengutronix.de> Link: https://lore.kernel.org/r/20221212205406.3771071-6-u.kleine-koenig@pengutronix.de Signed-off-by:
Mark Brown <broonie@kernel.org>
-
- Dec 15, 2022
-
-
Krzysztof Kozlowski authored
lochnagar_of_match is used unconditionally, so COMPILE_TEST builds without OF warn: sound/soc/codecs/lochnagar-sc.c:247:34: error: ‘lochnagar_of_match’ defined but not used [-Werror=unused-const-variable=] Reported-by:
kernel test robot <lkp@intel.com> Signed-off-by:
Krzysztof Kozlowski <krzysztof.kozlowski@linaro.org> Link: https://lore.kernel.org/r/20221215134337.77944-1-krzysztof.kozlowski@linaro.org Signed-off-by:
Mark Brown <broonie@kernel.org>
-
- Dec 13, 2022
-
-
Hans de Goede authored
For some reason rt5670_i2c_probe() does a pm_runtime_put() at the end of a successful probe. But it has never done a pm_runtime_get() leading to the following error being logged into dmesg: rt5670 i2c-10EC5640:00: Runtime PM usage count underflow! Fix this by removing the unnecessary pm_runtime_put(). Fixes: 64e89e5f ("ASoC: rt5670: Add runtime PM support") Signed-off-by:
Hans de Goede <hdegoede@redhat.com> Link: https://lore.kernel.org/r/20221213123319.11285-1-hdegoede@redhat.com Signed-off-by:
Mark Brown <broonie@kernel.org>
-
- Dec 12, 2022
-
-
Marek Szyprowski authored
Fix this by dropping wm8994->accdet_lock while calling cancel_delayed_work_sync(&wm8994->mic_work) in wm1811_jackdet_irq(). Fixes: c0cc3f16 ("ASoC: wm8994: Allow a delay between jack insertion and microphone detect") Signed-off-by:
Marek Szyprowski <m.szyprowski@samsung.com> Acked-by:
Charles Keepax <ckeepax@opensource.cirrus.com> Link: https://lore.kernel.org/r/20221209091657.1183-1-m.szyprowski@samsung.com Signed-off-by:
Mark Brown <broonie@kernel.org>
-
- Dec 07, 2022
-
-
Jiapeng Chong authored
The function wcd_clsh_set_buck_mode() is defined in the wcd-clsh-v2.c file, but not called elsewhere, so remove this unused function. sound/soc/codecs/wcd-clsh-v2.c:133:20: warning: unused function 'wcd_clsh_enable_status'. Link: https://bugzilla.openanolis.cn/show_bug.cgi?id=3348 Reported-by:
Abaci Robot <abaci@linux.alibaba.com> Signed-off-by:
Jiapeng Chong <jiapeng.chong@linux.alibaba.com> Link: https://lore.kernel.org/r/20221205073507.36071-1-jiapeng.chong@linux.alibaba.com Signed-off-by:
Mark Brown <broonie@kernel.org>
-
- Dec 05, 2022
-
-
Colin Ian King authored
Don't populate the read-only arrays capture_reg_H and capture_reg_L on the stack but instead make them static const. Also makes the object code a little smaller. Signed-off-by:
Colin Ian King <colin.i.king@gmail.com> Link: https://lore.kernel.org/r/20221202171450.1815346-1-colin.i.king@gmail.com Signed-off-by:
Mark Brown <broonie@kernel.org>
-