platform/kernel/linux-starfive.git
2 years agoASoC: Intel: avs: Depend on SND_INTEL_DSP_CONFIG
Amadeusz Sławiński [Mon, 25 Apr 2022 09:16:46 +0000 (11:16 +0200)]
ASoC: Intel: avs: Depend on SND_INTEL_DSP_CONFIG

In order to enable NHLT support one must select SND_INTEL_DSP_CONFIG,
which will select SND_INTEL_NHLT. Otherwise the file containing NHLT
code doesn't get build leading to errors when linking.

Fixes: 274d79e51875 ("ASoC: Intel: avs: Configure modules according to their type")
Reported-by: kernel test robot <lkp@intel.com>
Reviewed-by: Cezary Rojewski <cezary.rojewski@intel.com>
Signed-off-by: Amadeusz Sławiński <amadeuszx.slawinski@linux.intel.com>
Link: https://lore.kernel.org/r/20220425091646.545216-2-amadeuszx.slawinski@linux.intel.com
Signed-off-by: Mark Brown <broonie@kernel.org>
2 years agoASoC: Intel: avs: Enable AVS driver only on x86 platforms
Amadeusz Sławiński [Mon, 25 Apr 2022 09:16:45 +0000 (11:16 +0200)]
ASoC: Intel: avs: Enable AVS driver only on x86 platforms

Only supported platform for AVS are x86 machines, so there is no reason
for it to be enabled on other architectures. Allow exception for compile
tests.

Fixes: 274d79e51875 ("ASoC: Intel: avs: Configure modules according to their type")
Reviewed-by: Cezary Rojewski <cezary.rojewski@intel.com>
Signed-off-by: Amadeusz Sławiński <amadeuszx.slawinski@linux.intel.com>
Link: https://lore.kernel.org/r/20220425091646.545216-1-amadeuszx.slawinski@linux.intel.com
Signed-off-by: Mark Brown <broonie@kernel.org>
2 years agoASoC: img-spdif-out: using pm_runtime_resume_and_get to simplify the code
Minghao Chi [Wed, 20 Apr 2022 03:04:39 +0000 (03:04 +0000)]
ASoC: img-spdif-out: using pm_runtime_resume_and_get to simplify the code

Using pm_runtime_resume_and_get() to replace pm_runtime_get_sync and
pm_runtime_put_noidle. This change is just to simplify the code, no
actual functional changes.

Reported-by: Zeal Robot <zealci@zte.com.cn>
Signed-off-by: Minghao Chi <chi.minghao@zte.com.cn>
Link: https://lore.kernel.org/r/20220420030439.2575817-1-chi.minghao@zte.com.cn
Signed-off-by: Mark Brown <broonie@kernel.org>
2 years agoASoC: img-spdif-in: using pm_runtime_resume_and_get instead of pm_runtime_get_sync
Minghao Chi [Tue, 19 Apr 2022 11:07:18 +0000 (11:07 +0000)]
ASoC: img-spdif-in: using pm_runtime_resume_and_get instead of pm_runtime_get_sync

Using pm_runtime_resume_and_get() to replace pm_runtime_get_sync and
pm_runtime_put_noidle. This change is just to simplify the code, no
actual functional changes.

Reported-by: Zeal Robot <zealci@zte.com.cn>
Signed-off-by: Minghao Chi <chi.minghao@zte.com.cn>
Link: https://lore.kernel.org/r/20220419110718.2574674-1-chi.minghao@zte.com.cn
Signed-off-by: Mark Brown <broonie@kernel.org>
2 years agofirmware: cirrus: cs_dsp: Avoid padding bytes in cs_dsp_coeff_ctl
Richard Fitzgerald [Mon, 25 Apr 2022 09:51:59 +0000 (10:51 +0100)]
firmware: cirrus: cs_dsp: Avoid padding bytes in cs_dsp_coeff_ctl

Change the order of members in struct cs_dsp_coeff_ctl to avoid
the compiler having to insert alignment padding bytes. On a x86_64
build this saves 16 bytes per control.

- Pointers are collected to the top of the struct (with the exception of
  priv, as noted below), so that they are inherently aligned.
- The set and enable bitflags are placed together so they can be merged.
- priv is placed at the end of the struct - it is for use by the
  client so it is helpful to make it stand out, and since the compiler
  will always pad the struct size to an alignment multiple putting a
  pointer last won't introduce any more padding.
- struct cs_dsp_alg_region is placed at the end, right before priv, for
  the same reasoning as priv.

Signed-off-by: Richard Fitzgerald <rf@opensource.cirrus.com>
Reviewed-by: Charles Keepax <ckeepax@opensource.cirrus.com>
Link: https://lore.kernel.org/r/20220425095159.3044527-1-rf@opensource.cirrus.com
Signed-off-by: Mark Brown <broonie@kernel.org>
2 years agoASoC: sh: Make SND_SOC_RZ depend on ARCH_RZG2L
Biju Das [Sat, 23 Apr 2022 16:44:43 +0000 (17:44 +0100)]
ASoC: sh: Make SND_SOC_RZ depend on ARCH_RZG2L

The SSI block is identical on Renesas RZ/G2L, RZ/G2UL and RZ/V2L SoC's, so
instead of adding dependency for each SoC's add dependency on ARCH_RZG2L.
The ARCH_RZG2L config option is already selected by ARCH_R9A07G043,
ARCH_R9A07G044 and ARCH_R9A07G054.

Signed-off-by: Biju Das <biju.das.jz@bp.renesas.com>
Reviewed-by: Geert Uytterhoeven <geert+renesas@glider.be>
Link: https://lore.kernel.org/r/20220423164443.146299-1-biju.das.jz@bp.renesas.com
Signed-off-by: Mark Brown <broonie@kernel.org>
2 years agoASoC: fsl_asrc: using pm_runtime_resume_and_get to simplify the code
Minghao Chi [Wed, 20 Apr 2022 03:04:02 +0000 (03:04 +0000)]
ASoC: fsl_asrc: using pm_runtime_resume_and_get to simplify the code

Using pm_runtime_resume_and_get() to replace pm_runtime_get_sync and
pm_runtime_put_noidle. This change is just to simplify the code, no
actual functional changes.

Reported-by: Zeal Robot <zealci@zte.com.cn>
Signed-off-by: Minghao Chi <chi.minghao@zte.com.cn>
Link: https://lore.kernel.org/r/20220420030402.2575755-1-chi.minghao@zte.com.cn
Signed-off-by: Mark Brown <broonie@kernel.org>
2 years agoASoC: SOF: pci: add quirks and PCI IDS
Mark Brown [Fri, 22 Apr 2022 23:16:32 +0000 (00:16 +0100)]
ASoC: SOF: pci: add quirks and PCI IDS

Merge series from Pierre-Louis Bossart <pierre-louis.bossart@linux.intel.com>:

Add two PCI IDs and quirks for APL Chromebooks and Intel IPC4
selection for developers.

2 years agoASoC: soc-core: remove always-false path
Pierre-Louis Bossart [Thu, 21 Apr 2022 16:25:05 +0000 (11:25 -0500)]
ASoC: soc-core: remove always-false path

cppcheck throws the following warning:

sound/soc/soc-core.c:2773:6: style: Condition '!num_widgets' is always
false [knownConditionTrueFalse]
 if (!num_widgets) {
     ^

sound/soc/soc-core.c:2761:18: note: Assuming that condition
'num_widgets<0' is not redundant
 if (num_widgets < 0) {
                 ^
sound/soc/soc-core.c:2766:18: note: Assuming condition is false
 if (num_widgets & 1) {
                 ^
sound/soc/soc-core.c:2772:2: note: Compound assignment '/=', assigned
value is 0
 num_widgets /= 2;
 ^

We should check upfront all error conditions.

Signed-off-by: Pierre-Louis Bossart <pierre-louis.bossart@linux.intel.com>
Reviewed-by: Bard Liao <yung-chuan.liao@linux.intel.com>
Reviewed-by: Rander Wang <rander.wang@intel.com>
Reviewed-by: Péter Ujfalusi <peter.ujfalusi@linux.intel.com>
Link: https://lore.kernel.org/r/20220421162505.302132-1-pierre-louis.bossart@linux.intel.com
Signed-off-by: Mark Brown <broonie@kernel.org>
2 years agoASoC: SOF: Intel: hda: Revisit IMR boot sequence
Peter Ujfalusi [Thu, 21 Apr 2022 20:20:31 +0000 (15:20 -0500)]
ASoC: SOF: Intel: hda: Revisit IMR boot sequence

The sequence for IMR boot is essentially the same as normal boot with the
difference that instead of DMA from host the firmware is loaded from IMR.

Re-structure the code to use the existing sequence and also add fallback
handling in case the IMR boot fails.

Introduce a new flag to make the IMR boot support check simpler.

Reviewed-by: Ranjani Sridharan <ranjani.sridharan@linux.intel.com>
Signed-off-by: Peter Ujfalusi <peter.ujfalusi@linux.intel.com>
Signed-off-by: Pierre-Louis Bossart <pierre-louis.bossart@linux.intel.com>
Link: https://lore.kernel.org/r/20220421202031.1548362-1-pierre-louis.bossart@linux.intel.com
Signed-off-by: Mark Brown <broonie@kernel.org>
2 years agoASoC: SOF: Intel: hda: simplify NHLT handling
Pierre-Louis Bossart [Thu, 21 Apr 2022 20:19:46 +0000 (15:19 -0500)]
ASoC: SOF: Intel: hda: simplify NHLT handling

The existing code does an init/free for each piece of information
needed. We can instead initialize the NHLT table in the .probe() and
free it in the .remove() callback.

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/20220421201946.1547041-1-pierre-louis.bossart@linux.intel.com
Signed-off-by: Mark Brown <broonie@kernel.org>
2 years agoASoC: SOF: topology: Check w->sname validity once in sof_connect_dai_widget()
Peter Ujfalusi [Thu, 21 Apr 2022 20:18:47 +0000 (15:18 -0500)]
ASoC: SOF: topology: Check w->sname validity once in sof_connect_dai_widget()

The 'w' (struct snd_soc_dapm_widget) is not changing within the function,
there is no reason to check the w->sname more than once as it is not
going to change.

Reviewed-by: Bard Liao <yung-chuan.liao@linux.intel.com>
Signed-off-by: Peter Ujfalusi <peter.ujfalusi@linux.intel.com>
Signed-off-by: Pierre-Louis Bossart <pierre-louis.bossart@linux.intel.com>
Link: https://lore.kernel.org/r/20220421201847.1545686-1-pierre-louis.bossart@linux.intel.com
Signed-off-by: Mark Brown <broonie@kernel.org>
2 years agoASoC: SOF: sof-audio: remove useless assignment
Pierre-Louis Bossart [Thu, 21 Apr 2022 16:26:00 +0000 (11:26 -0500)]
ASoC: SOF: sof-audio: remove useless assignment

There is no need to assign spcm to NULL. Removing this assignment also
removes a false alarm reported by cppcheck.

Signed-off-by: Pierre-Louis Bossart <pierre-louis.bossart@linux.intel.com>
Reviewed-by: Bard Liao <yung-chuan.liao@linux.intel.com>
Reviewed-by: Rander Wang <rander.wang@intel.com>
Reviewed-by: Péter Ujfalusi <peter.ujfalusi@linux.intel.com>
Link: https://lore.kernel.org/r/20220421162600.302230-1-pierre-louis.bossart@linux.intel.com
Signed-off-by: Mark Brown <broonie@kernel.org>
2 years agoASoC: SOF: Intel: pci-tgl: add RPL-P support
Gongjun Song [Thu, 21 Apr 2022 16:33:58 +0000 (11:33 -0500)]
ASoC: SOF: Intel: pci-tgl: add RPL-P support

Add PCI DID for Intel Raptor Lake P.

Reviewed-by: Kai Vehmanen <kai.vehmanen@linux.intel.com>
Signed-off-by: Gongjun Song <gongjun.song@intel.com>
Signed-off-by: Pierre-Louis Bossart <pierre-louis.bossart@linux.intel.com>
Link: https://lore.kernel.org/r/20220421163358.319489-5-pierre-louis.bossart@linux.intel.com
Signed-off-by: Mark Brown <broonie@kernel.org>
2 years agoASoC: SOF: Intel: pci-tgl: add ADL-PS support
Muralidhar Reddy [Thu, 21 Apr 2022 16:33:57 +0000 (11:33 -0500)]
ASoC: SOF: Intel: pci-tgl: add ADL-PS support

Add PCI DID for Intel Alder Lake PS.

Reviewed-by: Ranjani Sridharan <ranjani.sridharan@linux.intel.com>
Signed-off-by: Muralidhar Reddy <muralidhar.reddy@intel.com>
Signed-off-by: Pierre-Louis Bossart <pierre-louis.bossart@linux.intel.com>
Link: https://lore.kernel.org/r/20220421163358.319489-4-pierre-louis.bossart@linux.intel.com
Signed-off-by: Mark Brown <broonie@kernel.org>
2 years agoASOC: SOF: pci: add ipc_type override for Intel IPC4 tests
Rander Wang [Thu, 21 Apr 2022 16:33:56 +0000 (11:33 -0500)]
ASOC: SOF: pci: add ipc_type override for Intel IPC4 tests

Add a kernel module parameter for select the non-default IPC type.

This should only be used by developers with access to firmware and
topology files, typically Intel and partners.

Signed-off-by: Rander Wang <rander.wang@intel.com>
Signed-off-by: Pierre-Louis Bossart <pierre-louis.bossart@linux.intel.com>
Signed-off-by: Ranjani Sridharan <ranjani.sridharan@linux.intel.com>
Reviewed-by: Péter Ujfalusi <peter.ujfalusi@linux.intel.com>
Reviewed-by: Bard Liao <yung-chuan.liao@linux.intel.com>
Link: https://lore.kernel.org/r/20220421163358.319489-3-pierre-louis.bossart@linux.intel.com
Signed-off-by: Mark Brown <broonie@kernel.org>
2 years agoASoC: SOF: sof-pci-dev: don't use the community key on APL Chromebooks
Pierre-Louis Bossart [Thu, 21 Apr 2022 16:33:55 +0000 (11:33 -0500)]
ASoC: SOF: sof-pci-dev: don't use the community key on APL Chromebooks

As suggested by MrChromebox, the SOF driver can be used with the SOF
firmware binary signed with the production key. This patch adds an
additional check for the ApolloLake SoC before modifying the default
firmware path.

Note that ApolloLake Chromebooks officially ship with the Skylake
driver, so to use SOF the users have to explicitly opt-in with
'options intel-dspcfg dsp_driver=3'. There is no plan to change the
default selection.

Signed-off-by: Pierre-Louis Bossart <pierre-louis.bossart@linux.intel.com>
Reviewed-by: Bard Liao <yung-chuan.liao@linux.intel.com>
Reviewed-by: Ranjani Sridharan <ranjani.sridharan@linux.intel.com>
Link: https://lore.kernel.org/r/20220421163358.319489-2-pierre-louis.bossart@linux.intel.com
Signed-off-by: Mark Brown <broonie@kernel.org>
2 years agoASoC: SOF: AMD updates
Mark Brown [Thu, 21 Apr 2022 18:37:35 +0000 (19:37 +0100)]
ASoC: SOF: AMD updates

Merge series from Pierre-Louis Bossart <pierre-louis.bossart@linux.intel.com>:

Small updates for the AMD SoF drivers.

2 years agoASoC: Intel: sof_ssp_amp: remove 'set-but-not-used' warning
Pierre-Louis Bossart [Thu, 21 Apr 2022 16:36:45 +0000 (11:36 -0500)]
ASoC: Intel: sof_ssp_amp: remove 'set-but-not-used' warning

Clang warning:
>> sound/soc/intel/boards/sof_ssp_amp.c:97:6: warning: variable 'i'
   set but not used [-Wunused-but-set-variable]
           int i = 0;
               ^

The device counter is not used when the quirk is not set, which static
analysis cannot know. Move its initialization before the loop to
remove this warning.

Reported-by: kernel test robot <lkp@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: Péter Ujfalusi <peter.ujfalusi@linux.intel.com>
Link: https://lore.kernel.org/r/20220421163645.319686-1-pierre-louis.bossart@linux.intel.com
Signed-off-by: Mark Brown <broonie@kernel.org>
2 years agoASoC: SOF: amd: Use dedicated MBOX for ACP and PSP communication
Ajit Kumar Pandey [Thu, 21 Apr 2022 16:58:20 +0000 (11:58 -0500)]
ASoC: SOF: amd: Use dedicated MBOX for ACP and PSP communication

We are currently using generic PSP Mailbox register for sending SHA
complete command to PSP but observe random arbitration issue during
PSP validation as MP0_C2PMSG_26_REG used by other kernel modules.

Use separate mailbox registers and doorbell mechanism to send SHA_DMA
complete command to PSP. This fixes such validation issues and added
flexibility for sending more ACP commands to PSP in future as new mbox
registers i.e MP0_C2PMSG_114_REG and MP0_C2PMSG_73_REG are dedicated
by PSP for ACP communications.

Reviewed-by: Ranjani Sridharan <ranjani.sridharan@linux.intel.com>
Reviewed-by: Bard Liao <yung-chuan.liao@linux.intel.com>
Signed-off-by: Ajit Kumar Pandey <AjitKumar.Pandey@amd.com>
Signed-off-by: Pierre-Louis Bossart <pierre-louis.bossart@linux.intel.com>
Link: https://lore.kernel.org/r/20220421165820.337207-3-pierre-louis.bossart@linux.intel.com
Signed-off-by: Mark Brown <broonie@kernel.org>
2 years agoASoC: SOF: amd: Add psp_mbox_ready() and psp_send_cmd() callback
Ajit Kumar Pandey [Thu, 21 Apr 2022 16:58:19 +0000 (11:58 -0500)]
ASoC: SOF: amd: Add psp_mbox_ready() and psp_send_cmd() callback

We need to ensure if PSP is mbox ready before and after sending cmd
to PSP over SMN interface. Add method to check MBOX_READY bit of PSP
with some delay over ACP_PSP_TIMEOUT_COUNTER. Replace psp_fw_validate
with new method psp_send_cmd() to send command via psp mailbox.

Reviewed-by: Ranjani Sridharan <ranjani.sridharan@linux.intel.com>
Signed-off-by: Ajit Kumar Pandey <AjitKumar.Pandey@amd.com>
Signed-off-by: Pierre-Louis Bossart <pierre-louis.bossart@linux.intel.com>
Link: https://lore.kernel.org/r/20220421165820.337207-2-pierre-louis.bossart@linux.intel.com
Signed-off-by: Mark Brown <broonie@kernel.org>
2 years agoASoC: rsnd: care return value from rsnd_node_fixed_index()
Kuninori Morimoto [Thu, 21 Apr 2022 02:55:58 +0000 (02:55 +0000)]
ASoC: rsnd: care return value from rsnd_node_fixed_index()

Renesas Sound is very complex, and thus it needs to use
rsnd_node_fixed_index() to know enabled pin index.

It returns error if strange pin was selected,
but some codes didn't check it.

This patch 1) indicates error message, 2) check return
value.

Reported-by: kernel test robot <lkp@intel.com>
Reported-by: Dan Carpenter <dan.carpenter@oracle.com>
Signed-off-by: Kuninori Morimoto <kuninori.morimoto.gx@renesas.com>
Link: https://lore.kernel.org/r/87pmlbgn5t.wl-kuninori.morimoto.gx@renesas.com
Signed-off-by: Mark Brown <broonie@kernel.org>
2 years agoASoC: audio-graph-card2: indicate "Experimental stage" warning only when successed
Kuninori Morimoto [Thu, 21 Apr 2022 02:56:17 +0000 (02:56 +0000)]
ASoC: audio-graph-card2: indicate "Experimental stage" warning only when successed

Because Sound Card needs many drivers to probe, current audio-graph-card2
will indicate "Experimental stage" at top of probe function even though
in case it gets -EPROBE_DEFER, thus it will be indicated many times.

This patch indicates it when probe was succeeded.

[    1.601393] asoc-audio-graph-card2 sound: Audio Graph Card2 is still under Experimental stage
...
[    1.721269] asoc-audio-graph-card2 sound: Audio Graph Card2 is still under Experimental stage
...
[    1.755231] asoc-audio-graph-card2 sound: Audio Graph Card2 is still under Experimental stage
...
[    1.907710] asoc-audio-graph-card2 sound: Audio Graph Card2 is still under Experimental stage
...
[    1.933173] rcar_sound ec500000.sound: probed
[    1.948875] asoc-audio-graph-card2 sound: Audio Graph Card2 is still under Experimental stage
[    1.959558] asoc-audio-graph-card2 sound: ak4613-hifi <-> rsnd-dai.0 mapping ok
[    1.968119] asoc-audio-graph-card2 sound: i2s-hifi <-> rsnd-dai.1 mapping ok

Signed-off-by: Kuninori Morimoto <kuninori.morimoto.gx@renesas.com>
Link: https://lore.kernel.org/r/87o80vgn5a.wl-kuninori.morimoto.gx@renesas.com
Signed-off-by: Mark Brown <broonie@kernel.org>
2 years agoASoC: rsnd: care default case on rsnd_ssiu_busif_err_status_clear()
Kuninori Morimoto [Thu, 21 Apr 2022 02:55:27 +0000 (02:55 +0000)]
ASoC: rsnd: care default case on rsnd_ssiu_busif_err_status_clear()

commit cfb7b8bf1e2d66 ("ASoC: rsnd: tidyup
rsnd_ssiu_busif_err_status_clear()") merged duplicate code, but it didn't
care about default case, and causes smatch warnings.

smatch warnings:
sound/soc/sh/rcar/ssiu.c:112 rsnd_ssiu_busif_err_status_clear() \
error: uninitialized symbol 'offset'.
sound/soc/sh/rcar/ssiu.c:114 rsnd_ssiu_busif_err_status_clear() \
error: uninitialized symbol 'shift'.

This patch cares it.

Reported-by: kernel test robot <lkp@intel.com>
Reported-by: Dan Carpenter <dan.carpenter@oracle.com>
Signed-off-by: Kuninori Morimoto <kuninori.morimoto.gx@renesas.com>
Link: https://lore.kernel.org/r/87r15rgn6p.wl-kuninori.morimoto.gx@renesas.com
Signed-off-by: Mark Brown <broonie@kernel.org>
2 years agoASoC: dt-bindings: max98390: add reset gpio bindings
Steve Lee [Wed, 20 Apr 2022 04:49:00 +0000 (13:49 +0900)]
ASoC: dt-bindings: max98390: add reset gpio bindings

This adds support for the reset gpio binding.

Signed-off-by: Steve Lee <steve.lee.analog@gmail.com>
Acked-by: Rob Herring <robh@kernel.org>
Link: https://lore.kernel.org/r/20220420044900.2989-2-steve.lee.analog@gmail.com
Signed-off-by: Mark Brown <broonie@kernel.org>
2 years agoASoC: max98390: Add reset gpio control
Steve Lee [Wed, 20 Apr 2022 04:48:59 +0000 (13:48 +0900)]
ASoC: max98390: Add reset gpio control

Add reset gpio control to support RESET PIN connected to gpio.

Signed-off-by: Steve Lee <steve.lee.analog@gmail.com>
Acked-by: Nuno Sá <nuno.sa@analog.com>
Link: https://lore.kernel.org/r/20220420044900.2989-1-steve.lee.analog@gmail.com
Signed-off-by: Mark Brown <broonie@kernel.org>
2 years agoASoC: SOF: using pm_runtime_resume_and_get to simplify the code
Minghao Chi [Wed, 20 Apr 2022 03:03:15 +0000 (03:03 +0000)]
ASoC: SOF: using pm_runtime_resume_and_get to simplify the code

Using pm_runtime_resume_and_get() to replace pm_runtime_get_sync and
pm_runtime_put_noidle. This change is just to simplify the code, no
actual functional changes.

Reported-by: Zeal Robot <zealci@zte.com.cn>
Signed-off-by: Minghao Chi <chi.minghao@zte.com.cn>
Acked-by: Pierre-Louis Bossart <pierre-louis.bossart@linux.intel.com>
Link: https://lore.kernel.org/r/20220420030315.2575691-1-chi.minghao@zte.com.cn
Signed-off-by: Mark Brown <broonie@kernel.org>
2 years agoASoC: amd: acp: Add pm ops callback in machine driver
Ajit Kumar Pandey [Wed, 20 Apr 2022 09:44:36 +0000 (15:14 +0530)]
ASoC: amd: acp: Add pm ops callback in machine driver

Add alsa snd_soc_pm_ops callback in ACP machine driver to support
suspend and resume operation of sound card components

Signed-off-by: Ajit Kumar Pandey <AjitKumar.Pandey@amd.com>
Link: https://lore.kernel.org/r/20220420094442.1352717-1-AjitKumar.Pandey@amd.com
Signed-off-by: Mark Brown <broonie@kernel.org>
2 years agoASoC: soc-pcm: improve BE state transitions
Mark Brown [Wed, 20 Apr 2022 13:22:08 +0000 (14:22 +0100)]
ASoC: soc-pcm: improve BE state transitions

Merge series from Pierre-Louis Bossart <pierre-louis.bossart@linux.intel.com>:

With additional tests with the introduction of a 'deep-buffer' PCM
device mixed with the regular low-latency path, we came up with two
improvements in the BE state machine and transitions. The short
explanation is that the BE cannot directly use the trigger commands
provided by the FE, and a translation is needed to deal with paused
states.

2 years agoASoC: SOF: add INTEL_IPC4 plumbing
Mark Brown [Wed, 20 Apr 2022 13:22:06 +0000 (14:22 +0100)]
ASoC: SOF: add INTEL_IPC4 plumbing

Merge series from Pierre-Louis Bossart <pierre-louis.bossart@linux.intel.com>:

The INTEL_IPC4 protocol and firmware architecture will rely on
different sets of firmware binary and topology files. Some platforms
will only support INTEL_IPC4, some will support both INTEL_IPC4 and
SOF_IPC for development, and some will stay with the existing SOF_IPC.

This patchset adds new IPC definitions, and search paths for firmware
and topology files, along with means to override the default IPC type
and search paths for development. The firmware binary names are
aligned with those used by the Intel AVS driver to avoid duplicate
firmware installs, but the topology will have to differ due to driver
architecture differences.

2 years agoASoC: Intel: avs: Topology and path management
Mark Brown [Wed, 20 Apr 2022 13:22:05 +0000 (14:22 +0100)]
ASoC: Intel: avs: Topology and path management

Merge series from Cezary Rojewski <cezary.rojewski@intel.com>:

A continuation of avs-driver initial series [1]. This chapter covers
path management and topology parsing part which was ealier path of the
main series. The two patches that represented these two subjects in the
initial series, have been split into many to allow for easier review and
discussion.

AVS topology is split into two major parts: dictionaries - found within
ASoC topology manifest - and path templates.

Dictionaries job is to reduce the total amount of memory
occupied by topology elements. Rather than having every pipeline and
module carry its own information, each refers to specific entry in
specific dictionary by provided (from topology file) indexes. In
consequence, most struct avs_tplg_xxx are made out of pointers.

Path templates are similar to path descriptions found in skylake-driver
and they describe how given path shall look like in runtime - number of
modules and pipelines that shape it and how they are laid out. A single
path template is tied either to FE or BE and thus at most to a single,
user-visible endpoint when speaking of FE.

Path is a software representation of its ADSP firmware equivalent. It's
a logical container for pipelines which are themselves containers - this
time for modules i.e. processing units.
Depending on the number of audio formats supported, each path template
may carry one or more descriptions of given path. During runtime, when
audio format is known, description matching said format is selected and
used when instantiating path on ADSP firmware side through IPCs.

2 years agoASoC: fsl_micfil: Driver updates
Mark Brown [Wed, 20 Apr 2022 13:22:03 +0000 (14:22 +0100)]
ASoC: fsl_micfil: Driver updates

Merge series from Sascha Hauer <s.hauer@pengutronix.de>:

Cleanups for the fsl_micfil driver.

2 years agoASoC: soc-pcm: improve BE transition for TRIGGER_START
Pierre-Louis Bossart [Wed, 6 Apr 2022 19:00:56 +0000 (14:00 -0500)]
ASoC: soc-pcm: improve BE transition for TRIGGER_START

When the BE was in PAUSED state, the correct trigger is PAUSE_RELEASE.

Signed-off-by: Pierre-Louis Bossart <pierre-louis.bossart@linux.intel.com>
Reviewed-by: Rander Wang <rander.wang@intel.com>
Reviewed-by: Ranjani Sridharan <ranjani.sridharan@linux.intel.com>
Reviewed-by: Péter Ujfalusi <peter.ujfalusi@linux.intel.com>
Reviewed-by: Bard Liao <yung-chuan.liao@linux.intel.com>
Link: https://lore.kernel.org/r/20220406190056.233481-3-pierre-louis.bossart@linux.intel.com
Signed-off-by: Mark Brown <broonie@kernel.org>
2 years agoASoC: soc-pcm: improve BE transition for PAUSE_RELEASE
Pierre-Louis Bossart [Wed, 6 Apr 2022 19:00:55 +0000 (14:00 -0500)]
ASoC: soc-pcm: improve BE transition for PAUSE_RELEASE

Commit 3aa1e96a2b95 ("ASoC: soc-pcm: fix BE handling of PAUSE_RELEASE")
did not modify the existing logic and kept the same logic for the following
transition

    play FE1    -> BE state is START
    pause FE1   -> BE state is PAUSED
    play FE2    -> BE state is START
    stop FE2    -> BE state is STOP <<< !!
    release FE1 -> BE state is START
    stop FE1    -> BE state is STOP

At the time it was identified by reviewers that a better solution
might consist in

    play FE1    -> BE state is START
    pause FE1   -> BE state is PAUSED
    play FE2    -> BE state is START
    stop FE2    -> BE state is PAUSE <<< !!
    release FE1 -> BE state is START
    stop FE1    -> BE state is STOP

This patch suggest a transition to PAUSE when all the 'active' streams
are paused. This would allow for a more consistent resource management
for platforms where PAUSE and STOP are handled differently.

To track the special case of an FE going from PAUSE_PUSH to STOP, we
add a state variable for each FE context. This 'fe_pause' boolean is
set on PAUSE_PUSH and cleared on either PAUSE_RELEASE and STOP
triggers.

Signed-off-by: Pierre-Louis Bossart <pierre-louis.bossart@linux.intel.com>
Reviewed-by: Rander Wang <rander.wang@intel.com>
Reviewed-by: Ranjani Sridharan <ranjani.sridharan@linux.intel.com>
Reviewed-by: Péter Ujfalusi <peter.ujfalusi@linux.intel.com>
Reviewed-by: Bard Liao <yung-chuan.liao@linux.intel.com>
Link: https://lore.kernel.org/r/20220406190056.233481-2-pierre-louis.bossart@linux.intel.com
Signed-off-by: Mark Brown <broonie@kernel.org>
2 years agoASoC: SOF: Kconfig: Make SND_SOC_SOF_HDA_PROBES tristate
Richard Fitzgerald [Thu, 7 Apr 2022 15:38:13 +0000 (16:38 +0100)]
ASoC: SOF: Kconfig: Make SND_SOC_SOF_HDA_PROBES tristate

SND_SOC_SOF_HDA_PROBES must be tristate because the code it builds
depends on code that is tristate.

If SND_SOC_SOF_HDA_PROBES is bool it leads to the following build
inconsistency:

SND_SOC_SOF_HDA_COMMON=m
  which selects SND_SOC_SOF_HDA_PROBES
    but since this is a bool SND_SOC_SOF_HDA_PROBES=y

SND_SOC_SOF_HDA_PROBES=y
  selects SND_SOC_SOF_DEBUG_PROBES=y
    so sof-client-probes.c is built into the kernel.

sof-client-probes.c calls functions in sof-client.c, but

SND_SOC_SOF=m
  sof-client.c is built into a loadable module.

Signed-off-by: Richard Fitzgerald <rf@opensource.cirrus.com>
Link: https://lore.kernel.org/r/20220407153813.1231866-1-rf@opensource.cirrus.com
Signed-off-by: Mark Brown <broonie@kernel.org>
2 years agoASoC: dmic: Add support for DSD data format
Shengjiu Wang [Mon, 18 Apr 2022 03:18:30 +0000 (11:18 +0800)]
ASoC: dmic: Add support for DSD data format

Add DSD format support in this generic dmic driver:
DSD_U8,
DSD_U16_LE,
DSD_U32_LE,

Signed-off-by: Shengjiu Wang <shengjiu.wang@nxp.com>
Link: https://lore.kernel.org/r/1650251910-8932-1-git-send-email-shengjiu.wang@nxp.com
Signed-off-by: Mark Brown <broonie@kernel.org>
2 years agoASoC: fsl_micfil: Remove debug message
Sascha Hauer [Thu, 14 Apr 2022 16:22:49 +0000 (18:22 +0200)]
ASoC: fsl_micfil: Remove debug message

The micfil driver prints out the IRQ numbers for each interrupt at error
level. This information is useful for debugging at best, remove it.

Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
Acked-by: Shengjiu Wang <shengjiu.wang@gmail.com>
Link: https://lore.kernel.org/r/20220414162249.3934543-22-s.hauer@pengutronix.de
Signed-off-by: Mark Brown <broonie@kernel.org>
2 years agoASoC: fsl_micfil: fold fsl_set_clock_params() into its only user
Sascha Hauer [Thu, 14 Apr 2022 16:22:48 +0000 (18:22 +0200)]
ASoC: fsl_micfil: fold fsl_set_clock_params() into its only user

fsl_set_clock_params() is used only once and easily be folded into its
caller, do so.

Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
Acked-by: Shengjiu Wang <shengjiu.wang@gmail.com>
Link: https://lore.kernel.org/r/20220414162249.3934543-21-s.hauer@pengutronix.de
Signed-off-by: Mark Brown <broonie@kernel.org>
2 years agoASoC: fsl_micfil: drop support for undocumented property
Sascha Hauer [Thu, 14 Apr 2022 16:22:47 +0000 (18:22 +0200)]
ASoC: fsl_micfil: drop support for undocumented property

The "fsl,shared-interrupt" property is undocumented and unnecessary.
Just pass IRQF_SHARED unconditionally.

Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
Acked-by: Shengjiu Wang <shengjiu.wang@gmail.com>
Link: https://lore.kernel.org/r/20220414162249.3934543-20-s.hauer@pengutronix.de
Signed-off-by: Mark Brown <broonie@kernel.org>
2 years agoASoC: fsl_micfil: drop only once used defines
Sascha Hauer [Thu, 14 Apr 2022 16:22:46 +0000 (18:22 +0200)]
ASoC: fsl_micfil: drop only once used defines

FSL_MICFIL_RATES and FSL_MICFIL_FORMATS is only used once. Drop
the unnecesary indirection and use SNDRV_PCM_RATE_8000_48000 and
SNDRV_PCM_FMTBIT_S16_LE directly.

Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
Acked-by: Shengjiu Wang <shengjiu.wang@gmail.com>
Link: https://lore.kernel.org/r/20220414162249.3934543-19-s.hauer@pengutronix.de
Signed-off-by: Mark Brown <broonie@kernel.org>
2 years agoASoC: fsl_micfil: drop unused include
Sascha Hauer [Thu, 14 Apr 2022 16:22:45 +0000 (18:22 +0200)]
ASoC: fsl_micfil: drop unused include

The micfil driver doesn't use anything from imx-pcm.h. Drop its
inclusion.

Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
Acked-by: Shengjiu Wang <shengjiu.wang@gmail.com>
Link: https://lore.kernel.org/r/20220414162249.3934543-18-s.hauer@pengutronix.de
Signed-off-by: Mark Brown <broonie@kernel.org>
2 years agoASoC: fsl_micfil: rework quality setting
Sascha Hauer [Thu, 14 Apr 2022 16:22:44 +0000 (18:22 +0200)]
ASoC: fsl_micfil: rework quality setting

For the quality setting the quality setting register values are directly
exposed to the kcontrol and thus to userspace. This is unfortunate
because the register settings contains invalid bit combinations marked
as "N/A". For userspace it doesn't make much sense to be able to set
these just to see that the driver responds with "Please make sure you
select a valid quality." in the kernel log.

Work around this by adding get/set functions for the quality setting.

Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
Acked-by: Shengjiu Wang <shengjiu.wang@gmail.com>
Link: https://lore.kernel.org/r/20220414162249.3934543-17-s.hauer@pengutronix.de
Signed-off-by: Mark Brown <broonie@kernel.org>
2 years agoASoC: fsl_micfil: simplify clock setting
Sascha Hauer [Thu, 14 Apr 2022 16:22:43 +0000 (18:22 +0200)]
ASoC: fsl_micfil: simplify clock setting

The reference manual has this for calculating the micfil internal clock
divider:

         MICFIL Clock rate
clkdiv = -----------------
         8 * OSR * outrate

(with OSR == Oversampling Rate, outrate == output sample rate)

The driver first sets the MICFIL Clock rate to (outrate * 1024) and then
calculates back the clkdiv value from the above calculation.

Simplify this by using a fixed clkdiv value of 8 and set the MICFIL
Clock rate to (outrate * clkdiv * OSR * 8).

While at it drop disabling the clock before setting its rate. The MICFIL
module is disabled when the rate is changed and it is also resetted
before it is started again, so I doubt it's necessary to disable the
clock.

Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
Acked-by: Shengjiu Wang <shengjiu.wang@gmail.com>
Link: https://lore.kernel.org/r/20220414162249.3934543-16-s.hauer@pengutronix.de
Signed-off-by: Mark Brown <broonie@kernel.org>
2 years agoASoC: fsl_micfil: Drop get_pdm_clk()
Sascha Hauer [Thu, 14 Apr 2022 16:22:42 +0000 (18:22 +0200)]
ASoC: fsl_micfil: Drop get_pdm_clk()

get_pdm_clk() calculates the PDM clock based on the quality setting,
but really the PDM clock is independent of the quality, it's always
rate * 4 * micfil->osr. Just drop the function and do the calculation
in the caller.

Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
Acked-by: Shengjiu Wang <shengjiu.wang@gmail.com>
Link: https://lore.kernel.org/r/20220414162249.3934543-15-s.hauer@pengutronix.de
Signed-off-by: Mark Brown <broonie@kernel.org>
2 years agoASoC: fsl_micfil: use define for OSR default value
Sascha Hauer [Thu, 14 Apr 2022 16:22:41 +0000 (18:22 +0200)]
ASoC: fsl_micfil: use define for OSR default value

The OSR (OverSampling Rate) setting is set once to the default value
and never changed throughout the driver. Nevertheless the value is
read back from the register for further calculations. Just use the
default value because we know what we have written.

Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
Acked-by: Shengjiu Wang <shengjiu.wang@gmail.com>
Link: https://lore.kernel.org/r/20220414162249.3934543-14-s.hauer@pengutronix.de
Signed-off-by: Mark Brown <broonie@kernel.org>
2 years agoASoC: fsl_micfil: add multi fifo support
Sascha Hauer [Thu, 14 Apr 2022 16:22:40 +0000 (18:22 +0200)]
ASoC: fsl_micfil: add multi fifo support

The micfil hardware provides the microphone data on multiple successive
FIFO registers, one register per stereo pair. Also to work properly the
SDMA_DONE0_CONFIG_DONE_SEL bit in the SDMA engines SDMA_DONE0_CONFIG
register must be set. This patch provides the necessary information to
the SDMA engine driver.

Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
Acked-by: Shengjiu Wang <shengjiu.wang@gmail.com>
Link: https://lore.kernel.org/r/20220414162249.3934543-13-s.hauer@pengutronix.de
Signed-off-by: Mark Brown <broonie@kernel.org>
2 years agodmaengine: imx-sdma: Add multi fifo support
Sascha Hauer [Thu, 14 Apr 2022 16:22:39 +0000 (18:22 +0200)]
dmaengine: imx-sdma: Add multi fifo support

The i.MX SDMA engine can read from / write to multiple successive
hardware FIFO registers, referred to as "Multi FIFO support". This is
needed for the micfil driver and certain configurations of the SAI
driver. This patch adds support for this feature.

The number of FIFOs to read from / write to must be communicated from
the client driver to the SDMA engine. For this the struct
dma_slave_config::peripheral_config field is used.

Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
Acked-By: Vinod Koul <vkoul@kernel.org>
Link: https://lore.kernel.org/r/20220414162249.3934543-12-s.hauer@pengutronix.de
Signed-off-by: Mark Brown <broonie@kernel.org>
2 years agodmaengine: imx-sdma: error out on unsupported transfer types
Sascha Hauer [Thu, 14 Apr 2022 16:22:38 +0000 (18:22 +0200)]
dmaengine: imx-sdma: error out on unsupported transfer types

The i.MX SDMA driver currently silently ignores unsupported transfer
types. These transfer types are specified in the dma channel description
in the device tree, so they should really be checked.
Issue a message and error out when we hit unsupported transfer types.

Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
Acked-By: Vinod Koul <vkoul@kernel.org>
Link: https://lore.kernel.org/r/20220414162249.3934543-11-s.hauer@pengutronix.de
Signed-off-by: Mark Brown <broonie@kernel.org>
2 years agodmaengine: imx: Move header to include/dma/
Sascha Hauer [Thu, 14 Apr 2022 16:22:37 +0000 (18:22 +0200)]
dmaengine: imx: Move header to include/dma/

The i.MX DMA drivers are device tree only, nothing in
include/linux/platform_data/dma-imx.h has platform_data in it, so move
the file to include/linux/dma/imx-dma.h.

Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
Acked-By: Vinod Koul <vkoul@kernel.org>
Link: https://lore.kernel.org/r/20220414162249.3934543-10-s.hauer@pengutronix.de
Signed-off-by: Mark Brown <broonie@kernel.org>
2 years agoASoC: fsl_micfil: drop unused variables
Sascha Hauer [Thu, 14 Apr 2022 16:22:36 +0000 (18:22 +0200)]
ASoC: fsl_micfil: drop unused variables

struct fsl_micfil has unused fields, remove them.

Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
Acked-by: Shengjiu Wang <shengjiu.wang@gmail.com>
Link: https://lore.kernel.org/r/20220414162249.3934543-9-s.hauer@pengutronix.de
Signed-off-by: Mark Brown <broonie@kernel.org>
2 years agoASoC: fsl_micfil: drop error messages from failed register accesses
Sascha Hauer [Thu, 14 Apr 2022 16:22:35 +0000 (18:22 +0200)]
ASoC: fsl_micfil: drop error messages from failed register accesses

Failed register accesses are really not expected in memory mapped
registers. When it fails then the register access itself is likely not
the reason, so no need to have extra error messages for each regmap
access. Just drop the error messages. This also fixes some places where
a return value is concatenated using 'ret |=' and then returned as
error value.

Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
Acked-by: Shengjiu Wang <shengjiu.wang@gmail.com>
Link: https://lore.kernel.org/r/20220414162249.3934543-8-s.hauer@pengutronix.de
Signed-off-by: Mark Brown <broonie@kernel.org>
2 years agoASoC: fsl_micfil: use clear/set bits
Sascha Hauer [Thu, 14 Apr 2022 16:22:34 +0000 (18:22 +0200)]
ASoC: fsl_micfil: use clear/set bits

Instead regmap_update_bits() use the simpler variants
regmap_[set|clear]_bits() where appropriate.

Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
Acked-by: Shengjiu Wang <shengjiu.wang@gmail.com>
Link: https://lore.kernel.org/r/20220414162249.3934543-7-s.hauer@pengutronix.de
Signed-off-by: Mark Brown <broonie@kernel.org>
2 years agoASoC: fsl_micfil: use GENMASK to define register bit fields
Sascha Hauer [Thu, 14 Apr 2022 16:22:33 +0000 (18:22 +0200)]
ASoC: fsl_micfil: use GENMASK to define register bit fields

Use GENMASK along with FIELD_PREP and FIELD_GET to access bitfields in
registers to straighten register access and to drop a lot of defines.

Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
Acked-by: Shengjiu Wang <shengjiu.wang@gmail.com>
Link: https://lore.kernel.org/r/20220414162249.3934543-6-s.hauer@pengutronix.de
Signed-off-by: Mark Brown <broonie@kernel.org>
2 years agoASoC: fsl_micfil: do not define SHIFT/MASK for single bits
Sascha Hauer [Thu, 14 Apr 2022 16:22:32 +0000 (18:22 +0200)]
ASoC: fsl_micfil: do not define SHIFT/MASK for single bits

No need to have defines for the mask of single bits. Also shift is
unused. Drop all these unnecessary defines.

Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
Acked-by: Shengjiu Wang <shengjiu.wang@gmail.com>
Link: https://lore.kernel.org/r/20220414162249.3934543-5-s.hauer@pengutronix.de
Signed-off-by: Mark Brown <broonie@kernel.org>
2 years agoASoC: fsl_micfil: drop fsl_micfil_set_mclk_rate()
Sascha Hauer [Thu, 14 Apr 2022 16:22:31 +0000 (18:22 +0200)]
ASoC: fsl_micfil: drop fsl_micfil_set_mclk_rate()

All that the .set_sysclk hook in the micfil driver does is to pass
the sysclk frequency to fsl_micfil_set_mclk_rate(). This function
expects the sample rate as argument though, not any kind of sysclk
frequency. The resulting rate setting of the clock is overwritten
in hw_params anyway, so drop this altogether.

Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
Acked-by: Shengjiu Wang <shengjiu.wang@gmail.com>
Link: https://lore.kernel.org/r/20220414162249.3934543-4-s.hauer@pengutronix.de
Signed-off-by: Mark Brown <broonie@kernel.org>
2 years agoASoC: fsl_micfil: Drop unused register read
Sascha Hauer [Thu, 14 Apr 2022 16:22:30 +0000 (18:22 +0200)]
ASoC: fsl_micfil: Drop unused register read

In get_pdm_clk() REG_MICFIL_CTRL2 is read, but the result is never used.
Drop the unused code.

Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
Acked-by: Shengjiu Wang <shengjiu.wang@gmail.com>
Link: https://lore.kernel.org/r/20220414162249.3934543-3-s.hauer@pengutronix.de
Signed-off-by: Mark Brown <broonie@kernel.org>
2 years agoASoC: fsl_micfil: Drop unnecessary register read
Sascha Hauer [Thu, 14 Apr 2022 16:22:29 +0000 (18:22 +0200)]
ASoC: fsl_micfil: Drop unnecessary register read

in get_pdm_clk() REG_MICFIL_CTRL2 is read twice. Drop second read.

Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
Acked-by: Shengjiu Wang <shengjiu.wang@gmail.com>
Link: https://lore.kernel.org/r/20220414162249.3934543-2-s.hauer@pengutronix.de
Signed-off-by: Mark Brown <broonie@kernel.org>
2 years agoASoC: codecs: wm8962: using pm_runtime_resume_and_get instead of pm_runtime_get_sync
Minghao Chi [Mon, 18 Apr 2022 11:02:59 +0000 (11:02 +0000)]
ASoC: codecs: wm8962: using pm_runtime_resume_and_get instead of pm_runtime_get_sync

Using pm_runtime_resume_and_get is more appropriate
for simplifing code

Reported-by: Zeal Robot <zealci@zte.com.cn>
Signed-off-by: Minghao Chi <chi.minghao@zte.com.cn>
Acked-by: Charles Keepax <ckeepax@opensource.cirrus.com>
Link: https://lore.kernel.org/r/20220418110259.2559144-1-chi.minghao@zte.com.cn
Signed-off-by: Mark Brown <broonie@kernel.org>
2 years agoASoC: qcom: lpass-platform: Update memremap flag to MEMREMAP_WC
Srinivasa Rao Mandadapu [Wed, 13 Apr 2022 10:09:56 +0000 (15:39 +0530)]
ASoC: qcom: lpass-platform: Update memremap flag to MEMREMAP_WC

Update memremap flag from MEMREMAP_WT to MEMREMAP_WC for better
performance.

Signed-off-by: Srinivasa Rao Mandadapu <quic_srivasam@quicinc.com>
Co-developed-by: Venkata Prasad Potturu <quic_potturu@quicinc.com>
Signed-off-by: Venkata Prasad Potturu <quic_potturu@quicinc.com>
Link: https://lore.kernel.org/r/1649844596-5264-1-git-send-email-quic_srivasam@quicinc.com
Signed-off-by: Mark Brown <broonie@kernel.org>
2 years agoASoC: Intel: avs: Configure modules according to their type
Cezary Rojewski [Thu, 31 Mar 2022 13:52:46 +0000 (15:52 +0200)]
ASoC: Intel: avs: Configure modules according to their type

Each module on DSP side serves a processing purpose. Depending on its
purpose, it needs different information during its initialization. Add
functions responsible for creating instances of specific module types
given the information coming from the topology file.

Signed-off-by: Amadeusz Sławiński <amadeuszx.slawinski@linux.intel.com>
Signed-off-by: Cezary Rojewski <cezary.rojewski@intel.com>
Link: https://lore.kernel.org/r/20220331135246.993089-15-cezary.rojewski@intel.com
Signed-off-by: Mark Brown <broonie@kernel.org>
2 years agoASoC: Intel: avs: Prepare modules before bindings them
Cezary Rojewski [Thu, 31 Mar 2022 13:52:45 +0000 (15:52 +0200)]
ASoC: Intel: avs: Prepare modules before bindings them

When binding modules to pins other than pin0, sometimes additional
preparations need to be made, depending on the module type.
Add function that prepares modules when necessary before binding them.

Signed-off-by: Amadeusz Sławiński <amadeuszx.slawinski@linux.intel.com>
Signed-off-by: Cezary Rojewski <cezary.rojewski@intel.com>
Link: https://lore.kernel.org/r/20220331135246.993089-14-cezary.rojewski@intel.com
Signed-off-by: Mark Brown <broonie@kernel.org>
2 years agoASoC: Intel: avs: Arm paths after creating them
Cezary Rojewski [Thu, 31 Mar 2022 13:52:44 +0000 (15:52 +0200)]
ASoC: Intel: avs: Arm paths after creating them

Creating the pipelines and instantiating the modules alone is
insufficient to have a fully operational stream. Before it can be run,
stream components need to be bound. Add arming functions to ensure all
necessary operations are completed before path is yielded back to the
avs_path_create() caller.

Signed-off-by: Amadeusz Sławiński <amadeuszx.slawinski@linux.intel.com>
Signed-off-by: Cezary Rojewski <cezary.rojewski@intel.com>
Link: https://lore.kernel.org/r/20220331135246.993089-13-cezary.rojewski@intel.com
Signed-off-by: Mark Brown <broonie@kernel.org>
2 years agoASoC: Intel: avs: Path state management
Cezary Rojewski [Thu, 31 Mar 2022 13:52:43 +0000 (15:52 +0200)]
ASoC: Intel: avs: Path state management

Add functions to ease with state changing of all objects found in the
path. Each represents either a BIND/UNBIND or SET_PIPELINE_STATE IPC.

DSP pipelines follow simple state machine scheme:
CREATE -> RESET -> PAUSE -> RUNNING -> PAUSE -> RESET -> DELETE

There is no STOP, PAUSE serves that purpose instead.

Signed-off-by: Amadeusz Sławiński <amadeuszx.slawinski@linux.intel.com>
Signed-off-by: Cezary Rojewski <cezary.rojewski@intel.com>
Link: https://lore.kernel.org/r/20220331135246.993089-12-cezary.rojewski@intel.com
Signed-off-by: Mark Brown <broonie@kernel.org>
2 years agoASoC: Intel: avs: Path creation and freeing
Cezary Rojewski [Thu, 31 Mar 2022 13:52:42 +0000 (15:52 +0200)]
ASoC: Intel: avs: Path creation and freeing

To implement ASoC PCM operations, DSP path handling is needed. With path
template concept present, information carried by topology file can be
converted into runtime path representation. Each may be composed of
several pipelines and each pipeline can contain a number of processing
modules inside. Number of templates and variants found within topology
may vastly outnumber the total amount of pipelines and modules supported
by AudioDSP firmware simultaneously (in runtime) so none of the IDs are
specified in the topology. These are assigned dynamically when needed
and account for limitations described by FIRMWARE_CONFIG and
HARDWARE_CONFIG basefw parameters.

Paths are created on ->hw_params() and are freed on ->hw_free() ALSA PCM
operations. This choice is based on firmware expectations - need for
complete set of information when attempting to instantiate pipelines and
modules on AudioDSP side. With DMA and audio format provided, search
mechanism tests all path variants available in given path template until
a matching variant is found. Once found, information already available
is combined with all avs_tplg_* pieces pointed by matching path variant.
This finally allows to begin a cascade of IPCs which goal is to reserve
resources and prepare DSP for upcoming audio streaming.

Signed-off-by: Amadeusz Sławiński <amadeuszx.slawinski@linux.intel.com>
Signed-off-by: Cezary Rojewski <cezary.rojewski@intel.com>
Link: https://lore.kernel.org/r/20220331135246.993089-11-cezary.rojewski@intel.com
Signed-off-by: Mark Brown <broonie@kernel.org>
2 years agoASoC: Intel: avs: Declare path and its components
Cezary Rojewski [Thu, 31 Mar 2022 13:52:41 +0000 (15:52 +0200)]
ASoC: Intel: avs: Declare path and its components

Declare representatives for all crucial elements which stream on ADSP
side is made of. That covers pipelines and modules subject which are
presented by struct avs_path_pipeline and avs_path_module respectively.
While struct avs_path_binding and struct avs_path do not represent any
object on firmware side directly, they are needed to help track the
interconnections and membership of every pipeline and module created.

Signed-off-by: Amadeusz Sławiński <amadeuszx.slawinski@linux.intel.com>
Signed-off-by: Cezary Rojewski <cezary.rojewski@intel.com>
Link: https://lore.kernel.org/r/20220331135246.993089-10-cezary.rojewski@intel.com
Signed-off-by: Mark Brown <broonie@kernel.org>
2 years agoASoC: Intel: avs: Support link_mask formatted string
Cezary Rojewski [Thu, 31 Mar 2022 13:52:40 +0000 (15:52 +0200)]
ASoC: Intel: avs: Support link_mask formatted string

Allow topology to specify formatted strings so machine board's
predefined ->link_mask can be used to specify SSP port number
automatically.

This is done to help reduce the amount of topology files as many I2S
configurations contain codec of the same type with little to no
differences in number of scenarios supported - the only difference being
the port number codec is connected to.

Signed-off-by: Amadeusz Sławiński <amadeuszx.slawinski@linux.intel.com>
Signed-off-by: Cezary Rojewski <cezary.rojewski@intel.com>
Link: https://lore.kernel.org/r/20220331135246.993089-9-cezary.rojewski@intel.com
Signed-off-by: Mark Brown <broonie@kernel.org>
2 years agoASoC: Intel: avs: Add topology loading operations
Cezary Rojewski [Thu, 31 Mar 2022 13:52:39 +0000 (15:52 +0200)]
ASoC: Intel: avs: Add topology loading operations

AVS topology is split into two major parts: dictionaries - found within
ASoC topology manifest - and path templates.

Add custom handlers for a range of operations available in struct
snd_soc_tplg_ops to allow for actually loading the topology file.

Signed-off-by: Amadeusz Sławiński <amadeuszx.slawinski@linux.intel.com>
Signed-off-by: Cezary Rojewski <cezary.rojewski@intel.com>
Link: https://lore.kernel.org/r/20220331135246.993089-8-cezary.rojewski@intel.com
Signed-off-by: Mark Brown <broonie@kernel.org>
2 years agoASoC: Intel: avs: Parse path and path templates tuples
Cezary Rojewski [Thu, 31 Mar 2022 13:52:38 +0000 (15:52 +0200)]
ASoC: Intel: avs: Parse path and path templates tuples

Path template is similar to path description found in skylake-driver
and it describes how given path shall look like in runtime - number of
modules and pipelines that shape it and how they are laid out. It is
tied to DAPM widget's (representing either a FE or a BE) private data.

Depending on the number of audio formats supported, each path template
may carry one or more descriptions of given path. During runtime, when
audio format is known, description matching said format is selected and
used when instantiating path on ADSP firmware side through IPCs.

Add parsing helpers to support loading such information from the
topology file.

Signed-off-by: Amadeusz Sławiński <amadeuszx.slawinski@linux.intel.com>
Signed-off-by: Cezary Rojewski <cezary.rojewski@intel.com>
Link: https://lore.kernel.org/r/20220331135246.993089-7-cezary.rojewski@intel.com
Signed-off-by: Mark Brown <broonie@kernel.org>
2 years agoASoC: Intel: avs: Parse pipeline and module tuples
Cezary Rojewski [Thu, 31 Mar 2022 13:52:37 +0000 (15:52 +0200)]
ASoC: Intel: avs: Parse pipeline and module tuples

Shape of a path on DSP side, that is, the number and the layout of its
pipelines and modules is paramount for streaming to be efficient and low
power-consuming. Add parsing helpers to support loading such information
from the topology file.

Signed-off-by: Amadeusz Sławiński <amadeuszx.slawinski@linux.intel.com>
Signed-off-by: Cezary Rojewski <cezary.rojewski@intel.com>
Link: https://lore.kernel.org/r/20220331135246.993089-6-cezary.rojewski@intel.com
Signed-off-by: Mark Brown <broonie@kernel.org>
2 years agoASoC: Intel: avs: Parse pplcfg and binding tuples
Cezary Rojewski [Thu, 31 Mar 2022 13:52:36 +0000 (15:52 +0200)]
ASoC: Intel: avs: Parse pplcfg and binding tuples

Path in ADSP firmware is represented by one or more pipelines. Just like
modules, these are described by a config structure. Add parsing helpers
to support loading such information from the topology file.

Signed-off-by: Amadeusz Sławiński <amadeuszx.slawinski@linux.intel.com>
Signed-off-by: Cezary Rojewski <cezary.rojewski@intel.com>
Link: https://lore.kernel.org/r/20220331135246.993089-5-cezary.rojewski@intel.com
Signed-off-by: Mark Brown <broonie@kernel.org>
2 years agoASoC: Intel: avs: Parse module-extension tuples
Cezary Rojewski [Thu, 31 Mar 2022 13:52:35 +0000 (15:52 +0200)]
ASoC: Intel: avs: Parse module-extension tuples

Anything that goes beyond module base config is an extension config. It
covers all fields for all specific module types available in ADSP
firmware. Add parsing helpers to support loading such information from
the topology file.

Signed-off-by: Amadeusz Sławiński <amadeuszx.slawinski@linux.intel.com>
Signed-off-by: Cezary Rojewski <cezary.rojewski@intel.com>
Link: https://lore.kernel.org/r/20220331135246.993089-4-cezary.rojewski@intel.com
Signed-off-by: Mark Brown <broonie@kernel.org>
2 years agoASoC: Intel: avs: Add topology parsing infrastructure
Cezary Rojewski [Thu, 31 Mar 2022 13:52:34 +0000 (15:52 +0200)]
ASoC: Intel: avs: Add topology parsing infrastructure

AVS topology is split into two major parts: dictionaries - found within
ASoC topology manifest - and path templates.

Dictionaries job is to reduce the total amount of memory
occupied by topology elements. Rather than having every pipeline and
module carry its own information, each refers to specific entry in
specific dictionary by provided (from topology file) indexes. In
consequence, most struct avs_tplg_xxx are made out of pointers.

To support the above, range of parsing helpers for all value-types known
to ALSA: uuid, bool, byte, short, word and string are added. Additional
handlers help translate pointer-types and more complex objects such as
audio formats and module base configs.

Path templates are similar to path descriptions found in skylake-driver
and they describe how given path shall look like in runtime - number of
modules and pipelines that shape it and how they are laid out.

Signed-off-by: Amadeusz Sławiński <amadeuszx.slawinski@linux.intel.com>
Signed-off-by: Cezary Rojewski <cezary.rojewski@intel.com>
Link: https://lore.kernel.org/r/20220331135246.993089-3-cezary.rojewski@intel.com
Signed-off-by: Mark Brown <broonie@kernel.org>
2 years agoASoC: Intel: avs: Declare vendor tokens
Cezary Rojewski [Thu, 31 Mar 2022 13:52:33 +0000 (15:52 +0200)]
ASoC: Intel: avs: Declare vendor tokens

Expose all vendor tokens that help shape AVS topology. Parsing helpers
introduced in follow up patches make use of these to know which block
they are currently dealing with and to verify their correctness.

Signed-off-by: Amadeusz Sławiński <amadeuszx.slawinski@linux.intel.com>
Signed-off-by: Cezary Rojewski <cezary.rojewski@intel.com>
Link: https://lore.kernel.org/r/20220331135246.993089-2-cezary.rojewski@intel.com
Signed-off-by: Mark Brown <broonie@kernel.org>
2 years agoASoC: SOF: Intel: add IP identifier
Pierre-Louis Bossart [Thu, 14 Apr 2022 18:48:17 +0000 (13:48 -0500)]
ASoC: SOF: Intel: add IP identifier

This patch adds an IP identifier for each Intel platform. The
identifier will be used to select different code branches or
constants.

Signed-off-by: Pierre-Louis Bossart <pierre-louis.bossart@linux.intel.com>
Reviewed-by: Péter Ujfalusi <peter.ujfalusi@linux.intel.com>
Reviewed-by: Ranjani Sridharan <ranjani.sridharan@linux.intel.com>
Link: https://lore.kernel.org/r/20220414184817.362215-16-pierre-louis.bossart@linux.intel.com
Signed-off-by: Mark Brown <broonie@kernel.org>
2 years agoASoC: SOF: Intel: hda: expose some codeloader functions
Ranjani Sridharan [Thu, 14 Apr 2022 18:48:16 +0000 (13:48 -0500)]
ASoC: SOF: Intel: hda: expose some codeloader functions

Expose the code loader functions for re-use in new platforms

Signed-off-by: Ranjani Sridharan <ranjani.sridharan@linux.intel.com>
Signed-off-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/20220414184817.362215-15-pierre-louis.bossart@linux.intel.com
Signed-off-by: Mark Brown <broonie@kernel.org>
2 years agoASoC: SOF: Intel: hda: Define rom_status_reg in sof_intel_dsp_desc
Ranjani Sridharan [Thu, 14 Apr 2022 18:48:15 +0000 (13:48 -0500)]
ASoC: SOF: Intel: hda: Define rom_status_reg in sof_intel_dsp_desc

Add the rom_status_reg field to struct sof_intel_dsp_desc and define
it for HDA platforms. This will be used to check the ROM status during
FW boot.

Signed-off-by: Ranjani Sridharan <ranjani.sridharan@linux.intel.com>
Signed-off-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/20220414184817.362215-14-pierre-louis.bossart@linux.intel.com
Signed-off-by: Mark Brown <broonie@kernel.org>
2 years agoASoC: SOF: Intel: hda: define check_ipc_irq op
Ranjani Sridharan [Thu, 14 Apr 2022 18:48:14 +0000 (13:48 -0500)]
ASoC: SOF: Intel: hda: define check_ipc_irq op

Define the check_ipc_irq op for HDA platforms and use it
when checking if it is an IPC IRQ.

Signed-off-by: Ranjani Sridharan <ranjani.sridharan@linux.intel.com>
Signed-off-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/20220414184817.362215-13-pierre-louis.bossart@linux.intel.com
Signed-off-by: Mark Brown <broonie@kernel.org>
2 years agoASoC: SOF: Intel: hda: use BIT() macros for consistency
Pierre-Louis Bossart [Thu, 14 Apr 2022 18:48:13 +0000 (13:48 -0500)]
ASoC: SOF: Intel: hda: use BIT() macros for consistency

BIT() macros should be used for all ADSPIC/IS registers.

Signed-off-by: Pierre-Louis Bossart <pierre-louis.bossart@linux.intel.com>
Reviewed-by: Péter Ujfalusi <peter.ujfalusi@linux.intel.com>
Reviewed-by: Ranjani Sridharan <ranjani.sridharan@linux.intel.com>
Link: https://lore.kernel.org/r/20220414184817.362215-12-pierre-louis.bossart@linux.intel.com
Signed-off-by: Mark Brown <broonie@kernel.org>
2 years agoASoC: SOF: Intel: move HDA_CL_STREAM_FORMAT definition to header
Ranjani Sridharan [Thu, 14 Apr 2022 18:48:12 +0000 (13:48 -0500)]
ASoC: SOF: Intel: move HDA_CL_STREAM_FORMAT definition to header

Use the definition of the HDA_CL_STREAM_FORMAT macro from the header
file.

Signed-off-by: Ranjani Sridharan <ranjani.sridharan@linux.intel.com>
Signed-off-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/20220414184817.362215-11-pierre-louis.bossart@linux.intel.com
Signed-off-by: Mark Brown <broonie@kernel.org>
2 years agoASoC: SOF: Intel: hda: use common ops across platforms
Pierre-Louis Bossart [Thu, 14 Apr 2022 18:48:11 +0000 (13:48 -0500)]
ASoC: SOF: Intel: hda: use common ops across platforms

The dsp_ops are mostly common between platforms. Introduce a common
structure and an init function to set platform-specific values.

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>
Reviewed-by: Kai Vehmanen <kai.vehmanen@linux.intel.com>
Reviewed-by: Rander Wang <rander.wang@intel.com>
Reviewed-by: Bard Liao <yung-chuan.liao@linux.intel.com>
Link: https://lore.kernel.org/r/20220414184817.362215-10-pierre-louis.bossart@linux.intel.com
Signed-off-by: Mark Brown <broonie@kernel.org>
2 years agoASoC: SOF: remove const qualifier for 'struct snd_sof_dsp_ops'
Pierre-Louis Bossart [Thu, 14 Apr 2022 18:48:10 +0000 (13:48 -0500)]
ASoC: SOF: remove const qualifier for 'struct snd_sof_dsp_ops'

Now that we start having multiple platforms with minor variants, the
use of the const qualifier for 'dsp_ops' is starting to be
sub-optimal: the structures are copied across platforms, with only a
couple of members that differ.

This patch removes the const qualifier without any functionality
changes, and adds an optional initialization callback. In follow-up
patches, the dsp_ops will revisited for Intel HDaudio platforms, with
the differences added programmatically over a common baseline.

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>
Reviewed-by: Kai Vehmanen <kai.vehmanen@linux.intel.com>
Reviewed-by: Rander Wang <rander.wang@intel.com>
Reviewed-by: Bard Liao <yung-chuan.liao@linux.intel.com>
Link: https://lore.kernel.org/r/20220414184817.362215-9-pierre-louis.bossart@linux.intel.com
Signed-off-by: Mark Brown <broonie@kernel.org>
2 years agoASoC: SOF: sof-audio: preserve topology filename override in nocodec mode
Pierre-Louis Bossart [Thu, 14 Apr 2022 18:48:09 +0000 (13:48 -0500)]
ASoC: SOF: sof-audio: preserve topology filename override in nocodec mode

If the topology filename is modified at a higher level, be it with a
DMI quirk or a kernel module parameter, we don't want to use the
default 'nocodec' topology name extracted from descriptors.

Signed-off-by: Pierre-Louis Bossart <pierre-louis.bossart@linux.intel.com>
Reviewed-by: Ranjani Sridharan <ranjani.sridharan@linux.intel.com>
Reviewed-by: Daniel Baluta <daniel.baluta@nxp.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/20220414184817.362215-8-pierre-louis.bossart@linux.intel.com
Signed-off-by: Mark Brown <broonie@kernel.org>
2 years agoASoC: SOF: sof-pci-dev: add parameter to override topology filename
Pierre-Louis Bossart [Thu, 14 Apr 2022 18:48:08 +0000 (13:48 -0500)]
ASoC: SOF: sof-pci-dev: add parameter to override topology filename

The existing 'tplg_path' module parameter can be used to load
alternate firmware files, be it for development or to handle
OEM-specific or board-specific releases. However the topology filename
is either hard-coded in machine descriptors or modified by specific
DMI-quirks.

For additional flexibility, this patch adds the 'tplg_filename' module
parameter to override topology names.

To avoid any confusion between DMI- and parameter-override, a variable
rename is added.

Signed-off-by: Pierre-Louis Bossart <pierre-louis.bossart@linux.intel.com>
Reviewed-by: Ranjani Sridharan <ranjani.sridharan@linux.intel.com>
Reviewed-by: Daniel Baluta <daniel.baluta@nxp.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/20220414184817.362215-7-pierre-louis.bossart@linux.intel.com
Signed-off-by: Mark Brown <broonie@kernel.org>
2 years agoASoC: SOF: sof-pci-dev: add parameter to override firmware filename
Pierre-Louis Bossart [Thu, 14 Apr 2022 18:48:07 +0000 (13:48 -0500)]
ASoC: SOF: sof-pci-dev: add parameter to override firmware filename

The existing 'fw_path' module parameter can be used to load alternate
firmware files, be it for development or to handle OEM-specific or
board-specific releases. The firmware name is however non-modifiable
and defined by platform-specific descriptors.

For additional flexibility during development or enable quirks, this
patch adds the 'fw_filename' module parameter to override default
firmware names.

Signed-off-by: Pierre-Louis Bossart <pierre-louis.bossart@linux.intel.com>
Reviewed-by: Ranjani Sridharan <ranjani.sridharan@linux.intel.com>
Reviewed-by: Daniel Baluta <daniel.baluta@nxp.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/20220414184817.362215-6-pierre-louis.bossart@linux.intel.com
Signed-off-by: Mark Brown <broonie@kernel.org>
2 years agoASoC: SOF: add IPC-dependent file names
Pierre-Louis Bossart [Thu, 14 Apr 2022 18:48:06 +0000 (13:48 -0500)]
ASoC: SOF: add IPC-dependent file names

To avoid misleading file names, use different names for INTEL_IPC4
firmware files.

Signed-off-by: Pierre-Louis Bossart <pierre-louis.bossart@linux.intel.com>
Reviewed-by: Bard Liao <yung-chuan.liao@linux.intel.com>
Reviewed-by: Rander Wang <rander.wang@intel.com>
Reviewed-by: Péter Ujfalusi <peter.ujfalusi@linux.intel.com>
Reviewed-by: Chao Song <chao.song@intel.com>
Link: https://lore.kernel.org/r/20220414184817.362215-5-pierre-louis.bossart@linux.intel.com
Signed-off-by: Mark Brown <broonie@kernel.org>
2 years agoASoC: SOF: add default IPC capability and file paths
Pierre-Louis Bossart [Thu, 14 Apr 2022 18:48:05 +0000 (13:48 -0500)]
ASoC: SOF: add default IPC capability and file paths

This patch adds a default IPC type for each platform, along with file
paths to be used for each IPC type. To make reviews simpler, we only
modify platform descriptors in this table, the information will be
used in the next patch.

The Intel IPCv4 is only supported on Intel platforms after APL, and
not by default. In follow-up patches, support for SKL and KBL will be
added, and in those two cases the IPCv4 will be the default (and only
supported mode).

Signed-off-by: Pierre-Louis Bossart <pierre-louis.bossart@linux.intel.com>
Reviewed-by: Bard Liao <yung-chuan.liao@linux.intel.com>
Reviewed-by: Rander Wang <rander.wang@intel.com>
Reviewed-by: Péter Ujfalusi <peter.ujfalusi@linux.intel.com>
Link: https://lore.kernel.org/r/20220414184817.362215-4-pierre-louis.bossart@linux.intel.com
Signed-off-by: Mark Brown <broonie@kernel.org>
2 years agoASoC: SOF: add path indirection to each IPC type
Pierre-Louis Bossart [Thu, 14 Apr 2022 18:48:04 +0000 (13:48 -0500)]
ASoC: SOF: add path indirection to each IPC type

With the addition of the IPCv4, we need the ability to select
different paths for firmware and topologies.

First add an indirection. Follow-up patches will add mechanisms to
select a default IPC or override it.

No functionality change in this patch.

Signed-off-by: Pierre-Louis Bossart <pierre-louis.bossart@linux.intel.com>
Reviewed-by: Bard Liao <yung-chuan.liao@linux.intel.com>
Reviewed-by: Rander Wang <rander.wang@intel.com>
Reviewed-by: Péter Ujfalusi <peter.ujfalusi@linux.intel.com>
Link: https://lore.kernel.org/r/20220414184817.362215-3-pierre-louis.bossart@linux.intel.com
Signed-off-by: Mark Brown <broonie@kernel.org>
2 years agoASoC: SOF: add definitions for different IPC types
Pierre-Louis Bossart [Thu, 14 Apr 2022 18:48:03 +0000 (13:48 -0500)]
ASoC: SOF: add definitions for different IPC types

Add enum type to allow for different types of IPCs. The IPCv4 is
intended for Intel only as a convergence path with firmware used in
Windows. Follow-up patches will introduce different abstractions with
.ops and different search paths for firmware and topology files.

Signed-off-by: Pierre-Louis Bossart <pierre-louis.bossart@linux.intel.com>
Reviewed-by: Bard Liao <yung-chuan.liao@linux.intel.com>
Reviewed-by: Rander Wang <rander.wang@intel.com>
Reviewed-by: Péter Ujfalusi <peter.ujfalusi@linux.intel.com>
Link: https://lore.kernel.org/r/20220414184817.362215-2-pierre-louis.bossart@linux.intel.com
Signed-off-by: Mark Brown <broonie@kernel.org>
2 years agoASoC: soc-card: Create jack kcontrol without pins
Akihiko Odaki [Fri, 8 Apr 2022 04:11:14 +0000 (13:11 +0900)]
ASoC: soc-card: Create jack kcontrol without pins

snd_soc_card_jack_new() allowed to create jack kcontrol without pins,
but did not create kcontrols. The jack would not have kcontrols if pins
were not going to be added.

This renames the old snd_soc_card_jack_new() to
snd_soc_card_jack_new_pins() for use when pins are provided or will be
added later. The new snd_soc_card_jack_new() appropriately creates a
jack for use without pins and adds a kcontrol.

Signed-off-by: Akihiko Odaki <akihiko.odaki@gmail.com>
Link: https://lore.kernel.org/r/20220408041114.6024-1-akihiko.odaki@gmail.com
Signed-off-by: Mark Brown <broonie@kernel.org>
2 years agoASoC: SOF: Intel: Check the bar size before remapping
Zheyu Ma [Sat, 9 Apr 2022 14:39:50 +0000 (22:39 +0800)]
ASoC: SOF: Intel: Check the bar size before remapping

The driver should use the pci_resource_len() to get the actual length of
pci bar, and compare it with the expect value. If the bar size is too
small (such as a broken device), the driver should return an error.

Signed-off-by: Zheyu Ma <zheyuma97@gmail.com>
Link: https://lore.kernel.org/r/20220409143950.2570186-1-zheyuma97@gmail.com
Signed-off-by: Mark Brown <broonie@kernel.org>
2 years agoASoC: ti: osk5912: Make it CCF clk API compatible
Janusz Krzysztofik [Thu, 7 Apr 2022 19:12:02 +0000 (21:12 +0200)]
ASoC: ti: osk5912: Make it CCF clk API compatible

The driver, OMAP1 specific, now omits clk_prepare/unprepare() steps, not
supported by OMAP1 custom implementation of clock API.  However, non-CCF
stubs of those functions exist for use on such platforms until converted
to CCF.

Update the driver to be compatible with CCF implementation of clock API.

Signed-off-by: Janusz Krzysztofik <jmkrzyszt@gmail.com>
Acked-by: Peter Ujfalusi <peter.ujfalusi@gmail.com>
Link: https://lore.kernel.org/r/20220407191202.46206-1-jmkrzyszt@gmail.com
Signed-off-by: Mark Brown <broonie@kernel.org>
2 years agoASoC: fsl: using pm_runtime_resume_and_get instead of pm_runtime_get_sync
Minghao Chi [Tue, 12 Apr 2022 08:30:00 +0000 (08:30 +0000)]
ASoC: fsl: using pm_runtime_resume_and_get instead of pm_runtime_get_sync

Using pm_runtime_resume_and_get is more appropriate
for simplifing code

Reported-by: Zeal Robot <zealci@zte.com.cn>
Signed-off-by: Minghao Chi <chi.minghao@zte.com.cn>
Acked-by: Shengjiu Wang <shengjiu.wang@gmail.com>
Link: https://lore.kernel.org/r/20220412083000.2532711-1-chi.minghao@zte.com.cn
Signed-off-by: Mark Brown <broonie@kernel.org>
2 years agoASoC: fix invalid yaml
Corentin Labbe [Mon, 11 Apr 2022 19:44:09 +0000 (19:44 +0000)]
ASoC: fix invalid yaml

The word "or" is useless and breaks yaml validation.

Signed-off-by: Corentin Labbe <clabbe@baylibre.com>
Link: https://lore.kernel.org/r/20220411194409.3390002-1-clabbe@baylibre.com
Signed-off-by: Mark Brown <broonie@kernel.org>
2 years agoASoC: remaining simple i2c probe changes
Mark Brown [Tue, 12 Apr 2022 16:16:54 +0000 (17:16 +0100)]
ASoC: remaining simple i2c probe changes

Merge series from Stephen Kitt <steve@sk2.org>:

This series covers all the remaining changes to migrate
sound/soc/codecs i2c probes to probe_new, where the const struct
i2c_client * argument is unused; there are a few remaining files which
use the argument and will need i2c_match_id migration.

2 years agoASoC: SOF: Abstractions for top-level IPC ops
Mark Brown [Tue, 12 Apr 2022 16:16:52 +0000 (17:16 +0100)]
ASoC: SOF: Abstractions for top-level IPC ops

Merge series from Ranjani Sridharan <ranjani.sridharan@linux.intel.com>:

This series is continuation of the IPC abstraction in the SOF driver in
preparation for supporting the new IPC supported by the SOF firmware.
It introduces abstraction for top-level IPC ops for sending/receiving
regular and large IPC's.

Peter Ujfalusi (15):
  ASoC: SOF: Add helper function to prepare and send an IPC message
  ASoC: SOF: Add high level IPC IO callback definitions to ipc_ops
  ASoC: SOF: ipc3: Implement the tx_msg IPC ops
  ASoC: SOF: ipc3: Use sof_ipc3_tx_msg() internally for message sending
  ASoC: SOF: ipc3: Implement the set_get_data IPC ops
  ASoC: SOF: ipc3: Implement the get_reply IPC ops
  ASoC: SOF: ipc3: Implement rx_msg IPC ops
  ASoC: SOF: ipc: Separate the ops checks by functions/topics
  ASoC: SOF: ipc: Add check for mandatory IPC message handling ops
  ASoC: SOF: ipc: Use the get_reply ops in snd_sof_ipc_get_reply()
  ASoC: SOF: ipc: Switch over to use the tx_msg and set_get_data ops
  ASoC: SOF: ipc: Switch over to use the rx_msg ops
  ASoC: SOF: Add widget_kcontrol_setup control ops for IPC3
  ASoC: SOF: sof-audio: Use the widget_kcontrol_setup ops for kcontrol
    set up
  ASoC: SOF: ipc: Move the ipc_set_get_comp_data() local to ipc3-control

 sound/soc/sof/ipc.c          | 858 ++---------------------------------
 sound/soc/sof/ipc3-control.c | 131 +++++-
 sound/soc/sof/ipc3.c         | 682 +++++++++++++++++++++++++++-
 sound/soc/sof/sof-audio.c    |  54 +--
 sound/soc/sof/sof-audio.h    |   7 +-
 sound/soc/sof/sof-priv.h     |  28 +-
 6 files changed, 880 insertions(+), 880 deletions(-)

--
2.25.1

2 years agoAllow detecting ACP6x DMIC via _DSD
Mark Brown [Tue, 12 Apr 2022 16:16:51 +0000 (17:16 +0100)]
Allow detecting ACP6x DMIC via _DSD

Merge series from Mario Limonciello <mario.limonciello@amd.com>:

It's not possible to probe for the presence of a DMIC, so the ACP6x
machine driver currently has a hardcoded list of all the systems known
to have a DMIC connected to the ACP.

Although this design works it means that the acp6x driver needs to always
grow with more systems and worse, if an OEM introduces a new system there
will be a mismatch in time that even if the driver (otherwise) works fine
it needs their system added to the list to work.

So this series introduces a _DSD that OEMs can populate into the BIOS to
indicate presence of a DMIC.

2 years agoASoC: cs35l45: Make exports namespaced
Richard Fitzgerald [Mon, 11 Apr 2022 16:59:29 +0000 (17:59 +0100)]
ASoC: cs35l45: Make exports namespaced

Use the new EXPORT_SYMBOL_NS_GPL() for exports from the set of
drivers for cs35l45.

Signed-off-by: Richard Fitzgerald <rf@opensource.cirrus.com>
Link: https://lore.kernel.org/r/20220411165929.1302333-1-rf@opensource.cirrus.com
Signed-off-by: Mark Brown <broonie@kernel.org>
2 years agoASoC: tegra186_asrc: mark runtime-pm functions as __maybe_unused
YueHaibing [Mon, 11 Apr 2022 02:09:08 +0000 (10:09 +0800)]
ASoC: tegra186_asrc: mark runtime-pm functions as __maybe_unused

sound/soc/tegra/tegra186_asrc.c:90:12: error: ‘tegra186_asrc_runtime_resume’ defined but not used [-Werror=unused-function]
 static int tegra186_asrc_runtime_resume(struct device *dev)
            ^~~~~~~~~~~~~~~~~~~~~~~~~~~~
sound/soc/tegra/tegra186_asrc.c:80:12: error: ‘tegra186_asrc_runtime_suspend’ defined but not used [-Werror=unused-function]
 static int tegra186_asrc_runtime_suspend(struct device *dev)
            ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~

Mark these functions as __maybe_unused to avoid this kind of warning.

Fixes: a2df8c2d5b36 ("ASoC: tegra: Add Tegra186 based ASRC driver")
Signed-off-by: YueHaibing <yuehaibing@huawei.com>
Reviewed-by: Sameer Pujar <spujar@nvidia.com>
Link: https://lore.kernel.org/r/20220411020908.580-1-yuehaibing@huawei.com
Signed-off-by: Mark Brown <broonie@kernel.org>
2 years agoASoC: amd: yc: add new YC platform varaint support
Vijendar Mukunda [Mon, 11 Apr 2022 13:41:15 +0000 (19:11 +0530)]
ASoC: amd: yc: add new YC platform varaint support

Update PCI revision id check for the new YC platform varaint.

Signed-off-by: Vijendar Mukunda <Vijendar.Mukunda@amd.com>
Link: https://lore.kernel.org/r/20220411134119.1767646-1-Vijendar.Mukunda@amd.com
Signed-off-by: Mark Brown <broonie@kernel.org>
2 years agoASoC: uda1380: use simple i2c probe function
Stephen Kitt [Tue, 5 Apr 2022 16:58:36 +0000 (18:58 +0200)]
ASoC: uda1380: use simple i2c probe function

The i2c probe functions here don't use the id information provided in
their second argument, so the single-parameter i2c probe function
("probe_new") can be used instead.

This avoids scanning the identifier tables during probes.

Signed-off-by: Stephen Kitt <steve@sk2.org>
Link: https://lore.kernel.org/r/20220405165836.2165310-15-steve@sk2.org
Signed-off-by: Mark Brown <broonie@kernel.org>