Dan Carpenter [Wed, 22 Jan 2025 07:18:06 +0000 (10:18 +0300)]
ALSA: hda: tas2781-spi: Delete some dead code
The scnprintf() function never returns negatives. And it won't return
zero here either, plus if it did we'd need to fix the error code.
Delete this dead code.
Takashi Iwai [Mon, 20 Jan 2025 15:15:07 +0000 (16:15 +0100)]
Merge tag 'asoc-v6.14' of https://git.kernel.org/pub/scm/linux/kernel/git/broonie/sound into for-linus
ASoC: Updates for v6.14
This was quite a quiet release for what I imagine are holiday related
reasons, the diffstat is dominated by some Cirrus Logic Kunit tests.
There's the usual mix of small improvements and fixes, plus a few new
drivers and features. The diffstat includes some DRM changes due to
work on HDMI audio.
- Allow clocking on each DAI in an audio graph card to be configured
separately.
- Improved power management for Renesas RZ-SSI.
- KUnit testing for the Cirrus DSP framework.
- Memory to meory operation support for Freescale/NXP platforms.
- Support for pause operations in SOF.
- Support for Allwinner suinv F1C100s, Awinc AW88083, Realtek
ALC5682I-VE
Nathan Chancellor [Mon, 20 Jan 2025 13:32:48 +0000 (06:32 -0700)]
ALSA: hda: tas2781-spi: Fix -Wsometimes-uninitialized in tasdevice_spi_switch_book()
Clang warns (or errors with CONFIG_WERROR=y):
sound/pci/hda/tas2781_hda_spi.c:110:6: error: variable 'ret' is used uninitialized whenever 'if' condition is false [-Werror,-Wsometimes-uninitialized]
110 | if (tas_priv->cur_book != TASDEVICE_BOOK_ID(reg)) {
| ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
sound/pci/hda/tas2781_hda_spi.c:119:9: note: uninitialized use occurs here
119 | return ret;
| ^~~
sound/pci/hda/tas2781_hda_spi.c:110:2: note: remove the 'if' if its condition is always true
110 | if (tas_priv->cur_book != TASDEVICE_BOOK_ID(reg)) {
| ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
sound/pci/hda/tas2781_hda_spi.c:108:9: note: initialize the variable 'ret' to silence this warning
108 | int ret;
| ^
| = 0
Sink the declaration of ret into the if block and just return 0 at the
end of the function, as there is nothing to do if cur_book has already
been changed.
There was a lote of code duplication in the dao_clear_left_input() and
dao_clear_right_input() functions. A new function, dao_clear_input(),
was created and now the left and right functions call it instead of
repeating themselves.
Takashi Iwai [Mon, 20 Jan 2025 07:46:54 +0000 (08:46 +0100)]
ALSA: hda: tas2781-spi: select CRC32 instead of CRC32_SARWATE
Just like the I2C driver (as in commit 86c96e7289c5 "ALSA:
hda/tas2781: select CRC32 instead of CRC32_SARWATE"), the new tas2781
SPI driver has to select CONFIG_CRC32 instead of
CONFIG_CRC32_SARWATE for fixing the build failures.
Geoffrey D. Bennett [Thu, 16 Jan 2025 17:47:58 +0000 (04:17 +1030)]
ALSA: scarlett2: Add device_setup option to use FCP driver
Add a new device_setup option (SCARLETT2_USE_FCP_DRIVER = 0x08) that
allows users to opt in to using the new FCP driver instead of the
existing scarlett2 driver for their device. This provides a way to
test the new FCP driver on existing supported hardware while keeping
the Scarlett2 driver as the default.
When the SCARLETT2_USE_FCP_DRIVER bit is set in device_setup, the
scarlett2 driver initialisation will hand off to the FCP driver
instead of proceeding with its own initialisation. The FCP driver then
provides access to the device via its hwdep interface.
Geoffrey D. Bennett [Thu, 16 Jan 2025 17:47:38 +0000 (04:17 +1030)]
ALSA: FCP: Add Focusrite Control Protocol driver
Add a new kernel driver for the Focusrite Control Protocol (FCP),
which is used by Focusrite Scarlett 2nd Gen, 3rd Gen, 4th Gen, Clarett
USB, Clarett+, and Vocaster series audio interfaces. This driver
provides a user-space control interface via ALSA's hwdep subsystem.
Unlike the existing Scarlett2 driver which implements all ALSA
controls in kernel space, this new FCP driver takes a different
approach by providing a minimal kernel interface that allows a
user-space driver to send FCP commands and receive notifications. The
only control implemented in kernel space is the Level Meter, since it
requires frequent polling of volatile data.
While this driver supports all interfaces that the Scarlett2 driver
works with, it is initially enabled only for 4th Gen 16i16, 18i16,
and 18i20 interfaces that are not supported by the Scarlett2 driver.
Baojun Xu [Mon, 16 Dec 2024 12:20:08 +0000 (20:20 +0800)]
ALSA: hda/tas2781: Add tas2781 hda SPI driver
This patch was used to add TAS2781 devices on SPI support in sound/pci/hda.
It use ACPI node descript about parameters of TAS2781 on SPI, it like:
Scope (_SB.PC00.SPI0)
{
Device (GSPK)
{
Name (_HID, "TXNW2781") // _HID: Hardware ID
Method (_CRS, 0, NotSerialized)
{
Name (RBUF, ResourceTemplate ()
{
SpiSerialBusV2 (...)
SpiSerialBusV2 (...)
}
}
}
}
And in platform/x86/serial-multi-instantiate.c, those spi devices will be
added into system as a single SPI device, so TAS2781 SPI driver will
probe twice for every single SPI device. And driver will also parser
mono DSP firmware binary and RCA binary for itself.
The code support Realtek as the primary codec.
In patch version-10, add multi devices firmware binary support,
to compatble with windows driver, they can share same firmware binary.
Michal Simek [Thu, 16 Jan 2025 14:55:46 +0000 (15:55 +0100)]
ASoC: xilinx: xlnx_spdif: Simpify using devm_clk_get_enabled()
Clock handling can be very simlified with using devm_clk_get_enabled() as
was done by commit 8d2aaf4382b7 ("gpio: zynq: Simplify using
devm_clk_get_enabled()").
Simon Trimmer [Thu, 2 Jan 2025 12:33:35 +0000 (20:33 +0800)]
ASoC: Intel: sof_sdw: Fix DMI match for Lenovo 83JX, 83MC and 83NM
Update the DMI match for a Lenovo laptop to a new DMI identifier.
This laptop ships with a different DMI identifier to what was expected
and now has three match entries. It also has the DMICs connected to the
host rather than the cs42l43 codec.
Signed-off-by: Simon Trimmer <simont@opensource.cirrus.com> Fixes: 83c062ae81e8 ("ASoC: Intel: sof_sdw: Add quirks for some new Lenovo laptops") Reviewed-by: Liam Girdwood <liam.r.girdwood@intel.com> Reviewed-by: Ranjani Sridharan <ranjani.sridharan@linux.intel.com> Signed-off-by: Bard Liao <yung-chuan.liao@linux.intel.com> Link: https://patch.msgid.link/20250102123335.256698-3-yung-chuan.liao@linux.intel.com Signed-off-by: Mark Brown <broonie@kernel.org>
Martin Blumenstingl [Tue, 14 Jan 2025 21:56:17 +0000 (22:56 +0100)]
ASoC: dapm: add support for preparing streams
Codec driver can implement .hw_params and/or .prepare from struct
snd_soc_dai_ops. For codec-to-codec links only the former (.hw_params)
callback has been called.
On platforms like Amlogic Meson8/8b/8m2 the SoC's sound card
(sound/soc/meson/gx-card.c) uses a codec-to-codec link for the HDMI
codec output because further digital routing is required after the
backend. The new DRM HDMI (audio) codec framework (which internally
uses sound/soc/codecs/hdmi-codec.c) relies on the .prepare callback
of the hdmi-codec to be called. Implement calls to
snd_soc_dai_prepare() so the .prepare callback is called. In this
case the mandatory part is the call to prepare the sink (which is
the hdmi-codec on those platforms). Also call snd_soc_dai_prepare()
for the source to stay consistent with the rest of the code (even
though it's not strictly necessary to make the DRM HDMI codec
framework work on Amlogic Meson8/8b/8m2).
For platforms or sound cards without a codec-to-codec link with
additional parameters (which applies to most hardware) this changes
nothing as the .prepare callback is already called via
snd_pcm_do_prepare() (as well as dpcm_fe_dai_prepare() and
dpcm_be_dai_prepare()) on those.
Suggested-by: Jerome Brunet <jbrunet@baylibre.com> Reviewed-by: Charles Keepax <ckeepax@opensource.cirrus.com> Reviewed-by: Jerome Brunet <jbrunet@baylibre.com> Signed-off-by: Martin Blumenstingl <martin.blumenstingl@googlemail.com> Link: https://patch.msgid.link/20250114215617.336105-3-martin.blumenstingl@googlemail.com Signed-off-by: Mark Brown <broonie@kernel.org>
Martin Blumenstingl [Tue, 14 Jan 2025 21:56:16 +0000 (22:56 +0100)]
ASoC: soc-dai: add snd_soc_dai_prepare() and use it internally
Add a new snd_soc_dai_prepare() which can be used (in an upcoming patch)
by soc-dapm.c. Use this new function internally in
snd_soc_pcm_dai_prepare() to avoid duplicating code.
Suggested-by: Jerome Brunet <jbrunet@baylibre.com> Reviewed-by: Charles Keepax <ckeepax@opensource.cirrus.com> Reviewed-by: Jerome Brunet <jbrunet@baylibre.com> Signed-off-by: Martin Blumenstingl <martin.blumenstingl@googlemail.com> Acked-by: Kuninori Morimoto <kuninori.morimoto.gx@renesas.com> Link: https://patch.msgid.link/20250114215617.336105-2-martin.blumenstingl@googlemail.com Signed-off-by: Mark Brown <broonie@kernel.org>
As of commit cb18cd26039f ("ASoC: soc-core: do rtd->id trick at
snd_soc_add_pcm_runtime()") the ID stored in the PCM runtime data can
no longer be safely used to index the priv->dai_props array. This is
because the ID may be modified during snd_soc_add_pcm_runtime(), thus
resulting in an ID that's no longer a valid array index.
To fix this, use the position of the dai_link stored inside the PCM
runtime data relative to the start of the dai_link array as index into
the priv->dai_props array.
Lianqin Hu [Wed, 15 Jan 2025 09:32:35 +0000 (09:32 +0000)]
ALSA: usb-audio: Add delay quirk for USB Audio Device
Audio control requests that sets sampling frequency sometimes fail on
this card. Adding delay between control messages eliminates that problem.
usb 1-1: New USB device found, idVendor=0d8c, idProduct=0014
usb 1-1: New USB device strings: Mfr=1, Product=2, SerialNumber=0
usb 1-1: Product: USB Audio Device
usb 1-1: Manufacturer: C-Media Electronics Inc.
Cezary Rojewski [Tue, 14 Jan 2025 18:42:39 +0000 (19:42 +0100)]
ALSA: hda: Transfer firmware in two chunks
As per specification, SDxLVI shall be at least 1 i.e.: two chunks to
perform a valid transfer. This is true for the PCM transfer code but
not firmware-transfer one.
Technical background:
- the LVI > 0 rule shall be obeyed in PCM transfer
- HW permits LVI == 0 when transfer is SW-controlled (SPIB)
- FW download is not a PCM transfer and is SW-controlled (SPIB)
The above is the fundament which AudioDSP firmware loading functions
have been built upon and worked since 2016. The presented changes are to
align the loading flows and avoid rising more questions in the future.
Achieve the goal by splitting snd_hdac_stream_setup_periods() into
substream-dependent and -independent part. Let snd_hdac_dsp_prepare()
utilize the latter so that both DSP-loading and PCM flows utilize same
BLDE setup loop which already takes care of cutting the buffer based on
azx_dev->period_bytes.
ALSA: hda/realtek: Enable headset mic on Positivo C6400
Positivo C6400 is equipped with ALC269VB, and it needs
ALC269VB_FIXUP_ASUS_ZENBOOK quirk to make its headset mic work.
Also must to limits the microphone boost.
Takashi Iwai [Tue, 14 Jan 2025 10:47:01 +0000 (11:47 +0100)]
ALSA: rawmidi: Make tied_device=0 as default / unknown
In the original change, rawmidi_info.tied_device showed -1 for the
unknown or untied device. But this would require the user-space to
check the protocol version and judge the value conditionally, which
is rather error-prone.
Instead, set the tied_device = 0 to be default as unknown, and
indicate the real device with the offset 1, for achieving more
backward compatibility.
Bence Csókás [Tue, 14 Jan 2025 09:59:07 +0000 (10:59 +0100)]
ASoC: sun4i-codec: Use new devm clk and reset APIs
Clean up error handling by using the new devm_
clock and reset functions. This should make it
easier to add new code, as we can eliminate the
"goto ladder" in probe().
Shengjiu Wang [Tue, 14 Jan 2025 10:27:20 +0000 (18:27 +0800)]
ASoC: dt-bindings: fsl,micfil: Add compatible string for i.MX943 platform
Add compatible string "fsl,imx943-micfil" for i.MX943 platform.
The definition of register map and some register bit map is
different on the i.MX943 platform.
Shengjiu Wang [Tue, 14 Jan 2025 10:27:19 +0000 (18:27 +0800)]
ASoC: fsl_micfil: Add i.MX943 platform support
On i.MX943, the FIFO data address is changed to 0x20~0x3c,
compared to previous version, there is a minus 4 offset,
so add a new regmap configuration for it.
And the bit width of CICOSR is changed to 5 bits, from bit
16th to 20th in REG_MICFIL_CTRL2 register, so update its
definition header file.
Mark Brown [Mon, 13 Jan 2025 20:08:47 +0000 (20:08 +0000)]
ASoC: extra format on each DAI
Merge series from Kuninori Morimoto <kuninori.morimoto.gx@renesas.com>:
Current clock provider/consumer setting is set by dai_link->dai_fmt, and it
is Codec base on Sound Card driver (= SND_SOC_DAIFMT_CBx_CFx).
Current CPU/Codec drivers are already based on its own base
(= SND_SOC_DAIFMT_Bx_Fx). So, Codec clock setting uses dai_link->dai_fmt
as-is, and CPU side clock setting is created from Codec base setting by
flipping. Because of this, we can't set both CPU/Codec clock consumer for
example.
To solve this issue, this patch-set adds new ext_fmt on each DAI.
It can keep compatible with legacy style.
dai_fmt : dai_link->dai_fmt = common settings
ext_fmt : each DAI settings
Legacy
dai_fmt includes 1, 2, 3, 4
New style
dai_fmt includes 1, 2, 3
ext_fmt includes 4
Audio-Graph-Card2 will use this new style by this patch-set.
By this patch, Card2 default behavior (= no "clock-master / frame-master"
settings on DT) will be changed, but no drivers are using it.
In case of no DAI has "clock-master / frame-master" property on DT,
it will be...
Legacy
CPU : provider (because flipped from Codec)
Codec: consumer
New style
CPU : consumer
Codec: consumer
One note is that Simple-Card, Audio-Graph-Card don't implement
this new style to keep compatiblily.
In Overlay case, port order can be random, so we shouldn't use get_next()
function to get next port.
Mark Brown [Mon, 13 Jan 2025 18:33:14 +0000 (18:33 +0000)]
ASoC: fsl: Support MQS on i.MX943
Merge series from Shengjiu Wang <shengjiu.wang@nxp.com>:
There are two MQS instances on the i.MX943 platform.
The definition of bit positions in the control register are
different. In order to support these MQS modules, define
two compatible strings to distinguish them.
Kuninori Morimoto [Mon, 6 Jan 2025 05:49:49 +0000 (05:49 +0000)]
ASoC: audio-graph-card2: Use extra format on each DAI
Current ASoC is using dai_link->dai_fmt to set DAI format for both
CPU/Codec. But because it is using same settings, and
SND_SOC_DAIFMT_CLOCK_PROVIDER is flipped for CPU, we can't set both
CPU/Codec as clock consumer, for example.
To solve this issue, this patch uses extra format for each DAI which can
keep compatibility with legacy system,
Kuninori Morimoto [Mon, 6 Jan 2025 05:49:45 +0000 (05:49 +0000)]
ASoC: soc-core: Enable to use extra format on each DAI
Current ASoC is using dai_link->dai_fmt to set DAI format for both
CPU/Codec. But because it is using same settings, and
SND_SOC_DAIFMT_CLOCK_PROVIDER is flipped for CPU, we can't set both
CPU/Codec as clock consumer, for example.
To solve this issue, this patch enable to use extra format for each
DAI which can keep compatibility with legacy system,
Kuninori Morimoto [Mon, 6 Jan 2025 05:49:41 +0000 (05:49 +0000)]
ASoC: audio-graph-card2: use of_graph_get_port_by_id() at graph_get_next_multi_ep()
Audio Graph Card2 is assuming "port" are necessarily in order, but there
is no guarantee in case of overlay. Use of_graph_get_port_by_id() instead
to handle it correctly.
Maxim Kochetkov [Thu, 19 Dec 2024 04:22:27 +0000 (07:22 +0300)]
ASoC: codecs: nau8824: fix max volume for Speaker output
There is no audio output if Speaker volume is set above 25.
According to datasheet Rev 2.5 maximum allowed value for the
Speaker output is 0b11001 (25)
0x6D CLASSD_GAIN_1/ 0x6E CLASSD_GAIN_2:
Left/Right Channel Class-D Driver Gain For DAC Left/Right
Input
(Step size is 1dB.)
00000 = Mute (DEFAULT)
00001 = 0dB
00002 = 1dB
...
11000 = 23dB
11001 = 24dB
So adjust this value in accordance with the datasheet.
Shengjiu Wang [Mon, 13 Jan 2025 09:03:21 +0000 (17:03 +0800)]
ASoC: dt-bindings: fsl,mqs: Add compatible string for i.MX943 platform
There are two MQS instances on the i.MX943 platform.
The definition of bit positions in the control register are
different. In order to support these MQS modules, define
two compatible strings to distinguish them.
As one instance is in the always-on domain, another is in the
wakeup domain, so the compatible strings are
"fsl,imx943-aonmix-mqs", "fsl,imx943-wakeupmix-mqs".
Shengjiu Wang [Mon, 13 Jan 2025 09:03:20 +0000 (17:03 +0800)]
ASoC: fsl_mqs: Add i.MX943 platform support
There are two MQS instances on the i.MX943 platform.
The definition of bit positions in the control register are
different. In order to support these MQS modules, define
two compatible strings to distinguish them.
On i.MX943 one instance is in Always-on mix, another is in
Wakeup-mix.
This patch fixes the volume adjustment issue on the Lenovo ThinkBook 16P Gen5
by applying the necessary quirk configuration for the Realtek ALC287 codec.
The issue was caused by incorrect configuration in the driver,
which prevented proper volume control on certain systems.
Takashi Iwai [Fri, 10 Jan 2025 15:59:41 +0000 (16:59 +0100)]
ALSA: seq: Notify UMP EP and FB changes
So far we notify the sequencer client and port changes upon UMP FB
changes, but those aren't really corresponding to the UMP updates.
e.g. when a FB info gets updated, it's not notified but done only when
some of sequencer port attribute is changed. This is no ideal
behavior.
This patch adds the two new sequencer event types for notifying the
UMP EP and FB changes via the announce port. The new event takes
snd_seq_ev_ump_notify type data, which is compatible with
snd_seq_addr (where the port number is replaced with the block
number).
The events are sent when the EP and FB info gets updated explicitly
via ioctl, or the backend UMP receives the corresponding UMP
messages.
The sequencer protocol version is bumped to 1.0.5 along with it.
Takashi Iwai [Fri, 10 Jan 2025 15:59:40 +0000 (16:59 +0100)]
ALSA: seq: Allow system notification in atomic
Currently the system notification helper assumes only the non-atomic
delivery. For allowing an event delivery in non-atomic context, add
the atomic flag to the helper function.
This is a preliminary change for the support of UMP EP/FB
notification.
Takashi Iwai [Fri, 10 Jan 2025 15:59:39 +0000 (16:59 +0100)]
ALSA: ump: Update rawmidi name per EP name update
The rawmidi name string should be updated dynamically when the device
receives the UMP EP name update, too. Both the core and legacy
rawmidi names are updated.
Takashi Iwai [Fri, 10 Jan 2025 15:59:38 +0000 (16:59 +0100)]
ALSA: ump: Copy safe string name to rawmidi
The UMP helper didn't set up the rawmidi name string by itself but
left it to the driver. But since the only user (USB MIDI2 driver)
picks up the UMP info name string to the rawmidi name as default, it's
better to set up in the UMP core side.
Meanwhile, UMP receives the EP name string from the device, and it
might contain garbage letters. We should purify the string to be
usable for the kernel as done previously for UMP Group names.
This implements the copy of the UMP info name string into the rawmidi
name at the creation of UMP EP object in a safe way to strip the
non-ASCII or non-printable characters. Also, change the reference
from the legacy rawmidi and other places to rawmidi name field instead
of ump info; this assures the sane strings.
Takashi Iwai [Fri, 10 Jan 2025 15:59:37 +0000 (16:59 +0100)]
ALSA: ump: Copy FB name string more safely
The UMP group names are referred as the corresponding sequencer port
names, hence they should be proper ASCII strings. OTOH, the UMP group
names are composed from the UMP FB strings that are received from the
device; i.e. a device may give some bogus letters and we can't trust
them fully.
To assure that the group names consist of the proper ASCII strings,
replace the normal string copy and append operations with special ones
that strip the non-printable letters.
Takashi Iwai [Fri, 10 Jan 2025 15:59:35 +0000 (16:59 +0100)]
ALSA: rawmidi: Show substream activity in info ioctl
The UMP legacy rawmidi may turn on/off the substream dynamically
depending on the UMP Function Block information. So far, there was no
direct way to know whether the substream is disabled (inactive) or
not; at most one can take a look at the substream name string or try
to open and get -ENODEV.
This patch extends the rawmidi info ioctl to show the current inactive
state of the given substream. When the selected substream is
inactive, info flags field contains the new bit flag
SNDRV_RAWMIDI_INFO_STREAM_INACTIVE.
Cezary Rojewski [Fri, 10 Jan 2025 11:33:25 +0000 (12:33 +0100)]
ALSA: hda: Fix compilation of snd_hdac_adsp_xxx() helpers
The snd_hdac_adsp_xxx() wrap snd_hdac_reg_xxx() helpers to simplify
register access for AudioDSP drivers e.g.: the avs-driver. Byte- and
word-variants of said helps do not expand to bare readx/writex()
operations but functions instead and, due to pointer type
incompatibility, cause compilation to fail.
As the macros are utilized by the avs-driver alone, relocate the code
introduced with commit c19bd02e9029 ("ALSA: hda: Add helper macros for
DSP capable devices") into the avs/ directory and update it to operate
on 'adev' i.e.: the avs-driver-context directly to fix the issue.
Fixes: c19bd02e9029 ("ALSA: hda: Add helper macros for DSP capable devices") Signed-off-by: Cezary Rojewski <cezary.rojewski@intel.com> Acked-by: Mark Brown <broonie@kernel.org> Link: https://patch.msgid.link/20250110113326.3809897-2-cezary.rojewski@intel.com Signed-off-by: Takashi Iwai <tiwai@suse.de>
Rob Herring (Arm) [Thu, 9 Jan 2025 18:22:02 +0000 (12:22 -0600)]
ASoC: simple-card: Drop unnecessary "dai-tdm-slot-width-map" property presence check
It doesn't matter whether "dai-tdm-slot-width-map" is not present or
there is some other issue parsing it in of_property_count_elems_of_size()
causing an error. Drop the presence check and rely on
of_property_count_elems_of_size() error return if not present.
Takashi Iwai [Fri, 10 Jan 2025 14:30:28 +0000 (15:30 +0100)]
Merge tag 'asoc-fix-v6.13-rc6' of https://git.kernel.org/pub/scm/linux/kernel/git/broonie/sound into for-linus
ASoC: Fixes for v6.13
A collection of device specific fixes that came in over the holidays,
plus a MAINTAINERS update and some documentation to help users debug
problems with some of the Cirrus CODECs found in modern laptops.
Yu-Chun Lin [Thu, 9 Jan 2025 17:15:47 +0000 (01:15 +0800)]
ASoC: amd: Add ACPI dependency to fix build error
As reported by the kernel test robot, the following error occurs:
sound/soc/amd/yc/acp6x-mach.c: In function 'acp6x_probe':
>> sound/soc/amd/yc/acp6x-mach.c:573:15: error: implicit declaration of function 'acpi_evaluate_integer'; did you mean 'acpi_evaluate_object'? [-Werror=implicit-function-declaration]
573 | ret = acpi_evaluate_integer(handle, "_WOV", NULL, &dmic_status);
| ^~~~~~~~~~~~~~~~~~~~~
| acpi_evaluate_object
cc1: some warnings being treated as errors
The function 'acpi_evaluate_integer' and its prototype in 'acpi_bus.h'
are only available when 'CONFIG_ACPI' is enabled. Add a 'depends on ACPI'
directive in Kconfig to ensure proper compilation.
Reported-by: kernel test robot <lkp@intel.com> Closes: https://lore.kernel.org/oe-kbuild-all/202501090345.pBIDRTym-lkp@intel.com/ Signed-off-by: Yu-Chun Lin <eleanor15x@gmail.com> Link: https://patch.msgid.link/20250109171547.362412-1-eleanor15x@gmail.com Signed-off-by: Mark Brown <broonie@kernel.org>
Mark Brown [Thu, 9 Jan 2025 15:55:24 +0000 (15:55 +0000)]
ASoC: Intel: avs: Fixes and cleanups
Merge series from Cezary Rojewski <cezary.rojewski@intel.com>:
A set of loosely connected changes, fixing few outstanding issues as
well as improving readability of the existing code.
The fixes lead the series, first five patches. The goal is to make sure
proper read() is used when accessing the registers, probe() and remove()
sequences for HDAudio streaming are synced, minimal AudioDSP firmware
version points to correct values and recent additions to the topology
are parsed properly.
The only patch that points to 'new functionality' is:
ASoC: Intel: avs: Update ASRC definition
as with the struct definition updates, one can utilize the ASRC module
in both streaming directions now (previously limited to Capture).
Everything else either improves the logging or provides comments vital
for long-term maintenance of the code.
Kuninori Morimoto [Thu, 9 Jan 2025 00:14:41 +0000 (00:14 +0000)]
ASoC: remove disable_route_checks
No driver is using disable_route_checks, let's remove it.
Because snd_soc_dapm_add_routes() itself will indicate detail error
when failed, this patch removes duplicate dev_err() not only
dev_warn() in error case.
Signed-off-by: Kuninori Morimoto <kuninori.morimoto.gx@renesas.com> Suggested-by: Amadeusz Sławiński <amadeuszx.slawinski@linux.intel.com> Tested-by: Amadeusz Sławiński <amadeuszx.slawinski@linux.intel.com> Link: https://patch.msgid.link/87tta8268e.wl-kuninori.morimoto.gx@renesas.com Signed-off-by: Mark Brown <broonie@kernel.org>
Kuninori Morimoto [Thu, 9 Jan 2025 00:14:34 +0000 (00:14 +0000)]
ASoC: intel: remove disable_route_checks
It sets disable_route_checks flag after checking that parent driver
isn't SOF, but skylake driver was removed, so it is dead code.
We can remove last user of disable_route_checks.
Signed-off-by: Kuninori Morimoto <kuninori.morimoto.gx@renesas.com> Suggested-by: Amadeusz Sławiński <amadeuszx.slawinski@linux.intel.com> Tested-by: Amadeusz Sławiński <amadeuszx.slawinski@linux.intel.com> Link: https://patch.msgid.link/87v7uo268m.wl-kuninori.morimoto.gx@renesas.com Signed-off-by: Mark Brown <broonie@kernel.org>
Kuninori Morimoto [Thu, 9 Jan 2025 00:40:05 +0000 (00:40 +0000)]
ASoC: rsnd: check rsnd_adg_clk_enable() return value
rsnd_adg_clk_enable() might be failed for some reasons, but it doesn't
check return value for now. In such case, we might get below WARNING from
clk_disable() during probe or suspend. Check rsnd_adg_clk_enable() return
value.
According to Geert, it happened only 7 times during the last 2 years.
So I have reproduced the issue and created patch by Intentionally making
an error.
Cezary Rojewski [Thu, 9 Jan 2025 12:22:06 +0000 (13:22 +0100)]
ASoC: Intel: avs: Fix theoretical infinite loop
While 'stack_dump_size' is a u32 bitfield of 16 bits, u32 has a bigger
upper bound than the type u16 of loop counter 'offset' what in theory
may lead to infinite loop condition.
Richard Fitzgerald [Thu, 9 Jan 2025 10:56:57 +0000 (10:56 +0000)]
ALSA: doc: Add codecs/index.rst to top-level index
commit 088fb4ee17fc ("ALSA: doc: cs35l56: Add information about
Cirrus Logic CS35L54/56/57") added a new subdirectory with an index
file, so this file must be added to the top-level index.
Charles Keepax [Wed, 8 Jan 2025 13:48:28 +0000 (13:48 +0000)]
ASoC: samsung: Add missing depends on I2C
When switching to selects for MFD_WM8994 a dependency should have also
been added for I2C, as the dependency on MFD_WM8994 will not be
considered by the select.
Fixes: fd55c6065bec ("ASoC: samsung: Add missing selects for MFD_WM8994") Reported-by: kernel test robot <lkp@intel.com> Closes: https://lore.kernel.org/oe-kbuild-all/202501082020.2bpGGVTW-lkp@intel.com/ Signed-off-by: Charles Keepax <ckeepax@opensource.cirrus.com> Link: https://patch.msgid.link/20250108134828.246570-1-ckeepax@opensource.cirrus.com Signed-off-by: Mark Brown <broonie@kernel.org>
Dan Carpenter [Wed, 8 Jan 2025 09:28:46 +0000 (12:28 +0300)]
ASoC: renesas: rz-ssi: Add a check for negative sample_space
My static checker rule complains about this code. The concern is that
if "sample_space" is negative then the "sample_space >= runtime->channels"
condition will not work as intended because it will be type promoted to a
high unsigned int value.
strm->fifo_sample_size is SSI_FIFO_DEPTH (32). The SSIFSR_TDC_MASK is
0x3f. Without any further context it does seem like a reasonable warning
and it can't hurt to add a check for negatives.
Cc: stable@vger.kernel.org Fixes: 03e786bd4341 ("ASoC: sh: Add RZ/G2L SSIF-2 driver") Signed-off-by: Dan Carpenter <dan.carpenter@linaro.org> Reviewed-by: Geert Uytterhoeven <geert+renesas@glider.be> Link: https://patch.msgid.link/e07c3dc5-d885-4b04-a742-71f42243f4fd@stanley.mountain Signed-off-by: Mark Brown <broonie@kernel.org>
Kuninori Morimoto [Wed, 8 Jan 2025 03:05:52 +0000 (03:05 +0000)]
ASoC: soc-card: remove card check
only snd_soc_card_set_bias_level() and snd_soc_card_set_bias_level_post()
are checking "card" in the function, like below
int snd_soc_card_set_bias_level(...)
{
...
=> if (card && card->xxx)
ret = card->xxxx(...);
...
}
But it should already have been an error if "card" was NULL.
remove "card" NULL check here. Otherwise it will get waring on
smatch without this patch. This is prepare for error check cleanup.