platform/kernel/linux-starfive.git
4 years agoASoC: fsl_easrc: mark PM functions __maybe_unused
Arnd Bergmann [Tue, 28 Apr 2020 21:28:08 +0000 (23:28 +0200)]
ASoC: fsl_easrc: mark PM functions __maybe_unused

ifdefs are hard, and in this driver the suspend/resume functions are
the only callers of some other helpers that trigger a harmless warning
when CONFIG_PM is disabled:

sound/soc/fsl/fsl_easrc.c:1807:12: warning: 'fsl_easrc_get_firmware' defined but not used [-Wunused-function]
 1807 | static int fsl_easrc_get_firmware(struct fsl_asrc *easrc)
      |            ^~~~~~~~~~~~~~~~~~~~~~
sound/soc/fsl/fsl_easrc.c:303:12: warning: 'fsl_easrc_resampler_config' defined but not used [-Wunused-function]
  303 | static int fsl_easrc_resampler_config(struct fsl_asrc *easrc)
      |            ^~~~~~~~~~~~~~~~~~~~~~~~~~

Remove the #ifdef and just mark the callers as __maybe_unused to
suppress the warnings altogether.

Fixes: 955ac624058f ("ASoC: fsl_easrc: Add EASRC ASoC CPU DAI drivers")
Signed-off-by: Arnd Bergmann <arnd@arndb.de>
Acked-by: Nicolin Chen <nicoleotsuka@gmail.com>
Link: https://lore.kernel.org/r/20200428212847.2926376-1-arnd@arndb.de
Signed-off-by: Mark Brown <broonie@kernel.org>
4 years agoASoC: mxs-saif: Fix unused assignment
Tang Bin [Wed, 29 Apr 2020 09:38:23 +0000 (17:38 +0800)]
ASoC: mxs-saif: Fix unused assignment

Delete unused initialized value, because 'ret' will be assigined
by the function of_alias_get_id().

Signed-off-by: Zhang Shengju <zhangshengju@cmss.chinamobile.com>
Signed-off-by: Tang Bin <tangbin@cmss.chinamobile.com>
Link: https://lore.kernel.org/r/20200429093823.1372-1-tangbin@cmss.chinamobile.com
Signed-off-by: Mark Brown <broonie@kernel.org>
4 years agoASoc: nau8810: add AUX related dapm widgets and routes
Seven Lee [Wed, 29 Apr 2020 09:00:02 +0000 (17:00 +0800)]
ASoc: nau8810: add AUX related dapm widgets and routes

This patch implements the following features:
- AUX input for recording.
- An input AUX output to SPK/MOUT.

Signed-off-by: Seven Lee <wtli@nuvoton.com>
Link: https://lore.kernel.org/r/20200429090002.28556-1-wtli@nuvoton.com
Signed-off-by: Mark Brown <broonie@kernel.org>
4 years agoASoC: codecs: wm97xx: fix ac97 dependency
Arnd Bergmann [Tue, 28 Apr 2020 21:26:59 +0000 (23:26 +0200)]
ASoC: codecs: wm97xx: fix ac97 dependency

A recent build fix got the dependency slightly wrong, breaking
builds with CONFIG_AC97_BUS_NEW:

WARNING: unmet direct dependencies detected for SND_SOC_WM9713
  Depends on [n]: SOUND [=y] && !UML && SND [=y] && SND_SOC [=y] && SND_SOC_AC97_BUS [=n]
  Selected by [m]:
  - SND_SOC_ZYLONITE [=m] && SOUND [=y] && !UML && SND [=y] && SND_SOC [=y] && SND_PXA2XX_SOC [=m] && MACH_ZYLONITE [=y] && AC97_BUS [=n]=n

WARNING: unmet direct dependencies detected for SND_SOC_WM9712
  Depends on [n]: SOUND [=y] && !UML && SND [=y] && SND_SOC [=y] && SND_SOC_AC97_BUS [=n]
  Selected by [m]:
  - SND_PXA2XX_SOC_EM_X270 [=m] && SOUND [=y] && !UML && SND [=y] && SND_SOC [=y] && SND_PXA2XX_SOC [=m] && (MACH_EM_X270 [=n] || MACH_EXEDA [=n] || MACH_CM_X300 [=y]) && AC97_BUS [=n]=n

Change the dependency to allow either version of the AC97 library
code.

Fixes: 5a309875787d ("ASoC: Fix SND_SOC_ALL_CODECS imply ac97 fallout")
Signed-off-by: Arnd Bergmann <arnd@arndb.de>
Acked-by: Charles Keepax <ckeepax@opensource.cirrus.com>
Link: https://lore.kernel.org/r/20200428212721.2877627-1-arnd@arndb.de
Signed-off-by: Mark Brown <broonie@kernel.org>
4 years agoASoC: component: suppress uninitialized-variable warning
Arnd Bergmann [Tue, 28 Apr 2020 21:47:31 +0000 (23:47 +0200)]
ASoC: component: suppress uninitialized-variable warning

Old versions of gcc (tested on gcc-4.8) produce a warning for
correct code:

sound/soc/soc-compress.c: In function 'soc_compr_open':
sound/soc/soc-compress.c:75:28: error: 'component' is used uninitialized in this function [-Werror=uninitialized]
  struct snd_soc_component *component, *save = NULL;

Change the for_each_rtd_components() macro to ensure 'component'
gets initialized to a value the compiler does not complain about.

Signed-off-by: Arnd Bergmann <arnd@arndb.de>
Link: https://lore.kernel.org/r/20200428214754.3925368-1-arnd@arndb.de
Signed-off-by: Mark Brown <broonie@kernel.org>
4 years agoMerge series "Kconfig updates for DMIC and SOF HDMI support" from Ranjani Sridharan...
Mark Brown [Tue, 28 Apr 2020 15:40:38 +0000 (16:40 +0100)]
Merge series "Kconfig updates for DMIC and SOF HDMI support" from Ranjani Sridharan <ranjani.sridharan@linux.intel.com>:

This series provides the following updtes to the Intel machine driver
Kconfig:

1. The first patch adds the explicit dependency on GPIOLIB when
SND_SOC_DMIC is selected.

2. SND_SOC_SOF_HDA_AUDIO_CODEC is required for using the legacy
HDA codec driver for HDMI support in SOF. The last 3 three patches
make the required changes to account for this.

Libin Yang (3):
  ASoC: intel: add depends on SND_SOC_SOF_HDA_AUDIO_CODEC for common
    hdmi
  ASoC: sof-sdw: remove CONFIG_SND_SOC_SOF_HDA_AUDIO_CODEC condition
  ASoC: sof_pcm512x: remove CONFIG_SND_HDA_CODEC_HDMI condition

Pierre-Louis Bossart (1):
  ASoC: Intel: boards: add explicit dependency on GPIOLIB when DMIC is
    used

 sound/soc/intel/boards/Kconfig        | 51 ++++++++++++++-------------
 sound/soc/intel/boards/sof_pcm512x.c  |  9 -----
 sound/soc/intel/boards/sof_sdw.c      |  8 -----
 sound/soc/intel/boards/sof_sdw_hdmi.c |  7 ----
 4 files changed, 26 insertions(+), 49 deletions(-)

--
2.17.1

4 years agoMerge series "add channel constraint for BDW machine drivers" from Brent Lu <brent...
Mark Brown [Tue, 28 Apr 2020 15:40:37 +0000 (16:40 +0100)]
Merge series "add channel constraint for BDW machine drivers" from Brent Lu <brent.lu@intel.com>:

The machine driver bdw-rt5650 (for Google buddy) supports 2 or 4-channel
recording while other two drivers support only 2-channel recording. HW
constraints are implemented to reflect the hardware limitation on BDW
platform.

Changes since v1:
- Change the patch title.
- Remove the DUAL_CHANNEL and QUAD_CHANNEL macros which are too obvious.
- Follow the naming convertion, using 'bdw_rt5650_' and 'bdw_rt5677_' to
  name startup functions.
- Refine the comments in startup functions.
- Redesign the bdw_rt5650_fe_startup() function for readability.
- Add an assignment to initialize runtime->hw.channels_max variable.

Brent Lu (3):
  ASoC: bdw-rt5677: add channel constraint
  ASoC: bdw-rt5650: add channel constraint
  ASoC: broadwell: add channel constraint

 sound/soc/intel/boards/bdw-rt5650.c | 29 +++++++++++++++++++++++++++++
 sound/soc/intel/boards/bdw-rt5677.c | 26 ++++++++++++++++++++++++++
 sound/soc/intel/boards/broadwell.c  | 26 ++++++++++++++++++++++++++
 3 files changed, 81 insertions(+)

--
2.7.4

4 years agoASoC: tegra: tegra_wm8903: Use devm_snd_soc_register_card()
Wei Yongjun [Tue, 28 Apr 2020 11:07:42 +0000 (11:07 +0000)]
ASoC: tegra: tegra_wm8903: Use devm_snd_soc_register_card()

Using devm_snd_soc_register_card() can make the code
shorter and cleaner.

Signed-off-by: Wei Yongjun <weiyongjun1@huawei.com>
Link: https://lore.kernel.org/r/20200428110742.110335-1-weiyongjun1@huawei.com
Signed-off-by: Mark Brown <broonie@kernel.org>
4 years agoMerge branch 'for-5.7' of https://git.kernel.org/pub/scm/linux/kernel/git/broonie...
Mark Brown [Tue, 28 Apr 2020 15:05:35 +0000 (16:05 +0100)]
Merge branch 'for-5.7' of https://git./linux/kernel/git/broonie/sound into asoc-5.8

4 years agoASoC: broadwell: add channel constraint
Brent Lu [Mon, 27 Apr 2020 17:13:34 +0000 (01:13 +0800)]
ASoC: broadwell: add channel constraint

BDW boards using this machine driver supports only stereo capture and
playback. Implement a constraint to enforce it.

Signed-off-by: Brent Lu <brent.lu@intel.com>
Acked-by: Pierre-Louis Bossart <pierre-louis.bossart@linux.intel.com>
Link: https://lore.kernel.org/r/1588007614-25061-4-git-send-email-brent.lu@intel.com
Signed-off-by: Mark Brown <broonie@kernel.org>
4 years agoASoC: bdw-rt5650: add channel constraint
Brent Lu [Mon, 27 Apr 2020 17:13:33 +0000 (01:13 +0800)]
ASoC: bdw-rt5650: add channel constraint

BDW boards using this machine driver supports only 2 or 4-channel capture.
Implement a constraint to enforce it.

Signed-off-by: Brent Lu <brent.lu@intel.com>
Acked-by: Pierre-Louis Bossart <pierre-louis.bossart@linux.intel.com>
Link: https://lore.kernel.org/r/1588007614-25061-3-git-send-email-brent.lu@intel.com
Signed-off-by: Mark Brown <broonie@kernel.org>
4 years agoASoC: bdw-rt5677: add channel constraint
Brent Lu [Mon, 27 Apr 2020 17:13:32 +0000 (01:13 +0800)]
ASoC: bdw-rt5677: add channel constraint

BDW boards using this machine driver supports only stereo capture and
playback. Implement a constraint to enforce it.

Signed-off-by: Brent Lu <brent.lu@intel.com>
Acked-by: Pierre-Louis Bossart <pierre-louis.bossart@linux.intel.com>
Link: https://lore.kernel.org/r/1588007614-25061-2-git-send-email-brent.lu@intel.com
Signed-off-by: Mark Brown <broonie@kernel.org>
4 years agoASoC: Intel: boards: add explicit dependency on GPIOLIB when DMIC is used
Pierre-Louis Bossart [Mon, 27 Apr 2020 16:52:08 +0000 (09:52 -0700)]
ASoC: Intel: boards: add explicit dependency on GPIOLIB when DMIC is used

SND_SOC_DMIC depends on GPIOLIB, so let's add the dependency before
selecting SND_SOC_DMIC.

Signed-off-by: Pierre-Louis Bossart <pierre-louis.bossart@linux.intel.com>
Signed-off-by: Ranjani Sridharan <ranjani.sridharan@linux.intel.com>
Reviewed-by: Guennadi Liakhovetski <guennadi.liakhovetski@linux.intel.com>
Reviewed-by: Kai Vehmanen <kai.vehmanen@linux.intel.com>
Link: https://lore.kernel.org/r/20200427165211.23463-2-ranjani.sridharan@linux.intel.com
Signed-off-by: Mark Brown <broonie@kernel.org>
4 years agoASoC: Intel: Skylake: Automatic DMIC format configuration according to information...
Mateusz Gorski [Mon, 27 Apr 2020 13:27:27 +0000 (15:27 +0200)]
ASoC: Intel: Skylake: Automatic DMIC format configuration according to information from NHLT

Automatically choose DMIC pipeline format configuration depending on
information included in NHLT.
Change the access rights of appropriate kcontrols to read-only in order
to prevent user interference.

Signed-off-by: Mateusz Gorski <mateusz.gorski@linux.intel.com>
Reviewed-by: Cezary Rojewski <cezary.rojewski@intel.com>
Reviewed-by: Pierre-Louis Bossart <pierre-louis.bossart@linux.intel.com>
Link: https://lore.kernel.org/r/20200427132727.24942-4-mateusz.gorski@linux.intel.com
Signed-off-by: Mark Brown <broonie@kernel.org>
4 years agoASoC: Intel: Multiple I/O PCM format support for pipe
Mateusz Gorski [Mon, 27 Apr 2020 13:27:26 +0000 (15:27 +0200)]
ASoC: Intel: Multiple I/O PCM format support for pipe

For pipes supporting multiple input/output formats, kcontrol is
created and selection of pipe input and output configuration
is done based on control set.

If more than one configuration is supported, then this patch
allows user to select configuration of choice
using amixer settings.

Signed-off-by: Mateusz Gorski <mateusz.gorski@linux.intel.com>
Signed-off-by: Pavan K S <pavan.k.s@intel.com>
Reviewed-by: Cezary Rojewski <cezary.rojewski@intel.com>
Reviewed-by: Pierre-Louis Bossart <pierre-louis.bossart@linux.intel.com>
Link: https://lore.kernel.org/r/20200427132727.24942-3-mateusz.gorski@linux.intel.com
Signed-off-by: Mark Brown <broonie@kernel.org>
4 years agoASoC: Intel: Skylake: Add alternative topology binary name
Mateusz Gorski [Mon, 27 Apr 2020 13:27:25 +0000 (15:27 +0200)]
ASoC: Intel: Skylake: Add alternative topology binary name

Add alternative topology binary file name based on used machine driver
and fallback to use this name after failed attempt to load topology file
with name based on NHLT.
This change addresses multiple issues with current mechanism, for
example - there are devices without NHLT table, and that currently
results in tplg_name being empty.

Signed-off-by: Mateusz Gorski <mateusz.gorski@linux.intel.com>
Reviewed-by: Cezary Rojewski <cezary.rojewski@intel.com>
Reviewed-by: Pierre-Louis Bossart <pierre-louis.bossart@linux.intel.com>
Link: https://lore.kernel.org/r/20200427132727.24942-2-mateusz.gorski@linux.intel.com
Signed-off-by: Mark Brown <broonie@kernel.org>
4 years agoASoC: hisilicon: Use the defined variable to clean code
Tang Bin [Mon, 27 Apr 2020 09:15:20 +0000 (17:15 +0800)]
ASoC: hisilicon: Use the defined variable to clean code

Use the defined variable "dev" to make the code cleaner.

Signed-off-by: Zhang Shengju <zhangshengju@cmss.chinamobile.com>
Signed-off-by: Tang Bin <tangbin@cmss.chinamobile.com>
Link: https://lore.kernel.org/r/20200427091520.12412-1-tangbin@cmss.chinamobile.com
Signed-off-by: Mark Brown <broonie@kernel.org>
4 years agoASoC: fsl_easrc: Check for null pointer before dereferencing "ctx" in fsl_easrc_hw_free()
Shengjiu Wang [Sat, 25 Apr 2020 07:19:29 +0000 (15:19 +0800)]
ASoC: fsl_easrc: Check for null pointer before dereferencing "ctx" in fsl_easrc_hw_free()

The patch 955ac624058f: "ASoC: fsl_easrc: Add EASRC ASoC CPU DAI
drivers" from Apr 16, 2020, leads to the following Smatch complaint:

sound/soc/fsl/fsl_easrc.c:1529 fsl_easrc_hw_free()
warn: variable dereferenced before check 'ctx' (see line 1527)

sound/soc/fsl/fsl_easrc.c
  1526          struct fsl_asrc_pair *ctx = runtime->private_data;
  1527          struct fsl_easrc_ctx_priv *ctx_priv = ctx->private;
                                                      ^^^^^
Dereference

  1528
  1529          if (ctx && (ctx_priv->ctx_streams & BIT(substream->stream))) {
                    ^^^
This check is too late, to prevent a NULL dereference.

  1530                  ctx_priv->ctx_streams &= ~BIT(substream->stream);
  1531                  fsl_easrc_release_context(ctx);

Fixes: 955ac624058f ("ASoC: fsl_easrc: Add EASRC ASoC CPU DAI drivers")
Reported-by: Dan Carpenter <dan.carpenter@oracle.com>
Signed-off-by: Shengjiu Wang <shengjiu.wang@nxp.com>
Acked-by: Nicolin Chen <nicoleotsuka@gmail.com>
Link: https://lore.kernel.org/r/d23c939f1c9eeb3fce34b6c34d44e2d6156f663a.1587799355.git.shengjiu.wang@nxp.com
Signed-off-by: Mark Brown <broonie@kernel.org>
4 years agoASoC: ti: remove comparison to bool in omap_mcbsp_dai_set_dai_fmt()
Jason Yan [Sun, 26 Apr 2020 09:42:38 +0000 (17:42 +0800)]
ASoC: ti: remove comparison to bool in omap_mcbsp_dai_set_dai_fmt()

Fix the following coccicheck warning:

sound/soc/ti/omap-mcbsp.c:1188:5-11: WARNING: Comparison to bool

Signed-off-by: Jason Yan <yanaijie@huawei.com>
Acked-by: Jarkko Nikula <jarkko.nikula@bitmer.com>
Link: https://lore.kernel.org/r/20200426094238.23914-1-yanaijie@huawei.com
Signed-off-by: Mark Brown <broonie@kernel.org>
4 years agoASoC: mxs-saif: Avoid unnecessary check
Tang Bin [Mon, 20 Apr 2020 14:25:09 +0000 (22:25 +0800)]
ASoC: mxs-saif: Avoid unnecessary check

The function mxs_saif_probe() is only called with an
openfirmware platform device. Therefore there is no
need to check that it has an openfirmware node.

Signed-off-by: Shengju Zhang <zhangshengju@cmss.chinamobile.com>
Signed-off-by: Tang Bin <tangbin@cmss.chinamobile.com>
Link: https://lore.kernel.org/r/20200420142509.9728-1-tangbin@cmss.chinamobile.com
Signed-off-by: Mark Brown <broonie@kernel.org>
4 years agoASoC: Intel: sof_sdw: add amp number in components string for ucm
randerwang [Sun, 19 Apr 2020 18:35:09 +0000 (02:35 +0800)]
ASoC: Intel: sof_sdw: add amp number in components string for ucm

The number of speaker amplifiers may vary between platforms. UCM
needs to check amp number to include different configuration files.
This patch keeps track of the number of speaker amplifiers and
stores it in components string of the card.

Tested on Comet Lake platforms.

Signed-off-by: randerwang <rander.wang@linux.intel.com>
Signed-off-by: Pierre-Louis Bossart <pierre-louis.bossart@linux.intel.com>
Signed-off-by: Bard Liao <yung-chuan.liao@linux.intel.com>
Reviewed-by: Guennadi Liakhovetski <guennadi.liakhovetski@linux.intel.com>
Link: https://lore.kernel.org/r/20200419183509.4134-1-yung-chuan.liao@linux.intel.com
Signed-off-by: Mark Brown <broonie@kernel.org>
4 years agoASoC: hisilicon: Use IS_ERR() instead of IS_ERR_OR_NULL()
Tang Bin [Mon, 27 Apr 2020 09:11:45 +0000 (17:11 +0800)]
ASoC: hisilicon: Use IS_ERR() instead of IS_ERR_OR_NULL()

In the function hi6210_i2s_probe(), devm_clk_get() doesn't return NULL.
Thus use IS_ERR() to validate the return value instead of IS_ERR_OR_NULL().

Signed-off-by: Zhang Shengju <zhangshengju@cmss.chinamobile.com>
Signed-off-by: Tang Bin <tangbin@cmss.chinamobile.com>
Link: https://lore.kernel.org/r/20200427091145.4268-1-tangbin@cmss.chinamobile.com
Signed-off-by: Mark Brown <broonie@kernel.org>
4 years agoASoC: fsl_esai: Disable exception interrupt before scheduling tasklet
Shengjiu Wang [Mon, 27 Apr 2020 06:23:21 +0000 (14:23 +0800)]
ASoC: fsl_esai: Disable exception interrupt before scheduling tasklet

Disable exception interrupt before scheduling tasklet, otherwise if
the tasklet isn't handled immediately, there will be endless xrun
interrupt.

Fixes: 7ccafa2b3879 ("ASoC: fsl_esai: recover the channel swap after xrun")
Signed-off-by: Shengjiu Wang <shengjiu.wang@nxp.com>
Acked-by: Nicolin Chen <nicoleotsuka@gmail.com>
Link: https://lore.kernel.org/r/a8f2ad955aac9e52587beedc1133b3efbe746895.1587968824.git.shengjiu.wang@nxp.com
Signed-off-by: Mark Brown <broonie@kernel.org>
4 years agoASoC: snd-sof-intel-hda-common - add hda_model parameter and pass it to HDA codec...
Jaroslav Kysela [Fri, 24 Apr 2020 09:25:20 +0000 (11:25 +0200)]
ASoC: snd-sof-intel-hda-common - add hda_model parameter and pass it to HDA codec driver

It may be useful to pass the specific model to the generic HDA codec
routines like the legacy HDA driver (snd-hda-intel) allows.
The model name "sofbus" is tricky anyway.

Original proposal: https://lore.kernel.org/alsa-devel/20191203161908.7496-1-perex@perex.cz/

Signed-off-by: Jaroslav Kysela <perex@perex.cz>
Reviewed-by: Takashi Iwai <tiwai@suse.de>
Reviewed-by: Kai Vehmanen <kai.vehmanen@linux.intel.com>
Cc: Pierre-Louis Bossart <pierre-louis.bossart@linux.intel.com>
Cc: Mark Brown <broonie@kernel.org>
Link: https://lore.kernel.org/r/20200424092520.23989-1-perex@perex.cz
Signed-off-by: Mark Brown <broonie@kernel.org>
4 years agoASoC: soc-compress: avoid false-positive Wuninitialized warning
Rong Chen [Fri, 24 Apr 2020 00:54:37 +0000 (08:54 +0800)]
ASoC: soc-compress: avoid false-positive Wuninitialized warning

gcc-6.5 and earlier show a new warning:

sound/soc/soc-compress.c: In function ‘soc_compr_open’:
sound/soc/soc-compress.c:75:28: warning: ‘component’ is used uninitialized in this function [-Wuninitialized]
  struct snd_soc_component *component, *save = NULL;
                              ^~~~~~~~~

Simplest fix is to initialize it to avoid the warning.

Reported-by: kbuild test robot <lkp@intel.com>
Signed-off-by: Rong Chen <rong.a.chen@intel.com>
Acked-by: Kuninori Morimoto <kuninori.morimoto.gx@renesas.com>
Cc: Kuninori Morimoto <kuninori.morimoto.gx@renesas.com>
Link: https://lore.kernel.org/lkml/202004201540.vYPhhYMs%25lkp@intel.com
Link: https://lore.kernel.org/r/20200424005437.3941-1-rong.a.chen@intel.com
Signed-off-by: Mark Brown <broonie@kernel.org>
4 years agoASoC: wm8962: set CLOCKING2 as non-volatile register
Shengjiu Wang [Fri, 24 Apr 2020 02:01:38 +0000 (10:01 +0800)]
ASoC: wm8962: set CLOCKING2 as non-volatile register

Previously CLOCKING2 is set as a volatile register, but cause
issue at suspend & resume, that some bits of CLOCKING2 is not
restored at resume, for example SYSCLK_SRC bits, then the output
clock is wrong.

The volatile property is caused by CLASSD_CLK_DIV bits,
which are controlled by the chip itself. But the datasheet
claims these are read only and protected by the security key,
and they are not read by the driver at all.

So it should be safe to change CLOCKING2 to be non-volatile.

Signed-off-by: Shengjiu Wang <shengjiu.wang@nxp.com>
Acked-by: Charles Keepax <ckeepax@opensource.cirrus.com>
Link: https://lore.kernel.org/r/6d25d5b36d4b9aeb8655b5e947dad52214e34177.1587693523.git.shengjiu.wang@nxp.com
Signed-off-by: Mark Brown <broonie@kernel.org>
4 years agoASoC: SOF: Add missing dependency on IMX_SCU
Mark Brown [Thu, 23 Apr 2020 14:28:05 +0000 (15:28 +0100)]
ASoC: SOF: Add missing dependency on IMX_SCU

This broke PowerPC allyesconfig.

Reported-by: Stephen Rothwell <sfr@canb.auug.org.au>
Signed-off-by: Mark Brown <broonie@kernel.org>
Link: https://lore.kernel.org/r/20200423142805.52757-1-broonie@kernel.org
Signed-off-by: Mark Brown <broonie@kernel.org>
4 years agoASoC: fsl_easrc: fix spelling mistake "prefitler" -> "prefilter"
Colin Ian King [Thu, 23 Apr 2020 08:39:22 +0000 (09:39 +0100)]
ASoC: fsl_easrc: fix spelling mistake "prefitler" -> "prefilter"

There is a spelling mistake in a deb_dbg message, fix it.

Signed-off-by: Colin Ian King <colin.king@canonical.com>
Link: https://lore.kernel.org/r/20200423083922.8159-1-colin.king@canonical.com
Signed-off-by: Mark Brown <broonie@kernel.org>
4 years agoASoC: Intel: Skylake: Replace guid_copy() with import_guid()
Andy Shevchenko [Wed, 22 Apr 2020 13:04:43 +0000 (16:04 +0300)]
ASoC: Intel: Skylake: Replace guid_copy() with import_guid()

There is a specific API to treat raw data as GUID, i.e. import_guid().
Use it instead of guid_copy() with explicit casting.

Signed-off-by: Andy Shevchenko <andriy.shevchenko@linux.intel.com>
Link: https://lore.kernel.org/r/20200422130443.38815-1-andriy.shevchenko@linux.intel.com
Signed-off-by: Mark Brown <broonie@kernel.org>
4 years agoASoC: dmic: Allow GPIO operations to sleep
Mark Brown [Wed, 22 Apr 2020 08:35:50 +0000 (09:35 +0100)]
ASoC: dmic: Allow GPIO operations to sleep

If there is a power GPIO provided we control it from DAPM context so there
is no problem with a sleeping GPIO, use the _cansleep() version of the API
to allow this.

Signed-off-by: Mark Brown <broonie@kernel.org>
Reviewed-by: Tzung-Bi Shih <tzungbi@google.com>
Link: https://lore.kernel.org/r/20200422083550.50711-1-broonie@kernel.org
Signed-off-by: Mark Brown <broonie@kernel.org>
4 years agoASoC: soc-core: return true, false in snd_soc_volsw_is_stereo()
Jason Yan [Wed, 22 Apr 2020 07:18:05 +0000 (15:18 +0800)]
ASoC: soc-core: return true, false in snd_soc_volsw_is_stereo()

Fix the following coccicheck warning:

include/sound/soc.h:1271:9-10: WARNING: return of 0/1 in function
'snd_soc_volsw_is_stereo' with return type bool

Signed-off-by: Jason Yan <yanaijie@huawei.com>
Link: https://lore.kernel.org/r/20200422071805.48793-1-yanaijie@huawei.com
Signed-off-by: Mark Brown <broonie@kernel.org>
4 years agoASoC: SOF: Fix build
Mark Brown [Wed, 22 Apr 2020 11:07:10 +0000 (12:07 +0100)]
ASoC: SOF: Fix build

The recent batch of SOF changes failed to build on some x86
configurations including an allmodconfig, revert the commits:

e150ef4169a76  ASoC: SOF: Introduce extended manifest
371091417864b  ASoC: SOF: ext_manifest: parse firmware version
7c024b948c206  ASoC: SOF: ext_manifest: parse compiler version
9e72f13ee541c  ASoC: SOF: ext_manifest: parse windows

to fix this.

Reported-by: Stephen Rothwell <sfr@canb.auug.org.au>
Signed-off-by: Mark Brown <broonie@kernel.org>
4 years agoMerge tag 'tegra-for-5.7-asoc' of git://git.kernel.org/pub/scm/linux/kernel/git/tegra...
Mark Brown [Wed, 22 Apr 2020 07:51:44 +0000 (08:51 +0100)]
Merge tag 'tegra-for-5.7-asoc' of git://git./linux/kernel/git/tegra/linux into asoc-5.7

ASoC: tegra: Fixes for v5.7-rc3

This contains a couple of fixes that are needed to properly reconfigure
the audio clocks on older Tegra devices.

4 years agoASoC: intel/skl/hda - fix oops on systems without i915 audio codec
Kai Vehmanen [Mon, 20 Apr 2020 20:54:31 +0000 (23:54 +0300)]
ASoC: intel/skl/hda - fix oops on systems without i915 audio codec

Recent fix for jack detection caused a regression on systems with HDA
audio codec but no HDMI/DP audio via i915 graphics, leading to a kernel
oops at device probe. On these systems, HDA bus instance lookup fails,
as the first ASoC runtime of the card is connected to a dummy codec
(as no HDMI codec is present).

Fixes: 3a24f135e6cc ("ASoC: intel/skl/hda - set autosuspend timeout for hda codecs")
Signed-off-by: Kai Vehmanen <kai.vehmanen@linux.intel.com>
Reviewed-by: Pierre-Louis Bossart <pierre-louis.bossart@linux.intel.com>
Reviewed-by: Ranjani Sridharan <ranjani.sridharan@linux.intel.com>
Link: https://lore.kernel.org/r/20200420205431.13070-1-kai.vehmanen@linux.intel.com
Signed-off-by: Mark Brown <broonie@kernel.org>
4 years agoMerge series "ASoC: Add new module driver for new ASRC" from Shengjiu Wang <shengjiu...
Mark Brown [Tue, 21 Apr 2020 18:22:09 +0000 (19:22 +0100)]
Merge series "ASoC: Add new module driver for new ASRC" from Shengjiu Wang <shengjiu.wang@nxp.com>:

Add new module driver for new ASRC in i.MX8MN, several commits
are added for new property fsl,asrc-format

Shengjiu Wang (7):
  ASoC: fsl_asrc: rename asrc_priv to asrc
  ASoC: dt-bindings: fsl_asrc: Add new property fsl,asrc-format
  ASoC: fsl-asoc-card: Support new property fsl,asrc-format
  ASoC: fsl_asrc: Support new property fsl,asrc-format
  ASoC: fsl_asrc: Move common definition to fsl_asrc_common
  ASoC: dt-bindings: fsl_easrc: Add document for EASRC
  ASoC: fsl_easrc: Add EASRC ASoC CPU DAI drivers

changes in v9
- use lowercase for dt example.

changes in v8
- change get_pair_priv_size to pair_priv_size variable

changes in v7
- updated according to Nicoin's comments.
- add get_pair_priv_size to replace PAIR_PRIVATE_SIZE

changes in v6
- updated according to Nicoin's and Rob's comments.

changes in v5
- Add new property fsl,asrc-format, rather than change fsl,asrc-width
  to fsl,asrc-formt.
- code change for above change.

changes in v4
- Add several commit for changing DT binding asrc-width to asrc-format
- rename asrc_priv to asrc

changes in v3
- add new commit "ASoC: fsl_asrc: Change asrc_width to asrc_format"
- modify binding doc to yaml format
- remove fsl_easrc_dma.c, make fsl_asrc_dma.c useable for easrc.

changes in v2
- change i.MX815 to i.MX8MN
- Add changes in Kconfig and Makefile

 .../devicetree/bindings/sound/fsl,asrc.txt    |    4 +
 .../devicetree/bindings/sound/fsl,easrc.yaml  |  101 +
 sound/soc/fsl/Kconfig                         |   11 +
 sound/soc/fsl/Makefile                        |    2 +
 sound/soc/fsl/fsl-asoc-card.c                 |   24 +-
 sound/soc/fsl/fsl_asrc.c                      |  305 +--
 sound/soc/fsl/fsl_asrc.h                      |   74 +-
 sound/soc/fsl/fsl_asrc_common.h               |  106 +
 sound/soc/fsl/fsl_asrc_dma.c                  |   54 +-
 sound/soc/fsl/fsl_easrc.c                     | 2114 +++++++++++++++++
 sound/soc/fsl/fsl_easrc.h                     |  651 +++++
 11 files changed, 3212 insertions(+), 234 deletions(-)
 create mode 100644 Documentation/devicetree/bindings/sound/fsl,easrc.yaml
 create mode 100644 sound/soc/fsl/fsl_asrc_common.h
 create mode 100644 sound/soc/fsl/fsl_easrc.c
 create mode 100644 sound/soc/fsl/fsl_easrc.h

--
2.21.0

4 years agoMerge series "ASoC: add snd_compress_ops and replace" from Kuninori Morimoto <kuninor...
Mark Brown [Tue, 21 Apr 2020 18:22:08 +0000 (19:22 +0100)]
Merge series "ASoC: add snd_compress_ops and replace" from Kuninori Morimoto <kuninori.morimoto.gx@renesas.com>:

Hi Mark

Current snd_soc_component_driver has compr_ops,
but it is created for ALSA, not for ALSA SoC.
This means it doesn't know the callback is for which component,
thus, each callback needs to get component via lookup function.

It is not good design, and will not work in the future,
because ASoC can have multipul same name component which
current lookup function can't handle.

This v2 patch-set adds new snd_compress_ops and call
callbacks with component.
v1 is here

Link: https://lore.kernel.org/alsa-devel/87blnqpuqp.wl-kuninori.morimoto.gx@renesas.com/
Kuninori Morimoto (8):
  ASoC: soc-compress: add snd_compress_ops
  ASoC: codec: wm_adsp: use snd_compress_ops
  ASoC: uniphier: use snd_compress_ops
  ASoC: qcom: q6sp6: use snd_compress_ops
  ASoC: intel: atom: use snd_compress_ops
  ASoC: sof: use snd_compress_ops
  ASoC: sprd: use snd_compress_ops
  ASoC: soc-compress: remove snd_compr_ops

 include/sound/soc-component.h                 | 40 ++++++++-
 sound/soc/codecs/cs47l15.c                    |  9 +-
 sound/soc/codecs/cs47l24.c                    |  8 +-
 sound/soc/codecs/cs47l35.c                    |  9 +-
 sound/soc/codecs/cs47l85.c                    |  9 +-
 sound/soc/codecs/cs47l90.c                    |  9 +-
 sound/soc/codecs/cs47l92.c                    |  9 +-
 sound/soc/codecs/wm5102.c                     |  9 +-
 sound/soc/codecs/wm5110.c                     |  8 +-
 sound/soc/codecs/wm_adsp.c                    | 18 ++--
 sound/soc/codecs/wm_adsp.h                    | 18 ++--
 .../intel/atom/sst-mfld-platform-compress.c   | 43 +++++----
 sound/soc/intel/atom/sst-mfld-platform-pcm.c  |  2 +-
 sound/soc/intel/atom/sst-mfld-platform.h      |  2 +-
 sound/soc/qcom/qdsp6/q6asm-dai.c              | 51 ++++++-----
 sound/soc/soc-compress.c                      | 89 ++++++++++---------
 sound/soc/sof/compress.c                      |  7 +-
 sound/soc/sof/compress.h                      |  7 +-
 sound/soc/sof/pcm.c                           |  4 +-
 sound/soc/sof/sof-priv.h                      |  2 +-
 sound/soc/sprd/sprd-pcm-compress.c            | 49 +++++-----
 sound/soc/sprd/sprd-pcm-dma.c                 |  2 +-
 sound/soc/sprd/sprd-pcm-dma.h                 |  2 +-
 sound/soc/uniphier/aio-compress.c             | 45 ++++++----
 sound/soc/uniphier/aio-dma.c                  |  2 +-
 sound/soc/uniphier/aio.h                      |  2 +-
 26 files changed, 265 insertions(+), 190 deletions(-)

--
2.17.1

4 years agoASoC: Add initial ZL38060 driver
Sven Van Asbroeck [Fri, 17 Apr 2020 22:13:41 +0000 (18:13 -0400)]
ASoC: Add initial ZL38060 driver

The ZL38060 is a "Connected Home Audio Processor" from Microsemi,
which consists of a Digital Signal Processor (DSP), several Digital
Audio Interfaces (DAIs), analog outputs, and a block of 14 GPIOs.

This driver supports only a tiny subset of the chip's functionality
and possible configurations:
- bypass mode (whole dsp block is bypassed)
- chip's I2S DAI routed directly to/from DACs and microphone
- chip's internal clock is driven by a 12 MHz external crystal
- chip's DAI connected to CPU is I2S, and bit + frame clock master
- chip must be strapped for "host boot": in this mode, firmware will
  be provided by this driver.

Signed-off-by: Sven Van Asbroeck <TheSven73@gmail.com>
Link: https://lore.kernel.org/r/20200417221341.31428-2-TheSven73@gmail.com
Signed-off-by: Mark Brown <broonie@kernel.org>
4 years agodt-bindings: sound: add Microsemi ZL38060 binding
Sven Van Asbroeck [Fri, 17 Apr 2020 22:13:40 +0000 (18:13 -0400)]
dt-bindings: sound: add Microsemi ZL38060 binding

Add devicetree binding for the Microsemi ZL38060 Connected
Home Audio Processor.

Signed-off-by: Sven Van Asbroeck <TheSven73@gmail.com>
Link: https://lore.kernel.org/r/20200417221341.31428-1-TheSven73@gmail.com
Signed-off-by: Mark Brown <broonie@kernel.org>
4 years agoASoC: soc-compress: remove snd_compr_ops
Kuninori Morimoto [Mon, 20 Apr 2020 07:10:15 +0000 (16:10 +0900)]
ASoC: soc-compress: remove snd_compr_ops

snd_compr_ops couldn't care called component,
but now we can care it via snd_compress_ops.
All drivers switched to it.
This patch removes snd_compr_ops.

Signed-off-by: Kuninori Morimoto <kuninori.morimoto.gx@renesas.com>
Tested-by: Charles Keepax <ckeepax@opensource.cirrus.com>
Reviewed-by: Charles Keepax <ckeepax@opensource.cirrus.com>
Reviewed-by: Ranjani Sridharan <ranjani.sridharan@linux.intel.com>
Link: https://lore.kernel.org/r/87lfmqvdig.wl-kuninori.morimoto.gx@renesas.com
Signed-off-by: Mark Brown <broonie@kernel.org>
4 years agoASoC: sprd: use snd_compress_ops
Kuninori Morimoto [Mon, 20 Apr 2020 07:10:00 +0000 (16:10 +0900)]
ASoC: sprd: use snd_compress_ops

We can use snd_compress_ops.
Let's switch to use it.

Signed-off-by: Kuninori Morimoto <kuninori.morimoto.gx@renesas.com>
Reviewed-by: Ranjani Sridharan <ranjani.sridharan@linux.intel.com>
Link: https://lore.kernel.org/r/87mu76vdiv.wl-kuninori.morimoto.gx@renesas.com
Signed-off-by: Mark Brown <broonie@kernel.org>
4 years agoASoC: sof: use snd_compress_ops
Kuninori Morimoto [Mon, 20 Apr 2020 07:09:48 +0000 (16:09 +0900)]
ASoC: sof: use snd_compress_ops

We can use snd_compress_ops.
Let's switch to use it.

Upstream code doesn't have sof_compressed_ops.
This patch assume it is implemented at out-of-tree.

Signed-off-by: Kuninori Morimoto <kuninori.morimoto.gx@renesas.com>
Reviewed-by: Ranjani Sridharan <ranjani.sridharan@linux.intel.com>
Link: https://lore.kernel.org/r/87o8rmvdj7.wl-kuninori.morimoto.gx@renesas.com
Signed-off-by: Mark Brown <broonie@kernel.org>
4 years agoASoC: intel: atom: use snd_compress_ops
Kuninori Morimoto [Mon, 20 Apr 2020 07:09:09 +0000 (16:09 +0900)]
ASoC: intel: atom: use snd_compress_ops

vWe can use snd_compress_ops.
Let's switch to use it.

Signed-off-by: Kuninori Morimoto <kuninori.morimoto.gx@renesas.com>
Reviewed-by: Ranjani Sridharan <ranjani.sridharan@linux.intel.com>
Link: https://lore.kernel.org/r/87pnc2vdka.wl-kuninori.morimoto.gx@renesas.com
Signed-off-by: Mark Brown <broonie@kernel.org>
4 years agoASoC: qcom: q6sp6: use snd_compress_ops
Kuninori Morimoto [Mon, 20 Apr 2020 07:08:44 +0000 (16:08 +0900)]
ASoC: qcom: q6sp6: use snd_compress_ops

We can use snd_compress_ops.
Let's switch to use it.

Signed-off-by: Kuninori Morimoto <kuninori.morimoto.gx@renesas.com>
Reviewed-by: Ranjani Sridharan <ranjani.sridharan@linux.intel.com>
Link: https://lore.kernel.org/r/87r1wivdkz.wl-kuninori.morimoto.gx@renesas.com
Signed-off-by: Mark Brown <broonie@kernel.org>
4 years agoASoC: uniphier: use snd_compress_ops
Kuninori Morimoto [Mon, 20 Apr 2020 07:08:30 +0000 (16:08 +0900)]
ASoC: uniphier: use snd_compress_ops

We can use snd_compress_ops.
Let's switch to use it.

Signed-off-by: Kuninori Morimoto <kuninori.morimoto.gx@renesas.com>
Reviewed-by: Ranjani Sridharan <ranjani.sridharan@linux.intel.com>
Link: https://lore.kernel.org/r/87sggyvdld.wl-kuninori.morimoto.gx@renesas.com
Signed-off-by: Mark Brown <broonie@kernel.org>
4 years agoASoC: codec: wm_adsp: use snd_compress_ops
Kuninori Morimoto [Mon, 20 Apr 2020 07:08:13 +0000 (16:08 +0900)]
ASoC: codec: wm_adsp: use snd_compress_ops

We can use snd_compress_ops.
Let's switch to use it.

Signed-off-by: Kuninori Morimoto <kuninori.morimoto.gx@renesas.com>
Tested-by: Charles Keepax <ckeepax@opensource.cirrus.com>
Reviewed-by: Ranjani Sridharan <ranjani.sridharan@linux.intel.com>
Acked-by: Charles Keepax <ckeepax@opensource.cirrus.com>
Link: https://lore.kernel.org/r/87tv1evdlu.wl-kuninori.morimoto.gx@renesas.com
Signed-off-by: Mark Brown <broonie@kernel.org>
4 years agoASoC: soc-compress: add snd_compress_ops
Kuninori Morimoto [Mon, 20 Apr 2020 07:07:50 +0000 (16:07 +0900)]
ASoC: soc-compress: add snd_compress_ops

Current snd_soc_component_driver has compr_ops, and each driver can
have callback via it. But, it is mainly created for ALSA, thus, it
doesn't have "component" as parameter.
Thus, each callback can't know it is called for which component.
Each callback currently is getting "component" by using
snd_soc_rtdcom_lookup() with driver name.

--- ALSA SoC  ---
...
if (component->driver->compr_ops &&
    component->driver->compr_ops->open)
=> return component->driver->compr_ops->open(stream);
...

--- driver ---
static int xxx_open(struct snd_compr_stream *stream)
{
struct snd_soc_pcm_runtime *rtd = stream->private_data;
=> struct snd_soc_component *component = snd_soc_rtdcom_lookup(..);
...
}

It works today, but, will not work in the future if we support multi
CPU/Codec/Platform, because 1 rtd might have multiple same driver
name component.

To solve this issue, each callback need to be called with component.
We already have many component driver callbacks.
This patch adds new snd_compress_ops, and call it with "component".

--- ALSA SoC  ---
...
if (component->driver->compress_ops->open)
=> return component->driver->compress_ops->open(
component, substream);
~~~~~~~~~
...

--- driver ---
static int xxx_open(struct snd_soc_component *component,
    struct snd_compr_stream *stream)
{
=> /* it don't need to use snd_soc_rtdcom_lookup() */
...
}

Signed-off-by: Kuninori Morimoto <kuninori.morimoto.gx@renesas.com>
Tested-by: Charles Keepax <ckeepax@opensource.cirrus.com>
Reviewed-by: Charles Keepax <ckeepax@opensource.cirrus.com>
Reviewed-by: Ranjani Sridharan <ranjani.sridharan@linux.intel.com>
Link: https://lore.kernel.org/r/87v9luvdmh.wl-kuninori.morimoto.gx@renesas.com
Signed-off-by: Mark Brown <broonie@kernel.org>
4 years agoASoC: fsl_easrc: Add EASRC ASoC CPU DAI drivers
Shengjiu Wang [Thu, 16 Apr 2020 12:25:37 +0000 (20:25 +0800)]
ASoC: fsl_easrc: Add EASRC ASoC CPU DAI drivers

EASRC (Enhanced Asynchronous Sample Rate Converter) is a new IP module
found on i.MX8MN. It is different with old ASRC module.

The primary features for the EASRC are as follows:
- 4 Contexts - groups of channels with an independent time base
- Fully independent and concurrent context control
- Simultaneous processing of up to 32 audio channels
- Programmable filter charachteristics for each context
- 32, 24, 20, and 16-bit fixed point audio sample support
- 32-bit floating point audio sample support
- 8kHz to 384kHz sample rate
- 1/16 to 8x sample rate conversion ratio

Signed-off-by: Shengjiu Wang <shengjiu.wang@nxp.com>
Signed-off-by: Cosmin-Gabriel Samoila <cosmin.samoila@nxp.com>
Acked-by: Nicolin Chen <nicoleotsuka@gmail.com>
Link: https://lore.kernel.org/r/260d7a9fbddf9fa90760d30095df60a4c25fd0a1.1587038908.git.shengjiu.wang@nxp.com
Signed-off-by: Mark Brown <broonie@kernel.org>
4 years agoASoC: dt-bindings: fsl_easrc: Add document for EASRC
Shengjiu Wang [Thu, 16 Apr 2020 12:25:36 +0000 (20:25 +0800)]
ASoC: dt-bindings: fsl_easrc: Add document for EASRC

EASRC (Enhanced Asynchronous Sample Rate Converter) is a new
IP module found on i.MX8MN.

Signed-off-by: Shengjiu Wang <shengjiu.wang@nxp.com>
Reviewed-by: Rob Herring <robh@kernel.org>
Link: https://lore.kernel.org/r/3195cad960113a089d63c10e2268d63b253a69c5.1587038908.git.shengjiu.wang@nxp.com
Signed-off-by: Mark Brown <broonie@kernel.org>
4 years agoASoC: fsl_asrc: Move common definition to fsl_asrc_common
Shengjiu Wang [Thu, 16 Apr 2020 12:25:35 +0000 (20:25 +0800)]
ASoC: fsl_asrc: Move common definition to fsl_asrc_common

There is a new ASRC included in i.MX serial platform, there
are some common definition can be shared with each other.
So move the common definition to a separate header file.

And add fsl_asrc_pair_priv and fsl_asrc_priv for
the variable specific for the module, which can be used
internally.

Signed-off-by: Shengjiu Wang <shengjiu.wang@nxp.com>
Acked-by: Nicolin Chen <nicoleotsuka@gmail.com>
Link: https://lore.kernel.org/r/7106993928ea9e9720e6b42ec601871103155b1c.1587038908.git.shengjiu.wang@nxp.com
Signed-off-by: Mark Brown <broonie@kernel.org>
4 years agoASoC: fsl_asrc: Support new property fsl,asrc-format
Shengjiu Wang [Thu, 16 Apr 2020 12:25:34 +0000 (20:25 +0800)]
ASoC: fsl_asrc: Support new property fsl,asrc-format

In order to align with new ESARC, we add new property fsl,asrc-format.
The fsl,asrc-format can replace the fsl,asrc-width, driver
can accept format from devicetree, don't need to convert it to
format through width.

Signed-off-by: Shengjiu Wang <shengjiu.wang@nxp.com>
Acked-by: Nicolin Chen <nicoleotsuka@gmail.com>
Link: https://lore.kernel.org/r/2be9664768f32982ba4f71e49749f7390096ac9f.1587038908.git.shengjiu.wang@nxp.com
Signed-off-by: Mark Brown <broonie@kernel.org>
4 years agoASoC: fsl-asoc-card: Support new property fsl, asrc-format
Shengjiu Wang [Thu, 16 Apr 2020 12:25:33 +0000 (20:25 +0800)]
ASoC: fsl-asoc-card: Support new property fsl, asrc-format

In order to align with new ESARC, we add new property fsl,asrc-format.
The fsl,asrc-format can replace the fsl,asrc-width, driver
can accept format from devicetree, don't need to convert it to
format through width.

Signed-off-by: Shengjiu Wang <shengjiu.wang@nxp.com>
Acked-by: Nicolin Chen <nicoleotsuka@gmail.com>
Link: https://lore.kernel.org/r/02f53d5512b9acd3492e2acdd5e0ba3113f18009.1587038908.git.shengjiu.wang@nxp.com
Signed-off-by: Mark Brown <broonie@kernel.org>
4 years agoASoC: dt-bindings: fsl_asrc: Add new property fsl, asrc-format
Shengjiu Wang [Thu, 16 Apr 2020 12:25:32 +0000 (20:25 +0800)]
ASoC: dt-bindings: fsl_asrc: Add new property fsl, asrc-format

In order to support new EASRC and simplify the code structure,
We decide to share the common structure between them. This bring
a problem that EASRC accept format directly from devicetree, but
ASRC accept width from devicetree.

In order to align with new ESARC, we add new property fsl,asrc-format.
The fsl,asrc-format can replace the fsl,asrc-width, then driver
can accept format from devicetree, don't need to convert it to
format through width.

Signed-off-by: Shengjiu Wang <shengjiu.wang@nxp.com>
Acked-by: Nicolin Chen <nicoleotsuka@gmail.com>
Acked-by: Rob Herring <robh@kernel.org>
Link: https://lore.kernel.org/r/e7acbde4b26a82b674a4091515a219e09f847eac.1587038908.git.shengjiu.wang@nxp.com
Signed-off-by: Mark Brown <broonie@kernel.org>
4 years agoASoC: fsl_asrc: rename asrc_priv to asrc
Shengjiu Wang [Thu, 16 Apr 2020 12:25:31 +0000 (20:25 +0800)]
ASoC: fsl_asrc: rename asrc_priv to asrc

In order to move common structure to fsl_asrc_common.h
we change the name of asrc_priv to asrc, the asrc_priv
will be used by new struct fsl_asrc_priv.

Signed-off-by: Shengjiu Wang <shengjiu.wang@nxp.com>
Acked-by: Nicolin Chen <nicoleotsuka@gmail.com>
Link: https://lore.kernel.org/r/722142c2e1b57a95f911db1d42d901b88fc283d6.1587038908.git.shengjiu.wang@nxp.com
Signed-off-by: Mark Brown <broonie@kernel.org>
4 years agoASoC: tegra: Enable audio mclk during tegra_asoc_utils_init()
Sowjanya Komatineni [Tue, 14 Jan 2020 07:24:24 +0000 (23:24 -0800)]
ASoC: tegra: Enable audio mclk during tegra_asoc_utils_init()

Tegra PMC clock clk_out_1 is dedicated for audio mclk from Tegra30
through Tegra210 and currently Tegra clock driver keeps the audio mclk
enabled.

With the move of PMC clocks from clock driver into pmc driver, audio
mclk enable from clock driver is removed and this should be taken care
of by the audio driver.

tegra_asoc_utils_init() calls tegra_asoc_utils_set_rate() and audio mclk
rate configuration is not needed during init and the rate is actually
set during the ->hw_params() callback.

So, this patch removes tegra_asoc_utils_set_rate() call and just leaves
the audio mclk enabled.

Signed-off-by: Sowjanya Komatineni <skomatineni@nvidia.com>
Tested-by: Dmitry Osipenko <digetx@gmail.com>
Reviewed-by: Dmitry Osipenko <digetx@gmail.com>
Signed-off-by: Thierry Reding <treding@nvidia.com>
4 years agoASoC: tegra: Add audio mclk parent configuration
Sowjanya Komatineni [Tue, 14 Jan 2020 07:24:23 +0000 (23:24 -0800)]
ASoC: tegra: Add audio mclk parent configuration

Tegra PMC clock clk_out_1 is dedicated for audio mclk from Tegra30
through Tegra210 and currently Tegra clock driver does the initial
parent configuration for audio mclk and keeps it enabled by default.

With the move of PMC clocks from clock driver into PMC driver, audio
clocks parent configuration can be specified through the device tree
using assigned-clock-parents property and audio mclk control should be
taken care of by the audio driver.

This patch has implementation for parent configuration when default
parent configuration through assigned-clock-parents property is not
specified in the device tree.

Tested-by: Dmitry Osipenko <digetx@gmail.com>
Reviewed-by: Dmitry Osipenko <digetx@gmail.com>
Reviewed-by: Sameer Pujar <spujar@nvidia.com>
Signed-off-by: Sowjanya Komatineni <skomatineni@nvidia.com>
Signed-off-by: Thierry Reding <treding@nvidia.com>
4 years agoASoC: nau8825: Change Tegra clk_out_2 provider to PMC
Sowjanya Komatineni [Tue, 14 Jan 2020 07:24:22 +0000 (23:24 -0800)]
ASoC: nau8825: Change Tegra clk_out_2 provider to PMC

Tegra clk_out_1, clk_out_2, and clk_out_3 are part of PMC block and
these clocks are moved from the clock driver to PMC driver with PMC as
a provider for these clocks.

Update bindings document to use PMC as clock provider for clk_out_2 and
change ID to PMC clock ID.

Reviewed-by: Dmitry Osipenko <digetx@gmail.com>
Acked-by: Rob Herring <robh@kernel.org>
Signed-off-by: Sowjanya Komatineni <skomatineni@nvidia.com>
Signed-off-by: Thierry Reding <treding@nvidia.com>
4 years agoASoC: tegra: Use device managed resource APIs to get the clock
Sowjanya Komatineni [Tue, 14 Jan 2020 07:24:17 +0000 (23:24 -0800)]
ASoC: tegra: Use device managed resource APIs to get the clock

tegra_asoc_utils uses clk_get() to get the clock and clk_put() to free
them explicitly.

This patch updates it to use device managed resource API devm_clk_get()
so the clock will be automatically released and freed when the device is
unbound and removes tegra_asoc_utils_fini() as its no longer needed.

Tested-by: Dmitry Osipenko <digetx@gmail.com>
Reviewed-by: Dmitry Osipenko <digetx@gmail.com>
Reviewed-by: Sameer Pujar <spujar@nvidia.com>
Signed-off-by: Sowjanya Komatineni <skomatineni@nvidia.com>
Signed-off-by: Thierry Reding <treding@nvidia.com>
4 years agoASoC: wm8960: Fix wrong clock after suspend & resume
Shengjiu Wang [Tue, 21 Apr 2020 11:28:45 +0000 (19:28 +0800)]
ASoC: wm8960: Fix wrong clock after suspend & resume

After suspend & resume, wm8960_hw_params may be called when
bias_level is not SND_SOC_BIAS_ON, then wm8960_configure_clocking
is not called. But if sample rate is changed at that time, then
the output clock rate will be not correct.

So judgement of bias_level is SND_SOC_BIAS_ON in wm8960_hw_params
is not necessary and it causes above issue.

Fixes: 3176bf2d7ccd ("ASoC: wm8960: update pll and clock setting function")
Signed-off-by: Shengjiu Wang <shengjiu.wang@nxp.com>
Acked-by: Charles Keepax <ckeepax@opensource.cirrus.com>
Link: https://lore.kernel.org/r/1587468525-27514-1-git-send-email-shengjiu.wang@nxp.com
Signed-off-by: Mark Brown <broonie@kernel.org>
4 years agoASoC: wcd934x: remove unneeded semicolon
Jason Yan [Mon, 20 Apr 2020 04:29:11 +0000 (12:29 +0800)]
ASoC: wcd934x: remove unneeded semicolon

Fix the following coccicheck warning:

sound/soc/codecs/wcd934x.c:3621:2-3: Unneeded semicolon
sound/soc/codecs/wcd934x.c:4270:2-3: Unneeded semicolon
sound/soc/codecs/wcd934x.c:4018:2-3: Unneeded semicolon
sound/soc/codecs/wcd934x.c:4043:2-3: Unneeded semicolon
sound/soc/codecs/wcd934x.c:3804:2-3: Unneeded semicolon
sound/soc/codecs/wcd934x.c:3866:2-3: Unneeded semicolon
sound/soc/codecs/wcd934x.c:3596:2-3: Unneeded semicolon
sound/soc/codecs/wcd934x.c:3542:2-3: Unneeded semicolon
sound/soc/codecs/wcd934x.c:3673:2-3: Unneeded semicolon
sound/soc/codecs/wcd934x.c:3723:2-3: Unneeded semicolon
sound/soc/codecs/wcd934x.c:2492:2-3: Unneeded semicolon
sound/soc/codecs/wcd934x.c:1790:3-4: Unneeded semicolon
sound/soc/codecs/wcd934x.c:1806:3-4: Unneeded semicolon
sound/soc/codecs/wcd934x.c:1812:2-3: Unneeded semicolon

Signed-off-by: Jason Yan <yanaijie@huawei.com>
Link: https://lore.kernel.org/r/20200420042911.19379-1-yanaijie@huawei.com
Signed-off-by: Mark Brown <broonie@kernel.org>
4 years agoASoC: wcd9335: remove unneeded semicolon
Jason Yan [Mon, 20 Apr 2020 04:28:47 +0000 (12:28 +0800)]
ASoC: wcd9335: remove unneeded semicolon

Fix the following coccicheck warning:

sound/soc/codecs/wcd9335.c:2606:2-3: Unneeded semicolon
sound/soc/codecs/wcd9335.c:3619:2-3: Unneeded semicolon
sound/soc/codecs/wcd9335.c:2849:2-3: Unneeded semicolon
sound/soc/codecs/wcd9335.c:2955:2-3: Unneeded semicolon
sound/soc/codecs/wcd9335.c:2988:2-3: Unneeded semicolon
sound/soc/codecs/wcd9335.c:3960:2-3: Unneeded semicolon
sound/soc/codecs/wcd9335.c:3776:2-3: Unneeded semicolon
sound/soc/codecs/wcd9335.c:3924:2-3: Unneeded semicolon
sound/soc/codecs/wcd9335.c:3355:2-3: Unneeded semicolon
sound/soc/codecs/wcd9335.c:3832:2-3: Unneeded semicolon
sound/soc/codecs/wcd9335.c:3079:2-3: Unneeded semicolon
sound/soc/codecs/wcd9335.c:3089:2-3: Unneeded semicolon
sound/soc/codecs/wcd9335.c:3232:2-3: Unneeded semicolon
sound/soc/codecs/wcd9335.c:3878:2-3: Unneeded semicolon
sound/soc/codecs/wcd9335.c:3578:2-3: Unneeded semicolon
sound/soc/codecs/wcd9335.c:3728:2-3: Unneeded semicolon
sound/soc/codecs/wcd9335.c:1922:3-4: Unneeded semicolon
sound/soc/codecs/wcd9335.c:1938:3-4: Unneeded semicolon
sound/soc/codecs/wcd9335.c:1944:2-3: Unneeded semicolon
sound/soc/codecs/wcd9335.c:3144:2-3: Unneeded semicolon
sound/soc/codecs/wcd9335.c:2568:2-3: Unneeded semicolon
sound/soc/codecs/wcd9335.c:2219:2-3: Unneeded semicolon

Signed-off-by: Jason Yan <yanaijie@huawei.com>
Link: https://lore.kernel.org/r/20200420042847.19206-1-yanaijie@huawei.com
Signed-off-by: Mark Brown <broonie@kernel.org>
4 years agoASoC: wcd934x: remove unnecessary comparisons to bool
Jason Yan [Mon, 20 Apr 2020 04:28:33 +0000 (12:28 +0800)]
ASoC: wcd934x: remove unnecessary comparisons to bool

Fix the following coccicheck warning:

sound/soc/codecs/wcd934x.c:3881:8-17: WARNING: Comparison of 0/1 to bool
variable

Signed-off-by: Jason Yan <yanaijie@huawei.com>
Link: https://lore.kernel.org/r/20200420042833.19116-1-yanaijie@huawei.com
Signed-off-by: Mark Brown <broonie@kernel.org>
4 years agoASoC: Intel: boards: split woofer and tweeter support
Mac Chiang [Mon, 23 Mar 2020 02:49:24 +0000 (10:49 +0800)]
ASoC: Intel: boards: split woofer and tweeter support

Support Woofer stereo speakers by default and optionally
Tweeter stereo speakers with a DMI quirk

Signed-off-by: Mac Chiang <mac.chiang@intel.com>
Link: https://lore.kernel.org/r/1584931764-2778-1-git-send-email-mac.chiang@intel.com
Signed-off-by: Mark Brown <broonie@kernel.org>
4 years agosoundwire: intel: use asoc_rtd_to_cpu() / asoc_rtd_to_codec() macro for DAI pointer
Kuninori Morimoto [Mon, 20 Apr 2020 07:01:01 +0000 (16:01 +0900)]
soundwire: intel: use asoc_rtd_to_cpu() / asoc_rtd_to_codec() macro for DAI pointer

Now ALSA SoC needs to use asoc_rtd_to_codec(),
otherwise, it will be compile error.

Signed-off-by: Kuninori Morimoto <kuninori.morimoto.gx@renesas.com>
Acked-By: Vinod Koul <vkoul@kernel.org>
Link: https://lore.kernel.org/r/87y2qqvdxu.wl-kuninori.morimoto.gx@renesas.com
Signed-off-by: Mark Brown <broonie@kernel.org>
4 years agoMerge series "ASoC: Fix dependency issues of SND_SOC" from Wei Li <liwei391@huawei...
Mark Brown [Mon, 20 Apr 2020 14:27:09 +0000 (15:27 +0100)]
Merge series "ASoC: Fix dependency issues of SND_SOC" from Wei Li <liwei391@huawei.com>:

Fix dependency issues of SND_SOC introduced by commit ea00d95200d02
("ASoC: Use imply for SND_SOC_ALL_CODECS").

Wei Li (2):
  ASoC: wm89xx: Fix build errors caused by I2C dependency
  ASoC: Fix wrong dependency of da7210 and wm8983

 sound/soc/codecs/Kconfig | 7 +++++--
 1 file changed, 5 insertions(+), 2 deletions(-)

--
2.17.1

4 years agoASoC: wm89xx: Add missing dependency
YueHaibing [Mon, 20 Apr 2020 12:53:43 +0000 (20:53 +0800)]
ASoC: wm89xx: Add missing dependency

sound/soc/codecs/wm8900.o: In function `wm8900_i2c_probe':
wm8900.c:(.text+0xa36): undefined reference to `__devm_regmap_init_i2c'
sound/soc/codecs/wm8900.o: In function `wm8900_modinit':
wm8900.c:(.init.text+0xb): undefined reference to `i2c_register_driver'
sound/soc/codecs/wm8900.o: In function `wm8900_exit':
wm8900.c:(.exit.text+0x8): undefined reference to `i2c_del_driver'
sound/soc/codecs/wm8988.o: In function `wm8988_i2c_probe':
wm8988.c:(.text+0x857): undefined reference to `__devm_regmap_init_i2c'
sound/soc/codecs/wm8988.o: In function `wm8988_modinit':
wm8988.c:(.init.text+0xb): undefined reference to `i2c_register_driver'
sound/soc/codecs/wm8988.o: In function `wm8988_exit':
wm8988.c:(.exit.text+0x8): undefined reference to `i2c_del_driver'
sound/soc/codecs/wm8995.o: In function `wm8995_i2c_probe':
wm8995.c:(.text+0x1c4f): undefined reference to `__devm_regmap_init_i2c'
sound/soc/codecs/wm8995.o: In function `wm8995_modinit':
wm8995.c:(.init.text+0xb): undefined reference to `i2c_register_driver'
sound/soc/codecs/wm8995.o: In function `wm8995_exit':
wm8995.c:(.exit.text+0x8): undefined reference to `i2c_del_driver'

Add SND_SOC_I2C_AND_SPI dependency to fix this.

Fixes: ea00d95200d02ece ("ASoC: Use imply for SND_SOC_ALL_CODECS")
Reported-by: Hulk Robot <hulkci@huawei.com>
Signed-off-by: YueHaibing <yuehaibing@huawei.com>
Acked-by: Charles Keepax <ckeepax@opensource.cirrus.com>
Link: https://lore.kernel.org/r/20200420125343.20920-1-yuehaibing@huawei.com
Signed-off-by: Mark Brown <broonie@kernel.org>
4 years agoASoC: Fix wrong dependency of da7210 and wm8983
Wei Li [Mon, 20 Apr 2020 20:24:10 +0000 (04:24 +0800)]
ASoC: Fix wrong dependency of da7210 and wm8983

As these two drivers support I2C and SPI, we should add the SND_SOC_I2C_AND_SPI
dependency instead.

Fixes: ce0c97f8a2936 ("ASoC: Fix SND_SOC_ALL_CODECS imply SPI fallout")
Signed-off-by: Wei Li <liwei391@huawei.com>
Link: https://lore.kernel.org/r/20200420202410.47327-3-liwei391@huawei.com
Signed-off-by: Mark Brown <broonie@kernel.org>
4 years agoASoC: wm89xx: Fix build errors caused by I2C dependency
Wei Li [Mon, 20 Apr 2020 20:24:09 +0000 (04:24 +0800)]
ASoC: wm89xx: Fix build errors caused by I2C dependency

When I2C=m, SND_SOC_WM8900=y, SND_SOC_WM8988=y, SND_SOC_WM8995=y:

sound/soc/codecs/wm8900.o: In function `wm8900_i2c_probe':
wm8900.c:(.text+0xa16): undefined reference to `__devm_regmap_init_i2c'
sound/soc/codecs/wm8900.o: In function `wm8900_modinit':
wm8900.c:(.init.text+0xb): undefined reference to `i2c_register_driver'
sound/soc/codecs/wm8900.o: In function `wm8900_exit':
wm8900.c:(.exit.text+0x8): undefined reference to `i2c_del_driver'
sound/soc/codecs/wm8988.o: In function `wm8988_i2c_probe':
wm8988.c:(.text+0x86b): undefined reference to `__devm_regmap_init_i2c'
sound/soc/codecs/wm8988.o: In function `wm8988_modinit':
wm8988.c:(.init.text+0xb): undefined reference to `i2c_register_driver'
sound/soc/codecs/wm8988.o: In function `wm8988_exit':
wm8988.c:(.exit.text+0x8): undefined reference to `i2c_del_driver'
sound/soc/codecs/wm8995.o: In function `wm8995_i2c_probe':
wm8995.c:(.text+0x1b5b): undefined reference to `__devm_regmap_init_i2c'
sound/soc/codecs/wm8995.o: In function `wm8995_modinit':
wm8995.c:(.init.text+0xb): undefined reference to `i2c_register_driver'
sound/soc/codecs/wm8995.o: In function `wm8995_exit':
wm8995.c:(.exit.text+0x8): undefined reference to `i2c_del_driver'

As these drivers support I2C and SPI, we add the SND_SOC_I2C_AND_SPI
dependency to solve it.

Fixes: ea00d95200d02 ("ASoC: Use imply for SND_SOC_ALL_CODECS")
Reported-by: Hulk Robot <hulkci@huawei.com>
Signed-off-by: Wei Li <liwei391@huawei.com>
Link: https://lore.kernel.org/r/20200420202410.47327-2-liwei391@huawei.com
Signed-off-by: Mark Brown <broonie@kernel.org>
4 years agoMerge series "ASoC: rsnd: multi-SSI setup fixes" from Matthias Blankertz <matthias...
Mark Brown [Mon, 20 Apr 2020 13:35:08 +0000 (14:35 +0100)]
Merge series "ASoC: rsnd: multi-SSI setup fixes" from Matthias Blankertz <matthias.blankertz@cetitec.com>:

Fix rsnd_dai_call() operations being performed twice for the master SSI
in multi-SSI setups, and fix the rsnd_ssi_stop operation for multi-SSI
setups.
The only visible effect of these issues was some "status check failed"
spam when the rsnd_ssi_stop was called, but overall the code is cleaner
now, and some questionable writes to the SSICR register which did not
lead to any observable misbehaviour but were contrary to the datasheet
are fixed.

Mark:
The first patch kind of reverts my "ASoC: rsnd: Fix parent SSI
start/stop in multi-SSI mode" from a few days ago and achieves the same
effect in a simpler fashion, if you would prefer a clean patch series
based on v5.6 drop me a note.

Greetings,
Matthias

Matthias Blankertz (2):
  ASoC: rsnd: Don't treat master SSI in multi SSI setup as parent
  ASoC: rsnd: Fix "status check failed" spam for multi-SSI

 sound/soc/sh/rcar/ssi.c | 18 +++++++++++++-----
 1 file changed, 13 insertions(+), 5 deletions(-)

base-commit: 15a5760cb8b6d5c1ebbf1d2e1f0b77380ab68a82
--
2.26.1

4 years agoMerge series "ASoC: meson: fix codec-to-codec link setup" from Jerome Brunet <jbrunet...
Mark Brown [Mon, 20 Apr 2020 13:35:07 +0000 (14:35 +0100)]
Merge series "ASoC: meson: fix codec-to-codec link setup" from Jerome Brunet <jbrunet@baylibre.com>:

This patchset fixes the problem reported by Marc in this thread [0]
The problem was due to an error in the meson card drivers which had
the "no_pcm" dai_link property set on codec-to-codec links

[0]: https://lore.kernel.org/r/20200417122732.GC5315@sirena.org.uk

Jerome Brunet (2):
  ASoC: meson: axg-card: fix codec-to-codec link setup
  ASoC: meson: gx-card: fix codec-to-codec link setup

 sound/soc/meson/axg-card.c | 4 +++-
 sound/soc/meson/gx-card.c  | 4 +++-
 2 files changed, 6 insertions(+), 2 deletions(-)

--
2.25.2

4 years agoASoC: dapm: fixup dapm kcontrol widget
Gyeongtaek Lee [Sat, 18 Apr 2020 04:13:20 +0000 (13:13 +0900)]
ASoC: dapm: fixup dapm kcontrol widget

snd_soc_dapm_kcontrol widget which is created by autodisable control
should contain correct on_val, mask and shift because it is set when the
widget is powered and changed value is applied on registers by following
code in dapm_seq_run_coalesced().

mask |= w->mask << w->shift;
if (w->power)
value |= w->on_val << w->shift;
else
value |= w->off_val << w->shift;

Shift on the mask in dapm_kcontrol_data_alloc() is removed to prevent
double shift.
And, on_val in dapm_kcontrol_set_value() is modified to get correct
value in the dapm_seq_run_coalesced().

Signed-off-by: Gyeongtaek Lee <gt82.lee@samsung.com>
Cc: stable@vger.kernel.org
Link: https://lore.kernel.org/r/000001d61537$b212f620$1638e260$@samsung.com
Signed-off-by: Mark Brown <broonie@kernel.org>
4 years agoASoC: rsnd: Fix "status check failed" spam for multi-SSI
Matthias Blankertz [Fri, 17 Apr 2020 15:30:17 +0000 (17:30 +0200)]
ASoC: rsnd: Fix "status check failed" spam for multi-SSI

Fix the rsnd_ssi_stop function to skip disabling the individual SSIs of
a multi-SSI setup, as the actual stop is performed by rsnd_ssiu_stop_gen2
- the same logic as in rsnd_ssi_start. The attempt to disable these SSIs
was harmless, but caused a "status check failed" message to be printed
for every SSI in the multi-SSI setup.
The disabling of interrupts is still performed, as they are enabled for
all SSIs in rsnd_ssi_init, but care is taken to not accidentally set the
EN bit for an SSI where it was not set by rsnd_ssi_start.

Signed-off-by: Matthias Blankertz <matthias.blankertz@cetitec.com>
Acked-by: Kuninori Morimoto <kuninori.morimoto.gx@renesas.com>
Link: https://lore.kernel.org/r/20200417153017.1744454-3-matthias.blankertz@cetitec.com
Signed-off-by: Mark Brown <broonie@kernel.org>
4 years agoASoC: rsnd: Don't treat master SSI in multi SSI setup as parent
Matthias Blankertz [Fri, 17 Apr 2020 15:30:16 +0000 (17:30 +0200)]
ASoC: rsnd: Don't treat master SSI in multi SSI setup as parent

The master SSI of a multi-SSI setup was attached both to the
RSND_MOD_SSI slot and the RSND_MOD_SSIP slot of the rsnd_dai_stream.
This is not correct wrt. the meaning of being "parent" in the rest of
the SSI code, where it seems to indicate an SSI that provides clock and
word sync but is not transmitting/receiving audio data.

Not treating the multi-SSI master as parent allows removal of various
special cases to the rsnd_ssi_is_parent conditions introduced in commit
a09fb3f28a60 ("ASoC: rsnd: Fix parent SSI start/stop in multi-SSI mode").
It also fixes the issue that operations performed via rsnd_dai_call()
were performed twice for the master SSI. This caused some "status check
failed" spam when stopping a multi-SSI stream as the driver attempted to
stop the master SSI twice.

Signed-off-by: Matthias Blankertz <matthias.blankertz@cetitec.com>
Acked-by: Kuninori Morimoto <kuninori.morimoto.gx@renesas.com>
Link: https://lore.kernel.org/r/20200417153017.1744454-2-matthias.blankertz@cetitec.com
Signed-off-by: Mark Brown <broonie@kernel.org>
4 years agoASoC: meson: gx-card: fix codec-to-codec link setup
Jerome Brunet [Mon, 20 Apr 2020 11:45:11 +0000 (13:45 +0200)]
ASoC: meson: gx-card: fix codec-to-codec link setup

Since the addition of commit 9b5db059366a ("ASoC: soc-pcm: dpcm: Only allow
playback/capture if supported"), meson-axg cards which have codec-to-codec
links fail to init and Oops.

  Unable to handle kernel NULL pointer dereference at virtual address 0000000000000128
  Internal error: Oops: 96000044 [#1] PREEMPT SMP
  CPU: 3 PID: 1582 Comm: arecord Not tainted 5.7.0-rc1
  pc : invalidate_paths_ep+0x30/0xe0
  lr : snd_soc_dapm_dai_get_connected_widgets+0x170/0x1a8
  Call trace:
   invalidate_paths_ep+0x30/0xe0
   snd_soc_dapm_dai_get_connected_widgets+0x170/0x1a8
   dpcm_path_get+0x38/0xd0
   dpcm_fe_dai_open+0x70/0x920
   snd_pcm_open_substream+0x564/0x840
   snd_pcm_open+0xfc/0x228
   snd_pcm_capture_open+0x4c/0x78
   snd_open+0xac/0x1a8
   ...

While this error was initially reported the axg-card type, it also applies
to the gx-card type.

While initiliazing the links, ASoC treats the codec-to-codec links of this
card type as a DPCM backend. This error eventually leads to the Oops.

Most of the card driver code is shared between DPCM backends and
codec-to-codec links. The property "no_pcm" marking DCPM BE was left set on
codec-to-codec links, leading to this problem. This commit fixes that.

Fixes: e37a0c313a0f ("ASoC: meson: gx: add sound card support")
Signed-off-by: Jerome Brunet <jbrunet@baylibre.com>
Link: https://lore.kernel.org/r/20200420114511.450560-3-jbrunet@baylibre.com
Signed-off-by: Mark Brown <broonie@kernel.org>
4 years agoASoC: meson: axg-card: fix codec-to-codec link setup
Jerome Brunet [Mon, 20 Apr 2020 11:45:10 +0000 (13:45 +0200)]
ASoC: meson: axg-card: fix codec-to-codec link setup

Since the addition of commit 9b5db059366a ("ASoC: soc-pcm: dpcm: Only allow
playback/capture if supported"), meson-axg cards which have codec-to-codec
links fail to init and Oops:

  Unable to handle kernel NULL pointer dereference at virtual address 0000000000000128
  Internal error: Oops: 96000044 [#1] PREEMPT SMP
  CPU: 3 PID: 1582 Comm: arecord Not tainted 5.7.0-rc1
  pc : invalidate_paths_ep+0x30/0xe0
  lr : snd_soc_dapm_dai_get_connected_widgets+0x170/0x1a8
  Call trace:
   invalidate_paths_ep+0x30/0xe0
   snd_soc_dapm_dai_get_connected_widgets+0x170/0x1a8
   dpcm_path_get+0x38/0xd0
   dpcm_fe_dai_open+0x70/0x920
   snd_pcm_open_substream+0x564/0x840
   snd_pcm_open+0xfc/0x228
   snd_pcm_capture_open+0x4c/0x78
   snd_open+0xac/0x1a8
   ...

While initiliazing the links, ASoC treats the codec-to-codec links of this
card type as a DPCM backend. This error eventually leads to the Oops.

Most of the card driver code is shared between DPCM backends and
codec-to-codec links. The property "no_pcm" marking DCPM BE was left set on
codec-to-codec links, leading to this problem. This commit fixes that.

Fixes: 0a8f1117a680 ("ASoC: meson: axg-card: add basic codec-to-codec link support")
Signed-off-by: Jerome Brunet <jbrunet@baylibre.com>
Link: https://lore.kernel.org/r/20200420114511.450560-2-jbrunet@baylibre.com
Signed-off-by: Mark Brown <broonie@kernel.org>
4 years agoASoC: Intel: haswell: Power transition refactor
Cezary Rojewski [Mon, 30 Mar 2020 19:45:20 +0000 (21:45 +0200)]
ASoC: Intel: haswell: Power transition refactor

Update D0 <-> D3 sequence to correctly transition hardware and DSP core
from and to D3. On top of that, set SHIM registers to their recommended
defaults during D0 and D3 proceduces as HW does not reset registers for
us.

Connected to:
[alsa-devel][BUG] bdw-rt5650 DSP boot timeout
https://mailman.alsa-project.org/pipermail/alsa-devel/2019-July/153098.html

Github issue ticket reference:
https://github.com/thesofproject/linux/pull/1842

Tested on:
- BDW-Y RVP with rt286
- SAMUS with rt5677

Proposed solution (both in July 2019 and on github):
'Revert "ASoC: Intel: Work around to fix HW d3 potential crash issue"'
is NAKed as it only covers the problem up and actually brings back the
undefined behavior: some registers (e.g.: APLLSE) are describing LPT
offsets rather than WPT ones. In consequence, during power-transitions
driver issues incorrect writes and leaves the regs of interest alone.

Existing patch - the non-revert - does not resolve the HW D3 issue at
all as it ignores the recommended sequence and does not initialize
hardware registers as expected. And thus, leaving things as are is also
unacceptable.

Signed-off-by: Cezary Rojewski <cezary.rojewski@intel.com>
Tested-by: Ross Zwisler <zwisler@google.com>
Link: https://lore.kernel.org/r/20200330194520.13253-1-cezary.rojewski@intel.com
Signed-off-by: Mark Brown <broonie@kernel.org>
4 years agoASoC: SOF: Intel: add min/max channels for SSP on Baytrail/Broadwell
Pierre-Louis Bossart [Fri, 17 Apr 2020 17:20:14 +0000 (12:20 -0500)]
ASoC: SOF: Intel: add min/max channels for SSP on Baytrail/Broadwell

Major regressions were detected by SOF CI on CherryTrail and Broadwell:

[   25.705750]  SSP2-Codec: ASoC: no backend playback stream
[   27.923378]  SSP2-Codec: ASoC: no users playback at close - state

This is root-caused to the introduction of the DAI capability checks
with snd_soc_dai_stream_valid(). Its use in soc-pcm.c makes it a
requirement for all DAIs to report at least a non-zero min_channels
field.

For some reason the SSP structures used for SKL+ did provide this
information but legacy platforms didn't.

Fixes: 9b5db059366ae2 ("ASoC: soc-pcm: dpcm: Only allow playback/capture if supported")
Signed-off-by: Pierre-Louis Bossart <pierre-louis.bossart@linux.intel.com>
Reviewed-by: Ranjani Sridharan <ranjani.sridharan@linux.intel.com>
Reviewed-by: Kai Vehmanen <kai.vehmanen@linux.intel.com>
Link: https://lore.kernel.org/r/20200417172014.11760-1-pierre-louis.bossart@linux.intel.com
Signed-off-by: Mark Brown <broonie@kernel.org>
4 years agoASoC: stm32: sai: fix sai probe
Olivier Moysan [Fri, 17 Apr 2020 14:21:22 +0000 (16:21 +0200)]
ASoC: stm32: sai: fix sai probe

pcm config must be set before snd_dmaengine_pcm_register() call.

Fixes: 0d6defc7e0e4 ("ASoC: stm32: sai: manage rebind issue")

Signed-off-by: Olivier Moysan <olivier.moysan@st.com>
Link: https://lore.kernel.org/r/20200417142122.10212-1-olivier.moysan@st.com
Signed-off-by: Mark Brown <broonie@kernel.org>
4 years agoASoC: Fix misspellings of "Analog Devices"
Geert Uytterhoeven [Thu, 16 Apr 2020 10:30:58 +0000 (12:30 +0200)]
ASoC: Fix misspellings of "Analog Devices"

According to https://www.analog.com/, the company name is spelled
"Analog Devices".

Signed-off-by: Geert Uytterhoeven <geert+renesas@glider.be>
Reviewed-by: Alexandru Ardelean <alexandru.ardelean@analog.com>
Link: https://lore.kernel.org/r/20200416103058.15269-7-geert+renesas@glider.be
Signed-off-by: Mark Brown <broonie@kernel.org>
4 years agoASoC: qdsp6: Suggest more generic node names
Stephan Gerhold [Wed, 15 Apr 2020 08:11:58 +0000 (10:11 +0200)]
ASoC: qdsp6: Suggest more generic node names

Change the listed examples to use more generic node names, representing
the class of the device nodes:

  - apr-service@<id>
  - dai@<id>

Both names are already in use in arch/arm64/boot/dts/qcom/sdm845.dtsi.

Also add #address-cells + #size-cells to the q6asm example,
without them the example produces dtc warnings.

Signed-off-by: Stephan Gerhold <stephan@gerhold.net>
Reviewed-by: Srinivas Kandagatla <srinivas.kandagatla@linaro.org>
Cc: Srinivas Kandagatla <srinivas.kandagatla@linaro.org>
Link: https://lore.kernel.org/r/20200415081159.1098-1-stephan@gerhold.net
Signed-off-by: Mark Brown <broonie@kernel.org>
4 years agoMerge series "ASoC: rsnd: Fixes for multichannel HDMI audio output" from Matthias...
Mark Brown [Thu, 16 Apr 2020 12:01:34 +0000 (13:01 +0100)]
Merge series "ASoC: rsnd: Fixes for multichannel HDMI audio output" from Matthias Blankertz <matthias.blankertz@cetitec.com>:

This fixes two issues in the snd-soc-rcar driver blocking multichannel
HDMI audio out: The parent SSI in a multi-SSI configuration is not
correctly set up and started, and the SSI->HDMI channel mapping is
wrong.

With these patches, the following device tree snippet can be used on an
r8a7795-based platform (Salvator-X) to enable multichannel HDMI audio on
HDMI0:

rsnd_port1: port@1 {
rsnd_endpoint1: endpoint {
remote-endpoint = <&dw_hdmi0_snd_in>;

dai-format = "i2s";
bitclock-master = <&rsnd_endpoint1>;
frame-master = <&rsnd_endpoint1>;

playback = <&ssi0 &ssi1 &ssi2 &ssi9>;
};
};

With a capable receiver attached, all of 2ch (stereo), 6ch (e.g. 5.1)
and 8ch audio output should work.

Matthias Blankertz (2):
  ASoC: rsnd: Fix parent SSI start/stop in multi-SSI mode
  ASoC: rsnd: Fix HDMI channel mapping for multi-SSI mode

 sound/soc/sh/rcar/ssi.c  | 8 ++++----
 sound/soc/sh/rcar/ssiu.c | 2 +-
 2 files changed, 5 insertions(+), 5 deletions(-)

base-commit: 7111951b8d4973bda27ff663f2cf18b663d15b48
--
2.26.0

4 years agoASoC: codecs: hdac_hdmi: Fix incorrect use of list_for_each_entry
Amadeusz Sławiński [Wed, 15 Apr 2020 16:28:49 +0000 (12:28 -0400)]
ASoC: codecs: hdac_hdmi: Fix incorrect use of list_for_each_entry

If we don't find any pcm, pcm will point at address at an offset from
the the list head and not a meaningful structure. Fix this by returning
correct pcm if found and NULL if not. Found with coccinelle.

Signed-off-by: Amadeusz Sławiński <amadeuszx.slawinski@linux.intel.com>
Link: https://lore.kernel.org/r/20200415162849.308-1-amadeuszx.slawinski@linux.intel.com
Signed-off-by: Mark Brown <broonie@kernel.org>
4 years agoASoC: rsnd: Fix HDMI channel mapping for multi-SSI mode
Matthias Blankertz [Wed, 15 Apr 2020 14:10:17 +0000 (16:10 +0200)]
ASoC: rsnd: Fix HDMI channel mapping for multi-SSI mode

The HDMI?_SEL register maps up to four stereo SSI data lanes onto the
sdata[0..3] inputs of the HDMI output block. The upper half of the
register contains four blocks of 4 bits, with the most significant
controlling the sdata3 line and the least significant the sdata0 line.

The shift calculation has an off-by-one error, causing the parent SSI to
be mapped to sdata3, the first multi-SSI child to sdata0 and so forth.
As the parent SSI transmits the stereo L/R channels, and the HDMI core
expects it on the sdata0 line, this causes no audio to be output when
playing stereo audio on a multichannel capable HDMI out, and
multichannel audio has permutated channels.

Fix the shift calculation to map the parent SSI to sdata0, the first
child to sdata1 etc.

Signed-off-by: Matthias Blankertz <matthias.blankertz@cetitec.com>
Acked-by: Kuninori Morimoto <kuninori.morimoto.gx@renesas.com>
Link: https://lore.kernel.org/r/20200415141017.384017-3-matthias.blankertz@cetitec.com
Signed-off-by: Mark Brown <broonie@kernel.org>
4 years agoASoC: rsnd: Fix parent SSI start/stop in multi-SSI mode
Matthias Blankertz [Wed, 15 Apr 2020 14:10:16 +0000 (16:10 +0200)]
ASoC: rsnd: Fix parent SSI start/stop in multi-SSI mode

The parent SSI of a multi-SSI setup must be fully setup, started and
stopped since it is also part of the playback/capture setup. So only
skip the SSI (as per commit 203cdf51f288 ("ASoC: rsnd: SSI parent cares
SWSP bit") and commit 597b046f0d99 ("ASoC: rsnd: control SSICR::EN
correctly")) if the SSI is parent outside of a multi-SSI setup.

Signed-off-by: Matthias Blankertz <matthias.blankertz@cetitec.com>
Acked-by: Kuninori Morimoto <kuninori.morimoto.gx@renesas.com>
Link: https://lore.kernel.org/r/20200415141017.384017-2-matthias.blankertz@cetitec.com
Signed-off-by: Mark Brown <broonie@kernel.org>
4 years agoMerge series "ASoC: SOF: topology and firmware IPC updates for 5.8" from Pierre-Louis...
Mark Brown [Wed, 15 Apr 2020 23:23:22 +0000 (00:23 +0100)]
Merge series "ASoC: SOF: topology and firmware IPC updates for 5.8" from Pierre-Louis Bossart <pierre-louis.bossart@linux.intel.com>:

Long series made of a relatively small changes from multiple SOF
contributors. I didn't find a good way to split this series since it
tracks SOF minor ABI changes (backwards-compatible with older firmware
files) and needs to be kept in-order. Future series should be much
shorter.

The main addition is support for an extended firmware manifest, which
helps retrieve capabilities directly from the firmware file instead of
the current IPC mechanism (still supported but will be deprecated).

The IPC is realigned with the firmware, along with type cleanups, and
the DMIC interface is simplified.

The topology changes are mainly about a multi-cpu DAI fix, a new DC
blocking component, better parsing of tuples and new parameters for
ALH (SoundWire) and HDaudio DAIs. New tokens are also added to clarify
the firmware behavior in the case of dependent pipelines, e.g. for
echo reference generation.

Artur Kloniecki (1):
  ASoC: SOF: Add XRUN flags field to struct sof_ipc_buffer.

Bard Liao (5):
  ASoC: SOF: topology: fix: handle DAI widget connections properly with
    multiple CPU DAI's
  ASoC: SOF: align sof_ipc_dai_alh_params with FW
  ASoC: SOF: topology: Get ALH rate amd channels from topology
  ASoC: SOF: topology: fix: parse hda_tokens to &config->hda
  ASoC: SOF: topology: Get HDA rate and channels from topology

Jaska Uimonen (2):
  ASoC: SOF: topology: stop parsing when all tokens have been found
  ASoC: SOF: topology: handle multiple sets of tuple arrays

Karol Trzcinski (6):
  ASoC: SOF: Mark get_ext* function ext_hdr arguments as const
  ASoC: SOF: Introduce offset in firmware data
  ASoC: SOF: Introduce extended manifest
  ASoC: SOF: ext_manifest: parse firmware version
  ASoC: SOF: ext_manifest: parse windows
  ASoC: SOF: ext_manifest: parse compiler version

Pan Xiuli (6):
  ASoC: SOF: add probe support extend data
  ASoC: SOF: add debug ABI version
  ASoC: SOF: change type char to uint8_t in info.h
  ASoC: SOF: change type char to uint8_t in trace.h
  ASoC: SOF: change type char to uint8_t in topology.h
  ASoC: SOF: make sof_ipc_cc_version to fixed length

Sebastiano Carlucci (1):
  ASoC: SOF: topology: Add support for DC Blocker

Seppo Ingalsuo (3):
  ASoC: SOF: Intel: Fix typo in header file comment text
  ASoC: SOF: Intel: Change DMIC load IPC to fixed length
  ASoC: SOF: Intel: Rename deprecated DMIC IPC struct field

 include/sound/sof.h                   |   3 +
 include/sound/sof/dai-intel.h         |  20 +-
 include/sound/sof/info.h              |  26 ++-
 include/sound/sof/topology.h          |  16 +-
 include/sound/sof/trace.h             |   2 +-
 include/uapi/sound/sof/abi.h          |   2 +-
 include/uapi/sound/sof/ext_manifest.h |  91 ++++++++
 include/uapi/sound/sof/tokens.h       |   8 +
 sound/soc/sof/intel/hda-loader.c      |   9 +-
 sound/soc/sof/loader.c                | 226 ++++++++++++++++--
 sound/soc/sof/topology.c              | 323 ++++++++++++++++----------
 11 files changed, 568 insertions(+), 158 deletions(-)
 create mode 100644 include/uapi/sound/sof/ext_manifest.h

base-commit: 83b35f4586e235bfb785a7947b555ad8f3d96887
--
2.20.1

4 years agoMerge series "Add support for SOF on i.MX8M" from Daniel Baluta <daniel.baluta@oss...
Mark Brown [Wed, 15 Apr 2020 23:23:20 +0000 (00:23 +0100)]
Merge series "Add support for SOF on i.MX8M" from Daniel Baluta <daniel.baluta@oss.nxp.com>
Daniel Baluta <daniel.baluta@nxp.com>:

From: Daniel Baluta <daniel.baluta@nxp.com>

This patch series adds support for SOF on i.MX8M family. First board
from this family that has a DSP is i.MX8MP.

First 2 patches are trying to fix some compilation issues, the next two
are adding the imx8m support and the last one adds the devicetree
binding.

Changes since v2:
 - add reviewed by from Rob to DT patch
 - fix ownership for patch 2

Daniel Baluta (3):
  ASoC: SOF: imx: Add i.MX8M HW support
  ASoC: SOF: Add i.MX8MP device descriptor
  dt-bindings: dsp: fsl: Add fsl,imx8mp-dsp entry

Pierre-Louis Bossart (1):
  ASoC: SOF: imx: fix undefined reference issue

YueHaibing (1):
  ASoC: SOF: imx8: Fix randbuild error

 .../devicetree/bindings/dsp/fsl,dsp.yaml      |   2 +
 sound/soc/sof/imx/Kconfig                     |  32 +-
 sound/soc/sof/imx/Makefile                    |   2 +
 sound/soc/sof/imx/imx8m.c                     | 279 ++++++++++++++++++
 sound/soc/sof/sof-of-dev.c                    |  14 +
 5 files changed, 325 insertions(+), 4 deletions(-)
 create mode 100644 sound/soc/sof/imx/imx8m.c

--
2.17.1

4 years agoASoC: SOF: topology: handle multiple sets of tuple arrays
Jaska Uimonen [Wed, 15 Apr 2020 20:28:16 +0000 (15:28 -0500)]
ASoC: SOF: topology: handle multiple sets of tuple arrays

Widget's parameters are set in topology and they usually consist of
several different types of tuple arrays like strings, words and bytes.
Here this kind of combination is called a "set".

Lately we've seen more complex widget definitions with multiple
identical sets of tuple arrays. One example is the dmic pdm
configuration, which is currently handled as a special case in token
parsing. This is not scalable for other components with multiple sets.

So add a new function sof_parse_token_sets, which can be used to parse
multiple sets. This function defines the number of sets and an offset to
copy the tokens to correct positions in the destination ipc struct. Old
sof_parse_token function will be a special case of calling
sof_parse_token_sets to parse 1 set with offset 0.

Finally modify the dmic dai link loading to use the new
sof_parse_array_sets to load multiple pdm configs.

Signed-off-by: Jaska Uimonen <jaska.uimonen@linux.intel.com>
Signed-off-by: Pierre-Louis Bossart <pierre-louis.bossart@linux.intel.com>
Reviewed-by: Ranjani Sridharan <ranjani.sridharan@linux.intel.com>
Reviewed-by: Guennadi Liakhovetski <guennadi.liakhovetski@linux.intel.com>
Reviewed-by: Kai Vehmanen <kai.vehmanen@linux.intel.com>
Link: https://lore.kernel.org/r/20200415202816.934-25-pierre-louis.bossart@linux.intel.com
Signed-off-by: Mark Brown <broonie@kernel.org>
4 years agoASoC: SOF: topology: stop parsing when all tokens have been found
Jaska Uimonen [Wed, 15 Apr 2020 20:28:15 +0000 (15:28 -0500)]
ASoC: SOF: topology: stop parsing when all tokens have been found

Optimize the parsing so that it will stop after all required tokens
have been found as there is no reason to continue after that.

Signed-off-by: Jaska Uimonen <jaska.uimonen@linux.intel.com>
Signed-off-by: Pierre-Louis Bossart <pierre-louis.bossart@linux.intel.com>
Reviewed-by: Ranjani Sridharan <ranjani.sridharan@linux.intel.com>
Reviewed-by: Guennadi Liakhovetski <guennadi.liakhovetski@linux.intel.com>
Reviewed-by: Kai Vehmanen <kai.vehmanen@linux.intel.com>
Link: https://lore.kernel.org/r/20200415202816.934-24-pierre-louis.bossart@linux.intel.com
Signed-off-by: Mark Brown <broonie@kernel.org>
4 years agoASoC: SOF: topology: Get HDA rate and channels from topology
Bard Liao [Wed, 15 Apr 2020 20:28:14 +0000 (15:28 -0500)]
ASoC: SOF: topology: Get HDA rate and channels from topology

FW interface for HDA DAI parameters was extended with information on
sampling rate and channel count in version 3.16. Align kernel header
with the FW change. This change is backwards compatible. Old firmware
will ignore the values.

Signed-off-by: Bard Liao <yung-chuan.liao@linux.intel.com>
Signed-off-by: Pierre-Louis Bossart <pierre-louis.bossart@linux.intel.com>
Reviewed-by: Guennadi Liakhovetski <guennadi.liakhovetski@linux.intel.com>
Reviewed-by: Kai Vehmanen <kai.vehmanen@linux.intel.com>
Link: https://lore.kernel.org/r/20200415202816.934-23-pierre-louis.bossart@linux.intel.com
Signed-off-by: Mark Brown <broonie@kernel.org>
4 years agoASoC: SOF: topology: fix: parse hda_tokens to &config->hda
Bard Liao [Wed, 15 Apr 2020 20:28:13 +0000 (15:28 -0500)]
ASoC: SOF: topology: fix: parse hda_tokens to &config->hda

Items in hda_tokens are for &config->hda. So fix it to the right
object. This error has been harmless as hda_tokens array was empty.

Signed-off-by: Bard Liao <yung-chuan.liao@linux.intel.com>
Signed-off-by: Pierre-Louis Bossart <pierre-louis.bossart@linux.intel.com>
Reviewed-by: Guennadi Liakhovetski <guennadi.liakhovetski@linux.intel.com>
Reviewed-by: Kai Vehmanen <kai.vehmanen@linux.intel.com>
Link: https://lore.kernel.org/r/20200415202816.934-22-pierre-louis.bossart@linux.intel.com
Signed-off-by: Mark Brown <broonie@kernel.org>
4 years agoASoC: SOF: topology: Get ALH rate amd channels from topology
Bard Liao [Wed, 15 Apr 2020 20:28:12 +0000 (15:28 -0500)]
ASoC: SOF: topology: Get ALH rate amd channels from topology

FW will need these params for synchronized playback over multiple
DAIs.

Signed-off-by: Bard Liao <yung-chuan.liao@linux.intel.com>
Signed-off-by: Pierre-Louis Bossart <pierre-louis.bossart@linux.intel.com>
Reviewed-by: Guennadi Liakhovetski <guennadi.liakhovetski@linux.intel.com>
Reviewed-by: Sławomir Błauciak <slawomir.blauciak@linux.intel.com>
Reviewed-by: Kai Vehmanen <kai.vehmanen@linux.intel.com>
Link: https://lore.kernel.org/r/20200415202816.934-21-pierre-louis.bossart@linux.intel.com
Signed-off-by: Mark Brown <broonie@kernel.org>
4 years agoASoC: SOF: align sof_ipc_dai_alh_params with FW
Bard Liao [Wed, 15 Apr 2020 20:28:11 +0000 (15:28 -0500)]
ASoC: SOF: align sof_ipc_dai_alh_params with FW

Aligned with FW change. The rate and channel values are needed in
case of a connection with a demux for synchronize playback over
multiple ALH DAIs.

Signed-off-by: Bard Liao <yung-chuan.liao@linux.intel.com>
Signed-off-by: Pierre-Louis Bossart <pierre-louis.bossart@linux.intel.com>
Reviewed-by: Guennadi Liakhovetski <guennadi.liakhovetski@linux.intel.com>
Reviewed-by: Sławomir Błauciak <slawomir.blauciak@linux.intel.com>
Reviewed-by: Kai Vehmanen <kai.vehmanen@linux.intel.com>
Link: https://lore.kernel.org/r/20200415202816.934-20-pierre-louis.bossart@linux.intel.com
Signed-off-by: Mark Brown <broonie@kernel.org>
4 years agoASoC: SOF: Intel: Rename deprecated DMIC IPC struct field
Seppo Ingalsuo [Wed, 15 Apr 2020 20:28:10 +0000 (15:28 -0500)]
ASoC: SOF: Intel: Rename deprecated DMIC IPC struct field

This patch restores the field name to fifo_bits_b since the
legacy firmware compatibility code (for firmware ABI 3.0.0 or earlier)
sets it in sof_link_dmic_load() function in topology.c. Setting of
reserved_2 didn't look appropriate.

Signed-off-by: Seppo Ingalsuo <seppo.ingalsuo@linux.intel.com>
Signed-off-by: Pierre-Louis Bossart <pierre-louis.bossart@linux.intel.com>
Reviewed-by: Kai Vehmanen <kai.vehmanen@linux.intel.com>
Reviewed-by: Guennadi Liakhovetski <guennadi.liakhovetski@linux.intel.com>
Link: https://lore.kernel.org/r/20200415202816.934-19-pierre-louis.bossart@linux.intel.com
Signed-off-by: Mark Brown <broonie@kernel.org>
4 years agoASoC: SOF: Intel: Change DMIC load IPC to fixed length
Seppo Ingalsuo [Wed, 15 Apr 2020 20:28:09 +0000 (15:28 -0500)]
ASoC: SOF: Intel: Change DMIC load IPC to fixed length

This patch changes the flexible array member pdm[] into a fixed
array of four that is the max. number of stereo PDM controllers
in the current Intel platforms. The change simplifies DMIC DAI
load code and aligns the IPC with other DAI types.

The change is compatible with old and new firmware with similar
change. The ABI minor version is increased due to change in
IPC headers.

Signed-off-by: Seppo Ingalsuo <seppo.ingalsuo@linux.intel.com>
Signed-off-by: Pierre-Louis Bossart <pierre-louis.bossart@linux.intel.com>
Reviewed-by: Kai Vehmanen <kai.vehmanen@linux.intel.com>
Reviewed-by: Guennadi Liakhovetski <guennadi.liakhovetski@linux.intel.com>
Link: https://lore.kernel.org/r/20200415202816.934-18-pierre-louis.bossart@linux.intel.com
Signed-off-by: Mark Brown <broonie@kernel.org>
4 years agoASoC: SOF: Intel: Fix typo in header file comment text
Seppo Ingalsuo [Wed, 15 Apr 2020 20:28:08 +0000 (15:28 -0500)]
ASoC: SOF: Intel: Fix typo in header file comment text

This patch fixes the typo in word "microphone".

Signed-off-by: Seppo Ingalsuo <seppo.ingalsuo@linux.intel.com>
Signed-off-by: Pierre-Louis Bossart <pierre-louis.bossart@linux.intel.com>
Reviewed-by: Kai Vehmanen <kai.vehmanen@linux.intel.com>
Reviewed-by: Guennadi Liakhovetski <guennadi.liakhovetski@linux.intel.com>
Link: https://lore.kernel.org/r/20200415202816.934-17-pierre-louis.bossart@linux.intel.com
Signed-off-by: Mark Brown <broonie@kernel.org>
4 years agoASoC: SOF: Add XRUN flags field to struct sof_ipc_buffer.
Artur Kloniecki [Wed, 15 Apr 2020 20:28:07 +0000 (15:28 -0500)]
ASoC: SOF: Add XRUN flags field to struct sof_ipc_buffer.

Currently if a component source buffer underruns or a component sink
buffer overruns the pipeline will enter an XRUN status and attempt
recovery. This is desired in most pipelines but some topologies need to
support use cases where we expect buffers to underrun or overrun.

Host ---> Proc----> Selector0 --> Buf0 ---- > DAI Playback
                      |
                      v
                     Buf1
                      |
                      v
Host <---------------Selector1 <----- Buf2 <----- Echo Ref DAI

In the example above we two host PCMs that can be independently
started/stopped thereby causing buf1 to either underrun or overrun
(and stop the pipelines). Buf1 should be permitted to underrun or overrun
without invoking pipeline XRUN logic and should over write oldest data
(for overrun) and readback 0s (for underrun).

2 flags have been added for use during buffer instantiation:
SOF_BUF_OVERRUN_PERMITTED and SOF_BUF_UNDERRUN_PERMITTED,
along with struct sof_ipc_buffer member fields: flags and reserved.
Flags field is supposed to hold the above-mentioned flags to allow
some control over XRUN behaviour.
Also added reserved field to the structure in case it comes in handy
some time in the future.

This is an incremental ABI change as the new fields are ignored by older
versions of the firmware.

Signed-off-by: Artur Kloniecki <arturx.kloniecki@linux.intel.com>
Signed-off-by: Pierre-Louis Bossart <pierre-louis.bossart@linux.intel.com>
Reviewed-by: Kai Vehmanen <kai.vehmanen@linux.intel.com>
Reviewed-by: Guennadi Liakhovetski <guennadi.liakhovetski@linux.intel.com>
Link: https://lore.kernel.org/r/20200415202816.934-16-pierre-louis.bossart@linux.intel.com
Signed-off-by: Mark Brown <broonie@kernel.org>
4 years agoASoC: SOF: make sof_ipc_cc_version to fixed length
Pan Xiuli [Wed, 15 Apr 2020 20:28:06 +0000 (15:28 -0500)]
ASoC: SOF: make sof_ipc_cc_version to fixed length

Align struct sof_ipc_cc_version to firmware definition in SOF ABI 3.15.0.

The struct definition was changed due to errors in FW build.
The Cadence XCC compiler produces incorrect linkage section sizes, when a
variable length array is used in the compiler version struct. The firmware
definition was changed to a fixed 32 byte compiler description string.
This length covers all released firmware binaries and thus only a minor
ABI change is needed.

As the same structure is used in IPC messages between driver and firmware,
the kernel needs to be aligned to firmware change.

Signed-off-by: Pan Xiuli <xiuli.pan@linux.intel.com>
Signed-off-by: Pierre-Louis Bossart <pierre-louis.bossart@linux.intel.com>
Reviewed-by: Kai Vehmanen <kai.vehmanen@linux.intel.com>
Link: https://lore.kernel.org/r/20200415202816.934-15-pierre-louis.bossart@linux.intel.com
Signed-off-by: Mark Brown <broonie@kernel.org>
4 years agoASoC: SOF: change type char to uint8_t in topology.h
Pan Xiuli [Wed, 15 Apr 2020 20:28:05 +0000 (15:28 -0500)]
ASoC: SOF: change type char to uint8_t in topology.h

Use uint8_t to replace char in packed ABI structs
to have fixed length for struct.

Signed-off-by: Pan Xiuli <xiuli.pan@linux.intel.com>
Signed-off-by: Pierre-Louis Bossart <pierre-louis.bossart@linux.intel.com>
Reviewed-by: Kai Vehmanen <kai.vehmanen@linux.intel.com>
Link: https://lore.kernel.org/r/20200415202816.934-14-pierre-louis.bossart@linux.intel.com
Signed-off-by: Mark Brown <broonie@kernel.org>
4 years agoASoC: SOF: change type char to uint8_t in trace.h
Pan Xiuli [Wed, 15 Apr 2020 20:28:04 +0000 (15:28 -0500)]
ASoC: SOF: change type char to uint8_t in trace.h

Use uint8_t to replace char in packed ABI structs
to have fixed length for struct.

Signed-off-by: Pan Xiuli <xiuli.pan@linux.intel.com>
Signed-off-by: Pierre-Louis Bossart <pierre-louis.bossart@linux.intel.com>
Reviewed-by: Kai Vehmanen <kai.vehmanen@linux.intel.com>
Link: https://lore.kernel.org/r/20200415202816.934-13-pierre-louis.bossart@linux.intel.com
Signed-off-by: Mark Brown <broonie@kernel.org>
4 years agoASoC: SOF: change type char to uint8_t in info.h
Pan Xiuli [Wed, 15 Apr 2020 20:28:03 +0000 (15:28 -0500)]
ASoC: SOF: change type char to uint8_t in info.h

Use uint8_t to replace char in packed ABI structs
to have fixed length for struct.

Signed-off-by: Pan Xiuli <xiuli.pan@linux.intel.com>
Signed-off-by: Pierre-Louis Bossart <pierre-louis.bossart@linux.intel.com>
Reviewed-by: Kai Vehmanen <kai.vehmanen@linux.intel.com>
Link: https://lore.kernel.org/r/20200415202816.934-12-pierre-louis.bossart@linux.intel.com
Signed-off-by: Mark Brown <broonie@kernel.org>
4 years agoASoC: SOF: add debug ABI version
Pan Xiuli [Wed, 15 Apr 2020 20:28:02 +0000 (15:28 -0500)]
ASoC: SOF: add debug ABI version

Add new debug ABI version to be increased when changing user space debug
interfaces while the the main FW ABI is not affected.

The abi_dbg_version share same definition with SOF_ABI_VER

This change main ABI to 3.14.0

Signed-off-by: Pan Xiuli <xiuli.pan@linux.intel.com>
Signed-off-by: Pierre-Louis Bossart <pierre-louis.bossart@linux.intel.com>
Reviewed-by: Kai Vehmanen <kai.vehmanen@linux.intel.com>
Link: https://lore.kernel.org/r/20200415202816.934-11-pierre-louis.bossart@linux.intel.com
Signed-off-by: Mark Brown <broonie@kernel.org>