]> Git Repo - linux.git/log
linux.git
2 years agoASoC: rt5640: Fix Jack work after system suspend
Oder Chiou [Mon, 28 Nov 2022 07:08:25 +0000 (15:08 +0800)]
ASoC: rt5640: Fix Jack work after system suspend

We found an corner case in RT5640 codec driver which schedules jack work
after system suspend as IRQ was enabled. Due to this, hitting the error
as register access happening after suspend as jack worker thread getting
scheduled in irq handler. The patch disables the irq during the suspend
to prevent the corner case happening.

Signed-off-by: Oder Chiou <[email protected]>
Reported-by: Mohan Kumar D <[email protected]>
Link: https://lore.kernel.org/r/[email protected]
Signed-off-by: Mark Brown <[email protected]>
2 years agoASoC: SOF: Drop obsolete dependency on COMPILE_TEST
Jean Delvare [Sun, 27 Nov 2022 18:35:49 +0000 (19:35 +0100)]
ASoC: SOF: Drop obsolete dependency on COMPILE_TEST

Since commit 0166dc11be91 ("of: make CONFIG_OF user selectable"), it
is possible to test-build any driver which depends on OF on any
architecture by explicitly selecting OF. Therefore depending on
COMPILE_TEST as an alternative is no longer needed.

Signed-off-by: Jean Delvare <[email protected]>
Link: https://lore.kernel.org/r/[email protected]
Signed-off-by: Mark Brown <[email protected]>
2 years agoASoC: max9867: Implement exact integer mode
Pavel Dobias [Wed, 23 Nov 2022 15:38:18 +0000 (16:38 +0100)]
ASoC: max9867: Implement exact integer mode

For 8kHz and 16kHz sample rates and certain PCLK values
the codec can be programmed to operate in exact integer
mode. If available, use it to achieve the exact sample rate.

Signed-off-by: Pavel Dobias <[email protected]>
Link: https://lore.kernel.org/r/[email protected]
Signed-off-by: Mark Brown <[email protected]>
2 years agoASoC: rsnd: adg: use __clk_get_name() instead of local clk_name[]
Kuninori Morimoto [Mon, 28 Nov 2022 05:46:28 +0000 (05:46 +0000)]
ASoC: rsnd: adg: use __clk_get_name() instead of local clk_name[]

Current rsnd_adg_clk_dbg_info() is using locak clk_name[] to ndicating
clk name, but we don't want to use local clk_name[] everywhere when we
support R-Car Gen4 sound to handling non compatible clk naming.

This patch uses __clk_get_name() instead of local clk_name[] for it.

Signed-off-by: Kuninori Morimoto <[email protected]>
Link: https://lore.kernel.org/r/[email protected]
Signed-off-by: Mark Brown <[email protected]>
2 years agoASoC: sdw-mockup: Switch to new snd_sdw_params_to_config helper
Charles Keepax [Wed, 23 Nov 2022 16:54:32 +0000 (16:54 +0000)]
ASoC: sdw-mockup: Switch to new snd_sdw_params_to_config helper

The conversion from hw_params to SoundWire config is pretty
standard as such most of the conversion can be handled by the new
snd_sdw_params_to_config helper function.

Signed-off-by: Charles Keepax <[email protected]>
Link: https://lore.kernel.org/r/[email protected]
Signed-off-by: Mark Brown <[email protected]>
2 years agoASoC: rt715: Switch to new snd_sdw_params_to_config helper
Charles Keepax [Wed, 23 Nov 2022 16:54:31 +0000 (16:54 +0000)]
ASoC: rt715: Switch to new snd_sdw_params_to_config helper

The conversion from hw_params to SoundWire config is pretty
standard as such most of the conversion can be handled by the new
snd_sdw_params_to_config helper function.

Signed-off-by: Charles Keepax <[email protected]>
Link: https://lore.kernel.org/r/[email protected]
Signed-off-by: Mark Brown <[email protected]>
2 years agoASoC: rt711: Switch to new snd_sdw_params_to_config helper
Charles Keepax [Wed, 23 Nov 2022 16:54:30 +0000 (16:54 +0000)]
ASoC: rt711: Switch to new snd_sdw_params_to_config helper

The conversion from hw_params to SoundWire config is pretty
standard as such most of the conversion can be handled by the new
snd_sdw_params_to_config helper function.

Signed-off-by: Charles Keepax <[email protected]>
Link: https://lore.kernel.org/r/[email protected]
Signed-off-by: Mark Brown <[email protected]>
2 years agoASoC: rt700: Switch to new snd_sdw_params_to_config helper
Charles Keepax [Wed, 23 Nov 2022 16:54:29 +0000 (16:54 +0000)]
ASoC: rt700: Switch to new snd_sdw_params_to_config helper

The conversion from hw_params to SoundWire config is pretty
standard as such most of the conversion can be handled by the new
snd_sdw_params_to_config helper function.

Signed-off-by: Charles Keepax <[email protected]>
Link: https://lore.kernel.org/r/[email protected]
Signed-off-by: Mark Brown <[email protected]>
2 years agoASoC: rt5682-sdw: Switch to new snd_sdw_params_to_config helper
Charles Keepax [Wed, 23 Nov 2022 16:54:28 +0000 (16:54 +0000)]
ASoC: rt5682-sdw: Switch to new snd_sdw_params_to_config helper

The conversion from hw_params to SoundWire config is pretty
standard as such most of the conversion can be handled by the new
snd_sdw_params_to_config helper function.

Signed-off-by: Charles Keepax <[email protected]>
Link: https://lore.kernel.org/r/[email protected]
Signed-off-by: Mark Brown <[email protected]>
2 years agoASoC: rt1316-sdw: Switch to new snd_sdw_params_to_config helper
Charles Keepax [Wed, 23 Nov 2022 16:54:27 +0000 (16:54 +0000)]
ASoC: rt1316-sdw: Switch to new snd_sdw_params_to_config helper

The conversion from hw_params to SoundWire config is pretty
standard as such most of the conversion can be handled by the new
snd_sdw_params_to_config helper function.

Signed-off-by: Charles Keepax <[email protected]>
Link: https://lore.kernel.org/r/[email protected]
Signed-off-by: Mark Brown <[email protected]>
2 years agoASoC: rt1308-sdw: Switch to new snd_sdw_params_to_config helper
Charles Keepax [Wed, 23 Nov 2022 16:54:26 +0000 (16:54 +0000)]
ASoC: rt1308-sdw: Switch to new snd_sdw_params_to_config helper

The conversion from hw_params to SoundWire config is pretty
standard as such most of the conversion can be handled by the new
snd_sdw_params_to_config helper function.

Signed-off-by: Charles Keepax <[email protected]>
Link: https://lore.kernel.org/r/[email protected]
Signed-off-by: Mark Brown <[email protected]>
2 years agoASoC: max98373-sdw: Switch to new snd_sdw_params_to_config helper
Charles Keepax [Wed, 23 Nov 2022 16:54:25 +0000 (16:54 +0000)]
ASoC: max98373-sdw: Switch to new snd_sdw_params_to_config helper

The conversion from hw_params to SoundWire config is pretty
standard as such most of the conversion can be handled by the new
snd_sdw_params_to_config helper function.

Signed-off-by: Charles Keepax <[email protected]>
Link: https://lore.kernel.org/r/[email protected]
Signed-off-by: Mark Brown <[email protected]>
2 years agosound: sdw: Add hw_params to SoundWire config helper function
Charles Keepax [Wed, 23 Nov 2022 16:54:24 +0000 (16:54 +0000)]
sound: sdw: Add hw_params to SoundWire config helper function

The vast majority of the current users of the SoundWire framework
have almost identical code for converting from hw_params to SoundWire
configuration. Whilst complex devices might require more, it is very
likely that most new devices will follow the same pattern. Save a
little code by factoring this out into a helper function.

Signed-off-by: Charles Keepax <[email protected]>
Link: https://lore.kernel.org/r/[email protected]
Signed-off-by: Mark Brown <[email protected]>
2 years agoASoC: rsnd: Drop obsolete dependency on COMPILE_TEST
Jean Delvare [Sun, 27 Nov 2022 18:34:41 +0000 (19:34 +0100)]
ASoC: rsnd: Drop obsolete dependency on COMPILE_TEST

Since commit 0166dc11be91 ("of: make CONFIG_OF user selectable"), it
is possible to test-build any driver which depends on OF on any
architecture by explicitly selecting OF. Therefore depending on
COMPILE_TEST as an alternative is no longer needed.

Signed-off-by: Jean Delvare <[email protected]>
Link: https://lore.kernel.org/r/[email protected]
Signed-off-by: Mark Brown <[email protected]>
2 years agoASoC: SOF: amd: ADD HS and SP virtual DAI.
V sujith kumar Reddy [Wed, 23 Nov 2022 12:19:10 +0000 (17:49 +0530)]
ASoC: SOF: amd: ADD HS and SP virtual DAI.

ADD HS and SP virtual DAI driver to support AMD platforms.

Signed-off-by: V sujith kumar Reddy <[email protected]>
Link: https://lore.kernel.org/r/20221123121911.3446224-4-vsujithkumar.reddy@amd.corp-partner.google.com
Signed-off-by: Mark Brown <[email protected]>
2 years agoASoC: SOF: amd: Fix for selecting clock source as external clock.
V sujith kumar Reddy [Wed, 23 Nov 2022 12:19:09 +0000 (17:49 +0530)]
ASoC: SOF: amd: Fix for selecting clock source as external clock.

By default clock source is selected as internal clock of 96Mhz
which is not configurable. Now we select the clock source to
external clock (ACLK) which can be configurable to different clock
ranges depending on usecase.

Signed-off-by: V sujith kumar Reddy <[email protected]>
Link: https://lore.kernel.org/r/20221123121911.3446224-3-vsujithkumar.reddy@amd.corp-partner.google.com
Signed-off-by: Mark Brown <[email protected]>
2 years agoASoC: SOF: amd: Fix for reading position updates from stream box.
V sujith kumar Reddy [Wed, 23 Nov 2022 12:19:08 +0000 (17:49 +0530)]
ASoC: SOF: amd: Fix for reading position updates from stream box.

By default the position updates are read from dsp box when streambox
size is not defined.if the streambox size is defined to some value
then position updates can be read from the streambox.

Signed-off-by: V sujith kumar Reddy <[email protected]>
Link: https://lore.kernel.org/r/20221123121911.3446224-2-vsujithkumar.reddy@amd.corp-partner.google.com
Signed-off-by: Mark Brown <[email protected]>
2 years agoRK3588 Audio Support
Mark Brown [Fri, 25 Nov 2022 21:39:20 +0000 (21:39 +0000)]
RK3588 Audio Support

Merge series from Nicolas Frattaroli <[email protected]>:

This patchset refactors the Rockchip I2S/TDM driver in order to
support the RK3588 SoC, and then adds the necessary compatible
string to load the driver for it.

Patch 1 rectifies a problem with the bindings where we were too
strict about requiring the rockchip,grf property. Most features
of this audio device don't need access to the GRF to function.

Patch 2 modifies the driver to adjust its behaviour to what the
changed bindings now allow, namely using most things without the
GRF.

Patch 3 and 4 are boring compatible string stuff that enables
RK3588 support. No special data is needed to initialise the
driver for this instance of the I2S/TDM IP.

2 years agoASoC: adau1372: fixes after debugging custom board
Mark Brown [Fri, 25 Nov 2022 21:26:21 +0000 (21:26 +0000)]
ASoC: adau1372: fixes after debugging custom board

Merge series from Maarten Zanders <[email protected]>:

A collection of fixes and improvements for the adau1372 driver.

2 years agoASoC: adau1372: add support for S24_LE mode
Maarten Zanders [Fri, 28 Oct 2022 15:26:24 +0000 (17:26 +0200)]
ASoC: adau1372: add support for S24_LE mode

The ADAU1372 contains 24bit ADCs and DACs. Allow the driver to use
its native mode which uses the same settings as the current 32 bit
mode.

Signed-off-by: Maarten Zanders <[email protected]>
Link: https://lore.kernel.org/r/[email protected]
Signed-off-by: Mark Brown <[email protected]>
2 years agoASoC: adau1372: correct PGA enable & mute bit
Maarten Zanders [Fri, 28 Oct 2022 15:26:25 +0000 (17:26 +0200)]
ASoC: adau1372: correct PGA enable & mute bit

The DAPM control for PGAx uses the PGA mute bit for
power management. This bit is active high but is set to
non-inverted (ie when powering, it will mute).
The ALSA control "PGA x Capture Switch" uses the active
high PGA_ENx bit, but is set to inverted. So when
enabling this switch, the PGA gets disabled.

To correct the behaviour, invert both these bits.

Signed-off-by: Maarten Zanders <[email protected]>
Link: https://lore.kernel.org/r/[email protected]
Signed-off-by: Mark Brown <[email protected]>
2 years agoASoC: adau1372: fix mclk
Maarten Zanders [Fri, 28 Oct 2022 15:26:23 +0000 (17:26 +0200)]
ASoC: adau1372: fix mclk

"mclk" is retrieved from the configuration and assigned to adau1372->clk.
However adau1372->mclk (==NULL) is used for clk_prepare_enable() and
clk_disable_unprepare() which don't have any effect.

Remove .clk from struct adau1372 and use .mclk throughout.
This change ensures that the input clock is switched on/off when the
bias level is changed.

Signed-off-by: Maarten Zanders <[email protected]>
Link: https://lore.kernel.org/r/[email protected]
Signed-off-by: Mark Brown <[email protected]>
2 years agoASoC: mediatek: mtk-btcvsd: Add checks for write and read of mtk_btcvsd_snd
Jiasheng Jiang [Wed, 16 Nov 2022 03:07:50 +0000 (11:07 +0800)]
ASoC: mediatek: mtk-btcvsd: Add checks for write and read of mtk_btcvsd_snd

As the mtk_btcvsd_snd_write and mtk_btcvsd_snd_read may return error,
it should be better to catch the exception.

Fixes: 4bd8597dc36c ("ASoC: mediatek: add btcvsd driver")
Signed-off-by: Jiasheng Jiang <[email protected]>
Link: https://lore.kernel.org/r/[email protected]
Signed-off-by: Mark Brown <[email protected]>
2 years agoASoC: dt-bindings: wcd9335: fix reset line polarity in example
Dmitry Torokhov [Thu, 27 Oct 2022 07:46:48 +0000 (00:46 -0700)]
ASoC: dt-bindings: wcd9335: fix reset line polarity in example

When resetting the block, the reset line is being driven low and then
high, which means that the line in DTS should be annotated as "active
low".

Fixes: 1877c9fda1b7 ("ASoC: dt-bindings: add dt bindings for wcd9335 audio codec")
Signed-off-by: Dmitry Torokhov <[email protected]>
Acked-by: Krzysztof Kozlowski <[email protected]>
Link: https://lore.kernel.org/r/[email protected]
Signed-off-by: Mark Brown <[email protected]>
2 years agoASoC: rockchip: i2s_tdm: Add support for RK3588
Nicolas Frattaroli [Tue, 25 Oct 2022 12:41:32 +0000 (14:41 +0200)]
ASoC: rockchip: i2s_tdm: Add support for RK3588

This adds support for the RK3588 SoC to the I2S/TDM driver.

Signed-off-by: Nicolas Frattaroli <[email protected]>
Link: https://lore.kernel.org/r/[email protected]
Signed-off-by: Mark Brown <[email protected]>
2 years agoASoC: dt-bindings: rockchip: i2s-tdm: Add RK3588 compatible
Nicolas Frattaroli [Tue, 25 Oct 2022 12:41:31 +0000 (14:41 +0200)]
ASoC: dt-bindings: rockchip: i2s-tdm: Add RK3588 compatible

This adds the compatible string for the RK3588 SoC.

Signed-off-by: Nicolas Frattaroli <[email protected]>
Acked-by: Krzysztof Kozlowski <[email protected]>
Link: https://lore.kernel.org/r/[email protected]
Signed-off-by: Mark Brown <[email protected]>
2 years agoASoC: rockchip: i2s_tdm: Make the grf property optional
Nicolas Frattaroli [Tue, 25 Oct 2022 12:41:30 +0000 (14:41 +0200)]
ASoC: rockchip: i2s_tdm: Make the grf property optional

Only IO Multiplex and two TRCM modes need access to the GRF, so
making it a hard requirement is not a wise idea, as it complicates
support for newer SoCs which do not do these things.

Signed-off-by: Nicolas Frattaroli <[email protected]>
Link: https://lore.kernel.org/r/[email protected]
Signed-off-by: Mark Brown <[email protected]>
2 years agoASoC: dt-bindings: rockchip: i2s-tdm: Make grf property optional
Nicolas Frattaroli [Tue, 25 Oct 2022 12:41:29 +0000 (14:41 +0200)]
ASoC: dt-bindings: rockchip: i2s-tdm: Make grf property optional

Turns out most things don't require the GRF, so making the property
optional is the obvious move.

Signed-off-by: Nicolas Frattaroli <[email protected]>
Acked-by: Krzysztof Kozlowski <[email protected]>
Link: https://lore.kernel.org/r/[email protected]
Signed-off-by: Mark Brown <[email protected]>
2 years agofirmware: cs_dsp: Switch to using namespaced exports
Mark Brown [Fri, 25 Nov 2022 14:36:56 +0000 (14:36 +0000)]
firmware: cs_dsp: Switch to using namespaced exports

Merge series from Richard Fitzgerald <[email protected]>:

Use EXPORT_SYMBOL_NS_GPL() instead of EXPORT_SYMBOL_GPL() and patch the
three drivers that use cs_dsp to add the MODULE_IMPORT_NS().

To make the namespace more specific the KConfig symbol for cs_dsp is
changed from CS_DSP to FW_CS_DSP.

2 years agoASoC/soundwire: revisit interrupt and lcount handling
Mark Brown [Fri, 25 Nov 2022 14:23:11 +0000 (14:23 +0000)]
ASoC/soundwire: revisit interrupt and lcount handling

Merge series from Bard Liao <[email protected]>:

The code in drivers/soundwire/intel_init.c is hardware-dependent and the
code does not apply to new generations starting with MeteorLake. Refactor
and clean-up the code to make this intel_init.c hardware-agnostic and
move all hardware-dependencies in the SOF driver using chip descriptors.

2 years agoASoC: wm_adsp: Report when a control write changes the value
Mark Brown [Fri, 25 Nov 2022 14:23:03 +0000 (14:23 +0000)]
ASoC: wm_adsp: Report when a control write changes the value

Merge series from Richard Fitzgerald <[email protected]>:

Writing a firmware control should be returning 1 if the control value
changed, so these two patches add that.

Though this is an ALSA requirement it is also useful for non-ALSA clients
of cs_dsp to know if the control value changed, so the main handling is
implemented in cs_dsp. TLV controls are specifically an ALSA thing so they
are handled specially in wm_adsp.

Simon Trimmer (2):
  firmware: cs_dsp: cs_dsp_coeff_write_ctrl() should report changed
  ASoC: wm_adsp: Return whether changed when writing controls

 drivers/firmware/cirrus/cs_dsp.c | 17 ++++++++++++-----
 sound/soc/codecs/wm_adsp.c       | 27 ++++++++++++++++++---------
 2 files changed, 30 insertions(+), 14 deletions(-)

--
2.30.2

2 years agofirmware: cs_dsp: Make the exports namespaced
Richard Fitzgerald [Thu, 24 Nov 2022 13:45:56 +0000 (13:45 +0000)]
firmware: cs_dsp: Make the exports namespaced

Move all the exports into a namespace.
This also adds the MODULE_IMPORT_NS to the 3 drivers that use the
exported functions.

Signed-off-by: Richard Fitzgerald <[email protected]>
Link: https://lore.kernel.org/r/[email protected]
Signed-off-by: Mark Brown <[email protected]>
2 years agofirmware: cs_dsp: Rename KConfig symbol CS_DSP -> FW_CS_DSP
Richard Fitzgerald [Thu, 24 Nov 2022 13:45:55 +0000 (13:45 +0000)]
firmware: cs_dsp: Rename KConfig symbol CS_DSP -> FW_CS_DSP

Qualify the KConfig symbol for cs_dsp by adding a FW_ prefix so that
it is more explicit what is being referred to. This is preparation for
using the symbol to namespace the exports.

Signed-off-by: Richard Fitzgerald <[email protected]>
Link: https://lore.kernel.org/r/[email protected]
Signed-off-by: Mark Brown <[email protected]>
2 years agoASoC: codecs: src4xxx-i2c: Convert to i2c's .probe_new()
Uwe Kleine-König [Fri, 18 Nov 2022 22:45:37 +0000 (23:45 +0100)]
ASoC: codecs: src4xxx-i2c: Convert to i2c's .probe_new()

The probe function doesn't make use of the i2c_device_id * parameter so it
can be trivially converted.

Signed-off-by: Uwe Kleine-König <[email protected]>
Link: https://lore.kernel.org/r/[email protected]
Reviewed-by: Matt Flax <[email protected]>
Signed-off-by: Mark Brown <[email protected]>
2 years agoASoC: max98396: Convert to i2c's .probe_new()
Uwe Kleine-König [Fri, 18 Nov 2022 22:45:36 +0000 (23:45 +0100)]
ASoC: max98396: Convert to i2c's .probe_new()

.probe_new() doesn't get the i2c_device_id * parameter, so determine
that explicitly in the probe function.

Signed-off-by: Uwe Kleine-König <[email protected]>
Link: https://lore.kernel.org/r/[email protected]
Signed-off-by: Mark Brown <[email protected]>
2 years agoASoC: codecs: tas2780: Convert to i2c's .probe_new()
Uwe Kleine-König [Fri, 18 Nov 2022 22:45:38 +0000 (23:45 +0100)]
ASoC: codecs: tas2780: Convert to i2c's .probe_new()

The probe function doesn't make use of the i2c_device_id * parameter so it
can be trivially converted.

Signed-off-by: Uwe Kleine-König <[email protected]>
Link: https://lore.kernel.org/r/[email protected]
Signed-off-by: Mark Brown <[email protected]>
2 years agoASoC: codecs: es8326: Convert to i2c's .probe_new()
Uwe Kleine-König [Fri, 18 Nov 2022 22:45:35 +0000 (23:45 +0100)]
ASoC: codecs: es8326: Convert to i2c's .probe_new()

The probe function doesn't make use of the i2c_device_id * parameter so it
can be trivially converted.

Signed-off-by: Uwe Kleine-König <[email protected]>
Link: https://lore.kernel.org/r/[email protected]
Signed-off-by: Mark Brown <[email protected]>
2 years agoMerge branch 'i2c/client_device_id_helper-immutable' of https://git.kernel.org/pub...
Mark Brown [Thu, 24 Nov 2022 19:20:09 +0000 (19:20 +0000)]
Merge branch 'i2c/client_device_id_helper-immutable' of https://git.kernel.org/pub/scm/linux/kernel/git/wsa/linux into HEAD

so we can apply I2C cleanups.

2 years agoASoC: mediatek: mt8186: Correct I2S shared clocks
Jiaxin Yu [Thu, 24 Nov 2022 02:30:50 +0000 (10:30 +0800)]
ASoC: mediatek: mt8186: Correct I2S shared clocks

In mt8186 platform, I2S2 should be the main I2S port that provide
the clock, on the contrary I2S3 should be the second I2S port that
use this clock.

Fixes: 9986bdaee477 ("ASoC: mediatek: mt8186: Configure shared clocks")
Signed-off-by: Jiaxin Yu <[email protected]>
Reviewed-by: AngeloGioacchino Del Regno <[email protected]>
Link: https://lore.kernel.org/r/[email protected]
Signed-off-by: Mark Brown <[email protected]>
2 years agoASoC: dt-bindings: add compatible string for NAU8318
David Lin [Thu, 24 Nov 2022 05:56:58 +0000 (13:56 +0800)]
ASoC: dt-bindings: add compatible string for NAU8318

The audio amplifier NAU8318 is almost functionally identical to NAU8315.
Adds compatible string "nuvoton,nau8318" for driver reuse.

Signed-off-by: David Lin <[email protected]>
Link: https://lore.kernel.org/r/[email protected]
Signed-off-by: Mark Brown <[email protected]>
2 years agoASoC: nau8315: add new acpi id and compatible id
David Lin [Thu, 24 Nov 2022 05:56:57 +0000 (13:56 +0800)]
ASoC: nau8315: add new acpi id and compatible id

Add new acpi id and compatible id for nau8315.

Signed-off-by: David Lin <[email protected]>
Link: https://lore.kernel.org/r/[email protected]
Signed-off-by: Mark Brown <[email protected]>
2 years agoASoC: qcom: cleanup and fix dependency of QCOM_COMMON
Srinivas Kandagatla [Thu, 24 Nov 2022 14:03:51 +0000 (14:03 +0000)]
ASoC: qcom: cleanup and fix dependency of QCOM_COMMON

SND_SOC_QCOM_COMMON depends on SOUNDWIRE for some symbols but this
is not explicitly specified using Kconfig depends. On the other hand
SND_SOC_QCOM_COMMON is also directly selected by the sound card
Kconfigs, this could result in various combinations and some symbols
ending up in modules and soundcard that uses those symbols as in-build
driver.

Fix these issues by explicitly specifying the dependencies of
SND_SOC_QCOM_COMMON and also use imply a to select SND_SOC_QCOM_COMMON
so that the symbol is selected based on its dependencies.

Also remove dummy stubs in common.c around CONFIG_SOUNDWIRE

Fixes: 3bd975f3ae0a ("ASoC: qcom: sm8250: move some code to common")
Reported-by: kernel test robot <[email protected]>
Signed-off-by: Srinivas Kandagatla <[email protected]>
Link: https://lore.kernel.org/r/[email protected]
Signed-off-by: Mark Brown <[email protected]>
2 years agoASoC: qcom: Add checks for devm_kcalloc
Yuan Can [Thu, 24 Nov 2022 14:05:10 +0000 (14:05 +0000)]
ASoC: qcom: Add checks for devm_kcalloc

As the devm_kcalloc may return NULL, the return value needs to be checked
to avoid NULL poineter dereference.

Fixes: 24caf8d9eb10 ("ASoC: qcom: lpass-sc7180: Add platform driver for lpass audio")
Signed-off-by: Yuan Can <[email protected]>
Link: https://lore.kernel.org/r/[email protected]
Signed-off-by: Mark Brown <[email protected]>
2 years agoASoC: wm_adsp: Return whether changed when writing controls
Simon Trimmer [Wed, 23 Nov 2022 16:58:11 +0000 (16:58 +0000)]
ASoC: wm_adsp: Return whether changed when writing controls

Functions that update cs_dsp controls need to handle return codes that
indicate whether the control value changed. A return code of 1 indicates
a change, 0 indicates no-change and a negative value is an error
condition.

Acked controls implicitly change value when written so a successful
write shall always report that the value changed.

Signed-off-by: Simon Trimmer <[email protected]>
Signed-off-by: Richard Fitzgerald <[email protected]>
Link: https://lore.kernel.org/r/[email protected]
Signed-off-by: Mark Brown <[email protected]>
2 years agofirmware: cs_dsp: cs_dsp_coeff_write_ctrl() should report changed
Simon Trimmer [Wed, 23 Nov 2022 16:58:10 +0000 (16:58 +0000)]
firmware: cs_dsp: cs_dsp_coeff_write_ctrl() should report changed

ALSA callers need to know whether there was a change to the value so
that they can report a control write change correctly.

Signed-off-by: Simon Trimmer <[email protected]>
Signed-off-by: Richard Fitzgerald <[email protected]>
Link: https://lore.kernel.org/r/[email protected]
Signed-off-by: Mark Brown <[email protected]>
2 years agoASoC: SOF: Intel: hda: read multi-link capabilities earlier
Pierre-Louis Bossart [Fri, 11 Nov 2022 04:26:53 +0000 (12:26 +0800)]
ASoC: SOF: Intel: hda: read multi-link capabilities earlier

There's no reason to delay the multi-link parsing, this can be done
earlier before checking the SoundWire capabilities.

Signed-off-by: Pierre-Louis Bossart <[email protected]>
Reviewed-by: Péter Ujfalusi <[email protected]>
Reviewed-by: Ranjani Sridharan <[email protected]>
Signed-off-by: Bard Liao <[email protected]>
Link: https://lore.kernel.org/r/[email protected]
Signed-off-by: Mark Brown <[email protected]>
2 years agosoundwire: intel_init: remove check on number of links
Pierre-Louis Bossart [Fri, 11 Nov 2022 04:26:52 +0000 (12:26 +0800)]
soundwire: intel_init: remove check on number of links

The number of links is checked with a chip-dependent helper in the
caller, remove the check in drivers/soundwire/intel_init.c

This change makes intel_init.c hardware-agnostic - which is quite
fitting for a layer that only creates auxiliary devices.

Signed-off-by: Pierre-Louis Bossart <[email protected]>
Reviewed-by: Péter Ujfalusi <[email protected]>
Reviewed-by: Ranjani Sridharan <[email protected]>
Signed-off-by: Bard Liao <[email protected]>
Acked-By: Vinod Koul <[email protected]>
Link: https://lore.kernel.org/r/[email protected]
Signed-off-by: Mark Brown <[email protected]>
2 years agosoundwire: intel_init: remove sdw_intel_enable_irq()
Pierre-Louis Bossart [Fri, 11 Nov 2022 04:26:51 +0000 (12:26 +0800)]
soundwire: intel_init: remove sdw_intel_enable_irq()

The functionality is implemented with per-chip callbacks, there are no
users of this symbol, remove the code.

Signed-off-by: Pierre-Louis Bossart <[email protected]>
Reviewed-by: Péter Ujfalusi <[email protected]>
Reviewed-by: Ranjani Sridharan <[email protected]>
Signed-off-by: Bard Liao <[email protected]>
Acked-By: Vinod Koul <[email protected]>
Link: https://lore.kernel.org/r/[email protected]
Signed-off-by: Mark Brown <[email protected]>
2 years agoASoC: SOF: Intel: hda: add callback to check SoundWire lcount information
Pierre-Louis Bossart [Fri, 11 Nov 2022 04:26:50 +0000 (12:26 +0800)]
ASoC: SOF: Intel: hda: add callback to check SoundWire lcount information

The number of links is stored in different registers depending on the
IP version, add sdw_check_lcount() callback. This callback only checks
that the number of links supported in hardware is compatible with the
number of links exposed in ACPI _DSD properties.

Signed-off-by: Pierre-Louis Bossart <[email protected]>
Reviewed-by: Péter Ujfalusi <[email protected]>
Reviewed-by: Ranjani Sridharan <[email protected]>
Signed-off-by: Bard Liao <[email protected]>
Link: https://lore.kernel.org/r/[email protected]
Signed-off-by: Mark Brown <[email protected]>
2 years agoASoC: SOF: Intel: mtl: move SoundWire interrupt enabling to callback
Pierre-Louis Bossart [Fri, 11 Nov 2022 04:26:49 +0000 (12:26 +0800)]
ASoC: SOF: Intel: mtl: move SoundWire interrupt enabling to callback

There's no real rationale for enabling the SoundWire interrupt in the
init, this can be done from the enable_sdw_irq() callback.

Signed-off-by: Pierre-Louis Bossart <[email protected]>
Reviewed-by: Péter Ujfalusi <[email protected]>
Reviewed-by: Ranjani Sridharan <[email protected]>
Signed-off-by: Bard Liao <[email protected]>
Link: https://lore.kernel.org/r/[email protected]
Signed-off-by: Mark Brown <[email protected]>
2 years agoASoC: SOF: Intel: mtl: factor interrupt enable/disable interrupt functions
Pierre-Louis Bossart [Fri, 11 Nov 2022 04:26:48 +0000 (12:26 +0800)]
ASoC: SOF: Intel: mtl: factor interrupt enable/disable interrupt functions

The offsets and sequences are identical for interrupt enabling and
disabling, we can refactor the code with a single routine and a
boolean.

Signed-off-by: Pierre-Louis Bossart <[email protected]>
Reviewed-by: Péter Ujfalusi <[email protected]>
Reviewed-by: Ranjani Sridharan <[email protected]>
Signed-off-by: Bard Liao <[email protected]>
Link: https://lore.kernel.org/r/[email protected]
Signed-off-by: Mark Brown <[email protected]>
2 years agoASoC: SOF: Intel: hda: add per-chip enable_sdw_irq() callback
Pierre-Louis Bossart [Fri, 11 Nov 2022 04:26:47 +0000 (12:26 +0800)]
ASoC: SOF: Intel: hda: add per-chip enable_sdw_irq() callback

Different generations of Intel hardware rely on different programming
sequences to enable SoundWire IP. In existing hardware, the SoundWire
interrupt is enabled with a register field in the DSP register
space. With HDaudio multi-link extensions registers, the SoundWire
interrupt will be enabled with a generic interrupt enable field in
LCTL, without any dependency on the DSP being enabled.

Add a per-chip callback following the example of the check_sdw_irq()
model already upstream.

Note that the callback is not populated yet for MeteorLake (MTL) since
the interrupts are already enabled in the init. A follow-up patch will
move the functionality to this callback after a couple of cleanups.

Signed-off-by: Pierre-Louis Bossart <[email protected]>
Reviewed-by: Péter Ujfalusi <[email protected]>
Reviewed-by: Ranjani Sridharan <[email protected]>
Signed-off-by: Bard Liao <[email protected]>
Link: https://lore.kernel.org/r/[email protected]
Signed-off-by: Mark Brown <[email protected]>
2 years agosoundwire: intel_init: remove useless interrupt enablement in interrupt thread
Pierre-Louis Bossart [Fri, 11 Nov 2022 04:26:46 +0000 (12:26 +0800)]
soundwire: intel_init: remove useless interrupt enablement in interrupt thread

When the code reaches the SoundWire interrupt thread handling, the
interrupt was enabled already, and there is no code that disables it
-> this is a no-op sequence.

Signed-off-by: Pierre-Louis Bossart <[email protected]>
Reviewed-by: Péter Ujfalusi <[email protected]>
Reviewed-by: Ranjani Sridharan <[email protected]>
Signed-off-by: Bard Liao <[email protected]>
Acked-By: Vinod Koul <[email protected]>
Link: https://lore.kernel.org/r/[email protected]
Signed-off-by: Mark Brown <[email protected]>
2 years agoASoC: Intel: avs: DSP recovery and resume fixes
Mark Brown [Wed, 23 Nov 2022 12:22:12 +0000 (12:22 +0000)]
ASoC: Intel: avs: DSP recovery and resume fixes

Merge series from Cezary Rojewski <[email protected]>:

Two fixes that are result of the recent discussions [1][2].

First adds missing locking around snd_pcm_stop() while the second fix
sets substream state to DISCONNECTED if any suspend/resume related
operation fails so that userspace has means to be aware that something
went wrong during said operation.

2 years agoASoC: soc-dai: Do not call snd_soc_link_be_hw_params_fixup() twice
Richard Fitzgerald [Fri, 4 Nov 2022 16:02:52 +0000 (16:02 +0000)]
ASoC: soc-dai: Do not call snd_soc_link_be_hw_params_fixup() twice

For a BE link snd_soc_link_be_hw_params_fixup() is called by
dpcm_be_dai_hw_params() to initialize the params before it passes them
to __soc_pcm_hw_params(). Then __soc_pcm_hw_params() refines params to
match the BE codec and passes that to snd_soc_dai_hw_params().

The second call of snd_soc_link_be_hw_params_fixup() within
snd_soc_dai_hw_params() was overwriting the refined params with the
original BE CPU DAI params. This would then lead to various problems,
for example passing an invalid number of channels to the codec driver
hw_params(), or enabling more AIF widgets on the codec than are actually
mapped by TDM slots.

These errors may not be noticed on a simple 1:1 link between one CPU DAI
and one codec DAI, because most likely they have the same DAI config
(though this is not necessarily true, for example if the CPU end has dummy
TDM slots to achieve a desirable BCLK).

For 1:N mappings there are likely to be multiple codecs using different
subsets of the TDM slots and this overwriting of the refined params
can cause incorrect configuration of each codec on the link.

The erroneous extra call to the BE fixup function() was introduced
by:
commit a655de808cbd ("ASoC: core: Allow topology to override machine
driver FE DAI link config.")

at that time, the call to the BE fixup was already done by
dpcm_be_dai_hw_params(), which was introduced several years earlier
by:
commit 01d7584cd2e5 ("ASoC: dpcm: Add Dynamic PCM core operations.")

The erroneous code has changed and moved to a different source file
since the patch that introduced it, so this fix patch won't directly
apply as a fix on top of code older than:
commit 8b4ba1d31771 ("ASoC: soc-dai: fix up hw params only if it is
needed")

though it can be applied with some minor adjustment to code before
that patch but after:
commit aa6166c2ac28 ("ASoC: soc-dai: mv soc_dai_hw_params() to soc-dai")

On any tree older than that the code is in soc-pcm.c.

Signed-off-by: Richard Fitzgerald <[email protected]>
Link: https://lore.kernel.org/r/[email protected]
Signed-off-by: Mark Brown <[email protected]>
2 years agoASoC: wm_adsp: Allow client to hook into pre_run callback
Richard Fitzgerald [Wed, 9 Nov 2022 16:53:29 +0000 (16:53 +0000)]
ASoC: wm_adsp: Allow client to hook into pre_run callback

Some HALO-based codecs need some additional custom setup in the
pre_run stage of cs_dsp. Implement the callback in wm_adsp to call
an optional codec driver callback.

Signed-off-by: Richard Fitzgerald <[email protected]>
Link: https://lore.kernel.org/r/[email protected]
Signed-off-by: Mark Brown <[email protected]>
2 years agoASoC: Intel: avs: Disconnect substream if suspend or resume fails
Cezary Rojewski [Wed, 16 Nov 2022 11:55:50 +0000 (12:55 +0100)]
ASoC: Intel: avs: Disconnect substream if suspend or resume fails

To improve performance and overall system stability, suspend/resume
operations for ASoC cards always return success status and defer the
actual work.

Because of that, if a substream fails to resume, userspace may still
attempt to invoke commands on it as from their perspective the operation
completed successfully. Set substream's state to DISCONNECTED to ensure
no further commands are attempted.

Signed-off-by: Cezary Rojewski <[email protected]>
Link: https://lore.kernel.org/r/[email protected]
Signed-off-by: Mark Brown <[email protected]>
2 years agoASoC: Intel: avs: Lock substream before snd_pcm_stop()
Cezary Rojewski [Wed, 16 Nov 2022 11:55:49 +0000 (12:55 +0100)]
ASoC: Intel: avs: Lock substream before snd_pcm_stop()

snd_pcm_stop() shall be called with stream lock held to prevent any
races between nonatomic streaming operations.

Fixes: 2f1f570cd730 ("ASoC: Intel: avs: Coredump and recovery flow")
Signed-off-by: Cezary Rojewski <[email protected]>
Link: https://lore.kernel.org/r/[email protected]
Signed-off-by: Mark Brown <[email protected]>
2 years agoASoC: Intel: avs: Add missing audio amplifier for KBL
Alicja Michalska [Mon, 21 Nov 2022 23:20:40 +0000 (00:20 +0100)]
ASoC: Intel: avs: Add missing audio amplifier for KBL

KBL platform is missing the definition of 'max98357a' audio amplifier.
This amplifier is used on many KBL Chromebooks, for instance variant
'nami' of 'Google/poppy' baseboard.

Reported-by: CoolStar <[email protected]>
Signed-off-by: Alicja Michalska <[email protected]>
Link: https://lore.kernel.org/r/Y3wHyJ/EcsLRHGr3@tora
Signed-off-by: Mark Brown <[email protected]>
2 years agoASoC: Intel: add Dell SKU 0C11 support
Mark Brown [Tue, 22 Nov 2022 15:20:52 +0000 (15:20 +0000)]
ASoC: Intel: add Dell SKU 0C11 support

Merge series from Bard Liao <[email protected]>:

Add Dell SKU 0C11 support with rt1318 codec.

2 years agoASoC: Intel: soc-acpi: add SKU 0C11 SoundWire configuration
Gongjun Song [Thu, 17 Nov 2022 00:27:58 +0000 (08:27 +0800)]
ASoC: Intel: soc-acpi: add SKU 0C11 SoundWire configuration

Audio hardware configuration of SKU 0C11 product is rt711 on link0,
two rt1318s on link1 and link2, rt714 on link3

Signed-off-by: Gongjun Song <[email protected]>
Signed-off-by: Bard Liao <[email protected]>
Link: https://lore.kernel.org/r/[email protected]
Signed-off-by: Mark Brown <[email protected]>
2 years agoASoC: Intel: sof_sdw: Add support for SKU 0C11 product
Gongjun Song [Thu, 17 Nov 2022 00:27:57 +0000 (08:27 +0800)]
ASoC: Intel: sof_sdw: Add support for SKU 0C11 product

SKU 0C11 product supports a SoundWire headset codec, SoundWire
capture from local microphones and two SoundWire amplifiers.

Signed-off-by: Gongjun Song <[email protected]>
Signed-off-by: Bard Liao <[email protected]>
Link: https://lore.kernel.org/r/[email protected]
Signed-off-by: Mark Brown <[email protected]>
2 years agoASoC: intel: sof_sdw: add rt1318 codec support.
Gongjun Song [Thu, 17 Nov 2022 00:27:56 +0000 (08:27 +0800)]
ASoC: intel: sof_sdw: add rt1318 codec support.

Add rt1318 sdca codec support in sof_sdw machine driver.

Signed-off-by: Gongjun Song <[email protected]>
Signed-off-by: Bard Liao <[email protected]>
Link: https://lore.kernel.org/r/[email protected]
Signed-off-by: Mark Brown <[email protected]>
2 years agoASoC: Intel: Skylake: Fix Kconfig dependency
Lili Li [Mon, 21 Nov 2022 10:47:42 +0000 (18:47 +0800)]
ASoC: Intel: Skylake: Fix Kconfig dependency

Commit e4746d94d00c ("ASoC: Intel: Skylake: Introduce HDA codec init and
exit routines") introduced HDA codec init routine which depends on SND_HDA.
Select SND_SOC_HDAC_HDA unconditionally to fix following compile error:
ERROR: modpost: "snd_hda_codec_device_init" [sound/soc/intel/skylake/snd-soc-skl.ko] undefined!

Fixes: e4746d94d00c ("ASoC: Intel: Skylake: Introduce HDA codec init and exit routines")
Reviewed-by: Junxiao Chang <[email protected]>
Suggested-by: Cezary Rojewski <[email protected]>
Signed-off-by: Lili Li <[email protected]>
Reviewed-by: Cezary Rojewski <[email protected]>
Link: https://lore.kernel.org/r/[email protected]
Signed-off-by: Mark Brown <[email protected]>
2 years agoASoC: nau8825: Add a manually mechanism for detection failure
David Lin [Tue, 22 Nov 2022 07:38:56 +0000 (15:38 +0800)]
ASoC: nau8825: Add a manually mechanism for detection failure

This patch is to use saradc to check the jack type when auto
detection is still failure.

Signed-off-by: David Lin <[email protected]>
Link: https://lore.kernel.org/r/[email protected]
Signed-off-by: Mark Brown <[email protected]>
2 years agoASoC: nau8825: Adjust internal clock during jack detection
David Lin [Tue, 22 Nov 2022 07:38:55 +0000 (15:38 +0800)]
ASoC: nau8825: Adjust internal clock during jack detection

This patch is to rasie up internal clock during jack detection.
The fast clock will accelerate charge and discharge effect.
So this mechanism will make jack detection more robust.

Signed-off-by: David Lin <[email protected]>
Link: https://lore.kernel.org/r/[email protected]
Signed-off-by: Mark Brown <[email protected]>
2 years agoASoC: Intel: sof_sdw: Add support for SKU 0C4F product
Gongjun Song [Tue, 22 Nov 2022 05:20:52 +0000 (13:20 +0800)]
ASoC: Intel: sof_sdw: Add support for SKU 0C4F product

SKU 0C4F product supports a SoundWire headset codec, SoundWire
capture from local microphones and two SoundWire amplifiers.

Signed-off-by: Gongjun Song <[email protected]>
Signed-off-by: Bard Liao <[email protected]>
Link: https://lore.kernel.org/r/[email protected]
Signed-off-by: Mark Brown <[email protected]>
2 years agoASoC: core: Exit all links before removing their components
Cezary Rojewski [Thu, 27 Oct 2022 08:58:40 +0000 (10:58 +0200)]
ASoC: core: Exit all links before removing their components

Flows leading to link->init() and link->exit() are not symmetric.
Currently the relevant part of card probe sequence goes as:

for_each_card_rtds(card, rtd)
for_each_rtd_components(rtd, i, component)
component->probe()
for_each_card_rtds(card, rtd)
for_each_rtd_dais(rtd, i, dai)
dai->probe()
for_each_card_rtds(card, rtd)
rtd->init()

On the other side, equivalent remove sequence goes as:

for_each_card_rtds(card, rtd)
for_each_rtd_dais(rtd, i, dai)
dai->remove()
for_each_card_rtds(card, rtd)
for_each_rtd_components(rtd, i, component)
component->remove()
for_each_card_rtds(card, rtd)
rtd->exit()

what can lead to errors as link->exit() may still operate on resources
owned by its components despite the probability of them being freed
during the component->remove().

This change modifies the remove sequence to:

for_each_card_rtds(card, rtd)
rtd->exit()
for_each_card_rtds(card, rtd)
for_each_rtd_dais(rtd, i, dai)
dai->remove()
for_each_card_rtds(card, rtd)
for_each_rtd_components(rtd, i, component)
component->remove()

so code found in link->exit() is safe to touch any component stuff as
component->remove() has not been called yet.

Signed-off-by: Cezary Rojewski <[email protected]>
Reviewed-by: Amadeusz Sławiński <[email protected]>
Link: https://lore.kernel.org/r/[email protected]
Signed-off-by: Mark Brown <[email protected]>
2 years agoASoC: mchp-spdiftx: add power saving features
Mark Brown [Fri, 18 Nov 2022 15:13:50 +0000 (15:13 +0000)]
ASoC: mchp-spdiftx: add power saving features

Merge series from Claudiu Beznea <[email protected]>:

This series adds support for runtime PM and system suspend/resume
for Microchip SPDIFTX (patches 2/3, 3/3). Along with it I took the
chance and added a minor cleanup (patch 1/3).

2 years agoASoC: Intel: sof_sdw_amp: mark coeff tables with __maybe_unused
Pierre-Louis Bossart [Fri, 18 Nov 2022 01:51:06 +0000 (09:51 +0800)]
ASoC: Intel: sof_sdw_amp: mark coeff tables with __maybe_unused

The same file provides two tables used in separate drivers, make them
as __maybe_unused to avoid errors:

sound/soc/intel/boards/sof_sdw_amp_coeff_tables.h:163:17: error:
‘dell_0b00_bq_params’ defined but not used
[-Werror=unused-const-variable=]
  163 | static const u8 dell_0b00_bq_params[] = {

Signed-off-by: Pierre-Louis Bossart <[email protected]>
Signed-off-by: Bard Liao <[email protected]>
Link: https://lore.kernel.org/r/[email protected]
Signed-off-by: Mark Brown <[email protected]>
2 years agoASoC: Intel: avs: Initialize private data for subsequent HDA FEs
Cezary Rojewski [Fri, 18 Nov 2022 11:30:52 +0000 (12:30 +0100)]
ASoC: Intel: avs: Initialize private data for subsequent HDA FEs

HDAudio implementation found in sound/pci/hda expects a valid stream
pointer in substream->runtime->private_data location. For ASoC users,
that should point to a valid link stream which is assigned when BE
opens.

As BE borrows its runtime from FE, the information may be lost when
reparenting comes into picture - see dpcm_be_reparent(). To support the
DPCM reparenting functionality for HDAudio scenarios while still
fulfilling expectations of HDAudio common code, have all FEs point to
the same private data.

Signed-off-by: Cezary Rojewski <[email protected]>
Link: https://lore.kernel.org/r/[email protected]
Signed-off-by: Mark Brown <[email protected]>
2 years agoASoC: mchp-spdiftx: add support for system suspend/resume
Claudiu Beznea [Thu, 17 Nov 2022 12:37:50 +0000 (14:37 +0200)]
ASoC: mchp-spdiftx: add support for system suspend/resume

Add support for system suspend/resume by moving the enable/disable
of interrupts in mchp_spdiftx_trigger() on SNDRV_PCM_TRIGGER_SUSPEND/
SNDRV_PCM_TRIGGER_RESUME commands.

Signed-off-by: Claudiu Beznea <[email protected]>
Link: https://lore.kernel.org/r/[email protected]
Signed-off-by: Mark Brown <[email protected]>
2 years agoASoC: mchp-spdiftx: add runtime pm support
Claudiu Beznea [Thu, 17 Nov 2022 12:37:49 +0000 (14:37 +0200)]
ASoC: mchp-spdiftx: add runtime pm support

Add runtime PM support for Microchip SPDIFTX driver. The runtime PM
APIs disables/enables IP's clock and enables/disable caching for
regmap.

Signed-off-by: Claudiu Beznea <[email protected]>
Link: https://lore.kernel.org/r/[email protected]
Signed-off-by: Mark Brown <[email protected]>
2 years agoASoC: mchp-spdiftx: simplify locking around ctrl->ch_stat
Claudiu Beznea [Thu, 17 Nov 2022 12:37:48 +0000 (14:37 +0200)]
ASoC: mchp-spdiftx: simplify locking around ctrl->ch_stat

Use a temporary variable to keep the AES3 value. With this a
spin_unlock_irqrestore() call has been removed from the final code.

Signed-off-by: Claudiu Beznea <[email protected]>
Link: https://lore.kernel.org/r/[email protected]
Signed-off-by: Mark Brown <[email protected]>
2 years agoASoC: dt-bindings: sun50i-dmic: Add D1 compatible string
Samuel Holland [Wed, 16 Nov 2022 03:46:21 +0000 (21:46 -0600)]
ASoC: dt-bindings: sun50i-dmic: Add D1 compatible string

The Allwinner D1 SoC has a DMIC codec like the one in the H6. It appears
to be register-compatible with the H6 variant, and the existing Linux
driver has been tested on a D1-based board, the Lichee RV 86 Panel.

Signed-off-by: Samuel Holland <[email protected]>
Acked-by: Ban Tao <[email protected]>
Acked-by: Krzysztof Kozlowski <[email protected]>
Link: https://lore.kernel.org/r/[email protected]
Signed-off-by: Mark Brown <[email protected]>
2 years agoASoC: amd: acp: Fix possible UAF in acp_dma_open
Gaosheng Cui [Fri, 18 Nov 2022 03:00:56 +0000 (11:00 +0800)]
ASoC: amd: acp: Fix possible UAF in acp_dma_open

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 <[email protected]>
Link: https://lore.kernel.org/r/[email protected]
Signed-off-by: Mark Brown <[email protected]>
2 years agoASoC: Intel: sof_nau8825: support rt1015p speaker amplifier
Brent Lu [Thu, 17 Nov 2022 23:19:19 +0000 (17:19 -0600)]
ASoC: Intel: sof_nau8825: support rt1015p speaker amplifier

Add rt1015p speaker amplifier support with a new board info
'adl_rt1015p_nau8825' which supports NAU8825 on SSP0 and ALC1015Q on
SSP1.

Reviewed-by: Bard Liao <[email protected]>
Signed-off-by: Brent Lu <[email protected]>
Signed-off-by: Pierre-Louis Bossart <[email protected]>
Link: https://lore.kernel.org/r/[email protected]
Signed-off-by: Mark Brown <[email protected]>
2 years agoASoC: SOF: probes: Check ops before memory allocation
Andy Shevchenko [Thu, 17 Nov 2022 10:32:23 +0000 (12:32 +0200)]
ASoC: SOF: probes: Check ops before memory allocation

We may check ops before spending resources on memory allocation.
While at it, utilize dev_get_platdata() helper.

Signed-off-by: Andy Shevchenko <[email protected]>
Acked-by: Peter Ujfalusi <[email protected]>
Link: https://lore.kernel.org/r/[email protected]
Signed-off-by: Mark Brown <[email protected]>
2 years agoASoC: codecs: wsa883x: Simplify with dev_err_probe
Krzysztof Kozlowski [Wed, 9 Nov 2022 16:37:59 +0000 (17:37 +0100)]
ASoC: codecs: wsa883x: Simplify with dev_err_probe

Code can be a bit simpler with dev_err_probe().

Signed-off-by: Krzysztof Kozlowski <[email protected]>
Link: https://lore.kernel.org/r/[email protected]
Signed-off-by: Mark Brown <[email protected]>
2 years agoASoC: codecs: wsa883x: Shutdown on error path
Krzysztof Kozlowski [Wed, 9 Nov 2022 16:37:58 +0000 (17:37 +0100)]
ASoC: codecs: wsa883x: Shutdown on error path

If probe fails, toggle shutdown via GPIO to save power and reverse
probe actions.

Signed-off-by: Krzysztof Kozlowski <[email protected]>
Link: https://lore.kernel.org/r/[email protected]
Signed-off-by: Mark Brown <[email protected]>
2 years agoASoC: amd: ps: Move acp63_dev_data strcture from PCI driver
Syed Saba Kareem [Wed, 16 Nov 2022 10:59:23 +0000 (16:29 +0530)]
ASoC: amd: ps: Move acp63_dev_data strcture from PCI driver

Move acp63_dev_data structure from PCI driver to acp header file.

Signed-off-by: Syed Saba Kareem <[email protected]>
Link: https://lore.kernel.org/r/[email protected]
Signed-off-by: Mark Brown <[email protected]>
2 years agoASoC: amd: ps: update macros with ps platform naming convention
Syed Saba Kareem [Wed, 16 Nov 2022 10:59:22 +0000 (16:29 +0530)]
ASoC: amd: ps: update macros with ps platform naming convention

Update macros using ps platform naming convention.

Signed-off-by: Syed Saba Kareem <[email protected]>
Link: https://lore.kernel.org/r/[email protected]
Signed-off-by: Mark Brown <[email protected]>
2 years agoAdds the combination of headset codec ALC5682I-VD + amp rt1019p
Mark Brown [Wed, 16 Nov 2022 13:12:20 +0000 (13:12 +0000)]
Adds the combination of headset codec ALC5682I-VD + amp rt1019p

Merge series from Ajye Huang <[email protected]>:

v1:
- machine driver:
  - Adds the combination of headset codec ALC5682I-VD + amp rt1019p.
  - Remove the duplicate code in machine driver.

Ajye Huang (2):
  ASoC: Intel: sof_rt5682: add support for ALC5682I-VD with amp rt1019p
  ASoC: Intel: sof rt5682: remove the duplicate codes

 sound/soc/intel/boards/sof_rt5682.c               | 7 +------
 sound/soc/intel/common/soc-acpi-intel-adl-match.c | 4 ++--
 2 files changed, 3 insertions(+), 8 deletions(-)

--
2.25.1

2 years agoASoC: rt1318: Add RT1318 SDCA vendor-specific driver
Shuming Fan [Tue, 8 Nov 2022 09:27:27 +0000 (17:27 +0800)]
ASoC: rt1318: Add RT1318 SDCA vendor-specific driver

This is the initial amplifier driver for rt1318 SDCA version.

Signed-off-by: Shuming Fan <[email protected]>
Link: https://lore.kernel.org/r/[email protected]
Signed-off-by: Mark Brown <[email protected]>
2 years agoASoC: Intel: sof rt5682: remove the duplicate codes
Ajye Huang [Tue, 8 Nov 2022 04:27:16 +0000 (12:27 +0800)]
ASoC: Intel: sof rt5682: remove the duplicate codes

Remove the redundant code to prevent user confuse.

Signed-off-by: Ajye Huang <[email protected]>
Acked-by: Pierre-Louis Bossart <[email protected]>
Link: https://lore.kernel.org/r/20221108042716.2930255-3-ajye_huang@compal.corp-partner.google.com
Signed-off-by: Mark Brown <[email protected]>
2 years agoASoC: Intel: sof_rt5682: add support for ALC5682I-VD with amp rt1019p
Ajye Huang [Tue, 8 Nov 2022 04:27:15 +0000 (12:27 +0800)]
ASoC: Intel: sof_rt5682: add support for ALC5682I-VD with amp rt1019p

This patch adds the driver data for two rt1019 speaker amplifiers on
SSP1 and ALC5682I-VD on SSP0 for ADL platform.

Signed-off-by: Ajye Huang <[email protected]>
Acked-by: Pierre-Louis Bossart <[email protected]>
Link: https://lore.kernel.org/r/20221108042716.2930255-2-ajye_huang@compal.corp-partner.google.com
Signed-off-by: Mark Brown <[email protected]>
2 years agoASoC: core: fix wrong size kzalloc for rtd's components member
lishqchn [Tue, 8 Nov 2022 04:24:56 +0000 (12:24 +0800)]
ASoC: core: fix wrong size kzalloc for rtd's components member

The actual space for struct snd_soc_component has been allocated by
snd_soc_register_component, here rtd's components are pointers to
components, I replace the base size from *component to component.

Signed-off-by: lishqchn <[email protected]>
Link: https://lore.kernel.org/r/[email protected]
Signed-off-by: Mark Brown <[email protected]>
2 years agoASoC: codecs: tx-macro: add dmic support via tx macro
Srinivas Kandagatla [Tue, 15 Nov 2022 06:54:30 +0000 (06:54 +0000)]
ASoC: codecs: tx-macro: add dmic support via tx macro

DMIC Paths into LPASS digital codec can go via tx-macro or va-macro codec, add
support to tx-macro path as va-macro path is already supported.

Signed-off-by: Srinivas Kandagatla <[email protected]>
Link: https://lore.kernel.org/r/[email protected]
Signed-off-by: Mark Brown <[email protected]>
2 years agoi2c: core: Introduce i2c_client_get_device_id helper function
Angel Iglesias [Sun, 13 Nov 2022 17:46:30 +0000 (18:46 +0100)]
i2c: core: Introduce i2c_client_get_device_id helper function

Introduces new helper function to aid in .probe_new() refactors. In order
to use existing i2c_get_device_id() on the probe callback, the device
match table needs to be accessible in that function, which would require
bigger refactors in some drivers using the deprecated .probe callback.

This issue was discussed in more detail in the IIO mailing list.

Link: https://lore.kernel.org/all/[email protected]/
Suggested-by: Nuno Sá <[email protected]>
Suggested-by: Andy Shevchenko <[email protected]>
Suggested-by: Jonathan Cameron <[email protected]>
Signed-off-by: Angel Iglesias <[email protected]>
Reviewed-by: Andy Shevchenko <[email protected]>
Reviewed-by: Jonathan Cameron <[email protected]>
Signed-off-by: Wolfram Sang <[email protected]>
2 years agoASoC: sunxi: use devm_platform_get_and_ioremap_resource()
Minghao Chi [Fri, 11 Nov 2022 08:41:51 +0000 (16:41 +0800)]
ASoC: sunxi: use devm_platform_get_and_ioremap_resource()

Convert platform_get_resource(), devm_ioremap_resource() to a single
call to devm_platform_get_and_ioremap_resource(), as this is exactly
what this function does.

Reported-by: Zeal Robot <[email protected]>
Signed-off-by: Minghao Chi <[email protected]>
Acked-by: Samuel Holland <[email protected]>
Link: https://lore.kernel.org/r/[email protected]
Signed-off-by: Mark Brown <[email protected]>
2 years agoASoC: pxa: fix null-pointer dereference in filter()
Zeng Heng [Mon, 14 Nov 2022 08:56:29 +0000 (16:56 +0800)]
ASoC: pxa: fix null-pointer dereference in filter()

kasprintf() would return NULL pointer when kmalloc() fail to allocate.
Need to check the return pointer before calling strcmp().

Fixes: 7a824e214e25 ("ASoC: mmp: add audio dma support")
Signed-off-by: Zeng Heng <[email protected]>
Link: https://lore.kernel.org/r/[email protected]
Signed-off-by: Mark Brown <[email protected]>
2 years agoASoC: codecs: Remove a useless include
Christophe JAILLET [Sat, 12 Nov 2022 21:12:13 +0000 (22:12 +0100)]
ASoC: codecs: Remove a useless include

<linux/gcd.h> is not needed for these drivers. Remove the corresponding
#include.

Signed-off-by: Christophe JAILLET <[email protected]>
Link: https://lore.kernel.org/r/875ca433849025edf8c23624cf29b0e2250bba50.1668287523.git.christophe.jaillet@wanadoo.fr
Signed-off-by: Mark Brown <[email protected]>
2 years agoLinux 6.1-rc5 v6.1-rc5
Linus Torvalds [Sun, 13 Nov 2022 21:12:55 +0000 (13:12 -0800)]
Linux 6.1-rc5

2 years agoMerge tag 'mips-fixes_6.1_1' of git://git.kernel.org/pub/scm/linux/kernel/git/mips...
Linus Torvalds [Sun, 13 Nov 2022 15:57:33 +0000 (07:57 -0800)]
Merge tag 'mips-fixes_6.1_1' of git://git.kernel.org/pub/scm/linux/kernel/git/mips/linux

Pull MIPS fixes from Thomas Bogendoerfer:

 - fix jump label branch range check

 - check kmalloc failures in Loongson64 kexec

 - fix builds with clang-14

 - fix char/int handling in pic32

* tag 'mips-fixes_6.1_1' of git://git.kernel.org/pub/scm/linux/kernel/git/mips/linux:
  MIPS: pic32: treat port as signed integer
  MIPS: jump_label: Fix compat branch range check
  mips: alchemy: gpio: Include the right header
  MIPS: Loongson64: Add WARN_ON on kexec related kmalloc failed
  MIPS: fix duplicate definitions for exported symbols
  mips: boot/compressed: use __NO_FORTIFY

2 years agoMerge tag 'efi-fixes-for-v6.1-3' of git://git.kernel.org/pub/scm/linux/kernel/git...
Linus Torvalds [Sun, 13 Nov 2022 15:52:22 +0000 (07:52 -0800)]
Merge tag 'efi-fixes-for-v6.1-3' of git://git.kernel.org/pub/scm/linux/kernel/git/efi/efi

Pull EFI fixes from Ard Biesheuvel:

 - Force the use of SetVirtualAddressMap() on Ampera Altra arm64
   machines, which crash in SetTime() if no virtual remapping is used

   This is the first time we've added an SMBIOS based quirk on arm64,
   but fortunately, we can just call a EFI protocol to grab the type #1
   SMBIOS record when running in the stub, so we don't need all the
   machinery we have in the kernel proper to parse SMBIOS data.

 - Drop a spurious warning on misaligned runtime regions when using 16k
   or 64k pages on arm64

* tag 'efi-fixes-for-v6.1-3' of git://git.kernel.org/pub/scm/linux/kernel/git/efi/efi:
  arm64: efi: Fix handling of misaligned runtime regions and drop warning
  arm64: efi: Force the use of SetVirtualAddressMap() on Altra machines

2 years agoMerge tag 'scsi-fixes' of git://git.kernel.org/pub/scm/linux/kernel/git/jejb/scsi
Linus Torvalds [Sat, 12 Nov 2022 17:27:15 +0000 (09:27 -0800)]
Merge tag 'scsi-fixes' of git://git.kernel.org/pub/scm/linux/kernel/git/jejb/scsi

Pull SCSI fixes from James Bottomley:
 "Three small fixes, all in drivers.

  The sas one is in an unlikely error leg, the debug one is to make it
  more standards conformant and the ibmvfc one is to fix a user visible
  bug where a failover could lose all paths to the device"

* tag 'scsi-fixes' of git://git.kernel.org/pub/scm/linux/kernel/git/jejb/scsi:
  scsi: scsi_debug: Make the READ CAPACITY response compliant with ZBC
  scsi: scsi_transport_sas: Fix error handling in sas_phy_add()
  scsi: ibmvfc: Avoid path failures during live migration

2 years agoMerge tag 'sound-fix-6.1-rc5' of git://git.kernel.org/pub/scm/linux/kernel/git/tiwai...
Linus Torvalds [Sat, 12 Nov 2022 17:23:32 +0000 (09:23 -0800)]
Merge tag 'sound-fix-6.1-rc5' of git://git.kernel.org/pub/scm/linux/kernel/git/tiwai/sound

Pull additional sound fix from Takashi Iwai:
 "A regression fix for the latest memalloc helper change"

* tag 'sound-fix-6.1-rc5' of git://git.kernel.org/pub/scm/linux/kernel/git/tiwai/sound:
  ALSA: memalloc: Try dma_alloc_noncontiguous() at first

2 years agoALSA: memalloc: Try dma_alloc_noncontiguous() at first
Takashi Iwai [Sat, 12 Nov 2022 08:47:18 +0000 (09:47 +0100)]
ALSA: memalloc: Try dma_alloc_noncontiguous() at first

The latest fix for the non-contiguous memalloc helper changed the
allocation method for a non-IOMMU system to use only the fallback
allocator.  This should have worked, but it caused a problem sometimes
when too many non-contiguous pages are allocated that can't be treated
by HD-audio controller.

As a quirk workaround, go back to the original strategy: use
dma_alloc_noncontiguous() at first, and apply the fallback only when
it fails, but only for non-IOMMU case.

We'll need a better fix in the fallback code as well, but this
workaround should paper over most cases.

Fixes: 9736a325137b ("ALSA: memalloc: Don't fall back for SG-buffer with IOMMU")
Reported-by: Linus Torvalds <[email protected]>
Link: https://lore.kernel.org/r/CAHk-=wgSH5ubdvt76gNwa004ooZAEJL_1Q-Fyw5M2FDdqL==dg@mail.gmail.com
Link: https://lore.kernel.org/r/[email protected]
Signed-off-by: Takashi Iwai <[email protected]>
2 years agoMerge tag 'ata-6.1-rc5' of git://git.kernel.org/pub/scm/linux/kernel/git/dlemoal...
Linus Torvalds [Sat, 12 Nov 2022 04:27:13 +0000 (20:27 -0800)]
Merge tag 'ata-6.1-rc5' of git://git.kernel.org/pub/scm/linux/kernel/git/dlemoal/libata

Pull ata fixes from Damien Le Moal:
 "Several libata generic code fixes for rc5:

   - Add missing translation of the SYNCHRONIZE CACHE 16 scsi command as
     this command is mandatory for host-managed ZBC drives.

     The lack of support for it in libata-scsi was causing issues with
     some passthrough applications using ZBC drives (from Shin'ichiro).

   - Fix the error path of libata-transport host, port, link and device
     attributes initialization (from Yingliang).

   - Prevent issuing new commands to a drive that is in the NCQ error
     state and undergoing recovery (From Niklas).

     This bug went unnoticed for a long time as commands issued to a
     drive in error state are aborted immediately and retried by the
     scsi layer, hiding the useless abort-and-retry sequence"

* tag 'ata-6.1-rc5' of git://git.kernel.org/pub/scm/linux/kernel/git/dlemoal/libata:
  ata: libata-core: do not issue non-internal commands once EH is pending
  ata: libata-transport: fix error handling in ata_tdev_add()
  ata: libata-transport: fix error handling in ata_tlink_add()
  ata: libata-transport: fix error handling in ata_tport_add()
  ata: libata-transport: fix double ata_host_put() in ata_tport_add()
  ata: libata-scsi: fix SYNCHRONIZE CACHE (16) command failure

2 years agoMerge tag 'mm-hotfixes-stable-2022-11-11' of git://git.kernel.org/pub/scm/linux/kerne...
Linus Torvalds [Sat, 12 Nov 2022 01:18:42 +0000 (17:18 -0800)]
Merge tag 'mm-hotfixes-stable-2022-11-11' of git://git.kernel.org/pub/scm/linux/kernel/git/akpm/mm

Pull misc hotfixes from Andrew Morton:
 "22 hotfixes.

  Eight are cc:stable and the remainder address issues which were
  introduced post-6.0 or which aren't considered serious enough to
  justify a -stable backport"

* tag 'mm-hotfixes-stable-2022-11-11' of git://git.kernel.org/pub/scm/linux/kernel/git/akpm/mm: (22 commits)
  docs: kmsan: fix formatting of "Example report"
  mm/damon/dbgfs: check if rm_contexts input is for a real context
  maple_tree: don't set a new maximum on the node when not reusing nodes
  maple_tree: fix depth tracking in maple_state
  arch/x86/mm/hugetlbpage.c: pud_huge() returns 0 when using 2-level paging
  fs: fix leaked psi pressure state
  nilfs2: fix use-after-free bug of ns_writer on remount
  x86/traps: avoid KMSAN bugs originating from handle_bug()
  kmsan: make sure PREEMPT_RT is off
  Kconfig.debug: ensure early check for KMSAN in CONFIG_KMSAN_WARN
  x86/uaccess: instrument copy_from_user_nmi()
  kmsan: core: kmsan_in_runtime() should return true in NMI context
  mm: hugetlb_vmemmap: include missing linux/moduleparam.h
  mm/shmem: use page_mapping() to detect page cache for uffd continue
  mm/memremap.c: map FS_DAX device memory as decrypted
  Partly revert "mm/thp: carry over dirty bit when thp splits on pmd"
  nilfs2: fix deadlock in nilfs_count_free_blocks()
  mm/mmap: fix memory leak in mmap_region()
  hugetlbfs: don't delete error page from pagecache
  maple_tree: reorganize testing to restore module testing
  ...

This page took 0.112645 seconds and 4 git commands to generate.