Commit Graph

35106 Commits

Author SHA1 Message Date
Olivier Moysan
caff4ce8cc
ASoC: stm32: i2s: manage rebind issue
The commit e894efef9a ("ASoC: core: add support to card rebind")
allows to rebind the sound card after a rebind of one of its component.
With this commit, the sound card is actually rebound,
but may be no more functional.

Corrections:
- Call snd_dmaengine_pcm_register() before snd_soc_register_component().
- Call snd_dmaengine_pcm_unregister() and snd_soc_unregister_component()
explicitly from I2S driver.

Signed-off-by: Olivier Moysan <olivier.moysan@st.com>
Link: https://lore.kernel.org/r/20200318144125.9163-4-olivier.moysan@st.com
Signed-off-by: Mark Brown <broonie@kernel.org>
2020-03-18 19:55:26 +00:00
Olivier Moysan
794df9448e
ASoC: stm32: spdifrx: manage rebind issue
The commit e894efef9a ("ASoC: core: add support to card rebind")
allows to rebind the sound card after a rebind of one of its component.
With this commit, the sound card is actually rebound,
but may be no more functional.

Corrections:
- Call snd_dmaengine_pcm_register() before snd_soc_register_component().
- Call snd_dmaengine_pcm_unregister() and snd_soc_unregister_component()
explicitly from SPDFIRX driver.

Signed-off-by: Olivier Moysan <olivier.moysan@st.com>
Link: https://lore.kernel.org/r/20200318144125.9163-3-olivier.moysan@st.com
Signed-off-by: Mark Brown <broonie@kernel.org>
2020-03-18 19:55:25 +00:00
Vinod Koul
4c3189380c
ASoC: qcom: q6asm-dai: add support for ALAC and APE decoders
Qualcomm DSPs also supports the ALAC and APE decoders, so add support
for these and convert the snd_codec_params to qdsp format.

Signed-off-by: Vinod Koul <vkoul@kernel.org>
Reviewed-by: Srinivas Kandagatla <srinivas.kandagatla@linaro.org>
Reviewed-by: Takashi Iwai <tiwai@suse.de>
Link: https://lore.kernel.org/r/20200316055221.1944464-9-vkoul@kernel.org
Signed-off-by: Mark Brown <broonie@kernel.org>
2020-03-16 17:52:11 +00:00
Vinod Koul
7076bf4da0
ASoC: qcom: q6asm: add support for alac and ape configs
Qualcomm DSPs expect ALAC and APE configs to be send for decoders,
so add the API to program the respective config to the DSP.

Signed-off-by: Vinod Koul <vkoul@kernel.org>
Reviewed-by: Srinivas Kandagatla <srinivas.kandagatla@linaro.org>
Reviewed-by: Takashi Iwai <tiwai@suse.de>
Link: https://lore.kernel.org/r/20200316055221.1944464-8-vkoul@kernel.org
Signed-off-by: Mark Brown <broonie@kernel.org>
2020-03-16 17:52:10 +00:00
Vinod Koul
40519a1c02
ASoC: qcom: q6asm-dai: add support to wma decoder
Qualcomm DSPs also supports the wma decoder, so add support for wma
decoder and convert the snd_codec_params to qdsp format.

Signed-off-by: Vinod Koul <vkoul@kernel.org>
Reviewed-by: Srinivas Kandagatla <srinivas.kandagatla@linaro.org>
Reviewed-by: Takashi Iwai <tiwai@suse.de>
Link: https://lore.kernel.org/r/20200316055221.1944464-6-vkoul@kernel.org
Signed-off-by: Mark Brown <broonie@kernel.org>
2020-03-16 17:52:08 +00:00
Vinod Koul
97163eadf1
ASoC: qcom: q6asm: add support to wma config
Qualcomm DSPs expect wma v9 and wma v10 configs to be set for wma
decoders, so add the API to program the respective wma config to the DSP

Signed-off-by: Vinod Koul <vkoul@kernel.org>
Reviewed-by: Srinivas Kandagatla <srinivas.kandagatla@linaro.org>
Reviewed-by: Takashi Iwai <tiwai@suse.de>
Link: https://lore.kernel.org/r/20200316055221.1944464-5-vkoul@kernel.org
Signed-off-by: Mark Brown <broonie@kernel.org>
2020-03-16 17:52:07 +00:00
Vinod Koul
8504a72f7c
ASoC: qcom: q6asm: pass codec profile to q6asm_open_write
Codec profile is required to be passed for WMA codecs so that we know
the codec profile present and tell DSP accordingly, so update this API
to pass the codec profile as argument

Signed-off-by: Vinod Koul <vkoul@kernel.org>
Reviewed-by: Srinivas Kandagatla <srinivas.kandagatla@linaro.org>
Reviewed-by: Takashi Iwai <tiwai@suse.de>
Link: https://lore.kernel.org/r/20200316055221.1944464-4-vkoul@kernel.org
Signed-off-by: Mark Brown <broonie@kernel.org>
2020-03-16 17:52:06 +00:00
Mark Brown
673f45f7bf
Merge branch 'for-5.6' of https://git.kernel.org/pub/scm/linux/kernel/git/broonie/sound into asoc-5.7 2020-03-13 18:52:23 +00:00
Yong Zhi
1a0f2433d7
ASoC: max98357a: Add ACPI HID MAX98360A
Maxim MAX98360A audio amplifier is functionally identical to MAX98357A,
add ACPI ID "MAX98360A" for driver reuse.

Signed-off-by: Yong Zhi <yong.zhi@intel.com>
Link: https://lore.kernel.org/r/1584114926-29287-1-git-send-email-yong.zhi@intel.com
Signed-off-by: Mark Brown <broonie@kernel.org>
2020-03-13 18:48:12 +00:00
Mark Brown
bd2b34e485
Merge series "ASoC: SOF: multi-cpu dais, IPC and Intel improvements for 5.7" from Pierre-Louis Bossart <pierre-louis.bossart@linux.intel.com>:
Corrections for compatibility with the multi-cpu dai check for
min-channels, IPC simplifications, and removal of unnecessary
boot-related code for Intel platforms.

Amery Song (2):
  ASoC: SOF: Intel: hda: remove unnecessary ROM IPC filter function
  ASoC: SOF: Intel: remove unnecessary waitq before loading firmware

Bard Liao (2):
  ASoC: SOF: Intel: hda-dai: add stream capability
  ASoC: SOF: topology: connect dai widget to all cpu-dais

Karol Trzcinski (2):
  ASoC: SOF: Make sof_ipc_ext_data enum more rigid
  ASoC: SOF: Remove SOF_IPC_EXT_DMA_BUFFER

 include/sound/sof/info.h         | 22 +-------
 sound/soc/sof/intel/cnl.c        |  5 --
 sound/soc/sof/intel/hda-dai.c    | 96 ++++++++++++++++++++++++++++++++
 sound/soc/sof/intel/hda-ipc.c    | 20 +------
 sound/soc/sof/intel/hda-loader.c |  3 -
 sound/soc/sof/intel/hda.c        |  3 -
 sound/soc/sof/intel/hda.h        |  1 -
 sound/soc/sof/loader.c           |  6 --
 sound/soc/sof/sof-priv.h         |  5 --
 sound/soc/sof/topology.c         |  8 ++-
 10 files changed, 108 insertions(+), 61 deletions(-)

base-commit: 101247a3b8
--
2.20.1
2020-03-13 16:17:01 +00:00
Mark Brown
ccab2c7dfe
Merge series "ASoC: Intel: machine driver updates for 5.7" from Pierre-Louis Bossart <pierre-louis.bossart@linux.intel.com>:
Fix HDaudio/HDMI Kconfig dependencies, cleanup code, and add support
for 2 new configs (DA7219+Maxim 98360A and RT5692+RT1015)

Note that the last patch is the first case where we added the
Reviewed-by tags automagically from the list of GitHub
approvers. Feedback/comments welcome on the format, and thanks to
Ranjani for the nice script!

Changes since v1:
Change base to broonie/for-5.7
Rebase and fix for_each_codec_dais() macro in Patch 9.
Add new patch to remove GFP_ATOMIC

Guennadi Liakhovetski (3):
  ASoC: codecs: hdac_hdmi: (cosmetic) remove redundant variable
    initialisations
  ASoC: Intel: skylake: (cosmetic) remove redundant variable
    initialisations
  ASoC: Intel: (cosmetic) simplify structure member access

Kai Vehmanen (4):
  ASoC: Intel: boards: drop reverse deps for SND_HDA_CODEC_HDMI
  ASoC: Intel: sof_pcm512x: drop reverse deps for SND_HDA_CODEC_HDMI
  ASoC: Intel: sof_pcm512x: make HDMI optional for all platforms
  ASoC: SOF: Intel: hda: remove SND_SOC_SOF_HDA_COMMON_HDMI_CODEC

Pierre-Louis Bossart (1):
  ASoC: Intel: don't use GFP_ATOMIC for machine driver contexts

Yong Zhi (2):
  ASoC: Intel: sof_da7219_max98373: Add support for max98360a speaker
    amp
  ASoC: Intel: sof_rt5682: Add rt1015 speaker amp support

 sound/soc/codecs/hdac_hdmi.c                  |   6 +-
 sound/soc/intel/boards/Kconfig                |  20 ++--
 sound/soc/intel/boards/bdw-rt5650.c           |   2 +-
 sound/soc/intel/boards/bdw-rt5677.c           |   2 +-
 sound/soc/intel/boards/broadwell.c            |   2 +-
 sound/soc/intel/boards/bxt_da7219_max98357a.c |   2 +-
 sound/soc/intel/boards/bxt_rt298.c            |   2 +-
 sound/soc/intel/boards/bytcht_da7213.c        |   2 +-
 sound/soc/intel/boards/cht_bsw_max98090_ti.c  |   2 +-
 sound/soc/intel/boards/cht_bsw_nau8824.c      |   2 +-
 sound/soc/intel/boards/cht_bsw_rt5645.c       |   2 +-
 sound/soc/intel/boards/cml_rt1011_rt5682.c    |   4 +-
 sound/soc/intel/boards/glk_rt5682_max98357a.c |   2 +-
 sound/soc/intel/boards/haswell.c              |   2 +-
 sound/soc/intel/boards/kbl_rt5663_max98927.c  |   2 +-
 .../intel/boards/kbl_rt5663_rt5514_max98927.c |   2 +-
 sound/soc/intel/boards/skl_hda_dsp_generic.c  |   2 +-
 .../soc/intel/boards/skl_nau88l25_max98357a.c |   2 +-
 sound/soc/intel/boards/skl_nau88l25_ssm4567.c |   2 +-
 sound/soc/intel/boards/sof_da7219_max98373.c  |  78 +++++++++++--
 sound/soc/intel/boards/sof_pcm512x.c          |  38 ++++--
 sound/soc/intel/boards/sof_rt5682.c           | 110 +++++++++++++++++-
 .../intel/common/soc-acpi-intel-jsl-match.c   |  34 +++++-
 sound/soc/intel/skylake/skl.c                 |   4 +-
 sound/soc/sof/intel/Kconfig                   |  11 --
 sound/soc/sof/intel/hda.c                     |   3 +-
 26 files changed, 269 insertions(+), 71 deletions(-)

base-commit: 101247a3b8
--
2.20.1
2020-03-13 16:17:00 +00:00
Mark Brown
a9bb153d3f
Merge series "ASoC: brcm: add dsl and pon chip audio driver" from Kevin Li <kevin-ke.li@broadcom.com>:
Changes in v2:
 * Make the comment a C++ one for license header
 * Remove all empty functions
 * Change all variable to use kernel coding style
 * Comment chip TX RX block independently generate I2S bus signals

Kevin Li (2):
  ASoC: brcm:  Add DSL/PON SoC audio driver
  ASoC: brcm:  DSL/PON SoC device tree bindings of audio driver

 .../bindings/sound/brcm,bcm63xx-audio.txt     |  29 ++
 sound/soc/bcm/Kconfig                         |   9 +
 sound/soc/bcm/Makefile                        |   4 +
 sound/soc/bcm/bcm63xx-i2s-whistler.c          | 317 ++++++++++++
 sound/soc/bcm/bcm63xx-i2s.h                   |  90 ++++
 sound/soc/bcm/bcm63xx-pcm-whistler.c          | 485 ++++++++++++++++++
 6 files changed, 934 insertions(+)
 create mode 100644 Documentation/devicetree/bindings/sound/brcm,bcm63xx-audio.txt
 create mode 100644 sound/soc/bcm/bcm63xx-i2s-whistler.c
 create mode 100644 sound/soc/bcm/bcm63xx-i2s.h
 create mode 100644 sound/soc/bcm/bcm63xx-pcm-whistler.c

--
2.25.1
2020-03-13 16:16:59 +00:00
Oder Chiou
a252d78cf7
ASoC: rt5682: Fine tune the HP performance in soundwire mode
The setting is sync with I2C/I2S mode.

Signed-off-by: Oder Chiou <oder_chiou@realtek.com>
Link: https://lore.kernel.org/r/20200313023850.28875-1-oder_chiou@realtek.com
Signed-off-by: Mark Brown <broonie@kernel.org>
2020-03-13 16:16:58 +00:00
Kevin Li
88eb404ccc
ASoC: brcm: Add DSL/PON SoC audio driver
This patch adds Broadcom DSL/PON SoC audio driver
with Whistler I2S block. The SoC supported by this
patch are BCM63158B0,BCM63178 and BCM47622/6755

Signed-off-by: Kevin Li <kevin-ke.li@broadcom.com>
Link: https://lore.kernel.org/r/20200312223242.2843-2-kevin-ke.li@broadcom.com
Signed-off-by: Mark Brown <broonie@kernel.org>
2020-03-13 16:01:35 +00:00
Pierre-Louis Bossart
2e6529a51a
ASoC: Intel: don't use GFP_ATOMIC for machine driver contexts
We've removed GFP_ATOMIC in all machine drivers and somehow this keeps
coming back due to copy-paste. Move to GFP_KERNEL.

Signed-off-by: Pierre-Louis Bossart <pierre-louis.bossart@linux.intel.com>
Reviewed-by: Ranjani Sridharan <ranjani.sridharan@linux.intel.com>
Reviewed-by: Guennadi Liakhovetski <guennadi.liakhovetski@linux.intel.com>
Reviewed-by: Kai Vehmanen <kai.vehmanen@linux.intel.com>
Link: https://lore.kernel.org/r/20200312194859.4051-11-pierre-louis.bossart@linux.intel.com
Signed-off-by: Mark Brown <broonie@kernel.org>
2020-03-13 15:44:57 +00:00
Yong Zhi
a79ae0f6c9
ASoC: Intel: sof_rt5682: Add rt1015 speaker amp support
This patch adds jsl_rt5682_rt1015 which supports the
RT5682 headset codec and RT1015 speaker amplifier combination
on JasperLake platform.

Signed-off-by: Yong Zhi <yong.zhi@intel.com>
Signed-off-by: Ranjani Sridharan <ranjani.sridharan@linux.intel.com>
Signed-off-by: Pierre-Louis Bossart <pierre-louis.bossart@linux.intel.com>
Link: https://lore.kernel.org/r/20200312194859.4051-10-pierre-louis.bossart@linux.intel.com
Signed-off-by: Mark Brown <broonie@kernel.org>
2020-03-13 15:44:56 +00:00
Yong Zhi
3f32e596b0
ASoC: Intel: sof_da7219_max98373: Add support for max98360a speaker amp
Add Maxim MAX98360A plug-and-play Class-D amplifier support on SSP1,
new card ID is sofda7219max98360a, name sof-da7219max98360a.

Signed-off-by: Yong Zhi <yong.zhi@intel.com>
Signed-off-by: Pierre-Louis Bossart <pierre-louis.bossart@linux.intel.com>
Link: https://lore.kernel.org/r/20200312194859.4051-9-pierre-louis.bossart@linux.intel.com
Signed-off-by: Mark Brown <broonie@kernel.org>
2020-03-13 15:44:55 +00:00
Guennadi Liakhovetski
42432196cf
ASoC: Intel: (cosmetic) simplify structure member access
Fix a clumsy structure member dereference in all machine drivers.

Signed-off-by: Guennadi Liakhovetski <guennadi.liakhovetski@linux.intel.com>
Signed-off-by: Pierre-Louis Bossart <pierre-louis.bossart@linux.intel.com>
Link: https://lore.kernel.org/r/20200312194859.4051-8-pierre-louis.bossart@linux.intel.com
Signed-off-by: Mark Brown <broonie@kernel.org>
2020-03-13 15:44:54 +00:00
Guennadi Liakhovetski
ca841843a3
ASoC: Intel: skylake: (cosmetic) remove redundant variable initialisations
Variables, used as loop iterators, don't need to be initialised.

Signed-off-by: Guennadi Liakhovetski <guennadi.liakhovetski@linux.intel.com>
Signed-off-by: Pierre-Louis Bossart <pierre-louis.bossart@linux.intel.com>
Link: https://lore.kernel.org/r/20200312194859.4051-7-pierre-louis.bossart@linux.intel.com
Signed-off-by: Mark Brown <broonie@kernel.org>
2020-03-13 15:44:54 +00:00
Guennadi Liakhovetski
c4aafb337d
ASoC: codecs: hdac_hdmi: (cosmetic) remove redundant variable initialisations
Remove several redundant variable initialisations.

Signed-off-by: Guennadi Liakhovetski <guennadi.liakhovetski@linux.intel.com>
Signed-off-by: Pierre-Louis Bossart <pierre-louis.bossart@linux.intel.com>
Link: https://lore.kernel.org/r/20200312194859.4051-6-pierre-louis.bossart@linux.intel.com
Signed-off-by: Mark Brown <broonie@kernel.org>
2020-03-13 15:44:53 +00:00
Kai Vehmanen
42c67753ca
ASoC: SOF: Intel: hda: remove SND_SOC_SOF_HDA_COMMON_HDMI_CODEC
To help user-space with HDMI codec driver transition, both
a kernel module parameter and a kernel option were initially
provided to configure default behaviour of SOF on Intel hardware
with commit 139c7febad ("ASoC: SOF: Intel: add support for
snd-hda-codec-hdmi").

As hdac-hdmi is already now lagging in features compared to
snd-hda-codec-hdmi, move ahead with the transition and remove
the build option to select between the two, and instead default
to snd-hda-codec-hdmi if it is enabled in kernel build.

The old behaviour of using hdac-hdmi driver can still be forced
via the kernel module parameter.

Signed-off-by: Kai Vehmanen <kai.vehmanen@linux.intel.com>
Signed-off-by: Pierre-Louis Bossart <pierre-louis.bossart@linux.intel.com>
Link: https://lore.kernel.org/r/20200312194859.4051-5-pierre-louis.bossart@linux.intel.com
Signed-off-by: Mark Brown <broonie@kernel.org>
2020-03-13 15:44:52 +00:00
Kai Vehmanen
15a5a89597
ASoC: Intel: sof_pcm512x: make HDMI optional for all platforms
Make HDMI optional for APL and later platforms. If no HDMI codec
is found on the HDA bus, the graphics side driver is missing or
correct codec driver is not part of kernel build, codec_mask
reflects this and HDMI is disabled. The DSP topology will still
have the links for HDMI, so connect these to dummy codec to avoid
failures in topology loading.

This change also fixes a kernel oops that was triggered if
sof_pcm512x was used with SOF configured to use hdac-hdmi (can be
done via "use_common_hdmi=0" or by selecting
CONFIG_SND_SOC_SOF_HDA_COMMON_HDMI_CODEC=n). This is not a supported
configuration.

Signed-off-by: Kai Vehmanen <kai.vehmanen@linux.intel.com>
Signed-off-by: Pierre-Louis Bossart <pierre-louis.bossart@linux.intel.com>
Link: https://lore.kernel.org/r/20200312194859.4051-4-pierre-louis.bossart@linux.intel.com
Signed-off-by: Mark Brown <broonie@kernel.org>
2020-03-13 15:44:51 +00:00
Kai Vehmanen
4399afd21a
ASoC: Intel: sof_pcm512x: drop reverse deps for SND_HDA_CODEC_HDMI
Having a reverse dependency to a config that has its own additional
dependencies, is generally not recommended. And this applies to
select statements for SND_HDA_CODEC_HDMI, e.g. the case where SND_HDA
and SND_SOC_SOF_HDA are built as modules, but the machine driver is
built-in, leading to compile errors (reported as
i386-randconfig-e003-20200206).

Give up on trying to define different dependencies based on SOF/SST
selection, and simply add a "depends on" for SND_HDA_CODEC_HDMI. This
fixes the issue with randconfigs. Only downside is that SND_HDA_CODEC_HDMI
may be built unnecessarily in some cases, but this seems like the lesser
evil.

Signed-off-by: Kai Vehmanen <kai.vehmanen@linux.intel.com>
Signed-off-by: Pierre-Louis Bossart <pierre-louis.bossart@linux.intel.com>
Link: https://lore.kernel.org/r/20200312194859.4051-3-pierre-louis.bossart@linux.intel.com
Signed-off-by: Mark Brown <broonie@kernel.org>
2020-03-13 15:44:50 +00:00
Kai Vehmanen
5c82813ce4
ASoC: Intel: boards: drop reverse deps for SND_HDA_CODEC_HDMI
Having a reverse dependency to a config that has its own additional
dependencies, is generally not recommended. And this applies to
select statements for SND_HDA_CODEC_HDMI, e.g. the case where SND_HDA
and SND_SOC_SOF_HDA are built as modules, but the machine driver is
built-in, leading to compile errors (reported as
i386-randconfig-e003-20200206).

Give up on trying to define different dependencies based on SOF/SST
selection, and simply add a "depends on" for SND_HDA_CODEC_HDMI. This
fixes the issue with randconfigs. Only downside is that SND_HDA_CODEC_HDMI
may be built unnecessarily in some cases, but this seems like the lesser
evil.

Fixes: aa2b4a5 ('ASoC: Intel: boards: fix incorrect HDMI Kconfig dependency')
Reported-by: kbuild test robot <lkp@intel.com>
Signed-off-by: Kai Vehmanen <kai.vehmanen@linux.intel.com>
Signed-off-by: Pierre-Louis Bossart <pierre-louis.bossart@linux.intel.com>
Link: https://lore.kernel.org/r/20200312194859.4051-2-pierre-louis.bossart@linux.intel.com
Signed-off-by: Mark Brown <broonie@kernel.org>
2020-03-13 15:44:49 +00:00
Bard Liao
c59aca98c9
ASoC: SOF: topology: connect dai widget to all cpu-dais
Extend code from single cpu-dai to multi-dai

Signed-off-by: Bard Liao <yung-chuan.liao@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>
Link: https://lore.kernel.org/r/20200312200622.24477-7-pierre-louis.bossart@linux.intel.com
Signed-off-by: Mark Brown <broonie@kernel.org>
2020-03-13 15:13:26 +00:00
Amery Song
828c2f7871
ASoC: SOF: Intel: remove unnecessary waitq before loading firmware
The HDA_DSP_IPC_PURGE_FW IPC from ROM is already handled in
cl_dsp_init(), and it will never be received in the IRQ thread,
so the wait condition on this IPC will never be satisfied. The
wait before loading firmware is redundant and can be removed safely.

Signed-off-by: Amery Song <chao.song@intel.com>
Signed-off-by: Pierre-Louis Bossart <pierre-louis.bossart@linux.intel.com>
Reviewed-by: Keyon Jie <yang.jie@linux.intel.com>
Reviewed-by: Kai Vehmanen <kai.vehmanen@linux.intel.com>
Reviewed-by: Pierre Bossart <pierre-louis.bossart@linux.intel.com>
Reviewed-by: Ranjani Sridharan <ranjani.sridharan@linux.intel.com>
Reviewed-by: Guennadi Liakhovetski <guennadi.liakhovetski@linux.intel.com>
Link: https://lore.kernel.org/r/20200312200622.24477-6-pierre-louis.bossart@linux.intel.com
Signed-off-by: Mark Brown <broonie@kernel.org>
2020-03-13 15:13:25 +00:00
Amery Song
9b65b2a80e
ASoC: SOF: Intel: hda: remove unnecessary ROM IPC filter function
The HDA_DSP_IPC_PURGE_FW IPC from ROM is already handled in
cl_dsp_init(), and as IPC IRQ is disabled at this stage, this
IPC will be never received in the IRQ thread. The function
hda_dsp_ipc_is_sof for filtering the ROM IPC can be removed
safely.

Signed-off-by: Amery Song <chao.song@intel.com>
Signed-off-by: Pierre-Louis Bossart <pierre-louis.bossart@linux.intel.com>
Reviewed-by: Ranjani Sridharan <ranjani.sridharan@linux.intel.com>
Reviewed-by: Keyon <yang.jie@intel.com>
Reviewed-by: Kai Vehmanen <kai.vehmanen@linux.intel.com>
Link: https://lore.kernel.org/r/20200312200622.24477-5-pierre-louis.bossart@linux.intel.com
Signed-off-by: Mark Brown <broonie@kernel.org>
2020-03-13 15:13:24 +00:00
Karol Trzcinski
a6096f88a0
ASoC: SOF: Remove SOF_IPC_EXT_DMA_BUFFER
This enum code, and what's more important, related structures is
unused in whole source code, so it shouldn't be kept.

Signed-off-by: Karol Trzcinski <karolx.trzcinski@linux.intel.com>
Signed-off-by: Pierre-Louis Bossart <pierre-louis.bossart@linux.intel.com>
Link: https://lore.kernel.org/r/20200312200622.24477-4-pierre-louis.bossart@linux.intel.com
Signed-off-by: Mark Brown <broonie@kernel.org>
2020-03-13 15:13:23 +00:00
Bard Liao
e81d47e94c
ASoC: SOF: Intel: hda-dai: add stream capability
snd_soc_dai_stream_valid() will check if the stream is valid by testing
stream->channels_min. So we do need the information in dai driver.

The stream name is not added since we want to sure
playback_widget/capture_widget will be created by topology.

Signed-off-by: Bard Liao <yung-chuan.liao@linux.intel.com>
Signed-off-by: Pierre-Louis Bossart <pierre-louis.bossart@linux.intel.com>
Reviewed-by: Ranjani Sridharan <ranjani.sridharan@linux.intel.com>
Reviewed-by: Pierre Bossart <pierre-louis.bossart@linux.intel.com>
Reviewed-by: Guennadi Liakhovetski <guennadi.liakhovetski@linux.intel.com>
Reviewed-by: Kai Vehmanen <kai.vehmanen@linux.intel.com>
Link: https://lore.kernel.org/r/20200312200622.24477-2-pierre-louis.bossart@linux.intel.com
Signed-off-by: Mark Brown <broonie@kernel.org>
2020-03-13 15:13:22 +00:00
Oder Chiou
5b7ddb86e6
ASoC: rt5682: Revise the DAC1 volume setting
The max volume of the DAC1 Playback Volume is 0dB.

Signed-off-by: Oder Chiou <oder_chiou@realtek.com>
Link: https://lore.kernel.org/r/20200313023850.28875-2-oder_chiou@realtek.com
Signed-off-by: Mark Brown <broonie@kernel.org>
2020-03-13 14:49:59 +00:00
Takashi Iwai
578194290d
ASoC: wm_adsp: Use scnprintf() for the limited buffer output
snprintf() is a hard-to-use function, it's especially difficult to use
it for concatenating substrings in a buffer with a limited size.
Since snprintf() returns the would-be-output size, not the actual
size, the subsequent use of snprintf() may point to the incorrect
position.

Use scnprintf() instead for fixing such potential errors.

Signed-off-by: Takashi Iwai <tiwai@suse.de>
Acked-by: Charles Keepax <ckeepax@opensource.cirrus.com>
Link: https://lore.kernel.org/r/20200313130334.9028-1-tiwai@suse.de
Signed-off-by: Mark Brown <broonie@kernel.org>
2020-03-13 14:49:58 +00:00
Amadeusz Sławiński
c42464a4e6
ASoC: topology: Perform component check upfront
Function soc_tplg_dbytes_create(), calls soc_tplg_init_kcontrol() to
perform additional driver specific initialization. While
soc_tplg_init_kcontrol() ensures that component is valid before invoking
ops->control_load, there is no such check at the end of
soc_tplg_dbytes_create() where list_add() is used.

Also in quite a few places, there is reference of tplg->comp->dapm or
tplg->comp->card, without any checks for tplg->comp.

In consequence of the above this may lead to referencing NULL pointer.

This allows for removal of now unnecessary checks.

Signed-off-by: Amadeusz Sławiński <amadeuszx.slawinski@linux.intel.com>
Reviewed-by: Ranjani Sridharan <ranjani.sridharan@linux.intel.com>
Link: https://lore.kernel.org/r/20200312122239.14489-1-amadeuszx.slawinski@linux.intel.com
Signed-off-by: Mark Brown <broonie@kernel.org>
2020-03-12 16:52:17 +00:00
Guennadi Liakhovetski
f17a14789e
ASoC: export DPCM runtime update functions
This makes DPCM runtime update functions available for external
calling. As an example, virtualised ASoC component drivers may need
to call these when managing shared DAPM routes that are used by more
than one driver (i.e. when host driver and guest drivers have a DAPM
path from guest PCM to host DAI where some parts are owned by host
driver and others by guest driver).

Signed-off-by: Guennadi Liakhovetski <guennadi.liakhovetski@linux.intel.com>
Link: https://lore.kernel.org/r/20200312095214.15126-3-guennadi.liakhovetski@linux.intel.com
Signed-off-by: Mark Brown <broonie@kernel.org>
2020-03-12 13:30:38 +00:00
Guennadi Liakhovetski
8cce6569e4
ASoC: (cosmetic) simplify dpcm_prune_paths()
Currently dpcm_prune_paths() has up to 4 nested condition and loop
levels, which forces the code to use flags for flow control.
Extracting widget status verification code from dpcm_prune_paths()
into a separate function simplifies the code.

Signed-off-by: Guennadi Liakhovetski <guennadi.liakhovetski@linux.intel.com>
Link: https://lore.kernel.org/r/20200312095214.15126-2-guennadi.liakhovetski@linux.intel.com
Signed-off-by: Mark Brown <broonie@kernel.org>
2020-03-12 13:30:37 +00:00
Mark Brown
6187509ba5
Merge series "ASoC: qdsp6: fix default FE dais and routings." from Srinivas Kandagatla <srinivas.kandagatla@linaro.org>:
QDSP6 Frontend dais can be configured to work in rx or tx or both rx/tx mode,
however the default routing do not honour this DT configuration making sound
card fail to probe. FE dais are also not fully honouring device tree configuration.
Fix both of them.

Originally  issue was reported by Vinod Koul

Srinivas Kandagatla (2):
  ASoC: qdsp6: q6asm-dai: only enable dais from device tree
  ASoC: qdsp6: q6routing: remove default routing

 sound/soc/qcom/qdsp6/q6asm-dai.c | 30 +++++++++++++++++++++++-------
 sound/soc/qcom/qdsp6/q6routing.c | 19 -------------------
 2 files changed, 23 insertions(+), 26 deletions(-)

--
2.21.0
2020-03-12 13:12:36 +00:00
Cezary Rojewski
16dcefc23e
ASoC: SOF: Intel: Fix stream cleanup on hw free
Field "substream" gets assigned during stream setup in
hda_dsp_pcm_hw_params() but it is never cleared afterwards during
cleanup procedure. Now, any non-pcm operation e.g.: compress can
mistakenly make use of that pointer as it's bypassing all
"if (s->substream)" checks.

Nulling the pointer during hw_free operation ensures no wild pointers
are left behind.

Fixes: cdae3b9a47 ("ASoC: SOF: Intel: Add Intel specific HDA PCM operations")
Signed-off-by: Cezary Rojewski <cezary.rojewski@intel.com>
Acked-by: Pierre-Louis Bossart <pierre-louis.bossart@linux.intel.com>
Link: https://lore.kernel.org/r/20200312120058.15057-1-cezary.rojewski@intel.com
Signed-off-by: Mark Brown <broonie@kernel.org>
2020-03-12 13:12:35 +00:00
Srinivas Kandagatla
f864edff11
ASoC: qdsp6: q6routing: remove default routing
Frontend dais can be configured to rx or tx or both, however having default
routes without considering this configuration can lead to failures during
card probe as below for compress rx only case. These routing have to come
from sound card routing table in device tree.

"routing: ASoC: Failed to add route MM_UL1 -> direct -> MultiMedia1 Capture
msm-snd-sdm845 sound: ASoC: failed to instantiate card -19
"

Reported-by: Vinod Koul <vinod.koul@linaro.org>
Signed-off-by: Srinivas Kandagatla <srinivas.kandagatla@linaro.org>
Link: https://lore.kernel.org/r/20200311180422.28363-3-srinivas.kandagatla@linaro.org
Signed-off-by: Mark Brown <broonie@kernel.org>
2020-03-12 12:55:39 +00:00
Srinivas Kandagatla
9b60441692
ASoC: qdsp6: q6asm-dai: only enable dais from device tree
Existing code enables all the playback and capture dais even
if there is no device tree entry. This can lead to
un-necessary dais in the system which will never be used.
So honour whats specfied in device tree.

Signed-off-by: Srinivas Kandagatla <srinivas.kandagatla@linaro.org>
Link: https://lore.kernel.org/r/20200311180422.28363-2-srinivas.kandagatla@linaro.org
Signed-off-by: Mark Brown <broonie@kernel.org>
2020-03-12 12:55:38 +00:00
Mark Brown
4d90a4e677 Linux 5.6-rc5
-----BEGIN PGP SIGNATURE-----
 
 iQFSBAABCAA8FiEEq68RxlopcLEwq+PEeb4+QwBBGIYFAl5lkYceHHRvcnZhbGRz
 QGxpbnV4LWZvdW5kYXRpb24ub3JnAAoJEHm+PkMAQRiGpHQH/RJrzcaZHo4lw88m
 Jf7vBZ9DYUlRgqE0pxTHWmodNObKRqpwOUGflUcWbb/7GD2LQUfeqhSECVQyTID9
 N9y7FcPvx321Qhc3EkZ24DBYk0+DQ0K2FVUrSa/PxO0n7czxxXWaLRDmlSULEd3R
 D4pVs3zEWOBXJHUAvUQ5R+lKfkeWKNeeepeh+rezuhpdWFBRNz4Jjr5QUJ8od5xI
 sIwobYmESJqTRVBHqW8g2T2/yIsFJ78GCXs8DZLe1wxh40UbxdYDTA0NDDTHKzK6
 lxzBgcmKzuge+1OVmzxLouNWMnPcjFlVgXWVerpSy3/SIFFkzzUWeMbqm6hKuhOn
 wAlcIgI=
 =VQUc
 -----END PGP SIGNATURE-----
gpgsig -----BEGIN PGP SIGNATURE-----
 
 iQFHBAABCgAxFiEEreZoqmdXGLWf4p/qJNaLcl1Uh9AFAl5pMckTHGJyb29uaWVA
 a2VybmVsLm9yZwAKCRAk1otyXVSH0JSaB/0dQ534mBfgkuR5JCOBU53pfcuSGoqM
 Ya+KepVKdGSIazXuuHRNaFeI3jJxiuiKJ7ar77lxxBSeerhMuLy5EAAH5Pm2f7TL
 XfevQ0VmptN8BKqZBRhIfdRAeXNDP04/R9bWK9wBk+J18A3mem1tMFkBwOYYS02f
 OgvsyUwDEsau6hTBBOiK3qyQgGPMOoCKHmX7ZQlNcaRYJzPwXqH+hQpnDbBRw+v/
 lW/+vVOa/NamWSXZogHQWuF1FqERY2AqWqDpDgoA0nLBwEis+Jte8gzCQxuNx6pd
 L0D5IJItvpWGM+bkDrg/dFHQRp4KlbX9G+cMU/ScGuBh0E4KBYT/17lk
 =CIkj
 -----END PGP SIGNATURE-----

Merge tag 'v5.6-rc5' into asoc-5.7

Linux 5.6-rc5
2020-03-11 18:45:26 +00:00
tangbin
103ae95513
ASoC: zte: zx-tdm: remove redundant variables dev
In this function, the variable 'dev' is assigned to '&pdev->dev',
but in the following code, all the assignments to 'struce device'
are used '&pdev->dev' instead of 'dev',except 'zx_tdm->dev'.
So,the variable 'dev' in this function is redundant and can be
replaced by '&pdev->dev' as elsewhere.

Signed-off-by: tangbin <tangbin@cmss.chinamobile.com>
Link: https://lore.kernel.org/r/20200311144646.11292-1-tangbin@cmss.chinamobile.com
Signed-off-by: Mark Brown <broonie@kernel.org>
2020-03-11 17:59:49 +00:00
Mark Brown
ad7366a68a
Merge series "ASoC: rt5682: fix Kconfig/compilation issues when I2C is not selected" from Pierre-Louis Bossart <pierre-louis.bossart@linux.intel.com>:
RT5682 can work in I2C or SoundWire mode, but the code will not
compile if I2C is not selected.

Reported-by: kbuild test robot <lkp@intel.com>

Pierre-Louis Bossart (3):
  ASoC: rt5682: fix unmet dependencies
  ASoC: rt5682: fix compilation issues without I2C
  ASoC: rt5682-sdw: fix 'defined but not used' pm functions

 sound/soc/codecs/Kconfig      |  2 +-
 sound/soc/codecs/rt5682-sdw.c |  4 ++--
 sound/soc/codecs/rt5682.c     | 10 ++++++++++
 3 files changed, 13 insertions(+), 3 deletions(-)

--
2.20.1
2020-03-10 18:19:02 +00:00
Takashi Iwai
d0c9abb833
ASoC: pcm: Fix (again) possible buffer overflow in dpcm state sysfs output
This is re-applying the fix that went into 5.6 (commit 6c89ffea60)
as the changes were wiped out after merging the other code
refactoring.  Basically the same changes, just replacing the
suspicious calls of snprintf() with scnprintf().

Signed-off-by: Takashi Iwai <tiwai@suse.de>
Link: https://lore.kernel.org/r/20200310163625.10838-1-tiwai@suse.de
Signed-off-by: Mark Brown <broonie@kernel.org>
2020-03-10 18:19:01 +00:00
Pierre-Louis Bossart
724cc62f7a
ASoC: rt5682-sdw: fix 'defined but not used' pm functions
Gcc reports the following warnings:

sound/soc/codecs/rt5682-sdw.c:286:12: warning: 'rt5682_dev_resume'
defined but not used [-Wunused-function]
 static int rt5682_dev_resume(struct device *dev)
            ^~~~~~~~~~~~~~~~~

sound/soc/codecs/rt5682-sdw.c:273:12: warning: 'rt5682_dev_suspend'
defined but not used [-Wunused-function]
 static int rt5682_dev_suspend(struct device *dev)
            ^~~~~~~~~~~~~~~~~~

Fix by adding maybe_unused as done for other SoundWire codecs

Fixes: 03f6fc6de9 ('ASoC: rt5682: Add the soundwire support')
Reported-by: kbuild test robot <lkp@intel.com>
Signed-off-by: Pierre-Louis Bossart <pierre-louis.bossart@linux.intel.com>
Cc: Oder Chiou <oder_chiou@realtek.com>
Link: https://lore.kernel.org/r/20200310163509.14466-4-pierre-louis.bossart@linux.intel.com
Signed-off-by: Mark Brown <broonie@kernel.org>
2020-03-10 18:03:31 +00:00
Pierre-Louis Bossart
5549ea6479
ASoC: rt5682: fix unmet dependencies
The rt5682 code can be used in I2C or SoundWire mode. When I2C is not
selected, we have the following issue:

WARNING: unmet direct dependencies detected for SND_SOC_RT5682
  Depends on [n]: SOUND [=m] && !UML && SND [=m] && SND_SOC [=m] &&
  I2C [=n]
  Selected by [m]:
  - SND_SOC_RT5682_SDW [=m] && SOUND [=m] && !UML && SND [=m] &&
    SND_SOC [=m] && SOUNDWIRE [=m]

Fix by adding SOUNDWIRE as a dependency.

Fixes: 03f6fc6de9 ('ASoC: rt5682: Add the soundwire support')
Reported-by: kbuild test robot <lkp@intel.com>
Signed-off-by: Pierre-Louis Bossart <pierre-louis.bossart@linux.intel.com>
Cc: Oder Chiou <oder_chiou@realtek.com>
Link: https://lore.kernel.org/r/20200310163509.14466-2-pierre-louis.bossart@linux.intel.com
Signed-off-by: Mark Brown <broonie@kernel.org>
2020-03-10 18:03:30 +00:00
Cezary Rojewski
7693cadac8
ASoC: Intel: Skylake: Await purge request ack on CNL
Each purge request is sent by driver after master core is powered up and
unresetted but before it is unstalled. On unstall, ROM begins processing
the request and initializing environment for FW load. Host should await
ROM's ack before moving forward. Without doing so, ROM init poll may
start too early and false timeouts can occur.

Fixes: cb6a552846 ("ASoC: Intel: cnl: Add sst library functions for cnl platform")
Signed-off-by: Cezary Rojewski <cezary.rojewski@intel.com>
Reviewed-by: Pierre-Louis Bossart <pierre-louis.bossart@linux.intel.com>
Link: https://lore.kernel.org/r/20200305145314.32579-8-cezary.rojewski@intel.com
Signed-off-by: Mark Brown <broonie@kernel.org>
2020-03-10 17:44:29 +00:00
Cezary Rojewski
024aa45f55
ASoC: Intel: Allow for ROM init retry on CNL platforms
Due to unconditional initial timeouts, firmware may fail to load during
its initialization. This issue cannot be resolved on driver side as it
is caused by external sources such as CSME but has to be accounted for
nonetheless.

Fixes: cb6a552846 ("ASoC: Intel: cnl: Add sst library functions for cnl platform")
Signed-off-by: Cezary Rojewski <cezary.rojewski@intel.com>
Reviewed-by: Pierre-Louis Bossart <pierre-louis.bossart@linux.intel.com>
Link: https://lore.kernel.org/r/20200305145314.32579-7-cezary.rojewski@intel.com
Signed-off-by: Mark Brown <broonie@kernel.org>
2020-03-10 17:44:28 +00:00
Cezary Rojewski
9e6c382f5a
ASoC: Intel: Skylake: Shield against no-NHLT configurations
Some configurations expose no NHLT table at all within their
/sys/firmware/acpi/tables. To prevent NULL-dereference errors from
occurring, adjust probe flow and append additional safety checks in
functions involved in NHLT lifecycle.

Signed-off-by: Cezary Rojewski <cezary.rojewski@intel.com>
Reviewed-by: Pierre-Louis Bossart <pierre-louis.bossart@linux.intel.com>
Link: https://lore.kernel.org/r/20200305145314.32579-5-cezary.rojewski@intel.com
Signed-off-by: Mark Brown <broonie@kernel.org>
2020-03-10 17:44:27 +00:00
Cezary Rojewski
e603f11d5d
ASoC: Intel: Skylake: Enable codec wakeup during chip init
Follow the recommendation set by hda_intel.c and enable HDMI/DP codec
wakeup during bus initialization procedure. Disable wakeup once init
completes.

Signed-off-by: Cezary Rojewski <cezary.rojewski@intel.com>
Reviewed-by: Pierre-Louis Bossart <pierre-louis.bossart@linux.intel.com>
Link: https://lore.kernel.org/r/20200305145314.32579-4-cezary.rojewski@intel.com
Signed-off-by: Mark Brown <broonie@kernel.org>
2020-03-10 17:44:26 +00:00
Cezary Rojewski
a66f88394a
ASoC: Intel: Skylake: Select hda configuration permissively
With _reset_link removed from the probe sequence, codec_mask at the time
skl_find_hda_machine() is invoked will always be 0, so hda machine will
never be chosen. Rather than reorganizing boot flow, be permissive about
invalid mask. codec_mask will be set to proper value during probe_work -
before skl_codec_create() ever gets called.

Signed-off-by: Cezary Rojewski <cezary.rojewski@intel.com>
Reviewed-by: Pierre-Louis Bossart <pierre-louis.bossart@linux.intel.com>
Link: https://lore.kernel.org/r/20200305145314.32579-3-cezary.rojewski@intel.com
Signed-off-by: Mark Brown <broonie@kernel.org>
2020-03-10 17:44:25 +00:00
Cezary Rojewski
2ef81057d8
ASoC: Intel: Skylake: Remove superfluous chip initialization
Skylake driver does the controller init operation twice:
- first during probe (only to stop it just before scheduling probe_work)
- and during said probe_work where the actual correct sequence is
executed

To properly complete boot sequence when iDisp codec is present, bus
initialization has to be called only after _i915_init() finishes.
With additional _reset_list preceding _i915_init(), iDisp codec never
gets the chance to enumerate on the link. Remove the superfluous
initialization to address the issue.

Signed-off-by: Cezary Rojewski <cezary.rojewski@intel.com>
Reviewed-by: Pierre-Louis Bossart <pierre-louis.bossart@linux.intel.com>
Link: https://lore.kernel.org/r/20200305145314.32579-2-cezary.rojewski@intel.com
Signed-off-by: Mark Brown <broonie@kernel.org>
2020-03-10 17:44:24 +00:00