OSDN Git Service

uclinux-h8/linux.git
4 years agoASoC: add soc-card.c
Kuninori Morimoto [Thu, 28 May 2020 01:47:46 +0000 (10:47 +0900)]
ASoC: add soc-card.c

Current ALSA SoC has some snd_soc_card_xxx() functions,
and card->xxx() callbacks.
But, it is implemented randomly at random place.

To collect all card related functions into one place,
this patch creats new soc-card.c.

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/87blm825kt.wl-kuninori.morimoto.gx@renesas.com
Signed-off-by: Mark Brown <broonie@kernel.org>
4 years agoASoC: soc.h: convert bool to bit field for snd_soc_card
Kuninori Morimoto [Thu, 28 May 2020 01:47:37 +0000 (10:47 +0900)]
ASoC: soc.h: convert bool to bit field for snd_soc_card

snd_soc_card has many bool, but it can be bit field.

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/87d06o25l2.wl-kuninori.morimoto.gx@renesas.com
Signed-off-by: Mark Brown <broonie@kernel.org>
4 years agoMerge series "Kconfig updates for DMIC and SOF HDMI support" from Pierre-Louis Bossar...
Mark Brown [Fri, 29 May 2020 20:43:38 +0000 (21:43 +0100)]
Merge series "Kconfig updates for DMIC and SOF HDMI support" from Pierre-Louis Bossart <pierre-louis.bossart@linux.intel.com>:

This series provides the following updates 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.

changes since v1:
first patch for DMIC was merged already
rebase for HDMI on top of Arnd's RT5682 changes.

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

 sound/soc/intel/boards/Kconfig        | 20 ++++++++++----------
 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, 10 insertions(+), 34 deletions(-)

base-commit: 89d73ccab20a684d8446cea4d8ac6a2608c8d390
--
2.20.1

4 years agodt-bindings: ASoC: renesas,rsnd: Add r8a7742 support
Lad Prabhakar [Tue, 26 May 2020 21:01:43 +0000 (22:01 +0100)]
dt-bindings: ASoC: renesas,rsnd: Add r8a7742 support

Document RZ/G1H (R8A7742) SoC bindings.

Signed-off-by: Lad Prabhakar <prabhakar.mahadev-lad.rj@bp.renesas.com>
Reviewed-by: Marian-Cristian Rotariu <marian-cristian.rotariu.rb@bp.renesas.com>
Reviewed-by: Geert Uytterhoeven <geert+renesas@glider.be>
Acked-by: Rob Herring <robh@kernel.org>
Link: https://lore.kernel.org/r/1590526904-13855-2-git-send-email-prabhakar.mahadev-lad.rj@bp.renesas.com
Signed-off-by: Mark Brown <broonie@kernel.org>
4 years agoASoC: sof_pcm512x: remove CONFIG_SND_HDA_CODEC_HDMI condition
Libin Yang [Fri, 29 May 2020 19:35:47 +0000 (14:35 -0500)]
ASoC: sof_pcm512x: remove CONFIG_SND_HDA_CODEC_HDMI condition

As CONFIG_SND_HDA_CODEC_HDMI is always enabled in sof_pcm512x,
let's remove the test of CONFIG_SND_HDA_CODEC_HDMI in the
sof_pcm512x driver.

Signed-off-by: Libin Yang <libin.yang@linux.intel.com>
Signed-off-by: Ranjani Sridharan <ranjani.sridharan@linux.intel.com>
Signed-off-by: Pierre-Louis Bossart <pierre-louis.bossart@linux.intel.com>
Reviewed-by: Kai Vehmanen <kai.vehmanen@linux.intel.com>
Link: https://lore.kernel.org/r/20200529193547.6077-4-pierre-louis.bossart@linux.intel.com
Signed-off-by: Mark Brown <broonie@kernel.org>
4 years agoASoC: sof-sdw: remove CONFIG_SND_SOC_SOF_HDA_AUDIO_CODEC condition
Libin Yang [Fri, 29 May 2020 19:35:46 +0000 (14:35 -0500)]
ASoC: sof-sdw: remove CONFIG_SND_SOC_SOF_HDA_AUDIO_CODEC condition

As CONFIG_SND_SOC_SOF_HDA_AUDIO_CODEC is always enabled in sof-soundwire
driver, let's remove the test of CONFIG_SND_SOC_SOF_HDA_AUDIO_CODEC
in the code.

Signed-off-by: Libin Yang <libin.yang@linux.intel.com>
Signed-off-by: Ranjani Sridharan <ranjani.sridharan@linux.intel.com>
Signed-off-by: Pierre-Louis Bossart <pierre-louis.bossart@linux.intel.com>
Reviewed-by: Kai Vehmanen <kai.vehmanen@linux.intel.com>
Link: https://lore.kernel.org/r/20200529193547.6077-3-pierre-louis.bossart@linux.intel.com
Signed-off-by: Mark Brown <broonie@kernel.org>
4 years agoASoC: intel: add depends on SND_SOC_SOF_HDA_AUDIO_CODEC for common hdmi
Libin Yang [Fri, 29 May 2020 19:35:45 +0000 (14:35 -0500)]
ASoC: intel: add depends on SND_SOC_SOF_HDA_AUDIO_CODEC for common hdmi

If the driver uses common hdmi, SND_SOC_SOF_HDA_AUDIO_CODEC is required
to be enabled. Otherwise, the legacy hda codec driver will not be used.

Signed-off-by: Libin Yang <libin.yang@linux.intel.com>
Signed-off-by: Ranjani Sridharan <ranjani.sridharan@linux.intel.com>
Signed-off-by: Pierre-Louis Bossart <pierre-louis.bossart@linux.intel.com>
Reviewed-by: Kai Vehmanen <kai.vehmanen@linux.intel.com>
Link: https://lore.kernel.org/r/20200529193547.6077-2-pierre-louis.bossart@linux.intel.com
Signed-off-by: Mark Brown <broonie@kernel.org>
4 years agoASoC: SOF: Intel: hda: fix generic hda codec support
Kai Vehmanen [Fri, 29 May 2020 16:03:58 +0000 (19:03 +0300)]
ASoC: SOF: Intel: hda: fix generic hda codec support

Add support for using generic codec driver with SOF. Generic driver
is used if:
 - snd_sof_intel_hda_common.hda_model="generic" is set, or
 - fallback if no other codec driver is found

The implementation is aligned with snd-hda-intel driver, and fixes audio
support for systems like Acer Swift 3 SF314-57G, on which this issue was
originally reported.

Signed-off-by: Kai Vehmanen <kai.vehmanen@linux.intel.com>
Reviewed-by: Hui Wang <hui.wang@canonical.com>
Reviewed-by: Guennadi Liakhovetski <guennadi.liakhovetski@linux.intel.com>
Reviewed-by: Pierre-Louis Bossart <pierre-louis.bossart@linux.intel.com>
BugLink: https://github.com/thesofproject/linux/issues/1807
BugLink: https://bugs.launchpad.net/bugs/1877757
Link: https://lore.kernel.org/r/20200529160358.12134-1-kai.vehmanen@linux.intel.com
Signed-off-by: Mark Brown <broonie@kernel.org>
4 years agoASoC: SOF: Intel: Baytrail: fix 'defined but not used' warnings
Pierre-Louis Bossart [Fri, 29 May 2020 15:04:08 +0000 (10:04 -0500)]
ASoC: SOF: Intel: Baytrail: fix 'defined but not used' warnings

With the allmodconfig option, CONFIG_SND_SOC_SOF_BAYTRAIL is disabled
due to mutual exclusion with the legacy driver. This generates
'defined by not used' warnings.

suspend/resume/remove are only supported for Baytrail for now, so move
the code under the CONFIG_SND_SOC_SOF_BAYTRAIL checks.

Fixes: ddcccd543f5d ("ASoC: SOF: Intel: byt: Add PM callbacks")
Reported-by: Stephen Rothwell <sfr@canb.auug.org.au>
Signed-off-by: Pierre-Louis Bossart <pierre-louis.bossart@linux.intel.com>
Link: https://lore.kernel.org/r/20200529150408.17236-1-pierre-louis.bossart@linux.intel.com
Signed-off-by: Mark Brown <broonie@kernel.org>
4 years agoSubject: [PATCH v2] ASoC: soc-pcm: fix BE dai not hw_free and shutdown during mixer...
朱灿灿 [Fri, 29 May 2020 10:12:44 +0000 (18:12 +0800)]
Subject: [PATCH v2] ASoC: soc-pcm: fix BE dai not hw_free and shutdown during mixer update

FE state is SND_SOC_DPCM_STATE_PREPARE now, BE1 is
used by FE.

Later when new BE2 is added to FE by mixer update,
it will call dpcm_run_update_startup() to update
BE2's state, but unfortunately BE2 .prepare() meets
error, it will disconnect all non started BE.

This make BE1 dai skip .hw_free() and .shutdown(),
and the BE1 users will never decrease to zero.

Signed-off-by: zhucancan <zhucancan@vivo.com>
Link: https://lore.kernel.org/r/ALMAWwB5CP9aAcKXCU5FzqqF.1.1590747164172.Hmail.zhucancan@vivo.com
Signed-off-by: Mark Brown <broonie@kernel.org>
4 years agoASoC: reduce verbosity of error messages for sof-dai and sof-link
Pierre-Louis Bossart [Fri, 29 May 2020 12:36:13 +0000 (07:36 -0500)]
ASoC: reduce verbosity of error messages for sof-dai and sof-link

Recent changes result in multiple dmesg traces such as:

[ 14.410435] Audio Port: ASoC: error at snd_soc_link_startup on Audio
Port: 1

[ 14.410446] sst-mfld-platform sst-mfld-platform: ASoC: error at
snd_soc_dai_startup on media-cpu-dai: 1

These messages are not really errors, when dai and dai-link callbacks
return the value of e.g. snd_pcm_hw_constraint_single() the result is
"Positive if the value is changed, zero if it's not changed, or a
negative error code"

Add a simple test to skip the checks for positive returned values

Suggested-by: Kuninori Morimoto <kuninori.morimoto.gx@renesas.com>
Signed-off-by: Pierre-Louis Bossart <pierre-louis.bossart@linux.intel.com>
Link: https://lore.kernel.org/r/20200529123613.13447-1-pierre-louis.bossart@linux.intel.com
Signed-off-by: Mark Brown <broonie@kernel.org>
4 years agoMerge series "ASoC topology header parsing refinement" from Keyon Jie <yang.jie@linux...
Mark Brown [Fri, 29 May 2020 12:30:08 +0000 (13:30 +0100)]
Merge series "ASoC topology header parsing refinement" from Keyon Jie <yang.jie@linux.intel.com>:

This small series is to optimize the header logging during the topology
parsing. This is verified work fine on both SOF and SST drivers.

Change History:
v3:
- Remove using the separated soc_pass_load() function and merge it to the
  soc_tplg_load_header() body.
- Add more Tested-by tags.

v2:
- Change the internal used array to be 'static' to fix the issue
  reported by: kbuild test robot <lkp@intel.com>
- Add testing coverage including Intel SST driver also.

v1:
- Initial version.

Keyon Jie (2):
  ASoC: topology: refine and log the header in the correct pass
  ASoC: topology: remove the redundant pass checks

 sound/soc/soc-topology.c | 96 ++++++++++++++++------------------------
 1 file changed, 38 insertions(+), 58 deletions(-)

--
2.25.1

4 years agoASoC: fsl_asrc_dma: Fix dma_chan leak when config DMA channel failed
Xiyu Yang [Mon, 25 May 2020 14:12:46 +0000 (22:12 +0800)]
ASoC: fsl_asrc_dma: Fix dma_chan leak when config DMA channel failed

fsl_asrc_dma_hw_params() invokes dma_request_channel() or
fsl_asrc_get_dma_channel(), which returns a reference of the specified
dma_chan object to "pair->dma_chan[dir]" with increased refcnt.

The reference counting issue happens in one exception handling path of
fsl_asrc_dma_hw_params(). When config DMA channel failed for Back-End,
the function forgets to decrease the refcnt increased by
dma_request_channel() or fsl_asrc_get_dma_channel(), causing a refcnt
leak.

Fix this issue by calling dma_release_channel() when config DMA channel
failed.

Signed-off-by: Xiyu Yang <xiyuyang19@fudan.edu.cn>
Signed-off-by: Xin Tan <tanxin.ctf@gmail.com>
Link: https://lore.kernel.org/r/1590415966-52416-1-git-send-email-xiyuyang19@fudan.edu.cn
Signed-off-by: Mark Brown <broonie@kernel.org>
4 years agoASoC: rt1015: Enable class-D silence and clock detections
derek.fang [Fri, 29 May 2020 11:05:10 +0000 (19:05 +0800)]
ASoC: rt1015: Enable class-D silence and clock detections

Avoid noise under bypass boost mode.

Signed-off-by: derek.fang <derek.fang@realtek.com>
Link: https://lore.kernel.org/r/1590750310-30085-1-git-send-email-derek.fang@realtek.com
Signed-off-by: Mark Brown <broonie@kernel.org>
4 years agoASoC: tlv320adcx140: Fix dt-binding-check issue
Dan Murphy [Thu, 28 May 2020 14:47:11 +0000 (09:47 -0500)]
ASoC: tlv320adcx140: Fix dt-binding-check issue

Fix dt-binding-check issue

ti,gpi-config:0:0: 4 is greater than the maximum of 1
ti,gpi-config:0:1: 5 is greater than the maximum of 1
ti,gpi-config:0:2: 6 is greater than the maximum of 1
ti,gpi-config:0:3: 7 is greater than the maximum of 1

Reported-by: Rob Herring <robh@kernel.org>
Signed-off-by: Dan Murphy <dmurphy@ti.com>
Reviewed-by: Rob Herring <robh@kernel.org>
Link: https://lore.kernel.org/r/20200528144711.18065-1-dmurphy@ti.com
Signed-off-by: Mark Brown <broonie@kernel.org>
4 years agoASoC: img-i2s-out: Fix runtime PM imbalance on error
Dinghao Liu [Fri, 29 May 2020 01:22:28 +0000 (09:22 +0800)]
ASoC: img-i2s-out: Fix runtime PM imbalance on error

pm_runtime_get_sync() increments the runtime PM usage counter even
the call returns an error code. Thus a pairing decrement is needed
on the error handling path to keep the counter balanced.

Signed-off-by: Dinghao Liu <dinghao.liu@zju.edu.cn>
Link: https://lore.kernel.org/r/20200529012230.5863-1-dinghao.liu@zju.edu.cn
Signed-off-by: Mark Brown <broonie@kernel.org>
4 years agoASoC: topology: remove the redundant pass checks
Keyon Jie [Wed, 27 May 2020 02:28:01 +0000 (10:28 +0800)]
ASoC: topology: remove the redundant pass checks

As we have check the 'pass' in the soc_elem_pass_load(), so no need to
check it again in each specific elem_load function, at the same time,
the tplg->pos will be reset to the next header base when the pass is
mismatched, so the increasing of the tplg->pos in these cases made no
sense. Here remove all of them.

Signed-off-by: Keyon Jie <yang.jie@linux.intel.com>
Tested-by: Vamshi Kerishna Gopal <vamshi.krishna.gopal@intel.com>
Tested-by: Cezary Rojewski <cezary.rojewski@intel.com>
Reviewed-by: Cezary Rojewski <cezary.rojewski@intel.com>
Reviewed-by: Ranjani Sridharan <ranjani.sridharan@linux.intel.com>
Link: https://lore.kernel.org/r/20200527022801.336264-3-yang.jie@linux.intel.com
Signed-off-by: Mark Brown <broonie@kernel.org>
4 years agoASoC: topology: refine and log the header in the correct pass
Keyon Jie [Wed, 27 May 2020 02:28:00 +0000 (10:28 +0800)]
ASoC: topology: refine and log the header in the correct pass

The check (tplg->pass == le32_to_cpu(hdr->type)) makes no sense as it is
comparing two different enums, refine the element loading functions, and
log the information when the header is being parsed in the corresponding
parsing pass.

Signed-off-by: Keyon Jie <yang.jie@linux.intel.com>
Tested-by: Vamshi Kerishna Gopal <vamshi.krishna.gopal@intel.com>
Tested-by: Cezary Rojewski <cezary.rojewski@intel.com>
Reviewed-by: Cezary Rojewski <cezary.rojewski@intel.com>
Reviewed-by: Ranjani Sridharan <ranjani.sridharan@linux.intel.com>
Link: https://lore.kernel.org/r/20200527022801.336264-2-yang.jie@linux.intel.com
Signed-off-by: Mark Brown <broonie@kernel.org>
4 years agoASoC: amd: Removing unnecessary instance initialization
Ravulapati Vishnu vardhan rao [Thu, 28 May 2020 07:52:16 +0000 (13:22 +0530)]
ASoC: amd: Removing unnecessary instance initialization

In DMA pointer the initialzation of instance is of no use.
In fact it will reinitialize the instance variable which is already
opened and functional.

Signed-off-by: Ravulapati Vishnu vardhan rao <Vishnuvardhanrao.Ravulapati@amd.com>
Link: https://lore.kernel.org/r/1590652337-21587-1-git-send-email-Vishnuvardhanrao.Ravulapati@amd.com
Signed-off-by: Mark Brown <broonie@kernel.org>
4 years agoASoC: sta32x: add missed function calls in error paths
Chuhong Yuan [Thu, 28 May 2020 10:20:04 +0000 (18:20 +0800)]
ASoC: sta32x: add missed function calls in error paths

sta32x_probe() forgets to call undo functions when it fails, add
the missed function calls to fix it.

Signed-off-by: Chuhong Yuan <hslester96@gmail.com>
Link: https://lore.kernel.org/r/20200528102004.911653-1-hslester96@gmail.com
Signed-off-by: Mark Brown <broonie@kernel.org>
4 years agoASoC: rt5682: split i2c driver into separate module
Arnd Bergmann [Thu, 28 May 2020 09:17:17 +0000 (11:17 +0200)]
ASoC: rt5682: split i2c driver into separate module

With SND_SOC_AMD_RV_RT5682_MACH using the i2c version of the
driver, we can easily get a build failure when I2C is built-in
but soundwire is not:

 WARNING: unmet direct dependencies detected for SND_SOC_RT5682
   Depends on [m]: SOUND [=y] && !UML && SND [=y] && SND_SOC [=y] && (I2C [=y] || SOUNDWIRE [=m]) && (SOUNDWIRE [=m] || !SOUNDWIRE [=m]) && (I2C [=y] || !I2C [=y])
   Selected by [y]:
   - SND_SOC_AMD_RV_RT5682_MACH [=y] && SOUND [=y] && !UML && SND [=y] && SND_SOC [=y] && SND_SOC_AMD_ACP3x [=y] && I2C [=y] && CROS_EC [=y]
   Selected by [m]:
   - SND_SOC_RT5682_SDW [=m] && SOUND [=y] && !UML && SND [=y] && SND_SOC [=y] && SOUNDWIRE [=m] && (I2C [=y] || !I2C [=y])

Rework the driver to have three separate modules, with the
main driver just dealing with the common bits and the actual
initialization as part of i2c and sdw specific modules.

The conversion is fairly mechanical to keep it easy to review,
i.e. it moves code around with the minimal required renaming
and changes.

Fixes: 6b8e4e7db3cd ("ASoC: amd: Add machine driver for Raven based platform")
Fixes: fd443a20c2f0 ("ASoC: rt5682: fix I2C/Soundwire dependencies")
Signed-off-by: Arnd Bergmann <arnd@arndb.de>
Reviewed-by: Pierre-Louis Bossart <pierre-louis.bossart@linux.intel.com>
Link: https://lore.kernel.org/r/20200528091851.2889754-1-arnd@arndb.de
Signed-off-by: Mark Brown <broonie@kernel.org>
4 years agoASoC: nau8810: add I2C device and compatible ID
Seven Lee [Thu, 28 May 2020 07:05:10 +0000 (15:05 +0800)]
ASoC: nau8810: add I2C device and compatible ID

The nau8810 driver can also compatible with nau8812 and nau8814.

Signed-off-by: Seven Lee <wtli@nuvoton.com>
Link: https://lore.kernel.org/r/20200528070510.29959-1-wtli@nuvoton.com
Signed-off-by: Mark Brown <broonie@kernel.org>
4 years agoASoC: ingenic: Unconditionally depend on devicetree
Paul Cercueil [Sat, 23 May 2020 12:54:55 +0000 (14:54 +0200)]
ASoC: ingenic: Unconditionally depend on devicetree

All boards with Ingenic SoCs probe with devicetree already, we have no
use for a non-devicetree path.

This solves some compilation warnings that were caused by unused
variables in the case where CONFIG_OF was disabled.

Reported-by: kbuild test robot <lkp@intel.com>
Signed-off-by: Paul Cercueil <paul@crapouillou.net>
Link: https://lore.kernel.org/r/20200523125455.12392-1-paul@crapouillou.net
Signed-off-by: Mark Brown <broonie@kernel.org>
4 years agoMerge series "ASoC: SOF: finalize Baytrail/CherryTrail support" from Pierre-Louis...
Mark Brown [Wed, 27 May 2020 13:48:57 +0000 (14:48 +0100)]
Merge series "ASoC: SOF: finalize Baytrail/CherryTrail support" from Pierre-Louis Bossart <pierre-louis.bossart@linux.intel.com>:

This long-overdue patchset adds missing system suspend/resume support
and hardens the IPC to solve module load/unload issues on specific
devices such as Cyan Chromebook. With this series SOF is finally
iso-feature with the legacy driver. Thanks to Ranjani and Keyon for
the basic patches and Enric for testing.

The last part needed for Baytrail/Cherrytrail is simplification of the
driver/card names and turn-key UCM support (on-going work with
Jaroslav).

Keyon Jie (1):
  ASoC: SOF: Intel: BYT: harden IPC initialization and handling

Pierre-Louis Bossart (3):
  ASoC: Intel: bytcr_rt5640/51: remove .ignore_suspend
  ASoC: Intel: byt/cht: add .pm_ops
  ASoC: SOF: Intel: BYT: mask BUSY or DONE interrupts in handler

Ranjani Sridharan (4):
  ASoC: SOF: Intel: byt: Add PM callbacks
  ASoC: SOF: pm: handle resume on legacy Intel platforms
  ASoC: SOF: ipc: ignore DSP replies received when they are not expected
  ASoC: SOF: Intel: BYT: add .remove op

 sound/soc/intel/boards/bytcht_cx2072x.c      |   3 +
 sound/soc/intel/boards/bytcht_da7213.c       |   3 +
 sound/soc/intel/boards/bytcht_es8316.c       |   3 +
 sound/soc/intel/boards/bytcr_rt5640.c        |   7 +-
 sound/soc/intel/boards/bytcr_rt5651.c        |   6 +-
 sound/soc/intel/boards/cht_bsw_max98090_ti.c |   3 +
 sound/soc/intel/boards/cht_bsw_nau8824.c     |   3 +
 sound/soc/intel/boards/cht_bsw_rt5645.c      |   3 +
 sound/soc/intel/boards/cht_bsw_rt5672.c      |   3 +
 sound/soc/sof/intel/byt.c                    | 116 ++++++++++++++-----
 sound/soc/sof/ipc.c                          |   9 +-
 sound/soc/sof/pm.c                           |   8 +-
 sound/soc/sof/sof-priv.h                     |   2 +-
 13 files changed, 122 insertions(+), 47 deletions(-)

base-commit: 0d71a5cf691a8226151ceeb79fb872925f053df5
--
2.20.1

4 years agoASoC: mmp-sspa: Fix return value check in asoc_mmp_sspa_probe()
Wei Yongjun [Wed, 27 May 2020 03:02:10 +0000 (03:02 +0000)]
ASoC: mmp-sspa: Fix return value check in asoc_mmp_sspa_probe()

In case of error, the function devm_ioremap() returns NULL pointer not
ERR_PTR(). The IS_ERR() test in the return value check should be
replaced with NULL test.

Signed-off-by: Wei Yongjun <weiyongjun1@huawei.com>
Link: https://lore.kernel.org/r/20200527030210.124393-1-weiyongjun1@huawei.com
Signed-off-by: Mark Brown <broonie@kernel.org>
4 years agoASoC: tlv320adcx140: Fix warnings when using W=1
Dan Murphy [Tue, 26 May 2020 17:52:47 +0000 (12:52 -0500)]
ASoC: tlv320adcx140: Fix warnings when using W=1

Fix the warnings when using the W=1 compiler flag.

sound/soc/codecs/tlv320adcx140.c: In function ‘adcx140_reset’:
sound/soc/codecs/tlv320adcx140.c:570:6: warning: variable ‘ret’ set but not used [-Wunused-but-set-variable]
  570 |  int ret = 0;
      |      ^~~

This was set but only used in case where the reset GPIO is not defined.
Have the function return the value of ret.

sound/soc/codecs/tlv320adcx140.c: In function ‘adcx140_codec_probe’:
sound/soc/codecs/tlv320adcx140.c:778:18: warning: comparison of unsigned expression < 0 is always false [-Wtype-limits]
  778 |  if (bias_source < ADCX140_MIC_BIAS_VAL_VREF ||
      |                  ^
sound/soc/codecs/tlv320adcx140.c:789:18: warning: comparison of unsigned expression < 0 is always false [-Wtype-limits]
  789 |  if (vref_source < ADCX140_MIC_BIAS_VREF_275V ||

This condition will not occur since if the dt property is not set then
the *_source variable is set to the default value.  So there is no way
that *_source can be less then 0.  Which is what each #define is set to.
The code just needs to make sure that the dt property is not out of the
upper bounds.

Reported-by: kbuild test robot <lkp@intel.com>
Signed-off-by: Dan Murphy <dmurphy@ti.com>
Link: https://lore.kernel.org/r/20200526175247.15309-1-dmurphy@ti.com
Signed-off-by: Mark Brown <broonie@kernel.org>
4 years agoASoC: wm8962: Fix runtime PM imbalance on error
Dinghao Liu [Wed, 27 May 2020 02:46:22 +0000 (10:46 +0800)]
ASoC: wm8962: Fix runtime PM imbalance on error

pm_runtime_get_sync() increments the runtime PM usage counter even
the call returns an error code. Thus a pairing decrement is needed
on the error handling path to keep the counter balanced.

Signed-off-by: Dinghao Liu <dinghao.liu@zju.edu.cn>
Acked-by: Charles Keepax <ckeepax@opensource.cirrus.com>
Link: https://lore.kernel.org/r/20200527024625.9937-1-dinghao.liu@zju.edu.cn
Signed-off-by: Mark Brown <broonie@kernel.org>
4 years agoASoC: img-spdif-in: Fix runtime PM imbalance on error
Dinghao Liu [Wed, 27 May 2020 08:43:24 +0000 (16:43 +0800)]
ASoC: img-spdif-in: Fix runtime PM imbalance on error

pm_runtime_get_sync() increments the runtime PM usage counter even
the call returns an error code. Thus a pairing decrement is needed
on the error handling path to keep the counter balanced.

Signed-off-by: Dinghao Liu <dinghao.liu@zju.edu.cn>
Link: https://lore.kernel.org/r/20200527084326.4131-1-dinghao.liu@zju.edu.cn
Signed-off-by: Mark Brown <broonie@kernel.org>
4 years agoASoC: tlv320adcx140: Add support for configuring GPI pins
Dan Murphy [Tue, 26 May 2020 20:09:17 +0000 (15:09 -0500)]
ASoC: tlv320adcx140: Add support for configuring GPI pins

Add support to configure the GPI pins to the specific configuration.
The pins can be disabled or be configured as data input for any of the
digital mic channels.  In addition the GPI can be used a a general
purpose input, a Master clock input or an ASI input for daisy chaining
devices.

Signed-off-by: Dan Murphy <dmurphy@ti.com>
Link: https://lore.kernel.org/r/20200526200917.10385-2-dmurphy@ti.com
Signed-off-by: Mark Brown <broonie@kernel.org>
4 years agodt-bindings: sound: tlv320adcx140: Add GPI config property
Dan Murphy [Tue, 26 May 2020 20:09:16 +0000 (15:09 -0500)]
dt-bindings: sound: tlv320adcx140: Add GPI config property

Add an array property that configures the General Purpose Input (GPI)
register.  The device has 4 GPI pins and each pin can be configured in 1
of 7 different ways.

Signed-off-by: Dan Murphy <dmurphy@ti.com>
Link: https://lore.kernel.org/r/20200526200917.10385-1-dmurphy@ti.com
Signed-off-by: Mark Brown <broonie@kernel.org>
4 years agoASoC: img-spdif-out: Fix runtime PM imbalance on error
Dinghao Liu [Wed, 27 May 2020 08:46:08 +0000 (16:46 +0800)]
ASoC: img-spdif-out: Fix runtime PM imbalance on error

pm_runtime_get_sync() increments the runtime PM usage counter even
the call returns an error code. Thus a pairing decrement is needed
on the error handling path to keep the counter balanced.

Signed-off-by: Dinghao Liu <dinghao.liu@zju.edu.cn>
Link: https://lore.kernel.org/r/20200527084610.4790-1-dinghao.liu@zju.edu.cn
Signed-off-by: Mark Brown <broonie@kernel.org>
4 years agoASoC: SOF: Intel: BYT: harden IPC initialization and handling
Keyon Jie [Tue, 26 May 2020 20:36:40 +0000 (15:36 -0500)]
ASoC: SOF: Intel: BYT: harden IPC initialization and handling

On probe and reset, we should not touch the SHIM_IMRD register since
it is configured by firmware.

The driver only configures SHIM_IMRX with the BUSY interrupt enabled
by default and DONE interrupt disabled. When sending an IPC message,
the DONE interrupt is enabled until the DSP response is provided.

This sequence hardens the IPC communication and avoid
interrupt-related issues when adding/removing modules or during system
suspend-resume transitions.

Signed-off-by: Keyon Jie <yang.jie@linux.intel.com>
Signed-off-by: Pierre-Louis Bossart <pierre-louis.bossart@linux.intel.com>
Tested-by: Enric Balletbo i Serra <enric.balletbo@collabora.com>
Reviewed-by: Ranjani Sridharan <ranjani.sridharan@linux.intel.com>
Link: https://lore.kernel.org/r/20200526203640.25980-9-pierre-louis.bossart@linux.intel.com
Signed-off-by: Mark Brown <broonie@kernel.org>
4 years agoASoC: SOF: Intel: BYT: mask BUSY or DONE interrupts in handler
Pierre-Louis Bossart [Tue, 26 May 2020 20:36:39 +0000 (15:36 -0500)]
ASoC: SOF: Intel: BYT: mask BUSY or DONE interrupts in handler

The DSP may send the same interrupt multiple times before it's handled
in the interrupt thread. Rather than masking it in the thread, mask it
in the handler directly.

This patch also removes useless checks that cannot happen, and masks
that are set don't need to be re-tested.

Suggested-by: Keyon Jie <yang.jie@linux.intel.com>
Signed-off-by: Pierre-Louis Bossart <pierre-louis.bossart@linux.intel.com>
Tested-by: Enric Balletbo i Serra <enric.balletbo@collabora.com>
Reviewed-by: Ranjani Sridharan <ranjani.sridharan@linux.intel.com>
BugLink: https://github.com/thesofproject/linux/issues/1492
Link: https://lore.kernel.org/r/20200526203640.25980-8-pierre-louis.bossart@linux.intel.com
Signed-off-by: Mark Brown <broonie@kernel.org>
4 years agoASoC: SOF: Intel: BYT: add .remove op
Ranjani Sridharan [Tue, 26 May 2020 20:36:38 +0000 (15:36 -0500)]
ASoC: SOF: Intel: BYT: add .remove op

Add .remove op that disables interrupts and reset the DSP
for BYT and CHT platforms.

Signed-off-by: Ranjani Sridharan <ranjani.sridharan@linux.intel.com>
Signed-off-by: Pierre-Louis Bossart <pierre-louis.bossart@linux.intel.com>
Tested-by: Enric Balletbo i Serra <enric.balletbo@collabora.com>
Link: https://lore.kernel.org/r/20200526203640.25980-7-pierre-louis.bossart@linux.intel.com
Signed-off-by: Mark Brown <broonie@kernel.org>
4 years agoASoC: SOF: ipc: ignore DSP replies received when they are not expected
Ranjani Sridharan [Tue, 26 May 2020 20:36:37 +0000 (15:36 -0500)]
ASoC: SOF: ipc: ignore DSP replies received when they are not expected

We currently ignore the reply messages from the DSP
when they are not expected but call it out as an error.
Change the error message to a debug message.

Signed-off-by: Ranjani Sridharan <ranjani.sridharan@linux.intel.com>
Signed-off-by: Pierre-Louis Bossart <pierre-louis.bossart@linux.intel.com>
Tested-by: Enric Balletbo i Serra <enric.balletbo@collabora.com>
Link: https://lore.kernel.org/r/20200526203640.25980-6-pierre-louis.bossart@linux.intel.com
Signed-off-by: Mark Brown <broonie@kernel.org>
4 years agoASoC: Intel: byt/cht: add .pm_ops
Pierre-Louis Bossart [Tue, 26 May 2020 20:36:36 +0000 (15:36 -0500)]
ASoC: Intel: byt/cht: add .pm_ops

Add required .pm_ops to support suspend/resume on baytrail/cherrytrail
machines.

This .pm_ops is conditionally-added to avoid impacting the legacy
driver where power management is handled differently.

Signed-off-by: Pierre-Louis Bossart <pierre-louis.bossart@linux.intel.com>
Tested-by: Enric Balletbo i Serra <enric.balletbo@collabora.com>
Reviewed-by: Ranjani Sridharan <ranjani.sridharan@linux.intel.com>
Link: https://lore.kernel.org/r/20200526203640.25980-5-pierre-louis.bossart@linux.intel.com
Signed-off-by: Mark Brown <broonie@kernel.org>
4 years agoASoC: Intel: bytcr_rt5640/51: remove .ignore_suspend
Pierre-Louis Bossart [Tue, 26 May 2020 20:36:35 +0000 (15:36 -0500)]
ASoC: Intel: bytcr_rt5640/51: remove .ignore_suspend

Low-power playback was never enabled on Baytrail devices, remove what
looks like copy/paste from other machine drivers which were never
submitted upstream.

Signed-off-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/20200526203640.25980-4-pierre-louis.bossart@linux.intel.com
Signed-off-by: Mark Brown <broonie@kernel.org>
4 years agoASoC: SOF: pm: handle resume on legacy Intel platforms
Ranjani Sridharan [Tue, 26 May 2020 20:36:34 +0000 (15:36 -0500)]
ASoC: SOF: pm: handle resume on legacy Intel platforms

Add new case when set_power_state() is not supported, e.g. for Intel
Baytrail/Cherrytrail legacy platforms.

Signed-off-by: Ranjani Sridharan <ranjani.sridharan@linux.intel.com>
Signed-off-by: Pierre-Louis Bossart <pierre-louis.bossart@linux.intel.com>
Tested-by: Enric Balletbo i Serra <enric.balletbo@collabora.com>
Link: https://lore.kernel.org/r/20200526203640.25980-3-pierre-louis.bossart@linux.intel.com
Signed-off-by: Mark Brown <broonie@kernel.org>
4 years agoASoC: SOF: Intel: byt: Add PM callbacks
Ranjani Sridharan [Tue, 26 May 2020 20:36:33 +0000 (15:36 -0500)]
ASoC: SOF: Intel: byt: Add PM callbacks

Add the PM callbacks for BYT/CHT platforms.

Signed-off-by: Ranjani Sridharan <ranjani.sridharan@linux.intel.com>
Signed-off-by: Pierre-Louis Bossart <pierre-louis.bossart@linux.intel.com>
Tested-by: Enric Balletbo i Serra <enric.balletbo@collabora.com>
Link: https://lore.kernel.org/r/20200526203640.25980-2-pierre-louis.bossart@linux.intel.com
Signed-off-by: Mark Brown <broonie@kernel.org>
4 years agoASoC: tas2552: Fix runtime PM imbalance in tas2552_component_probe
Dinghao Liu [Mon, 25 May 2020 07:17:30 +0000 (15:17 +0800)]
ASoC: tas2552: Fix runtime PM imbalance in tas2552_component_probe

pm_runtime_get_sync() increments the runtime PM usage counter even
when it returns an error code. Thus a pairing decrement is needed on
the error handling path to keep the counter balanced.

Signed-off-by: Dinghao Liu <dinghao.liu@zju.edu.cn>
Link: https://lore.kernel.org/r/20200525071732.5887-1-dinghao.liu@zju.edu.cn
Signed-off-by: Mark Brown <broonie@kernel.org>
4 years agoASoC: fix incomplete error-handling in img_i2s_in_probe.
Qiushi Wu [Mon, 25 May 2020 05:50:11 +0000 (00:50 -0500)]
ASoC: fix incomplete error-handling in img_i2s_in_probe.

Function "pm_runtime_get_sync()" is not handled by "pm_runtime_put()"
if "PTR_ERR(rst) == -EPROBE_DEFER". Fix this issue by adding
"pm_runtime_put()" into this error path.

Fixes: f65bb92ca12e ("ASoC: img-i2s-in: Add runtime PM")
Signed-off-by: Qiushi Wu <wu000273@umn.edu>
Link: https://lore.kernel.org/r/20200525055011.31925-1-wu000273@umn.edu
Signed-off-by: Mark Brown <broonie@kernel.org>
4 years agoASoC: ti: Fix runtime PM imbalance in omap2_mcbsp_set_clks_src
Dinghao Liu [Mon, 25 May 2020 08:58:48 +0000 (16:58 +0800)]
ASoC: ti: Fix runtime PM imbalance in omap2_mcbsp_set_clks_src

When clk_set_parent() returns an error code, a pairing
runtime PM usage counter increment is needed to keep the
counter balanced.

Signed-off-by: Dinghao Liu <dinghao.liu@zju.edu.cn>
Acked-by: Peter Ujfalusi <peter.ujfalusi@ti.com>
Link: https://lore.kernel.org/r/20200525085848.4227-1-dinghao.liu@zju.edu.cn
Signed-off-by: Mark Brown <broonie@kernel.org>
4 years agoASoC: fix semicolon.cocci warnings
kbuild test robot [Mon, 25 May 2020 18:43:51 +0000 (02:43 +0800)]
ASoC: fix semicolon.cocci warnings

sound/soc/codecs/zl38060.c:298:2-3: Unneeded semicolon

 Remove unneeded semicolon.

Generated by: scripts/coccinelle/misc/semicolon.cocci

Fixes: 52e8a94baf90 ("ASoC: Add initial ZL38060 driver")
Signed-off-by: kbuild test robot <lkp@intel.com>
CC: Sven Van Asbroeck <thesven73@gmail.com>
Link: https://lore.kernel.org/r/20200525184351.GA37386@5cf39b9a5cc3
Signed-off-by: Mark Brown <broonie@kernel.org>
4 years agoMerge series "ASoC: add soc-link" from Kuninori Morimoto <kuninori.morimoto.gx@renesa...
Mark Brown [Mon, 25 May 2020 14:31:13 +0000 (15:31 +0100)]
Merge series "ASoC: add soc-link" from Kuninori Morimoto <kuninori.morimoto.gx@renesas.com>:

Hi Mark

Current ALSA SoC is handling dai_link related operation,
but it is implmemented directly without using function/macro,
and at random place.

This v4 patch-set creates new snd_soc_link_xxx() functions
which handles dai_link related operation,
and implmement these at new soc-link.c.

v3 -> v4

- add Reviewed-by from Ranjani and Pierre-Louis
- fix bisection error at [2/7]

v2 -> v3

- add missing #include <sound/soc-link.h> in soc-link.c

v1 -> v2
- #include <sound/soc-link.h> is added on each c source file
  instead of soc.h
- not have extra error message after snd_soc_link_xxx(),
  because it already indicate it via snc_link_ret()
- snd_soc_link_compr_xxx() doesn't have rtd parameter,
  because it can be created from cstream

Link: https://lore.kernel.org/r/87lflk4yk3.wl-kuninori.morimoto.gx@renesas.com
Link: https://lore.kernel.org/r/874ksa59wc.wl-kuninori.morimoto.gx@renesas.com
Link: https://lore.kernel.org/r/877dx868op.wl-kuninori.morimoto.gx@renesas.com
Kuninori Morimoto (7):
  ASoC: add soc-link.c
  ASoC: soc-link: move soc_rtd_xxx()
  ASoC: soc-link: remove unneeded parameter from snd_soc_link_xxx()
  ASoC: soc-link: add snd_soc_link_be_hw_params_fixup()
  ASoC: soc-link: add snd_soc_link_compr_startup()
  ASoC: soc-link: add snd_soc_link_compr_shutdown()
  ASoC: soc-link: add snd_soc_link_compr_set_params()

 include/sound/soc-link.h |  27 +++++++
 sound/soc/Makefile       |   2 +-
 sound/soc/soc-compress.c |  46 ++++--------
 sound/soc/soc-core.c     |  18 ++---
 sound/soc/soc-dai.c      |   9 ++-
 sound/soc/soc-link.c     | 150 +++++++++++++++++++++++++++++++++++++++
 sound/soc/soc-pcm.c      |  86 ++++------------------
 7 files changed, 219 insertions(+), 119 deletions(-)
 create mode 100644 include/sound/soc-link.h
 create mode 100644 sound/soc/soc-link.c

--
2.17.1

Thank you for your help !!

Best regards
---
Kuninori Morimoto

4 years agoMerge series "ASoC: SOF: extended manifest support for 5.8" from Kai Vehmanen <kai...
Mark Brown [Mon, 25 May 2020 14:31:12 +0000 (15:31 +0100)]
Merge series "ASoC: SOF: extended manifest support for 5.8" from Kai Vehmanen <kai.vehmanen@linux.intel.com>:

Hello,

extended firmware manifest is a method to retrieve capabilities
directly from the firmware file instead of routing the information via
the DSP and reading it back via IPC (latter mechanism still supported
but will be deprecated).

This feature was briefly merged to 5.8 with the series sent on
2020-Apr-15, but due to a regression hit with exporting uapi headers,
the patches got dropped.

Here's an update with the uapi header issue fixed, rebased to latest
'for-5.8' and a few minor fixes. This has been sitting in sof-dev for
some weeks and no further issues have been found. We also added
a check for the uapi-export case to SOF CI, so such errors would
not slip through again in the future.

Tooling support to create firmware files with an extended header
is available in SOF firmware repository (see the rimage tool) and
this part is already merged.

Karol Trzcinski (5):
  ASoC: SOF: loader: Adjust validation condition for fw_offset
  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

 include/sound/sof/ext_manifest.h |  95 +++++++++++++++++
 sound/soc/sof/intel/hda-loader.c |   2 +-
 sound/soc/sof/loader.c           | 176 ++++++++++++++++++++++++++++++-
 3 files changed, 269 insertions(+), 4 deletions(-)
 create mode 100644 include/sound/sof/ext_manifest.h

--
2.26.2

4 years agoASoC: fsl_asrc: Merge suspend/resume function to runtime_suspend/resume
Shengjiu Wang [Fri, 22 May 2020 09:57:24 +0000 (17:57 +0800)]
ASoC: fsl_asrc: Merge suspend/resume function to runtime_suspend/resume

With dedicated power domain for asrc, power can be disabled after
probe and pm runtime suspend, then the value of all registers need to
be restored in pm runtime resume. So we can merge suspend/resume function
to runtime_suspend/resume function and enable regcache only in end of
probe.

Signed-off-by: Shengjiu Wang <shengjiu.wang@nxp.com>
Acked-by: Nicolin Chen <nicoleotsuka@gmail.com>
Link: https://lore.kernel.org/r/1590141444-28668-1-git-send-email-shengjiu.wang@nxp.com
Signed-off-by: Mark Brown <broonie@kernel.org>
4 years agoASoC: fsl: imx-audmix: Fix unused assignment to variable 'ret'
Tang Bin [Wed, 13 May 2020 11:14:08 +0000 (19:14 +0800)]
ASoC: fsl: imx-audmix: Fix unused assignment to variable 'ret'

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

Signed-off-by: Zhang Shengju <zhangshengju@cmss.chinamobile.com>
Signed-off-by: Tang Bin <tangbin@cmss.chinamobile.com>
Link: https://lore.kernel.org/r/20200513111408.11452-1-tangbin@cmss.chinamobile.com
Signed-off-by: Mark Brown <broonie@kernel.org>
4 years agoASoC: fsl_asrc: Fix -Wmissing-prototypes warning
shengjiu wang [Mon, 25 May 2020 09:03:32 +0000 (17:03 +0800)]
ASoC: fsl_asrc: Fix -Wmissing-prototypes warning

COMPILER_INSTALL_PATH=$HOME/0day COMPILER=clang make.cross ARCH=x86_64

sound/soc/fsl/fsl_asrc.c:557:18: warning: no previous prototype for function 'fsl_asrc_get_dma_channel' [-Wmissing-prototypes]
struct dma_chan *fsl_asrc_get_dma_channel(struct fsl_asrc_pair *pair, bool dir)
                 ^
sound/soc/fsl/fsl_asrc.c:557:1: note: declare 'static' if the function is not intended to be used outside of this translation unit
struct dma_chan *fsl_asrc_get_dma_channel(struct fsl_asrc_pair *pair, bool dir)
^
static

Fixes: be7bd03f0201 ("ASoC: fsl_asrc: Move common definition to fsl_asrc_common")
Reported-by: kbuild test robot <lkp@intel.com>
Signed-off-by: shengjiu wang <shengjiu.wang@nxp.com>
Link: https://lore.kernel.org/r/1590397412-12966-1-git-send-email-shengjiu.wang@nxp.com
Signed-off-by: Mark Brown <broonie@kernel.org>
4 years agoASoC: max98390: Added Amplifier Driver
Steve Lee [Mon, 18 May 2020 00:50:38 +0000 (09:50 +0900)]
ASoC: max98390: Added Amplifier Driver

This is the initial amplifier driver for max98390.

Reported-by: kbuild test robot <lkp@intel.com>
Signed-off-by: Steve Lee <steves.lee@maximintegrated.com>
Link: https://lore.kernel.org/r/20200518005038.21074-1-steves.lee@maximintegrated.com
Signed-off-by: Mark Brown <broonie@kernel.org>
4 years agoASoC: SOF: ext_manifest: parse compiler version
Karol Trzcinski [Wed, 20 May 2020 16:59:11 +0000 (19:59 +0300)]
ASoC: SOF: ext_manifest: parse compiler version

The compiler version and description can be extracted from the
extended manifest content. This information known at build time
does not need to be provided in a mailbox.

Signed-off-by: Karol Trzcinski <karolx.trzcinski@linux.intel.com>
Signed-off-by: Kai Vehmanen <kai.vehmanen@linux.intel.com>
Reviewed-by: Guennadi Liakhovetski <guennadi.liakhovetski@linux.intel.com>
Reviewed-by: Ranjani Sridharan <ranjani.sridharan@linux.intel.com>
Link: https://lore.kernel.org/r/20200520165911.21696-6-kai.vehmanen@linux.intel.com
Signed-off-by: Mark Brown <broonie@kernel.org>
4 years agoASoC: SOF: ext_manifest: parse windows
Karol Trzcinski [Wed, 20 May 2020 16:59:10 +0000 (19:59 +0300)]
ASoC: SOF: ext_manifest: parse windows

The window description can be extracted from the extended manifest
content. This information known at build time does not need to be
provided in a mailbox.

Signed-off-by: Karol Trzcinski <karolx.trzcinski@linux.intel.com>
Signed-off-by: Kai Vehmanen <kai.vehmanen@linux.intel.com>
Reviewed-by: Guennadi Liakhovetski <guennadi.liakhovetski@linux.intel.com>
Reviewed-by: Ranjani Sridharan <ranjani.sridharan@linux.intel.com>
Link: https://lore.kernel.org/r/20200520165911.21696-5-kai.vehmanen@linux.intel.com
Signed-off-by: Mark Brown <broonie@kernel.org>
4 years agoASoC: SOF: ext_manifest: parse firmware version
Karol Trzcinski [Wed, 20 May 2020 16:59:09 +0000 (19:59 +0300)]
ASoC: SOF: ext_manifest: parse firmware version

The firmware version can be extracted from the extended
manifest content. This information known at build time
does not need to be provided in a mailbox.

Signed-off-by: Karol Trzcinski <karolx.trzcinski@linux.intel.com>
Signed-off-by: Kai Vehmanen <kai.vehmanen@linux.intel.com>
Reviewed-by: Guennadi Liakhovetski <guennadi.liakhovetski@linux.intel.com>
Reviewed-by: Ranjani Sridharan <ranjani.sridharan@linux.intel.com>
Link: https://lore.kernel.org/r/20200520165911.21696-4-kai.vehmanen@linux.intel.com
Signed-off-by: Mark Brown <broonie@kernel.org>
4 years agoASoC: SOF: Introduce extended manifest
Karol Trzcinski [Wed, 20 May 2020 16:59:08 +0000 (19:59 +0300)]
ASoC: SOF: Introduce extended manifest

Extended manifest is a place to store build time known firmware
metadata, for example firmware version or used compiler description.
Given information is read on host side before firmware startup.
This part of output binary is located as a first structure in binary
file.
Extended manifest should be skipped in firmware loading routine.

Signed-off-by: Karol Trzcinski <karolx.trzcinski@linux.intel.com>
Signed-off-by: Kai Vehmanen <kai.vehmanen@linux.intel.com>
Reviewed-by: Guennadi Liakhovetski <guennadi.liakhovetski@linux.intel.com>
Reviewed-by: Ranjani Sridharan <ranjani.sridharan@linux.intel.com>
Link: https://lore.kernel.org/r/20200520165911.21696-3-kai.vehmanen@linux.intel.com
Signed-off-by: Mark Brown <broonie@kernel.org>
4 years agoASoC: SOF: loader: Adjust validation condition for fw_offset
Karol Trzcinski [Wed, 20 May 2020 16:59:07 +0000 (19:59 +0300)]
ASoC: SOF: loader: Adjust validation condition for fw_offset

Condition in if statement should be same as trace message
and FW size equal to zero (after skipping offset) should
be marked as invalid.

Signed-off-by: Karol Trzcinski <karolx.trzcinski@linux.intel.com>
Signed-off-by: Kai Vehmanen <kai.vehmanen@linux.intel.com>
Reviewed-by: Guennadi Liakhovetski <guennadi.liakhovetski@linux.intel.com>
Reviewed-by: Ranjani Sridharan <ranjani.sridharan@linux.intel.com>
Link: https://lore.kernel.org/r/20200520165911.21696-2-kai.vehmanen@linux.intel.com
Signed-off-by: Mark Brown <broonie@kernel.org>
4 years agoASoC: soc-link: add snd_soc_link_compr_set_params()
Kuninori Morimoto [Mon, 25 May 2020 00:57:50 +0000 (09:57 +0900)]
ASoC: soc-link: add snd_soc_link_compr_set_params()

dai_link related function should be implemented at soc-link.c.
This patch adds snd_soc_link_compr_set_params().

Signed-off-by: Kuninori Morimoto <kuninori.morimoto.gx@renesas.com>
Reviewed-by: Ranjani Sridharan <ranjani.sridharan@linux.intel.com>
Reviewed-by: Pierre-Louis Bossart <pierre-louis.bossart@linux.intel.com>
Link: https://lore.kernel.org/r/87sgfo3k6q.wl-kuninori.morimoto.gx@renesas.com
Signed-off-by: Mark Brown <broonie@kernel.org>
4 years agoASoC: soc-link: add snd_soc_link_compr_shutdown()
Kuninori Morimoto [Mon, 25 May 2020 00:57:45 +0000 (09:57 +0900)]
ASoC: soc-link: add snd_soc_link_compr_shutdown()

dai_link related function should be implemented at soc-link.c.
This patch adds snd_soc_link_compr_shutdown().

Signed-off-by: Kuninori Morimoto <kuninori.morimoto.gx@renesas.com>
Reviewed-by: Ranjani Sridharan <ranjani.sridharan@linux.intel.com>
Reviewed-by: Pierre-Louis Bossart <pierre-louis.bossart@linux.intel.com>
Link: https://lore.kernel.org/r/87tv043k6u.wl-kuninori.morimoto.gx@renesas.com
Signed-off-by: Mark Brown <broonie@kernel.org>
4 years agoASoC: soc-link: add snd_soc_link_compr_startup()
Kuninori Morimoto [Mon, 25 May 2020 00:57:41 +0000 (09:57 +0900)]
ASoC: soc-link: add snd_soc_link_compr_startup()

dai_link related function should be implemented at soc-link.c.
This patch adds snd_soc_link_compr_startup().

Signed-off-by: Kuninori Morimoto <kuninori.morimoto.gx@renesas.com>
Reviewed-by: Ranjani Sridharan <ranjani.sridharan@linux.intel.com>
Reviewed-by: Pierre-Louis Bossart <pierre-louis.bossart@linux.intel.com>
Link: https://lore.kernel.org/r/87v9kk3k6y.wl-kuninori.morimoto.gx@renesas.com
Signed-off-by: Mark Brown <broonie@kernel.org>
4 years agoASoC: soc-link: add snd_soc_link_be_hw_params_fixup()
Kuninori Morimoto [Mon, 25 May 2020 00:57:36 +0000 (09:57 +0900)]
ASoC: soc-link: add snd_soc_link_be_hw_params_fixup()

dai_link related function should be implemented at soc-link.c.
This patch adds snd_soc_link_be_hw_params_fixup().

Signed-off-by: Kuninori Morimoto <kuninori.morimoto.gx@renesas.com>
Reviewed-by: Ranjani Sridharan <ranjani.sridharan@linux.intel.com>
Reviewed-by: Pierre-Louis Bossart <pierre-louis.bossart@linux.intel.com>
Link: https://lore.kernel.org/r/87wo503k73.wl-kuninori.morimoto.gx@renesas.com
Signed-off-by: Mark Brown <broonie@kernel.org>
4 years agoASoC: soc-link: remove unneeded parameter from snd_soc_link_xxx()
Kuninori Morimoto [Mon, 25 May 2020 00:57:31 +0000 (09:57 +0900)]
ASoC: soc-link: remove unneeded parameter from snd_soc_link_xxx()

"rtd" can be created from "substream".
Let's cleanup snd_soc_link_xxx().

Signed-off-by: Kuninori Morimoto <kuninori.morimoto.gx@renesas.com>
Reviewed-by: Ranjani Sridharan <ranjani.sridharan@linux.intel.com>
Reviewed-by: Pierre-Louis Bossart <pierre-louis.bossart@linux.intel.com>
Link: https://lore.kernel.org/r/87y2pg3k78.wl-kuninori.morimoto.gx@renesas.com
Signed-off-by: Mark Brown <broonie@kernel.org>
4 years agoASoC: soc-link: move soc_rtd_xxx()
Kuninori Morimoto [Mon, 25 May 2020 00:57:19 +0000 (09:57 +0900)]
ASoC: soc-link: move soc_rtd_xxx()

dai_link related function should be implemented at
soc-link.c.
This patch moves soc-pcm soc_rtd_xxx()
to soc-link as snd_soc_link_xxx()

Signed-off-by: Kuninori Morimoto <kuninori.morimoto.gx@renesas.com>
Reviewed-by: Ranjani Sridharan <ranjani.sridharan@linux.intel.com>
Reviewed-by: Pierre-Louis Bossart <pierre-louis.bossart@linux.intel.com>
Link: https://lore.kernel.org/r/87zh9w3k7k.wl-kuninori.morimoto.gx@renesas.com
Signed-off-by: Mark Brown <broonie@kernel.org>
4 years agoASoC: add soc-link.c
Kuninori Morimoto [Mon, 25 May 2020 00:57:14 +0000 (09:57 +0900)]
ASoC: add soc-link.c

Current ALSA SoC has many dai_link->xxx() functions.
But, it is implemented randomly at random place.

This patch creats new soc-link.c and collect dai_link related
operation into it.

Signed-off-by: Kuninori Morimoto <kuninori.morimoto.gx@renesas.com>
Reviewed-by: Ranjani Sridharan <ranjani.sridharan@linux.intel.com>
Reviewed-by: Pierre-Louis Bossart <pierre-louis.bossart@linux.intel.com>
Link: https://lore.kernel.org/r/871rn84ys5.wl-kuninori.morimoto.gx@renesas.com
Signed-off-by: Mark Brown <broonie@kernel.org>
4 years agoASoC: max9867: keep ADCs and DACs always on
Pavel Dobias [Fri, 22 May 2020 14:29:57 +0000 (16:29 +0200)]
ASoC: max9867: keep ADCs and DACs always on

Updating power management register requires toggling the shutdown
bit otherwise it causes unexpected behavior of the codec.
However, toggling the shutdown bit results in loud speaker crackling.
Setup the power management register only at startup to avoid that.

Signed-off-by: Pavel Dobias <dobias@2n.cz>
Link: https://lore.kernel.org/r/20200522142957.18364-3-dobias@2n.cz
Signed-off-by: Mark Brown <broonie@kernel.org>
4 years agoASoC: max9867: add digital microphone controls
Pavel Dobias [Fri, 22 May 2020 14:29:56 +0000 (16:29 +0200)]
ASoC: max9867: add digital microphone controls

MAX9867 codec has a possibility of connecting digital microphones.
Add DAPM controls to be able to enable them.

Signed-off-by: Pavel Dobias <dobias@2n.cz>
Link: https://lore.kernel.org/r/20200522142957.18364-2-dobias@2n.cz
Signed-off-by: Mark Brown <broonie@kernel.org>
4 years agoASoC: pxa: remove Compulab pxa2xx boards
Robert Jarzmik [Thu, 21 May 2020 18:51:39 +0000 (20:51 +0200)]
ASoC: pxa: remove Compulab pxa2xx boards

As these boards have been removed from the pxa tree, amend accordingly
the sound subsystem.

Signed-off-by: Robert Jarzmik <robert.jarzmik@free.fr>
Acked-by: Mike Rapoport <rppt@kernel.org>
Acked-by: Arnd Bergmann <arnd@arndb.de>
Link: https://lore.kernel.org/r/20200521185140.27276-3-robert.jarzmik@free.fr
Signed-off-by: Mark Brown <broonie@kernel.org>
4 years agoASoC: max9867: add mono playback switch
Pavel Dobias [Wed, 20 May 2020 07:19:03 +0000 (09:19 +0200)]
ASoC: max9867: add mono playback switch

Add Mono Playback switch to codec controls which enables codec's
capability of mixing left and right channel at the DAC output.

Signed-off-by: Pavel Dobias <dobias@2n.cz>
Link: https://lore.kernel.org/r/20200520071904.15801-5-dobias@2n.cz
Signed-off-by: Mark Brown <broonie@kernel.org>
4 years agoASoC: max9867: add filter controls
Pavel Dobias [Wed, 20 May 2020 07:19:01 +0000 (09:19 +0200)]
ASoC: max9867: add filter controls

Adding missing codec controls - ADC/DAC IIR filter selection.

Signed-off-by: Pavel Dobias <dobias@2n.cz>
Link: https://lore.kernel.org/r/20200520071904.15801-3-dobias@2n.cz
Signed-off-by: Mark Brown <broonie@kernel.org>
4 years agoASoC: max9867: don't use regmap defaults
Pavel Dobias [Wed, 20 May 2020 07:19:00 +0000 (09:19 +0200)]
ASoC: max9867: don't use regmap defaults

MAX9867 codec doesn't have reset pin, so the registers don't
have default values in the case of reboot without powering off.
Remove the reg_defaults struct and let the regmap read initial
state of the registers at startup instead of taking them from
reg_defaults struct.

Signed-off-by: Pavel Dobias <dobias@2n.cz>
Link: https://lore.kernel.org/r/20200520071904.15801-2-dobias@2n.cz
Signed-off-by: Mark Brown <broonie@kernel.org>
4 years agoASoC: mmp-sspa: Fix the error handling in probe()
Lubomir Rintel [Wed, 20 May 2020 08:35:16 +0000 (10:35 +0200)]
ASoC: mmp-sspa: Fix the error handling in probe()

If we fail after pm_runtime_enable(), we fail to undo it. Same with
clk_prepare_enable(). Let's order them after all things that can fail.

Fixes: 7d98cc648253 ("ASoC: mmp-sspa: Add support for the runtime power management")
Signed-off-by: Lubomir Rintel <lkundrak@v3.sk>
Link: https://lore.kernel.org/r/20200520083516.2120802-1-lkundrak@v3.sk
Signed-off-by: Mark Brown <broonie@kernel.org>
4 years agoASoC: Add Marvell MMP SSPA binding
Lubomir Rintel [Mon, 11 May 2020 21:01:33 +0000 (23:01 +0200)]
ASoC: Add Marvell MMP SSPA binding

Add binding documentation for the audio serial port interface (I2S) on
Marvell MMP SoCs.

Signed-off-by: Lubomir Rintel <lkundrak@v3.sk>
Reviewed-by: Rob Herring <robh@kernel.org>
Link: https://lore.kernel.org/r/20200511210134.1224532-11-lkundrak@v3.sk
Signed-off-by: Mark Brown <broonie@kernel.org>
4 years agoASoC: mmp-sspa: Add Device Tree support
Lubomir Rintel [Mon, 11 May 2020 21:01:34 +0000 (23:01 +0200)]
ASoC: mmp-sspa: Add Device Tree support

This makes it possible to select CONFIG_SND_MMP_SOC_SSPA directly, as
opposed to via CONFIG_SND_MMP_SOC, and for the driver to bind to a device
tree node. That makes the driver useful on Device Tree based systems,
with audio-graph-card or simple-card.

The aforementioned card drivers control the master clock themselves and
don't call the set_dai_sysclk() or set_dai_pll(), thus the respective
handlers don't serve any purpose anymore. Instead, they return early and
the hw_params() handler sets the appropriate bitclk itself.

The register range is split into two -- for the RX block and for the TX
block. On a MMP2 there are two pairs of them; the first one has the
clock controller in the middle, while the second just has a hole:

  0xd42a0c00 - 0xd42a0c30 RX1
  0xd42a0c30 - 0xd42a0c40 Clocks
  0xd42a0c80 - 0xd42a0cb0 TX1
  0xd42a0d00 - 0xd42a0d30 RX2
  0xd42a0d80 - 0xd42a0cb0 TX2

For this reason, mmp_sspa_write_reg() and mmp_sspa_read_reg() are
replaced with direct calls to I/O routines.

Tested on a MMP2-based OLPC XO-1.75 laptop with rt5631 coded, mmp_tdma DMA
engine and MMP2 clock controller glued together with audio-graph-card.

Signed-off-by: Lubomir Rintel <lkundrak@v3.sk>
Link: https://lore.kernel.org/r/20200511210134.1224532-12-lkundrak@v3.sk
Signed-off-by: Mark Brown <broonie@kernel.org>
4 years agoASoC: amd: return error when acp de-init fails
Vijendar Mukunda [Tue, 19 May 2020 14:34:22 +0000 (22:34 +0800)]
ASoC: amd: return error when acp de-init fails

Return error when acp de-init fails during suspend.

Signed-off-by: Vijendar Mukunda <Vijendar.Mukunda@amd.com>
Link: https://lore.kernel.org/r/20200519143422.18255-3-Vijendar.Mukunda@amd.com
Signed-off-by: Mark Brown <broonie@kernel.org>
4 years agoASoC: amd: refactoring dai_hw_params() callback
Vijendar Mukunda [Tue, 19 May 2020 14:34:21 +0000 (22:34 +0800)]
ASoC: amd: refactoring dai_hw_params() callback

Removed api config_pdm_stream_params().
Modified switch case for channel check.
Default case should return -EINVAL.

Signed-off-by: Vijendar Mukunda <Vijendar.Mukunda@amd.com>
Link: https://lore.kernel.org/r/20200519143422.18255-2-Vijendar.Mukunda@amd.com
Signed-off-by: Mark Brown <broonie@kernel.org>
4 years agoASoC: amd: fix kernel warning
Vijendar Mukunda [Tue, 19 May 2020 14:34:20 +0000 (22:34 +0800)]
ASoC: amd: fix kernel warning

Removed unused variable from code to fix the kernel warning.

Reported-by: kbuild test robot <lkp@intel.com>
Signed-off-by: Vijendar Mukunda <Vijendar.Mukunda@amd.com>
Link: https://lore.kernel.org/r/20200519143422.18255-1-Vijendar.Mukunda@amd.com
Signed-off-by: Mark Brown <broonie@kernel.org>
4 years agoMerge series "Add Renoir ACP driver" from Vijendar Mukunda <Vijendar.Mukunda@amd...
Mark Brown [Tue, 19 May 2020 13:18:53 +0000 (14:18 +0100)]
Merge series "Add Renoir ACP driver" from Vijendar Mukunda <Vijendar.Mukunda@amd.com>:

This adds an ASoC driver for the ACP (Audio CoProcessor)
block on AMD Renoir APUs.

V3:
- Changed PCI driver PM runtime sequence
- Removed redundant code in Renoir machine driver

V2:
- Removed empty declaration of dai_ops
- Removed SNDRV_PCM_INFO_BATCH flag
- Defined Macros for delay and counter and corrected dma stop sequence.
- Changed PCI driver pm runtime sequence
- Removed redundant code

Vijendar Mukunda (14):
  ASoC: amd: add Renoir ACP3x IP register header
  ASoC: amd: add Renoir ACP PCI driver
  ASoC: amd: add acp init/de-init functions
  ASoC: amd: create acp3x pdm platform device
  ASoC: amd: add ACP3x PDM platform driver
  ASoC: amd: irq handler changes for ACP3x PDM dma driver
  ASoC: amd: add acp3x pdm driver dma ops
  ASoC: amd: add ACP PDM DMA driver dai ops
  ASoC: amd: add Renoir ACP PCI driver PM ops
  ASoC: amd: add ACP PDM DMA driver pm ops
  ASoC: amd: enable Renoir acp3x drivers build
  ASoC: amd: create platform devices for Renoir
  ASoC: amd: RN machine driver using dmic
  ASoC: amd: enable build for RN machine driver

 sound/soc/amd/Kconfig                      |  13 +
 sound/soc/amd/Makefile                     |   1 +
 sound/soc/amd/renoir/Makefile              |   7 +
 sound/soc/amd/renoir/acp3x-pdm-dma.c       | 530 +++++++++++++++++++++
 sound/soc/amd/renoir/acp3x-rn.c            |  77 +++
 sound/soc/amd/renoir/rn-pci-acp3x.c        | 344 +++++++++++++
 sound/soc/amd/renoir/rn_acp3x.h            |  88 ++++
 sound/soc/amd/renoir/rn_chip_offset_byte.h | 349 ++++++++++++++
 8 files changed, 1409 insertions(+)
 create mode 100644 sound/soc/amd/renoir/Makefile
 create mode 100644 sound/soc/amd/renoir/acp3x-pdm-dma.c
 create mode 100644 sound/soc/amd/renoir/acp3x-rn.c
 create mode 100644 sound/soc/amd/renoir/rn-pci-acp3x.c
 create mode 100644 sound/soc/amd/renoir/rn_acp3x.h
 create mode 100644 sound/soc/amd/renoir/rn_chip_offset_byte.h

--
2.26.2

4 years agoASoC: fsl_micfil: Do not pass irq numbers in comments
Fabio Estevam [Mon, 18 May 2020 18:54:48 +0000 (15:54 -0300)]
ASoC: fsl_micfil: Do not pass irq numbers in comments

The IRQ numbers may change depending on the SoC, so do not pass the IRQ
numbers in the comments.

Signed-off-by: Fabio Estevam <festevam@gmail.com>
Link: https://lore.kernel.org/r/20200518185448.6116-2-festevam@gmail.com
Signed-off-by: Mark Brown <broonie@kernel.org>
4 years agoASoC: fsl_micfil: Remove unneeded ifdef's
Fabio Estevam [Mon, 18 May 2020 18:54:47 +0000 (15:54 -0300)]
ASoC: fsl_micfil: Remove unneeded ifdef's

There is no need to use ifdef's around the power managament
related functions, as they are already using the __maybe_unused
notation.

Signed-off-by: Fabio Estevam <festevam@gmail.com>
Link: https://lore.kernel.org/r/20200518185448.6116-1-festevam@gmail.com
Signed-off-by: Mark Brown <broonie@kernel.org>
4 years agoASoC: fsl_asrc: Set ASR76K and ASR56K based on processing clock
Shengjiu Wang [Tue, 12 May 2020 10:22:59 +0000 (18:22 +0800)]
ASoC: fsl_asrc: Set ASR76K and ASR56K based on processing clock

The processing clock is different for platforms, so it is better
to set ASR76K and ASR56K based on processing clock, rather than
hard coding the value for them.

Signed-off-by: Shengjiu Wang <shengjiu.wang@nxp.com>
Signed-off-by: Mihai Serban <mihai.serban@nxp.com>
Link: https://lore.kernel.org/r/1589278979-31008-1-git-send-email-shengjiu.wang@nxp.com
Signed-off-by: Mark Brown <broonie@kernel.org>
4 years agoASoC: amd: enable build for RN machine driver
Vijendar Mukunda [Mon, 18 May 2020 17:17:04 +0000 (01:17 +0800)]
ASoC: amd: enable build for RN machine driver

This patch enables build for RN machine driver.

Signed-off-by: Vijendar Mukunda <Vijendar.Mukunda@amd.com>
Reviewed-by: Pierre-Louis Bossart <pierre-louis.bossart@linux.intel.com>
Link: https://lore.kernel.org/r/20200518171704.24999-15-Vijendar.Mukunda@amd.com
Signed-off-by: Mark Brown <broonie@kernel.org>
4 years agoASoC: amd: RN machine driver using dmic
Vijendar Mukunda [Mon, 18 May 2020 17:17:03 +0000 (01:17 +0800)]
ASoC: amd: RN machine driver using dmic

This patch adds Renoir Machine driver for dmic support.

Signed-off-by: Vijendar Mukunda <Vijendar.Mukunda@amd.com>
Reviewed-by: Pierre-Louis Bossart <pierre-louis.bossart@linux.intel.com>
Link: https://lore.kernel.org/r/20200518171704.24999-14-Vijendar.Mukunda@amd.com
Signed-off-by: Mark Brown <broonie@kernel.org>
4 years agoASoC: amd: create platform devices for Renoir
Vijendar Mukunda [Mon, 18 May 2020 17:17:02 +0000 (01:17 +0800)]
ASoC: amd: create platform devices for Renoir

Create platform devices for generic dmic codec driver
and machine driver.
These platform devices required for creation of sound card.

Signed-off-by: Vijendar Mukunda <Vijendar.Mukunda@amd.com>
Reviewed-by: Pierre-Louis Bossart <pierre-louis.bossart@linux.intel.com>
Link: https://lore.kernel.org/r/20200518171704.24999-13-Vijendar.Mukunda@amd.com
Signed-off-by: Mark Brown <broonie@kernel.org>
4 years agoASoC: amd: enable Renoir acp3x drivers build
Vijendar Mukunda [Mon, 18 May 2020 17:17:01 +0000 (01:17 +0800)]
ASoC: amd: enable Renoir acp3x drivers build

Renoir ACP3x drivers can be built by selecting necessary
kernel config option.
The patch enables build support of the same.

Signed-off-by: Vijendar Mukunda <Vijendar.Mukunda@amd.com>
Reviewed-by: Pierre-Louis Bossart <pierre-louis.bossart@linux.intel.com>
Link: https://lore.kernel.org/r/20200518171704.24999-12-Vijendar.Mukunda@amd.com
Signed-off-by: Mark Brown <broonie@kernel.org>
4 years agoASoC: amd: add ACP PDM DMA driver pm ops
Vijendar Mukunda [Mon, 18 May 2020 17:17:00 +0000 (01:17 +0800)]
ASoC: amd: add ACP PDM DMA driver pm ops

Add ACP PDM DMA driver pm ops.

Signed-off-by: Vijendar Mukunda <Vijendar.Mukunda@amd.com>
Reviewed-by: Pierre-Louis Bossart <pierre-louis.bossart@linux.intel.com>
Link: https://lore.kernel.org/r/20200518171704.24999-11-Vijendar.Mukunda@amd.com
Signed-off-by: Mark Brown <broonie@kernel.org>
4 years agoASoC: amd: add Renoir ACP PCI driver PM ops
Vijendar Mukunda [Mon, 18 May 2020 17:16:59 +0000 (01:16 +0800)]
ASoC: amd: add Renoir ACP PCI driver PM ops

Add Renoir ACP Pci driver pm ops.

Signed-off-by: Vijendar Mukunda <Vijendar.Mukunda@amd.com>
Reviewed-by: Pierre-Louis Bossart <pierre-louis.bossart@linux.intel.com>
Link: https://lore.kernel.org/r/20200518171704.24999-10-Vijendar.Mukunda@amd.com
Signed-off-by: Mark Brown <broonie@kernel.org>
4 years agoASoC: amd: add ACP PDM DMA driver dai ops
Vijendar Mukunda [Mon, 18 May 2020 17:16:58 +0000 (01:16 +0800)]
ASoC: amd: add ACP PDM DMA driver dai ops

This patch adds ACP3x PDM DMA driver DAI operations.

Signed-off-by: Vijendar Mukunda <Vijendar.Mukunda@amd.com>
Reviewed-by: Pierre-Louis Bossart <pierre-louis.bossart@linux.intel.com>
Link: https://lore.kernel.org/r/20200518171704.24999-9-Vijendar.Mukunda@amd.com
Signed-off-by: Mark Brown <broonie@kernel.org>
4 years agoASoC: amd: add acp3x pdm driver dma ops
Vijendar Mukunda [Mon, 18 May 2020 17:16:57 +0000 (01:16 +0800)]
ASoC: amd: add acp3x pdm driver dma ops

This patch adds PDM driver DMA operations.

Signed-off-by: Vijendar Mukunda <Vijendar.Mukunda@amd.com>
Reviewed-by: Pierre-Louis Bossart <pierre-louis.bossart@linux.intel.com>
Link: https://lore.kernel.org/r/20200518171704.24999-8-Vijendar.Mukunda@amd.com
Signed-off-by: Mark Brown <broonie@kernel.org>
4 years agoASoC: amd: irq handler changes for ACP3x PDM dma driver
Vijendar Mukunda [Mon, 18 May 2020 17:16:56 +0000 (01:16 +0800)]
ASoC: amd: irq handler changes for ACP3x PDM dma driver

Whenever audio data equal to the PDM watermark level
are consumed, interrupt is generated.
Acknowledge the interrupt.

Signed-off-by: Vijendar Mukunda <Vijendar.Mukunda@amd.com>
Reviewed-by: Pierre-Louis Bossart <pierre-louis.bossart@linux.intel.com>
Link: https://lore.kernel.org/r/20200518171704.24999-7-Vijendar.Mukunda@amd.com
Signed-off-by: Mark Brown <broonie@kernel.org>
4 years agoASoC: amd: add ACP3x PDM platform driver
Vijendar Mukunda [Mon, 18 May 2020 17:16:55 +0000 (01:16 +0800)]
ASoC: amd: add ACP3x PDM platform driver

PDM platform driver binds to the platform device created by
ACP3x PCI device. PDM driver registers ALSA DMA and CPU DAI
components with ASoC framework.

Signed-off-by: Vijendar Mukunda <Vijendar.Mukunda@amd.com>
Reviewed-by: Pierre-Louis Bossart <pierre-louis.bossart@linux.intel.com>
Link: https://lore.kernel.org/r/20200518171704.24999-6-Vijendar.Mukunda@amd.com
Signed-off-by: Mark Brown <broonie@kernel.org>
4 years agoASoC: amd: create acp3x pdm platform device
Vijendar Mukunda [Mon, 18 May 2020 17:16:54 +0000 (01:16 +0800)]
ASoC: amd: create acp3x pdm platform device

ACP 3x IP has PDM decoder as one of IP blocks.
Create a platform device for it, so that the PDM platform driver
can be bound to this device.
Pass PCI resources like MMIO, irq to this platform device.

Signed-off-by: Vijendar Mukunda <Vijendar.Mukunda@amd.com>
Reviewed-by: Pierre-Louis Bossart <pierre-louis.bossart@linux.intel.com>
Link: https://lore.kernel.org/r/20200518171704.24999-5-Vijendar.Mukunda@amd.com
Signed-off-by: Mark Brown <broonie@kernel.org>
4 years agoASoC: amd: add acp init/de-init functions
Vijendar Mukunda [Mon, 18 May 2020 17:16:53 +0000 (01:16 +0800)]
ASoC: amd: add acp init/de-init functions

Add Renoir ACP PCI driver init/deinit functions.

Signed-off-by: Vijendar Mukunda <Vijendar.Mukunda@amd.com>
Reviewed-by: Pierre-Louis Bossart <pierre-louis.bossart@linux.intel.com>
Link: https://lore.kernel.org/r/20200518171704.24999-4-Vijendar.Mukunda@amd.com
Signed-off-by: Mark Brown <broonie@kernel.org>
4 years agoASoC: amd: add Renoir ACP PCI driver
Vijendar Mukunda [Mon, 18 May 2020 17:16:52 +0000 (01:16 +0800)]
ASoC: amd: add Renoir ACP PCI driver

ACP is a PCI audio device.
This patch adds PCI driver to bind to this device and get
PCI resources.

Signed-off-by: Vijendar Mukunda <Vijendar.Mukunda@amd.com>
Reviewed-by: Pierre-Louis Bossart <pierre-louis.bossart@linux.intel.com>
Link: https://lore.kernel.org/r/20200518171704.24999-3-Vijendar.Mukunda@amd.com
Signed-off-by: Mark Brown <broonie@kernel.org>
4 years agoASoC: amd: add Renoir ACP3x IP register header
Vijendar Mukunda [Mon, 18 May 2020 17:16:51 +0000 (01:16 +0800)]
ASoC: amd: add Renoir ACP3x IP register header

Add register header for ACP3x IP in Renoir platform.

Signed-off-by: Vijendar Mukunda <Vijendar.Mukunda@amd.com>
Reviewed-by: Pierre-Louis Bossart <pierre-louis.bossart@linux.intel.com>
Link: https://lore.kernel.org/r/20200518171704.24999-2-Vijendar.Mukunda@amd.com
Signed-off-by: Mark Brown <broonie@kernel.org>
4 years agoASoC: Intel: bytcr_rt5640: Add quirk for Toshiba Encore WT8-A tablet
Hans de Goede [Mon, 18 May 2020 07:24:16 +0000 (09:24 +0200)]
ASoC: Intel: bytcr_rt5640: Add quirk for Toshiba Encore WT8-A tablet

The Toshiba Encore WT8-A tablet almost fully works with the default
settings for non-CR Bay Trail devices. The only problem is that its
jack-detect switch is not inverted (it is active high instead of
the normal active low).

Add a quirk for this model using the default settings +
BYT_RT5640_JD_NOT_INV.

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/20200518072416.5348-1-hdegoede@redhat.com
Signed-off-by: Mark Brown <broonie@kernel.org>
4 years agoMerge series "ASoC: SOF: Intel and IMX updates for 5.8" from Kai Vehmanen <kai.vehman...
Mark Brown [Mon, 18 May 2020 15:43:50 +0000 (16:43 +0100)]
Merge series "ASoC: SOF: Intel and IMX updates for 5.8" from Kai Vehmanen <kai.vehmanen@linux.intel.com>:

Hi,

here's a series of minor fixes and improvements to SOF. Add support
for smart amplifier component type. Cover more systems by relaxing
match rules for the generic Soundwire machine driver. Fix issues with
driver unload and address a few compiler warnings.

Daniel Baluta (2):
  ASoC: SOF: Do nothing when DSP PM callbacks are not set
  ASoC: SOF: define INFO_ flags in dsp_ops

Keyon Jie (1):
  ASoC: SOF: topology: add support to smart amplifier

Marcin Rajwa (2):
  ASoC: SOF: add a power_down_notify method
  ASoC: SOF: inform DSP that driver is going to be removed

Pierre-Louis Bossart (2):
  ASoC: SOF: imx: make dsp_ops static
  ASoC: SOF: imx: make imx8m_dsp_ops static

randerwang (1):
  ASoC: SOF: Intel: sdw: relax sdw machine select constraints

 include/sound/sof/topology.h |  2 ++
 sound/soc/sof/core.c         |  6 ++++++
 sound/soc/sof/imx/imx8.c     |  2 +-
 sound/soc/sof/imx/imx8m.c    |  8 +++++++-
 sound/soc/sof/intel/hda.c    | 10 +++++++++-
 sound/soc/sof/pm.c           | 19 +++++++++++++++++--
 sound/soc/sof/sof-priv.h     |  1 +
 sound/soc/sof/topology.c     |  1 +
 8 files changed, 44 insertions(+), 5 deletions(-)

--
2.26.0

4 years agoMerge series "ASoC: cleanup DAI/Component activity" from Kuninori Morimoto <kuninori...
Mark Brown [Mon, 18 May 2020 15:43:49 +0000 (16:43 +0100)]
Merge series "ASoC: cleanup DAI/Component activity" from Kuninori Morimoto <kuninori.morimoto.gx@renesas.com>:

Hi Mark

These are v3 of DAI/Component activity cleanup.

This patch-set exchanges soc-dapm.c :: snd_soc_dai_link_event_xxx()
behavior which updates dai->active but not cares other actives.
But I think original code was wrong.
So, I believe these works correctly, but maybe need some tests or deep review.

v1 -> v2
- function naming "activity" -> "active"

v2 -> v3
- macro -> inline function
- added Reviewed-by from Ranjani, Acked-by from Peter

Link: https://lore.kernel.org/r/875zd39frp.wl-kuninori.morimoto.gx@renesas.com
Link: https://lore.kernel.org/r/87blmq9alx.wl-kuninori.morimoto.gx@renesas.com
Kuninori Morimoto (21):
  ASoC: soc-pcm: replace snd_soc_runtime_activate()/deactivate() to macro
  ASoC: soc-dai: add snd_soc_dai_action()
  ASoC: soc-dapm: use snd_soc_dai_activate()/deactivate()
  ASoC: soc-dai: add snd_soc_dai_active()
  ASoC: soc-component: add snd_soc_component_active()
  ASoC: soc-dai: add snd_soc_dai_stream_active()
  ASoC: use snd_soc_xxx_active()
  ASoC: atomel: use snd_soc_xxx_active()
  ASoC: bcm: use snd_soc_xxx_active()
  ASoC: cirrus: use snd_soc_xxx_active()
  ASoC: codecs: use snd_soc_xxx_active()
  ASoC: fsl: use snd_soc_xxx_active()
  ASoC: intel: use snd_soc_xxx_active()
  ASoC: jz4740: use snd_soc_xxx_active()
  ASoC: mediatek: use snd_soc_xxx_active()
  ASoC: meson: use snd_soc_xxx_active()
  ASoC: pxa: use snd_soc_xxx_active()
  ASoC: ti: use snd_soc_xxx_active()
  ASoC: uniphier: use snd_soc_xxx_active()
  ASoC: dwc: use snd_soc_xxx_active()
  ASoC: cleanup dai / component active code

 include/sound/soc-component.h                |  6 +-
 include/sound/soc-dai.h                      | 21 +++++-
 include/sound/soc.h                          | 15 ++++-
 sound/soc/atmel/atmel_ssc_dai.c              |  4 +-
 sound/soc/bcm/bcm2835-i2s.c                  |  6 +-
 sound/soc/bcm/cygnus-ssp.c                   |  4 +-
 sound/soc/cirrus/ep93xx-i2s.c                |  4 +-
 sound/soc/codecs/adav80x.c                   |  4 +-
 sound/soc/codecs/arizona.c                   |  2 +-
 sound/soc/codecs/cs4271.c                    |  4 +-
 sound/soc/codecs/madera.c                    |  2 +-
 sound/soc/codecs/max98090.c                  |  6 +-
 sound/soc/codecs/tlv320aic23.c               |  2 +-
 sound/soc/codecs/tlv320dac33.c               |  2 +-
 sound/soc/codecs/uda1380.c                   |  2 +-
 sound/soc/codecs/wl1273.c                    |  2 +-
 sound/soc/codecs/wm8711.c                    |  2 +-
 sound/soc/codecs/wm8753.c                    |  4 +-
 sound/soc/dwc/dwc-i2s.c                      |  2 +-
 sound/soc/fsl/fsl_esai.c                     |  2 +-
 sound/soc/fsl/fsl_spdif.c                    |  4 +-
 sound/soc/intel/atom/sst-mfld-platform-pcm.c | 14 ++--
 sound/soc/jz4740/jz4740-i2s.c                |  8 +--
 sound/soc/mediatek/mt8173/mt8173-afe-pcm.c   |  8 +--
 sound/soc/meson/axg-tdm-interface.c          |  2 +-
 sound/soc/pxa/pxa-ssp.c                      |  8 +--
 sound/soc/pxa/pxa2xx-i2s.c                   |  2 +-
 sound/soc/soc-compress.c                     |  4 +-
 sound/soc/soc-core.c                         | 11 +--
 sound/soc/soc-dai.c                          | 23 +++++++
 sound/soc/soc-dapm.c                         |  8 +--
 sound/soc/soc-pcm.c                          | 70 +++++++-------------
 sound/soc/ti/davinci-mcasp.c                 |  2 +-
 sound/soc/ti/omap-dmic.c                     |  4 +-
 sound/soc/ti/omap-mcbsp.c                    |  4 +-
 sound/soc/ti/omap-mcpdm.c                    |  8 +--
 sound/soc/uniphier/aio-cpu.c                 |  4 +-
 37 files changed, 155 insertions(+), 125 deletions(-)

--
2.17.1

4 years agoMerge series "ASoC: codecs: rt*-sdw: memory leaks and simplifications" from Pierre...
Mark Brown [Mon, 18 May 2020 15:43:48 +0000 (16:43 +0100)]
Merge series "ASoC: codecs: rt*-sdw: memory leaks and simplifications" from Pierre-Louis Bossart <pierre-louis.bossart@linux.intel.com>:

While debugging unrelated memory corruption errors, I detected issues
related to the interaction with the SoundWire and ASoC cores, here are
3 small patches to fix all this.

Pierre-Louis Bossart (3):
  ASoC: codecs: rt*-sdw: don't assign slave_ops
  ASoC: codecs: rt*-sdw: fix memory leak in set_sdw_stream()
  ASoC: codecs: rt1308-sdw: remove duplicate allocation

 sound/soc/codecs/rt1308-sdw.c | 11 +++--------
 sound/soc/codecs/rt5682-sdw.c |  3 ---
 sound/soc/codecs/rt5682.c     |  3 +++
 sound/soc/codecs/rt700-sdw.c  |  3 ---
 sound/soc/codecs/rt700.c      |  3 +++
 sound/soc/codecs/rt711-sdw.c  |  3 ---
 sound/soc/codecs/rt711.c      |  3 +++
 sound/soc/codecs/rt715-sdw.c  |  3 ---
 sound/soc/codecs/rt715.c      |  3 +++
 9 files changed, 15 insertions(+), 20 deletions(-)

base-commit: d731c1a0f935dbebf4a851e072f8c7309eb2b8c5
--
2.20.1

4 years agoMerge series "ASoC: Intel: minor fixes to machine drivers" from Pierre-Louis Bossart...
Mark Brown [Mon, 18 May 2020 15:43:46 +0000 (16:43 +0100)]
Merge series "ASoC: Intel: minor fixes to machine drivers" from Pierre-Louis Bossart <pierre-louis.bossart@linux.intel.com>:

Minor button remap changes, inspired by recent Chromebook patches,
typo in component string reported by Jaroslav and driver name change
not submitted in last wm8804 contribution.

Pierre-Louis Bossart (5):
  ASoC: Intel: soc-acpi: change machine driver name for WM8804 platforms
  ASoC: Intel: sof_sdw: fix typo in components string
  ASoC: Intel: sof_sdw_rt711: remap buttons
  ASoC: Intel: sof_sdw_rt700: remap buttons
  ASoC: Intel: cht_bsw_nau8824: remap BTN_0 as KEY_PLAYPAUSE

 sound/soc/intel/boards/cht_bsw_nau8824.c          | 4 ++--
 sound/soc/intel/boards/sof_sdw.c                  | 2 +-
 sound/soc/intel/boards/sof_sdw_rt700.c            | 8 ++++----
 sound/soc/intel/boards/sof_sdw_rt711.c            | 8 ++++----
 sound/soc/intel/common/soc-acpi-intel-bxt-match.c | 2 +-
 5 files changed, 12 insertions(+), 12 deletions(-)

base-commit: d731c1a0f935dbebf4a851e072f8c7309eb2b8c5
--
2.20.1

4 years agoMerge series "ASoC: da7213: support for usage with simple-card" from Sebastian Reiche...
Mark Brown [Mon, 18 May 2020 15:43:45 +0000 (16:43 +0100)]
Merge series "ASoC: da7213: support for usage with simple-card" from Sebastian Reichel <sebastian.reichel@collabora.com>:

Hi,

This extends the da7213 driver to be used with simple-audio-card in
combination with a fixed clock. Here is a snippet of the downstream
board's DT, that is supposed to be supported by this patchset.

---------------------------------------------------------------------
/ {
sound {
compatible = "simple-audio-card";
simple-audio-card,name = "audio-card";
simple-audio-card,format = "i2s";
simple-audio-card,bitclock-master = <&dailink_master>;
simple-audio-card,frame-master = <&dailink_master>;

simple-audio-card,widgets = "Speaker", "Ext Spk";
simple-audio-card,audio-routing = "Ext Spk", "LINE";

simple-audio-card,cpu {
sound-dai = <&ssi1>;
};

dailink_master: simple-audio-card,codec {
sound-dai = <&codec>;
};
};

clk_ext_audio_codec: clock-codec {
compatible = "fixed-clock";
#clock-cells = <0>;
clock-frequency = <12288000>;
};
};

&i2c1 {
codec: audio-codec@1a {
compatible = "dlg,da7212";
reg = <0x1a>;
#sound-dai-cells = <0>;
VDDA-supply = <&reg_2v5_audio>;
VDDSP-supply = <&reg_5v0_audio>;
VDDMIC-supply = <&reg_3v3_audio>;
VDDIO-supply = <&reg_3v3_audio>;
clocks = <&clk_ext_audio_codec>;
clock-names = "mclk";
};
};
---------------------------------------------------------------------

This is mostly a resend of PATCHv2. There was quite a bit of discussion
for the last patch. As far as I can see no better solution was found and
the patch is fine as is. Sorry for the delay in sending another revision.

Changes since PATCHv2:
 * https://lore.kernel.org/alsa-devel/20191120152406.2744-1-sebastian.reichel@collabora.com/
 * dropped patch converting DA7213 into selectable Kconfig option (merged)
 * fix compatible string in patch 1 (DT binding) as pointed out by Adam Thomson
 * collected Reviewed-by from Adam Thomson for patch 2-4

Changes since PATCHv1:
 * https://lore.kernel.org/alsa-devel/20191108174843.11227-1-sebastian.reichel@collabora.com/
 * add patch adding da7212 compatible to DT bindings
 * update regulator patch, so that VDDA is enabled together with VDDIO
   while the device is enabled to avoid device reset
 * update clock patch, so that automatic PLL handling is not enabled
   when PLL is configured manually
 * update clock patch, so that automatic PLL is disabled when the device
   is suspended
 * update clock patch, so that automatic PLL is configured into bypass
   mode when possible

-- Sebastian

Sebastian Reichel (5):
  ASoC: da7213: Add da7212 DT compatible
  ASoC: da7213: Add regulator support
  ASoC: da7213: move set_sysclk to codec level
  ASoC: da7213: move set_pll to codec level
  ASoC: da7213: add default clock handling

 .../devicetree/bindings/sound/da7213.txt      |   8 +-
 sound/soc/codecs/da7213.c                     | 172 ++++++++++++++++--
 sound/soc/codecs/da7213.h                     |  11 ++
 3 files changed, 175 insertions(+), 16 deletions(-)

--
2.26.2

4 years agoASoC: fsl_micfil: Fix unused assignment in fsl_set_clock_params()
Tang Bin [Mon, 18 May 2020 11:00:40 +0000 (19:00 +0800)]
ASoC: fsl_micfil: Fix unused assignment in fsl_set_clock_params()

Delete unused initialized value of 'ret', because it will
be assigned by the function fsl_micfil_set_mclk_rate().

Signed-off-by: Tang Bin <tangbin@cmss.chinamobile.com>
Link: https://lore.kernel.org/r/20200518110040.18036-1-tangbin@cmss.chinamobile.com
Signed-off-by: Mark Brown <broonie@kernel.org>
4 years agoASoC: amd: raven: Make the driver name consistent across files
Akshu Agrawal [Mon, 18 May 2020 04:39:05 +0000 (10:09 +0530)]
ASoC: amd: raven: Make the driver name consistent across files

This fixes the issue of driver not getting auto loaded with
MODULE_ALIAS.

With this patch:
$find /sys/devices -name modalias -print0 | xargs -0 grep -i acp3x
/sys/devices/pci0000:00/0000:00:08.1/0000:03:00.5/acp3x_i2s_playcap.2/
modalias:platform:acp3x_i2s_playcap
/sys/devices/pci0000:00/0000:00:08.1/0000:03:00.5/acp3x_i2s_playcap.0/
modalias:platform:acp3x_i2s_playcap
/sys/devices/pci0000:00/0000:00:08.1/0000:03:00.5/acp3x_rv_i2s_dma.0/
modalias:platform:acp3x_rv_i2s_dma
/sys/devices/pci0000:00/0000:00:08.1/0000:03:00.5/acp3x_i2s_playcap.1/
modalias:platform:acp3x_i2s_playcap

Signed-off-by: Akshu Agrawal <akshu.agrawal@amd.com>
Link: https://lore.kernel.org/r/20200518043913.40646-1-akshu.agrawal@amd.com
Signed-off-by: Mark Brown <broonie@kernel.org>
4 years agoASoC: fsl_micfil: Fix indentation to put on one line affected code
Tang Bin [Mon, 18 May 2020 10:59:51 +0000 (18:59 +0800)]
ASoC: fsl_micfil: Fix indentation to put on one line affected code

In the function fsl_micfil_startup(), the two lines of dev_err()
can be shortened to one line.

Signed-off-by: Tang Bin <tangbin@cmss.chinamobile.com>
Link: https://lore.kernel.org/r/20200518105951.19200-1-tangbin@cmss.chinamobile.com
Signed-off-by: Mark Brown <broonie@kernel.org>