This patch adds Codec2Codec-Single sample to audio-graph-card2-custom-sample.dtsi.
Because it can use very basic connection only for now,
it can use only
- 2channels
- S32_LE format
Test-Component driver has "IN" and "OUT" widget. Thus the route is
+--+
| | <-- Codec6 <-- IN
| | --> Codec7 --> OUT
+--+
One note here is that it will start works when it boot.
In other words we can't stop it so far.
We need to update driver for it in the future.
...
asoc-audio-graph-card2-custom-sample: test_codec.7 <-> test_codec.6 mapping ok
test-component test_codec: test_dai_startup() : test_codec.6
test-component test_codec: test_dai_startup() : test_codec.7
...
Signed-off-by: Kuninori Morimoto <kuninori.morimoto.gx@renesas.com>
Link: https://lore.kernel.org/r/87o87ulu2o.wl-kuninori.morimoto.gx@renesas.com
Signed-off-by: Mark Brown <broonie@kernel.org>
This patch adds DPCM link Multi-CPU/Codec sample to
audio-graph-card2-custom-sample.dtsi.
This sample is assuming MIXer connection.
One note is that Multi-FE is not supported on ASoC
FE BE
**** +-+
CPU5 -- * * -- | | -- Codec4
CPU6 -- * * | | -- Codec5
**** +-+
Signed-off-by: Kuninori Morimoto <kuninori.morimoto.gx@renesas.com>
Link: https://lore.kernel.org/r/87pmsalu2s.wl-kuninori.morimoto.gx@renesas.com
Signed-off-by: Mark Brown <broonie@kernel.org>
This patch adds DPCM link Single-CPU/Codec sample to
audio-graph-card2-custom-sample.dtsi.
This sample is assuming MIXer connection.
FE BE
****
CPU3 -- * * -- Codec3
CPU4 -- * *
****
Signed-off-by: Kuninori Morimoto <kuninori.morimoto.gx@renesas.com>
Link: https://lore.kernel.org/r/87r1cqlu2w.wl-kuninori.morimoto.gx@renesas.com
Signed-off-by: Mark Brown <broonie@kernel.org>
Audio Graph Card2 settings is a little bit difficult for beginner,
and Customizing it also difficult/confusable too.
So, this patch adds sample for it.
You can easily use it by adding below line on your DT file,
and select CONFIGs to your .config.
#include "../../../../../sound/soc/generic/audio-graph-card2-custom-sample.dtsi"
CONFIG_SND_AUDIO_GRAPH_CARD2
CONFIG_SND_AUDIO_GRAPH_CARD2_CUSTOM_SAMPLE
CONFIG_SND_TEST_COMPONENT
This patch uses audio-graph-card2 base custom sample driver.
You can directly use audio-graph-card2 instead of custom sample driver
by modifing compatible.
- compatible = "audio-graph-card2-custom-sample";
+ compatible = "audio-graph-card2";
Sample custom driver will indicate customized print.
It is using Test-Component driver for CPU/Codec.
It can indicate more detail print of each behavior if user want to.
In such case, you need to update compatible to "xxx-nv" or "xxx-vv".
- compatible = "test-cpu";
+ compatible = "test-cpu-verbose";
Signed-off-by: Kuninori Morimoto <kuninori.morimoto.gx@renesas.com>
Link: https://lore.kernel.org/r/87tuhmlu35.wl-kuninori.morimoto.gx@renesas.com
Signed-off-by: Mark Brown <broonie@kernel.org>
audio-graph-card2 has customizing support.
This means user can re-use audio-graph-card2 DT parsing, and possible
to expand to own special handling.
This patch adds Audio Graph Card2 Customize Sample Driver.
It can re-use audio-graph-card2 parsing by calling
audio_graph2_parse_of(...), and user can expand each functions by
using hooks.
Signed-off-by: Kuninori Morimoto <kuninori.morimoto.gx@renesas.com>
Link: https://lore.kernel.org/r/87v922lu3c.wl-kuninori.morimoto.gx@renesas.com
Signed-off-by: Mark Brown <broonie@kernel.org>
This patch adds Codec2Codec support to audio-graph-card2.
It can use Codec2Codec but very simple case only for now.
It doesn't have "SWITCH" control yet, thus it start automatically
when it was probed, and can't stop, so far.
Thus it needs to be updated around widgets/routing handling,
and you need to understand that it is under experimental.
Codec has SND_SOC_DAPM_INPUT() (= IN) / SND_SOC_DAPM_OUTPUT(= OUT)
widgets in below case.
It is assuming 2channel, S32_LE format for now.
It needs to be updated, too.
It needs "codec2codec" node (= B), needs to have routing (= A),
need to indicate CPU side at links (= X).
ports@0 is for CPU side (= X), port@1 is Codec side (= Y).
It needs to have "rate" (= C)
+--+
| |<-- Codec0 <-- IN
| |--> Codec1 --> OUT
+--+
sound {
compatible = "audio-graph-card2";
(A) routing = "OUT" ,"DAI1 Playback",
"DAI0 Capture", "IN";
(X) links = <&c2c>;
(B) codec2codec {
ports {
(C) rate = <48000>;
(X) c2c: port@0 { c2cf_ep: endpoint { remote-endpoint = <&codec0_ep>; }; };
(Y) port@1 { c2cb_ep: endpoint { remote-endpoint = <&codec1_ep>; }; };
};
};
Codec {
ports {
port@0 {
bitclock-master;
frame-master;
codec0_ep: endpoint { remote-endpoint = <&c2cf_ep>; }; };
port@1 { codec1_ep: endpoint { remote-endpoint = <&c2cb_ep>; }; };
};
};
Link: https://lore.kernel.org/r/87k0xszlep.wl-kuninori.morimoto.gx@renesas.com
Signed-off-by: Kuninori Morimoto <kuninori.morimoto.gx@renesas.com>
Link: https://lore.kernel.org/r/87y26ylu4a.wl-kuninori.morimoto.gx@renesas.com
Signed-off-by: Mark Brown <broonie@kernel.org>
audio-graph-card2 will support DPCM/Multi/Codec2Codec,
and these will use almost same DT settings which uses
ports0 and ports1.
This patch adds asoc_graph_is_ports0() which checks
port is under port0 or not.
Signed-off-by: Kuninori Morimoto <kuninori.morimoto.gx@renesas.com>
Link: https://lore.kernel.org/r/875yu2n8ra.wl-kuninori.morimoto.gx@renesas.com
Signed-off-by: Mark Brown <broonie@kernel.org>
We already have dummy-codec, dummy-platform.
But its issues are
1) we don't have dummy-cpu,
2) we can't select it via DeviceTree
3) It do nothing
Sometimes we want to have Dummy Sound Component for debugging,
for testing, for learning Framework behavior, etc, etc...
This patch adds Test-Component driver for it.
User can select CPU Component by using "test-cpu" compatible,
and can select Codec Component by using "test-codec" compatible.
It doesn't support Platform so far, but is easy to add.
We can verbose print to know its progress if user selected
xxx-verbose compatible driver.
for example,
test-cpu : silent Component, silent DAI
test-cpu-verbose-component : verbose Component, silent DAI
test-cpu-verbose-dai : silent Component, verbose DAI
test-cpu-verbose : verbose Component, verbose DAI
Signed-off-by: Kuninori Morimoto <kuninori.morimoto.gx@renesas.com>
Link: https://lore.kernel.org/r/877dein8rx.wl-kuninori.morimoto.gx@renesas.com
Signed-off-by: Mark Brown <broonie@kernel.org>
A back-merge of 5.15 branch into 5.16-devel branch for further
development of USB and ALSA core stuff that depends on 5.15 fixes.
Signed-off-by: Takashi Iwai <tiwai@suse.de>
A little pop can be heard obviously from HP while playing a silent.
This patch fixes it by using two functions:
1. Enable HP 1bit output mode.
2. Change the charge pump switch size during playback on and off.
Signed-off-by: Derek Fang <derek.fang@realtek.com>
Link: https://lore.kernel.org/r/20211014094054.811-1-derek.fang@realtek.com
Signed-off-by: Mark Brown <broonie@kernel.org>
There are several things the patch adding the support for 'I2S Reference'
got wrong:
- "None" selection is in fact equals to last selected reference
- The custom put overrides RX/TX len, TDM slot sizes, etc
- the enum is useless in most part for the reference tracking
- there is no need for EXT control as there is a single bit in
RT1011_TDM1_SET_1 register (bit 7) which selects the reference
- it was using ucontrol->value.integer.value[0] in the put/get callbacks
which causesed access to 'I2S Reference' enum with alsamixer to fail
Complements: c3de683c4d ("ASoC: rt1011: Fix 'I2S Reference' enum control caused error")
Signed-off-by: Peter Ujfalusi <peter.ujfalusi@linux.intel.com>
Link: https://lore.kernel.org/r/20211013123300.11095-1-peter.ujfalusi@linux.intel.com
Signed-off-by: Mark Brown <broonie@kernel.org>
There is a noise issue for 8kHz sample rate on slave mode.
Compared with master mode, the difference is the DACDIV
setting, after correcting the DACDIV, the noise is gone.
There is no noise issue for 48kHz sample rate, because
the default value of DACDIV is correct for 48kHz.
So wm8960_configure_clocking() should be functional for
ADC and DAC function even if it is slave mode.
In order to be compatible for old use case, just add
condition for checking that sysclk is zero with
slave mode.
Fixes: 0e50b51aa2 ("ASoC: wm8960: Let wm8960 driver configure its bit clock and frame clock")
Signed-off-by: Shengjiu Wang <shengjiu.wang@nxp.com>
Acked-by: Charles Keepax <ckeepax@opensource.cirrus.com>
Link: https://lore.kernel.org/r/1634102224-3922-1-git-send-email-shengjiu.wang@nxp.com
Signed-off-by: Mark Brown <broonie@kernel.org>
ChiYuan Huang <cy_huang@richtek.com>:
From: ChiYuan Huang <cy_huang@richtek.com>
This patch series Add the Richtek RT9120 support.
In v4:
- Add 'classd_tlv' for 'SPK Gain Volume' control item.
- Unify the tlv declaration to the postfix '_tlv'.
- Fix 'digital_tlv' mute as 1 to declare the minimum is muted.
In v3:
- Add dvdd regulator binding to check the dvdd voltage domain.
- Refine sdo_select_text.
- Use switch case in 'internal_power_event' function.
- Remove the volume and mute initially write in component probe.
- Remove the mute API. It's no need by HW design.
In v2:
- Add missing #sound-dai-cells property.
ChiYuan Huang (2):
ASoC: dt-bindings: rt9120: Add initial bindings
ASoC: rt9120: Add rt9210 audio amplifier support
.../devicetree/bindings/sound/richtek,rt9120.yaml | 59 +++
sound/soc/codecs/Kconfig | 10 +
sound/soc/codecs/Makefile | 2 +
sound/soc/codecs/rt9120.c | 495 +++++++++++++++++++++
4 files changed, 566 insertions(+)
create mode 100644 Documentation/devicetree/bindings/sound/richtek,rt9120.yaml
create mode 100644 sound/soc/codecs/rt9120.c
--
2.7.4
The only usage of acp5x_i2s_dai_ops is to assign its address to the ops
field in the snd_soc_dai_driver struct, which is a pointer to const.
Make it const to allow the compiler to put it in read-only memory.
Signed-off-by: Rikard Falkeborn <rikard.falkeborn@gmail.com>
Link: https://lore.kernel.org/r/20211012211506.21159-1-rikard.falkeborn@gmail.com
Signed-off-by: Mark Brown <broonie@kernel.org>
These are only assigned to the ops field in the snd_soc_dai_link struct
which is a pointer to const struct snd_soc_ops. Make them const to allow
the compiler to put them in read-only memory.
Signed-off-by: Rikard Falkeborn <rikard.falkeborn@gmail.com>
Link: https://lore.kernel.org/r/20211012205521.14098-1-rikard.falkeborn@gmail.com
Signed-off-by: Mark Brown <broonie@kernel.org>
This drops the rt9210 support due to a race with a new version being
sent out for some incremental changes.
Signed-off-by: Mark Brown <broonie@kernel.org>
Access to 'I2S Reference' enum causes alsamixer to fail to load:
$ alsamixer
cannot load mixer controls: Invalid argument
cml_rt1011_rt5682 cml_rt1011_rt5682: control 2:0:0:TL I2S Reference:0: access overflow
The reason is that the original patch adding the code was using
ucontrol->value.integer.value[0]
instead the correct
ucontrol->value.enumerated.item[0]
for an ENUM control.
Fixes: 87f40af26c ("ASoC: rt1011: add i2s reference control for rt1011")
Reported-by: Seppo Ingalsuo <seppo.ingalsuo@linux.intel.com>
Signed-off-by: Peter Ujfalusi <peter.ujfalusi@linux.intel.com>
Link: https://lore.kernel.org/r/20211011144518.2518-1-peter.ujfalusi@linux.intel.com
Signed-off-by: Mark Brown <broonie@kernel.org>
Ensure the default 0dB playback path is always used.
The code that set FULL_SCALE_VOL based on LOAD_DET_RCSTAT was
spurious, and resulted in a -6dB attenuation being accidentally
inserted into the playback path.
Signed-off-by: Stefan Binding <sbinding@opensource.cirrus.com>
Signed-off-by: Richard Fitzgerald <rf@opensource.cirrus.com>
Link: https://lore.kernel.org/r/20211011144903.28915-1-rf@opensource.cirrus.com
Signed-off-by: Mark Brown <broonie@kernel.org>
The small set of cleanups against bytcr_rt5651 board file.
In v2:
- added commit message to patch 2 (Joe, Pierre)
- added cover letter (Pierre)
- added Hans to Cc list (Hans)
Andy Shevchenko (4):
ASoC: Intel: bytcr_rt5651: Get platform data via dev_get_platdata()
ASoC: Intel: bytcr_rt5651: Use temporary variable for struct device
ASoC: Intel: bytcr_rt5651: use devm_clk_get_optional() for mclk
ASoC: Intel: bytcr_rt5651: Utilize dev_err_probe() to avoid log
saturation
sound/soc/intel/boards/bytcr_rt5651.c | 118 +++++++++++---------------
1 file changed, 50 insertions(+), 68 deletions(-)
--
2.33.0
dev_err_probe() avoids printing into log when the deferred probe is invoked.
This is possible when clock provider is pending to appear.
Signed-off-by: Andy Shevchenko <andriy.shevchenko@linux.intel.com>
Reviewed-by: Hans de Goede <hdegoede@redhat.com>
Link: https://lore.kernel.org/r/20211007170250.27997-5-andriy.shevchenko@linux.intel.com
Signed-off-by: Mark Brown <broonie@kernel.org>
The devm_clk_get_optional() helper returns NULL when devm_clk_get()
returns -ENOENT. This makes things slightly cleaner. The added benefit
is mostly cosmetic.
Signed-off-by: Andy Shevchenko <andriy.shevchenko@linux.intel.com>
Reviewed-by: Hans de Goede <hdegoede@redhat.com>
Link: https://lore.kernel.org/r/20211007170250.27997-4-andriy.shevchenko@linux.intel.com
Signed-off-by: Mark Brown <broonie@kernel.org>
dev_err_probe() avoids printing into log when the deferred probe is invoked.
This is possible when clock provider is pending to appear.
Signed-off-by: Andy Shevchenko <andriy.shevchenko@linux.intel.com>
Reviewed-by: Hans de Goede <hdegoede@redhat.com>
Tested-by: Hans de Goede <hdegoede@redhat.com>
Link: https://lore.kernel.org/r/20211007165715.27463-5-andriy.shevchenko@linux.intel.com
Signed-off-by: Mark Brown <broonie@kernel.org>
The devm_clk_get_optional() helper returns NULL when devm_clk_get()
returns -ENOENT. This makes things slightly cleaner. The added benefit
is mostly cosmetic.
Signed-off-by: Andy Shevchenko <andriy.shevchenko@linux.intel.com>
Reviewed-by: Hans de Goede <hdegoede@redhat.com>
Tested-by: Hans de Goede <hdegoede@redhat.com>
Link: https://lore.kernel.org/r/20211007165715.27463-4-andriy.shevchenko@linux.intel.com
Signed-off-by: Mark Brown <broonie@kernel.org>
Use temporary variable for struct device to make code neater.
Signed-off-by: Andy Shevchenko <andriy.shevchenko@linux.intel.com>
Reviewed-by: Hans de Goede <hdegoede@redhat.com>
Tested-by: Hans de Goede <hdegoede@redhat.com>
Link: https://lore.kernel.org/r/20211007165715.27463-3-andriy.shevchenko@linux.intel.com
Signed-off-by: Mark Brown <broonie@kernel.org>
Access to platform data via dev_get_platdata() getter to make code cleaner.
Signed-off-by: Andy Shevchenko <andriy.shevchenko@linux.intel.com>
Reviewed-by: Hans de Goede <hdegoede@redhat.com>
Tested-by: Hans de Goede <hdegoede@redhat.com>
Link: https://lore.kernel.org/r/20211007165715.27463-2-andriy.shevchenko@linux.intel.com
Signed-off-by: Mark Brown <broonie@kernel.org>
We are using fch clock controller as parent mclk source for rt5682
codec. Add config to enable clock framework support for 48MHz fixed
clock when machine driver config is selected.
Signed-off-by: Ajit Kumar Pandey <AjitKumar.Pandey@amd.com>
Link: https://lore.kernel.org/r/20211011055354.67719-1-AjitKumar.Pandey@amd.com
Signed-off-by: Mark Brown <broonie@kernel.org>
'component' is allocated in snd_soc_register_component(), but component->list
is not initalized, this may cause snd_soc_del_component_unlocked() deref null
ptr in the error handing case.
KASAN: null-ptr-deref in range [0x0000000000000000-0x0000000000000007]
RIP: 0010:__list_del_entry_valid+0x81/0xf0
Call Trace:
snd_soc_del_component_unlocked+0x69/0x1b0 [snd_soc_core]
snd_soc_add_component.cold+0x54/0x6c [snd_soc_core]
snd_soc_register_component+0x70/0x90 [snd_soc_core]
devm_snd_soc_register_component+0x5e/0xd0 [snd_soc_core]
tas2552_probe+0x265/0x320 [snd_soc_tas2552]
? tas2552_component_probe+0x1e0/0x1e0 [snd_soc_tas2552]
i2c_device_probe+0xa31/0xbe0
Fix by adding INIT_LIST_HEAD() to snd_soc_component_initialize().
Reported-by: Hulk Robot <hulkci@huawei.com>
Signed-off-by: Yang Yingliang <yangyingliang@huawei.com>
Link: https://lore.kernel.org/r/20211009065840.3196239-1-yangyingliang@huawei.com
Signed-off-by: Mark Brown <broonie@kernel.org>
In the case where the call to i2s_tdm_prepare_enable_mclk fails the
function returns before the error handling goto is executed. Fix this
by removing the return do perform the intended error handling exit.
Fixes: 081068fd64 ("ASoC: rockchip: add support for i2s-tdm controller")
Addresses-Coverity: ("Structurally dead code")
Signed-off-by: Colin Ian King <colin.king@canonical.com>
Message-Id: <20211008095430.62680-2-colin.king@canonical.com>
Signed-off-by: Mark Brown <broonie@kernel.org>
The call to rockchip_i2s_ch_to_io is only useful for its return
value which is not being used. The function call also has no
side effects, the call is effectively useless and can be removed.
Addresses-Coverity: ("Useless call")
Signed-off-by: Colin Ian King <colin.king@canonical.com>
Message-Id: <20211008095430.62680-1-colin.king@canonical.com>
Signed-off-by: Mark Brown <broonie@kernel.org>
Because clock names are modified in mediatek CCF driver, sync the updated
clock names to audsys driver.
Signed-off-by: Trevor Wu <trevor.wu@mediatek.com>
Message-Id: <20211008070424.14347-1-trevor.wu@mediatek.com>
Signed-off-by: Mark Brown <broonie@kernel.org>
The small set of cleanups against bytcht_es8316 board file.
In v4:
- fixed Pierre's email (Pierre)
- added Hans to the Cc list
In v3:
- actually added a Pierre's tag (Mark)
In v2:
- added tag (Pierre)
- added commit message to the patch 2 (Joe)
Andy Shevchenko (4):
ASoC: Intel: bytcht_es8316: Get platform data via dev_get_platdata()
ASoC: Intel: bytcht_es8316: Use temporary variable for struct device
ASoC: Intel: bytcht_es8316: Switch to use gpiod_get_optional()
ASoC: Intel: bytcht_es8316: Utilize dev_err_probe() to avoid log
saturation
sound/soc/intel/boards/bytcht_es8316.c | 37 +++++++++-----------------
1 file changed, 12 insertions(+), 25 deletions(-)
--
2.33.0
The fixed maximum size of IPC message does not allow for large
transfers, e.g. for filter data. Currently such messages will
be divided into smaller pieces and sent to firmware in multiple
chunks. For future IPC, this strategy is not suitable.
The maximum IPC message size is limited by host box size which
can be known when firmware is ready, so the fw_ready callback
can allocate IPC messages with platform-specific sizes instead
of the current fixed-size.
To be compatible with released firmware, current platforms will
still use SOF_IPC_MSG_MAX_SIZE. For future platforms, there will
be a new fw_ready function and the platform-specific allocation
will take place there.
Signed-off-by: Rander Wang <rander.wang@intel.com>
Reviewed-by: Bard Liao <bard.liao@intel.com>
Reviewed-by: Ranjani Sridharan <ranjani.sridharan@linux.intel.com>
Reviewed-by: Pierre-Louis Bossart <pierre-louis.bossart@linux.intel.com>
Signed-off-by: Peter Ujfalusi <peter.ujfalusi@linux.intel.com>
Message-Id: <20211008093836.28210-1-peter.ujfalusi@linux.intel.com>
Signed-off-by: Mark Brown <broonie@kernel.org>
dev_err_probe() avoids printing into log when the deferred probe is invoked.
This is possible when clock provider is pending to appear.
Signed-off-by: Andy Shevchenko <andriy.shevchenko@linux.intel.com>
Acked-by: Pierre-Louis Bossart <pierre-louis.bossart@linux.intel.com>
Message-Id: <20211007164523.27094-5-andriy.shevchenko@linux.intel.com>
Signed-off-by: Mark Brown <broonie@kernel.org>
First of all, replace indexed API by plain one since we have index 0.
Second, switch to optional variant and drop duplicated code.
Signed-off-by: Andy Shevchenko <andriy.shevchenko@linux.intel.com>
Acked-by: Pierre-Louis Bossart <pierre-louis.bossart@linux.intel.com>
Message-Id: <20211007164523.27094-4-andriy.shevchenko@linux.intel.com>
Signed-off-by: Mark Brown <broonie@kernel.org>
Use temporary variable for struct device to make code neater.
Signed-off-by: Andy Shevchenko <andriy.shevchenko@linux.intel.com>
Acked-by: Pierre-Louis Bossart <pierre-louis.bossart@linux.intel.com>
Message-Id: <20211007164523.27094-3-andriy.shevchenko@linux.intel.com>
Signed-off-by: Mark Brown <broonie@kernel.org>
Access to platform data via dev_get_platdata() getter to make code cleaner.
Signed-off-by: Andy Shevchenko <andriy.shevchenko@linux.intel.com>
Acked-by: Pierre-Louis Bossart <pierre-louis.bossart@linux.intel.com>
Message-Id: <20211007164523.27094-2-andriy.shevchenko@linux.intel.com>
Signed-off-by: Mark Brown <broonie@kernel.org>
The max98927 codec on some devices (i.e. Xiaomi Mi A2 Lite phone) requires
hardware-resetting the codec by driving a reset-gpio. This series adds
support for it through an optional reset-gpios property.
v4:
* Correctly assert/deassert the GPIO states
* Wait for the i2c port to be ready after reset
* Reset device when removed
v3:
* Fix indentation on the dev_err_probe line
v2:
* Use dev_err_probe instead of dev_err
Alejandro Tafalla (2):
ASoC: max98927: Handle reset gpio when probing i2c
dt-bindings: sound: max98927: Add reset-gpios optional property
.../devicetree/bindings/sound/max9892x.txt | 3 +++
sound/soc/codecs/max98927.c | 25 +++++++++++++++++++
sound/soc/codecs/max98927.h | 1 +
3 files changed, 29 insertions(+)
--
2.33.0
Hi,
The aim of this series is to clean up, make it easier to interpret and less
'chatty' prints aimed for debugging errors.
For example currently the DSP/IPC dump is printed every time we have an IPC
timeout and it is posible to lost the first and more indicative dump to find the
rootcause.
Regards,
Peter
---
Peter Ujfalusi (18):
ASoC: SOF: debug: Swap the dsp_dump and ipc_dump sequence for
fw_exception
ASoC: SOF: ipc and dsp dump: Add markers for better visibility
ASoC: SOF: Print the dbg_dump and ipc_dump once to reduce kernel log
noise
ASoC: SOF: loader: Print the DSP dump if boot fails
ASoC: SOF: intel: atom: No need to do a DSP dump in atom_run()
ASoC: SOF: debug/ops: Move the IPC and DSP dump functions out from the
header
ASoC: SOF: debug: Add SOF_DBG_DUMP_OPTIONAL flag for DSP dumping
ASoC: SOF: intel: hda-loader: Use snd_sof_dsp_dbg_dump() for DSP dump
ASoC: SOF: Drop SOF_DBG_DUMP_FORCE_ERR_LEVEL and sof_dev_dbg_or_err
ASoC: SOF: debug: Print out the fw_state along with the DSP dump
ASoC: SOF: ipc: Re-enable dumps after successful IPC tx
ASoC: SOF: ops: Force DSP panic dumps to be printed
ASoC: SOF: Introduce macro to set the firmware state
ASoC: SOF: intel: hda: Drop 'error' prefix from error dump functions
ASoC: SOF: core: Clean up snd_sof_get_status() prints
ASoC: SOF: loader: Drop SOF_DBG_DUMP_REGS flag when firmware start
fails
ASoC: SOF: Intel: hda-loader: Drop SOF_DBG_DUMP_REGS flag from
dbg_dump calls
ASoC: SOF: Intel: hda: Dump registers and stack when SOF_DBG_DUMP_REGS
is set
Pierre-Louis Bossart (1):
ASoC: SOF: core: debug: force all processing on primary core
sound/soc/sof/core.c | 24 ++++++-------
sound/soc/sof/debug.c | 61 ++++++++++++++++++++++++++++++--
sound/soc/sof/intel/atom.c | 5 +--
sound/soc/sof/intel/hda-loader.c | 11 +++---
sound/soc/sof/intel/hda.c | 16 +++------
sound/soc/sof/ipc.c | 10 ++++--
sound/soc/sof/loader.c | 11 ++++--
sound/soc/sof/ops.c | 3 ++
sound/soc/sof/ops.h | 12 +------
sound/soc/sof/pm.c | 6 ++--
sound/soc/sof/sof-priv.h | 31 ++++++++++------
sound/soc/sof/topology.c | 6 ++++
12 files changed, 131 insertions(+), 65 deletions(-)
--
2.33.0
Hello,
this is version 5 of the I2S/TDM driver patchset. A big thanks
to everyone who has provided their valuable feedback so far.
Changes in v5:
driver:
- change comment style of the first comment to C++ style
- make refcount non-atomic, as it's only ever used inside
a spinlock
- use newer SND_SOC_DAIFMT_CB* defines
- change ternary statements to if/else conditions
- make _clk_compensation_put return 1 if clock changed
- implement set_bclk_ratio callback
- always set half frame sync mode in TDM mode
- automatically enable mclk-calibrate mode when the clocks for
it are specified in the device tree
bindings:
- add Reviewed-by: Rob Herring
- drop rockchip,frame-width property (done by set_bclk_ratio)
- drop rockchip,fsync-half-frame property
- drop rockchip,mclk-calibrate property
dts:
- drop empty codec block from Quartz64 device tree
Changes in v4:
driver:
- factor TDE/RDE enable/disable into their own inlined functions
- add an RDE disable in a location where it looks like it was
forgotten (rxctrl else), judging by corresponding TDE code
- remove parentheses around CLK_PPM_MIN/MAX values
- wording + titlecasing in the clock compensation control
- use if statement in precious_reg instead
- refactor rockchip_i2s_io_multiplex to have the switch statements
in a function call to make the function less unwieldy
- get rid of IS_ERR checks around clk enable/disable calls where
already checked before by the probe
- reworded some error message strings
- fix potential deadlock in txrxctrl found by Sugar Zhang
using spin_lock_irqsave
- fix potential deadlock in trcm_mode found by Sugar Zhang
using spin_lock_irqsave
- use devm_platform_get_and_ioremap_resource in probe
- only set DMA things if controller has capture/playback ability.
Did not move this into init_dai because I'd then need to pass in
the res and probe it earlier in the function, and it's also used
elsewhere in the probe function
- use _get_optional_exclusive for reset controls, as some controllers
only have capture or playback capability
bindings:
- remove status = "okay" since that's the default
- change the path configs to be an enum
- rename "foo" to "bus"
- make resets optional as controller may lack either playback or
capture capability, and therefore also doesn't have a reset.
At least one reset is still required, because a controller with
no playback and no capture is not very useful
Changes in v3:
driver:
- alphabetically sort includes
- check pm_runtime_get_sync return value, act on it
- remove unnecessary initialisers in set_fmt
- use udelay(15) in retry code: 10 retries * 15 = 150, so at worst
we wait the full i2s register access delay
- fix some weird returns to return directly
- use __maybe_unused instead of #ifdef CONFIG_PM_SLEEP, also put
__maybe_unused on the runtime callbacks
- use (foo) instead of foo in header macros for precedence reasons
- when using mclk-calibrate, also turn off/on those clocks during
suspend and resume operations
- remove mclk_tx and mclk_rx reenablement code in remove
- move hclk enablement further down the probe, and disable it
on probe failure
- make reset controls mandatory, since the bindings state this too
- use _exclusive for getting the reset controls
- change reset assert/deassert delays to both be 10 usec
(thank you Sugar Zhang!)
- properly prepare and enable all mclks in probe, especially before
calling clk_get_rate on them
- if registering PCM fails, also use the cleanup error path instead of
returning directly
- bring back playback and capture only but in the way Sugar Zhang
suggested it: set those modes depending on dma-names
- rework clock enablement in general. Probe now always enables these,
instead of relying on the pm resume thing
- add myself to MAINTAINERS for this driver
dt bindings:
- fix a description still mentioning clk-trcm in the schema
- document rockchip,io-multiplex, a property that describes the
hardware as having multiplexed I2S GPIOs so direction needs to
be changed dynamically
- document rockchip,mclk-calibrate, which allows specifying
different clocks for the two sample rate bases and switch between
them as needed
- dma-names now doesn't have a set order and items can be absent to
indicate that the controller doesn't support this mode
- add myself to MAINTAINERS for these bindings
Changes in v2:
- remove ad-hoc writeq and needless (and broken) optimisation in
reset assert/deassert. This wouldn't have worked on Big Endian,
and would've been pointless on any other platform, as the
overhead for saving one write was comparatively big
- fix various checkpatch issues
- get rid of leftover clk-trcm in schema
- set status = "okay" in example in schema instead of "disabled"
- change dma-names so rx is first, adjust device trees as necessary
- properly reference uint32-array for rx-route and tx-route
instead of uint32
- replace trcm-sync with two boolean properties, adjust DT changes
accordingly and also get rid of the header file
- get rid of rockchip,no-dmaengine. This was only needed for
some downstream driver and shouldn't be in the DT
- get rid of rockchip,capture-only/playback-only. Rationale being
that I have no way to test whether they're needed, and
unconditionally setting channels_min to 0 breaks everything
- change hclk description in "clocks"
Nicolas Frattaroli (4):
ASoC: rockchip: add support for i2s-tdm controller
ASoC: dt-bindings: rockchip: add i2s-tdm bindings
arm64: dts: rockchip: add i2s1 on rk356x
arm64: dts: rockchip: add analog audio on Quartz64
.../bindings/sound/rockchip,i2s-tdm.yaml | 198 ++
MAINTAINERS | 7 +
.../boot/dts/rockchip/rk3566-quartz64-a.dts | 31 +-
arch/arm64/boot/dts/rockchip/rk356x.dtsi | 26 +
sound/soc/rockchip/Kconfig | 11 +
sound/soc/rockchip/Makefile | 2 +
sound/soc/rockchip/rockchip_i2s_tdm.c | 1848 +++++++++++++++++
sound/soc/rockchip/rockchip_i2s_tdm.h | 398 ++++
8 files changed, 2520 insertions(+), 1 deletion(-)
create mode 100644 Documentation/devicetree/bindings/sound/rockchip,i2s-tdm.yaml
create mode 100644 sound/soc/rockchip/rockchip_i2s_tdm.c
create mode 100644 sound/soc/rockchip/rockchip_i2s_tdm.h
--
2.33.0
Recent changes in soc-pcm completely broke basic support for mixers on
Intel systems: the filters on BE states prevent the connection of a
second mixer input while the back-end is already active.
Rather than reverting the changes, which would be problematic for
Tegra systems, this patch suggests an additional filter which will
only apply to Tegra systems. This is a temporary solution which will
have to be revisited - additional issues have been reported with DPCM.
Fixes: 0c25db3f76 ('ASoC: soc-pcm: Don't reconnect an already active BE')
Suggested-by: Sameer Pujar <spujar@nvidia.com>
Signed-off-by: Pierre-Louis Bossart <pierre-louis.bossart@linux.intel.com>
Reviewed-by: Ranjani Sridharan <ranjani.sridharan@linux.intel.com>
Reviewed-by: Péter Ujfalusi <peter.ujfalusi@linux.intel.com>
Link: https://lore.kernel.org/r/20211004212141.193136-1-pierre-louis.bossart@linux.intel.com
Signed-off-by: Mark Brown <broonie@kernel.org>
When the system plays a sound immediately after resuming from S3,
it could hear a little pop from headphones.
It is due to the HP was unmuted before the completion of
jack re-detection finished in parallel.
This patch adds a lock to make sure the HP unmute after jack detect handler,
and adds a few depop changes.
Signed-off-by: Derek Fang <derek.fang@realtek.com>
Link: https://lore.kernel.org/r/20211007085519.12543-1-derek.fang@realtek.com
Signed-off-by: Mark Brown <broonie@kernel.org>
This commit adds support for the rockchip i2s-tdm controller,
which enables audio output on the following rockchip SoCs:
- px30
- rk1808
- rk3308
- rk3566
- rk3568
- rv1126
This is a cleaned up version of the downstream vendor kernel's
driver. It can be enabled through the SND_SOC_ROCKCHIP_I2S_TDM
configuration option.
Signed-off-by: Nicolas Frattaroli <frattaroli.nicolas@gmail.com>
Link: https://lore.kernel.org/r/20211001171531.178775-2-frattaroli.nicolas@gmail.com
Signed-off-by: Mark Brown <broonie@kernel.org>
This patch prepares the introduction of the compress API with SOF.
After each fragment is accepted by the DSP we need to inform
the userspace applications that they can send the next fragment.
This is done via snd_compr_fragment_elapsed.
Similar with the PCM case, in order to avoid sending an IPC before
the previous IPC is handled we need to schedule a delayed work to
call snd_compr_fragment_elapsed().
See snd_sof_pcm_period_elapsed.
To sum up this patch offers the following API to SOF code:
* snd_sof_compr_init_elapsed_work
* snd_sof_compr_fragment_elapsed
Note that implementation for compressed function is in a new file
selected via CONFIG_SND_SOC_SOF_COMPRESS invisible config option.
This option is automatically selected for platforms that support
the compress interface. For now only i.MX8 platforms support this.
For symmetry we introduce snd_sof_pcm_init_elapsed_work to setup
the work struct for PCM case.
Signed-off-by: Daniel Baluta <daniel.baluta@nxp.com>
Signed-off-by: Bud Liviu-Alexandru <budliviu@gmail.com>
Reviewed-by: Pierre-Louis Bossart <pierre-louis.bossart@linux.intel.com>
Reviewed-by: Paul Olaru <paul.olaru@oss.nxp.com>
Reviewed-by: Péter Ujfalusi <peter.ujfalusi@linux.intel.com>
Link: https://lore.kernel.org/r/20211004152147.1268978-5-daniel.baluta@oss.nxp.com
Signed-off-by: Mark Brown <broonie@kernel.org>
This makes IMX use the newly introduced generic IPC ops
instead of imx specific ones, and removes the old IMX
ipc ops, as they are no longer needed.
Signed-off-by: Daniel Baluta <daniel.baluta@nxp.com>
Signed-off-by: Bud Liviu-Alexandru <budliviu@gmail.com>
Reviewed-by: Pierre-Louis Bossart <pierre-louis.bossart@linux.intel.com>
Reviewed-by: Péter Ujfalusi <peter.ujfalusi@linux.intel.com>
Link: https://lore.kernel.org/r/20211004152147.1268978-4-daniel.baluta@oss.nxp.com
Signed-off-by: Mark Brown <broonie@kernel.org>
This operations should be generic as there is nothing Intel
specific. This works well for NXP i.MX8 stream IPC ops.
We start by moving sof/intel/intel-ipc.c into sof/stream-ipc.c and
rename the functions to be generic.
Notice that we use newly introduced snd_sof_dsp_mailbox_read
instead of sof_mailbox_read, to make sure that we are not
bound to existing MMIO memory access, and we allow platform
to implement their own memory access routines.
Signed-off-by: Daniel Baluta <daniel.baluta@nxp.com>
Signed-off-by: Bud Liviu-Alexandru <budliviu@gmail.com>
Reviewed-by: Pierre-Louis Bossart <pierre-louis.bossart@linux.intel.com>
Reviewed-by: Daniel Baluta <daniel.baluta@gmail.com>
Reviewed-by: Péter Ujfalusi <peter.ujfalusi@linux.intel.com>
Link: https://lore.kernel.org/r/20211004152147.1268978-3-daniel.baluta@oss.nxp.com
Signed-off-by: Mark Brown <broonie@kernel.org>
We need to introduce snd_sof_mailbox_{read/write} in order to provide
a generic way for mailbox access. These routines are optional, each
platform can implement their own specific routines.
So far, all platforms use mmapped I/O thus they can use custom made
routines sof_mailbox_read / sof_mailbox_write that use MMIO.
Signed-off-by: Daniel Baluta <daniel.baluta@nxp.com>
Signed-off-by: Bud Liviu-Alexandru <budliviu@gmail.com>
Reviewed-by: Pierre-Louis Bossart <pierre-louis.bossart@linux.intel.com>
Reviewed-by: Péter Ujfalusi <peter.ujfalusi@linux.intel.com>
Link: https://lore.kernel.org/r/20211004152147.1268978-2-daniel.baluta@oss.nxp.com
Signed-off-by: Mark Brown <broonie@kernel.org>
First thing the pipelines function which have "struct device *dev" as
parameter do is:
struct snd_sof_dev *sdev = dev_get_drvdata(dev);
and in all cases the passed dev is actually coming from sdev->dev.
Skip this steps and pass directly the sdev to all pipelines related
functions as few of them already does this.
Signed-off-by: Peter Ujfalusi <peter.ujfalusi@linux.intel.com>
Reviewed-by: Ranjani Sridharan <ranjani.sridharan@linux.intel.com>
Reviewed-by: Kai Vehmanen <kai.vehmanen@linux.intel.com>
Link: https://lore.kernel.org/r/20211006111651.10027-1-peter.ujfalusi@linux.intel.com
Signed-off-by: Mark Brown <broonie@kernel.org>
When removing the topology components, do not power down
the primary core. Doing so will result in an IPC timeout
when the SOF PCI device runtime suspends.
Fixes: 0dcdf84289 ("ASoC: SOF: add a "core" parameter to widget loading functions")
Signed-off-by: Ranjani Sridharan <ranjani.sridharan@linux.intel.com>
Reviewed-by: Pierre-Louis Bossart <pierre-louis.bossart@linux.intel.com>
Reviewed-by: Kai Vehmanen <kai.vehmanen@linux.intel.com>
Signed-off-by: Peter Ujfalusi <peter.ujfalusi@linux.intel.com>
Link: https://lore.kernel.org/r/20211006104041.27183-1-peter.ujfalusi@linux.intel.com
Signed-off-by: Mark Brown <broonie@kernel.org>
Instead of checking the fw_state to decide what information should be
printed, use the SOF_DBG_DUMP_REGS bit in the flags to dump registers and
stack.
Signed-off-by: Peter Ujfalusi <peter.ujfalusi@linux.intel.com>
Reviewed-by: Pierre-Louis Bossart <pierre-louis.bossart@linux.intel.com>
Reviewed-by: Ranjani Sridharan <ranjani.sridharan@linux.intel.com>
Reviewed-by: Kai Vehmanen <kai.vehmanen@linux.intel.com>
Link: https://lore.kernel.org/r/20211006110645.26679-20-peter.ujfalusi@linux.intel.com
Signed-off-by: Mark Brown <broonie@kernel.org>
In cl_dsp_init() we are powering up the DSP, register dump is not valid.
In hda_dsp_cl_boot_firmware() we are downloading the firmware to DSP, again
the register dump is not a valid concept.
Signed-off-by: Peter Ujfalusi <peter.ujfalusi@linux.intel.com>
Reviewed-by: Pierre-Louis Bossart <pierre-louis.bossart@linux.intel.com>
Reviewed-by: Ranjani Sridharan <ranjani.sridharan@linux.intel.com>
Reviewed-by: Kai Vehmanen <kai.vehmanen@linux.intel.com>
Link: https://lore.kernel.org/r/20211006110645.26679-19-peter.ujfalusi@linux.intel.com
Signed-off-by: Mark Brown <broonie@kernel.org>
snd_sof_dsp_run() failure indicates that the DSP did not even booted up,
thus asking for dumping registers at this point is not valid.
Signed-off-by: Peter Ujfalusi <peter.ujfalusi@linux.intel.com>
Reviewed-by: Pierre-Louis Bossart <pierre-louis.bossart@linux.intel.com>
Reviewed-by: Ranjani Sridharan <ranjani.sridharan@linux.intel.com>
Reviewed-by: Kai Vehmanen <kai.vehmanen@linux.intel.com>
Link: https://lore.kernel.org/r/20211006110645.26679-18-peter.ujfalusi@linux.intel.com
Signed-off-by: Mark Brown <broonie@kernel.org>
Clean up the error prints when decoding the status in snd_sof_get_status():
Drop the "error:" prefixes from the prints,
Use %# to print hexadecimal numbers,
Reword some of the messages to be more precise,
For a known error print out the panic code as well,
For unknown error print only the panic code without the magic
Signed-off-by: Peter Ujfalusi <peter.ujfalusi@linux.intel.com>
Reviewed-by: Pierre-Louis Bossart <pierre-louis.bossart@linux.intel.com>
Reviewed-by: Kai Vehmanen <kai.vehmanen@linux.intel.com>
Link: https://lore.kernel.org/r/20211006110645.26679-17-peter.ujfalusi@linux.intel.com
Signed-off-by: Mark Brown <broonie@kernel.org>
Drop the 'error' prefix printed in hda_dsp_dump_ext_rom_status(),
hda_ipc_irq_dump() and hda_ipc_dump() as it gives no value to the
information we print.
The DSP and IPC dump is marked now, which makes the 'error' prefix more
redundant.
Signed-off-by: Peter Ujfalusi <peter.ujfalusi@linux.intel.com>
Reviewed-by: Pierre-Louis Bossart <pierre-louis.bossart@linux.intel.com>
Reviewed-by: Kai Vehmanen <kai.vehmanen@linux.intel.com>
Link: https://lore.kernel.org/r/20211006110645.26679-16-peter.ujfalusi@linux.intel.com
Signed-off-by: Mark Brown <broonie@kernel.org>
Add sof_set_fw_state() macro to wrap the sdev->fw_state management to allow
actions to be taken when certain state is set or when state is changing.
Signed-off-by: Peter Ujfalusi <peter.ujfalusi@linux.intel.com>
Reviewed-by: Pierre-Louis Bossart <pierre-louis.bossart@linux.intel.com>
Reviewed-by: Kai Vehmanen <kai.vehmanen@linux.intel.com>
Link: https://lore.kernel.org/r/20211006110645.26679-15-peter.ujfalusi@linux.intel.com
Signed-off-by: Mark Brown <broonie@kernel.org>
If a DSP panic happens we want to see the dumps.
Signed-off-by: Peter Ujfalusi <peter.ujfalusi@linux.intel.com>
Reviewed-by: Pierre-Louis Bossart <pierre-louis.bossart@linux.intel.com>
Reviewed-by: Kai Vehmanen <kai.vehmanen@linux.intel.com>
Link: https://lore.kernel.org/r/20211006110645.26679-14-peter.ujfalusi@linux.intel.com
Signed-off-by: Mark Brown <broonie@kernel.org>
The dumps are silenced after an IPC tx timeout by default.
The IPC timeout can indicate severe error (firmware crash) or in some cases
it is less devastating and the firmware remains operational, the timeout
was due to a scheduling spike or other anomaly.
In any case consequent IPC timeouts will not print dumps but if any IPC do
succeed than we should re-enable the dumps to print dumps the next time
a timeout might happen.
Signed-off-by: Peter Ujfalusi <peter.ujfalusi@linux.intel.com>
Reviewed-by: Pierre-Louis Bossart <pierre-louis.bossart@linux.intel.com>
Reviewed-by: Kai Vehmanen <kai.vehmanen@linux.intel.com>
Link: https://lore.kernel.org/r/20211006110645.26679-13-peter.ujfalusi@linux.intel.com
Signed-off-by: Mark Brown <broonie@kernel.org>
The fw state can be an important information along with the DSP dump.
Print it out before the dump.
Signed-off-by: Peter Ujfalusi <peter.ujfalusi@linux.intel.com>
Reviewed-by: Pierre-Louis Bossart <pierre-louis.bossart@linux.intel.com>
Reviewed-by: Kai Vehmanen <kai.vehmanen@linux.intel.com>
Link: https://lore.kernel.org/r/20211006110645.26679-12-peter.ujfalusi@linux.intel.com
Signed-off-by: Mark Brown <broonie@kernel.org>
The sof_dev_dbg_or_err() is only used by intel/hda.c when dumping dsp
debug information.
It was used to print the extended rom status in either dev_dbg (during
retries) and finally with dev_err, but other lines were printed with
dev_err regardless.
Since we now only print the dump once, the flag and the macros is no longer
needed.
Signed-off-by: Peter Ujfalusi <peter.ujfalusi@linux.intel.com>
Reviewed-by: Ranjani Sridharan <ranjani.sridharan@linux.intel.com>
Reviewed-by: Pierre-Louis Bossart <pierre-louis.bossart@linux.intel.com>
Link: https://lore.kernel.org/r/20211006110645.26679-11-peter.ujfalusi@linux.intel.com
Signed-off-by: Mark Brown <broonie@kernel.org>
Do not call directly the hda_dsp_dump(), use the generic wrapper instead
to provide consistent output.
Mark the DSP dumps as optional to not spam the kernel log with the
exception of the last dump in case the DSP fails to run.
Signed-off-by: Peter Ujfalusi <peter.ujfalusi@linux.intel.com>
Reviewed-by: Ranjani Sridharan <ranjani.sridharan@linux.intel.com>
Reviewed-by: Pierre-Louis Bossart <pierre-louis.bossart@linux.intel.com>
Link: https://lore.kernel.org/r/20211006110645.26679-10-peter.ujfalusi@linux.intel.com
Signed-off-by: Mark Brown <broonie@kernel.org>
The new SOF_DBG_DUMP_OPTIONAL flag can be used to mark a DSP dump that
should only be printed when the SOF_DBG_PRINT_ALL_DUMPS sof_core_debug
flag is set, otherwise it should be ignored and not printed.
Signed-off-by: Peter Ujfalusi <peter.ujfalusi@linux.intel.com>
Reviewed-by: Ranjani Sridharan <ranjani.sridharan@linux.intel.com>
Reviewed-by: Pierre-Louis Bossart <pierre-louis.bossart@linux.intel.com>
Link: https://lore.kernel.org/r/20211006110645.26679-9-peter.ujfalusi@linux.intel.com
Signed-off-by: Mark Brown <broonie@kernel.org>
To be usable in platform code, move the IPC and DSP dump function to
debug.c and export it in a similar way as the snd_sof_handle_fw_exception()
Make the snd_sof_ipc_dump() static as it is only used in debug.c
Signed-off-by: Peter Ujfalusi <peter.ujfalusi@linux.intel.com>
Reviewed-by: Ranjani Sridharan <ranjani.sridharan@linux.intel.com>
Reviewed-by: Pierre-Louis Bossart <pierre-louis.bossart@linux.intel.com>
Link: https://lore.kernel.org/r/20211006110645.26679-8-peter.ujfalusi@linux.intel.com
Signed-off-by: Mark Brown <broonie@kernel.org>
The core already prints a dump if the DSP failed to start in
snd_sof_run_firmware(), there is no need to print it locally as well.
Signed-off-by: Peter Ujfalusi <peter.ujfalusi@linux.intel.com>
Reviewed-by: Ranjani Sridharan <ranjani.sridharan@linux.intel.com>
Reviewed-by: Pierre-Louis Bossart <pierre-louis.bossart@linux.intel.com>
Link: https://lore.kernel.org/r/20211006110645.26679-7-peter.ujfalusi@linux.intel.com
Signed-off-by: Mark Brown <broonie@kernel.org>
It can be useful to print the DSP dump from the core in case the DSP boot
failed.
Signed-off-by: Peter Ujfalusi <peter.ujfalusi@linux.intel.com>
Reviewed-by: Ranjani Sridharan <ranjani.sridharan@linux.intel.com>
Reviewed-by: Pierre-Louis Bossart <pierre-louis.bossart@linux.intel.com>
Link: https://lore.kernel.org/r/20211006110645.26679-6-peter.ujfalusi@linux.intel.com
Signed-off-by: Mark Brown <broonie@kernel.org>
Do not print the dump more than once to keep the kernel log cleaner in case
of a firmware failure.
When the DSP is rebooted due to suspend or runtime_suspend reset the flags
to re-enable the dump prints.
Add also a debug flag to print all dumps to get more coverage if needed.
Signed-off-by: Peter Ujfalusi <peter.ujfalusi@linux.intel.com>
Reviewed-by: Ranjani Sridharan <ranjani.sridharan@linux.intel.com>
Reviewed-by: Pierre-Louis Bossart <pierre-louis.bossart@linux.intel.com>
Link: https://lore.kernel.org/r/20211006110645.26679-5-peter.ujfalusi@linux.intel.com
Signed-off-by: Mark Brown <broonie@kernel.org>
Add markers to identify the start and end of the IPC and DSP dumps in the
kernel log.
Signed-off-by: Peter Ujfalusi <peter.ujfalusi@linux.intel.com>
Reviewed-by: Ranjani Sridharan <ranjani.sridharan@linux.intel.com>
Reviewed-by: Pierre-Louis Bossart <pierre-louis.bossart@linux.intel.com>
Link: https://lore.kernel.org/r/20211006110645.26679-4-peter.ujfalusi@linux.intel.com
Signed-off-by: Mark Brown <broonie@kernel.org>
snd_sof_dsp_panic() only prints dsp_dump followed by flushing the DMA trace
buffer.
To retain similar 'sequence' first do an ipc_dump then the dsp_dump and
finally flush the trace buffer in case of fw_exception.
Signed-off-by: Peter Ujfalusi <peter.ujfalusi@linux.intel.com>
Reviewed-by: Ranjani Sridharan <ranjani.sridharan@linux.intel.com>
Reviewed-by: Pierre-Louis Bossart <pierre-louis.bossart@linux.intel.com>
Link: https://lore.kernel.org/r/20211006110645.26679-3-peter.ujfalusi@linux.intel.com
Signed-off-by: Mark Brown <broonie@kernel.org>
The topology file currently provides information on which
pipeline/processing is to be scheduled on which DSP core.
To help diagnose potential issues, this patch provides an override of
the 'core' tokens to use the primary core (typically core0). Of course
this may result in a Core0 activity that exceeds hardware
capabilities, so this should only be used when the total processing
fits on DSP - possibly using firmware mockup processing and stubs.
No new dmesg log was added to avoid adding noise during topology
parsing, but the existing logs will show the primary core being used.
This is strictly for validation/debug, products should NEVER use this
override, the topology is assumed to be the description of the
firmware graph.
Signed-off-by: Pierre-Louis Bossart <pierre-louis.bossart@linux.intel.com>
Reviewed-by: Bard Liao <bard.liao@intel.com>
Reviewed-by: Kai Vehmanen <kai.vehmanen@linux.intel.com>
Signed-off-by: Peter Ujfalusi <peter.ujfalusi@linux.intel.com>
Link: https://lore.kernel.org/r/20211006110645.26679-2-peter.ujfalusi@linux.intel.com
Signed-off-by: Mark Brown <broonie@kernel.org>
The put callback of a kcontrol is supposed to return 1 when the value
is changed, and this will be notified to user-space. However, some
DAPM kcontrols always return 0 (except for errors), hence the
user-space misses the update of a control value.
This patch corrects the behavior by properly returning 1 when the
value gets updated.
Reported-and-tested-by: Hans de Goede <hdegoede@redhat.com>
Cc: <stable@vger.kernel.org>
Signed-off-by: Takashi Iwai <tiwai@suse.de>
Link: https://lore.kernel.org/r/20211006141712.2439-1-tiwai@suse.de
Signed-off-by: Mark Brown <broonie@kernel.org>
dev_err_probe() avoids printing into log when the deferred probe is invoked.
This is possible when clock provider is pending to appear.
Signed-off-by: Andy Shevchenko <andriy.shevchenko@linux.intel.com>
Link: https://lore.kernel.org/r/20211006150428.16434-4-andriy.shevchenko@linux.intel.com
Signed-off-by: Mark Brown <broonie@kernel.org>
First of all, replace indexed API by plain one since we have index 0.
Second, switch to optional variant and drop duplicated code.
Signed-off-by: Andy Shevchenko <andriy.shevchenko@linux.intel.com>
Link: https://lore.kernel.org/r/20211006150428.16434-3-andriy.shevchenko@linux.intel.com
Signed-off-by: Mark Brown <broonie@kernel.org>
Access to platform data via dev_get_platdata() getter to make code cleaner.
Signed-off-by: Andy Shevchenko <andriy.shevchenko@linux.intel.com>
Acked-by: Pierre-Louis Bossart <pierre-louis.bossart@linux.intel.com>
Acked-by: Pierre-Louis Bossart <pierre-louis.bossart@linux.com>
Link: https://lore.kernel.org/r/20211006150428.16434-1-andriy.shevchenko@linux.intel.com
Signed-off-by: Mark Brown <broonie@kernel.org>
This patch is to fix audio 3.5mm jack detection failure
on wcd938x codec based target.
Fixes: bcee7ed09b (ASoC: codecs: wcd938x: add Multi Button Headset Control support)
Signed-off-by: Venkata Prasad Potturu <potturu@codeaurora.org>
Signed-off-by: Srinivasa Rao Mandadapu <srivasam@codeaurora.org>
Reviewed-by: Srinivas Kandagatla <srinivas.kandagatla@linaro.org>
Link: https://lore.kernel.org/r/1633614619-27026-1-git-send-email-srivasam@codeaurora.org
Signed-off-by: Mark Brown <broonie@kernel.org>
One quirk for a Dell TigerLake/SoundWire device, and initial support
for platforms based on the ES8336 codec (aka ES8316). For full
functionality, an update of the codec driver will be needed.
Pierre-Louis Bossart (5):
ASoC: Intel: soc-acpi: apl/glk/tgl: add entry for devices based on
ES8336 codec
ALSA: intel-dsp-config: add quirk for APL/GLK/TGL devices based on
ES8336 codec
ASoC: Intel: add machine driver for SOF+ES8336
ASoC: Intel: soc-acpi: add missing quirk for TGL SDCA single amp
ASoC: Intel: sof_sdw: add missing quirk for Dell SKU 0A45
sound/hda/intel-dsp-config.c | 22 +-
sound/soc/intel/boards/Kconfig | 14 +
sound/soc/intel/boards/Makefile | 2 +
sound/soc/intel/boards/sof_es8336.c | 569 ++++++++++++++++++
sound/soc/intel/boards/sof_sdw.c | 10 +
.../intel/common/soc-acpi-intel-bxt-match.c | 6 +
.../intel/common/soc-acpi-intel-glk-match.c | 7 +-
.../intel/common/soc-acpi-intel-tgl-match.c | 47 ++
8 files changed, 674 insertions(+), 3 deletions(-)
create mode 100644 sound/soc/intel/boards/sof_es8336.c
--
2.25.1
With the chip shortage, some GeminiLake Intel-based designs were
respun and now rely on codecs that need the SSP bit clock turned on in
the hw_params stage, not the trigger stage. This patchset mirrors the
flags added in the SOF DAI_CONFIG IPC, and sets the flags when this
capability is indicated as necessary in the topology files where the
SSP configuration is stored.
We initially considered a more generic solution with an on-demand SSP
clock activation using the common clock framework. This would be a
more elegant solution indeed, but it would have required more
intrusive changes that would conflict with the SOF multi-client
support (in-development), and more backport hassles on product
branches. The on-demand activation of clocks is still a desired
feature that will be enabled at a later point.
Bard Liao (1):
ASoC: SOF: dai-intel: add SOF_DAI_INTEL_SSP_CLKCTRL_MCLK/BCLK_ES bits
Pierre-Louis Bossart (4):
ASoC: SOF: dai: mirror group_id definition added in firmware
ASoC: SOF: dai: include new flags for DAI_CONFIG
ASoC: SOF: Intel: hda: add new flags for DAI_CONFIG
ASoC: SOF: Intel: hda-dai: improve SSP DAI handling for dynamic
pipelines
include/sound/sof/dai-intel.h | 4 ++
include/sound/sof/dai.h | 10 ++++-
sound/soc/sof/intel/hda-dai.c | 82 ++++++++++++++++++++++++++++++++++-
sound/soc/sof/intel/hda.c | 6 +++
sound/soc/sof/sof-audio.c | 4 ++
5 files changed, 103 insertions(+), 3 deletions(-)
--
2.25.1
This allows specifying an alternate path for SOF firmware or
SOF topology.
This is particularly useful for i.MX when running Linux vs Android.
Signed-off-by: Daniel Baluta <daniel.baluta@nxp.com>
Reviewed-by: Pierre-Louis Bossart <pierre-louis.bossart@linux.intel.com>
Reviewed-by: Ranjani Sridharan <ranjani.sridharan@linux.intel.com>
Link: https://lore.kernel.org/r/20211005071949.1277613-1-daniel.baluta@oss.nxp.com
Signed-off-by: Mark Brown <broonie@kernel.org>
The struct cz_aif1_ops is only assigned to the ops field in the
snd_soc_dai_link struct which is a pointer to const struct snd_soc_ops.
Make it const to allow the compiler to put it in read-only memory.
Signed-off-by: Rikard Falkeborn <rikard.falkeborn@gmail.com>
Link: https://lore.kernel.org/r/20211004224514.8783-1-rikard.falkeborn@gmail.com
Signed-off-by: Mark Brown <broonie@kernel.org>
For debug and community support, it's useful to expose a kernel
parameter to prevent the use of dynamic pipelines exposed in a
topology file, or conversely to force an existing topology to use
dynamic pipelines.
Add an override bit and an enable bit which is valid only when the
override is set.
For products, the intent is that the topology file defines the
behavior, these two bits are only intended for diagnosis and
performance checks.
Signed-off-by: Pierre-Louis Bossart <pierre-louis.bossart@linux.intel.com>
Reviewed-by: Bard Liao <bard.liao@intel.com>
Reviewed-by: Kai Vehmanen <kai.vehmanen@linux.intel.com>
Reviewed-by: Ranjani Sridharan <ranjani.sridharan@linux.intel.com>
Link: https://lore.kernel.org/r/20211004212729.199550-3-pierre-louis.bossart@linux.intel.com
Signed-off-by: Mark Brown <broonie@kernel.org>
We log most of the SSP configurations except the clks_control. This
will be used to enable bclk/mclk early start so it's useful to show
the information to the user.
Signed-off-by: Pierre-Louis Bossart <pierre-louis.bossart@linux.intel.com>
Reviewed-by: Ranjani Sridharan <ranjani.sridharan@linux.intel.com>
Reviewed-by: Bard Liao <bard.liao@intel.com>
Reviewed-by: Kai Vehmanen <kai.vehmanen@linux.intel.com>
Link: https://lore.kernel.org/r/20211004212729.199550-2-pierre-louis.bossart@linux.intel.com
Signed-off-by: Mark Brown <broonie@kernel.org>
In order to keep the widget use_count balanced, make sure the DAI
widgets are allocated once in hw_params and released in hw_free. A
'setup' status flag is used to deal with cases where the .hw_params
callback is invoked multiple times, and likewise with cases where
hw_free is invoked without hw_params being called first (which can
happen if the FE hw_params fails).
In addition, this patch frees the widgets in the suspend transition,
and reallocates them in the .prepare callback. The 'setup' flag helps
in this case differentiate between resume (setup needed) and
xruns (setup not needed).
This balanced operation was not needed previously but will be required
when SOF dynamic pipelines are enabled.
Co-developed-by: Ranjani Sridharan <ranjani.sridharan@linux.intel.com>
Signed-off-by: Ranjani Sridharan <ranjani.sridharan@linux.intel.com>
Signed-off-by: Pierre-Louis Bossart <pierre-louis.bossart@linux.intel.com>
Reviewed-by: Ranjani Sridharan <ranjani.sridharan@linux.intel.com>
Reviewed-by: Bard Liao <bard.liao@intel.com>
Reviewed-by: Guennadi Liakhovetski <guennadi.liakhovetski@linux.intel.com>
Reviewed-by: Péter Ujfalusi <peter.ujfalusi@linux.intel.com>
Link: https://lore.kernel.org/r/20211004171430.103674-6-pierre-louis.bossart@linux.intel.com
Signed-off-by: Mark Brown <broonie@kernel.org>
The DAI_CONFIG is used for both hw_params and hw_free. Use flags to
specify what stage the configuration applies to.
the DAI_CONFIG IPC may be sent also during the widget setup so each
flag is cleared after the IPC to restore the state.
Signed-off-by: Pierre-Louis Bossart <pierre-louis.bossart@linux.intel.com>
Reviewed-by: Bard Liao <bard.liao@intel.com>
Reviewed-by: Guennadi Liakhovetski <guennadi.liakhovetski@linux.intel.com>
Reviewed-by: Brent Lu <brent.lu@intel.com>
Link: https://lore.kernel.org/r/20211004171430.103674-4-pierre-louis.bossart@linux.intel.com
Signed-off-by: Mark Brown <broonie@kernel.org>
Add machine driver to support APL/GLK/TGL platforms.
The TGL platform supports DMIC, APL and GLK do not.
Co-developed-by: Huajun Li <huajun.li@intel.com>
Signed-off-by: Huajun Li <huajun.li@intel.com>
Signed-off-by: Pierre-Louis Bossart <pierre-louis.bossart@linux.intel.com>
Reviewed-by: Kai Vehmanen <kai.vehmanen@linux.intel.com>
Link: https://lore.kernel.org/r/20211004213512.220836-4-pierre-louis.bossart@linux.intel.com
Signed-off-by: Mark Brown <broonie@kernel.org>
A number of devices, such as the "Chuwi HI10x" and "UNIQCELL Q15.6",
are based on APL/GLK with an I2C/I2S ES8336 codec.
Add table to find topology and firmware files.
Co-developed-by: Huajun Li <huajun.li@intel.com>
Signed-off-by: Huajun Li <huajun.li@intel.com>
Signed-off-by: Pierre-Louis Bossart <pierre-louis.bossart@linux.intel.com>
Reviewed-by: Kai Vehmanen <kai.vehmanen@linux.intel.com>
Link: https://lore.kernel.org/r/20211004213512.220836-2-pierre-louis.bossart@linux.intel.com
Signed-off-by: Mark Brown <broonie@kernel.org>
Set the card.components string using the new nau8824_components() helper
which returns a components string based on the DMI quirks inside the
nau8824 codec driver.
Signed-off-by: Hans de Goede <hdegoede@redhat.com>
Link: https://lore.kernel.org/r/20211002211459.110124-4-hdegoede@redhat.com
Signed-off-by: Mark Brown <broonie@kernel.org>
Some devices using the NAU8824 have only one speaker. To still have things
working properly this requires the left + right channels to both be mixed
to the left speaker output.
This mixer setup is done by userspace based on UCM profiles. But this
requires userspace to know that there is a mono-speaker. Add a helper
function (for the machine driver) to get a components string providing
this info.
This is done inside the codec driver because the codec driver already
has a DMI quirk table.
Signed-off-by: Hans de Goede <hdegoede@redhat.com>
Link: https://lore.kernel.org/r/20211002211459.110124-3-hdegoede@redhat.com
Signed-off-by: Mark Brown <broonie@kernel.org>
Add a quirk mechanism to allow specifying that active-high jack-detection
should be used on platforms where this info is not available in devicetree.
And add an entry for the Cyberbook T116 tablet to the DMI table, so that
jack-detection will work properly on this tablet.
Signed-off-by: Hans de Goede <hdegoede@redhat.com>
Link: https://lore.kernel.org/r/20211002211459.110124-2-hdegoede@redhat.com
Signed-off-by: Mark Brown <broonie@kernel.org>
The NAU8824_JACK_LOGIC define was wrong, for active high jack-detect
to work bit 1 needs to be set, rather then bit 0.
The correct bit was found in the Android kernel source dump for
a Cyberbook T116 tablet; and this was also tested on that same tablet.
Signed-off-by: Hans de Goede <hdegoede@redhat.com>
Reviewed-by: Pierre-Louis Bossart <pierre-louis.bossart@linux.intel.com>
Link: https://lore.kernel.org/r/20211002211459.110124-1-hdegoede@redhat.com
Signed-off-by: Mark Brown <broonie@kernel.org>
Use the new IRQF_NO_AUTOEN flag when requesting the IRQ, rather then
disabling it immediately after requesting it.
This fixes a possible race where the IRQ might trigger between requesting
and disabling it; and this also leads to a small code cleanup.
Signed-off-by: Hans de Goede <hdegoede@redhat.com>
Link: https://lore.kernel.org/r/20211003132255.31743-2-hdegoede@redhat.com
Signed-off-by: Mark Brown <broonie@kernel.org>
Use the new IRQF_NO_AUTOEN flag when requesting the IRQ, rather then
disabling it immediately after requesting it.
This fixes a possible race where the IRQ might trigger between requesting
and disabling it; and this also leads to a small code cleanup.
Signed-off-by: Hans de Goede <hdegoede@redhat.com>
Link: https://lore.kernel.org/r/20211003132255.31743-1-hdegoede@redhat.com
Signed-off-by: Mark Brown <broonie@kernel.org>
The driver is for codec NAU88L21 of Nuvoton Technology Corporation.
The NAU88L21 is an ultra-low power high performance audio codec that
supports both analog and digital audio functions.
Signed-off-by: Seven Lee <wtli@nuvoton.com>
Link: https://lore.kernel.org/r/20211001103108.3297848-1-wtli@nuvoton.com
Signed-off-by: Mark Brown <broonie@kernel.org>
Hi,
The previous, v2 of this series was sent by Daniel Baluta:
https://lore.kernel.org/alsa-devel/20210917143659.401102-1-daniel.baluta@oss.nxp.com/
We have agreed that it might be better that someone from Intel is going to take it
from here as we already have the infrastructure up to test and verify the
dynamic pipelines support.
Changes since v2 (sent by Daniel Baluta):
- patch 10: Fix NULL point dereference in hda_dai_update_config()
- I have kept Daniel's SoB for the series.
Changes since v1:
- Signed-off-by tag added by Daniel
This series implements initial support for dynamic pipelines to setup/teardown
pipeline as needed when a PCM is open/closed.
Initially dynamic pipelines are only supported with single core setup which will
be expanded with a follow-up series.
Review with SOF community at
https://github.com/thesofproject/linux/pull/2794
The feature has been merged on 1st of April to sof-dev, all issues found since
has been fixed and squashed to this upstream series.
Regards,
Peter
---
Ranjani Sridharan (12):
ASoC: topology: change the complete op in snd_soc_tplg_ops to return
int
ASoC: SOF: control: Add access field in struct snd_sof_control
ASoC: SOF: topology: Add new token for dynamic pipeline
ASoC: SOF: sof-audio: add helpers for widgets, kcontrols and dai
config set up
AsoC: dapm: export a couple of functions
ASoC: SOF: Add new fields to snd_sof_route
ASoC: SOF: restore kcontrols for widget during set up
ASoC: SOF: Don't set up widgets during topology parsing
ASoC: SOF: Introduce widget use_count
ASoC: SOF: Intel: hda: make sure DAI widget is set up before IPC
ASoC: SOF: Add support for dynamic pipelines
ASoC: SOF: topology: Add kernel parameter for topology verification
include/sound/soc-dpcm.h | 1 +
include/sound/soc-topology.h | 2 +-
include/uapi/sound/sof/tokens.h | 1 +
sound/soc/intel/skylake/skl-topology.c | 6 +-
sound/soc/soc-dapm.c | 2 +
sound/soc/soc-pcm.c | 4 +-
sound/soc/soc-topology.c | 10 +-
sound/soc/sof/intel/hda-dai.c | 174 +++---
sound/soc/sof/intel/hda.c | 177 ++++--
sound/soc/sof/intel/hda.h | 5 +
sound/soc/sof/ipc.c | 22 +
sound/soc/sof/pcm.c | 58 +-
sound/soc/sof/pm.c | 4 +-
sound/soc/sof/sof-audio.c | 709 +++++++++++++++++++------
sound/soc/sof/sof-audio.h | 32 +-
sound/soc/sof/sof-priv.h | 1 +
sound/soc/sof/topology.c | 362 +++++--------
17 files changed, 1032 insertions(+), 538 deletions(-)
--
2.33.0
Implement SPDIF bypass mode. It implies internal SoC
routing of SPDIF input signal to SPDIF output signal. The
test bed requires two boards: B1 configured in bypass mode,
and B2 to feed B1 SPDIF RX port and read B1 SPDIF TX port:
B2 TX -> B1 RX,
B2 RX <- B1 TX.
The test procedure:
a) Boot both boards
b) B2: start "arecord <spdifcard> -r 48kHz | aplay <local DAC>"
c) B2: start "aplay <spdifcard> -r 48kHz <2ch 48kHz audio file>"
d) B1: enable bypass mode:
amixer -cimxspdif cset numid=8,iface=PCM,name='Bypass Mode' on
e) B2: check DAC audio, make sure the same sample rate is used at
steps b) and c), in example above the rate is 48kHz.
f) B1: try to run "aplay" or "arecord" on imxspdif card while in
bypass mode - both must fail until bypass mode is disabled
g) B1: disable bypass mode:
amixer -cimxspdif cset numid=8,iface=PCM,name='Bypass Mode' off
h) B1: check the usual playback and capture on imxspdif card.
During this test try to set bypass mode - must not be allowed
while playback or capture is running.
Signed-off-by: Viorel Suman <viorel.suman@nxp.com>
Signed-off-by: Shengjiu Wang <shengjiu.wang@nxp.com>
Link: https://lore.kernel.org/r/1632649760-1651-1-git-send-email-shengjiu.wang@nxp.com
Signed-off-by: Mark Brown <broonie@kernel.org>
Add a kernel debug flag to enable a one-shot topology
verification for all pipelines including the dynamic
ones. If the debug flag is set, all the topology
component loading will be verified during the complete
callback.
Signed-off-by: Ranjani Sridharan <ranjani.sridharan@linux.intel.com>
Reviewed-by: Guennadi Liakhovetski <guennadi.liakhovetski@linux.intel.com>
Reviewed-by: Pierre-Louis Bossart <pierre-louis.bossart@linux.intel.com>
Reviewed-by: Kai Vehmanen <kai.vehmanen@linux.intel.com>
Signed-off-by: Daniel Baluta <daniel.baluta@nxp.com>
Signed-off-by: Peter Ujfalusi <peter.ujfalusi@linux.intel.com>
Link: https://lore.kernel.org/r/20210927120517.20505-13-peter.ujfalusi@linux.intel.com
Signed-off-by: Mark Brown <broonie@kernel.org>
Add support for dynamic pipelines by modifying the PCM
hw_params ioctl implementation to determine the widgets
required for a PCM stream by querying the list of
connected DAPM widgets. This list is saved as part of
snd_sof_pcm_stream struct and will be used to setup the widgets.
The sof_widget_list_setup/free routines setup and free connected
DAPM widgets when a PCM is opened/closed. These routines accept
a list of connected DAPM widgets as input and determine the SOF
widgets, their corresponding pipeline widgets and connections
between them that need to be setup before the PCM is triggered.
Please note that the dynamic pipeline feature will only be enabled
for those pipelines whose dynamic_pipeline_widget flag is set in
topologies. Add a new token called SOF_TKN_SCHED_DYNAMIC_PIPELINE
that when set in topology will be applied to the
dynamic_pipeline_widget flag of the pipeline widget.
Signed-off-by: Ranjani Sridharan <ranjani.sridharan@linux.intel.com>
Reviewed-by: Guennadi Liakhovetski <guennadi.liakhovetski@linux.intel.com>
Reviewed-by: Pierre-Louis Bossart <pierre-louis.bossart@linux.intel.com>
Reviewed-by: Kai Vehmanen <kai.vehmanen@linux.intel.com>
Signed-off-by: Daniel Baluta <daniel.baluta@nxp.com>
Signed-off-by: Peter Ujfalusi <peter.ujfalusi@linux.intel.com>
Link: https://lore.kernel.org/r/20210927120517.20505-12-peter.ujfalusi@linux.intel.com
Signed-off-by: Mark Brown <broonie@kernel.org>
With the implementation of the dynamic pipeline feature, widgets
will only be setup when a PCM is opened during the
hw_params ioctl. The BE hw_params callback is responsible for
sending the DAI_CONFIG for the DAI widgets in the DSP.
With dynamic pipelines, the DAI widgets will need to set up
first before sending the DAI_CONFIG IPC in the BE hw_params.
Update the BE hw_params/hw_free callbacks for all ALH, HDA and SSP
DAIs to set up/free the DAI widget before/after DAI_CONFIG IPC.
Signed-off-by: Ranjani Sridharan <ranjani.sridharan@linux.intel.com>
Reviewed-by: Guennadi Liakhovetski <guennadi.liakhovetski@linux.intel.com>
Reviewed-by: Pierre-Louis Bossart <pierre-louis.bossart@linux.intel.com>
Reviewed-by: Kai Vehmanen <kai.vehmanen@linux.intel.com>
Signed-off-by: Daniel Baluta <daniel.baluta@nxp.com>
Signed-off-by: Peter Ujfalusi <peter.ujfalusi@linux.intel.com>
Link: https://lore.kernel.org/r/20210927120517.20505-11-peter.ujfalusi@linux.intel.com
Signed-off-by: Mark Brown <broonie@kernel.org>
Add a new field, use_count to struct snd_sof_widget to keep track
of the usage count for each widget. Since widgets can belong to
multiple pipelines, this field will ensure that the widget
is setup only when the first pipeline that needs it is started
and freed when the last pipeline that needs it is stopped. There is
no need to protect the widget use_count access as the core already
handles mutual exclusion at the PCM level.
Add a new helper sof_widget_free() to handle freeing the SOF
widgets and export the sof_widget_setup/free() functions.
Signed-off-by: Ranjani Sridharan <ranjani.sridharan@linux.intel.com>
Reviewed-by: Guennadi Liakhovetski <guennadi.liakhovetski@linux.intel.com>
Reviewed-by: Pierre-Louis Bossart <pierre-louis.bossart@linux.intel.com>
Reviewed-by: Kai Vehmanen <kai.vehmanen@linux.intel.com>
Signed-off-by: Daniel Baluta <daniel.baluta@nxp.com>
Signed-off-by: Peter Ujfalusi <peter.ujfalusi@linux.intel.com>
Link: https://lore.kernel.org/r/20210927120517.20505-10-peter.ujfalusi@linux.intel.com
Signed-off-by: Mark Brown <broonie@kernel.org>
In preparation for supporting dynamic pipelines, move the
widget setup, DAI config IPCs to the complete callback
during topology loading. For current topology where all
the pipelines are static, all the pipelines will be set up
during complete. For topologies with dynamic and static pipelines,
this will enable setting up only the static ones during
topology loading. Reuse the sof_restore_pipelines() function for
this purpose and rename it to sof_set_up_pipelines().
Signed-off-by: Ranjani Sridharan <ranjani.sridharan@linux.intel.com>
Reviewed-by: Guennadi Liakhovetski <guennadi.liakhovetski@linux.intel.com>
Reviewed-by: Pierre-Louis Bossart <pierre-louis.bossart@linux.intel.com>
Reviewed-by: Kai Vehmanen <kai.vehmanen@linux.intel.com>
Signed-off-by: Daniel Baluta <daniel.baluta@nxp.com>
Signed-off-by: Peter Ujfalusi <peter.ujfalusi@linux.intel.com>
Link: https://lore.kernel.org/r/20210927120517.20505-9-peter.ujfalusi@linux.intel.com
Signed-off-by: Mark Brown <broonie@kernel.org>
Restore kcontrols for each widget after it has been set up
successfully.
Signed-off-by: Ranjani Sridharan <ranjani.sridharan@linux.intel.com>
Signed-off-by: Kai Vehmanen <kai.vehmanen@linux.intel.com>
Reviewed-by: Guennadi Liakhovetski <guennadi.liakhovetski@linux.intel.com>
Reviewed-by: Pierre-Louis Bossart <pierre-louis.bossart@linux.intel.com>
Reviewed-by: Seppo Ingalsuo <seppo.ingalsuo@intel.com>
Signed-off-by: Daniel Baluta <daniel.baluta@nxp.com>
Signed-off-by: Peter Ujfalusi <peter.ujfalusi@linux.intel.com>
Link: https://lore.kernel.org/r/20210927120517.20505-8-peter.ujfalusi@linux.intel.com
Signed-off-by: Mark Brown <broonie@kernel.org>
Add two new fields to save the source widget and sink widget
pointers in struct snd_sof_route to make it easier to look up
routes by source/sink widget. Also, add a flag to indicate
if the route has been set up in the DSP. These will be used
when the dynamic pipeline feature is implemented and routes
will have to be set up at run time.
Also, add a new sof_tear_down_pipelines() callback, that will
used to reset the set up status for all routes during suspend.
Signed-off-by: Ranjani Sridharan <ranjani.sridharan@linux.intel.com>
Reviewed-by: Guennadi Liakhovetski <guennadi.liakhovetski@linux.intel.com>
Reviewed-by: Pierre-Louis Bossart <pierre-louis.bossart@linux.intel.com>
Reviewed-by: Kai Vehmanen <kai.vehmanen@linux.intel.com>
Signed-off-by: Daniel Baluta <daniel.baluta@nxp.com>
Signed-off-by: Peter Ujfalusi <peter.ujfalusi@linux.intel.com>
Link: https://lore.kernel.org/r/20210927120517.20505-7-peter.ujfalusi@linux.intel.com
Signed-off-by: Mark Brown <broonie@kernel.org>
Export a couple of DAPM functions that can be used by
ASoC drivers to determine connected widgets when a PCM
is started.
Signed-off-by: Ranjani Sridharan <ranjani.sridharan@linux.intel.com>
Reviewed-by: Guennadi Liakhovetski <guennadi.liakhovetski@linux.intel.com>
Reviewed-by: Pierre-Louis Bossart <pierre-louis.bossart@linux.intel.com>
Reviewed-by: Kai Vehmanen <kai.vehmanen@linux.intel.com>
Signed-off-by: Daniel Baluta <daniel.baluta@nxp.com>
Signed-off-by: Peter Ujfalusi <peter.ujfalusi@linux.intel.com>
Link: https://lore.kernel.org/r/20210927120517.20505-6-peter.ujfalusi@linux.intel.com
Signed-off-by: Mark Brown <broonie@kernel.org>
Refactor the existing code to use helper functions to
set up/free widgets, send dai config and set up kcontrols for
widgets. These will be reused later on for setting up widgets in
the connected DAPM widgets list for a particular PCM when the
dynamic pipeline feature is implemented.
Signed-off-by: Ranjani Sridharan <ranjani.sridharan@linux.intel.com>
Reviewed-by: Guennadi Liakhovetski <guennadi.liakhovetski@linux.intel.com>
Reviewed-by: Pierre-Louis Bossart <pierre-louis.bossart@linux.intel.com>
Reviewed-by: Kai Vehmanen <kai.vehmanen@linux.intel.com>
Signed-off-by: Daniel Baluta <daniel.baluta@nxp.com>
Signed-off-by: Peter Ujfalusi <peter.ujfalusi@linux.intel.com>
Link: https://lore.kernel.org/r/20210927120517.20505-5-peter.ujfalusi@linux.intel.com
Signed-off-by: Mark Brown <broonie@kernel.org>
Today, we set up all widgets required for all PCM streams
at the time of topology parsing even if they are not
used. An optimization would be to only set up the widgets
required for currently active PCM streams. This would give
the FW the opportunity to power gate unused memory blocks,
thereby saving power.
For dynamic pipelines, the widgets in the connected DAPM path
for each PCM will need to be set up at runtime. This patch
introduces a new token, DYNAMIC_PIPELINE, for scheduler type
widgets that indicate whether a pipeline should be set up
statically during topology load or at runtime when the PCM is
opened. Introduce a new field called dynamic_pipeline_widget
in struct snd_sof_widget to save the value of the parsed token.
The token is set only for the pipeline (scheduler type)
widget and must be propagated to all widgets in the same
pipeline during topology load. Introduce another field called
pipe_widget in struct snd_sof_widget that saves the pointer to
the scheduler widget with the same pipeline ID as that of the
widget. This field is populated when the pipeline completion
callback is invoked during topology loading.
Signed-off-by: Ranjani Sridharan <ranjani.sridharan@linux.intel.com>
Reviewed-by: Guennadi Liakhovetski <guennadi.liakhovetski@linux.intel.com>
Reviewed-by: Pierre-Louis Bossart <pierre-louis.bossart@linux.intel.com>
Reviewed-by: Kai Vehmanen <kai.vehmanen@linux.intel.com>
Signed-off-by: Daniel Baluta <daniel.baluta@nxp.com>
Signed-off-by: Peter Ujfalusi <peter.ujfalusi@linux.intel.com>
Link: https://lore.kernel.org/r/20210927120517.20505-4-peter.ujfalusi@linux.intel.com
Signed-off-by: Mark Brown <broonie@kernel.org>
Add a new field to save the access setting for all controls
in struct snd_sof_control. This will be used to ensure that
only widgets belonging to static pipelines have volatile
controls.
Signed-off-by: Ranjani Sridharan <ranjani.sridharan@linux.intel.com>
Reviewed-by: Guennadi Liakhovetski <guennadi.liakhovetski@linux.intel.com>
Reviewed-by: Pierre-Louis Bossart <pierre-louis.bossart@linux.intel.com>
Reviewed-by: Kai Vehmanen <kai.vehmanen@linux.intel.com>
Signed-off-by: Daniel Baluta <daniel.baluta@nxp.com>
Signed-off-by: Peter Ujfalusi <peter.ujfalusi@linux.intel.com>
Link: https://lore.kernel.org/r/20210927120517.20505-3-peter.ujfalusi@linux.intel.com
Signed-off-by: Mark Brown <broonie@kernel.org>
In the SOF driver, the operations performed in the complete callback
can fail and therefore topology loading should return an error in
such cases. So, change the signature of the complete op
in struct snd_soc_tplg_ops to return an int to return the error.
Also, amend the complete callback functions in the SOF driver and
the SKL driver to conform with the new signature.
Signed-off-by: Ranjani Sridharan <ranjani.sridharan@linux.intel.com>
Reviewed-by: Guennadi Liakhovetski <guennadi.liakhovetski@linux.intel.com>
Reviewed-by: Pierre-Louis Bossart <pierre-louis.bossart@linux.intel.com>
Reviewed-by: Kai Vehmanen <kai.vehmanen@linux.intel.com>
Signed-off-by: Daniel Baluta <daniel.baluta@nxp.com>
Signed-off-by: Peter Ujfalusi <peter.ujfalusi@linux.intel.com>
Link: https://lore.kernel.org/r/20210927120517.20505-2-peter.ujfalusi@linux.intel.com
Signed-off-by: Mark Brown <broonie@kernel.org>
The struct iapq8096_ops is only assigned to the ops field in the
snd_soc_dai_link struct which is a pointer to const struct snd_soc_ops.
Make it const to allow the compiler to put it in read-only memory.
Signed-off-by: Rikard Falkeborn <rikard.falkeborn@gmail.com>
Link: https://lore.kernel.org/r/20211001115030.10402-1-rikard.falkeborn@gmail.com
Signed-off-by: Mark Brown <broonie@kernel.org>
When the system resumes from S3, if the system plays a beep,
there is continuous "Zizi.." noise from HP that could be heard.
It is caused by the SAR mode switch during the combo jack
re-detection which be executed parallelly in a workqueue
after the system resumes.
This patch changes the behavior of SAR mode switch to
avoid this issue.
Signed-off-by: Derek Fang <derek.fang@realtek.com>
Link: https://lore.kernel.org/r/20211001074113.2223-2-derek.fang@realtek.com
Signed-off-by: Mark Brown <broonie@kernel.org>
When codec's ASRC was enabled, the DA and AD filters use
the reference clk which tracks the I2S clks.
And if the I2S clks' timing of open and close are not expected,
this patch allows the filters to switch to use sysclk if
ASRC's ref clks disappeared and could fix the below possible issues:
1. Avoid DA filter to keep surplus samples.
2. Avoid that AD filter works failed during dapm's power on.
For example,
if I2S clks were closed before dacdat during playback off
due to jack unplug, it causes ref clks disappeared and
DA filter remained some samples which will produce pop noise
on the next HP playback.
ASRC auto-disable could clear the samples during the playback off.
Signed-off-by: Derek Fang <derek.fang@realtek.com>
Link: https://lore.kernel.org/r/20211001074113.2223-1-derek.fang@realtek.com
Signed-off-by: Mark Brown <broonie@kernel.org>
platforms->of_node and codes->of_node are assigned in probe function,
and of_node_put is called at the end of probe function, because of_node
seems to be not used after probe functon
In this patch, of_node_put is moved to platform remove function in case
of_node is used at any occasions after probe function in the future.
Signed-off-by: Trevor Wu <trevor.wu@mediatek.com>
Link: https://lore.kernel.org/r/20211001031601.3953-1-trevor.wu@mediatek.com
Signed-off-by: Mark Brown <broonie@kernel.org>
Add a board config adl_mx98360a_rt5682 to support alc5682 headset
codec and max98360a speaker amplifier. Follow Intel BT offload design
by connecting alc5682 to SSP0 and max98360a to SSP1.
Signed-off-by: Malik_Hsu <malik_hsu@wistron.corp-partner.google.com>
Signed-off-by: Brent Lu <brent.lu@intel.com>
Acked-by: Pierre-Louis Bossart <pierre-louis.bossart@linux.intel.com>
Link: https://lore.kernel.org/r/20211001150316.414141-1-brent.lu@intel.com
Signed-off-by: Mark Brown <broonie@kernel.org>
The struct tegra_machine_snd_ops is only assigned to the ops field in the
snd_soc_dai_link struct which is a pointer to const struct snd_soc_ops.
Make it const to allow the compiler to put it in read-only memory.
Signed-off-by: Rikard Falkeborn <rikard.falkeborn@gmail.com>
Link: https://lore.kernel.org/r/20211001114517.6752-1-rikard.falkeborn@gmail.com
Signed-off-by: Mark Brown <broonie@kernel.org>
The DAI clock is only used in I2S mode, to make it clear
and to fix clock resource release issue, we move CCF clock
related code to rt5682_i2c_probe to fix clock
register/unregister issue.
Signed-off-by: Jack Yu <jack.yu@realtek.com>
Link: https://lore.kernel.org/r/20210929054344.12112-1-jack.yu@realtek.com
Signed-off-by: Mark Brown <broonie@kernel.org>
On i.MX8ULP the audio interface and codec are controlled
by Cortex-M domain, Cortex-M core provides audio service
over rpmsg.
The rpmsg audio function is almost same as i.MX7ULP
platform, so share same configuration.
Signed-off-by: Shengjiu Wang <shengjiu.wang@nxp.com>
Link: https://lore.kernel.org/r/1632972413-22130-1-git-send-email-shengjiu.wang@nxp.com
Signed-off-by: Mark Brown <broonie@kernel.org>
Remove a repeated "#include <linux/firmware.h>" in line 32.
Signed-off-by: Guo Zhengkui <guozhengkui@vivo.com>
Acked-by: Simon Trimmer <simont@opensource.cirrus.com>
Link: https://lore.kernel.org/r/20210929123217.5240-1-guozhengkui@vivo.com
Signed-off-by: Mark Brown <broonie@kernel.org>
We have growing number of options under SND_SOC_SOF_TOPLEVEL as SOF
adaptation is growing (Intel, NXP, AMD and Mediatek) and new features are
added.
It will make the menuconfig user experience much cleaner if we move the
SOF options under a separate page.
Signed-off-by: Peter Ujfalusi <peter.ujfalusi@linux.intel.com>
Reviewed-by: Bard Liao <bard.liao@intel.com>
Reviewed-by: Daniel Baluta <daniel.baluta@gmail.com>
Reviewed-by: Ranjani Sridharan <ranjani.sridharan@linux.intel.com>
Link: https://lore.kernel.org/r/20210930070438.16846-1-peter.ujfalusi@linux.intel.com
Signed-off-by: Mark Brown <broonie@kernel.org>
Commit 1d25684e22 ("ASoC: nau8824: Fix open coded prefix handling")
replaced the nau8824_dapm_enable_pin() helper with direct calls to
snd_soc_dapm_enable_pin(), but the helper was using
snd_soc_dapm_force_enable_pin() and not forcing the MICBIAS + SAR
supplies on breaks headphone vs headset and button-press detection.
Replace the snd_soc_dapm_enable_pin() calls with
snd_soc_dapm_force_enable_pin() to fix this.
Cc: stable@vger.kernel.org
Fixes: 1d25684e22 ("ASoC: nau8824: Fix open coded prefix handling")
Signed-off-by: Hans de Goede <hdegoede@redhat.com>
Link: https://lore.kernel.org/r/20210929201512.460360-1-hdegoede@redhat.com
Signed-off-by: Mark Brown <broonie@kernel.org>
The struct mop500_ab8500_ops is only assigned to the ops field in the
snd_soc_dai_link struct which is a pointer to const struct snd_soc_ops.
Make it const to allow the compiler to put it in read-only memory.
Signed-off-by: Rikard Falkeborn <rikard.falkeborn@gmail.com>
Link: https://lore.kernel.org/r/20210929094401.28086-1-rikard.falkeborn@gmail.com
Signed-off-by: Mark Brown <broonie@kernel.org>
These are only assigned to the ops field in the snd_soc_dai_link struct
which is a pointer to const struct snd_soc_ops. Make them const to allow
the compiler to put them in read-only memory.
Signed-off-by: Rikard Falkeborn <rikard.falkeborn@gmail.com>
Link: https://lore.kernel.org/r/20210929093121.21253-1-rikard.falkeborn@gmail.com
Signed-off-by: Mark Brown <broonie@kernel.org>
To follow 20-character length limitation of platform device name, we
have only 7 character space for amplifier. Therefore, the last
character of mx98357a and mx98360a is removed to save space.
Signed-off-by: Brent Lu <brent.lu@intel.com>
Fixes: e224ef76fa ('ASoC: intel: sof_rt5682: support jsl_rt5682s_mx98360a board')
Acked-by: Pierre-Louis Bossart <pierre-louis.bossart@linux.intel.com>
Link: https://lore.kernel.org/r/20210927143249.439129-1-brent.lu@intel.com
Signed-off-by: Mark Brown <broonie@kernel.org>
If we get an error on reply (msg->reply_error) then we should print the
error value out.
At the same time extend the print to include the message size as well and
do the same in case of a timeout.
Signed-off-by: Peter Ujfalusi <peter.ujfalusi@linux.intel.com>
Reviewed-by: Daniel Baluta <daniel.baluta@gmail.com>
Reviewed-by: Paul Olaru <paul.olaru@oss.nxp.com>
Reviewed-by: Pierre-Louis Bossart <pierre-louis.bossart@linux.intel.com>
Link: https://lore.kernel.org/r/20210928073615.29574-1-peter.ujfalusi@linux.intel.com
Signed-off-by: Mark Brown <broonie@kernel.org>
These helped troubleshoot some DMA issue in SOF.
Signed-off-by: Marc Herbert <marc.herbert@intel.com>
Reviewed-by: Pierre-Louis Bossart <pierre-louis.bossart@linux.intel.com>
Reviewed-by: Ranjani Sridharan <ranjani.sridharan@linux.intel.com>
Signed-off-by: Peter Ujfalusi <peter.ujfalusi@linux.intel.com>
Link: https://lore.kernel.org/r/20210928102635.26227-1-peter.ujfalusi@linux.intel.com
Signed-off-by: Mark Brown <broonie@kernel.org>
If an invalid stream is passed to snd_sof_ipc_msg_data() it won't
fill the provided object with data. The caller has to be able to
recognise such cases to avoid handling invalid data. Make the
function return an error when failing.
Signed-off-by: Guennadi Liakhovetski <guennadi.liakhovetski@linux.intel.com>
Reviewed-by: Peter Ujfalusi <peter.ujfalusi@intel.com>
Reviewed-by: Kai Vehmanen <kai.vehmanen@linux.intel.com>
Reviewed-by: Ranjani Sridharan <ranjani.sridharan@linux.intel.com>
Signed-off-by: Peter Ujfalusi <peter.ujfalusi@linux.intel.com>
Link: https://lore.kernel.org/r/20210928103516.8066-1-peter.ujfalusi@linux.intel.com
Signed-off-by: Mark Brown <broonie@kernel.org>
Sparse (make C=2) complains about undeclared variables. Fix by adding
a real prototype instead of 'extern' in sof-of-dev.c
Signed-off-by: Pierre-Louis Bossart <pierre-louis.bossart@linux.intel.com>
Reviewed-by: Daniel Baluta <daniel.baluta@gmail.com>
Reviewed-by: Kai Vehmanen <kai.vehmanen@linux.intel.com>
Reviewed-by: Paul Olaru <paul.olaru@oss.nxp.com>
Signed-off-by: Peter Ujfalusi <peter.ujfalusi@linux.intel.com>
Link: https://lore.kernel.org/r/20210928072807.27838-1-peter.ujfalusi@linux.intel.com
Signed-off-by: Mark Brown <broonie@kernel.org>
There is no restore_stream flag anymmore.
Signed-off-by: Ranjani Sridharan <ranjani.sridharan@linux.intel.com>
Reviewed-by: Paul Olaru <paul.olaru@oss.nxp.com>
Reviewed-by: Kai Vehmanen <kai.vehmanen@linux.intel.com>
Reviewed-by: Bard Liao <bard.liao@intel.com>
Reviewed-by: Pierre-Louis Bossart <pierre-louis.bossart@linux.intel.com>
Signed-off-by: Peter Ujfalusi <peter.ujfalusi@linux.intel.com>
Link: https://lore.kernel.org/r/20210928074030.30553-1-peter.ujfalusi@linux.intel.com
Signed-off-by: Mark Brown <broonie@kernel.org>
In order to provide more information in case of timeout observed while
reading STREAM_SD_OFFSET, print out the stream name or in case there is
no audio stream associated (like dma-trace), print "--"
Signed-off-by: Peter Ujfalusi <peter.ujfalusi@linux.intel.com>
Reviewed-by: Pierre-Louis Bossart <pierre-louis.bossart@linux.intel.com>
Reviewed-by: Ranjani Sridharan <ranjani.sridharan@linux.intel.com>
Link: https://lore.kernel.org/r/20210928081744.4785-1-peter.ujfalusi@linux.intel.com
Signed-off-by: Mark Brown <broonie@kernel.org>
The initial hdac_stream code was adapted a third time with the same
locking issues. Move the spin_lock outside the loops and make sure the
fields are protected on read/write.
Signed-off-by: Pierre-Louis Bossart <pierre-louis.bossart@linux.intel.com>
Acked-by: Mark Brown <broonie@kernel.org>
Link: https://lore.kernel.org/r/20210924192417.169243-5-pierre-louis.bossart@linux.intel.com
Signed-off-by: Takashi Iwai <tiwai@suse.de>
This series of patches gradually separates the ASoC specific wm_adsp
code from that required to manage firmware in Cirrus Logic DSPs.
The series starts with renaming, progresses to splitting the
functionality before finally moving the independent functionality into
drivers/firmware so that it can be used by both the existing ASoC
wm_adsp and new non-audio parts.
Charles Keepax (3):
ASoC: wm_adsp: Move check for control existence
ASoC: wm_adsp: Switch to using wm_coeff_read_ctrl for compressed
buffers
ASoC: wm_adsp: Move sys_config_size to wm_adsp
Simon Trimmer (13):
ASoC: wm_adsp: Remove use of snd_ctl_elem_type_t
ASoC: wm_adsp: Cancel ongoing work when removing controls
ASoC: wm_adsp: Rename generic DSP support
ASoC: wm_adsp: Introduce cs_dsp logging macros
ASoC: wm_adsp: Separate some ASoC and generic functions
ASoC: wm_adsp: Split DSP power operations into helper functions
ASoC: wm_adsp: Separate generic cs_dsp_coeff_ctl handling
ASoC: wm_adsp: Move check of dsp->running to better place
ASoC: wm_adsp: Pass firmware names as parameters when starting DSP
core
ASoC: wm_adsp: move firmware loading to client
ASoC: wm_adsp: Split out struct cs_dsp from struct wm_adsp
ASoC: wm_adsp: Separate wm_adsp specifics in cs_dsp_client_ops
firmware: cs_dsp: add driver to support firmware loading on Cirrus
Logic DSPs
MAINTAINERS | 11 +
drivers/firmware/Kconfig | 1 +
drivers/firmware/Makefile | 1 +
drivers/firmware/cirrus/Kconfig | 5 +
drivers/firmware/cirrus/Makefile | 3 +
drivers/firmware/cirrus/cs_dsp.c | 3109 ++++++++++++++++
include/linux/firmware/cirrus/cs_dsp.h | 242 ++
.../linux/firmware/cirrus}/wmfw.h | 8 +-
sound/soc/codecs/Kconfig | 1 +
sound/soc/codecs/cs47l15.c | 22 +-
sound/soc/codecs/cs47l24.c | 20 +-
sound/soc/codecs/cs47l35.c | 24 +-
sound/soc/codecs/cs47l85.c | 32 +-
sound/soc/codecs/cs47l90.c | 34 +-
sound/soc/codecs/cs47l92.c | 20 +-
sound/soc/codecs/madera.c | 18 +-
sound/soc/codecs/wm2200.c | 30 +-
sound/soc/codecs/wm5102.c | 16 +-
sound/soc/codecs/wm5110.c | 24 +-
sound/soc/codecs/wm_adsp.c | 3188 ++---------------
sound/soc/codecs/wm_adsp.h | 105 +-
21 files changed, 3794 insertions(+), 3120 deletions(-)
create mode 100644 drivers/firmware/cirrus/Kconfig
create mode 100644 drivers/firmware/cirrus/Makefile
create mode 100644 drivers/firmware/cirrus/cs_dsp.c
create mode 100644 include/linux/firmware/cirrus/cs_dsp.h
rename {sound/soc/codecs => include/linux/firmware/cirrus}/wmfw.h (91%)
--
2.33.0
As part of moving to remove the old style defines for the bus clocks update
the ak4458 driver to use more modern terminology for clocking.
Signed-off-by: Mark Brown <broonie@kernel.org>
Link: https://lore.kernel.org/r/20210920163817.16490-1-broonie@kernel.org
Signed-off-by: Mark Brown <broonie@kernel.org>
As part of moving to remove the old style defines for the bus clocks update
the ak5558 driver to use more modern terminology for clocking.
Signed-off-by: Mark Brown <broonie@kernel.org>
Link: https://lore.kernel.org/r/20210920164753.17030-1-broonie@kernel.org
Signed-off-by: Mark Brown <broonie@kernel.org>
Currently, The fixed 512KB prealloc buffer size is too larger for
tiny memory kernel (such as 16MB memory). This patch adds the module
option "prealloc_buffer_size_kbytes" to specify prealloc buffer size.
It's suitable for cards which use the generic dmaengine pcm driver
with no config.
Signed-off-by: Sugar Zhang <sugar.zhang@rock-chips.com>
Link: https://lore.kernel.org/r/1632394246-59341-1-git-send-email-sugar.zhang@rock-chips.com
Signed-off-by: Mark Brown <broonie@kernel.org>
As part of moving to remove the old style defines for the bus clocks update
the dwc-i2s driver to use more modern terminology for clocking.
Signed-off-by: Mark Brown <broonie@kernel.org>
Link: https://lore.kernel.org/r/20210921205313.46710-1-broonie@kernel.org
Signed-off-by: Mark Brown <broonie@kernel.org>
As part of moving to remove the old style defines for the bus clocks update
the ak4671 driver to use more modern terminology for clocking.
Signed-off-by: Mark Brown <broonie@kernel.org>
Link: https://lore.kernel.org/r/20210920164211.16718-1-broonie@kernel.org
Signed-off-by: Mark Brown <broonie@kernel.org>
As part of moving to remove the old style defines for the bus clocks update
the alc5623 driver to use more modern terminology for clocking.
Signed-off-by: Mark Brown <broonie@kernel.org>
Link: https://lore.kernel.org/r/20210920165036.17142-1-broonie@kernel.org
Signed-off-by: Mark Brown <broonie@kernel.org>
As part of the effort to remove our old APIs based on outdated terminology
update the Broadcom drivers to use modern terminology.
Signed-off-by: Mark Brown <broonie@kernel.org>
Link: https://lore.kernel.org/r/20210916143423.24025-1-broonie@kernel.org
Signed-off-by: Mark Brown <broonie@kernel.org>
As part of moving to remove the old style defines for the bus clocks update
the cpcap driver to use more modern terminology for clocking.
Signed-off-by: Mark Brown <broonie@kernel.org>
Link: https://lore.kernel.org/r/20210921213034.31427-1-broonie@kernel.org
Signed-off-by: Mark Brown <broonie@kernel.org>
There is a spelling mistake in a dev_err error message. Fix it.
Signed-off-by: Colin Ian King <colin.king@canonical.com>
Acked-by: Martin Blumenstingl <martin.blumenstingl@googlemail.com>
Link: https://lore.kernel.org/r/20210924231242.144692-1-colin.king@canonical.com
Signed-off-by: Mark Brown <broonie@kernel.org>
As part of moving to remove the old style defines for the bus clocks update
the ad193x driver to use more modern terminology for clocking.
Signed-off-by: Mark Brown <broonie@kernel.org>
Link: https://lore.kernel.org/r/20210916142232.33914-1-broonie@kernel.org
Signed-off-by: Mark Brown <broonie@kernel.org>
The only usage of these is to assign their address to the ops field in
the snd_soc_dai_driver struct, which is a pointer to const. Make them
const to allow the compiler to put them in read-only memory.
Signed-off-by: Rikard Falkeborn <rikard.falkeborn@gmail.com>
Acked-by: Sameer Pujar <spujar@nvidia.com>
Link: https://lore.kernel.org/r/20210922205438.34519-1-rikard.falkeborn@gmail.com
Signed-off-by: Mark Brown <broonie@kernel.org>
Some headsets require very different comparator thresholds for type detection,
as well as longer settling times. In order to detect a larger number of headsets,
use 2 thresholds to give maximum coverage (1.25V and 1.75V), as well as a longer
settling time of 100ms. This will not affect default audotodetect mode
and applies to manual mode type detection only.
Signed-off-by: Stefan Binding <sbinding@opensource.cirrus.com>
Signed-off-by: Vitaly Rodionov <vitalyr@opensource.cirrus.com>
Link: https://lore.kernel.org/r/20210927111437.18113-1-vitalyr@opensource.cirrus.com
Signed-off-by: Mark Brown <broonie@kernel.org>
As part of moving to remove the old style defines for the bus clocks update
the adav80x driver to use more modern terminology for clocking.
Signed-off-by: Mark Brown <broonie@kernel.org>
Link: https://lore.kernel.org/r/20210916151806.20756-6-broonie@kernel.org
Signed-off-by: Mark Brown <broonie@kernel.org>
As part of moving to remove the old style defines for the bus clocks update
the adau1977 driver to use more modern terminology for clocking.
Signed-off-by: Mark Brown <broonie@kernel.org>
Link: https://lore.kernel.org/r/20210916151806.20756-5-broonie@kernel.org
Signed-off-by: Mark Brown <broonie@kernel.org>
As part of moving to remove the old style defines for the bus clocks update
the adau17x1 driver to use more modern terminology for clocking.
Signed-off-by: Mark Brown <broonie@kernel.org>
Link: https://lore.kernel.org/r/20210916151806.20756-4-broonie@kernel.org
Signed-off-by: Mark Brown <broonie@kernel.org>
As part of moving to remove the old style defines for the bus clocks update
the adau1701 driver to use more modern terminology for clocking.
Signed-off-by: Mark Brown <broonie@kernel.org>
Link: https://lore.kernel.org/r/20210916151806.20756-3-broonie@kernel.org
Signed-off-by: Mark Brown <broonie@kernel.org>
As part of moving to remove the old style defines for the bus clocks update
the adau1373 driver to use more modern terminology for clocking.
Signed-off-by: Mark Brown <broonie@kernel.org>
Link: https://lore.kernel.org/r/20210916151806.20756-2-broonie@kernel.org
Signed-off-by: Mark Brown <broonie@kernel.org>
As part of moving to remove the old style defines for the bus clocks update
the adau1372 driver to use more modern terminology for clocking.
Signed-off-by: Mark Brown <broonie@kernel.org>
Link: https://lore.kernel.org/r/20210916151806.20756-1-broonie@kernel.org
Signed-off-by: Mark Brown <broonie@kernel.org>
As part of moving to remove the old style defines for the bus clocks update
the ad1836 driver to use more modern terminology for clocking.
Signed-off-by: Mark Brown <broonie@kernel.org>
Link: https://lore.kernel.org/r/20210916142125.7226-1-broonie@kernel.org
Signed-off-by: Mark Brown <broonie@kernel.org>
As part of the effort to remove our old APIs based on outdated terminology
update the EP93xx drivers to use modern terminology.
Signed-off-by: Mark Brown <broonie@kernel.org>
Link: https://lore.kernel.org/r/20210916143828.36215-1-broonie@kernel.org
Signed-off-by: Mark Brown <broonie@kernel.org>
With gcc, we get a warning in this file:
In file included from include/linux/io.h:13,
from sound/soc/samsung/s3c-i2s-v2.c:16:
sound/soc/samsung/s3c-i2s-v2.c: In function 's3c2412_i2s_trigger':
arch/arm/include/asm/io.h:92:22: error: this statement may fall through [-Werror=implicit-fallthrough=]
#define __raw_writel __raw_writel
^
arch/arm/include/asm/io.h:299:29: note: in expansion of macro '__raw_writel'
#define writel_relaxed(v,c) __raw_writel((__force u32) cpu_to_le32(v),c)
^~~~~~~~~~~~
arch/arm/include/asm/io.h:307:36: note: in expansion of macro 'writel_relaxed'
#define writel(v,c) ({ __iowmb(); writel_relaxed(v,c); })
^~~~~~~~~~~~~~
sound/soc/samsung/s3c-i2s-v2.c:398:3: note: in expansion of macro 'writel'
writel(0x0, i2s->regs + S3C2412_IISFIC);
^~~~~~
sound/soc/samsung/s3c-i2s-v2.c:400:2: note: here
case SNDRV_PCM_TRIGGER_RESUME:
^~~~
From all I can tell, this was indeed meant to fall through, so
add "fallthrough;" statement to avoid the warning.
Signed-off-by: Arnd Bergmann <arnd@arndb.de>
Reviewed-by: Krzysztof Kozlowski <krzysztof.kozlowski@canonical.com>
Link: https://lore.kernel.org/r/20210927095449.1070639-1-arnd@kernel.org
Signed-off-by: Mark Brown <broonie@kernel.org>
As part of moving to remove the old style defines for the bus clocks update
the ak4642 driver to use more modern terminology for clocking.
Signed-off-by: Mark Brown <broonie@kernel.org>
Link: https://lore.kernel.org/r/20210920164042.16624-1-broonie@kernel.org
Signed-off-by: Mark Brown <broonie@kernel.org>
The versioning scheme was changed in an earlier patch, which caused the version
being used to initialize WCD9335 to be interpreted as if it was WCD937X, which
changed code paths causing broken headphones output. Pass WCD9335 instead of
WCD9335_VERSION_2_0 to wcd_clsh_ctrl_alloc to fix it.
Fixes: 19c5d1f6a0 ("ASoC: codecs: wcd-clsh: add new version support")
Signed-off-by: Yassine Oudjana <y.oudjana@protonmail.com>
Reviewed-by: Srinivas Kandagatla <srinivas.kandagatla@linaro.org>
Link: https://lore.kernel.org/r/20210925022339.786296-1-y.oudjana@protonmail.com
Signed-off-by: Mark Brown <broonie@kernel.org>
As part of moving to remove the old style defines for the bus clocks update
the alc5632 driver to use more modern terminology for clocking.
Signed-off-by: Mark Brown <broonie@kernel.org>
Link: https://lore.kernel.org/r/20210920165128.17224-1-broonie@kernel.org
Signed-off-by: Mark Brown <broonie@kernel.org>
As part of moving to remove the old style defines for the bus clocks update
the ak4104 driver to use more modern terminology for clocking.
Signed-off-by: Mark Brown <broonie@kernel.org>
Link: https://lore.kernel.org/r/20210916150922.20183-1-broonie@kernel.org
Signed-off-by: Mark Brown <broonie@kernel.org>
As part of moving to remove the old style defines for the bus clocks update
the ak4118 driver to use more modern terminology for clocking.
Signed-off-by: Mark Brown <broonie@kernel.org>
Link: https://lore.kernel.org/r/20210916150804.20058-1-broonie@kernel.org
Signed-off-by: Mark Brown <broonie@kernel.org>
As part of moving to remove the old style defines for the bus clocks update
the zl38060 driver to use more modern terminology for clocking.
Signed-off-by: Mark Brown <broonie@kernel.org>
Link: https://lore.kernel.org/r/20210921205117.4393-1-broonie@kernel.org
Signed-off-by: Mark Brown <broonie@kernel.org>
wm_adsp originally provided firmware loading on some audio DSP and was
implemented as an ASoC codec driver. However, the firmware loading now
covers a wider range of DSP cores and peripherals containing them,
beyond just audio. So it needs to be available to non-audio drivers. All
the core firmware loading support has been moved into a new driver
cs_dsp, leaving only the ASoC-specific parts in wm_adsp.
Signed-off-by: Simon Trimmer <simont@opensource.cirrus.com>
Signed-off-by: Charles Keepax <ckeepax@opensource.cirrus.com>
Link: https://lore.kernel.org/r/20210913160057.103842-17-simont@opensource.cirrus.com
Signed-off-by: Mark Brown <broonie@kernel.org>
This is preparation for moving the generic DSP support out of ASoC.
The event callbacks let the client add custom handling of events.
Signed-off-by: Simon Trimmer <simont@opensource.cirrus.com>
Signed-off-by: Charles Keepax <ckeepax@opensource.cirrus.com>
Link: https://lore.kernel.org/r/20210913160057.103842-16-simont@opensource.cirrus.com
Signed-off-by: Mark Brown <broonie@kernel.org>
In preparation for moving the generic DSP support out of ASoC split
struct wm_adsp into two parts, one will form the structure for the new
generic DSP code and embed that one into wm_adsp.
Signed-off-by: Simon Trimmer <simont@opensource.cirrus.com>
Signed-off-by: Charles Keepax <ckeepax@opensource.cirrus.com>
Link: https://lore.kernel.org/r/20210913160057.103842-15-simont@opensource.cirrus.com
Signed-off-by: Mark Brown <broonie@kernel.org>
This is preparation for moving the generic DSP support out of ASoC.
Passing the firmware as parameters into the power_up functions
simplifies the generic code that will be moved out of wm_adsp.
Signed-off-by: Simon Trimmer <simont@opensource.cirrus.com>
Link: https://lore.kernel.org/r/20210913160057.103842-14-simont@opensource.cirrus.com
Signed-off-by: Mark Brown <broonie@kernel.org>
As preparation for moving the generic DSP support out of ASoC pass the
firmware names used when loading files as parameters as the generic code
can't refer directly to the array specific to wm_adsp. The code
remaining in wm_adsp.c doesn't need to change, it can continue to use
the string arrays directly.
Signed-off-by: Simon Trimmer <simont@opensource.cirrus.com>
Signed-off-by: Charles Keepax <ckeepax@opensource.cirrus.com>
Link: https://lore.kernel.org/r/20210913160057.103842-13-simont@opensource.cirrus.com
Signed-off-by: Mark Brown <broonie@kernel.org>
In preparation for moving the generic DSP support out of ASoC, move
the check of dsp->running to a more appropriate place that will move
to the generic code.
Signed-off-by: Simon Trimmer <simont@opensource.cirrus.com>
Signed-off-by: Charles Keepax <ckeepax@opensource.cirrus.com>
Link: https://lore.kernel.org/r/20210913160057.103842-12-simont@opensource.cirrus.com
Signed-off-by: Mark Brown <broonie@kernel.org>
This is preparation for moving the generic DSP support out of ASoC. The
majority of the handling of firmware controls is generic and this change
separates the generic and ASoC specific details into separate structures
and functions and renames the generic code named wm_* to cs_*.
Signed-off-by: Simon Trimmer <simont@opensource.cirrus.com>
Signed-off-by: Charles Keepax <ckeepax@opensource.cirrus.com>
Link: https://lore.kernel.org/r/20210913160057.103842-11-simont@opensource.cirrus.com
Signed-off-by: Mark Brown <broonie@kernel.org>
sys_config_size is part of the compressed stream support, move it from
what will become generic DSP code so that it remains in ASoC.
Signed-off-by: Charles Keepax <ckeepax@opensource.cirrus.com>
Signed-off-by: Simon Trimmer <simont@opensource.cirrus.com>
Link: https://lore.kernel.org/r/20210913160057.103842-10-simont@opensource.cirrus.com
Signed-off-by: Mark Brown <broonie@kernel.org>
This is preparation for moving the generic DSP support out of
ASoC. This change separates the generic handling of power and state
transitions from the DAPM API wrapper.
Signed-off-by: Simon Trimmer <simont@opensource.cirrus.com>
Signed-off-by: Charles Keepax <ckeepax@opensource.cirrus.com>
Link: https://lore.kernel.org/r/20210913160057.103842-9-simont@opensource.cirrus.com
Signed-off-by: Mark Brown <broonie@kernel.org>
Split some functions into ASoC and generic portions so that existing
interfaces can be retained whilst allowing the implementation to be
moved out of ASoC.
Signed-off-by: Simon Trimmer <simont@opensource.cirrus.com>
Signed-off-by: Charles Keepax <ckeepax@opensource.cirrus.com>
Link: https://lore.kernel.org/r/20210913160057.103842-8-simont@opensource.cirrus.com
Signed-off-by: Mark Brown <broonie@kernel.org>
In preparation for moving the generic DSP support out of ASoC, add
some new logging macros that will be used from the generic code.
Signed-off-by: Simon Trimmer <simont@opensource.cirrus.com>
Signed-off-by: Charles Keepax <ckeepax@opensource.cirrus.com>
Link: https://lore.kernel.org/r/20210913160057.103842-7-simont@opensource.cirrus.com
Signed-off-by: Mark Brown <broonie@kernel.org>
This rename is preparation for moving the generic DSP support out of
ASoC, generic code named wm_* will be renamed to cs_*.
Signed-off-by: Simon Trimmer <simont@opensource.cirrus.com>
Signed-off-by: Charles Keepax <ckeepax@opensource.cirrus.com>
Link: https://lore.kernel.org/r/20210913160057.103842-6-simont@opensource.cirrus.com
Signed-off-by: Mark Brown <broonie@kernel.org>
When parsing a compressed buffer from the firmware the driver currently
open codes reading the firmware coefficient containing the buffer
description. Improve this slightly by using the coefficient read
functions already provided by the wm_adsp driver. It is worth noting
this change requires the running variable to be set before
wm_adsp_buffer_init is called, however this is safe, since its all still
under the power lock and nothing in the compressed code gates itself on
running.
Signed-off-by: Charles Keepax <ckeepax@opensource.cirrus.com>
Signed-off-by: Simon Trimmer <simont@opensource.cirrus.com>
Link: https://lore.kernel.org/r/20210913160057.103842-4-simont@opensource.cirrus.com
Signed-off-by: Mark Brown <broonie@kernel.org>
Checking earlier in the function if a control already exists avoids
superfluous string construction and also prepares for future
refactoring.
Signed-off-by: Charles Keepax <ckeepax@opensource.cirrus.com>
Signed-off-by: Simon Trimmer <simont@opensource.cirrus.com>
Link: https://lore.kernel.org/r/20210913160057.103842-3-simont@opensource.cirrus.com
Signed-off-by: Mark Brown <broonie@kernel.org>
In preparation for moving the generic DSP support out of ASoC, remove
the use of the ALSA specific types for the control type. The use of an
ALSA type was unnecessary, the simplified code is easier to read and
avoids Sparse warnings.
Signed-off-by: Simon Trimmer <simont@opensource.cirrus.com>
Signed-off-by: Charles Keepax <ckeepax@opensource.cirrus.com>
Link: https://lore.kernel.org/r/20210913160057.103842-2-simont@opensource.cirrus.com
Signed-off-by: Mark Brown <broonie@kernel.org>
Currently autoloading for SPI devices does not use the DT ID table, it uses
SPI modalises. Supporting OF modalises is going to be difficult if not
impractical, an attempt was made but has been reverted, so ensure that
module autoloading works for this driver by adding SPI IDs for parts that
only have a compatible listed.
Fixes: 96c8395e21 ("spi: Revert modalias changes")
Signed-off-by: Mark Brown <broonie@kernel.org>
Cc: patches@opensource.cirrus.com
Reviewed-by: Charles Keepax <ckeepax@opensource.cirrus.com>
Link: https://lore.kernel.org/r/20210924194844.45974-1-broonie@kernel.org
Signed-off-by: Mark Brown <broonie@kernel.org>
Currently autoloading for SPI devices does not use the DT ID table, it uses
SPI modalises. Supporting OF modalises is going to be difficult if not
impractical, an attempt was made but has been reverted, so ensure that
module autoloading works for this driver by adding SPI IDs for parts that
only have a compatible listed.
Fixes: 96c8395e21 ("spi: Revert modalias changes")
Signed-off-by: Mark Brown <broonie@kernel.org>
Link: https://lore.kernel.org/r/20210924194956.46079-1-broonie@kernel.org
Signed-off-by: Mark Brown <broonie@kernel.org>
The documentation says that the return value of tty_ldisc_ops::hangup
hook is ignored. And it really is, so there is no point for its return
type to be int. Switch it to void and all the hooks too.
Cc: Dmitry Torokhov <dmitry.torokhov@gmail.com>
Cc: Wolfgang Grandegger <wg@grandegger.com>
Cc: Marc Kleine-Budde <mkl@pengutronix.de>
Cc: "David S. Miller" <davem@davemloft.net>
Cc: Jakub Kicinski <kuba@kernel.org>
Cc: Paul Mackerras <paulus@samba.org>
Cc: Liam Girdwood <lgirdwood@gmail.com>
Cc: Mark Brown <broonie@kernel.org>
Cc: Jaroslav Kysela <perex@perex.cz>
Cc: Takashi Iwai <tiwai@suse.com>
Cc: Peter Ujfalusi <peter.ujfalusi@gmail.com>
Acked-by: Dmitry Torokhov <dmitry.torokhov@gmail.com>
Acked-by: Mark Brown <broonie@kernel.org>
Acked-by: Marc Kleine-Budde <mkl@pengutronix.de>
Signed-off-by: Jiri Slaby <jslaby@suse.cz>
Link: https://lore.kernel.org/r/20210914091134.17426-4-jslaby@suse.cz
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
As part of moving to remove the old style defines for the bus clocks update
the pl1022_rdk driver to use more modern terminology for clocking.
Signed-off-by: Mark Brown <broonie@kernel.org>
Reviewed-by: Fabio Estevam <festevam@gmail.com>
Link: https://lore.kernel.org/r/20210921213542.31688-16-broonie@kernel.org
Signed-off-by: Mark Brown <broonie@kernel.org>
As part of moving to remove the old style defines for the bus clocks update
the pl1022_ds driver to use more modern terminology for clocking.
Signed-off-by: Mark Brown <broonie@kernel.org>
Reviewed-by: Fabio Estevam <festevam@gmail.com>
Link: https://lore.kernel.org/r/20210921213542.31688-15-broonie@kernel.org
Signed-off-by: Mark Brown <broonie@kernel.org>
As part of moving to remove the old style defines for the bus clocks update
the mpc8610_hpcd driver to use more modern terminology for clocking.
Signed-off-by: Mark Brown <broonie@kernel.org>
Reviewed-by: Fabio Estevam <festevam@gmail.com>
Link: https://lore.kernel.org/r/20210921213542.31688-14-broonie@kernel.org
Signed-off-by: Mark Brown <broonie@kernel.org>
As part of moving to remove the old style defines for the bus clocks update
the imx-sgtl5000 driver to use more modern terminology for clocking.
Signed-off-by: Mark Brown <broonie@kernel.org>
Reviewed-by: Fabio Estevam <festevam@gmail.com>
Link: https://lore.kernel.org/r/20210921213542.31688-13-broonie@kernel.org
Signed-off-by: Mark Brown <broonie@kernel.org>
As part of moving to remove the old style defines for the bus clocks update
the imx-rpmsg driver to use more modern terminology for clocking.
Signed-off-by: Mark Brown <broonie@kernel.org>
Reviewed-by: Fabio Estevam <festevam@gmail.com>
Link: https://lore.kernel.org/r/20210921213542.31688-12-broonie@kernel.org
Signed-off-by: Mark Brown <broonie@kernel.org>
As part of moving to remove the old style defines for the bus clocks update
the imx-hdmi driver to use more modern terminology for clocking.
Signed-off-by: Mark Brown <broonie@kernel.org>
Reviewed-by: Fabio Estevam <festevam@gmail.com>
Link: https://lore.kernel.org/r/20210921213542.31688-11-broonie@kernel.org
Signed-off-by: Mark Brown <broonie@kernel.org>