ASoC: codecs: wcd934x: return error code correctly from hw_params
Error returned from wcd934x_slim_set_hw_params() are not passed to upper layer,
this could be misleading to the user which can start sending stream leading
to unnecessary errors.
ASoC: codecs: wcd938x: fix volatile register range
Interrupt Clear registers WCD938X_INTR_CLEAR_0 - WCD938X_INTR_CLEAR_2
are not marked as volatile. This has resulted in a missing interrupt bug
while performing runtime pm. regcache_sync() during runtime pm resume path
will write to Interrupt clear registers with previous values which basically
clears the pending interrupt and actual interrupt handler never sees this
interrupt.
This issue is more visible with headset plug-in plug-out case compared to
headset button.
Fix this by adding the Interrupt clear registers to volatile range
Takashi Iwai [Tue, 16 Nov 2021 07:18:12 +0000 (08:18 +0100)]
ASoC: topology: Add missing rwsem around snd_ctl_remove() calls
snd_ctl_remove() has to be called with card->controls_rwsem held (when
called after the card instantiation). This patch add the missing
rwsem calls around it.
would set the MultiMedia1 steam for SLIMBUS_0_RX, however doing below
command will reset previously setup MultiMedia1 stream, because both of them
are using MultiMedia1 PCM stream.
Simon Trimmer [Mon, 15 Nov 2021 12:01:54 +0000 (12:01 +0000)]
ASoC: wm_adsp: wm_adsp_control_add() error: uninitialized symbol 'ret'
This patch fixes the static analysis warning as it is correctly
indicating a possible code path, it cannot know that for the affected
firmware versions subname would always be NULL.
Reported-by: kernel test robot <lkp@intel.com> Reported-by: Dan Carpenter <dan.carpenter@oracle.com> Signed-off-by: Simon Trimmer <simont@opensource.cirrus.com> Acked-by: Charles Keepax <ckeepax@opensource.cirrus.com> Link: https://lore.kernel.org/r/20211115120154.56782-1-simont@opensource.cirrus.com Signed-off-by: Mark Brown <broonie@kernel.org>
commit df03147c916f9 ("ASoC: sh: rcar: dma: : use proper DMAENGINE
API for termination") updated DMAEngine API _all() to _sync(),
but it should be _async().
_all() and _async() are almost same, the difference is only return
error code. _sync() will call dmaengine_synchronize() and will be
kernel panic.
This patch is needed for v5.15 or later.
[ 27.293264] BUG: scheduling while atomic: irq/130-ec70000/131/0x00000003
[ 27.300084] 2 locks held by irq/130-ec70000/131:
[ 27.304743] #0: ffff0004c274d908 (&group->lock){....}-{2:2}, at: _snd_pcm_stream_lock_irqsave+0x48/0x54
[ 27.314344] #1: ffff0004c1788c60 (&priv->lock#2){....}-{2:2}, at: rsnd_soc_dai_trigger+0x70/0x7bc
[ 27.323409] irq event stamp: 206
[ 27.326664] hardirqs last enabled at (205): [<ffff80001082de50>] _raw_spin_unlock_irq+0x50/0xa0
[ 27.335529] hardirqs last disabled at (206): [<ffff80001082d9e4>] _raw_spin_lock_irqsave+0xc4/0xd0
[ 27.344564] softirqs last enabled at (0): [<ffff800010037324>] copy_process+0x644/0x1b10
[ 27.352819] softirqs last disabled at (0): [<0000000000000000>] 0x0
[ 27.359142] CPU: 0 PID: 131 Comm: irq/130-ec70000 Not tainted 5.14.0-rc1+ #918
[ 27.366429] Hardware name: Renesas H3ULCB Kingfisher board based on r8a77950 (DT)
[ 27.373975] Call trace:
[ 27.376442] dump_backtrace+0x0/0x1b4
[ 27.380141] show_stack+0x24/0x30
[ 27.383488] dump_stack_lvl+0x8c/0xb8
[ 27.387184] dump_stack+0x18/0x34
[ 27.390528] __schedule_bug+0x8c/0x9c
[ 27.394224] __schedule+0x790/0x8dc
[ 27.397746] schedule+0x7c/0x110
[ 27.401003] synchronize_irq+0x94/0xd0
[ 27.404786] rcar_dmac_device_synchronize+0x20/0x2c
[ 27.409710] rsnd_dmaen_stop+0x50/0x64
[ 27.413495] rsnd_soc_dai_trigger+0x554/0x7bc
[ 27.417890] snd_soc_pcm_dai_trigger+0xe8/0x264
Arnd Bergmann [Mon, 8 Nov 2021 11:11:14 +0000 (12:11 +0100)]
ASoC: SOF: build compression interface into snd_sof.ko
With CONFIG_SND_SOC_SOF_COMPRESS=m, the compression code is
not built into a the main SOF driver when that is built-in:
x86_64-linux-ld: sound/soc/sof/ipc.o: in function `ipc_stream_message':
ipc.c:(.text+0x5a2): undefined reference to `snd_sof_compr_fragment_elapsed'
x86_64-linux-ld: sound/soc/sof/topology.o: in function `sof_dai_load':
topology.c:(.text+0x32d1): undefined reference to `snd_sof_compr_init_elapsed_work'
x86_64-linux-ld: topology.c:(.text+0x32e1): undefined reference to `snd_sof_compr_init_elapsed_work'
Make this a 'bool' symbol so it just decides whether the
code gets built at all.
Fixes: 0d301b245a31 ("ASoC: SOF: Introduce fragment elapsed notification API") Signed-off-by: Arnd Bergmann <arnd@arndb.de> Tested-by: Pierre-Louis Bossart <pierre-louis.bossart@linux.intel.com> Link: https://lore.kernel.org/r/20211108111132.3800548-1-arnd@kernel.org Signed-off-by: Mark Brown <broonie@kernel.org>
ASoC: mediatek: mt8173: Fix debugfs registration for components
When registering the mt8173-afe-pcm driver, we are also adding two
components: one is for the PCM DAIs and one is for the HDMI DAIs, but
when debugfs is enabled, we're getting the following issue:
[ 17.279176] debugfs: Directory '11220000.audio-controller' with parent 'mtk-rt5650' already present!
[ 17.288345] debugfs: Directory '11220000.audio-controller' with parent 'mtk-rt5650' already present!
To overcome to that without any potentially big rewrite of this driver,
similarly to what was done in mt8195-afe-pcm, add a debugfs_prefix to
the components before actually adding them.
Derek Fang [Tue, 9 Nov 2021 09:54:50 +0000 (17:54 +0800)]
ASoC: rt5682: Re-detect the combo jack after resuming
Sometimes, end-users change the jack type under suspending,
so it needs to re-detect the combo jack type after resuming to
avoid any unexpected behaviors.
Derek Fang [Tue, 9 Nov 2021 09:54:49 +0000 (17:54 +0800)]
ASoC: rt5682: Avoid the unexpected IRQ event during going to suspend
When the system suspends, the codec driver will set SAR to
power saving mode if a headset is plugged in.
There is a chance to generate an unexpected IRQ, and leads to
issues after resuming such as noise from OMTP type headsets.
Jack Yu [Thu, 11 Nov 2021 09:17:05 +0000 (17:17 +0800)]
ASoC: rt1011: revert 'I2S Reference' to SOC_ENUM_EXT
Revert 'I2S Reference' to SOC_ENUM_EXT because the settings are specific
for some platforms, the default setting for 'I2S Reference' does nothing,
only some SoC platform need to configure it.
Previous 'I2S Reference' in SOC_ENUM format only toggles one bit of
RT1011_TDM1_SET_1 register, which isn't enough for specific platform.
ASoC: mediatek: mt8173-rt5650: Rename Speaker control to Ext Spk
Some RT5645 and RT5650 powered platforms are using "Ext Spk"
instead of "Speaker", and this is also reflected in alsa-lib
configurations for the generic RT5645 usecase manager configs.
Rename the "Speaker" control to "Ext Spk" in order to be able
to make the userspace reuse/inherit the same configurations also
for this machine, along with the others.
Takashi Iwai [Fri, 5 Nov 2021 09:09:25 +0000 (10:09 +0100)]
ASoC: DAPM: Cover regression by kctl change notification fix
The recent fix for DAPM to correct the kctl change notification by the
commit c95e52071ea4 ("ASoC: DAPM: Fix missing kctl change
notifications") caused other regressions since it changed the behavior
of snd_soc_dapm_set_pin() that is called from several API functions.
Formerly it returned always 0 for success, but now it returns 0 or 1.
This patch addresses it, restoring the old behavior of
snd_soc_dapm_set_pin() while keeping the fix in
snd_soc_dapm_put_pin_switch().
Kai Vehmanen [Fri, 5 Nov 2021 11:16:55 +0000 (13:16 +0200)]
ASoC: SOF: Intel: hda: fix hotplug when only codec is suspended
If codec is in runtime suspend, but controller is not, hotplug events
are missed as the codec has no way to alert the controller. Problem does
not occur if both controller and codec are active, or when both are
suspended.
An easy way to reproduce is to play an audio stream on one codec (e.g.
to HDMI/DP display codec), wait for other HDA codec to go to runtime
suspend, and then plug in a headset to the suspended codec. The jack
event is not reported correctly in this case. Another way to reproduce
is to force controller to stay active with
"snd_sof_pci.sof_pci_debug=0x1"
Fix the issue by reconfiguring the WAKEEN register when powering up/down
individual links, and handling control events in the interrupt handler.
Peter Ujfalusi [Wed, 3 Nov 2021 08:27:10 +0000 (10:27 +0200)]
ASoC: SOF:control: Fix variable type in snd_sof_refresh_control()
The second parameter for snd_sof_ipc_set_get_comp_data() is ipc_cmd, not
ipc_ctrl_type and the type is u32.
Fixes: 7a20f2d041695 ("ASoC: SOF: Handle control change notification from firmware") Signed-off-by: Peter Ujfalusi <peter.ujfalusi@gmail.com> Acked-by: Ranjani Sridharan <ranjani.sridharan@linux.intel.com> Link: https://lore.kernel.org/r/20211103082710.17165-1-peter.ujfalusi@linux.intel.com Signed-off-by: Mark Brown <broonie@kernel.org>
Charles Keepax [Fri, 29 Oct 2021 21:40:27 +0000 (16:40 -0500)]
ASoC: cs35l41: Change monitor widgets to siggens
Currently the internal monitor sources are input widgets, which means
if the card is set to fully routed these will not enable unless connected
to something in the machine driver. However, all these are internal
monitor signals so it makes no sense to connect them to something in the
machine driver. As such switch them to siggen widgets which will have
the same behaviour except not require external linkage on a fully routed
card.
Mark Brown [Fri, 29 Oct 2021 20:53:41 +0000 (21:53 +0100)]
Merge series "Multiple headphone codec driver support" from Brent Lu <brent.lu@intel.com>:
Support multiple headphone drivers in same machine driver. In this
case, both rt5682 and rt5682s are supported and enumerated by different
ACPI HID "10EC5682" and "RTL5682".
V2 Changes:
- remove useless 'NULL', 'false' in if-condition
- can use 'comp_ids' field alone to enumerate driver
- add comma to the end of entry in structure initialization
- keep the table of byt/cht/cml/icl untouched
V3 Changes:
- upstreamd from SOF github, PR#3200
- use new compatiable IDs to shrink the enumerate table of BYT and CHT
- add 'const' to snd_soc_acpi_codecs structures
V4 Changes:
- add signoff to patch 4~6
V5 Changes:
- none, just rebase for patch 3 conflict
Brent Lu (3):
ASoC: soc-acpi: add comp_ids field for machine driver matching
ASoC: Intel: sof_rt5682: detect codec variant in probe function
ASoC: Intel: sof_rt5682: use comp_ids to enumerate rt5682s
Pierre-Louis Bossart (3):
ASoC: Intel: soc-acpi-byt: shrink tables using compatible IDs
ASoC: Intel: soc-acpi-cht: shrink tables using compatible IDs
ASoC: Intel: soc-acpi: use const for all uses of snd_soc_acpi_codecs
Mark Brown [Fri, 29 Oct 2021 20:53:39 +0000 (21:53 +0100)]
Merge series "ASoC: Sanity checks and soc-topology updates" from Cezary Rojewski <cezary.rojewski@intel.com>:
Couple of soc-topology related changes and a use-after-free fix. Said fix
and two sanity checks for soc-topology lead the way. While the
use-after-free is quite obvious, the sanity checks are here to cover for
cases where user malformed the topology file -or- access to filesystem
somehow got interrupted during copy operation. We shouldn't be reading
outside the file boundary.
Afterward a change to soc_tplg_add_kcontrol(): device being passed to
soc_tplg_add_dcontrol() from comp->dev to tplg->dev which corrects
dev_xxx() invoked later on.
Also, device used for topology memory allocations from component->dev to
component->card->dev so memory gets freed each time card device (usually
platform device) is removed rather than the component device what may
happen less frequently.
Dummy component gets smarter and no longer overrides hw_params if
there are other components accociated with related struct
snd_soc_pcm_runtime instance.
Amadeusz Sławiński (5):
ASoC: core: Remove invalid snd_soc_component_set_jack call
ASoC: topology: Check for dapm widget completeness
ASoC: topology: Use correct device for prints
ASoC: topology: Change topology device to card device
ASoC: Stop dummy from overriding hwparams
ASoC: tlv320aic3x: Make aic3x_remove() return void
Up to now aic3x_remove() returns zero unconditionally. Make it return
void instead which makes it easier to see in the callers that there is
no error to handle.
Also the return value of i2c and spi remove callbacks is ignored anyway.
Brent Lu [Fri, 29 Oct 2021 17:14:04 +0000 (01:14 +0800)]
ASoC: soc-acpi: add comp_ids field for machine driver matching
A machine driver needs to be enumerated by more than one ACPI HID if
it supports second headphone driver (i.e. rt5682 and rt5682s).
However, the id field in snd_soc_acpi_mach structure could contain
only one HID. By adding a 'comp_ids' field which can contain several
HIDs, we can enumerate a machine driver by multiple ACPI HIDs.
In case that there are other components assigned to runtime device,
depending on order dummy component can override their params with its
own, which shouldn't happen. Check if there are any other components
assigned to rtd and if so, skip setting hwparams.
Occurs when using topology where 'snd-soc-dummy' gets assigned by
default as codec and platform component.
Alternative approach would be to copy whole dummy handling and rename it
to "snd-soc-null" or something similar. And remove hwparams assignment
to make it really do nothing.
ASoC: topology: Change topology device to card device
Topology needs device for prints and resource allocation. So far,
component->dev is used. However, this may lead to high memory use in
model where card is an independent driver which can be reloaded and
topology is loaded from component's probe() method. Every time machine
driver is reloaded topology is being loaded anew, each time allocating
new memory. Said memory will only be freed when component itself is
being freed.
Address the problem by tying topology to component->card->dev instead,
so memory occupied by the topology is freed whenever related machine
device gets removed.
Mark Brown [Fri, 29 Oct 2021 13:51:28 +0000 (14:51 +0100)]
Merge series "ASoC: cs42l42: Fix definition and handling of jack switch invert" from Richard Fitzgerald <rf@opensource.cirrus.com>:
Summary: The driver applied the opposite of the DT setting to the
wrong register bit.
The jack plug detect hardware in cs42l42 is somewhat confusing,
compounded by an unclear description in the datasheet. This is most
likely the reason that the driver implemented a DT property for the
wrong register bit, that had the opposite effect of what was
described in the binding.
Changing the meaning of the property values isn't feasible; the
driver dates from 2016 and the risk of breaking out-of-tree configs
is too high (the property is also available to ACPI systems).
So the fix is to make the binding doc match the actual behaviour and
then fix the driver to apply it to the correct register bit.
As a bonus, patch #3 converts the binding to yaml.
Richard Fitzgerald (3):
ASoC: dt-bindings: cs42l42: Correct description of ts-inv
ASoC: cs42l42: Correct configuring of switch inversion from ts-inv
ASoC: dt-bindings: cs42l42: Convert binding to yaml
Julian Braha [Fri, 29 Oct 2021 00:12:25 +0000 (20:12 -0400)]
ASoC: fix unmet dependencies on GPIOLIB for SND_SOC_RT1015P
When SND_SOC_MT8192_MT6359_RT1015_RT5682,
SND_SOC_MT8192_MT6359_RT1015_RT5682,
SND_SOC_MT8183_DA7219_MAX98357A, or
SND_SOC_MT8183_MT6358_TS3A227E_MAX98357A is selected,
and GPIOLIB is not selected, Kbuild gives the following
warnings, respectively:
The same codec seems to have different personalities. ESSX8316 was
used for Baytrail/CherryTrail, ESSX8336 seems to be used for AppoloLake,
GeminiLake, JasperLake and TigerLake devices.
ASoC: cs42l42: Correct configuring of switch inversion from ts-inv
The setting from the cirrus,ts-inv property should be applied to the
TIP_SENSE_INV bit, as this is the one that actually affects the jack
detect block. The TS_INV bit only swaps the meaning of the PLUG and
UNPLUG interrupts and should always be 1 for the interrupts to have
the normal meaning.
Due to some misunderstanding the driver had been implemented to
configure the TS_INV bit based on the jack switch polarity. This made
the interrupts behave the correct way around, but left the jack detect
block, button detect and analogue circuits always interpreting an open
switch as unplugged.
The signal chain inside the codec is:
SENSE pin -> TIP_SENSE_INV -> TS_INV -> (invert) -> interrupts
|
v
Jack detect,
button detect and
analog control
As the TIP_SENSE_INV already performs the necessary inversion the
TS_INV bit never needs to change. It must always be 1 to yield the
expected interrupt behaviour.
Some extra confusion has arisen because of the additional invert in the
interrupt path, meaning that a value applied to the TS_INV bit produces
the opposite effect of applying it to the TIP_SENSE_INV bit. The ts-inv
property has therefore always had the opposite effect to what might be
expected (0 = inverted, 1 = not inverted). To maintain the meaning of
the ts-inv property it must be inverted when applied to TIP_SENSE_INV.
ASoC: dt-bindings: cs42l42: Correct description of ts-inv
This swaps the descriptions of the 0 and 1 values to match
what the driver actually does with this property.
The background here is somewhat confusing. The codec has two
invert bits for the tip sense. The DT property should have been
for the TIP_SENSE_INV bit, which is the one that controls the
detect block. Due to some misunderstanding of the hardware the
driver actually implemented setting of the TS_INV bit, which is
only for swapping the sense of the interrupt bits. The description
was taken from the datasheet and refers to TIP_SENSE_INV but
unfortunately TS_INV has a different purpose and the net effect
of changing it is the reverse of what was intended (this is not
clearly described in the datasheet). So the ts-inv settings have
always done the exact opposite of what the description said.
Given the age of the driver, it's too late now to swap the meanings
of the values, so the description is changed to match the behaviour.
They have been annotated with the terminology used in the datasheet
to avoid the confusion of which one corresponds to what the datasheet
calls "inverted tip sense".
Clang is a little more pedantic than GCC, which permits implicit
fallthroughs to cases that contain just break or return. Clang's version
is more in line with the kernel's own stance in deprecated.rst, which
states that all switch/case blocks must end in either break,
fallthrough, continue, goto, or return. Add the missing break to fix
the warning.
Julian Braha [Wed, 27 Oct 2021 18:48:35 +0000 (14:48 -0400)]
ASoC: fix unmet dependencies on GPIOLIB for SND_SOC_DMIC
When SND_SOC_AMD_RENOIR_MACH or SND_SOC_AMD_RV_RT5682_MACH
are selected, and GPIOLIB is not selected, Kbuild gives
the following warnings, respectively:
This is because SND_SOC_DMIC and SND_SOC_MAX98357A are
selected by SND_SOC_AMD_RV_RT5682_MACH and SND_SOC_AMD_RENOIR_MACH,
respectively. However, neither of the selectors depend on or select GPIOLIB,
despite their selectees depending on GPIOLIB.
These unmet dependency bugs were detected by Kismet,
a static analysis tool for Kconfig. Please advise if this
is not the appropriate solution.
WARNING: unmet direct dependencies detected for SND_SOC_AMD_MACH_COMMON
Depends on [n]: SOUND [=m] && !UML && SND [=m] && SND_SOC [=m] && X86 && PCI [=n] && I2C [=m]
Selected by [m]:
- SND_SOC_AMD_LEGACY_MACH [=m] && SOUND [=m] && !UML && SND [=m] && SND_SOC [=m]
Make this more consistent by adding the same checks everywhere.
Fixes: 6d5f207b8089 ("ASoC: amd: acp: Add legacy sound card support for Chrome audio") Fixes: 2b23b77d4b00 ("ASoC: amd: acp: Add SOF audio support on Chrome board") Signed-off-by: Arnd Bergmann <arnd@arndb.de> Link: https://lore.kernel.org/r/20211027082359.52248-1-arnd@kernel.org Signed-off-by: Mark Brown <broonie@kernel.org>
Yang Yingliang [Wed, 27 Oct 2021 06:52:28 +0000 (14:52 +0800)]
ASoC: amd: acp: Fix return value check in acp_machine_select()
In case of error, platform_device_register_data() returns ERR_PTR()
and never returns NULL. The NULL test in the return value check
should be replaced with IS_ERR().
Reported-by: Hulk Robot <hulkci@huawei.com> Fixes: 5987aa397e3b ("ASoC: amd: acp: Add callback for machine driver on ACP") Signed-off-by: Yang Yingliang <yangyingliang@huawei.com> Link: https://lore.kernel.org/r/20211027065228.833825-1-yangyingliang@huawei.com Signed-off-by: Mark Brown <broonie@kernel.org>
ASoC: rockchip: i2s_tdm: improve return value handling
cppcheck reports the following warning:
sound/soc/rockchip/rockchip_i2s_tdm.c:599:9: warning: Identical
condition and return expression 'ret', return value is always 0
[identicalConditionAfterEarlyExit]
return ret;
^
sound/soc/rockchip/rockchip_i2s_tdm.c:594:6: note: If condition 'ret'
is true, the function will return/exit
if (ret)
^
sound/soc/rockchip/rockchip_i2s_tdm.c:599:9: note: Returning identical
expression 'ret'
return ret;
^
While the code is not wrong, it's clearer to return 0 directly.
sound/soc/codecs/nau8821.c:390:17: error: Array 'dmic_speed_sel[4]'
accessed at index 4, which is out of bounds. [arrayIndexOutOfBounds]
dmic_speed_sel[i].param, dmic_speed_sel[i].val);
^
sound/soc/codecs/nau8821.c:378:2: note: After for loop, i has value 4
for (i = 0 ; i < 4 ; i++)
^
sound/soc/codecs/nau8821.c:390:17: note: Array index out of bounds
dmic_speed_sel[i].param, dmic_speed_sel[i].val);
^
While the code is not incorrect, we can deal with the out-of-bounds
check in a clearer way that makes static analysis happy.
Mark Brown [Tue, 26 Oct 2021 19:00:42 +0000 (20:00 +0100)]
Merge series "ASoC: cs42l42: Fixes to power-down" from Richard Fitzgerald <rf@opensource.cirrus.com>:
Driver probe and remove were inconsistent in what they did to power-down
and neither did all steps. In addition to that, neither function
prevented the interrupt handler from running during and after power-down.
Richard Fitzgerald (2):
ASoC: cs42l42: Reset and power-down on remove() and failed probe()
ASoC: cs42l42: free_irq() before powering-down on probe() fail
Mark Brown [Tue, 26 Oct 2021 19:00:40 +0000 (20:00 +0100)]
Merge series "Update Lpass digital codec macro drivers" from Srinivasa Rao Mandadapu <srivasam@codeaurora.org>:
This patch set is to add support for lpass sc7280 based targets.
Upadate compatible name and change of bulk clock voting to optional
clock voting in digital codecs va, rx, tx macro drivers.
Changes Since V3:
-- Removed fixes tag.
-- Change signedoff by sequence.
Changes Since V2:
-- Add Tx macro deafults for lpass sc7280
Changes Since V1:
-- Removed individual clock voting and used bulk clock optional.
-- Removed volatile changes and fixed default values.
-- Typo errors.
Srinivasa Rao Mandadapu (5):
ASoC: qcom: Add compatible names in va,wsa,rx,tx codec drivers for
sc7280
ASoC: qcom: dt-bindings: Add compatible names for lpass sc7280 digital
codecs
ASoC: codecs: tx-macro: Enable tx top soundwire mic clock
ASoC: codecs: tx-macro: Update tx default values
ASoC: codecs: Change bulk clock voting to optional voting in digital
codecs
--
Qualcomm India Private Limited, on behalf of Qualcomm Innovation Center, Inc.,
is a member of Code Aurora Forum, a Linux Foundation Collaborative Project.
Mark Brown [Tue, 26 Oct 2021 19:00:39 +0000 (20:00 +0100)]
Merge series "ASoC: qcom: Add AudioReach support" from Srinivas Kandagatla <srinivas.kandagatla@linaro.org>:
Hi Mark,
This version is a respin of v10 fixing a build error in 12/17 patch.
QCOM SoC relevant non-audio patches in this series has been merged into
the Qualcomm drivers-for-5.16 tree, as this series depends those patches
an immutable tag is available at:
https://git.kernel.org/pub/scm/linux/kernel/git/qcom/linux.git tags/20210927135559.738-6-srinivas.kandagatla@linaro.org
This patchset adds ASoC driver support to configure signal processing
framework ("AudioReach") which is integral part of Qualcomm next
generation audio SDK and will be deployed on upcoming Qualcomm chipsets.
It makes use of ASoC Topology to load graphs on to the DSP which is then
managed by APM (Audio Processing Manager) service to prepare/start/stop.
Here is simplified high-level block diagram of AudioReach:
AudioReach has constructs of sub-graph, container and modules.
Each sub-graph can have N containers and each Container can have N Modules
and connections between them can be linear or non-linear.
An audio function can be realized with one or many connected
sub-graphs. There are also control/event paths between modules that can
be wired up while building graph to achieve various control mechanism
between modules. These concepts of Sub-Graph, Containers and Modules
are represented in ASoC topology.
Here is simple I2S graph with a Write Shared Memory and a
Volume control module within a single Subgraph (1) with one Container (1)
and 5 modules.
This patchset adds very minimal support for AudioReach which includes
supporting sub-graphs containing CODEC DMA ports and simple PCM
Decoder/Encoder and Logger Modules. Additional capabilities will
be built over time to expose features offered by AudioReach.
This patchset is Tested on SM8250 SoC based Qualcomm Robotics Platform RB5
and SM9250 MTP with WSA881X Smart Speaker Amplifiers, DMICs connected via
VA Macro and WCD938x Codec connected via TX and RX Macro and HDMI audio
via I2S.
First 10 Patches are mostly reorganization existing Old QDSP Audio
Framework code and bindings so that we could reuse them on AudioReach.
ASoC topology graphs for DragonBoard RB5 and SM8250 MTP are available at
https://git.linaro.org/people/srinivas.kandagatla/audioreach-topology.git/
and Qualcomm AudioReach DSP headers are available at:
https://source.codeaurora.org/quic/la/platform/vendor/opensource/arspf-headers
Note: There is one false positive warning in this patchset:
audioreach.c:80:45: warning: array of flexible structures
Thanks,
srini
Changes since v10:
- fix build error during arm64 defconfig build reported by Mark in 12/17 patch
for audioreach_tplg_init symbol
Srinivas Kandagatla (17):
ASoC: dt-bindings: move LPASS dai related bindings out of q6afe
ASoC: dt-bindings: move LPASS clocks related bindings out of q6afe
ASoC: dt-bindings: rename q6afe.h to q6dsp-lpass-ports.h
ASoC: qdsp6: q6afe-dai: move lpass audio ports to common file
ASoC: qdsp6: q6afe-clocks: move audio-clocks to common file
ASoC: dt-bindings: q6dsp: add q6apm-lpass-dai compatible
ASoC: dt-bindings: lpass-clocks: add q6prm clocks compatible
ASoC: dt-bindings: add q6apm digital audio stream bindings
ASoC: qdsp6: audioreach: add basic pkt alloc support
ASoC: qdsp6: audioreach: add q6apm support
ASoC: qdsp6: audioreach: add module configuration command helpers
ASoC: qdsp6: audioreach: add Kconfig and Makefile
ASoC: qdsp6: audioreach: add topology support
ASoC: qdsp6: audioreach: add q6apm-dai support
ASoC: qdsp6: audioreach: add q6apm lpass dai support
ASoC: qdsp6: audioreach: add q6prm support
ASoC: qdsp6: audioreach: add support for q6prm-clocks
ASoC: amd: acp: SND_SOC_AMD_ACP_COMMON should depend on X86 && PCI
All configuration symbols for AMD Audio ACP conponents depend on X86 &&
PCI, except for SND_SOC_AMD_ACP_COMMON. Add a dependency on X86 && PCI
to SND_SOC_AMD_ACP_COMMON, to prevent asking the user about AMD Audio
ACP support when configuring a kernel without X86 or PCI support.
ASoC: amd: acp: Wrap AMD Audio ACP components in SND_SOC_AMD_ACP_COMMON
The build only descends into sound/soc/amd/acp/ if
CONFIG_SND_SOC_AMD_ACP_COMMON=y. Hence all later config symbols should
depend on SND_SOC_AMD_ACP_COMMON, to prevent asking the user about
config symbols for driver code that won't be build anyway.
ASoC: cs42l42: free_irq() before powering-down on probe() fail
Relying on devm to free the irq handler on probe failure leaves a
small window of opportunity for an interrupt to become pending and
then the handler to run after the chip has been reset and powered
off.
For safety cs42l42_probe() should free the irq in the error path.
As the irq is now disabled by the driver in probe() and remove()
there is no point allocating it as a devres-managed item, so
convert to plain non-devres.
ASoC: dt-bindings: add q6apm digital audio stream bindings
On AudioReach audio Framework, Audio Streams (PCM/Compressed) are managed by
Q6APM(Audio Process Manager) service. This patch adds bindings for this DAIs
exposed by the DSP.
On AudioReach audio Framework access to LPASS ports is via Q6PRM
(Proxy Resource Manager) service, so add a dedicated lpass-clock compatible
string for this.