platform/kernel/linux-rpi.git
3 years agoASoC: rsnd: call rsnd_ssi_master_clk_start() from rsnd_ssi_init()
Kuninori Morimoto [Thu, 8 Apr 2021 04:28:38 +0000 (13:28 +0900)]
ASoC: rsnd: call rsnd_ssi_master_clk_start() from rsnd_ssi_init()

Current rsnd needs to call .prepare (P) for clock settings,
.trigger for playback start (S) and stop (E).
It should be called as below from SSI point of view.

P -> S -> E -> P -> S -> E -> ...

But, if you used MIXer, below case might happen

              (2)
1: P -> S ---> E -> ...
2:         P ----> S -> ...
          (1)     (3)

P(1) setups clock, but E(2) resets it. and starts playback (3).
In such case, it will reports "SSI parent/child should use same rate".

rsnd_ssi_master_clk_start() which is the main function at (P)
was called from rsnd_ssi_init() (= S) before,
but was moved by below patch to rsnd_soc_dai_prepare() (= P) to avoid
using clk_get_rate() which shouldn't be used under atomic context.

commit 4d230d1271064 ("ASoC: rsnd: fixup not to call clk_get/set
under non-atomic")

Because of above patch, rsnd_ssi_master_clk_start() is now called at (P)
which is for non atomic context. But (P) is assuming that spin lock is
*not* used.
One issue now is rsnd_ssi_master_clk_start() is checking ssi->xxx
which should be protected by spin lock.

After above patch, adg.c had below patch for other reasons.

commit 06e8f5c842f2d ("ASoC: rsnd: don't call clk_get_rate()
under atomic context")

clk_get_rate() is used at probe() timing by this patch.
In other words, rsnd_ssi_master_clk_start() is no longer using
clk_get_rate() any more.

This means we can call it from rsnd_ssi_init() (= S) again which is
protected by spin lock.
This patch re-move it to under spin lock, and solves
1. checking ssi->xxx without spin lock issue.
2. clk setting / device start / device stop race condition.

Reported-by: Linh Phung T. Y. <linh.phung.jy@renesas.com>
Signed-off-by: Kuninori Morimoto <kuninori.morimoto.gx@renesas.com>
Link: https://lore.kernel.org/r/875z0x1jt5.wl-kuninori.morimoto.gx@renesas.com
Signed-off-by: Mark Brown <broonie@kernel.org>
3 years agoASoC: cs35l36: Fix an error handling path in 'cs35l36_i2c_probe()'
Christophe JAILLET [Sun, 11 Apr 2021 12:57:13 +0000 (14:57 +0200)]
ASoC: cs35l36: Fix an error handling path in 'cs35l36_i2c_probe()'

If 'devm_regmap_init_i2c()' fails, there is no need to goto err. We should
return directly as already done by the surrounding error handling paths.

Signed-off-by: Christophe JAILLET <christophe.jaillet@wanadoo.fr>
Link: https://lore.kernel.org/r/9fec48e75bc1d3c92626e6f6aca2344bda223379.1618145790.git.christophe.jaillet@wanadoo.fr
Signed-off-by: Mark Brown <broonie@kernel.org>
3 years agoASoC: cs35l35: Fix an error handling path in 'cs35l35_i2c_probe()'
Christophe JAILLET [Sun, 11 Apr 2021 12:51:06 +0000 (14:51 +0200)]
ASoC: cs35l35: Fix an error handling path in 'cs35l35_i2c_probe()'

If 'devm_regmap_init_i2c()' fails, there is no need to goto err. We should
return directly as already done by the surrounding error handling paths.

Signed-off-by: Christophe JAILLET <christophe.jaillet@wanadoo.fr>
Link: https://lore.kernel.org/r/15720439769ba94ffb65c90217392b0758b08f61.1618145369.git.christophe.jaillet@wanadoo.fr
Signed-off-by: Mark Brown <broonie@kernel.org>
3 years agoMerge series "ASoC: simple-card-utils: prepare for multi support" from Kuninori Morim...
Mark Brown [Tue, 13 Apr 2021 13:11:53 +0000 (14:11 +0100)]
Merge series "ASoC: simple-card-utils: prepare for multi support" from Kuninori Morimoto <kuninori.morimoto.gx@renesas.com>:

Hi Mark

This patch-set is for v2 of Multi-CPU/Codec support,
and some cleanups.
v1 had patch-conflict on simple-card / audio-graph with below.
v2 was solved it.

fa74c223b6fd78a5314b4c61b9abdbed3c2185b4
("ASoC: simple-card: fix possible uninitialized single_cpu local variable")

I want to add new audio-graph-card2 driver which can support
not only DPCM, but also Multi-CPU/Codec, and Codec2Codec.
And it is also supporting audio-graph-card2 base custom driver.

But before supporting such driver, we need to cleanup existing
simple-card / audio-graph, because these and new driver are
sharing code.

Link: https://lore.kernel.org/r/87wntmod33.wl-kuninori.morimoto.gx@renesas.com
Link: https://lore.kernel.org/r/20210408141639.GA39604@sirena.org.uk
Kuninori Morimoto (12):
  ASoC: simple-card-utils: setup dai_props cpu_dai/codec_dai at initial timing
  ASoC: simple-card-utils: remove li->dais/li->conf
  ASoC: simple-card-utils: use for_each_prop_xxx()
  ASoC: simple-card-utils: remove asoc_simple_parse_xxx()
  ASoC: simple-card-utils: care multi DAI at asoc_simple_clean_reference()
  ASoC: simple-card-utils: indicate dai_fmt if exist
  ASoC: simple-card-utils: indicate missing CPU/Codec numbers for debug
  ASoC: simple-card-utils: add simple_props_to_xxx() macro
  ASoC: simple-card-utils: multi support at asoc_simple_canonicalize_cpu/platform()
  ASoC: simple-card-utils: tidyup debug info for clock
  ASoC: simple-card-utils: tidyup dev_dbg() to use 1 line
  ASoC: simple-card-utils: tidyup asoc_simple_parse_convert()

 include/sound/simple_card_utils.h     | 107 ++++++++++------
 sound/soc/generic/audio-graph-card.c  |  64 ++++------
 sound/soc/generic/simple-card-utils.c | 174 ++++++++++++++++----------
 sound/soc/generic/simple-card.c       |  70 ++++-------
 4 files changed, 226 insertions(+), 189 deletions(-)

--
2.25.1

3 years agoASoC: sti: sti_uniperif: add missing MODULE_DEVICE_TABLE
Chen Lifu [Fri, 9 Apr 2021 01:59:53 +0000 (09:59 +0800)]
ASoC: sti: sti_uniperif: add missing MODULE_DEVICE_TABLE

This patch adds missing MODULE_DEVICE_TABLE definition which generates
correct modalias for automatic loading of this driver when it is built
as an external module.

Reported-by: Hulk Robot <hulkci@huawei.com>
Signed-off-by: Chen Lifu <chenlifu@huawei.com>
Reviewed-by: Arnaud Pouliquen <arnaud.pouliquen@st.com>
Link: https://lore.kernel.org/r/20210409015953.259688-1-chenlifu@huawei.com
Signed-off-by: Mark Brown <broonie@kernel.org>
3 years agoASoC: simple-card-utils: tidyup asoc_simple_parse_convert()
Kuninori Morimoto [Sun, 11 Apr 2021 23:53:00 +0000 (08:53 +0900)]
ASoC: simple-card-utils: tidyup asoc_simple_parse_convert()

dev is not used. This patch removes it.

Signed-off-by: Kuninori Morimoto <kuninori.morimoto.gx@renesas.com>
Link: https://lore.kernel.org/r/87eefgwf8j.wl-kuninori.morimoto.gx@renesas.com
Signed-off-by: Mark Brown <broonie@kernel.org>
3 years agoASoC: simple-card-utils: tidyup dev_dbg() to use 1 line
Kuninori Morimoto [Sun, 11 Apr 2021 23:52:55 +0000 (08:52 +0900)]
ASoC: simple-card-utils: tidyup dev_dbg() to use 1 line

We can use 100 char now for 1 line.
This patch tidyup unreadable dev_dbg() message.

Signed-off-by: Kuninori Morimoto <kuninori.morimoto.gx@renesas.com>
Link: https://lore.kernel.org/r/87fszwwf8o.wl-kuninori.morimoto.gx@renesas.com
Signed-off-by: Mark Brown <broonie@kernel.org>
3 years agoASoC: simple-card-utils: tidyup debug info for clock
Kuninori Morimoto [Sun, 11 Apr 2021 23:52:50 +0000 (08:52 +0900)]
ASoC: simple-card-utils: tidyup debug info for clock

simple-card / audio-graph can use clock as dai->clk or dai->sysclk.
These related information should be indicated at same position.
This patch tidyup it.

Signed-off-by: Kuninori Morimoto <kuninori.morimoto.gx@renesas.com>
Link: https://lore.kernel.org/r/87h7kcwf8t.wl-kuninori.morimoto.gx@renesas.com
Signed-off-by: Mark Brown <broonie@kernel.org>
3 years agoASoC: simple-card-utils: multi support at asoc_simple_canonicalize_cpu/platform()
Kuninori Morimoto [Sun, 11 Apr 2021 23:52:45 +0000 (08:52 +0900)]
ASoC: simple-card-utils: multi support at asoc_simple_canonicalize_cpu/platform()

Current asoc_simple_canonicalize_cpu/platform() is assuming single CPU,
single Platform, but we want to support Multi support.
This patch is prepare for it.

Signed-off-by: Kuninori Morimoto <kuninori.morimoto.gx@renesas.com>
Link: https://lore.kernel.org/r/87im4swf8y.wl-kuninori.morimoto.gx@renesas.com
Signed-off-by: Mark Brown <broonie@kernel.org>
3 years agoASoC: simple-card-utils: add simple_props_to_xxx() macro
Kuninori Morimoto [Sun, 11 Apr 2021 23:52:32 +0000 (08:52 +0900)]
ASoC: simple-card-utils: add simple_props_to_xxx() macro

We shouldn't use dai_props->cpus/codecs/cpu_dai/codec_dai/codec_conf
directly, because these are array to supporting multi CPU/Codec/Platform.
This patch adds asoc_link_to_xxx() macro for it.

Signed-off-by: Kuninori Morimoto <kuninori.morimoto.gx@renesas.com>
Link: https://lore.kernel.org/r/87k0p8wf9b.wl-kuninori.morimoto.gx@renesas.com
Signed-off-by: Mark Brown <broonie@kernel.org>
3 years agoASoC: simple-card-utils: indicate missing CPU/Codec numbers for debug
Kuninori Morimoto [Sun, 11 Apr 2021 23:52:27 +0000 (08:52 +0900)]
ASoC: simple-card-utils: indicate missing CPU/Codec numbers for debug

Now ALSA is supporting multi-CPU/Codec,
thus, we want to know number of CPU/Codec when debugging.
This patch indicates it.

Signed-off-by: Kuninori Morimoto <kuninori.morimoto.gx@renesas.com>
Link: https://lore.kernel.org/r/87lf9owf9g.wl-kuninori.morimoto.gx@renesas.com
Signed-off-by: Mark Brown <broonie@kernel.org>
3 years agoASoC: simple-card-utils: indicate dai_fmt if exist
Kuninori Morimoto [Sun, 11 Apr 2021 23:52:23 +0000 (08:52 +0900)]
ASoC: simple-card-utils: indicate dai_fmt if exist

link->dai_fmt might be 0.
Don't indicate it in such case when debugging.

Signed-off-by: Kuninori Morimoto <kuninori.morimoto.gx@renesas.com>
Link: https://lore.kernel.org/r/87mtu4wf9k.wl-kuninori.morimoto.gx@renesas.com
Signed-off-by: Mark Brown <broonie@kernel.org>
3 years agoASoC: simple-card-utils: care multi DAI at asoc_simple_clean_reference()
Kuninori Morimoto [Sun, 11 Apr 2021 23:52:18 +0000 (08:52 +0900)]
ASoC: simple-card-utils: care multi DAI at asoc_simple_clean_reference()

ASoC is now supporting multi DAI, but, current
simple-card / audio-graph are assuming fixed single DAI.

This patch cares multi DAI at asoc_simple_clean_reference()
for of_node_put().

Signed-off-by: Kuninori Morimoto <kuninori.morimoto.gx@renesas.com>
Link: https://lore.kernel.org/r/87o8ekwf9p.wl-kuninori.morimoto.gx@renesas.com
Signed-off-by: Mark Brown <broonie@kernel.org>
3 years agoASoC: simple-card-utils: remove asoc_simple_parse_xxx()
Kuninori Morimoto [Sun, 11 Apr 2021 23:52:13 +0000 (08:52 +0900)]
ASoC: simple-card-utils: remove asoc_simple_parse_xxx()

ASoC is now supporting multi DAI, but, current
simple-card / audio-graph are assuming fixed single DAI.

Now, asoc_simple_parse_xxx() macro is assuming single DAI.
To support multi-CPU/Codec, this patch unpack asoc_simple_parse_xxx()
macro, and uses "&dai_link->cpus[i]" instead of "dai_link->cpus".

Signed-off-by: Kuninori Morimoto <kuninori.morimoto.gx@renesas.com>
Link: https://lore.kernel.org/r/87pmz0wf9u.wl-kuninori.morimoto.gx@renesas.com
Signed-off-by: Mark Brown <broonie@kernel.org>
3 years agoASoC: simple-card-utils: use for_each_prop_xxx()
Kuninori Morimoto [Sun, 11 Apr 2021 23:52:09 +0000 (08:52 +0900)]
ASoC: simple-card-utils: use for_each_prop_xxx()

ASoC is now supporting multi DAI, but, current
simple-card / audio-graph are assuming fixed single DAI.

This patch uses for_each_prop_xxx() to support multi DAI.

Signed-off-by: Kuninori Morimoto <kuninori.morimoto.gx@renesas.com>
Link: https://lore.kernel.org/r/87r1jgwf9y.wl-kuninori.morimoto.gx@renesas.com
Signed-off-by: Mark Brown <broonie@kernel.org>
3 years agoASoC: simple-card-utils: remove li->dais/li->conf
Kuninori Morimoto [Sun, 11 Apr 2021 23:52:04 +0000 (08:52 +0900)]
ASoC: simple-card-utils: remove li->dais/li->conf

li->dais is same as number of CPU + Codec,
li->conf is same as number of Codec when dummy-Codec.

li->dais/li->conf are no longer needed.
This patch removes these.

Signed-off-by: Kuninori Morimoto <kuninori.morimoto.gx@renesas.com>
Link: https://lore.kernel.org/r/87sg3wwfa3.wl-kuninori.morimoto.gx@renesas.com
Signed-off-by: Mark Brown <broonie@kernel.org>
3 years agoASoC: simple-card-utils: setup dai_props cpu_dai/codec_dai at initial timing
Kuninori Morimoto [Sun, 11 Apr 2021 23:51:59 +0000 (08:51 +0900)]
ASoC: simple-card-utils: setup dai_props cpu_dai/codec_dai at initial timing

We couldn't setup dai_props cpu_dai/codec_dai at the initial timing,
because "counting DAIs loop" and "detecting DAIs loop" were different.
But we can do it now, because these are using same loops.

This patch setups dai_props cpu_dai/codec_dai at the initial timing.
It can removes triky code from simple-card / audio-graph.

Signed-off-by: Kuninori Morimoto <kuninori.morimoto.gx@renesas.com>
Link: https://lore.kernel.org/r/87tuocwfa8.wl-kuninori.morimoto.gx@renesas.com
Signed-off-by: Mark Brown <broonie@kernel.org>
3 years agoMerge series "ASoC: SOF: Intel: descriptor corrections for TGL and ADL" from Pierre...
Mark Brown [Mon, 12 Apr 2021 18:56:23 +0000 (19:56 +0100)]
Merge series "ASoC: SOF: Intel: descriptor corrections for TGL and ADL" from Pierre-Louis Bossart <pierre-louis.bossart@linux.intel.com>:

One missed property for TigerLake and need for separate descriptors
between ADL-S and the other flavors.

Libin Yang (1):
  ASoC: SOF: Intel: add missing use_acpi_target_states for TGL platforms

Sathya Prakash M R (1):
  ASoC: SOF: Intel: Update ADL P to use its own descriptor

 sound/soc/sof/intel/pci-tgl.c | 20 +++++++++++++++++++-
 sound/soc/sof/intel/tgl.c     |  2 +-
 2 files changed, 20 insertions(+), 2 deletions(-)

--
2.25.1

3 years agoMerge series "ASoC: SOF: simplify probe and report errors" from Ranjani Sridharan...
Mark Brown [Mon, 12 Apr 2021 18:56:22 +0000 (19:56 +0100)]
Merge series "ASoC: SOF: simplify probe and report errors" from Ranjani Sridharan <ranjani.sridharan@linux.intel.com>:

These patches simplify the sof_probe_complete handling and
address reporting of errors during probe.

Peter Ujfalusi (2):
  ASoC: SOF: core: Add missing error prints to device probe operation
  ASoC: SOF: Simplify sof_probe_complete handling for acpi/pci/of

 sound/soc/sof/core.c         |  9 +++++++--
 sound/soc/sof/sof-acpi-dev.c | 18 +++---------------
 sound/soc/sof/sof-of-dev.c   | 18 +++---------------
 sound/soc/sof/sof-pci-dev.c  | 20 ++++----------------
 4 files changed, 17 insertions(+), 48 deletions(-)

--
2.25.1

3 years agoMerge series "ASoC: SOF: simplify nocodec mode" from Ranjani Sridharan <ranjani.sridh...
Mark Brown [Mon, 12 Apr 2021 18:56:21 +0000 (19:56 +0100)]
Merge series "ASoC: SOF: simplify nocodec mode" from Ranjani Sridharan <ranjani.sridharan@linux.intel.com>:

This set of patches simplify the implementation
of nocodec mode in SOF.

Pierre-Louis Bossart (6):
  ASoC: SOF: add Kconfig option for probe workqueues
  ASoC: soc-acpi: add new fields for mach_params
  ASoC: SOF: change signature of set_mach_params() callback
  ASoC: SOF: Intel: update set_mach_params()
  ASoC: SOF: pcm: export snd_pcm_dai_link_fixup
  ASOC: SOF: simplify nocodec mode

 include/sound/soc-acpi.h  |  4 ++++
 include/sound/sof.h       |  3 ---
 sound/soc/sof/Kconfig     | 11 +++++++++++
 sound/soc/sof/intel/bdw.c |  8 ++++++--
 sound/soc/sof/intel/byt.c | 22 +++++++++++++---------
 sound/soc/sof/intel/hda.c |  8 ++++++--
 sound/soc/sof/intel/hda.h |  2 +-
 sound/soc/sof/nocodec.c   | 39 +++++++++++++++++++++------------------
 sound/soc/sof/ops.h       |  6 ++----
 sound/soc/sof/pcm.c       |  1 +
 sound/soc/sof/sof-audio.c | 34 +++++++++++++++-------------------
 sound/soc/sof/sof-priv.h  |  2 +-
 12 files changed, 81 insertions(+), 59 deletions(-)

--
2.25.1

3 years agoASoC: SOF: Intel: Update ADL P to use its own descriptor
Sathya Prakash M R [Mon, 12 Apr 2021 16:15:19 +0000 (11:15 -0500)]
ASoC: SOF: Intel: Update ADL P to use its own descriptor

ADL P has specific machines and hence having its own
table will help separate the machines and FW

Reviewed-by: Bard Liao <bard.liao@intel.com>
Reviewed-by: Kai Vehmanen <kai.vehmanen@linux.intel.com>
Signed-off-by: Sathya Prakash M R <sathya.prakash.m.r@intel.com>
Signed-off-by: Pierre-Louis Bossart <pierre-louis.bossart@linux.intel.com>
Link: https://lore.kernel.org/r/20210412161519.13508-3-pierre-louis.bossart@linux.intel.com
Signed-off-by: Mark Brown <broonie@kernel.org>
3 years agoASoC: SOF: Intel: add missing use_acpi_target_states for TGL platforms
Libin Yang [Mon, 12 Apr 2021 16:15:18 +0000 (11:15 -0500)]
ASoC: SOF: Intel: add missing use_acpi_target_states for TGL platforms

All Intel TigerLake platforms should support the feature of getting
the system state from acpi to deal with S0ix support.

This was missed in previous commits, likely due to copy/paste from
older code.

Reviewed-by: Ranjani Sridharan <ranjani.sridharan@linux.intel.com>
Signed-off-by: Libin Yang <libin.yang@intel.com>
Signed-off-by: Pierre-Louis Bossart <pierre-louis.bossart@linux.intel.com>
Link: https://lore.kernel.org/r/20210412161519.13508-2-pierre-louis.bossart@linux.intel.com
Signed-off-by: Mark Brown <broonie@kernel.org>
3 years agoASoC: SOF: topology: remove useless code
Ranjani Sridharan [Fri, 9 Apr 2021 22:05:22 +0000 (15:05 -0700)]
ASoC: SOF: topology: remove useless code

The patch "ASoC: SOF: Intel: hda: assign link DMA channel at run-time"
fixed the sof_link_hda_unload() to remove the call to the BE
hw_free op but left the rest of code that become redundant.

So, remove sof_link_hda_unload() along with the link_unload() op
entirely as it is not longer needed.

Reported-by: Pierre-Louis Bossart <pierre-louis.bossart@linux.intel.com>
Reviewed-by: Kai Vehmanen <kai.vehmanen@linux.intel.com>
Reviewed-by: Pierre-Louis Bossart <pierre-louis.bossart@linux.intel.com>
Signed-off-by: Ranjani Sridharan <ranjani.sridharan@linux.intel.com>
Link: https://lore.kernel.org/r/20210409220522.1542865-1-ranjani.sridharan@linux.intel.com
Signed-off-by: Mark Brown <broonie@kernel.org>
3 years agoASoC: SOF: Kconfig: fix typo of SND_SOC_SOF_PCI
Libin Yang [Fri, 9 Apr 2021 22:13:08 +0000 (15:13 -0700)]
ASoC: SOF: Kconfig: fix typo of SND_SOC_SOF_PCI

It should be 'endif ## SND_SOC_SOF_PCI' instead of
'endif ## SND_SOC_SOF_INTEL_PCI'

Signed-off-by: Libin Yang <libin.yang@intel.com>
Reviewed-by: Kai Vehmanen <kai.vehmanen@linux.intel.com>
Reviewed-by: Pierre-Louis Bossart <pierre-louis.bossart@linux.intel.com>
Signed-off-by: Ranjani Sridharan <ranjani.sridharan@linux.intel.com>
Link: https://lore.kernel.org/r/20210409221308.1544000-1-ranjani.sridharan@linux.intel.com
Signed-off-by: Mark Brown <broonie@kernel.org>
3 years agoASOC: SOF: simplify nocodec mode
Pierre-Louis Bossart [Fri, 9 Apr 2021 22:01:21 +0000 (15:01 -0700)]
ASOC: SOF: simplify nocodec mode

Replace ugly #if (!IS_ENABLED) by if (!IS_ENABLED), remove
cross-module dependencies and use classic mechanism to pass
information to the machine driver.

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>
Signed-off-by: Ranjani Sridharan <ranjani.sridharan@linux.intel.com>
Link: https://lore.kernel.org/r/20210409220121.1542362-7-ranjani.sridharan@linux.intel.com
Signed-off-by: Mark Brown <broonie@kernel.org>
3 years agoASoC: SOF: pcm: export snd_pcm_dai_link_fixup
Pierre-Louis Bossart [Fri, 9 Apr 2021 22:01:20 +0000 (15:01 -0700)]
ASoC: SOF: pcm: export snd_pcm_dai_link_fixup

In preparation of the nocodec refactoring, export the dai-link
fixup. This will also be required when we have more clients and
platform drivers.

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>
Signed-off-by: Ranjani Sridharan <ranjani.sridharan@linux.intel.com>
Link: https://lore.kernel.org/r/20210409220121.1542362-6-ranjani.sridharan@linux.intel.com
Signed-off-by: Mark Brown <broonie@kernel.org>
3 years agoASoC: SOF: Intel: update set_mach_params()
Pierre-Louis Bossart [Fri, 9 Apr 2021 22:01:19 +0000 (15:01 -0700)]
ASoC: SOF: Intel: update set_mach_params()

Add information for num_dai_drivers and dai_drivers[], which will be
used in the refactored nocodec implementation

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>
Signed-off-by: Ranjani Sridharan <ranjani.sridharan@linux.intel.com>
Link: https://lore.kernel.org/r/20210409220121.1542362-5-ranjani.sridharan@linux.intel.com
Signed-off-by: Mark Brown <broonie@kernel.org>
3 years agoASoC: SOF: change signature of set_mach_params() callback
Pierre-Louis Bossart [Fri, 9 Apr 2021 22:01:18 +0000 (15:01 -0700)]
ASoC: SOF: change signature of set_mach_params() callback

To set additional parameters, we need to have access to sdev, not the
plain vanilla struct device pointer.

No functionality change.

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>
Signed-off-by: Ranjani Sridharan <ranjani.sridharan@linux.intel.com>
Link: https://lore.kernel.org/r/20210409220121.1542362-4-ranjani.sridharan@linux.intel.com
Signed-off-by: Mark Brown <broonie@kernel.org>
3 years agoASoC: soc-acpi: add new fields for mach_params
Pierre-Louis Bossart [Fri, 9 Apr 2021 22:01:17 +0000 (15:01 -0700)]
ASoC: soc-acpi: add new fields for mach_params

We currently have an ugly way of handling the SOF nocodec mode, with
blatant violations between layers. To create the nocodec card, let's
add two new fields and the existing mach_params structure, that way
there will be no differences with regular cards.

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>
Signed-off-by: Ranjani Sridharan <ranjani.sridharan@linux.intel.com>
Link: https://lore.kernel.org/r/20210409220121.1542362-3-ranjani.sridharan@linux.intel.com
Signed-off-by: Mark Brown <broonie@kernel.org>
3 years agoASoC: SOF: add Kconfig option for probe workqueues
Pierre-Louis Bossart [Fri, 9 Apr 2021 22:01:16 +0000 (15:01 -0700)]
ASoC: SOF: add Kconfig option for probe workqueues

The probe workqueue is currently used in the HDaudio case, following
the example of the snd-hda-intel driver.

For development and validation, it's useful to enable the probe
workqueue even with ACPI devices or NOCODEC mode.

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>
Signed-off-by: Ranjani Sridharan <ranjani.sridharan@linux.intel.com>
Link: https://lore.kernel.org/r/20210409220121.1542362-2-ranjani.sridharan@linux.intel.com
Signed-off-by: Mark Brown <broonie@kernel.org>
3 years agoASoC: SOF: Simplify sof_probe_complete handling for acpi/pci/of
Peter Ujfalusi [Fri, 9 Apr 2021 22:09:59 +0000 (15:09 -0700)]
ASoC: SOF: Simplify sof_probe_complete handling for acpi/pci/of

Set the sof_data->sof_probe_complete callback unconditionally of
CONFIG_SND_SOC_SOF_PROBE_WORK_QUEUE.

The sof_probe_complete will be called when the sof_probe_continue()
function is successfully executed, called either directly from
snd_sof_device_probe() or from the scheduled work.

Since all error cases within the call chain of snd_sof_device_probe() have
error prints, there is no need to print again in the acpi/pci/of level.

Signed-off-by: Peter Ujfalusi <peter.ujfalusi@linux.intel.com>
Reviewed-by: Pierre-Louis Bossart <pierre-louis.bossart@linux.intel.com>
Signed-off-by: Ranjani Sridharan <ranjani.sridharan@linux.intel.com>
Link: https://lore.kernel.org/r/20210409220959.1543456-3-ranjani.sridharan@linux.intel.com
Signed-off-by: Mark Brown <broonie@kernel.org>
3 years agoASoC: SOF: core: Add missing error prints to device probe operation
Peter Ujfalusi [Fri, 9 Apr 2021 22:09:58 +0000 (15:09 -0700)]
ASoC: SOF: core: Add missing error prints to device probe operation

Two error cases in snd_sof_device_probe() and sof_probe_continue() are
missing error prints.
If either of them happens it is not possible to identify the reason for the
failure.

Add dev_err() prints for the cases to aim debugging.

Signed-off-by: Peter Ujfalusi <peter.ujfalusi@linux.intel.com>
Reviewed-by: Pierre-Louis Bossart <pierre-louis.bossart@linux.intel.com>
Signed-off-by: Ranjani Sridharan <ranjani.sridharan@linux.intel.com>
Link: https://lore.kernel.org/r/20210409220959.1543456-2-ranjani.sridharan@linux.intel.com
Signed-off-by: Mark Brown <broonie@kernel.org>
3 years agoASoC: amd: Add support for ALC1015P codec in acp3x machine driver
Vijendar Mukunda [Thu, 8 Apr 2021 13:02:36 +0000 (18:32 +0530)]
ASoC: amd: Add support for ALC1015P codec in acp3x machine driver

Add ALC1015p codec support for acp3x machine driver.

Signed-off-by: Vijendar Mukunda <Vijendar.Mukunda@amd.com>
Link: https://lore.kernel.org/r/1617886984-9500-1-git-send-email-Vijendar.Mukunda@amd.com
Signed-off-by: Mark Brown <broonie@kernel.org>
3 years agoASoC: wcd9335: constify static struct snd_soc_dai_ops
Ye Bin [Thu, 8 Apr 2021 06:26:44 +0000 (14:26 +0800)]
ASoC: wcd9335: constify static struct snd_soc_dai_ops

The snd_soc_dai_ops structures is only stored in the ops field of a
snd_soc_dai_driver structure, so make the snd_soc_dai_ops structure
const to allow the compiler to put it in read-only memory.

Reported-by: Hulk Robot <hulkci@huawei.com>
Signed-off-by: Ye Bin <yebin10@huawei.com>
Link: https://lore.kernel.org/r/20210408062644.802988-1-yebin10@huawei.com
Signed-off-by: Mark Brown <broonie@kernel.org>
3 years agoASoC: codecs: lpass-tx-macro: constify static struct snd_soc_dai_ops
Ye Bin [Thu, 8 Apr 2021 06:26:57 +0000 (14:26 +0800)]
ASoC: codecs: lpass-tx-macro: constify static struct snd_soc_dai_ops

The snd_soc_dai_ops structures is only stored in the ops field of a
snd_soc_dai_driver structure, so make the snd_soc_dai_ops structure
const to allow the compiler to put it in read-only memory.

Reported-by: Hulk Robot <hulkci@huawei.com>
Signed-off-by: Ye Bin <yebin10@huawei.com>
Link: https://lore.kernel.org/r/20210408062657.803668-1-yebin10@huawei.com
Signed-off-by: Mark Brown <broonie@kernel.org>
3 years agoASoC: amd: renoir: acp3x-pdm-dma: constify static struct snd_soc_dai_ops
Ye Bin [Thu, 8 Apr 2021 06:26:58 +0000 (14:26 +0800)]
ASoC: amd: renoir: acp3x-pdm-dma: constify static struct snd_soc_dai_ops

The snd_soc_dai_ops structures is only stored in the ops field of a
snd_soc_dai_driver structure, so make the snd_soc_dai_ops structure
const to allow the compiler to put it in read-only memory.

Reported-by: Hulk Robot <hulkci@huawei.com>
Signed-off-by: Ye Bin <yebin10@huawei.com>
Link: https://lore.kernel.org/r/20210408062658.803724-1-yebin10@huawei.com
Signed-off-by: Mark Brown <broonie@kernel.org>
3 years agoASoC: codecs: lpass-wsa-macro: constify static struct snd_soc_dai_ops
Ye Bin [Thu, 8 Apr 2021 06:26:42 +0000 (14:26 +0800)]
ASoC: codecs: lpass-wsa-macro: constify static struct snd_soc_dai_ops

The snd_soc_dai_ops structures is only stored in the ops field of a
snd_soc_dai_driver structure, so make the snd_soc_dai_ops structure
const to allow the compiler to put it in read-only memory.

Reported-by: Hulk Robot <hulkci@huawei.com>
Signed-off-by: Ye Bin <yebin10@huawei.com>
Link: https://lore.kernel.org/r/20210408062642.802846-1-yebin10@huawei.com
Signed-off-by: Mark Brown <broonie@kernel.org>
3 years agoASoC: rt1019: remove registers to sync with rt1019 datasheet
Jack Yu [Fri, 9 Apr 2021 08:52:29 +0000 (08:52 +0000)]
ASoC: rt1019: remove registers to sync with rt1019 datasheet

Remove some registers to synchronize with the latest rt1019 datasheet.

Signed-off-by: Jack Yu <jack.yu@realtek.com>
Link: https://lore.kernel.org/r/01e6409f0db0451aa1e45ca7d82cca9c@realtek.com
Signed-off-by: Mark Brown <broonie@kernel.org>
3 years agoASoC: rt711-sdca: Constify static struct snd_soc_dai_ops
Ye Bin [Thu, 8 Apr 2021 06:26:47 +0000 (14:26 +0800)]
ASoC: rt711-sdca: Constify static struct snd_soc_dai_ops

The snd_soc_dai_ops structures is only stored in the ops field of a
snd_soc_dai_driver structure, so make the snd_soc_dai_ops structure
const to allow the compiler to put it in read-only memory.

Reported-by: Hulk Robot <hulkci@huawei.com>
Signed-off-by: Ye Bin <yebin10@huawei.com>
Link: https://lore.kernel.org/r/20210408062647.803141-1-yebin10@huawei.com
Signed-off-by: Mark Brown <broonie@kernel.org>
3 years agoASoC: wcd934x: constify static struct snd_soc_dai_ops
Ye Bin [Thu, 8 Apr 2021 06:26:48 +0000 (14:26 +0800)]
ASoC: wcd934x: constify static struct snd_soc_dai_ops

The snd_soc_dai_ops structures is only stored in the ops field of a
snd_soc_dai_driver structure, so make the snd_soc_dai_ops structure
const to allow the compiler to put it in read-only memory.

Reported-by: Hulk Robot <hulkci@huawei.com>
Signed-off-by: Ye Bin <yebin10@huawei.com>
Link: https://lore.kernel.org/r/20210408062648.803227-1-yebin10@huawei.com
Signed-off-by: Mark Brown <broonie@kernel.org>
3 years agoASoC: rt715-sdca: Constify static struct snd_soc_dai_ops
Ye Bin [Thu, 8 Apr 2021 06:26:54 +0000 (14:26 +0800)]
ASoC: rt715-sdca: Constify static struct snd_soc_dai_ops

The snd_soc_dai_ops structures is only stored in the ops field of a
snd_soc_dai_driver structure, so make the snd_soc_dai_ops structure
const to allow the compiler to put it in read-only memory.

Reported-by: Hulk Robot <hulkci@huawei.com>
Signed-off-by: Ye Bin <yebin10@huawei.com>
Link: https://lore.kernel.org/r/20210408062654.803538-1-yebin10@huawei.com
Signed-off-by: Mark Brown <broonie@kernel.org>
3 years agoASoC: Intel: KMB: Constify static struct snd_soc_dai_ops
Ye Bin [Thu, 8 Apr 2021 06:26:53 +0000 (14:26 +0800)]
ASoC: Intel: KMB: Constify static struct snd_soc_dai_ops

The snd_soc_dai_ops structures is only stored in the ops field of a
snd_soc_dai_driver structure, so make the snd_soc_dai_ops structure
const to allow the compiler to put it in read-only memory.

Reported-by: Hulk Robot <hulkci@huawei.com>
Signed-off-by: Ye Bin <yebin10@huawei.com>
Link: https://lore.kernel.org/r/20210408062653.803478-1-yebin10@huawei.com
Signed-off-by: Mark Brown <broonie@kernel.org>
3 years agoASoC: codecs: lpass-rx-macro: constify static struct snd_soc_dai_ops
Ye Bin [Thu, 8 Apr 2021 06:26:50 +0000 (14:26 +0800)]
ASoC: codecs: lpass-rx-macro: constify static struct snd_soc_dai_ops

The snd_soc_dai_ops structures is only stored in the ops field of a
snd_soc_dai_driver structure, so make the snd_soc_dai_ops structure
const to allow the compiler to put it in read-only memory.

Reported-by: Hulk Robot <hulkci@huawei.com>
Signed-off-by: Ye Bin <yebin10@huawei.com>
Link: https://lore.kernel.org/r/20210408062650.803309-1-yebin10@huawei.com
Signed-off-by: Mark Brown <broonie@kernel.org>
3 years agoASoC: soc-compress: lock pcm_mutex to resolve lockdep error
Gyeongtaek Lee [Wed, 7 Apr 2021 04:14:04 +0000 (13:14 +0900)]
ASoC: soc-compress: lock pcm_mutex to resolve lockdep error

If panic_on_warn=1 is added in bootargs and compress offload playback with
DPCM is started, kernel panic would be occurred because rtd->card->pcm_mutex
isn't held in soc_compr_open_fe() and soc_compr_free_fe() and it generates
lockdep warning in the following code.

void snd_soc_runtime_action(struct snd_soc_pcm_runtime *rtd,
    int stream, int action)
{
struct snd_soc_dai *dai;
int i;

lockdep_assert_held(&rtd->card->pcm_mutex);

To prevent lockdep warning but minimize side effect by adding mutex,
pcm_mutex is held just before snd_soc_runtime_activate() and
snd_soc_runtime_deactivate() and is released right after them.

Signed-off-by: Gyeongtaek Lee <gt82.lee@samsung.com>
Link: https://lore.kernel.org/r/1891546521.01617772502282.JavaMail.epsvc@epcpadp3
Signed-off-by: Mark Brown <broonie@kernel.org>
3 years agoASoC: amd: raven: acp3x-i2s: Constify static struct snd_soc_dai_ops
Ye Bin [Thu, 8 Apr 2021 06:26:51 +0000 (14:26 +0800)]
ASoC: amd: raven: acp3x-i2s: Constify static struct snd_soc_dai_ops

The snd_soc_dai_ops structures is only stored in the ops field of a
snd_soc_dai_driver structure, so make the snd_soc_dai_ops structure
const to allow the compiler to put it in read-only memory.

Reported-by: Hulk Robot <hulkci@huawei.com>
Signed-off-by: Ye Bin <yebin10@huawei.com>
Link: https://lore.kernel.org/r/20210408062651.803413-1-yebin10@huawei.com
Signed-off-by: Mark Brown <broonie@kernel.org>
3 years agoMerge series "ASoC: simple-card-utils: prepare for multi support" from Kuninori Morim...
Mark Brown [Thu, 8 Apr 2021 16:39:58 +0000 (17:39 +0100)]
Merge series "ASoC: simple-card-utils: prepare for multi support" from Kuninori Morimoto <kuninori.morimoto.gx@renesas.com>:

Hi Mark

I want to add new audio-graph-card2 driver which can support
not only DPCM, but also Multi-CPU/Codec, and Codec2Codec.
And it is also supporting audio-graph-card2 base custom driver.

But before supporting such driver, we need to cleanup existing
simple-card / audio-graph, because these and new driver are
sharing code.

This patch-set are for Multi-CPU/Codec support,
and some cleanups.

Kuninori Morimoto (14):
  ASoC: simple-card-utils: enable flexible CPU/Codec/Platform
  ASoC: simple-card-utils: share dummy DAI and reduce memory
  ASoC: simple-card-utils: setup dai_props cpu_dai/codec_dai at initial timing
  ASoC: simple-card-utils: remove li->dais/li->conf
  ASoC: simple-card-utils: use for_each_prop_xxx()
  ASoC: simple-card-utils: remove asoc_simple_parse_xxx()
  ASoC: simple-card-utils: care multi DAI at asoc_simple_clean_reference()
  ASoC: simple-card-utils: indicate dai_fmt if exist
  ASoC: simple-card-utils: indicate missing CPU/Codec numbers for debug
  ASoC: simple-card-utils: add simple_props_to_xxx() macro
  ASoC: simple-card-utils: multi support at asoc_simple_canonicalize_cpu/platform()
  ASoC: simple-card-utils: tidyup debug info for clock
  ASoC: simple-card-utils: tidyup dev_dbg() to use 1 line
  ASoC: simple-card-utils: tidyup asoc_simple_parse_convert()

 include/sound/simple_card_utils.h     | 116 +++++++----
 sound/soc/generic/audio-graph-card.c  |  90 ++++-----
 sound/soc/generic/simple-card-utils.c | 272 +++++++++++++++++---------
 sound/soc/generic/simple-card.c       | 104 +++++-----
 4 files changed, 352 insertions(+), 230 deletions(-)

--
2.25.1

3 years agoASoC: tas2770: Constify static struct snd_soc_dai_ops
Ye Bin [Thu, 8 Apr 2021 06:26:46 +0000 (14:26 +0800)]
ASoC: tas2770: Constify static struct snd_soc_dai_ops

The snd_soc_dai_ops structures is only stored in the ops field of a
snd_soc_dai_driver structure, so make the snd_soc_dai_ops structure
const to allow the compiler to put it in read-only memory.

Reported-by: Hulk Robot <hulkci@huawei.com>
Signed-off-by: Ye Bin <yebin10@huawei.com>
Link: https://lore.kernel.org/r/20210408062646.803053-1-yebin10@huawei.com
Signed-off-by: Mark Brown <broonie@kernel.org>
3 years agoASoC: cx2072x: constify static struct snd_soc_dai_ops
Ye Bin [Thu, 8 Apr 2021 06:26:56 +0000 (14:26 +0800)]
ASoC: cx2072x: constify static struct snd_soc_dai_ops

The snd_soc_dai_ops structures is only stored in the ops field of a
snd_soc_dai_driver structure, so make the snd_soc_dai_ops structure
const to allow the compiler to put it in read-only memory.

Reported-by: Hulk Robot <hulkci@huawei.com>
Signed-off-by: Ye Bin <yebin10@huawei.com>
Link: https://lore.kernel.org/r/20210408062656.803606-1-yebin10@huawei.com
Signed-off-by: Mark Brown <broonie@kernel.org>
3 years agoASoC: rt1019: constify static struct snd_soc_dai_ops
Ye Bin [Thu, 8 Apr 2021 06:27:01 +0000 (14:27 +0800)]
ASoC: rt1019: constify static struct snd_soc_dai_ops

The snd_soc_dai_ops structures is only stored in the ops field of a
snd_soc_dai_driver structure, so make the snd_soc_dai_ops structure
const to allow the compiler to put it in read-only memory.

Reported-by: Hulk Robot <hulkci@huawei.com>
Signed-off-by: Ye Bin <yebin10@huawei.com>
Link: https://lore.kernel.org/r/20210408062701.803865-1-yebin10@huawei.com
Signed-off-by: Mark Brown <broonie@kernel.org>
3 years agoASoC: fsl: sunxi: remove redundant dev_err call
Muhammad Usama Anjum [Wed, 7 Apr 2021 09:56:34 +0000 (14:56 +0500)]
ASoC: fsl: sunxi: remove redundant dev_err call

devm_ioremap_resource() prints error message in itself. Remove the
dev_err call to avoid redundant error message.

Signed-off-by: Muhammad Usama Anjum <musamaanjum@gmail.com>
Link: https://lore.kernel.org/r/20210407095634.GA1379642@LEGION
Signed-off-by: Mark Brown <broonie@kernel.org>
3 years agoASoC: codecs: tlv320aic3x: add SPI to the DT binding
Jiri Prchal [Thu, 8 Apr 2021 06:07:41 +0000 (08:07 +0200)]
ASoC: codecs: tlv320aic3x: add SPI to the DT binding

Added note and example of SPI support.

Signed-off-by: Jiri Prchal <jiri.prchal@aksignal.cz>
Link: https://lore.kernel.org/r/20210408060741.6879-1-jiri.prchal@aksignal.cz
Signed-off-by: Mark Brown <broonie@kernel.org>
3 years agoASoC: tas2764: constify static struct snd_soc_dai_ops
Ye Bin [Thu, 8 Apr 2021 06:26:43 +0000 (14:26 +0800)]
ASoC: tas2764: constify static struct snd_soc_dai_ops

The snd_soc_dai_ops structures is only stored in the ops field of a
snd_soc_dai_driver structure, so make the snd_soc_dai_ops structure
const to allow the compiler to put it in read-only memory.

Reported-by: Hulk Robot <hulkci@huawei.com>
Signed-off-by: Ye Bin <yebin10@huawei.com>
Link: https://lore.kernel.org/r/20210408062643.802908-1-yebin10@huawei.com
Signed-off-by: Mark Brown <broonie@kernel.org>
3 years agoASoC: codecs: tlv320aic3x: add AIC3106
Jiri Prchal [Thu, 8 Apr 2021 13:59:08 +0000 (15:59 +0200)]
ASoC: codecs: tlv320aic3x: add AIC3106

In DT binding is mentioned that this driver is compatible with 3106.
So added compatibility string and model number.

Signed-off-by: Jiri Prchal <jiri.prchal@aksignal.cz>
Link: https://lore.kernel.org/r/20210408135908.125667-1-jiri.prchal@aksignal.cz
Signed-off-by: Mark Brown <broonie@kernel.org>
3 years agoASoC: codecs: wsa881x: constify static struct snd_soc_dai_ops
Ye Bin [Thu, 8 Apr 2021 06:27:00 +0000 (14:27 +0800)]
ASoC: codecs: wsa881x: constify static struct snd_soc_dai_ops

The snd_soc_dai_ops structures is only stored in the ops field of a
snd_soc_dai_driver structure, so make the snd_soc_dai_ops structure
const to allow the compiler to put it in read-only memory.

Reported-by: Hulk Robot <hulkci@huawei.com>
Signed-off-by: Ye Bin <yebin10@huawei.com>
Link: https://lore.kernel.org/r/20210408062700.803792-1-yebin10@huawei.com
Signed-off-by: Mark Brown <broonie@kernel.org>
3 years agoASoC: simple-card-utils: share dummy DAI and reduce memory
Kuninori Morimoto [Thu, 1 Apr 2021 04:15:33 +0000 (13:15 +0900)]
ASoC: simple-card-utils: share dummy DAI and reduce memory

Current simple-card / audio-graph creates 1xCPU + 1xCodec + 1xPlatform
for all dai_link, but some of them is not needed.
For example Platform is not needed for DPCM BE case.
Moreover, we can share snd-soc-dummy DAI for CPU-dummy / dummy-Codec
in DPCM.

This patch adds dummy DAI and share it when DPCM case,
I beliave it can contribute to reduce memory.

By this patch, CPU-dummy / dummy-CPU are set at asoc_simple_init_priv(),
thus, its settings are no longer needed at DPCM detecting timing
on simple-card / audio-graph.
Moreover, we can remove triky Platform settings code for DPCM BE,
because un-needed Platform is not created.

Signed-off-by: Kuninori Morimoto <kuninori.morimoto.gx@renesas.com>
Link: https://lore.kernel.org/r/87tuoqod22.wl-kuninori.morimoto.gx@renesas.com
Signed-off-by: Mark Brown <broonie@kernel.org>
3 years agoASoC: simple-card-utils: enable flexible CPU/Codec/Platform
Kuninori Morimoto [Thu, 1 Apr 2021 04:15:23 +0000 (13:15 +0900)]
ASoC: simple-card-utils: enable flexible CPU/Codec/Platform

Current simple-card / audio-graph are assuming fixed
single-CPU/Codec/Platform.
This patch prepares multi-CPU/Codec/Platform support.

Note is that it is not yet full-multi-support.

Signed-off-by: Kuninori Morimoto <kuninori.morimoto.gx@renesas.com>
Link: https://lore.kernel.org/r/87v996od2c.wl-kuninori.morimoto.gx@renesas.com
Signed-off-by: Mark Brown <broonie@kernel.org>
3 years agoMerge series "Adds SPI support" from Jiri Prchal <jiri.prchal@aksignal.cz>:
Mark Brown [Wed, 7 Apr 2021 20:07:29 +0000 (21:07 +0100)]
Merge series "Adds SPI support" from Jiri Prchal <jiri.prchal@aksignal.cz>:

Moved I2C stuff to separated file, shered thingk to header file.
Added SPI in separeted file.

Jiri Prchal (4):
  ASoC: codecs: tlv320aic3x: move model definitions
  ASoC: codecs: tlv320aic3x: rename probe function
  ASoC: codecs: tlv320aic3x: move I2C to separated file
  ASoC: codecs: tlv320aic3x: add SPI support

 sound/soc/codecs/Kconfig           |  16 ++++-
 sound/soc/codecs/Makefile          |   4 ++
 sound/soc/codecs/tlv320aic3x-i2c.c |  70 +++++++++++++++++++
 sound/soc/codecs/tlv320aic3x-spi.c |  76 ++++++++++++++++++++
 sound/soc/codecs/tlv320aic3x.c     | 108 ++++++++---------------------
 sound/soc/codecs/tlv320aic3x.h     |  12 ++++
 6 files changed, 204 insertions(+), 82 deletions(-)
 create mode 100644 sound/soc/codecs/tlv320aic3x-i2c.c
 create mode 100644 sound/soc/codecs/tlv320aic3x-spi.c

--
2.25.1

3 years agoASoC: meson: axg-fifo: add NO_PERIOD_WAKEUP support
Jerome Brunet [Wed, 7 Apr 2021 14:59:14 +0000 (16:59 +0200)]
ASoC: meson: axg-fifo: add NO_PERIOD_WAKEUP support

On the AXG family, the fifo irq is not necessary for the HW to operate.
It is just used to notify that a period has elapsed. If userpace does not
care for these wakeups (such as pipewire), we are just wasting CPU cycles.

Add support for NO_PERIOD_WAKEUP and disable irq when they are no needed.

Signed-off-by: Jerome Brunet <jbrunet@baylibre.com>
Link: https://lore.kernel.org/r/20210407145914.311479-1-jbrunet@baylibre.com
Signed-off-by: Mark Brown <broonie@kernel.org>
3 years agoASoC: simple-card: fix possible uninitialized single_cpu local variable
Krzysztof Kozlowski [Wed, 7 Apr 2021 09:20:27 +0000 (11:20 +0200)]
ASoC: simple-card: fix possible uninitialized single_cpu local variable

The 'single_cpu' local variable is assigned by asoc_simple_parse_dai()
and later used in a asoc_simple_canonicalize_cpu() call, assuming the
entire function did not exit on errors.

However the first function returns 0 if passed device_node is NULL,
thus leaving the variable uninitialized and reporting success.

Addresses-Coverity: Uninitialized scalar variable
Fixes: 8f7f298a3337 ("ASoC: simple-card-utils: separate asoc_simple_card_parse_dai()")
Signed-off-by: Krzysztof Kozlowski <krzysztof.kozlowski@canonical.com>
Acked-by: Sameer Pujar <spujar@nvidia.com>
Link: https://lore.kernel.org/r/20210407092027.60769-1-krzysztof.kozlowski@canonical.com
Signed-off-by: Mark Brown <broonie@kernel.org>
3 years agoASoC: codecs: lpass-va-macro: constify static struct snd_soc_dai_ops
Ye Bin [Wed, 7 Apr 2021 07:42:18 +0000 (15:42 +0800)]
ASoC: codecs: lpass-va-macro: constify static struct snd_soc_dai_ops

The snd_soc_dai_ops structures is only stored in the ops field of a
snd_soc_dai_driver structure, so make the snd_soc_dai_ops structure
const to allow the compiler to put it in read-only memory.

Reported-by: Hulk Robot <hulkci@huawei.com>
Signed-off-by: Ye Bin <yebin10@huawei.com>
Link: https://lore.kernel.org/r/20210407074218.3051979-1-yebin10@huawei.com
Signed-off-by: Mark Brown <broonie@kernel.org>
3 years agoASoC: codecs: tlv320aic3x: add SPI support
Jiri Prchal [Tue, 6 Apr 2021 14:24:39 +0000 (16:24 +0200)]
ASoC: codecs: tlv320aic3x: add SPI support

Added SPI support.

Signed-off-by: Jiri Prchal <jiri.prchal@aksignal.cz>
Link: https://lore.kernel.org/r/20210406142439.102396-5-jiri.prchal@aksignal.cz
Signed-off-by: Mark Brown <broonie@kernel.org>
3 years agoASoC: codecs: tlv320aic3x: move I2C to separated file
Jiri Prchal [Tue, 6 Apr 2021 14:24:38 +0000 (16:24 +0200)]
ASoC: codecs: tlv320aic3x: move I2C to separated file

Moved I2C related staff to separated source file.

Signed-off-by: Jiri Prchal <jiri.prchal@aksignal.cz>
Link: https://lore.kernel.org/r/20210406142439.102396-4-jiri.prchal@aksignal.cz
Signed-off-by: Mark Brown <broonie@kernel.org>
3 years agoASoC: codecs: tlv320aic3x: rename probe function
Jiri Prchal [Tue, 6 Apr 2021 14:24:37 +0000 (16:24 +0200)]
ASoC: codecs: tlv320aic3x: rename probe function

Renamed function to have it free for generic probe.

Signed-off-by: Jiri Prchal <jiri.prchal@aksignal.cz>
Link: https://lore.kernel.org/r/20210406142439.102396-3-jiri.prchal@aksignal.cz
Signed-off-by: Mark Brown <broonie@kernel.org>
3 years agoASoC: codecs: tlv320aic3x: move model definitions
Jiri Prchal [Tue, 6 Apr 2021 14:24:36 +0000 (16:24 +0200)]
ASoC: codecs: tlv320aic3x: move model definitions

Model definitions moved to header file.
Preparation for SPI and I2C separated files.

Signed-off-by: Jiri Prchal <jiri.prchal@aksignal.cz>
Link: https://lore.kernel.org/r/20210406142439.102396-2-jiri.prchal@aksignal.cz
Signed-off-by: Mark Brown <broonie@kernel.org>
3 years agoMerge series "kbl_da7219_max9357a machine changes for wov and MST" from vamshi.krishn...
Mark Brown [Tue, 6 Apr 2021 17:33:13 +0000 (18:33 +0100)]
Merge series "kbl_da7219_max9357a machine changes for wov and MST" from vamshi.krishna.gopal@intel.com
Vamshi Krishna Gopal <vamshi.krishna.gopal@intel.corp-partner.google.com>:

From: Vamshi Krishna Gopal <vamshi.krishna.gopal@intel.corp-partner.google.com>

Hi all,

This patch series about creating dailink for Wake on voice functionality
and also adding MST route changes.

changes in v3:

-Remove DP from widgets
-Add MST support in other routing table for kbl_rt5663_max98927.c

v2 is here:

https://patchwork.kernel.org/project/alsa-devel/cover/20210325174325.31802-1-vamshi.krishna.gopal@intel.com/

v1 is here:

https://patchwork.kernel.org/project/alsa-devel/cover/20210324175200.44922-1-vamshi.krishna.gopal@intel.com/

Mac Chiang (1):
  ASoc: Intel: board: add BE DAI link for WoV

Vamshi Krishna Gopal (1):
  ASoC: Intel: kbl: Add MST route change to kbl machine drivers

 sound/soc/intel/boards/kbl_da7219_max98357a.c | 58 +++++++++++++++++--
 sound/soc/intel/boards/kbl_da7219_max98927.c  | 10 ++--
 sound/soc/intel/boards/kbl_rt5663_max98927.c  | 14 +++--
 3 files changed, 70 insertions(+), 12 deletions(-)

--
2.17.1

3 years agoASoC: max98390: Add support for tx slot configuration.
Steve Lee [Mon, 5 Apr 2021 14:38:01 +0000 (23:38 +0900)]
ASoC: max98390: Add support for tx slot configuration.

 Update voltage/current tx slot configuration support.

Signed-off-by: Steve Lee <steves.lee@maximintegrated.com>
Link: https://lore.kernel.org/r/20210405143801.29770-1-steves.lee@maximintegrated.com
Signed-off-by: Mark Brown <broonie@kernel.org>
3 years agoASoC: ak5558: Fix s/show/slow/ typo
Shengjiu Wang [Sat, 3 Apr 2021 13:59:25 +0000 (21:59 +0800)]
ASoC: ak5558: Fix s/show/slow/ typo

s/show/slow/

Fixes: 920884777480 ("ASoC: ak5558: Add support for AK5558 ADC driver")
Signed-off-by: Shengjiu Wang <shengjiu.wang@nxp.com>
Link: https://lore.kernel.org/r/1617458365-23393-1-git-send-email-shengjiu.wang@nxp.com
Signed-off-by: Mark Brown <broonie@kernel.org>
3 years agoASoc: Intel: board: add BE DAI link for WoV
Mac Chiang [Mon, 5 Apr 2021 12:48:35 +0000 (18:18 +0530)]
ASoc: Intel: board: add BE DAI link for WoV

create dai link in kbl_da7219_max98357a driver for wake on voice
functionality.

changes picked from broonie's tree
commit 0c7941a63a0f
("ASoC: Intel: Skylake: Use refcap device for mono recording")
commit 2154be362c90
("ASoc: Intel: boards: Add WOV as sink for nau88l25_ssm4567 machine")

Signed-off-by: Mac Chiang <mac.chiang@intel.com>
Signed-off-by: Vamshi Krishna Gopal <vamshi.krishna.gopal@intel.com>
Tested-by: Kaiyen Chang <kaiyen.chang@intel.corp-partner.google.com>
Tested-by: luke yang <luke_yang@compal.corp-partner.google.com>
Tested-by: Grace Kao <grace.kao@intel.com>
Tested-by: Kaiyen Chang <kaiyen.chang@intel.com>
Reviewed-by: Cheng-Yi Chiang <cychiang@chromium.org>
Acked-by: Pierre-Louis Bossart <pierre-louis.bossart@linux.intel.com>
Link: https://lore.kernel.org/r/20210405124835.71247-3-vamshi.krishna.gopal@intel.com
Signed-off-by: Mark Brown <broonie@kernel.org>
3 years agoASoC: Intel: kbl: Add MST route change to kbl machine drivers
Vamshi Krishna Gopal [Mon, 5 Apr 2021 12:48:34 +0000 (18:18 +0530)]
ASoC: Intel: kbl: Add MST route change to kbl machine drivers

To support MST hdmi audio, modify the current routes to be
based on port in kbl_da7219_max98357a, kbl_da7219_max98927 &
kbl_rt5663_max98927.

Signed-off-by: Vamshi Krishna Gopal <vamshi.krishna.gopal@intel.com>
Acked-by: Pierre-Louis Bossart <pierre-louis.bossart@linux.intel.com>
Link: https://lore.kernel.org/r/20210405124835.71247-2-vamshi.krishna.gopal@intel.com
Signed-off-by: Mark Brown <broonie@kernel.org>
3 years agoASoC: Intel: cht_bsw_rt5672: Set card.components string
Hans de Goede [Fri, 2 Apr 2021 14:07:47 +0000 (16:07 +0200)]
ASoC: Intel: cht_bsw_rt5672: Set card.components string

Set the card.components string using the new rt5670_components() helper
which returns a components string based on the DMI quirks inside the
rt5670 codec driver.

Signed-off-by: Hans de Goede <hdegoede@redhat.com>
Acked-by: Pierre-Louis Bossart <pierre-louis.bossart@linux.intel.com>
Link: https://lore.kernel.org/r/20210402140747.174716-7-hdegoede@redhat.com
Signed-off-by: Mark Brown <broonie@kernel.org>
3 years agoASoC: rt5670: Add a rt5670_components() helper
Hans de Goede [Fri, 2 Apr 2021 14:07:46 +0000 (16:07 +0200)]
ASoC: rt5670: Add a rt5670_components() helper

The rt5670 codec driver uses DMI quirks to configure the DMIC data-pins,
which means that it knows which DMIC interface is used on a specific
device.

ATM we duplicate this DMI matching inside the UCM profiles to select
the right DMIC interface. Add a rt5670_components() helper which the
machine-driver can use to set the components string of the card so
that UCM can get the info from the components string.

This way we only need to add new DMI quirks in one place.

Signed-off-by: Hans de Goede <hdegoede@redhat.com>
Acked-by: Pierre-Louis Bossart <pierre-louis.bossart@linux.intel.com>
Link: https://lore.kernel.org/r/20210402140747.174716-6-hdegoede@redhat.com
Signed-off-by: Mark Brown <broonie@kernel.org>
3 years agoASoC: rt5670: Add a quirk for the Dell Venue 10 Pro 5055
Hans de Goede [Fri, 2 Apr 2021 14:07:45 +0000 (16:07 +0200)]
ASoC: rt5670: Add a quirk for the Dell Venue 10 Pro 5055

Add a quirk with the jack-detect and dmic settings necessary to make
jack-detect and the builtin mic work on Dell Venue 10 Pro 5055 tablets.

Signed-off-by: Hans de Goede <hdegoede@redhat.com>
Acked-by: Pierre-Louis Bossart <pierre-louis.bossart@linux.intel.com>
Link: https://lore.kernel.org/r/20210402140747.174716-5-hdegoede@redhat.com
Signed-off-by: Mark Brown <broonie@kernel.org>
3 years agoASoC: Intel: cht_bsw_rt5672: Add support for Bay Trail CR / SSP0
Hans de Goede [Fri, 2 Apr 2021 14:07:44 +0000 (16:07 +0200)]
ASoC: Intel: cht_bsw_rt5672: Add support for Bay Trail CR / SSP0

The rt5672 codec is used on some Bay Trail CR boards, on these SoCs SSP2
is not available and SSP0 should be used instead. At support for this.

This has been tested on a Dell Venue 10 Pro 5055.

Signed-off-by: Hans de Goede <hdegoede@redhat.com>
Acked-by: Pierre-Louis Bossart <pierre-louis.bossart@linux.intel.com>
Link: https://lore.kernel.org/r/20210402140747.174716-4-hdegoede@redhat.com
Signed-off-by: Mark Brown <broonie@kernel.org>
3 years agoASoC: Intel: Baytrail: Add quirk for the Dell Venue 10 Pro 5055 tablet
Hans de Goede [Fri, 2 Apr 2021 14:07:43 +0000 (16:07 +0200)]
ASoC: Intel: Baytrail: Add quirk for the Dell Venue 10 Pro 5055 tablet

The Dell Venue 10 Pro 5055 tablet uses an ACPI HID of 10EC5640 while using
a rt5672 codec (instead of a rt5640 codec). Add a quirk for this.

Signed-off-by: Hans de Goede <hdegoede@redhat.com>
Acked-by: Pierre-Louis Bossart <pierre-louis.bossart@linux.intel.com>
Link: https://lore.kernel.org/r/20210402140747.174716-3-hdegoede@redhat.com
Signed-off-by: Mark Brown <broonie@kernel.org>
3 years agoASoC: Intel: Unify the thinkpad10 and aegex10 byt-match quirks
Hans de Goede [Fri, 2 Apr 2021 14:07:42 +0000 (16:07 +0200)]
ASoC: Intel: Unify the thinkpad10 and aegex10 byt-match quirks

There is no reason to have separate quirk-handlers / byt_machine_id-s
for these.

These are both cases of BYT devices with a 10EC5640 ACPI HID while using
a rt5672 codec.

The Dell Venue 10 Pro 5055 is another example of such a device, instead
of adding a third byt_machine_id definition for this Dell model, make
change the 2 existing cases into a generic BYT_RT5672 byt_machine_id
in preparation for adding a quirk for the Dell Venue 10 Pro 5055.

Signed-off-by: Hans de Goede <hdegoede@redhat.com>
Acked-by: Pierre-Louis Bossart <pierre-louis.bossart@linux.intel.com>
Link: https://lore.kernel.org/r/20210402140747.174716-2-hdegoede@redhat.com
Signed-off-by: Mark Brown <broonie@kernel.org>
3 years agoASoC: Intel: Boards: cml_da7219_max98390: add capture stream for echo reference
Mac Chiang [Thu, 1 Apr 2021 14:00:13 +0000 (22:00 +0800)]
ASoC: Intel: Boards: cml_da7219_max98390: add capture stream for echo reference

enable speaker capture dai link for feedback path

Signed-off-by: Mac Chiang <mac.chiang@intel.com>
Acked-by: Pierre-Louis Bossart <pierre-louis.bossart@linux.intel.com>
Link: https://lore.kernel.org/r/1617285613-29457-1-git-send-email-mac.chiang@intel.com
Signed-off-by: Mark Brown <broonie@kernel.org>
3 years agoASoC: intel, keembay-i2s: Fix a dt_binding_check warning
Zhen Lei [Mon, 29 Mar 2021 08:14:35 +0000 (16:14 +0800)]
ASoC: intel, keembay-i2s: Fix a dt_binding_check warning

The property "dmas" contains two items: DMA "TX" and "RX" channel,
Therefore, its value also needs to be written in two parts.

Otherwise, below YAML check warning is reported:
Documentation/devicetree/bindings/sound/intel,keembay-i2s.example.dt.yaml:\
i2s@20140000: dmas: [[4294967295, 29, 4294967295, 33]] is too short

Signed-off-by: Zhen Lei <thunder.leizhen@huawei.com>
Acked-by: Rob Herring <robh@kernel.org>
Link: https://lore.kernel.org/r/20210329081435.2200-1-thunder.leizhen@huawei.com
Signed-off-by: Mark Brown <broonie@kernel.org>
3 years agoASoC: Intel: Fix a typo
Bhaskar Chowdhury [Mon, 22 Mar 2021 06:52:38 +0000 (12:22 +0530)]
ASoC: Intel: Fix a typo

s/struture/structure/

Signed-off-by: Bhaskar Chowdhury <unixbhaskar@gmail.com>
Link: https://lore.kernel.org/r/20210322065238.151920-1-unixbhaskar@gmail.com
Signed-off-by: Mark Brown <broonie@kernel.org>
3 years agoMerge series "ASoC: remove cppchecks warnings on lm49453 and da732x" from Pierre...
Mark Brown [Thu, 1 Apr 2021 09:25:14 +0000 (10:25 +0100)]
Merge series "ASoC: remove cppchecks warnings on lm49453 and da732x" from Pierre-Louis Bossart <pierre-louis.bossart@linux.intel.com>:

There are the last two patches in the cleanups, this time I am not
sure what the code does and what the proper fix might be. Feedback
welcome.

Pierre-Louis Bossart (2):
  ASoC: lm49453: fix useless assignment before return
  ASoC: da732x: simplify code

 sound/soc/codecs/da732x.c  | 17 ++++++-----------
 sound/soc/codecs/da732x.h  | 12 ++++--------
 sound/soc/codecs/lm49453.c |  2 --
 3 files changed, 10 insertions(+), 21 deletions(-)

--
2.25.1

3 years agoMerge series "ASoC: dt-bindings: Rework audio-graph-port schema" from Rob Herring...
Mark Brown [Thu, 1 Apr 2021 09:25:13 +0000 (10:25 +0100)]
Merge series "ASoC: dt-bindings: Rework audio-graph-port schema" from Rob Herring <robh@>:

This series refactors the audio-graph-port.yaml schema moving the
'port' node out of the schema and updating to use graph.yaml schema.
This allows users to define what each 'port' node is like other graph
binding users.

v2:
- Rebase on ASoC tree

Rob

Cc: alsa-devel@alsa-project.org
Cc: linux-tegra@vger.kernel.org
Cc: Jonathan Hunter <jonathanh@nvidia.com>
Cc: Kuninori Morimoto <kuninori.morimoto.gx@renesas.com>
Cc: Liam Girdwood <lgirdwood@gmail.com>
Cc: Lubomir Rintel <lkundrak@v3.sk>
Cc: Mark Brown <broonie@kernel.org>
Cc: Masahiro Yamada <yamada.masahiro@socionext.com>
Cc: Sameer Pujar <spujar@nvidia.com>
Cc: Thierry Reding <thierry.reding@gmail.com>
Rob Herring (3):
  ASoC: dt-bindings: Move port/ports properties out of
    audio-graph-port.yaml
  ASoC: dt-bindings: Use OF graph schema
  ASoC: dt-bindings: socionext: Use audio-graph-port schema

 .../bindings/sound/audio-graph-port.yaml      | 104 ++++++++----------
 .../bindings/sound/marvell,mmp-sspa.yaml      |   6 +-
 .../bindings/sound/nvidia,tegra186-dspk.yaml  |  11 +-
 .../sound/nvidia,tegra210-admaif.yaml         |  11 +-
 .../bindings/sound/nvidia,tegra210-ahub.yaml  |  11 +-
 .../bindings/sound/nvidia,tegra210-dmic.yaml  |  11 +-
 .../bindings/sound/nvidia,tegra210-i2s.yaml   |  11 +-
 .../bindings/sound/renesas,rsnd.yaml          |   5 +-
 .../sound/socionext,uniphier-aio.yaml         |   8 +-
 .../sound/socionext,uniphier-evea.yaml        |   8 +-
 10 files changed, 89 insertions(+), 97 deletions(-)

--
2.27.0

3 years agoMerge series "ASoC: soc-core: tidyup error handling for rtd" from Kuninori Morimoto...
Mark Brown [Thu, 1 Apr 2021 09:25:12 +0000 (10:25 +0100)]
Merge series "ASoC: soc-core: tidyup error handling for rtd" from Kuninori Morimoto <kuninori.morimoto.gx@renesas.com>:

Hi Mark

These are small clanup patches for soc-core.
[1/2] patch adds missing explanation, and
[2/2] patch fixup error handling of rtd.

Kuninori Morimoto (2):
  ASoC: soc-core: add comment for rtd freeing
  ASoC: soc-core: use device_unregister() if rtd allocation failed

 sound/soc/soc-core.c | 14 ++++++++++++--
 1 file changed, 12 insertions(+), 2 deletions(-)

--
2.25.1

3 years agoMerge series "ASoC: remove cppcheck warnings for multiple SOCs" from Pierre-Louis...
Mark Brown [Thu, 1 Apr 2021 09:25:11 +0000 (10:25 +0100)]
Merge series "ASoC: remove cppcheck warnings for multiple SOCs" from Pierre-Louis Bossart <pierre-louis.bossart@linux.intel.com>:

Trivial cleanups to make cppcheck less verbose.

There should be no functionality change, except for the 'sti_uniperif'
patch where an error check was added.

Pierre-Louis Bossart (17):
  ASoC: amd: renoir: acp3x-pdm-dma: remove unnecessary assignments
  ASoC: atmel: fix shadowed variable
  ASoC: atmel: atmel-i2s: remove useless initialization
  ASoC: bcm: cygnus_ssp: remove useless initialization
  ASoC: meson: axg-tdmin: remove useless assignment
  ASoC: meson: axg-tdmout: remove useless assignment
  ASoC: pxa: remove useless assignment
  ASoC: sti: sti_uniperif: add missing error check
  ASoC: sti: uniperif: align function prototypes
  ASoC: stm: stm32_adfsdm: fix snprintf format string
  ASoC: sunxi: sun8i-codec: clarify expression
  ASoC: tegra: tegra20_das: clarify expression
  ASoC: tegra: tegra20_das: align function prototypes
  ASoC: ti: omap-abe-twl6040: remove useless assignment
  ASoC: ti: omap-mcsp: remove duplicate test
  ASoC: ux500: mop500: rename shadowing variable
  ASoC: ux500: mop500: align function prototype

 sound/soc/amd/renoir/acp3x-pdm-dma.c | 2 --
 sound/soc/atmel/atmel-classd.c       | 6 +++---
 sound/soc/atmel/atmel-i2s.c          | 2 +-
 sound/soc/bcm/cygnus-ssp.c           | 2 +-
 sound/soc/meson/axg-tdmin.c          | 2 +-
 sound/soc/meson/axg-tdmout.c         | 2 +-
 sound/soc/pxa/mmp-pcm.c              | 2 +-
 sound/soc/sti/sti_uniperif.c         | 2 ++
 sound/soc/sti/uniperif.h             | 4 ++--
 sound/soc/stm/stm32_adfsdm.c         | 2 +-
 sound/soc/sunxi/sun8i-codec.c        | 2 +-
 sound/soc/tegra/tegra20_das.c        | 8 ++++----
 sound/soc/tegra/tegra20_das.h        | 6 +++---
 sound/soc/ti/omap-abe-twl6040.c      | 2 +-
 sound/soc/ti/omap-mcbsp.c            | 3 +--
 sound/soc/ux500/mop500.c             | 6 +++---
 sound/soc/ux500/mop500_ab8500.h      | 2 +-
 17 files changed, 27 insertions(+), 28 deletions(-)

--
2.25.1

3 years agoASoC: Intel: Fix a typo
Bhaskar Chowdhury [Mon, 22 Mar 2021 21:01:05 +0000 (02:31 +0530)]
ASoC: Intel: Fix a typo

s/defintions/definitions/

Signed-off-by: Bhaskar Chowdhury <unixbhaskar@gmail.com>
Link: https://lore.kernel.org/r/20210322210105.1575758-1-unixbhaskar@gmail.com
Signed-off-by: Mark Brown <broonie@kernel.org>
3 years agoASoC: ux500: mop500: align function prototype
Pierre-Louis Bossart [Fri, 26 Mar 2021 21:59:27 +0000 (16:59 -0500)]
ASoC: ux500: mop500: align function prototype

cppcheck warning:

sound/soc/ux500/mop500_ab8500.c:360:60: style:inconclusive: Function
'mop500_ab8500_machine_init' argument 1 names different: declaration
'runtime' definition 'rtd'. [funcArgNamesDifferent]

int mop500_ab8500_machine_init(struct snd_soc_pcm_runtime *rtd)
                                                           ^
sound/soc/ux500/mop500_ab8500.h:16:60: note: Function
'mop500_ab8500_machine_init' argument 1 names different: declaration
'runtime' definition 'rtd'.
int mop500_ab8500_machine_init(struct snd_soc_pcm_runtime *runtime);
                                                           ^
sound/soc/ux500/mop500_ab8500.c:360:60: note: Function
'mop500_ab8500_machine_init' argument 1 names different: declaration
'runtime' definition 'rtd'.
int mop500_ab8500_machine_init(struct snd_soc_pcm_runtime *rtd)
                                                           ^

Signed-off-by: Pierre-Louis Bossart <pierre-louis.bossart@linux.intel.com>
Link: https://lore.kernel.org/r/20210326215927.936377-18-pierre-louis.bossart@linux.intel.com
Signed-off-by: Mark Brown <broonie@kernel.org>
3 years agoASoC: ux500: mop500: rename shadowing variable
Pierre-Louis Bossart [Fri, 26 Mar 2021 21:59:26 +0000 (16:59 -0500)]
ASoC: ux500: mop500: rename shadowing variable

cppcheck warning:

sound/soc/ux500/mop500.c:143:23: style: Local variable 'mop500_card'
shadows outer variable [shadowVariable]

 struct snd_soc_card *mop500_card = platform_get_drvdata(pdev);
                      ^
sound/soc/ux500/mop500.c:54:28: note: Shadowed declaration
static struct snd_soc_card mop500_card = {
                           ^
sound/soc/ux500/mop500.c:143:23: note: Shadow variable
 struct snd_soc_card *mop500_card = platform_get_drvdata(pdev);
                      ^

Signed-off-by: Pierre-Louis Bossart <pierre-louis.bossart@linux.intel.com>
Link: https://lore.kernel.org/r/20210326215927.936377-17-pierre-louis.bossart@linux.intel.com
Signed-off-by: Mark Brown <broonie@kernel.org>
3 years agoASoC: ti: omap-mcsp: remove duplicate test
Pierre-Louis Bossart [Fri, 26 Mar 2021 21:59:25 +0000 (16:59 -0500)]
ASoC: ti: omap-mcsp: remove duplicate test

cppcheck warning:

sound/soc/ti/omap-mcbsp.c:379:11: style: The if condition is the same
as the previous if condition [duplicateCondition]

 if (mcbsp->irq) {
          ^
sound/soc/ti/omap-mcbsp.c:376:11: note: First condition
 if (mcbsp->irq)
          ^
sound/soc/ti/omap-mcbsp.c:379:11: note: Second condition
 if (mcbsp->irq) {
          ^

Keeping two separate tests was probably intentional for clarity, but
since this generates warnings we might as well make cppcheck happy so
that we have fewer warnings.

Signed-off-by: Pierre-Louis Bossart <pierre-louis.bossart@linux.intel.com>
Acked-by: Peter Ujfalusi <peter.ujfalusi@gmail.com>
Link: https://lore.kernel.org/r/20210326215927.936377-16-pierre-louis.bossart@linux.intel.com
Signed-off-by: Mark Brown <broonie@kernel.org>
3 years agoASoC: ti: omap-abe-twl6040: remove useless assignment
Pierre-Louis Bossart [Fri, 26 Mar 2021 21:59:24 +0000 (16:59 -0500)]
ASoC: ti: omap-abe-twl6040: remove useless assignment

cppcheck warning:

sound/soc/ti/omap-abe-twl6040.c:173:10: style: Variable 'ret' is
assigned a value that is never used. [unreadVariable]
 int ret = 0;
         ^

Signed-off-by: Pierre-Louis Bossart <pierre-louis.bossart@linux.intel.com>
Acked-by: Peter Ujfalusi <peter.ujfalusi@gmail.com>
Link: https://lore.kernel.org/r/20210326215927.936377-15-pierre-louis.bossart@linux.intel.com
Signed-off-by: Mark Brown <broonie@kernel.org>
3 years agoASoC: tegra: tegra20_das: align function prototypes
Pierre-Louis Bossart [Fri, 26 Mar 2021 21:59:23 +0000 (16:59 -0500)]
ASoC: tegra: tegra20_das: align function prototypes

cppcheck warnings:

sound/soc/tegra/tegra20_das.c:35:40: style:inconclusive: Function
'tegra20_das_connect_dap_to_dac' argument 1 names different:
declaration 'dap_id' definition 'dap'. [funcArgNamesDifferent]

int tegra20_das_connect_dap_to_dac(int dap, int dac)
                                       ^
sound/soc/tegra/tegra20_das.h:98:47: note: Function
'tegra20_das_connect_dap_to_dac' argument 1 names different:
declaration 'dap_id' definition 'dap'.
extern int tegra20_das_connect_dap_to_dac(int dap_id, int dac_sel);
                                              ^
sound/soc/tegra/tegra20_das.c:35:40: note: Function
'tegra20_das_connect_dap_to_dac' argument 1 names different:
declaration 'dap_id' definition 'dap'.
int tegra20_das_connect_dap_to_dac(int dap, int dac)
                                       ^
sound/soc/tegra/tegra20_das.c:35:49: style:inconclusive: Function
'tegra20_das_connect_dap_to_dac' argument 2 names different:
declaration 'dac_sel' definition 'dac'. [funcArgNamesDifferent]
int tegra20_das_connect_dap_to_dac(int dap, int dac)
                                                ^
sound/soc/tegra/tegra20_das.h:98:59: note: Function
'tegra20_das_connect_dap_to_dac' argument 2 names different:
declaration 'dac_sel' definition 'dac'.
extern int tegra20_das_connect_dap_to_dac(int dap_id, int dac_sel);
                                                          ^
sound/soc/tegra/tegra20_das.c:35:49: note: Function 'tegra20_das_connect_dap_to_dac' argument 2 names different: declaration 'dac_sel' definition 'dac'.
int tegra20_das_connect_dap_to_dac(int dap, int dac)
                                                ^
sound/soc/tegra/tegra20_das.c:53:40: style:inconclusive: Function
'tegra20_das_connect_dap_to_dap' argument 1 names different:
declaration 'dap_id' definition 'dap'. [funcArgNamesDifferent]
int tegra20_das_connect_dap_to_dap(int dap, int otherdap, int master,
                                       ^
sound/soc/tegra/tegra20_das.h:108:47: note: Function
'tegra20_das_connect_dap_to_dap' argument 1 names different:
declaration 'dap_id' definition 'dap'.
extern int tegra20_das_connect_dap_to_dap(int dap_id, int other_dap_sel,
                                              ^
sound/soc/tegra/tegra20_das.c:53:40: note: Function
'tegra20_das_connect_dap_to_dap' argument 1 names different:
declaration 'dap_id' definition 'dap'.
int tegra20_das_connect_dap_to_dap(int dap, int otherdap, int master,
                                       ^
sound/soc/tegra/tegra20_das.c:53:49: style:inconclusive: Function
'tegra20_das_connect_dap_to_dap' argument 2 names different:
declaration 'other_dap_sel' definition
'otherdap'. [funcArgNamesDifferent]
int tegra20_das_connect_dap_to_dap(int dap, int otherdap, int master,
                                                ^
sound/soc/tegra/tegra20_das.h:108:59: note: Function
'tegra20_das_connect_dap_to_dap' argument 2 names different:
declaration 'other_dap_sel' definition 'otherdap'.
extern int tegra20_das_connect_dap_to_dap(int dap_id, int other_dap_sel,
                                                          ^
sound/soc/tegra/tegra20_das.c:53:49: note: Function
'tegra20_das_connect_dap_to_dap' argument 2 names different:
declaration 'other_dap_sel' definition 'otherdap'.
int tegra20_das_connect_dap_to_dap(int dap, int otherdap, int master,
                                                ^
sound/soc/tegra/tegra20_das.c:75:40: style:inconclusive: Function
'tegra20_das_connect_dac_to_dap' argument 1 names different:
declaration 'dac_id' definition 'dac'. [funcArgNamesDifferent]
int tegra20_das_connect_dac_to_dap(int dac, int dap)
                                       ^
sound/soc/tegra/tegra20_das.h:118:47: note: Function
'tegra20_das_connect_dac_to_dap' argument 1 names different:
declaration 'dac_id' definition 'dac'.
extern int tegra20_das_connect_dac_to_dap(int dac_id, int dap_sel);
                                              ^
sound/soc/tegra/tegra20_das.c:75:40: note: Function
'tegra20_das_connect_dac_to_dap' argument 1 names different:
declaration 'dac_id' definition 'dac'.
int tegra20_das_connect_dac_to_dap(int dac, int dap)
                                       ^
sound/soc/tegra/tegra20_das.c:75:49: style:inconclusive: Function
'tegra20_das_connect_dac_to_dap' argument 2 names different:
declaration 'dap_sel' definition 'dap'. [funcArgNamesDifferent]
int tegra20_das_connect_dac_to_dap(int dac, int dap)
                                                ^
sound/soc/tegra/tegra20_das.h:118:59: note: Function
'tegra20_das_connect_dac_to_dap' argument 2 names different:
declaration 'dap_sel' definition 'dap'.
extern int tegra20_das_connect_dac_to_dap(int dac_id, int dap_sel);
                                                          ^
sound/soc/tegra/tegra20_das.c:75:49: note: Function
'tegra20_das_connect_dac_to_dap' argument 2 names different:
declaration 'dap_sel' definition 'dap'.
int tegra20_das_connect_dac_to_dap(int dac, int dap)
                                                ^

Signed-off-by: Pierre-Louis Bossart <pierre-louis.bossart@linux.intel.com>
Acked-by: Thierry Reding <treding@nvidia.com>
Link: https://lore.kernel.org/r/20210326215927.936377-14-pierre-louis.bossart@linux.intel.com
Signed-off-by: Mark Brown <broonie@kernel.org>
3 years agoASoC: tegra: tegra20_das: clarify expression
Pierre-Louis Bossart [Fri, 26 Mar 2021 21:59:22 +0000 (16:59 -0500)]
ASoC: tegra: tegra20_das: clarify expression

cppcheck warning:

sound/soc/tegra/tegra20_das.c:64:60: style: Boolean result is used in
bitwise operation. Clarify expression with
parentheses. [clarifyCondition]
 reg = otherdap << TEGRA20_DAS_DAP_CTRL_SEL_DAP_CTRL_SEL_P |
                                                           ^
sound/soc/tegra/tegra20_das.c:65:61: style: Boolean result is used in
bitwise operation. Clarify expression with
parentheses. [clarifyCondition]

  !!sdata2rx << TEGRA20_DAS_DAP_CTRL_SEL_DAP_SDATA2_TX_RX_P |
                                                            ^
sound/soc/tegra/tegra20_das.c:66:61: style: Boolean result is used in
bitwise operation. Clarify expression with
parentheses. [clarifyCondition]
  !!sdata1rx << TEGRA20_DAS_DAP_CTRL_SEL_DAP_SDATA1_TX_RX_P |
                                                            ^

Signed-off-by: Pierre-Louis Bossart <pierre-louis.bossart@linux.intel.com>
Acked-by: Thierry Reding <treding@nvidia.com>
Link: https://lore.kernel.org/r/20210326215927.936377-13-pierre-louis.bossart@linux.intel.com
Signed-off-by: Mark Brown <broonie@kernel.org>
3 years agoASoC: sunxi: sun8i-codec: clarify expression
Pierre-Louis Bossart [Fri, 26 Mar 2021 21:59:21 +0000 (16:59 -0500)]
ASoC: sunxi: sun8i-codec: clarify expression

cppcheck warning:

sound/soc/sunxi/sun8i-codec.c:488:28: style: Clarify calculation
precedence for '%' and '?'. [clarifyCalculation]
 return sample_rate % 4000 ? 22579200 : 24576000;
                           ^

Signed-off-by: Pierre-Louis Bossart <pierre-louis.bossart@linux.intel.com>
Acked-by: Maxime Ripard <maxime@cerno.tech>
Link: https://lore.kernel.org/r/20210326215927.936377-12-pierre-louis.bossart@linux.intel.com
Signed-off-by: Mark Brown <broonie@kernel.org>
3 years agoASoC: stm: stm32_adfsdm: fix snprintf format string
Pierre-Louis Bossart [Fri, 26 Mar 2021 21:59:20 +0000 (16:59 -0500)]
ASoC: stm: stm32_adfsdm: fix snprintf format string

cppcheck warning:

sound/soc/stm/stm32_adfsdm.c:120:2: warning: %d in format
string (no. 1) requires 'int' but the argument type is 'unsigned
int'. [invalidPrintfArgType_sint]
 snprintf(str_freq, sizeof(str_freq), "%d\n", freq);
 ^

Signed-off-by: Pierre-Louis Bossart <pierre-louis.bossart@linux.intel.com>
Link: https://lore.kernel.org/r/20210326215927.936377-11-pierre-louis.bossart@linux.intel.com
Signed-off-by: Mark Brown <broonie@kernel.org>
3 years agoASoC: sti: uniperif: align function prototypes
Pierre-Louis Bossart [Fri, 26 Mar 2021 21:59:19 +0000 (16:59 -0500)]
ASoC: sti: uniperif: align function prototypes

cppcheck warning:

sound/soc/sti/uniperif_player.c:1049:24: style:inconclusive: Function
'uni_player_init' argument 2 names different: declaration 'uni_player'
definition 'player'. [funcArgNamesDifferent]
      struct uniperif *player)
                       ^
sound/soc/sti/uniperif.h:1375:24: note: Function 'uni_player_init'
argument 2 names different: declaration 'uni_player' definition
'player'.
      struct uniperif *uni_player);
                       ^
sound/soc/sti/uniperif_player.c:1049:24: note: Function
'uni_player_init' argument 2 names different: declaration 'uni_player'
definition 'player'.
      struct uniperif *player)
                       ^
sound/soc/sti/uniperif_reader.c:411:24: style:inconclusive: Function
'uni_reader_init' argument 2 names different: declaration 'uni_reader'
definition 'reader'. [funcArgNamesDifferent]
      struct uniperif *reader)
                       ^
sound/soc/sti/uniperif.h:1380:24: note: Function 'uni_reader_init'
argument 2 names different: declaration 'uni_reader' definition
'reader'.
      struct uniperif *uni_reader);
                       ^
sound/soc/sti/uniperif_reader.c:411:24: note: Function
'uni_reader_init' argument 2 names different: declaration 'uni_reader'
definition 'reader'.
      struct uniperif *reader)
                       ^

Signed-off-by: Pierre-Louis Bossart <pierre-louis.bossart@linux.intel.com>
Reviewed-by: Arnaud Pouliquen <arnaud.pouliquen@st.com>
Link: https://lore.kernel.org/r/20210326215927.936377-10-pierre-louis.bossart@linux.intel.com
Signed-off-by: Mark Brown <broonie@kernel.org>
3 years agoASoC: sti: sti_uniperif: add missing error check
Pierre-Louis Bossart [Fri, 26 Mar 2021 21:59:18 +0000 (16:59 -0500)]
ASoC: sti: sti_uniperif: add missing error check

cppcheck warning:

sound/soc/sti/sti_uniperif.c:490:6: style: Variable 'ret' is
reassigned a value before the old one has been
used. [redundantAssignment]
 ret = devm_snd_soc_register_component(&pdev->dev,
     ^
sound/soc/sti/sti_uniperif.c:486:6: note: ret is assigned
 ret = sti_uniperiph_cpu_dai_of(node, priv);
     ^
sound/soc/sti/sti_uniperif.c:490:6: note: ret is overwritten
 ret = devm_snd_soc_register_component(&pdev->dev,
     ^

sti_uniperiph_cpu_dai_of() can return -EINVAL which seems like a
good-enough reason to bail.

Signed-off-by: Pierre-Louis Bossart <pierre-louis.bossart@linux.intel.com>
Reviewed-by: Arnaud Pouliquen <arnaud.pouliquen@st.com>
Link: https://lore.kernel.org/r/20210326215927.936377-9-pierre-louis.bossart@linux.intel.com
Signed-off-by: Mark Brown <broonie@kernel.org>
3 years agoASoC: pxa: remove useless assignment
Pierre-Louis Bossart [Fri, 26 Mar 2021 21:59:17 +0000 (16:59 -0500)]
ASoC: pxa: remove useless assignment

cppcheck warning:

sound/soc/pxa/mmp-pcm.c:207:10: style: Variable 'ret' is assigned a
value that is never used. [unreadVariable]
 int ret = 0, stream;
         ^

Signed-off-by: Pierre-Louis Bossart <pierre-louis.bossart@linux.intel.com>
Link: https://lore.kernel.org/r/20210326215927.936377-8-pierre-louis.bossart@linux.intel.com
Signed-off-by: Mark Brown <broonie@kernel.org>
3 years agoASoC: meson: axg-tdmout: remove useless assignment
Pierre-Louis Bossart [Fri, 26 Mar 2021 21:59:16 +0000 (16:59 -0500)]
ASoC: meson: axg-tdmout: remove useless assignment

cppcheck complains about potential null pointer dereference but it's
rather an unnecessary assignment to NULL before walking through a
list.

Signed-off-by: Pierre-Louis Bossart <pierre-louis.bossart@linux.intel.com>
Link: https://lore.kernel.org/r/20210326215927.936377-7-pierre-louis.bossart@linux.intel.com
Signed-off-by: Mark Brown <broonie@kernel.org>
3 years agoASoC: meson: axg-tdmin: remove useless assignment
Pierre-Louis Bossart [Fri, 26 Mar 2021 21:59:15 +0000 (16:59 -0500)]
ASoC: meson: axg-tdmin: remove useless assignment

cppcheck complains about potential null pointer dereference but it's
rather an unnecessary assignment to NULL before walking through a
list.

Signed-off-by: Pierre-Louis Bossart <pierre-louis.bossart@linux.intel.com>
Link: https://lore.kernel.org/r/20210326215927.936377-6-pierre-louis.bossart@linux.intel.com
Signed-off-by: Mark Brown <broonie@kernel.org>
3 years agoASoC: bcm: cygnus_ssp: remove useless initialization
Pierre-Louis Bossart [Fri, 26 Mar 2021 21:59:14 +0000 (16:59 -0500)]
ASoC: bcm: cygnus_ssp: remove useless initialization

Cppcheck warning:

sound/soc/bcm/cygnus-ssp.c:1364:6: style: Redundant initialization for
'err'. The initialized value is overwritten before it is
read. [redundantInitialization]
 err = devm_snd_soc_register_component(dev, &cygnus_ssp_component,
     ^
sound/soc/bcm/cygnus-ssp.c:1313:10: note: err is initialized
 int err = -EINVAL;
         ^
sound/soc/bcm/cygnus-ssp.c:1364:6: note: err is overwritten
 err = devm_snd_soc_register_component(dev, &cygnus_ssp_component,
     ^

Signed-off-by: Pierre-Louis Bossart <pierre-louis.bossart@linux.intel.com>
Link: https://lore.kernel.org/r/20210326215927.936377-5-pierre-louis.bossart@linux.intel.com
Signed-off-by: Mark Brown <broonie@kernel.org>
3 years agoASoC: atmel: atmel-i2s: remove useless initialization
Pierre-Louis Bossart [Fri, 26 Mar 2021 21:59:13 +0000 (16:59 -0500)]
ASoC: atmel: atmel-i2s: remove useless initialization

Cppcheck complains:

sound/soc/atmel/atmel-i2s.c:628:6: style: Redundant initialization for 'err'. The initialized value is overwritten before it is read. [redundantInitialization]
 err = devm_request_irq(&pdev->dev, irq, atmel_i2s_interrupt, 0,
     ^
sound/soc/atmel/atmel-i2s.c:598:10: note: err is initialized
 int err = -ENXIO;
         ^
sound/soc/atmel/atmel-i2s.c:628:6: note: err is overwritten
 err = devm_request_irq(&pdev->dev, irq, atmel_i2s_interrupt, 0,
     ^

Signed-off-by: Pierre-Louis Bossart <pierre-louis.bossart@linux.intel.com>
Reviewed-by: Codrin Ciubotariu <codrin.ciubotariu@microchip.com>
Link: https://lore.kernel.org/r/20210326215927.936377-4-pierre-louis.bossart@linux.intel.com
Signed-off-by: Mark Brown <broonie@kernel.org>
3 years agoASoC: atmel: fix shadowed variable
Pierre-Louis Bossart [Fri, 26 Mar 2021 21:59:12 +0000 (16:59 -0500)]
ASoC: atmel: fix shadowed variable

Fix cppcheck warning:

sound/soc/atmel/atmel-classd.c:51:14: style: Local variable 'pwm_type'
shadows outer variable [shadowVariable]
 const char *pwm_type;
             ^
sound/soc/atmel/atmel-classd.c:226:27: note: Shadowed declaration
static const char * const pwm_type[] = {
                          ^
sound/soc/atmel/atmel-classd.c:51:14: note: Shadow variable
 const char *pwm_type;
             ^

Signed-off-by: Pierre-Louis Bossart <pierre-louis.bossart@linux.intel.com>
Reviewed-by: Codrin Ciubotariu <codrin.ciubotariu@microchip.com>
Link: https://lore.kernel.org/r/20210326215927.936377-3-pierre-louis.bossart@linux.intel.com
Signed-off-by: Mark Brown <broonie@kernel.org>
3 years agoASoC: amd: renoir: acp3x-pdm-dma: remove unnecessary assignments
Pierre-Louis Bossart [Fri, 26 Mar 2021 21:59:11 +0000 (16:59 -0500)]
ASoC: amd: renoir: acp3x-pdm-dma: remove unnecessary assignments

cppcheck warning:

sound/soc/amd/renoir/acp3x-pdm-dma.c:132:17: style: Variable
'pdm_dma_enable' is assigned a value that is never
used. [unreadVariable]
 pdm_dma_enable = 0x00;
                ^
sound/soc/amd/renoir/acp3x-pdm-dma.c:156:18: style: Variable
'pdm_dma_enable' is assigned a value that is never
used. [unreadVariable]
  pdm_dma_enable = 0x00;
                 ^

indeed those values are never used because the timeout is reset.

Signed-off-by: Pierre-Louis Bossart <pierre-louis.bossart@linux.intel.com>
Link: https://lore.kernel.org/r/20210326215927.936377-2-pierre-louis.bossart@linux.intel.com
Signed-off-by: Mark Brown <broonie@kernel.org>