platform/kernel/linux-starfive.git
4 years agoASoC: pxa: magician: convert to use i2c_new_client_device()
Wolfram Sang [Thu, 26 Mar 2020 21:10:10 +0000 (22:10 +0100)]
ASoC: pxa: magician: convert to use i2c_new_client_device()

Move away from the deprecated API and return the shiny new ERRPTR where
useful.

Signed-off-by: Wolfram Sang <wsa+renesas@sang-engineering.com>
Link: https://lore.kernel.org/r/20200326211010.13471-2-wsa+renesas@sang-engineering.com
Signed-off-by: Mark Brown <broonie@kernel.org>
4 years agoMerge series "ASoC: rt1308-sdw: configure amplifier with set_tdm_slot()" from Pierre...
Mark Brown [Thu, 26 Mar 2020 19:04:33 +0000 (19:04 +0000)]
Merge series "ASoC: rt1308-sdw: configure amplifier with set_tdm_slot()" from Pierre-Louis Bossart <pierre-louis.bossart@linux.intel.com>:

When two (or more) amplifiers are on the same link, the integrator may:
a) assign dedicated slots for each of the amplifiers.
b) provide the same configuration to all amplifiers, and rely on
additional controls/processing in the amplifier to generate different
outputs.

case a) was the initial direction for SoundWire and is required for
amplifiers with limited capabilities, but to deal with orientation or
'posture' changes it's easier to implement case b) when the amplifier
can deal with multiple channels.

This patchset suggest the use of the set_tdm_slot() API to define
which of the channels will be consumed by what amplifiers. This maps
well with SoundWire's 'ChannelEnable' registers. The notion of
slot_width is however irrelevant here and ignored, and SoundWire ports
are typically single direction, so only one of the two masks shall be
used.

Pierre-Louis Bossart (2):
  ASoC: rt1308-sdw: add set_tdm_slot() support
  ASoC: rt1308-sdw: use slot and rx_mask to configure stream

 sound/soc/codecs/rt1308-sdw.c | 38 +++++++++++++++++++++++++++++++----
 sound/soc/codecs/rt1308-sdw.h |  2 ++
 2 files changed, 36 insertions(+), 4 deletions(-)

--
2.20.1

4 years agoMerge series "ASoC: Intel: machine driver updates" from Pierre-Louis Bossart <pierre...
Mark Brown [Thu, 26 Mar 2020 19:04:32 +0000 (19:04 +0000)]
Merge series "ASoC: Intel: machine driver updates" from Pierre-Louis Bossart <pierre-louis.bossart@linux.intel.com>:

One correction for GeminiLake and 2 additional machine drivers for
Chromebooks.

Curtis Malainey (1):
  ASoC: Intel: Make glk+rt5682 echo ref dynamic

Sathyanarayana Nujella (2):
  ASoC: Intel: sof_rt5682: Add support for tgl-max98373-rt5682
  ASoC: Intel: common: Add mach table for tgl-max98373-rt5682

Yong Zhi (1):
  ASoC: intel: sof_da7219_max98373: Add speaker switch

 sound/soc/intel/boards/Kconfig                |  1 +
 sound/soc/intel/boards/Makefile               |  2 +-
 sound/soc/intel/boards/glk_rt5682_max98357a.c |  1 +
 sound/soc/intel/boards/sof_da7219_max98373.c  | 67 +++++++++-------
 sound/soc/intel/boards/sof_maxim_common.c     | 80 +++++++++++++++++++
 sound/soc/intel/boards/sof_maxim_common.h     | 24 ++++++
 sound/soc/intel/boards/sof_rt5682.c           | 21 +++++
 .../intel/common/soc-acpi-intel-tgl-match.c   | 13 +++
 8 files changed, 178 insertions(+), 31 deletions(-)
 create mode 100644 sound/soc/intel/boards/sof_maxim_common.c
 create mode 100644 sound/soc/intel/boards/sof_maxim_common.h

--
2.20.1

4 years agoMerge series "ASoC: SOF: cleanups and improvements" from Pierre-Louis Bossart <pierre...
Mark Brown [Thu, 26 Mar 2020 19:04:31 +0000 (19:04 +0000)]
Merge series "ASoC: SOF: cleanups and improvements" from Pierre-Louis Bossart <pierre-louis.bossart@linux.intel.com>:

Couple of small patches to improve error handling, inits, logs.

Hope we can have this for 5.7?

Guennadi Liakhovetski (2):
  ASoC: SOF: (cosmetic) use for_each_pcm_streams() in sof_dai_load()
  ASoC: SOF: fix uninitialised "work" with VirtIO

Kai Vehmanen (2):
  ASoC: SOF: Intel: hda: do not leave clock gating off upon error
  ASoC: SOF: Intel: hda: call codec wake at chip init

Ranjani Sridharan (1):
  ASoC: SOF: Intel: hda: Improve DSP state logging

 sound/soc/sof/intel/hda-ctrl.c | 15 +++++++++---
 sound/soc/sof/intel/hda-dsp.c  | 43 ++++++++++++++++++++++++++++++++--
 sound/soc/sof/pcm.c            |  4 +---
 sound/soc/sof/sof-audio.h      |  3 +++
 sound/soc/sof/topology.c       | 17 ++++++++++----
 5 files changed, 69 insertions(+), 13 deletions(-)

--
2.20.1

4 years agoASoC: pxa: Enable AC'97 bus support for PXA machines
Mark Brown [Thu, 26 Mar 2020 18:01:16 +0000 (18:01 +0000)]
ASoC: pxa: Enable AC'97 bus support for PXA machines

The AC'97 based PXA machines currently don't build reliably as they don't
ensure that an AC'97 bus is built, causing at least eseries_pxa_defconfig
to fail to build. Add selects to fix this.

Reported-by: KernelCI <bot@kernelci.org>
Signed-off-by: Mark Brown <broonie@kernel.org>
Link: https://lore.kernel.org/r/20200326180116.21375-1-broonie@kernel.org
Signed-off-by: Mark Brown <broonie@kernel.org>
4 years agoASoC: pxa: Select regmap from AC'97 machines
Mark Brown [Thu, 26 Mar 2020 15:10:53 +0000 (15:10 +0000)]
ASoC: pxa: Select regmap from AC'97 machines

regmap needs to be selected by users which for machine drivers that select
AC'97 CODEC drivers means that we need to also select regmap to ensure that
the CODEC driver will build if nothing else enables regmap as is likely for
such systems.

Signed-off-by: Mark Brown <broonie@kernel.org>
Link: https://lore.kernel.org/r/20200326151053.40806-1-broonie@kernel.org
Signed-off-by: Mark Brown <broonie@kernel.org>
4 years agoASoC: rt1308-sdw: use slot and rx_mask to configure stream
Pierre-Louis Bossart [Wed, 25 Mar 2020 21:29:05 +0000 (16:29 -0500)]
ASoC: rt1308-sdw: use slot and rx_mask to configure stream

If the DAI was configured with a set_tdm_slots() call, use the information.

A platform or machine driver may configure each amplifier to extract
different bitSlots from the frame, or extract the same data and use
processing to generate the relevant output. The latter case is easier
to handle in case of orientation changes.

Signed-off-by: Pierre-Louis Bossart <pierre-louis.bossart@linux.intel.com>
Link: https://lore.kernel.org/r/20200325212905.28145-3-pierre-louis.bossart@linux.intel.com
Signed-off-by: Mark Brown <broonie@kernel.org>
4 years agoASoC: rt1308-sdw: add set_tdm_slot() support
Pierre-Louis Bossart [Wed, 25 Mar 2020 21:29:04 +0000 (16:29 -0500)]
ASoC: rt1308-sdw: add set_tdm_slot() support

Add ability to select which of the channels is used, or both, in case
two RT1308 amplifiers are located on the same link.

Signed-off-by: Pierre-Louis Bossart <pierre-louis.bossart@linux.intel.com>
Link: https://lore.kernel.org/r/20200325212905.28145-2-pierre-louis.bossart@linux.intel.com
Signed-off-by: Mark Brown <broonie@kernel.org>
4 years agoASoC: SOF: Intel: hda: call codec wake at chip init
Kai Vehmanen [Wed, 25 Mar 2020 21:12:33 +0000 (16:12 -0500)]
ASoC: SOF: Intel: hda: call codec wake at chip init

Further align HDA init sequence to the legacy non-DSP HDA driver by
calling snd_hdac_set_codec_wakeup() during the chip init sequence.

Signed-off-by: Kai Vehmanen <kai.vehmanen@linux.intel.com>
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/20200325211233.27394-6-pierre-louis.bossart@linux.intel.com
Signed-off-by: Mark Brown <broonie@kernel.org>
4 years agoASoC: SOF: Intel: hda: do not leave clock gating off upon error
Kai Vehmanen [Wed, 25 Mar 2020 21:12:32 +0000 (16:12 -0500)]
ASoC: SOF: Intel: hda: do not leave clock gating off upon error

The misc clock gating (MISCBDCGE) is disabled for controller reset and
reenabled once reset is complete.

Fix the case when error happens during reset, and clock gating is
left disabled. The clock gating should be reenabled also in this case.

Signed-off-by: Kai Vehmanen <kai.vehmanen@linux.intel.com>
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/20200325211233.27394-5-pierre-louis.bossart@linux.intel.com
Signed-off-by: Mark Brown <broonie@kernel.org>
4 years agoASoC: SOF: fix uninitialised "work" with VirtIO
Guennadi Liakhovetski [Wed, 25 Mar 2020 21:12:31 +0000 (16:12 -0500)]
ASoC: SOF: fix uninitialised "work" with VirtIO

In the VirtIO case the sof_pcm_open() function isn't called on the
host during guest streaming, which then leaves "work" structures
uninitialised. However it is then used to handle position update
messages from the DSP. Move their initialisation to immediately after
allocation of the containing structure.

Signed-off-by: Guennadi Liakhovetski <guennadi.liakhovetski@linux.intel.com>
Signed-off-by: Pierre-Louis Bossart <pierre-louis.bossart@linux.intel.com>
Reviewed-by: Kai Vehmanen <kai.vehmanen@linux.intel.com>
Reviewed-by: Ranjani Sridharan <ranjani.sridharan@linux.intel.com>
Link: https://lore.kernel.org/r/20200325211233.27394-4-pierre-louis.bossart@linux.intel.com
Signed-off-by: Mark Brown <broonie@kernel.org>
4 years agoASoC: SOF: (cosmetic) use for_each_pcm_streams() in sof_dai_load()
Guennadi Liakhovetski [Wed, 25 Mar 2020 21:12:30 +0000 (16:12 -0500)]
ASoC: SOF: (cosmetic) use for_each_pcm_streams() in sof_dai_load()

Use for_each_pcm_streams() to enumerate streams in sof_dai_load()
instead of doing that manually.

Signed-off-by: Guennadi Liakhovetski <guennadi.liakhovetski@linux.intel.com>
Signed-off-by: Pierre-Louis Bossart <pierre-louis.bossart@linux.intel.com>
Reviewed-by: Kai Vehmanen <kai.vehmanen@linux.intel.com>
Reviewed-by: Ranjani Sridharan <ranjani.sridharan@linux.intel.com>
Link: https://lore.kernel.org/r/20200325211233.27394-3-pierre-louis.bossart@linux.intel.com
Signed-off-by: Mark Brown <broonie@kernel.org>
4 years agoASoC: SOF: Intel: hda: Improve DSP state logging
Ranjani Sridharan [Wed, 25 Mar 2020 21:12:29 +0000 (16:12 -0500)]
ASoC: SOF: Intel: hda: Improve DSP state logging

Improve the DSP power state logs with the state names
instead of values.

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/20200325211233.27394-2-pierre-louis.bossart@linux.intel.com
Signed-off-by: Mark Brown <broonie@kernel.org>
4 years agoASoC: Intel: common: Add mach table for tgl-max98373-rt5682
Sathyanarayana Nujella [Wed, 25 Mar 2020 21:32:45 +0000 (16:32 -0500)]
ASoC: Intel: common: Add mach table for tgl-max98373-rt5682

Update tgl mach table with: Maxim98373 Amp and ALC5682 hp codec.
Both of the codecs are on I2S bus.

Signed-off-by: Jairaj Arava <jairaj.arava@intel.com>
Signed-off-by: Sathyanarayana Nujella <sathyanarayana.nujella@intel.com>
Signed-off-by: Pierre-Louis Bossart <pierre-louis.bossart@linux.intel.com>
Link: https://lore.kernel.org/r/20200325213245.28247-5-pierre-louis.bossart@linux.intel.com
Signed-off-by: Mark Brown <broonie@kernel.org>
4 years agoASoC: Intel: sof_rt5682: Add support for tgl-max98373-rt5682
Sathyanarayana Nujella [Wed, 25 Mar 2020 21:32:44 +0000 (16:32 -0500)]
ASoC: Intel: sof_rt5682: Add support for tgl-max98373-rt5682

This patch does the below:
1. Adds the driver data and updates quirk info for TGL
        with Max98373 speaker amp and ALC5682 headset codec.
2. Added max98373 speaker related code to common file for re-use.

Signed-off-by: Jairaj Arava <jairaj.arava@intel.com>
Signed-off-by: Sathyanarayana Nujella <sathyanarayana.nujella@intel.com>
Signed-off-by: Pierre-Louis Bossart <pierre-louis.bossart@linux.intel.com>
Link: https://lore.kernel.org/r/20200325213245.28247-4-pierre-louis.bossart@linux.intel.com
Signed-off-by: Mark Brown <broonie@kernel.org>
4 years agoASoC: intel: sof_da7219_max98373: Add speaker switch
Yong Zhi [Wed, 25 Mar 2020 21:32:43 +0000 (16:32 -0500)]
ASoC: intel: sof_da7219_max98373: Add speaker switch

Add "Spk Switch" and associated widget, route to max98360a
speaker amp for power saving, also remove the speaker_amp_init()
callback with complete separated tables for max98373 and max98360a.

Signed-off-by: Bhat, Uday M <uday.m.bhat@intel.com>
Signed-off-by: Pierre-Louis Bossart <pierre-louis.bossart@linux.intel.com>
Signed-off-by: Yong Zhi <yong.zhi@intel.com>
Link: https://lore.kernel.org/r/20200325213245.28247-3-pierre-louis.bossart@linux.intel.com
Signed-off-by: Mark Brown <broonie@kernel.org>
4 years agoASoC: Intel: Make glk+rt5682 echo ref dynamic
Curtis Malainey [Wed, 25 Mar 2020 21:32:42 +0000 (16:32 -0500)]
ASoC: Intel: Make glk+rt5682 echo ref dynamic

Without the dynamic flag to allow runtime routing, the card cannot
probe on chromebooks because SOF is constantly waiting for the link.
Adding flag back to allow upstream kernels to work on rt5682 based
chromebooks since SOF can now ignore the hard coded front end.

Signed-off-by: Curtis Malainey <cujomalainey@chromium.org>
Signed-off-by: Pierre-Louis Bossart <pierre-louis.bossart@linux.intel.com>
Link: https://lore.kernel.org/r/20200325213245.28247-2-pierre-louis.bossart@linux.intel.com
Signed-off-by: Mark Brown <broonie@kernel.org>
4 years agoASoC: mchp-i2s-mcc: make signed 1 bit bitfields unsigned
Colin Ian King [Wed, 25 Mar 2020 13:29:13 +0000 (13:29 +0000)]
ASoC: mchp-i2s-mcc: make signed 1 bit bitfields unsigned

The signed 1 bit bitfields should be unsigned, so make them unsigned.

Signed-off-by: Colin Ian King <colin.king@canonical.com>
Reviewed-by: Codrin Ciubotariu <codrin.ciubotariu@microchip.com>
Link: https://lore.kernel.org/r/20200325132913.110115-1-colin.king@canonical.com
Signed-off-by: Mark Brown <broonie@kernel.org>
4 years agoASoC: Convert jz4740-i2s doc to YAML
Paul Cercueil [Fri, 6 Mar 2020 22:29:26 +0000 (23:29 +0100)]
ASoC: Convert jz4740-i2s doc to YAML

Convert the textual binding documentation for the AIC (AC97/I2S
Controller) of Ingenic SoCs to a YAML schema, and add the new compatible
strings in the process.

Signed-off-by: Paul Cercueil <paul@crapouillou.net>
Reviewed-by: Rob Herring <robh@kernel.org>
Link: https://lore.kernel.org/r/20200306222931.39664-1-paul@crapouillou.net
Signed-off-by: Mark Brown <broonie@kernel.org>
4 years agoASoC: jz4740-i2s: Add support for the JZ4770
Paul Cercueil [Fri, 6 Mar 2020 22:29:31 +0000 (23:29 +0100)]
ASoC: jz4740-i2s: Add support for the JZ4770

Before the JZ4770, the playback and capture sampling rates had to match.
The JZ4770 supports independent sampling rates for both.

Signed-off-by: Paul Cercueil <paul@crapouillou.net>
Link: https://lore.kernel.org/r/20200306222931.39664-6-paul@crapouillou.net
Signed-off-by: Mark Brown <broonie@kernel.org>
4 years agoASoC: jz4740-i2s: Add support for the JZ4760
Paul Cercueil [Fri, 6 Mar 2020 22:29:30 +0000 (23:29 +0100)]
ASoC: jz4740-i2s: Add support for the JZ4760

The change of offset for the {rx,tx}_threshold fields in the conf
register predates the JZ4780, and was first introduced in the JZ4760.

Signed-off-by: Paul Cercueil <paul@crapouillou.net>
Link: https://lore.kernel.org/r/20200306222931.39664-5-paul@crapouillou.net
Signed-off-by: Mark Brown <broonie@kernel.org>
4 years agodt-bindings: sound: rockchip-i2s: add #sound-dai-cells property
Johan Jonker [Tue, 24 Mar 2020 09:41:48 +0000 (10:41 +0100)]
dt-bindings: sound: rockchip-i2s: add #sound-dai-cells property

'#sound-dai-cells' is required to properly interpret
the list of DAI specified in the 'sound-dai' property,
so add them to 'rockchip-i2s.yaml'

Signed-off-by: Johan Jonker <jbx6244@gmail.com>
Reviewed-by: Rob Herring <robh@kernel.org>
Link: https://lore.kernel.org/r/20200324094149.6904-2-jbx6244@gmail.com
Signed-off-by: Mark Brown <broonie@kernel.org>
4 years agodt-bindings: sound: convert rockchip i2s bindings to yaml
Johan Jonker [Tue, 24 Mar 2020 09:41:47 +0000 (10:41 +0100)]
dt-bindings: sound: convert rockchip i2s bindings to yaml

Current dts files with 'i2s' nodes are manually verified.
In order to automate this process rockchip-i2s.txt
has to be converted to yaml.

Signed-off-by: Johan Jonker <jbx6244@gmail.com>
Reviewed-by: Rob Herring <robh@kernel.org>
Link: https://lore.kernel.org/r/20200324094149.6904-1-jbx6244@gmail.com
Signed-off-by: Mark Brown <broonie@kernel.org>
4 years agoASoC: wm8974: remove unused variables
YueHaibing [Tue, 24 Mar 2020 07:06:15 +0000 (15:06 +0800)]
ASoC: wm8974: remove unused variables

sound/soc/codecs/wm8974.c:200:38: warning:
 wm8974_aux_boost_controls defined but not used [-Wunused-const-variable=]
sound/soc/codecs/wm8974.c:204:38: warning:
 wm8974_mic_boost_controls defined but not used [-Wunused-const-variable=]

commit 8a123ee2a46d ("ASoC: WM8974 DAPM cleanups")
left behind this, remove them.

Signed-off-by: YueHaibing <yuehaibing@huawei.com>
Link: https://lore.kernel.org/r/20200324070615.16248-1-yuehaibing@huawei.com
Signed-off-by: Mark Brown <broonie@kernel.org>
4 years agoMerge series "Support built-in Mic on Tegra boards that use WM8903" from Dmitry Osipe...
Mark Brown [Mon, 23 Mar 2020 18:17:26 +0000 (18:17 +0000)]
Merge series "Support built-in Mic on Tegra boards that use WM8903" from Dmitry Osipenko <digetx@gmail.com>:

Hello,

This small series adds audio route for built-in microphone on NVIDIA Tegra
boards that use WM8903 CODEC. In particular this is needed in order to unmute
internal microphone on Acer A500 tablet device. I'm planning to send out the
device tree for the A500 for 5.8, so will be nice to get the microphone
sorted out. Please review and apply, thanks in advance.

Dmitry Osipenko (2):
  dt-bindings: sound: tegra-wm8903: Document built-in microphone audio
    source
  ASoC: tegra: tegra_wm8903: Support DAPM events for built-in microphone

 .../sound/nvidia,tegra-audio-wm8903.txt        |  1 +
 sound/soc/tegra/tegra_wm8903.c                 | 18 ++++++++++++++++++
 2 files changed, 19 insertions(+)

--
2.25.1

4 years agoASoC: rt5682: Add the descriptions for the DMIC clock rate and delay settings
Oder Chiou [Mon, 23 Mar 2020 08:25:47 +0000 (16:25 +0800)]
ASoC: rt5682: Add the descriptions for the DMIC clock rate and delay settings

The patch adds the descriptions for the DMIC clock rate and delay settings.

Signed-off-by: Oder Chiou <oder_chiou@realtek.com>
Link: https://lore.kernel.org/r/20200323082547.7898-3-oder_chiou@realtek.com
Signed-off-by: Mark Brown <broonie@kernel.org>
4 years agoASoC: rt5682: Add a property for DMIC delay
Oder Chiou [Mon, 23 Mar 2020 08:25:46 +0000 (16:25 +0800)]
ASoC: rt5682: Add a property for DMIC delay

The patch adds a property for DMIC delay (ms) to avoid pop noise and
changes the default delay setting.

Signed-off-by: Oder Chiou <oder_chiou@realtek.com>
Link: https://lore.kernel.org/r/20200323082547.7898-2-oder_chiou@realtek.com
Signed-off-by: Mark Brown <broonie@kernel.org>
4 years agoASoC: rt5682: Add a property for DMIC clock rate
Oder Chiou [Mon, 23 Mar 2020 08:25:45 +0000 (16:25 +0800)]
ASoC: rt5682: Add a property for DMIC clock rate

The patch adds a property for DMIC clock rate (hz) and changes the
default to the common optimize DMIC clock rate.

Signed-off-by: Oder Chiou <oder_chiou@realtek.com>
Link: https://lore.kernel.org/r/20200323082547.7898-1-oder_chiou@realtek.com
Signed-off-by: Mark Brown <broonie@kernel.org>
4 years agoASoC: MT6660: make spdxcheck.py happy
Lukas Bulwahn [Sat, 21 Mar 2020 11:40:22 +0000 (12:40 +0100)]
ASoC: MT6660: make spdxcheck.py happy

The SPDX-License-Identifier shall not be suffixed with anything further.
This makes ./scripts/spdxcheck.py complain:

  sound/soc/codecs/mt6660.c: 1:36 Invalid token: //

Clean up SPDX-License-Identifier line to make spdxcheck.py happy.

Signed-off-by: Lukas Bulwahn <lukas.bulwahn@gmail.com>
Link: https://lore.kernel.org/r/20200321114022.8545-1-lukas.bulwahn@gmail.com
Signed-off-by: Mark Brown <broonie@kernel.org>
4 years agoASoC: tegra-wm8903: Document built-in microphone audio source
Dmitry Osipenko [Fri, 20 Mar 2020 20:55:03 +0000 (23:55 +0300)]
ASoC: tegra-wm8903: Document built-in microphone audio source

The internal microphone source is needed in order to be able to describe
the hardware audio routing for devices that have the built-in microphone
in addition to the external Mic Jack.

Signed-off-by: Dmitry Osipenko <digetx@gmail.com>
Acked-by: Stephen Warren <swarren@nvidia.com>
Acked-by: Jon Hunter <jonathanh@nvidia.com>
Link: https://lore.kernel.org/r/20200320205504.30466-2-digetx@gmail.com
Signed-off-by: Mark Brown <broonie@kernel.org>
4 years agoASoC: tegra: tegra_wm8903: Support DAPM events for built-in microphone
Dmitry Osipenko [Fri, 20 Mar 2020 20:55:04 +0000 (23:55 +0300)]
ASoC: tegra: tegra_wm8903: Support DAPM events for built-in microphone

The enable-GPIO needs to be toggled on a DAPM event in order to turn
microphone ON/OFF, otherwise microphone won't work.

Signed-off-by: Dmitry Osipenko <digetx@gmail.com>
Acked-by: Stephen Warren <swarren@nvidia.com>
Acked-by: Jon Hunter <jonathanh@nvidia.com>
Link: https://lore.kernel.org/r/20200320205504.30466-3-digetx@gmail.com
Signed-off-by: Mark Brown <broonie@kernel.org>
4 years agoASoC: soc-core: Merge CPU/Codec for soc_dai_pcm_new()
Kuninori Morimoto [Mon, 16 Mar 2020 06:37:20 +0000 (15:37 +0900)]
ASoC: soc-core: Merge CPU/Codec for soc_dai_pcm_new()

Now CPU/Codec DAIs are alias for dais.
Thus, we can directly use for_each_rtd_dais() macro
for soc_dai_pcm_new().
This patch merge CPU/Codec for 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/87r1xsolen.wl-kuninori.morimoto.gx@renesas.com
Signed-off-by: Mark Brown <broonie@kernel.org>
4 years agoASoC: soc-pcm: Merge for_each_rtd_cpu/codec_dais()
Kuninori Morimoto [Mon, 16 Mar 2020 06:37:14 +0000 (15:37 +0900)]
ASoC: soc-pcm: Merge for_each_rtd_cpu/codec_dais()

Now we can use for_each_rtd_dais().
Let's use it instead of for_each_rtd_cpu/codec_dais().

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/87sgi8olet.wl-kuninori.morimoto.gx@renesas.com
Signed-off-by: Mark Brown <broonie@kernel.org>
4 years agoASoC: soc-dapm: Merge for_each_rtd_cpu/codec_dais()
Kuninori Morimoto [Mon, 16 Mar 2020 06:37:09 +0000 (15:37 +0900)]
ASoC: soc-dapm: Merge for_each_rtd_cpu/codec_dais()

Now we can use for_each_rtd_dais().
Let's use it instead of for_each_rtd_cpu/codec_dais().

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/87tv2ooley.wl-kuninori.morimoto.gx@renesas.com
Signed-off-by: Mark Brown <broonie@kernel.org>
4 years agoASoC: soc-core: Merge for_each_rtd_cpu/codec_dais()
Kuninori Morimoto [Mon, 16 Mar 2020 06:37:03 +0000 (15:37 +0900)]
ASoC: soc-core: Merge for_each_rtd_cpu/codec_dais()

Now we can use for_each_rtd_dais().
Let's use it instead of for_each_rtd_cpu/codec_dais().

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/87v9n4olf4.wl-kuninori.morimoto.gx@renesas.com
Signed-off-by: Mark Brown <broonie@kernel.org>
4 years agoASoC: soc-core: Merge CPU/Codec DAIs
Kuninori Morimoto [Mon, 16 Mar 2020 06:36:58 +0000 (15:36 +0900)]
ASoC: soc-core: Merge CPU/Codec DAIs

ALSA SoC is currently categorizing CPU/Codec DAIs,
and it works well.

But modern devices require more complex connections,
for example Codec to Codec, etc, and future devices will
enable to more complex connections.
Because of these background, CPU/Codec DAIs categorizing is
no longer good much to modern device.

Currently, rtd has both CPU/Codec DAIs pointer.

rtd->cpu_dais   = [][][][][][][][][]
rtd->codec_dais = [][][][][][][][][]

This patch merges these into DAIs pointer.

rtd->dais = [][][][][][][][][][][][][][][][][][]
            ^cpu_dais         ^codec_dais
            |--- num_cpus ---|--- num_codecs --|

Then, we can merge for_each_rtd_cpu/codec_dais() from this patch.

- for_each_rtd_cpu_dais() {
- ...
- }
- for_each_rtd_codec_dais() {
- ...
- }
+ for_each_rtd_dais() {
+ ...
+ }

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/87wo7kolfa.wl-kuninori.morimoto.gx@renesas.com
Signed-off-by: Mark Brown <broonie@kernel.org>
4 years agoMerge branch 'topic/ro_wordlength' of git://git.kernel.org/pub/scm/linux/kernel/git...
Mark Brown [Fri, 20 Mar 2020 15:33:01 +0000 (15:33 +0000)]
Merge branch 'topic/ro_wordlength' of git://git./linux/kernel/git/vkoul/soundwire into asoc-5.7

4 years agosoundwire: stream: Add read_only_wordlength flag to port properties
Srinivas Kandagatla [Wed, 11 Mar 2020 11:35:44 +0000 (11:35 +0000)]
soundwire: stream: Add read_only_wordlength flag to port properties

According to SoundWire Specification Version 1.2.
"A Data Port number X (in the range 0-14) which supports only one
value of WordLength may implement the WordLength field in the
DPX_BlockCtrl1 Register as Read-Only, returning the fixed value of
WordLength in response to reads."

As WSA881x interfaces in PDM mode making the only field "WordLength"
in DPX_BlockCtrl1" fixed and read-only. Behaviour of writing to this
register on WSA881x soundwire slave with Qualcomm Soundwire Controller
is throwing up an error. Not sure how other controllers deal with
writing to readonly registers, but this patch provides a way to avoid
writes to DPN_BlockCtrl1 register by providing a read_only_wordlength
flag in struct sdw_dpn_prop

Signed-off-by: Srinivas Kandagatla <srinivas.kandagatla@linaro.org>
Link: https://lore.kernel.org/r/20200311113545.23773-2-srinivas.kandagatla@linaro.org
Signed-off-by: Vinod Koul <vkoul@kernel.org>
4 years agoMerge series "ASoC: stm32: manage rebind issue" from Olivier Moysan <olivier.moysan...
Mark Brown [Wed, 18 Mar 2020 21:41:27 +0000 (21:41 +0000)]
Merge series "ASoC: stm32: manage rebind issue" from Olivier Moysan <olivier.moysan@st.com>:

This patchset corrects a rebind issue on STM32 SPDIFRX and I2S drivers.

The same correction has already been applied for SAI driver:
0d6defc7e0e4 ("ASoC: stm32: sai: manage rebind issue")

The commit e894efef9ac7 ("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.

The following problems have been seen on STM32 drivers.

1) DMA channel is not requested:

With the sound card rebind the simplified call sequence is:
    probe
        snd_soc_register_component
                snd_soc_try_rebind_card
                        snd_soc_instantiate_card
        devm_snd_dmaengine_pcm_register

The problem occurs because the pcm must be registered,
before snd_soc_instantiate_card() is called.

Modify the driver, to change the call sequence as follows:
    probe
        devm_snd_dmaengine_pcm_register
        snd_soc_register_component
                snd_soc_try_rebind_card

2) DMA channel is not released:

dma_release_channel() is not called when
devm_dmaengine_pcm_release() is executed.
This occurs because SND_DMAENGINE_PCM_DRV_NAME component,
has already been released through devm_component_release().

devm_dmaengine_pcm_release() should be called before
devm_component_release() to avoid this problem.

Call snd_dmaengine_pcm_unregister() and snd_soc_unregister_component()
explicitly from the driver, to have the right sequence.

Olivier Moysan (3):
  ASoC: stm32: spdifrx: fix regmap status check
  ASoC: stm32: spdifrx: manage rebind issue
  ASoC: stm32: i2s: manage rebind issue

 sound/soc/stm/stm32_i2s.c     | 40 ++++++++++++++++------
 sound/soc/stm/stm32_spdifrx.c | 64 +++++++++++++++++++----------------
 2 files changed, 63 insertions(+), 41 deletions(-)

--
2.17.1

4 years agoMerge series "ASoC: sdm845: fix soundwire stream handling" from Srinivas Kandagatla...
Mark Brown [Wed, 18 Mar 2020 21:41:26 +0000 (21:41 +0000)]
Merge series "ASoC: sdm845: fix soundwire stream handling" from Srinivas Kandagatla <srinivas.kandagatla@linaro.org>:

Recent addition of SoundWire stream state-machine checks in linux-next
have shown an existing issue with handling soundwire streams in codec drivers.

In general soundwire stream prepare/enable/disable can be called from either
codec/machine/controller driver. However calling it in codec driver means
that if multiple instances(Left/Right speakers) of the same codec is
connected to the same stream then it will endup calling stream
prepare/enable/disable more than once. This will mess up the stream
state-machine checks in the soundwire core.

Moving this stream handling to machine driver would fix this issue
and also allow board/platform specfic power sequencing.

Changes since v1:
- removed false error check while setting sruntime.

Srinivas Kandagatla (2):
  ASoC: qcom: sdm845: handle soundwire stream
  ASoC: codecs: wsa881x: remove soundwire stream handling

 sound/soc/codecs/wsa881x.c | 44 +------------------------
 sound/soc/qcom/Kconfig     |  2 +-
 sound/soc/qcom/sdm845.c    | 67 ++++++++++++++++++++++++++++++++++++++
 3 files changed, 69 insertions(+), 44 deletions(-)

--
2.21.0

4 years agoASoC: rt5682: remove noisy debug messages
Shuming Fan [Tue, 17 Mar 2020 07:33:21 +0000 (15:33 +0800)]
ASoC: rt5682: remove noisy debug messages

Some debug messages are too noisy.
This patch removes it.

Signed-off-by: Shuming Fan <shumingf@realtek.com>
Link: https://lore.kernel.org/r/20200317073321.12660-1-shumingf@realtek.com
Signed-off-by: Mark Brown <broonie@kernel.org>
4 years agoASoC: qcom: sdm845: handle soundwire stream
Srinivas Kandagatla [Tue, 17 Mar 2020 15:12:32 +0000 (15:12 +0000)]
ASoC: qcom: sdm845: handle soundwire stream

In existing setup WSA881x codec handles soundwire stream,
however DB845c and other machines based on SDM845c have 2
instances for WSA881x codec. This will force soundwire stream
to be prepared/enabled twice or multiple times.
Handling SoundWire Stream in machine driver would fix this issue.

Signed-off-by: Srinivas Kandagatla <srinivas.kandagatla@linaro.org>
Reviewed-by: Pierre-Louis Bossart <pierre-louis.bossart@linux.intel.com>
Link: https://lore.kernel.org/r/20200317151233.8763-2-srinivas.kandagatla@linaro.org
Signed-off-by: Mark Brown <broonie@kernel.org>
4 years agoASoC: codecs: wsa881x: remove soundwire stream handling
Srinivas Kandagatla [Tue, 17 Mar 2020 15:12:33 +0000 (15:12 +0000)]
ASoC: codecs: wsa881x: remove soundwire stream handling

There could be multiple instances of this codec on any platform,
so handling stream directly in this codec driver can lead to
multiple calls to prepare/enable/disable on the same SoundWire stream.
Move this stream handling to machine driver to fix this issue.

Signed-off-by: Srinivas Kandagatla <srinivas.kandagatla@linaro.org>
Link: https://lore.kernel.org/r/20200317151233.8763-3-srinivas.kandagatla@linaro.org
Signed-off-by: Mark Brown <broonie@kernel.org>
4 years agoASoC: stm32: i2s: manage rebind issue
Olivier Moysan [Wed, 18 Mar 2020 14:41:25 +0000 (15:41 +0100)]
ASoC: stm32: i2s: manage rebind issue

The commit e894efef9ac7 ("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>
4 years agoASoC: stm32: spdifrx: manage rebind issue
Olivier Moysan [Wed, 18 Mar 2020 14:41:24 +0000 (15:41 +0100)]
ASoC: stm32: spdifrx: manage rebind issue

The commit e894efef9ac7 ("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>
4 years agoMerge series "ALSA: compress: Add wma, alac and ape support" from Vinod Koul <vkoul...
Mark Brown [Mon, 16 Mar 2020 18:07:42 +0000 (18:07 +0000)]
Merge series "ALSA: compress: Add wma, alac and ape support" from Vinod Koul <vkoul@>:

This series adds more WMA profiles and WMA decoder parameters to UAPI and
then support for these in qcom driver. It also adds FLAC and APE IDs and
decoder parameters to UAPI and then support in qcom driver

This was tested on Dragon board RB3.

Last, bump up the compressed version so that userspace can check for the
support.

Since the series touches compress uapi and asoc, it would make sense to go
thru asoc tree with acks.

Changes in v3:
 - add r-b from Srini
 - use macros for FLAC channel layout tags

Changes in v2:
 - use bitflags for wma profiles

Vinod Koul (9):
  ALSA: compress: add wma codec profiles
  ALSA: compress: Add wma decoder params
  ASoC: qcom: q6asm: pass codec profile to q6asm_open_write
  ASoC: qcom: q6asm: add support to wma config
  ASoC: qcom: q6asm-dai: add support to wma decoder
  ALSA: compress: add alac & ape decoder params
  ASoC: qcom: q6asm: add support for alac and ape configs
  ASoC: qcom: q6asm-dai: add support for ALAC and APE decoders
  ALSA: compress: bump the version

 include/uapi/sound/compress_offload.h |   2 +-
 include/uapi/sound/compress_params.h  |  37 +++-
 sound/soc/qcom/qdsp6/q6asm-dai.c      | 139 ++++++++++++++-
 sound/soc/qcom/qdsp6/q6asm.c          | 243 +++++++++++++++++++++++++-
 sound/soc/qcom/qdsp6/q6asm.h          |  51 +++++-
 5 files changed, 465 insertions(+), 7 deletions(-)

--
2.24.1

4 years agoASoC: soc-dai: return proper error for get_sdw_stream()
Srinivas Kandagatla [Mon, 16 Mar 2020 15:11:10 +0000 (15:11 +0000)]
ASoC: soc-dai: return proper error for get_sdw_stream()

snd_soc_dai_get_sdw_stream() returns null if dai does not support
this callback, this is no very useful for the caller to
differentiate if this is an error or unsupported call for the dai.

return -ENOTSUPP in cases where this callback is not supported.

Signed-off-by: Srinivas Kandagatla <srinivas.kandagatla@linaro.org>
Link: https://lore.kernel.org/r/20200316151110.2580-1-srinivas.kandagatla@linaro.org
Signed-off-by: Mark Brown <broonie@kernel.org>
4 years agoALSA: compress: bump the version
Vinod Koul [Mon, 16 Mar 2020 05:52:21 +0000 (11:22 +0530)]
ALSA: compress: bump the version

We have added support for bunch of new decoders and parameters for
decoders. To help users find the support bump the version up to 0,2,0.

Signed-off-by: Vinod Koul <vkoul@kernel.org>
Reviewed-by: Takashi Iwai <tiwai@suse.de>
Link: https://lore.kernel.org/r/20200316055221.1944464-10-vkoul@kernel.org
Signed-off-by: Mark Brown <broonie@kernel.org>
4 years agoASoC: qcom: q6asm-dai: add support for ALAC and APE decoders
Vinod Koul [Mon, 16 Mar 2020 05:52:20 +0000 (11:22 +0530)]
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>
4 years agoASoC: qcom: q6asm: add support for alac and ape configs
Vinod Koul [Mon, 16 Mar 2020 05:52:19 +0000 (11:22 +0530)]
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>
4 years agoALSA: compress: add alac & ape decoder params
Vinod Koul [Mon, 16 Mar 2020 05:52:18 +0000 (11:22 +0530)]
ALSA: compress: add alac & ape decoder params

Add ALAC (Apple Lossless Audio Codec) and APE (Monkey's Lossless Audio
Codec) defines and parameters required to configure these.

Signed-off-by: Vinod Koul <vkoul@kernel.org>
Reviewed-by: Takashi Iwai <tiwai@suse.de>
Link: https://lore.kernel.org/r/20200316055221.1944464-7-vkoul@kernel.org
Signed-off-by: Mark Brown <broonie@kernel.org>
4 years agoASoC: qcom: q6asm-dai: add support to wma decoder
Vinod Koul [Mon, 16 Mar 2020 05:52:17 +0000 (11:22 +0530)]
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>
4 years agoASoC: qcom: q6asm: add support to wma config
Vinod Koul [Mon, 16 Mar 2020 05:52:16 +0000 (11:22 +0530)]
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>
4 years agoASoC: qcom: q6asm: pass codec profile to q6asm_open_write
Vinod Koul [Mon, 16 Mar 2020 05:52:15 +0000 (11:22 +0530)]
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>
4 years agoALSA: compress: Add wma decoder params
Vinod Koul [Mon, 16 Mar 2020 05:52:14 +0000 (11:22 +0530)]
ALSA: compress: Add wma decoder params

Some WMA decoders like WMAv10 etc need some additional encoder option
parameters, so add these as WMA decoder params.

Signed-off-by: Vinod Koul <vkoul@kernel.org>
Reviewed-by: Takashi Iwai <tiwai@suse.de>
Link: https://lore.kernel.org/r/20200316055221.1944464-3-vkoul@kernel.org
Signed-off-by: Mark Brown <broonie@kernel.org>
4 years agoALSA: compress: add wma codec profiles
Vinod Koul [Mon, 16 Mar 2020 05:52:13 +0000 (11:22 +0530)]
ALSA: compress: add wma codec profiles

Some codec profiles were missing for WMA, like WMA9/10 lossless and
wma10 pro, so add these profiles

Signed-off-by: Vinod Koul <vkoul@kernel.org>
Reviewed-by: Takashi Iwai <tiwai@suse.de>
Link: https://lore.kernel.org/r/20200316055221.1944464-2-vkoul@kernel.org
Signed-off-by: Mark Brown <broonie@kernel.org>
4 years agoMerge branch 'for-5.6' of https://git.kernel.org/pub/scm/linux/kernel/git/broonie...
Mark Brown [Fri, 13 Mar 2020 18:52:23 +0000 (18:52 +0000)]
Merge branch 'for-5.6' of https://git./linux/kernel/git/broonie/sound into asoc-5.7

4 years agoASoC: max98357a: Add ACPI HID MAX98360A
Yong Zhi [Fri, 13 Mar 2020 15:55:26 +0000 (10:55 -0500)]
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>
4 years agoMerge series "ASoC: SOF: multi-cpu dais, IPC and Intel improvements for 5.7" from...
Mark Brown [Fri, 13 Mar 2020 16:17:01 +0000 (16:17 +0000)]
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: 101247a3b86e1cc0e382b7e887a56176290fc957
--
2.20.1

4 years agoMerge series "ASoC: Intel: machine driver updates for 5.7" from Pierre-Louis Bossart...
Mark Brown [Fri, 13 Mar 2020 16:17:00 +0000 (16:17 +0000)]
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: 101247a3b86e1cc0e382b7e887a56176290fc957
--
2.20.1

4 years agoMerge series "ASoC: brcm: add dsl and pon chip audio driver" from Kevin Li <kevin...
Mark Brown [Fri, 13 Mar 2020 16:16:59 +0000 (16:16 +0000)]
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

4 years agoASoC: rt5682: Fine tune the HP performance in soundwire mode
Oder Chiou [Fri, 13 Mar 2020 02:38:49 +0000 (10:38 +0800)]
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>
4 years agoASoC: brcm: DSL/PON SoC device tree bindings of audio driver
Kevin Li [Thu, 12 Mar 2020 22:32:40 +0000 (15:32 -0700)]
ASoC: brcm: DSL/PON SoC device tree bindings of audio driver

Signed-off-by: Kevin Li <kevin-ke.li@broadcom.com>
Link: https://lore.kernel.org/r/20200312223242.2843-1-kevin-ke.li@broadcom.com
Signed-off-by: Mark Brown <broonie@kernel.org>
4 years agoASoC: brcm: Add DSL/PON SoC audio driver
Kevin Li [Thu, 12 Mar 2020 22:32:41 +0000 (15:32 -0700)]
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>
4 years agoASoC: Intel: don't use GFP_ATOMIC for machine driver contexts
Pierre-Louis Bossart [Thu, 12 Mar 2020 19:48:59 +0000 (14:48 -0500)]
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>
4 years agoASoC: Intel: sof_rt5682: Add rt1015 speaker amp support
Yong Zhi [Thu, 12 Mar 2020 19:48:58 +0000 (14:48 -0500)]
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>
4 years agoASoC: Intel: sof_da7219_max98373: Add support for max98360a speaker amp
Yong Zhi [Thu, 12 Mar 2020 19:48:57 +0000 (14:48 -0500)]
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>
4 years agoASoC: Intel: (cosmetic) simplify structure member access
Guennadi Liakhovetski [Thu, 12 Mar 2020 19:48:56 +0000 (14:48 -0500)]
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>
4 years agoASoC: Intel: skylake: (cosmetic) remove redundant variable initialisations
Guennadi Liakhovetski [Thu, 12 Mar 2020 19:48:55 +0000 (14:48 -0500)]
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>
4 years agoASoC: codecs: hdac_hdmi: (cosmetic) remove redundant variable initialisations
Guennadi Liakhovetski [Thu, 12 Mar 2020 19:48:54 +0000 (14:48 -0500)]
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>
4 years agoASoC: SOF: Intel: hda: remove SND_SOC_SOF_HDA_COMMON_HDMI_CODEC
Kai Vehmanen [Thu, 12 Mar 2020 19:48:53 +0000 (14:48 -0500)]
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 139c7febad1a ("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>
4 years agoASoC: Intel: sof_pcm512x: make HDMI optional for all platforms
Kai Vehmanen [Thu, 12 Mar 2020 19:48:52 +0000 (14:48 -0500)]
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>
4 years agoASoC: Intel: sof_pcm512x: drop reverse deps for SND_HDA_CODEC_HDMI
Kai Vehmanen [Thu, 12 Mar 2020 19:48:51 +0000 (14:48 -0500)]
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>
4 years agoASoC: Intel: boards: drop reverse deps for SND_HDA_CODEC_HDMI
Kai Vehmanen [Thu, 12 Mar 2020 19:48:50 +0000 (14:48 -0500)]
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>
4 years agoASoC: SOF: topology: connect dai widget to all cpu-dais
Bard Liao [Thu, 12 Mar 2020 20:06:22 +0000 (15:06 -0500)]
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>
4 years agoASoC: SOF: Intel: remove unnecessary waitq before loading firmware
Amery Song [Thu, 12 Mar 2020 20:06:21 +0000 (15:06 -0500)]
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>
4 years agoASoC: SOF: Intel: hda: remove unnecessary ROM IPC filter function
Amery Song [Thu, 12 Mar 2020 20:06:20 +0000 (15:06 -0500)]
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>
4 years agoASoC: SOF: Remove SOF_IPC_EXT_DMA_BUFFER
Karol Trzcinski [Thu, 12 Mar 2020 20:06:19 +0000 (15:06 -0500)]
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>
4 years agoASoC: SOF: Make sof_ipc_ext_data enum more rigid
Karol Trzcinski [Thu, 12 Mar 2020 20:06:18 +0000 (15:06 -0500)]
ASoC: SOF: Make sof_ipc_ext_data enum more rigid

It's a part of ABI interface, so enum value shouldn't change
for example after removing some old enum code.

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-3-pierre-louis.bossart@linux.intel.com
Signed-off-by: Mark Brown <broonie@kernel.org>
4 years agoASoC: SOF: Intel: hda-dai: add stream capability
Bard Liao [Thu, 12 Mar 2020 20:06:17 +0000 (15:06 -0500)]
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>
4 years agoASoC: rt5682: Revise the DAC1 volume setting
Oder Chiou [Fri, 13 Mar 2020 02:38:50 +0000 (10:38 +0800)]
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>
4 years agoASoC: wm_adsp: Use scnprintf() for the limited buffer output
Takashi Iwai [Fri, 13 Mar 2020 13:03:34 +0000 (14:03 +0100)]
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>
4 years agoASoC: topology: Perform component check upfront
Amadeusz Sławiński [Thu, 12 Mar 2020 12:22:39 +0000 (08:22 -0400)]
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>
4 years agoMerge series "ASoC: SOF: preparatory patches" from Guennadi Liakhovetski <guennadi...
Mark Brown [Thu, 12 Mar 2020 13:46:04 +0000 (13:46 +0000)]
Merge series "ASoC: SOF: preparatory patches" from Guennadi Liakhovetski <guennadi.liakhovetski@linux.intel.com>:

2 preparatory patches for the SOF virtualisation work. No functional
changes, only some code refactoring and exporting of helper functions.

v2: rebase, no changes otherwise.

Thanks
Guennadi

Guennadi Liakhovetski (2):
  ASoC: (cosmetic) simplify dpcm_prune_paths()
  ASoC: export DPCM runtime update functions

 include/sound/soc-dpcm.h |  4 +--
 sound/soc/soc-dapm.c     |  8 +++---
 sound/soc/soc-pcm.c      | 68 +++++++++++++++++++++++++-----------------------
 3 files changed, 42 insertions(+), 38 deletions(-)

--
1.9.3

4 years agoASoC: dt-bindings: google, cros-ec-codec: Fix dtc warnings in example
Rob Herring [Wed, 11 Mar 2020 20:58:41 +0000 (15:58 -0500)]
ASoC: dt-bindings: google, cros-ec-codec: Fix dtc warnings in example

Extra dtc warnings (roughly what W=1 enables) are now enabled by default
when building the binding examples. These were fixed treewide in
5.6-rc5, but the newly added google,cros-ec-codec schema adds some new
warnings:

Documentation/devicetree/bindings/sound/google,cros-ec-codec.example.dts:17.28-21.11:
Warning (unit_address_vs_reg): /example-0/reserved_mem: node has a reg or ranges property, but no unit name
Documentation/devicetree/bindings/sound/google,cros-ec-codec.example.dts:22.19-32.11:
Warning (unit_address_vs_reg): /example-0/cros-ec@0: node has a unit name, but no reg property
Documentation/devicetree/bindings/sound/google,cros-ec-codec.example.dts:26.37-31.15:
Warning (unit_address_vs_reg): /example-0/cros-ec@0/ec-codec: node has a reg or ranges property, but no unit name

Fixing the above, then results in:

Documentation/devicetree/bindings/sound/google,cros-ec-codec.example.dts:26.13-23:
Warning (reg_format): /example-0/cros-ec@0:reg: property has invalid length (4 bytes) (#address-cells == 1, #size-cells == 1)
Documentation/devicetree/bindings/sound/google,cros-ec-codec.example.dts:27.37-32.15:
Warning (unit_address_vs_reg): /example-0/cros-ec@0/ec-codec: node has a reg or ranges property, but no unit name

Fixes: eadd54c75f1e ("dt-bindings: Convert the binding file google, cros-ec-codec.txt to yaml format.")
Signed-off-by: Rob Herring <robh@kernel.org>
Reviewed-by: Enric Balletbo i Serra <enric.balletbo@collabora.com>
Cc: alsa-devel@alsa-project.org
Cc: Benson Leung <bleung@chromium.org>
Cc: Mark Brown <broonie@kernel.org>
Cc: Liam Girdwood <lgirdwood@gmail.com>
Cc: Guenter Roeck <groeck@chromium.org>
Cc: Enric Balletbo i Serra <enric.balletbo@collabora.com>
Cc: Cheng-Yi Chiang <cychiang@chromium.org>
Link: https://lore.kernel.org/r/20200311205841.2710-1-robh@kernel.org
Signed-off-by: Mark Brown <broonie@kernel.org>
4 years agoASoC: export DPCM runtime update functions
Guennadi Liakhovetski [Thu, 12 Mar 2020 09:52:14 +0000 (10:52 +0100)]
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>
4 years agoASoC: (cosmetic) simplify dpcm_prune_paths()
Guennadi Liakhovetski [Thu, 12 Mar 2020 09:52:13 +0000 (10:52 +0100)]
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>
4 years agoMerge series "ASoC: qdsp6: fix default FE dais and routings." from Srinivas Kandagatl...
Mark Brown [Thu, 12 Mar 2020 13:12:36 +0000 (13:12 +0000)]
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

4 years agoASoC: SOF: Intel: Fix stream cleanup on hw free
Cezary Rojewski [Thu, 12 Mar 2020 12:00:58 +0000 (13:00 +0100)]
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: cdae3b9a47aa ("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>
4 years agoMAINTAINERS: Update Cirrus Logic codec driver maintainers
James Schulman [Tue, 10 Mar 2020 19:27:51 +0000 (14:27 -0500)]
MAINTAINERS: Update Cirrus Logic codec driver maintainers

Brian & Paul are no longer active audio codec driver
maintainers. Update list to reflect myself and David
Rhodes as the active maintainers.

Signed-off-by: James Schulman <james.schulman@cirrus.com>
Link: https://lore.kernel.org/r/20200310192751.24487-1-james.schulman@cirrus.com
Signed-off-by: Mark Brown <broonie@kernel.org>
4 years agoMAINTAINERS: add entry for Sound Open Firmware drivers
Kai Vehmanen [Wed, 11 Mar 2020 17:45:37 +0000 (19:45 +0200)]
MAINTAINERS: add entry for Sound Open Firmware drivers

Sound Open Firmware (SOF) is an open source audio DSP firwmare
instrastructure and SDK. The kernel drivers for SOF are part of
the ALSA subsystem.

Signed-off-by: Kai Vehmanen <kai.vehmanen@linux.intel.com>
Acked-by: Ranjani Sridharan <ranjani.sridharan@linux.intel.com>
Acked-by: Liam Girdwood <liam.r.girdwood@linux.intel.com>
Acked-by: Daniel Baluta <daniel.baluta@nxp.com>
Acked-by: Pierre-Louis Bossart <pierre-louis.bossart@linux.intel.com>
Link: https://lore.kernel.org/r/20200311174537.24497-1-kai.vehmanen@linux.intel.com
Signed-off-by: Mark Brown <broonie@kernel.org>
4 years agoASoC: qdsp6: q6routing: remove default routing
Srinivas Kandagatla [Wed, 11 Mar 2020 18:04:22 +0000 (18:04 +0000)]
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>
4 years agoASoC: qdsp6: q6asm-dai: only enable dais from device tree
Srinivas Kandagatla [Wed, 11 Mar 2020 18:04:21 +0000 (18:04 +0000)]
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>
4 years agoMerge tag 'v5.6-rc5' into asoc-5.7
Mark Brown [Wed, 11 Mar 2020 18:45:26 +0000 (18:45 +0000)]
Merge tag 'v5.6-rc5' into asoc-5.7

Linux 5.6-rc5

4 years agoASoC: dt-bindings: stm32: convert spdfirx to json-schema
Olivier Moysan [Fri, 17 Jan 2020 17:03:52 +0000 (18:03 +0100)]
ASoC: dt-bindings: stm32: convert spdfirx to json-schema

Convert the STM32 SPDIFRX bindings to DT schema format using json-schema.

Signed-off-by: Olivier Moysan <olivier.moysan@st.com>
Reviewed-by: Rob Herring <robh@kernel.org>
Link: https://lore.kernel.org/r/20200117170352.16040-1-olivier.moysan@st.com
Signed-off-by: Mark Brown <broonie@kernel.org>
4 years agoASoC: zte: zx-tdm: remove redundant variables dev
tangbin [Wed, 11 Mar 2020 14:46:46 +0000 (22:46 +0800)]
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>
4 years agoASoC: Convert cirrus,cs42l51 to json-schema
Benjamin Gaignard [Fri, 28 Feb 2020 15:27:06 +0000 (16:27 +0100)]
ASoC: Convert cirrus,cs42l51 to json-schema

Convert cirrus,cs42l51 to yaml format.

Signed-off-by: Benjamin Gaignard <benjamin.gaignard@st.com>
Reviewed-by: Rob Herring <robh@kernel.org>
Link: https://lore.kernel.org/r/20200228152706.29749-1-benjamin.gaignard@st.com
Signed-off-by: Mark Brown <broonie@kernel.org>
4 years agoMerge series "ASoC: rt5682: fix Kconfig/compilation issues when I2C is not selected...
Mark Brown [Tue, 10 Mar 2020 18:19:02 +0000 (18:19 +0000)]
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

4 years agoASoC: pcm: Fix (again) possible buffer overflow in dpcm state sysfs output
Takashi Iwai [Tue, 10 Mar 2020 16:36:25 +0000 (17:36 +0100)]
ASoC: pcm: Fix (again) possible buffer overflow in dpcm state sysfs output

This is re-applying the fix that went into 5.6 (commit 6c89ffea60aa)
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>
4 years agoASoC: rt5682-sdw: fix 'defined but not used' pm functions
Pierre-Louis Bossart [Tue, 10 Mar 2020 16:35:09 +0000 (11:35 -0500)]
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: 03f6fc6de9192f ('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>