platform/kernel/linux-rpi.git
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: 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>
3 years agoASoC: soc-core: use device_unregister() if rtd allocation failed
Kuninori Morimoto [Tue, 30 Mar 2021 05:26:38 +0000 (14:26 +0900)]
ASoC: soc-core: use device_unregister() if rtd allocation failed

Because soc_free_pcm_runtime(rtd) checks rtd pointer and freeing
rtd->xxx, it doesn't work correctly in case of rtd allocation failed.

We need to use device_unregister(dev) in such case.
This patch fixup it.

Signed-off-by: Kuninori Morimoto <kuninori.morimoto.gx@renesas.com>
Link: https://lore.kernel.org/r/87r1jxxldd.wl-kuninori.morimoto.gx@renesas.com
Signed-off-by: Mark Brown <broonie@kernel.org>
3 years agoASoC: soc-core: add comment for rtd freeing
Kuninori Morimoto [Tue, 30 Mar 2021 05:26:28 +0000 (14:26 +0900)]
ASoC: soc-core: add comment for rtd freeing

We don't need to mind freeing for rtd,
because it was created from devm_kzalloc(dev, xxx) which is rtd->dev.

This means, if rtd->dev was freed, rtd will be also freed
automatically.

soc_new_pcm_runtime(...)
{
...
rtd = devm_kzalloc(dev, ...);
rtd->dev = dev;
...
}

This explanation was missing at soc_free_pcm_runtime() comment.
This patch indicates it.

Signed-off-by: Kuninori Morimoto <kuninori.morimoto.gx@renesas.com>
Link: https://lore.kernel.org/r/87sg4dxldn.wl-kuninori.morimoto.gx@renesas.com
Signed-off-by: Mark Brown <broonie@kernel.org>
3 years agoASoC: dt-bindings: socionext: Use audio-graph-port schema
Rob Herring [Wed, 31 Mar 2021 14:27:48 +0000 (09:27 -0500)]
ASoC: dt-bindings: socionext: Use audio-graph-port schema

Convert the Socionext audio schemas to use audio-graph-port.yaml schema
for 'port' nodes.

The number and numbering of port nodes should be documented, but is not.
Leave a FIXME here so others don't copy.

Cc: Masahiro Yamada <yamada.masahiro@socionext.com>
Cc: Liam Girdwood <lgirdwood@gmail.com>
Cc: Mark Brown <broonie@kernel.org>
Signed-off-by: Rob Herring <robh@kernel.org>
Link: https://lore.kernel.org/r/20210331142748.2163272-4-robh@kernel.org
Signed-off-by: Mark Brown <broonie@kernel.org>
3 years agoASoC: dt-bindings: Use OF graph schema
Rob Herring [Wed, 31 Mar 2021 14:27:47 +0000 (09:27 -0500)]
ASoC: dt-bindings: Use OF graph schema

Now that we have an OF graph schema, let's use it for the
audio-graph-port schema.

Cc: Liam Girdwood <lgirdwood@gmail.com>
Cc: Mark Brown <broonie@kernel.org>
Cc: Kuninori Morimoto <kuninori.morimoto.gx@renesas.com>
Cc: alsa-devel@alsa-project.org
Signed-off-by: Rob Herring <robh@kernel.org>
Link: https://lore.kernel.org/r/20210331142748.2163272-3-robh@kernel.org
Signed-off-by: Mark Brown <broonie@kernel.org>
3 years agoASoC: dt-bindings: Move port/ports properties out of audio-graph-port.yaml
Rob Herring [Wed, 31 Mar 2021 14:27:46 +0000 (09:27 -0500)]
ASoC: dt-bindings: Move port/ports properties out of audio-graph-port.yaml

Users of the audio-graph-port schema need to define how many ports
and what each port is, so they need to define 'ports' and/or 'port'
anyways. Let's drop 'ports' and 'port' from the schema and adjust users
to reference audio-graph-port.yaml from a port property.

Cc: Liam Girdwood <lgirdwood@gmail.com>
Cc: Mark Brown <broonie@kernel.org>
Cc: Thierry Reding <thierry.reding@gmail.com>
Cc: Jonathan Hunter <jonathanh@nvidia.com>
Cc: Kuninori Morimoto <kuninori.morimoto.gx@renesas.com>
Cc: Lubomir Rintel <lkundrak@v3.sk>
Cc: Sameer Pujar <spujar@nvidia.com>
Cc: alsa-devel@alsa-project.org
Cc: linux-tegra@vger.kernel.org
Signed-off-by: Rob Herring <robh@kernel.org>
Link: https://lore.kernel.org/r/20210331142748.2163272-2-robh@kernel.org
Signed-off-by: Mark Brown <broonie@kernel.org>
3 years agoASoC: da732x: simplify code
Pierre-Louis Bossart [Fri, 26 Mar 2021 22:16:19 +0000 (17:16 -0500)]
ASoC: da732x: simplify code

cppcheck reports a false positive:

sound/soc/codecs/da732x.c:1161:25: warning: Either the condition
'indiv<0' is redundant or there is division by zero at line
1161. [zerodivcond]
 fref = (da732x->sysclk / indiv);
                        ^
sound/soc/codecs/da732x.c:1158:12: note: Assuming that condition
'indiv<0' is not redundant
 if (indiv < 0)
           ^
sound/soc/codecs/da732x.c:1161:25: note: Division by zero
 fref = (da732x->sysclk / indiv);
                        ^

The code is awfully convoluted/confusing and can be simplified with a
single variable and the BIT macro.

Signed-off-by: Pierre-Louis Bossart <pierre-louis.bossart@linux.intel.com>
Link: https://lore.kernel.org/r/20210326221619.949961-3-pierre-louis.bossart@linux.intel.com
Signed-off-by: Mark Brown <broonie@kernel.org>
3 years agoASoC: lm49453: fix useless assignment before return
Pierre-Louis Bossart [Fri, 26 Mar 2021 22:16:18 +0000 (17:16 -0500)]
ASoC: lm49453: fix useless assignment before return

Cppcheck warning:

sound/soc/codecs/lm49453.c:1210:11: style: Variable 'pll_clk' is
assigned a value that is never used. [unreadVariable]

  pll_clk = BIT(4);
          ^

FIXME: What is the correct fix?
/* fll clk slection */
pll_clk = BIT(4);
return 0;

is the assignment redundant or the 'return 0' a mistake?

Signed-off-by: Pierre-Louis Bossart <pierre-louis.bossart@linux.intel.com>
Link: https://lore.kernel.org/r/20210326221619.949961-2-pierre-louis.bossart@linux.intel.com
Signed-off-by: Mark Brown <broonie@kernel.org>
3 years agoMerge tag 'mute-led-rework' of https://git.kernel.org/pub/scm/linux/kernel/git/tiwai...
Mark Brown [Wed, 31 Mar 2021 16:16:14 +0000 (17:16 +0100)]
Merge tag 'mute-led-rework' of https://git./linux/kernel/git/tiwai/sound into asoc-5.13

ALSA: control - add generic LED API

This patchset tries to resolve the diversity in the audio LED
control among the ALSA drivers. A new control layer registration
is introduced which allows to run additional operations on
top of the elementary ALSA sound controls.

A new control access group (three bits in the access flags)
was introduced to carry the LED group information for
the sound controls. The low-level sound drivers can just
mark those controls using this access group. This information
is not exported to the user space, but user space can
manage the LED sound control associations through sysfs
(last patch) per Mark's request. It makes things fully
configurable in the kernel and user space (UCM).

The actual state ('route') evaluation is really easy
(the minimal value check for all channels / controls / cards).
If there's more complicated logic for a given hardware,
the card driver may eventually export a new read-only
sound control for the LED group and do the logic itself.

The new LED trigger control code is completely separated
and possibly optional (there's no symbol dependency).
The full code separation allows eventually to move this
LED trigger control to the user space in future.
Actually it replaces the already present functionality
in the kernel space (HDA drivers) and allows a quick adoption
for the recent hardware (ASoC codecs including SoundWire).

snd_ctl_led            24576  0

The sound driver implementation is really easy:

1) call snd_ctl_led_request() when control LED layer should be
   automatically activated
   / it calls module_request("snd-ctl-led") on demand /
2) mark all related kcontrols with
        SNDRV_CTL_ELEM_ACCESS_SPK_LED or
        SNDRV_CTL_ELEM_ACCESS_MIC_LED

Link: https://lore.kernel.org/r/20210317172945.842280-1-perex@perex.cz
Signed-off-by: Takashi Iwai <tiwai@suse.de>
3 years agoMerge series "ASoC: simple-card: cleanup and prepare for Multi CPU/Codec support...
Mark Brown [Wed, 31 Mar 2021 14:53:49 +0000 (15:53 +0100)]
Merge series "ASoC: simple-card: cleanup and prepare for Multi CPU/Codec 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 user customization.

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 cleanup and prepare for Multi-CPU/Codec support.

Kuninori Morimoto (6):
  ASoC: simple-card-utils.c: remove old comment
  ASoC: simple-card-utils: alloc dai_link information for CPU/Codec/Platform
  ASoC: audio-graph: count DAI / link numbers as in order
  ASoC: audio-graph: cleanup graph_for_each_link()
  ASoC: simple-card: count DAI / link numbers as in order
  ASoC: simple-card: cleanup graph_for_each_link()

 include/sound/simple_card_utils.h     |   7 +-
 sound/soc/generic/audio-graph-card.c  | 112 +++++++++++++------------
 sound/soc/generic/simple-card-utils.c |  20 +++--
 sound/soc/generic/simple-card.c       | 115 +++++++++++++++-----------
 4 files changed, 143 insertions(+), 111 deletions(-)

--
2.25.1

3 years agoASoC: rt1019: add address-cells and size-cells information
Jack Yu [Wed, 31 Mar 2021 07:10:46 +0000 (15:10 +0800)]
ASoC: rt1019: add address-cells and size-cells information

Add address-cells and size-cells information to fix warnings
for rt1019.yaml.

Signed-off-by: Jack Yu <jack.yu@realtek.com>
Link: https://lore.kernel.org/r/20210331071046.12526-1-jack.yu@realtek.com
Signed-off-by: Mark Brown <broonie@kernel.org>
3 years agoASoC: tegra: Set driver name explicitly
Thierry Reding [Tue, 30 Mar 2021 18:06:57 +0000 (20:06 +0200)]
ASoC: tegra: Set driver name explicitly

The SoC sound core will generate a driver name by normalizing the card
name. However, most of the time that name does not tell anything about
the driver and is therefore useless for this purpose.

Make the driver name more useful by setting it explicitly during card
initialization.

Signed-off-by: Thierry Reding <treding@nvidia.com>
Link: https://lore.kernel.org/r/20210330180657.1867971-1-thierry.reding@gmail.com
Signed-off-by: Mark Brown <broonie@kernel.org>
3 years agoASoC: Intel: Fix a typo
Bhaskar Chowdhury [Mon, 22 Mar 2021 06:49:09 +0000 (12:19 +0530)]
ASoC: Intel: Fix a typo

s/struture/structure/

Signed-off-by: Bhaskar Chowdhury <unixbhaskar@gmail.com>
Link: https://lore.kernel.org/r/20210322064909.4189290-1-unixbhaskar@gmail.com
Signed-off-by: Mark Brown <broonie@kernel.org>
3 years agoASoC: dt-bindings: ak5558: Add compatible string for ak5552
Shengjiu Wang [Wed, 31 Mar 2021 07:44:46 +0000 (15:44 +0800)]
ASoC: dt-bindings: ak5558: Add compatible string for ak5552

Add compatible string "asahi-kasei,ak5552" for ak5552

Signed-off-by: Shengjiu Wang <shengjiu.wang@nxp.com>
Acked-by: Rob Herring <robh@kernel.org>
Link: https://lore.kernel.org/r/1617176686-25528-2-git-send-email-shengjiu.wang@nxp.com
Signed-off-by: Mark Brown <broonie@kernel.org>
3 years agoASoC: ak5558: Add support for ak5552
Viorel Suman [Wed, 31 Mar 2021 07:44:45 +0000 (15:44 +0800)]
ASoC: ak5558: Add support for ak5552

AK5552 is a 32-bit 2ch ADC and has the same register
map as AK5558.

Signed-off-by: Viorel Suman <viorel.suman@nxp.com>
Signed-off-by: Shengjiu Wang <shengjiu.wang@nxp.com>
Link: https://lore.kernel.org/r/1617176686-25528-1-git-send-email-shengjiu.wang@nxp.com
Signed-off-by: Mark Brown <broonie@kernel.org>
3 years agoASoC: Intel: bytcr_rt5640: Add quirk for the Chuwi Hi8 tablet
Hans de Goede [Thu, 25 Mar 2021 22:10:54 +0000 (23:10 +0100)]
ASoC: Intel: bytcr_rt5640: Add quirk for the Chuwi Hi8 tablet

The Chuwi Hi8 tablet is using an analog mic on IN1 and has its
jack-detect connected to JD2_IN4N, instead of using the default
IN3 for its internal mic and JD1_IN4P for jack-detect.

It also only has 1 speaker.

Add a quirk applying the correct settings for this configuration.

Signed-off-by: Hans de Goede <hdegoede@redhat.com>
Link: https://lore.kernel.org/r/20210325221054.22714-1-hdegoede@redhat.com
Signed-off-by: Mark Brown <broonie@kernel.org>
3 years agoASoC: simple-card: cleanup graph_for_each_link()
Kuninori Morimoto [Fri, 26 Mar 2021 03:26:40 +0000 (12:26 +0900)]
ASoC: simple-card: cleanup graph_for_each_link()

simple-card checks DT links 2 times. 1st is for counting DAIs / links
to allocating memory, 2nd is for detecting DAIs.
To detecting DAIs as CPU-dummy -> dummy-Codec order when DPCM case,
it uses  loops 2 times.
Because of this kind of complex background, it needs to use local
varuable for it, and each call-back functions need to care about it.

Now, 1st and 2nd DT link check are using same order,
thus we can share same code. This patch do it.

Signed-off-by: Kuninori Morimoto <kuninori.morimoto.gx@renesas.com>
Link: https://lore.kernel.org/r/875z1e1tov.wl-kuninori.morimoto.gx@renesas.com
Signed-off-by: Mark Brown <broonie@kernel.org>
3 years agoASoC: simple-card: count DAI / link numbers as in order
Kuninori Morimoto [Fri, 26 Mar 2021 03:26:33 +0000 (12:26 +0900)]
ASoC: simple-card: count DAI / link numbers as in order

simple-card checks DT links 2 times. 1st is for counting DAIs / links
to allocating memory, 2nd is for detecting DAIs.
To detecting DAIs as CPU-dummy -> dummy-Codec order when DPCM case,
it uses loops 2 times at 2nd DT link check.
But it doesn't do it at 1st DT link check.

for (li.cpu = 1; li.cpu >= 0; li.cpu--) {
/*
 * Detect all CPU first, and Detect all Codec 2n
 *
 * In Normal sound case, all DAIs are detected
 * as "CPU-Codec".
 *
 * In DPCM sound case,
 * all CPUs   are detected as "CPU-dummy", and
 * all Codecs are detected as "dummy-Codec".
 * To avoid random sub-device numbering,
 * detect "dummy-Codec" in last;
 */
ret = simple_for_each_link(...);
...
}

To prepare supporting multi-CPU/Codec, and code cleanup,
this patch use same loop for 1st DT link check, too.

Signed-off-by: Kuninori Morimoto <kuninori.morimoto.gx@renesas.com>
Link: https://lore.kernel.org/r/877dlu1tp2.wl-kuninori.morimoto.gx@renesas.com
Signed-off-by: Mark Brown <broonie@kernel.org>
3 years agoASoC: audio-graph: cleanup graph_for_each_link()
Kuninori Morimoto [Fri, 26 Mar 2021 03:26:20 +0000 (12:26 +0900)]
ASoC: audio-graph: cleanup graph_for_each_link()

audio-graph checks DT links 2 times. 1st is for counting DAIs / links
to allocating memory, 2nd is for detecting DAIs.
To detecting DAIs as CPU-dummy -> dummy-Codec order when DPCM case,
it uses  loops 2 times.
Because of this kind of complex background, it needs to use local
varuable for it, and each call-back functions need to care about it.

Now, 1st and 2nd DT link check are using same order,
thus we can share same code. This patch do it.

Signed-off-by: Kuninori Morimoto <kuninori.morimoto.gx@renesas.com>
Link: https://lore.kernel.org/r/878s6a1tpf.wl-kuninori.morimoto.gx@renesas.com
Signed-off-by: Mark Brown <broonie@kernel.org>
3 years agoASoC: audio-graph: count DAI / link numbers as in order
Kuninori Morimoto [Fri, 26 Mar 2021 03:26:11 +0000 (12:26 +0900)]
ASoC: audio-graph: count DAI / link numbers as in order

audio-graph checks DT links 2 times. 1st is for counting DAIs / links
to allocating memory, 2nd is for detecting DAIs.
To detecting DAIs as CPU-dummy -> dummy-Codec order when DPCM case,
it uses loops 2 times at 2nd DT link check.
But it doesn't do it at 1st DT link check.

for (li.cpu = 1; li.cpu >= 0; li.cpu--) {
/*
 * Detect all CPU first, and Detect all Codec 2n
 *
 * In Normal sound case, all DAIs are detected
 * as "CPU-Codec".
 *
 * In DPCM sound case,
 * all CPUs   are detected as "CPU-dummy", and
 * all Codecs are detected as "dummy-Codec".
 * To avoid random sub-device numbering,
 * detect "dummy-Codec" in last;
 */
ret = graph_for_each_link(...);
...
}

To prepare supporting multi-CPU/Codec, and code cleanup,
this patch use same loop for 1st DT link check, too.

Signed-off-by: Kuninori Morimoto <kuninori.morimoto.gx@renesas.com>
Link: https://lore.kernel.org/r/87a6qq1tpp.wl-kuninori.morimoto.gx@renesas.com
Signed-off-by: Mark Brown <broonie@kernel.org>
3 years agoASoC: simple-card-utils: alloc dai_link information for CPU/Codec/Platform
Kuninori Morimoto [Fri, 26 Mar 2021 03:26:06 +0000 (12:26 +0900)]
ASoC: simple-card-utils: alloc dai_link information for CPU/Codec/Platform

simple-card / audio-graph are assuming single CPU/Codec/Platform on
dai_link. Because of it, it is difficult to support Multi-CPU/Codec.

This patch allocs CPU/Codec/Platform dai_link imformation
instead of using existing props information. It can update to
multi-CPU/Codec, but is still assuming single-CPU/Codec for now.

Signed-off-by: Kuninori Morimoto <kuninori.morimoto.gx@renesas.com>
Link: https://lore.kernel.org/r/87blb61tpv.wl-kuninori.morimoto.gx@renesas.com
Signed-off-by: Mark Brown <broonie@kernel.org>
3 years agoASoC: simple-card-utils.c: remove old comment
Kuninori Morimoto [Fri, 26 Mar 2021 03:25:57 +0000 (12:25 +0900)]
ASoC: simple-card-utils.c: remove old comment

commit adb76b5b9c474 ("ASoC: soc-core: remove legacy style dai_link")
removed snd_soc_init_multicodec(). The comment on asoc_simple_init_priv()
is no longer needed. This patch removes it.

Signed-off-by: Kuninori Morimoto <kuninori.morimoto.gx@renesas.com>
Link: https://lore.kernel.org/r/87czvm1tq2.wl-kuninori.morimoto.gx@renesas.com
Signed-off-by: Mark Brown <broonie@kernel.org>
3 years agoASoC: dt-bindings: nvidia, tegra210-ahub: Add missing child nodes
Rob Herring [Fri, 26 Mar 2021 19:50:03 +0000 (13:50 -0600)]
ASoC: dt-bindings: nvidia, tegra210-ahub: Add missing child nodes

The nvidia,tegra210-ahub binding is missing schema for child nodes. This
results in warnings if 'additionalProperties: false' is set (or when the
tools implement 'unevaluatedProperties' support). Add the child nodes
and reference their schema if one exists.

Cc: Liam Girdwood <lgirdwood@gmail.com>
Cc: Mark Brown <broonie@kernel.org>
Cc: Thierry Reding <thierry.reding@gmail.com>
Cc: Jonathan Hunter <jonathanh@nvidia.com>
Cc: Sameer Pujar <spujar@nvidia.com>
Cc: alsa-devel@alsa-project.org
Cc: linux-tegra@vger.kernel.org
Signed-off-by: Rob Herring <robh@kernel.org>
Acked-by: Thierry Reding <treding@nvidia.com>
Acked-by: Sameer Pujar <spujar@nvidia.com>
Link: https://lore.kernel.org/r/20210326195003.3756394-1-robh@kernel.org
Signed-off-by: Mark Brown <broonie@kernel.org>
3 years agoALSA: led control - add sysfs kcontrol LED marking layer
Jaroslav Kysela [Wed, 17 Mar 2021 17:29:45 +0000 (18:29 +0100)]
ALSA: led control - add sysfs kcontrol LED marking layer

We need to manage the kcontrol entries association for the LED trigger
from the user space. This patch adds a layer to the sysfs tree like:

/sys/devices/virtual/sound/ctl-led/mic
   + card0
   |  + attach
   |  + detach
   |  ...
   + card1
      + attach
      ...

Operations:

  attach and detach
    - amixer style ID is accepted and easy strings for numid and
      simple names
  reset
    - reset all associated kcontrol entries
  list
    - list associated kcontrol entries (numid values only)

Additional symlinks:

/sys/devices/virtual/sound/ctl-led/mic/card0/card ->
  /sys/class/sound/card0

/sys/class/sound/card0/controlC0/led-mic ->
  /sys/devices/virtual/sound/ctl-led/mic/card0

Signed-off-by: Jaroslav Kysela <perex@perex.cz>
Link: https://lore.kernel.org/r/20210317172945.842280-7-perex@perex.cz
Signed-off-by: Takashi Iwai <tiwai@suse.de>
3 years agoALSA: control - add sysfs support to the LED trigger module
Jaroslav Kysela [Wed, 17 Mar 2021 17:29:44 +0000 (18:29 +0100)]
ALSA: control - add sysfs support to the LED trigger module

Create SYSFS/devices/virtual/sound/ctl-led tree
(with SYSFS/class/sound/ctl-led symlink).

  speaker/
    +-- mode
    +-- brightness
  mic/
    +-- mode
    +-- brightness

Copy the idea from the HDA driver and allow to set the audio
LEDs based on the various modes:

- follow mute
- follow moute (inverted to follow mute)
- off
- on

Also, the actual LED state is exposed.

Signed-off-by: Jaroslav Kysela <perex@perex.cz>
Link: https://lore.kernel.org/r/20210317172945.842280-6-perex@perex.cz
Signed-off-by: Takashi Iwai <tiwai@suse.de>
3 years agoALSA: HDA - remove the custom implementation for the audio LED trigger
Jaroslav Kysela [Wed, 17 Mar 2021 17:29:43 +0000 (18:29 +0100)]
ALSA: HDA - remove the custom implementation for the audio LED trigger

With the new snd-ctl-led module, we have a generic way
to trigger audio LEDs based on the sound control changes.

Remove the custom implementation from the HDA driver.

Move the LED initialization before snd_hda_gen_parse_auto_config()
call in all drivers to create marked controls there.

Signed-off-by: Jaroslav Kysela <perex@perex.cz>
Link: https://lore.kernel.org/r/20210317172945.842280-5-perex@perex.cz
Signed-off-by: Takashi Iwai <tiwai@suse.de>
3 years agoALSA: control - add generic LED trigger module as the new control layer
Jaroslav Kysela [Wed, 17 Mar 2021 17:29:42 +0000 (18:29 +0100)]
ALSA: control - add generic LED trigger module as the new control layer

The recent laptops have usually two LEDs assigned to reflect
the speaker and microphone mute state. This implementation
adds a tiny layer on top of the control API which calculates
the state for those LEDs using the driver callbacks.

Two new access flags are introduced to describe the controls
which affects the audio path settings (an easy code change
for drivers).

The LED resource can be shared with multiple sound cards with
this code. The user space controls may be added to the state
chain on demand, too.

This code should replace the LED code in the HDA driver and
add a possibility to easy extend the other drivers (ASoC
codecs etc.).

Signed-off-by: Jaroslav Kysela <perex@perex.cz>
Link: https://lore.kernel.org/r/20210317172945.842280-4-perex@perex.cz
Signed-off-by: Takashi Iwai <tiwai@suse.de>