Commit graph

915759 commits

Author SHA1 Message Date
Kuninori Morimoto
73de4b0268
ASoC: soc-card: add snd_soc_card_probe()
Card related function should be implemented at soc-card now.
This patch adds it.

One note here is that card has "card->probe" and "card->late_probe"
callbacks.
Because it needs to care "late_probe", "card->probed" flag is set
under if (card->probe) at snd_soc_card_probe().

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/87wo4wzv54.wl-kuninori.morimoto.gx@renesas.com
Signed-off-by: Mark Brown <broonie@kernel.org>
2020-05-30 02:11:36 +01:00
Kuninori Morimoto
27f07cacc9
ASoC: soc-card: add probed bit field to snd_soc_card
We already have bit field to control snd_soc_card.
Let's add "probed" field on it instead of local variable.

One note here is that soc_cleanup_card_resources()
will be called as (A) formal cleanup or as (B) error handling,
thus, it needs to distinguish these.

In (A) case, card will have "instantiated" flag if all probe
callback functions were called without error.
Thus, snd_soc_unbind_card() is using it to judging card was probed.
But this this patch removes it, because it is no longer needed.

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/87r1v4zv36.wl-kuninori.morimoto.gx@renesas.com
Signed-off-by: Mark Brown <broonie@kernel.org>
2020-05-30 02:11:36 +01:00
Kuninori Morimoto
739443d1f1
ASoC: soc-card: add snd_soc_card_resume_post()
Card related function should be implemented at soc-card now.
This patch adds 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/87y2pczv5d.wl-kuninori.morimoto.gx@renesas.com
Signed-off-by: Mark Brown <broonie@kernel.org>
2020-05-30 02:11:35 +01:00
Kuninori Morimoto
934c752c38
ASoC: soc-card: add snd_soc_card_resume_pre()
Card related function should be implemented at soc-card now.
This patch adds 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/87zh9szv5k.wl-kuninori.morimoto.gx@renesas.com
Signed-off-by: Mark Brown <broonie@kernel.org>
2020-05-30 02:11:34 +01:00
Kuninori Morimoto
d17b60b2c4
ASoC: soc-card: add snd_soc_card_suspend_post()
Card related function should be implemented at soc-card now.
This patch adds 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/871rn425j3.wl-kuninori.morimoto.gx@renesas.com
Signed-off-by: Mark Brown <broonie@kernel.org>
2020-05-30 02:11:33 +01:00
Kuninori Morimoto
130dc08c82
ASoC: soc-card: add snd_soc_card_suspend_pre()
Card related function should be implemented at soc-card now.
This patch adds 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/87367k25jc.wl-kuninori.morimoto.gx@renesas.com
Signed-off-by: Mark Brown <broonie@kernel.org>
2020-05-30 02:11:32 +01:00
Kuninori Morimoto
bf5bb8db5b
ASoC: soc-card: move snd_soc_card_subclass to soc-card
Card related function should be implemented at soc-card now.
This patch moves 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/874ks025jn.wl-kuninori.morimoto.gx@renesas.com
Signed-off-by: Mark Brown <broonie@kernel.org>
2020-05-30 02:11:31 +01:00
Kuninori Morimoto
65a75718d6
ASoC: soc-card: move snd_soc_card_get_codec_dai() to soc-card
Card related function should be implemented at soc-card now.
This patch moves 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/875zcg25jv.wl-kuninori.morimoto.gx@renesas.com
Signed-off-by: Mark Brown <broonie@kernel.org>
2020-05-30 02:11:30 +01:00
Kuninori Morimoto
63efed582c
ASoC: soc-card: move snd_soc_card_set/get_drvdata() to soc-card
Card related function should be implemented at soc-card now.
This patch moves 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/877dww25k4.wl-kuninori.morimoto.gx@renesas.com
Signed-off-by: Mark Brown <broonie@kernel.org>
2020-05-30 02:11:29 +01:00
Kuninori Morimoto
3359e9b6fa
ASoC: soc-card: move snd_soc_card_jack_new() to soc-card
Card related function should be implemented at soc-card now.
This patch moves 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/878shc25kc.wl-kuninori.morimoto.gx@renesas.com
Signed-off-by: Mark Brown <broonie@kernel.org>
2020-05-30 02:11:28 +01:00
Kuninori Morimoto
209c6cdfd2
ASoC: soc-card: move snd_soc_card_get_kcontrol() to soc-card
Card related function should be implemented at soc-card now.
This patch moves 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/87a71s25kj.wl-kuninori.morimoto.gx@renesas.com
Signed-off-by: Mark Brown <broonie@kernel.org>
2020-05-30 02:11:27 +01:00
Kuninori Morimoto
1793936bc9
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>
2020-05-30 02:11:27 +01:00
Kuninori Morimoto
317ec67593
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>
2020-05-30 02:11:26 +01:00
Mark Brown
6e28a0c3e0
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: 89d73ccab2
--
2.20.1
2020-05-29 21:43:38 +01:00
Lad Prabhakar
b6f10d3f2e
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>
2020-05-29 21:43:37 +01:00
Libin Yang
1e7cb64b0a
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>
2020-05-29 21:23:51 +01:00
Libin Yang
38acab2d61
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>
2020-05-29 21:23:50 +01:00
Libin Yang
8f529f0175
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>
2020-05-29 21:23:50 +01:00
Kai Vehmanen
89d73ccab2
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>
2020-05-29 18:18:02 +01:00
Pierre-Louis Bossart
af89e7dac5
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: ddcccd543f ("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>
2020-05-29 16:55:31 +01:00
朱灿灿
68f8043ed1
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>
2020-05-29 16:55:30 +01:00
Pierre-Louis Bossart
28ff437a44
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>
2020-05-29 14:21:45 +01:00
Mark Brown
67866ff9b7
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
2020-05-29 13:30:08 +01:00
Xiyu Yang
36124fb19f
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>
2020-05-29 13:30:07 +01:00
derek.fang
2aec8ccc1a
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>
2020-05-29 13:30:06 +01:00
Dan Murphy
c8b47d63ad
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>
2020-05-29 13:30:05 +01:00
Dinghao Liu
65bd91dd69
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>
2020-05-29 13:30:04 +01:00
Keyon Jie
c2cbd0a719
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>
2020-05-29 13:06:41 +01:00
Keyon Jie
82ed741873
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>
2020-05-29 13:06:41 +01:00
Ravulapati Vishnu vardhan rao
4a04345021
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>
2020-05-28 13:20:20 +01:00
Chuhong Yuan
8dc1011470
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>
2020-05-28 13:20:20 +01:00
Arnd Bergmann
a50067d4f3
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: 6b8e4e7db3 ("ASoC: amd: Add machine driver for Raven based platform")
Fixes: fd443a20c2 ("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>
2020-05-28 13:20:19 +01:00
Seven Lee
2b1878afc8
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>
2020-05-28 13:20:18 +01:00
Paul Cercueil
e6825bae26
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>
2020-05-28 13:20:17 +01:00
Mark Brown
93e0f69a40
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: 0d71a5cf69
--
2.20.1
2020-05-27 14:48:57 +01:00
Wei Yongjun
185457632b
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>
2020-05-27 14:48:56 +01:00
Dan Murphy
850ba84b5c
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>
2020-05-27 14:48:55 +01:00
Dinghao Liu
920bef64cc
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>
2020-05-27 14:48:54 +01:00
Dinghao Liu
53865b3259
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>
2020-05-27 14:48:53 +01:00
Dan Murphy
3c35e79cea
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>
2020-05-27 14:48:52 +01:00
Dan Murphy
2465d32bea
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>
2020-05-27 14:48:51 +01:00
Dinghao Liu
9ad61b5c80
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>
2020-05-27 14:48:50 +01:00
Keyon Jie
3d2e5c4807
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>
2020-05-27 14:06:59 +01:00
Pierre-Louis Bossart
3d3d1fb9ce
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>
2020-05-27 14:06:58 +01:00
Ranjani Sridharan
c691f0c6e2
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>
2020-05-27 14:06:58 +01:00
Ranjani Sridharan
d7a1ed2689
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>
2020-05-27 14:06:57 +01:00
Pierre-Louis Bossart
68224376bc
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>
2020-05-27 14:06:56 +01:00
Pierre-Louis Bossart
512e76724f
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>
2020-05-27 14:06:55 +01:00
Ranjani Sridharan
fc907cc527
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>
2020-05-27 14:06:54 +01:00
Ranjani Sridharan
ddcccd543f
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>
2020-05-27 14:06:53 +01:00