Commit Graph

783831 Commits

Author SHA1 Message Date
Liam Girdwood
efefbc60f7 ASoC: SOF: Add Nocodec machine driver support
Add a simple "fallback" machine driver that can be used to enable SOF
on boards with no codec device. This machine driver can also be forced
for debug/development.

Signed-off-by: Liam Girdwood <liam.r.girdwood@linux.intel.com>
2018-11-01 11:11:18 -05:00
Liam Girdwood
e25bc7a982 ASoC: SOF: Add PM support
Add support for saving and restoring DSP context in D3 to host DDR.

The suspend callback includes: suspend all pcm's stream that are running,
send CTX_SAVE ipc, drop all ipc's, release trace dma and then
power off the DSP.

And the resume callback performs the following steps: load FW, run FW,
re-initialize trace, restore pipeline, restore the kcontrol values
and finally send the ctx restore ipc to the dsp.

The streams that are suspended are resumed by the ALSA resume trigger.
If the streams are paused during system suspend, they are marked
explicitly so they can be restored during PAUSE_RELEASE.

Signed-off-by: Liam Girdwood <liam.r.girdwood@linux.intel.com>
2018-11-01 11:11:18 -05:00
Liam Girdwood
eb424f5cec ASoC: SOF: Add compressed PCM support
Add support for compressed audio playback/capture in SOF.

TODO: to be completed.

Signed-off-by: Liam Girdwood <liam.r.girdwood@linux.intel.com>
2018-11-01 11:11:18 -05:00
Liam Girdwood
589be0fd53 ASoC: SOF: Add userspace ABI support
Add userspace ABI for audio userspace application IO outside of regular
ALSA PCM and kcontrols. This is intended to be used to format
coefficients and data for custom processing components.

Signed-off-by: Liam Girdwood <liam.r.girdwood@linux.intel.com>
2018-11-01 11:11:18 -05:00
Liam Girdwood
9a02526442 ASoC: SOF: Add firmware loader support
The firmware loader exports APIs that can be called by core to load and
process multiple different file formats.

Signed-off-by: Liam Girdwood <liam.r.girdwood@linux.intel.com>
2018-11-01 11:11:18 -05:00
Liam Girdwood
1d7c0b3795 ASoC: SOF: Add DSP HW abstraction operations
Add operation pointers that can be called by core to control a wide
variety of DSP targets. The DSP HW drivers will fill in these
operations.

Signed-off-by: Liam Girdwood <liam.r.girdwood@linux.intel.com>
2018-11-01 11:11:18 -05:00
Liam Girdwood
d587d74726 ASoC: SOF: Add DSP firmware trace event support
Add a trace event buffer that can be used by userspace to read DSP runtime
trace events alongside bespoke trace data in realtime for firmware debug.

Signed-off-by: Liam Girdwood <liam.r.girdwood@linux.intel.com>
2018-11-01 11:11:18 -05:00
Liam Girdwood
734a80fbb3 ASoC: SOF: Add support for loading topologies
SOF uses topology to define the DAPM graphs and widgets, DAIs, PCMs and set
parameters for init and run time usage. This patch loads topology and
maps it to IPC commands that are build the topology on the DSP.

Signed-off-by: Liam Girdwood <liam.r.girdwood@linux.intel.com>
2018-11-01 11:11:18 -05:00
Liam Girdwood
3f3a20f425 ASoC: SOF: Add PCM operations support
Add support for exposing PCMs to userspace. PCMs are defined by topology
and the operations in this patch map to SOF IPC calls.

Signed-off-by: Liam Girdwood <liam.r.girdwood@linux.intel.com>
2018-11-01 11:11:18 -05:00
Liam Girdwood
8f3b2f0dac ASoC: SOF: Add support for IPC IO between DSP and Host
Define an IPC ABI for all host <--> DSP communication. This ABI should
be transport agnostic. i.e. it should work on MMIO and SPI/I2C style
interfaces.

Signed-off-by: Liam Girdwood <liam.r.girdwood@linux.intel.com>
2018-11-01 11:11:18 -05:00
Liam Girdwood
1926564de3 ASoC: SOF: Add driver debug support.
Add debugFS files that can be used to expose DSP memories and
and peripherals to userspace to assist with firmware debugging.

Signed-off-by: Liam Girdwood <liam.r.girdwood@linux.intel.com>
2018-11-01 11:11:18 -05:00
Liam Girdwood
d9e001df59 ASoC: SOF: Add Sound Open Firmware KControl support
SOF exposes regular ALSA Kcontrols that are defined by topology. This
patch converts the Kcontrol IO to DSP IPC.

Signed-off-by: Liam Girdwood <liam.r.girdwood@linux.intel.com>
2018-11-01 11:11:18 -05:00
Liam Girdwood
cd1ab393f0 ASoC: SOF: Add Sound Open Firmware driver core
The Sound Open Firmware driver core is a generic architecture
independent layer that allows SOF to be used on many different different
architectures and platforms. It abstracts DSP operations and IO methods
so that the target DSP can be an internal memory mapped or external SPI
or I2C based device. This abstraction also allows SOF to be run on
many different VMs on the same physical HW.

SOF also requires some data in ASoC PCM runtime data for looking up
SOF data during ASoC PCM operations.

Signed-off-by: Liam Girdwood <liam.r.girdwood@linux.intel.com>
2018-11-01 11:11:18 -05:00
Guennadi Liakhovetski
0576373494 soc: fix a use after free case
Unloading ASoC modules as used by the SOF driver leads to an object
being used after it's been freed. Fix this be clearing a reference to
it and making sure to check for its presence. This fixes issue #144.

Signed-off-by: Guennadi Liakhovetski <guennadi.liakhovetski@intel.com>
2018-11-01 11:11:18 -05:00
Wu Zhigang
5711d8e9d7 ASoC:topology:bug fix:check return value avoid oops.
check the return value to free the kcontrols instance
to avoid oops caused by the pointer dereference.

Signed-off-by: Wu Zhigang <zhigang.wu@linux.intel.com>
[guennadi.liakhovetski@intel.com add handling of .autodisable=1 cases]
2018-11-01 11:11:18 -05:00
Wu Zhigang
d28e9af0a5 ASoC:topology:delete dynamic object during widget remove
remove the dynamic object during the topology free stage.
to avoid multi remove operation.

Signed-off-by: Wu Zhigang <zhigang.wu@linux.intel.com>
2018-11-01 11:11:17 -05:00
Wu Zhigang
4c10c44636 ASoC:core:bug fix: oops caused by pointer dereference.
oops case:
the snd_card{} would be freed ahead of dynamic kcontrol
remove process, in this process, the snd_card{} will be
used, then the oops will be hit.

the solution:
the operation of removing the dynamic kcontrol should
be ahead of snd_card{} free.

Signed-off-by: Wu Zhigang <zhigang.wu@linux.intel.com>
2018-11-01 11:11:17 -05:00
Seppo Ingalsuo
a2b54ab25a ASoC: dapm: fix kcontrols for effect widgets
This patch adds the handling of snd_soc_dapm_effect that was missing.

Signed-off-by: Ranjani Sridharan <ranjani.sridharan@linux.intel.com>
Signed-off-by: Seppo Ingalsuo <seppo.ingalsuo@linux.intel.com>
2018-11-01 11:11:17 -05:00
Keyon Jie
95eedaa607 ALSA: HDA: export process_unsol_events() which can be used without
hdac_bus library.

In some cases, we want to initialize hda bus without this hdac_bus
library(e.g. for non-HDA I2S only usuage on Intel Skylake+ platforms),
where we will do hdac bus non-HDA-only implementation in BSD license.

When we want to add hda link support(GPL) in this implementation, we
need reuse this process_unsol_events(), so export it is better solution
comparing to implement it again.

Signed-off-by: Keyon Jie <yang.jie@linux.intel.com>
2018-11-01 11:11:17 -05:00
Bard liao
4185428b8c ASoC: Intel: common: add SOF information for APL RVP
Add firmware/topology information for APL RVP

Signed-off-by: Bard liao <bard.liao@intel.com>
2018-11-01 11:11:17 -05:00
Pierre-Louis Bossart
c2754ce91e ASoC: core: support driver alias names for FE topology overrides
When the same machine driver is reused between platforms but with a
different alias, using the driver name is not enough. Add additional
fallback case to use the card device name.

Tested on GeminiLake with bxt_da7219_max98357a machine driver

Signed-off-by: Pierre-Louis Bossart <pierre-louis.bossart@linux.intel.com>
2018-11-01 11:11:17 -05:00
Pierre-Louis Bossart
e7b326c20e ASoC: Intel: common: add ACPI match for CannonLake
MX98373 is used on some CNL boards

Signed-off-by: Pierre-Louis Bossart <pierre-louis.bossart@linux.intel.com>
2018-11-01 11:11:17 -05:00
Pierre-Louis Bossart
61302c063a ASoC: Intel: common: add ACPI matching tables for ICL
Signed-off-by: Pierre-Louis Bossart <pierre-louis.bossart@linux.intel.com>
2018-11-01 11:11:17 -05:00
Pierre-Louis Bossart
eabf5644c0 ASoC: fix oops w/ for_each_rtd_codec_dai_rollback() macro
A kernel oops happens on an error case (usual missing BE mixer
configuration required by Intel SST driver). Git bisect points to this
macro and an operator precedence issue.

	for (; ((i--) >= 0) && ((dai) = rtd->codec_dais[i]);)

The initial code replaced by this macro was
	while (--i >= 0) {
		codec_dai = rtd->codec_dais[i];

Fix the C operator precedence difference by reverting to pre-decrement

Fixes: 0b7990e389 ('ASoC: add for_each_rtd_codec_dai() macro')
Cc: Kuninori Morimoto <kuninori.morimoto.gx@renesas.com>
Signed-off-by: Pierre-Louis Bossart <pierre-louis.bossart@linux.intel.com>
Signed-off-by: Mark Brown <broonie@kernel.org>
(cherry picked from commit 23cb2d04db)
2018-11-01 10:15:34 -05:00
Marcel Ziswiler
f6c174d0d3 ASoC: soc-core: fix trivial checkpatch issues
Fix a few trivial aka cosmetic only checkpatch issues like long lines,
wrong indentations, spurious blanks and newlines, missing newlines,
multi-line comments etc.

Signed-off-by: Marcel Ziswiler <marcel.ziswiler@toradex.com>
Signed-off-by: Mark Brown <broonie@kernel.org>
(cherry picked from commit 2c7b696a75)
2018-10-31 10:57:17 -05:00
Charles Keepax
ec4c1f531b ASoC: dapm: Add support for hw_free on CODEC to CODEC links
Currently, on power down for a CODEC to CODEC DAI link we only call
digital_mute and shutdown. Provide a little more flexibility for drivers
by adding a call to hw_free as well.

Signed-off-by: Charles Keepax <ckeepax@opensource.cirrus.com>
Signed-off-by: Mark Brown <broonie@kernel.org>
(cherry picked from commit 3c01b0e129)
2018-10-31 10:57:17 -05:00
Dan Carpenter
c161474356 ASoC: Intel: kbl_da7219_max98927: minor white space clean up
I just added a couple missing tabs.

Signed-off-by: Dan Carpenter <dan.carpenter@oracle.com>
Signed-off-by: Mark Brown <broonie@kernel.org>
(cherry picked from commit 9ab2a1bd81)
2018-10-31 10:57:17 -05:00
Christoph Hellwig
1846be9804 ASoC: intel: don't pass GFP_DMA32 to dma_alloc_coherent
The DMA API does its own zone decisions based on the coherent_dma_mask.

Signed-off-by: Christoph Hellwig <hch@lst.de>
Reviewed-by: Takashi Iwai <tiwai@suse.de>
Signed-off-by: Mark Brown <broonie@kernel.org>
(cherry picked from commit 3b99103849)
2018-10-31 10:57:17 -05:00
Mac Chiang
92bdae060d ASoC: Intel: common: Add Kabylake Dialog+Maxim machine driver entry
This patch adds da7219_max98927 machine driver entry into
machine table

Signed-off-by: Mac Chiang <mac.chiang@intel.com>
Signed-off-by: Mark Brown <broonie@kernel.org>
(cherry picked from commit 6530adeaaf)
2018-10-31 10:57:17 -05:00
Mac Chiang
aadc9c0aea ASoC: Intel: Boards: Add KBL Dialog Maxim I2S machine driver
This patch adds Kabylake I2S machine driver with:
DA7219 audio codec(SSP1) and MAXIM98927(SSP0) speaker amplifier.

Signed-off-by: Mac Chiang <mac.chiang@intel.com>
Signed-off-by: Mark Brown <broonie@kernel.org>
(cherry picked from commit bca0ac1d96)
2018-10-31 10:57:17 -05:00
Ryan Lee
43501cd993 ASoC: max98373: Sort DHT Rot Pnt Volume in reverse order
Signed-off-by: Ryan Lee <ryans.lee@maximintegrated.com>
Signed-off-by: Mark Brown <broonie@kernel.org>
(cherry picked from commit a23f5dc844)
2018-10-31 10:57:17 -05:00
Ryan Lee
709f781924 ASoC: max98373: Sort max98373_bde_gain_tlv in reverse order
Signed-off-by: Ryan Lee <ryans.lee@maximintegrated.com>
Signed-off-by: Mark Brown <broonie@kernel.org>
(cherry picked from commit d34c8f37c7)
2018-10-31 10:57:17 -05:00
Ryan Lee
1408fe9caa ASoC: max98373: Sort BDE Limiter Thresh Volume in reverse order
Signed-off-by: Ryan Lee <ryans.lee@maximintegrated.com>
Signed-off-by: Mark Brown <broonie@kernel.org>
(cherry picked from commit 6c3beeca42)
2018-10-31 10:57:17 -05:00
Ryan Lee
c5c720a082 ASoC: max98373: Sort Digital Volume in reverse order
Signed-off-by: Ryan Lee <ryans.lee@maximintegrated.com>
Signed-off-by: Mark Brown <broonie@kernel.org>
(cherry picked from commit 4cbbc91609)
2018-10-31 10:57:17 -05:00
Andreas Färber
14d1ad367b ASoC: max98088: Add master clock handling
If master clock is provided through device tree, then update
the master clock frequency during set_sysclk.

Cc: Tushar Behera <tushar.behera@linaro.org>
Signed-off-by: Andreas Färber <afaerber@suse.de>
Acked-by: Tushar Behera <trblinux@gmail.com>
Reviewed-by: Javier Martinez Canillas <javier.martinez@collabora.co.uk>
[m.felsch@pengutronix.de: move mclk request to i2c_probe]
[m.felsch@pengutronix.de: make use of snd_soc_component_get_bias_level()]
Signed-off-by: Marco Felsch <m.felsch@pengutronix.de>
Signed-off-by: Mark Brown <broonie@kernel.org>
(cherry picked from commit 62a7fc32a6)
2018-10-31 10:57:17 -05:00
Takashi Iwai
0f9ea3fba1 ASoC: topology: Use the standard fall-through annotations
As a preparatory patch for the upcoming -Wimplicit-fallthrough
compiler checks, replace with the standard "fall through" annotation.
gcc can't understand the mixed texts, unfortunately.

Signed-off-by: Takashi Iwai <tiwai@suse.de>
Signed-off-by: Mark Brown <broonie@kernel.org>
(cherry picked from commit 9c6c4d961e)
2018-10-31 10:57:17 -05:00
Takashi Iwai
2072f260de ASoC: intel: skylake: Add fall-through annotation
As a preparatory patch for the upcoming -Wimplicit-fallthrough
compiler checks, add the "fall through" annotation in Intel SST
skylake driver.

Signed-off-by: Takashi Iwai <tiwai@suse.de>
Signed-off-by: Mark Brown <broonie@kernel.org>
(cherry picked from commit e4bfd61571)
2018-10-31 10:57:17 -05:00
Takashi Iwai
9ddf42cdd3 ASoC: rt274: Add fall-through annotations
As a preparatory patch for the upcoming -Wimplicit-fallthrough
compiler checks, add the "fall through" annotations in rt274 driver.

Signed-off-by: Takashi Iwai <tiwai@suse.de>
Signed-off-by: Mark Brown <broonie@kernel.org>
(cherry picked from commit 0beeb4baf5)
2018-10-31 10:57:17 -05:00
Takashi Iwai
01318e75fe ASoC: intel: skylake: Add missing break in skl_tplg_get_token()
skl_tplg_get_token() misses a break in the big switch() block for
SKL_TKN_U8_CORE_ID entry.
Spotted nicely by -Wimplicit-fallthrough compiler option.

Fixes: 6277e83292 ("ASoC: Intel: Skylake: Parse vendor tokens to build module data")
Cc: <stable@vger.kernel.org>
Signed-off-by: Takashi Iwai <tiwai@suse.de>
Signed-off-by: Mark Brown <broonie@kernel.org>
(cherry picked from commit 9c80c5a883)
2018-10-31 10:57:17 -05:00
Matthias Kaehlcke
c6967255cf ASoC: soc-utils: Rename dummy_dma_ops to snd_dummy_dma_ops
The symbols 'dummy_dma_ops' is declared with different data types by
sound/soc/soc-utils.c and arch/arm64/include/asm/dma-mapping.h. This
leads to conflicts when soc-utils.c (indirectly) includes dma-mapping.h:

sound/soc/soc-utils.c:282:33: error: conflicting types for 'dummy_dma_ops'
  static const struct snd_pcm_ops dummy_dma_ops = {
                                  ^
...
arch/arm64/include/asm/dma-mapping.h:27:33: note: previous declaration of 'dummy_dma_ops' was here
  extern const struct dma_map_ops dummy_dma_ops;
                                  ^

Rename the symbol in soc-utils.c to 'snd_dummy_dma_ops' to avoid the
conflict.

Signed-off-by: Matthias Kaehlcke <mka@chromium.org>
Signed-off-by: Mark Brown <broonie@kernel.org>
(cherry picked from commit 42cfb412e2)
2018-10-31 10:57:17 -05:00
Andreas Färber
2fdf01a90e ASoC: max98088: add OF support
MAX98088 is an older version of the MAX98089 device.

Signed-off-by: Andreas Färber <afaerber@suse.de>
[m.felsch@pengutronix.de: add CONFIG_OF compile switch]
[m.felsch@pengutronix.de: adapt commit message]
Signed-off-by: Marco Felsch <m.felsch@pengutronix.de>
Signed-off-by: Mark Brown <broonie@kernel.org>
(cherry picked from commit 85aa0fe73e)
2018-10-31 10:57:17 -05:00
Kuninori Morimoto
908a51f110 ASoC: add for_each_component_dais() macro
To be more readable code, this patch adds
new for_each_component_dais() macro, and replace existing code to it.

Signed-off-by: Kuninori Morimoto <kuninori.morimoto.gx@renesas.com>
Signed-off-by: Mark Brown <broonie@kernel.org>
(cherry picked from commit 15a0c64572)
2018-10-31 10:57:17 -05:00
Kuninori Morimoto
375ce662b9 ASoC: add for_each_component() macro
To be more readable code, this patch adds
new for_each_component() macro, and replace existing code to it.

Signed-off-by: Kuninori Morimoto <kuninori.morimoto.gx@renesas.com>
Signed-off-by: Mark Brown <broonie@kernel.org>
(cherry picked from commit 368dee9459)
2018-10-31 10:57:17 -05:00
Oder Chiou
e33c6d1b79 ASoC: rt5663: Remove the boost volume in the beginning of playback
The patch removes the boost volume in the beginning of playback while the
DAC volume set to lower.

Signed-off-by: Oder Chiou <oder_chiou@realtek.com>
Signed-off-by: Mark Brown <broonie@kernel.org>
(cherry picked from commit fc795bf722)
2018-10-31 10:57:17 -05:00
Kuninori Morimoto
8664e7491e ASoC: add for_each_dpcm_be() macro
To be more readable code, this patch adds
new for_each_dpcm_be() macro, and replace existing code to it.

Signed-off-by: Kuninori Morimoto <kuninori.morimoto.gx@renesas.com>
Signed-off-by: Mark Brown <broonie@kernel.org>
(cherry picked from commit 8d6258a4dd)
2018-10-31 10:57:17 -05:00
Kuninori Morimoto
7131ebc23f ASoC: add for_each_dpcm_fe() macro
To be more readable code, this patch adds
new for_each_dpcm_fe() macro, and replace existing code to it.

Signed-off-by: Kuninori Morimoto <kuninori.morimoto.gx@renesas.com>
Signed-off-by: Mark Brown <broonie@kernel.org>
(cherry picked from commit d2e24d6465)
2018-10-31 10:57:17 -05:00
Kuninori Morimoto
4d16e7d583 ASoC: add for_each_comp_order() macro
To be more readable code, this patch adds
new for_each_comp_order() macro, and replace existing code to it.

Signed-off-by: Kuninori Morimoto <kuninori.morimoto.gx@renesas.com>
Signed-off-by: Mark Brown <broonie@kernel.org>
(cherry picked from commit 1a1035a985)
2018-10-31 10:57:17 -05:00
Kuninori Morimoto
b3a651e4e9 ASoC: add for_each_card_components() macro
To be more readable code, this patch adds
new for_each_card_components() macro, and replace existing code to it.

Signed-off-by: Kuninori Morimoto <kuninori.morimoto.gx@renesas.com>
Signed-off-by: Mark Brown <broonie@kernel.org>
(cherry picked from commit f70f18f7d4)
2018-10-31 10:57:17 -05:00
Kuninori Morimoto
1b84adc23e ASoC: add for_each_card_rtds() macro
To be more readable code, this patch adds
new for_each_card_rtds() macro, and replace existing code to it.

Signed-off-by: Kuninori Morimoto <kuninori.morimoto.gx@renesas.com>
Signed-off-by: Mark Brown <broonie@kernel.org>
(cherry picked from commit bcb1fd1fcd)
2018-10-31 10:57:17 -05:00
Kuninori Morimoto
6d4c665fb9 ASoC: add for_each_card_links() macro
To be more readable code, this patch adds
new for_each_card_links() macro, and replace existing code to it.

Signed-off-by: Kuninori Morimoto <kuninori.morimoto.gx@renesas.com>
Signed-off-by: Mark Brown <broonie@kernel.org>
(cherry picked from commit 98061fdbfc)
2018-10-31 10:57:17 -05:00