linux-2.6-microblaze.git
5 years agoMerge remote-tracking branch 'asoc/for-4.19' into asoc-4.20
Mark Brown [Fri, 19 Oct 2018 12:31:41 +0000 (13:31 +0100)]
Merge remote-tracking branch 'asoc/for-4.19' into asoc-4.20

5 years agoASoC: wm_adsp: Log addresses as 8 digits in wm_adsp_buffer_populate
Richard Fitzgerald [Fri, 19 Oct 2018 12:25:16 +0000 (13:25 +0100)]
ASoC: wm_adsp: Log addresses as 8 digits in wm_adsp_buffer_populate

Increase the address value width in the debug log from 4 digits to
8 digits to allow for DSP cores with larger memory address ranges.

Signed-off-by: Richard Fitzgerald <rf@opensource.cirrus.com>
Signed-off-by: Mark Brown <broonie@kernel.org>
5 years agoASoC: wm_adsp: Rename memory fields in wm_adsp_buffer
Richard Fitzgerald [Fri, 19 Oct 2018 12:25:15 +0000 (13:25 +0100)]
ASoC: wm_adsp: Rename memory fields in wm_adsp_buffer

The wm_adsp_buffer struct is the control header of a circular
buffer used to transfer data from the firmware over the
control interface to an ALSA compressed stream.

The original names of the fields pointing to the data buffer
were based on ADSP2V2 memory layout where they correspond to
{XM, XM, YM}. But this circular buffer could be used on other
types of DSP core that have different memory region types.
Also the names and description of the size fields were not
very clear. The field names and descriptions have been changed
to be generic and not imply any particular memory types.

This patch updates the wm_adsp driver to the new field names.

Signed-off-by: Richard Fitzgerald <rf@opensource.cirrus.com>
Signed-off-by: Mark Brown <broonie@kernel.org>
5 years agoASoC: cs42l51: add mclk support
Olivier Moysan [Mon, 15 Oct 2018 14:03:36 +0000 (16:03 +0200)]
ASoC: cs42l51: add mclk support

Add MCLK dapm to allow configuration of cirrus CS42l51
codec as a master clock consumer.

Signed-off-by: Olivier Moysan <olivier.moysan@st.com>
Signed-off-by: Mark Brown <broonie@kernel.org>
5 years agoASoC: stm32: sai: set sai as mclk clock provider
Olivier Moysan [Mon, 15 Oct 2018 14:03:35 +0000 (16:03 +0200)]
ASoC: stm32: sai: set sai as mclk clock provider

Add master clock generation support in STM32 SAI.
The master clock provided by SAI can be used to feed a codec.

Signed-off-by: Olivier Moysan <olivier.moysan@st.com>
Signed-off-by: Mark Brown <broonie@kernel.org>
5 years agoASoC: dt-bindings: add mclk support to cs42l51
Olivier Moysan [Mon, 15 Oct 2018 14:03:34 +0000 (16:03 +0200)]
ASoC: dt-bindings: add mclk support to cs42l51

Add clocks properties to cs42l51 Cirrus codec,
to support master clock provider.

Signed-off-by: Olivier Moysan <olivier.moysan@st.com>
Signed-off-by: Mark Brown <broonie@kernel.org>
5 years agoASoC: dt-bindings: add mclk provider support to stm32 sai
Olivier Moysan [Mon, 15 Oct 2018 14:03:33 +0000 (16:03 +0200)]
ASoC: dt-bindings: add mclk provider support to stm32 sai

add mclk provider support to stm32 sai

Signed-off-by: Olivier Moysan <olivier.moysan@st.com>
Signed-off-by: Mark Brown <broonie@kernel.org>
5 years agoASoC: soc-core: fix trivial checkpatch issues
Marcel Ziswiler [Thu, 18 Oct 2018 11:18:28 +0000 (13:18 +0200)]
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>
5 years agoASoC: dapm: Add support for hw_free on CODEC to CODEC links
Charles Keepax [Thu, 11 Oct 2018 16:28:28 +0000 (17:28 +0100)]
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>
5 years agoASoC: Intel: kbl_da7219_max98927: minor white space clean up
Dan Carpenter [Thu, 18 Oct 2018 07:34:30 +0000 (10:34 +0300)]
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>
5 years agoASoC: rsnd: tidyup SSICR::SWSP for TDM
Kuninori Morimoto [Wed, 17 Oct 2018 01:55:57 +0000 (01:55 +0000)]
ASoC: rsnd: tidyup SSICR::SWSP for TDM

R-Car datasheet is indicating that WS output settings of SSICR::SWSP
is inverted on TDM mode from non TDM mode settings.
But, it is meaning that TDM should use 0 here.
Without this patch, sound input/output 1ch will be 2ch, 2ch will be 3ch
..., be jumbled on I2S + TDM settings. This patch fixup it.
This patch is tested on R-Car H3 ulcb-kf board, SSI3/4 TDM sound.

Signed-off-by: Kuninori Morimoto <kuninori.morimoto.gx@renesas.com>
Signed-off-by: Mark Brown <broonie@kernel.org>
5 years agoASoC: rsnd: enable TDM settings for SSI parent
Kuninori Morimoto [Wed, 17 Oct 2018 01:55:37 +0000 (01:55 +0000)]
ASoC: rsnd: enable TDM settings for SSI parent

Some SSIs are sharing each pins (= WS/CLK pin for playback/capture).
Then, SSI parent needs control WS/CLK setting for SSI slave.
In such case, SSI parent needs TDM settings if SSI slave is working as
TDM mode. But it is not cared in current driver.
It can't capture TDM sound without this patch if SSIs were pin sharing.
This patch is tested on R-Car H3 ulcb-kf board, SSI3/4 with TDM sound.

Signed-off-by: Kuninori Morimoto <kuninori.morimoto.gx@renesas.com>
Signed-off-by: Mark Brown <broonie@kernel.org>
5 years agoASoC: pcm3168a: add hw constraint for capture channel
Kuninori Morimoto [Wed, 17 Oct 2018 01:54:33 +0000 (01:54 +0000)]
ASoC: pcm3168a: add hw constraint for capture channel

LEFT_J / I2S only can use TDM.
commit 594680ea4a394 ("ASoC: pcm3168a: add hw constraint for channel")
commit 3809688980205 ("ASoC: pcm3168a: add HW constraint for non
RIGHT_J") added channel constraint for it, but, it was only for playback.
This patch adds constraint for capture.

Signed-off-by: Kuninori Morimoto <kuninori.morimoto.gx@renesas.com>
Signed-off-by: Mark Brown <broonie@kernel.org>
5 years agoASoC: sta32x: Add support for XTI clock
Daniel Mack [Wed, 17 Oct 2018 11:37:03 +0000 (13:37 +0200)]
ASoC: sta32x: Add support for XTI clock

The STA32x chips feature an XTI clock input that needs to be stable before
the reset signal is released. Therefore, the chip driver needs to get a
handle to the clock. Instead of relying on other parts of the system to
enable the clock, let the codec driver grab a handle itself.

In order to keep existing boards working, clock support is made optional.

Signed-off-by: Daniel Mack <daniel@zonque.org>
Signed-off-by: Mark Brown <broonie@kernel.org>
5 years agoASoC: nau8822: new codec driver
David Lin [Fri, 28 Sep 2018 03:10:04 +0000 (11:10 +0800)]
ASoC: nau8822: new codec driver

Add driver for NAU88C22.

Signed-off-by: David Lin <CTLIN0@nuvoton.com>
Signed-off-by: Mark Brown <broonie@kernel.org>
5 years agoASoC: tegra_sgtl5000: fix device_node refcounting
Marcel Ziswiler [Tue, 16 Oct 2018 10:47:29 +0000 (12:47 +0200)]
ASoC: tegra_sgtl5000: fix device_node refcounting

Similar to the following:

commit 4321723648b0 ("ASoC: tegra_alc5632: fix device_node refcounting")

commit 7c5dfd549617 ("ASoC: tegra: fix device_node refcounting")

Signed-off-by: Marcel Ziswiler <marcel.ziswiler@toradex.com>
Acked-by: Jon Hunter <jonathanh@nvidia.com>
Signed-off-by: Mark Brown <broonie@kernel.org>
5 years agoASoC: sunxi: allow the sun8i-codec driver to be built on ARM64
Vasily Khoruzhick [Wed, 17 Oct 2018 07:38:10 +0000 (00:38 -0700)]
ASoC: sunxi: allow the sun8i-codec driver to be built on ARM64

Allwinner A64 uses the same digital codec part as in A33, so we need
to build this driver on ARM64 as well.

Signed-off-by: Vasily Khoruzhick <anarsoul@gmail.com>
Acked-by: Maxime Ripard <maxime.ripard@bootlin.com>
Signed-off-by: Mark Brown <broonie@kernel.org>
5 years agoASoC: sunxi: Add new driver for Allwinner A64 codec's analog path controls
Vasily Khoruzhick [Wed, 17 Oct 2018 07:38:09 +0000 (00:38 -0700)]
ASoC: sunxi: Add new driver for Allwinner A64 codec's analog path controls

The internal codec on A64 is split into 2 parts. The analog path controls
are routed through an embedded custom register bus accessed through
the PRCM block.

Add an ASoC component driver for it. This should be tied to the codec
audio card as an auxiliary device.

Signed-off-by: Vasily Khoruzhick <anarsoul@gmail.com>
Acked-by: Maxime Ripard <maxime.ripard@bootlin.com>
Signed-off-by: Mark Brown <broonie@kernel.org>
5 years agoASoC: dt-binding: Add bindings for Allwinner A64 codec's analog path controls
Vasily Khoruzhick [Wed, 17 Oct 2018 07:38:08 +0000 (00:38 -0700)]
ASoC: dt-binding: Add bindings for Allwinner A64 codec's analog path controls

The internal codec on Allwinner A64 is split into 2 parts. The
analog path controls are routed through an embedded custom register
bus accessed through the PRCM block just as on A23/A33/H3.

Add a binding for this hardware.

Signed-off-by: Vasily Khoruzhick <anarsoul@gmail.com>
Acked-by: Maxime Ripard <maxime.ripard@bootlin.com>
Signed-off-by: Mark Brown <broonie@kernel.org>
5 years agoASoC: sun8i-codec-analog: split regmap code into separate driver
Vasily Khoruzhick [Wed, 17 Oct 2018 07:38:07 +0000 (00:38 -0700)]
ASoC: sun8i-codec-analog: split regmap code into separate driver

It will be reused by sun50i-codec-analog later.

Signed-off-by: Vasily Khoruzhick <anarsoul@gmail.com>
Acked-by: Maxime Ripard <maxime.ripard@bootlin.com>
Signed-off-by: Mark Brown <broonie@kernel.org>
5 years agoASoC: sun8i-codec: Don't hardcode BCLK / LRCK ratio
Vasily Khoruzhick [Wed, 17 Oct 2018 07:38:06 +0000 (00:38 -0700)]
ASoC: sun8i-codec: Don't hardcode BCLK / LRCK ratio

BCLK / LRCK ratio should be sample size * channels, but it was
hardcoded to 32 (0x1 is 32 as per A33 and A64 datasheets).

Calculate it basing on sample size and number of channels.

Signed-off-by: Vasily Khoruzhick <anarsoul@gmail.com>
Acked-by: Maxime Ripard <maxime.ripard@bootlin.com>
Signed-off-by: Mark Brown <broonie@kernel.org>
5 years agoASoC: sun4i-i2s: Add compatibility with A64 codec I2S
Marcus Cooper [Wed, 17 Oct 2018 07:38:05 +0000 (00:38 -0700)]
ASoC: sun4i-i2s: Add compatibility with A64 codec I2S

The I2S block used for the audio codec in the A64 differs from other 3
I2S modules in A64 and isn't compatible with H3. But it is very similar
to what is found in A10(sun4i). However, its TX FIFO is
located at a different address.

Signed-off-by: Marcus Cooper <codekipper@gmail.com>
Signed-off-by: Vasily Khoruzhick <anarsoul@gmail.com>
Acked-by: Maxime Ripard <maxime.ripard@bootlin.com>
Signed-off-by: Mark Brown <broonie@kernel.org>
5 years agoASoC: intel: don't pass GFP_DMA32 to dma_alloc_coherent
Christoph Hellwig [Sat, 13 Oct 2018 15:17:04 +0000 (17:17 +0200)]
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>
5 years agoASoC: Intel: common: Add Kabylake Dialog+Maxim machine driver entry
Mac Chiang [Tue, 9 Oct 2018 07:37:08 +0000 (15:37 +0800)]
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>
5 years agoASoC: Intel: Boards: Add KBL Dialog Maxim I2S machine driver
Mac Chiang [Tue, 9 Oct 2018 07:35:47 +0000 (15:35 +0800)]
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>
5 years agoASoC: AMD: Add SND_JACK_LINEOUT jack type
Akshu Agrawal [Mon, 15 Oct 2018 06:54:44 +0000 (12:24 +0530)]
ASoC: AMD: Add SND_JACK_LINEOUT jack type

Some 3 pole connectors report impedance greater than threshold of
1000Ohm. Thus, da7219 reports them as LINEOUT.
Adding the SND_JACK_LINEOUT type so that we don't fail to detect
any 3 pole jack type.
Also, changing
SND_JACK_HEADPHONE | SND_JACK_MICROPHONE -> SND_JACK_HEADSET

Signed-off-by: Akshu Agrawal <akshu.agrawal@amd.com>
Signed-off-by: Mark Brown <broonie@kernel.org>
5 years agoASoC: pcm3168a: add I2S/Left_J TDM support
Kuninori Morimoto [Fri, 12 Oct 2018 06:31:49 +0000 (06:31 +0000)]
ASoC: pcm3168a: add I2S/Left_J TDM support

pcm3168a is supporting TDM on I2S/Left_J, but there is no
settings for it. This patch add it.

Signed-off-by: Kuninori Morimoto <kuninori.morimoto.gx@renesas.com>
Signed-off-by: Mark Brown <broonie@kernel.org>
5 years agoASoC: pcm3168a: add hw constraint for channel
Kuninori Morimoto [Fri, 12 Oct 2018 06:31:18 +0000 (06:31 +0000)]
ASoC: pcm3168a: add hw constraint for channel

LEFT_J / I2S only can use TDM.
This patch adds channel constraint for it.

Signed-off-by: Kuninori Morimoto <kuninori.morimoto.gx@renesas.com>
Signed-off-by: Mark Brown <broonie@kernel.org>
5 years agoASoC: pcm3168a: add HW constraint for non RIGHT_J
Kuninori Morimoto [Fri, 12 Oct 2018 06:31:00 +0000 (06:31 +0000)]
ASoC: pcm3168a: add HW constraint for non RIGHT_J

RIGHT_J only can handle 16bit data bits.
Current driver just errored if user requests non RIGHT_J
+ 16bit combination. But it is not useful for user.
This patch adds HW constraint for it, and avoid
error on such situation.

Signed-off-by: Kuninori Morimoto <kuninori.morimoto.gx@renesas.com>
Signed-off-by: Mark Brown <broonie@kernel.org>
5 years agoASoC: sta32x: set ->component pointer in private struct
Daniel Mack [Thu, 11 Oct 2018 18:32:05 +0000 (20:32 +0200)]
ASoC: sta32x: set ->component pointer in private struct

The ESD watchdog code in sta32x_watchdog() dereferences the pointer
which is never assigned.

This is a regression from a1be4cead9b950 ("ASoC: sta32x: Convert to direct
regmap API usage.") which went unnoticed since nobody seems to use that ESD
workaround.

Fixes: a1be4cead9b950 ("ASoC: sta32x: Convert to direct regmap API usage.")
Signed-off-by: Daniel Mack <daniel@zonque.org>
Signed-off-by: Mark Brown <broonie@kernel.org>
Cc: stable@vger.kernel.org
5 years agoASoC: max98373: Sort DHT Rot Pnt Volume in reverse order
Ryan Lee [Wed, 10 Oct 2018 23:26:17 +0000 (23:26 +0000)]
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>
5 years agoASoC: max98373: Sort max98373_bde_gain_tlv in reverse order
Ryan Lee [Wed, 10 Oct 2018 23:26:13 +0000 (23:26 +0000)]
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>
5 years agoASoC: max98373: Sort BDE Limiter Thresh Volume in reverse order
Ryan Lee [Wed, 10 Oct 2018 23:26:10 +0000 (23:26 +0000)]
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>
5 years agoASoC: max98373: Sort Digital Volume in reverse order
Ryan Lee [Wed, 10 Oct 2018 23:26:06 +0000 (23:26 +0000)]
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>
5 years agoASoC: audio-graph-card: enable mclk-fs on codec node
Kuninori Morimoto [Wed, 10 Oct 2018 02:22:29 +0000 (02:22 +0000)]
ASoC: audio-graph-card: enable mclk-fs on codec node

Current audio-graph-card is supporting mclk-fs on CPU node
side only. But having Codec node also is good idea.
It will be just ignored if not defined.

"rcpu_ep" is same as "cpu_ep", This patch tidyup it, too.

Signed-off-by: Kuninori Morimoto <kuninori.morimoto.gx@renesas.com>
Signed-off-by: Mark Brown <broonie@kernel.org>
5 years agoASoC: rsnd: use 32bit TDM width as default
Kuninori Morimoto [Wed, 10 Oct 2018 02:20:42 +0000 (02:20 +0000)]
ASoC: rsnd: use 32bit TDM width as default

commit fb2815f44a9e ("ASoC: rsnd: add support for 16/24 bit slot widths")
added TDM width check, and return error if it was not 16/24/32 bit.
But it is too strict. This patch uses 32bit same as default.

Signed-off-by: Kuninori Morimoto <kuninori.morimoto.gx@renesas.com>
Signed-off-by: Mark Brown <broonie@kernel.org>
5 years agoASoC: max98988: add I2C dependency
Arnd Bergmann [Wed, 10 Oct 2018 08:37:13 +0000 (10:37 +0200)]
ASoC: max98988: add I2C dependency

max98988 only builds with I2C support enabled, otherwise we get a build error:

sound/soc/codecs/max98088.c:1789:1: error: data definition has no type or storage class [-Werror]
 module_i2c_driver(max98088_i2c_driver);
 ^~~~~~~~~~~~~~~~~
sound/soc/codecs/max98088.c:1789:1: error: type defaults to 'int' in declaration of 'module_i2c_driver' [-Werror=implicit-int]
sound/soc/codecs/max98088.c:1789:1: error: parameter names (without types) in function declaration [-Werror]
sound/soc/codecs/max98088.c:1780:26: error: 'max98088_i2c_driver' defined but not used [-Werror=unused-variable]

Fixes: 24ae67c58250 ("ASoC: max98988: make it selectable")
Signed-off-by: Arnd Bergmann <arnd@arndb.de>
Reviewed-by: Marco Felsch <m.felsch@pengutronix.de>
Signed-off-by: Mark Brown <broonie@kernel.org>
5 years agoASoC: max98988: make it selectable
Marco Felsch [Fri, 5 Oct 2018 07:58:12 +0000 (09:58 +0200)]
ASoC: max98988: make it selectable

Currently the driver will build only if SND_SOC_ALL_CODECS is set.
Adding a Kconfig menu description to build the driver standalone.

Signed-off-by: Marco Felsch <m.felsch@pengutronix.de>
Signed-off-by: Mark Brown <broonie@kernel.org>
5 years agoASoC: max98088: Add master clock handling
Andreas Färber [Fri, 5 Oct 2018 07:58:11 +0000 (09:58 +0200)]
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>
5 years agoASoC: dt-bindings: max98088: add external clock binding
Marco Felsch [Fri, 5 Oct 2018 07:58:10 +0000 (09:58 +0200)]
ASoC: dt-bindings: max98088: add external clock binding

Allow setting the clock provider for the external clock called "mclk".

Signed-off-by: Marco Felsch <m.felsch@pengutronix.de>
Signed-off-by: Mark Brown <broonie@kernel.org>
5 years agoASoC: wm8782: add support for regulators
Daniel Mack [Wed, 3 Oct 2018 19:34:36 +0000 (21:34 +0200)]
ASoC: wm8782: add support for regulators

Lookup regulators for Vdd and Vdda during probe, and enable them when the
component is linked.

Signed-off-by: Daniel Mack <daniel@zonque.org>
Signed-off-by: Mark Brown <broonie@kernel.org>
5 years agoASoC: Add device tree documentation file for wm8782 stereo DAC
Daniel Mack [Wed, 3 Oct 2018 19:34:35 +0000 (21:34 +0200)]
ASoC: Add device tree documentation file for wm8782 stereo DAC

Add a device tree documentation file for the wm8782 stereo DAC to describe
the regulator handles.

Signed-off-by: Daniel Mack <daniel@zonque.org>
Acked-by: Charles Keepax <ckeepax@opensource.cirrus.com>
Signed-off-by: Mark Brown <broonie@kernel.org>
5 years agoASoC: dt-bindings: add dt bindings for adau1977 audio codec
Alexandru Ardelean [Tue, 2 Oct 2018 12:06:30 +0000 (15:06 +0300)]
ASoC: dt-bindings: add dt bindings for adau1977 audio codec

Add device-tree bindings documentation file for ADAU1977 audio codec.
This describes device-tree fields that are already supported by the driver.

The driver supports both I2C AND and SPI, and this doc covers both aspects
of the DT configuration.

Signed-off-by: Alexandru Ardelean <alexandru.ardelean@analog.com>
Signed-off-by: Mark Brown <broonie@kernel.org>
5 years agoASoC: topology: Use the standard fall-through annotations
Takashi Iwai [Thu, 4 Oct 2018 18:30:06 +0000 (20:30 +0200)]
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>
5 years agoASoC: intel: skylake: Add fall-through annotation
Takashi Iwai [Thu, 4 Oct 2018 18:30:05 +0000 (20:30 +0200)]
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>
5 years agoASoC: rt274: Add fall-through annotations
Takashi Iwai [Thu, 4 Oct 2018 18:30:04 +0000 (20:30 +0200)]
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>
5 years agoASoC: pcm186x: Use the standard fall-through annotation
Takashi Iwai [Thu, 4 Oct 2018 18:30:03 +0000 (20:30 +0200)]
ASoC: pcm186x: Use the standard fall-through annotation

As a preparatory patch for the upcoming -Wimplicit-fallthrough
compiler checks, replace with the standard "fall through" annotation.
Unfortunately gcc doesn't understand the mixed comment lines.

Signed-off-by: Takashi Iwai <tiwai@suse.de>
Signed-off-by: Mark Brown <broonie@kernel.org>
5 years agoASoC: adau1761: Use the standard fall-through annotation
Takashi Iwai [Thu, 4 Oct 2018 18:30:02 +0000 (20:30 +0200)]
ASoC: adau1761: Use the standard fall-through annotation

As a preparatory patch for the upcoming -Wimplicit-fallthrough
compiler checks, replace with the standard "fall through" annotation
at the right place.  It has to be put right before the next label.

Signed-off-by: Takashi Iwai <tiwai@suse.de>
Signed-off-by: Mark Brown <broonie@kernel.org>
5 years agoASoC: ts3a227e: fix a typo in documentation
Tzung-Bi Shih [Thu, 4 Oct 2018 10:43:01 +0000 (18:43 +0800)]
ASoC: ts3a227e: fix a typo in documentation

There is no "MACBIAS".  It should be "MICBIAS".

Signed-off-by: Tzung-Bi Shih <tzungbi@google.com>
Signed-off-by: Mark Brown <broonie@kernel.org>
5 years agoASoC: add fault detect recovery property to DT bindings
Daniel Mack [Wed, 3 Oct 2018 19:32:34 +0000 (21:32 +0200)]
ASoC: add fault detect recovery property to DT bindings

The driver already has support for setting the FDRB bit in the CONFA
register through platform data, but there was no property to set it
in the device-tree bindings.

Signed-off-by: Daniel Mack <daniel@zonque.org>
Signed-off-by: Mark Brown <broonie@kernel.org>
5 years agoASoC: pxa-ssp: enable and disable extclk if given
Daniel Mack [Wed, 3 Oct 2018 19:36:27 +0000 (21:36 +0200)]
ASoC: pxa-ssp: enable and disable extclk if given

If a "extclk" clock is given, enable and disable it when appropriate.

Signed-off-by: Daniel Mack <daniel@zonque.org>
Signed-off-by: Mark Brown <broonie@kernel.org>
5 years agoASoC: qdsp6: q6asm-dai: checking NULL vs IS_ERR()
Dan Carpenter [Mon, 1 Oct 2018 16:44:30 +0000 (19:44 +0300)]
ASoC: qdsp6: q6asm-dai: checking NULL vs IS_ERR()

The q6asm_audio_client_alloc() doesn't return NULL, it returns error
pointers.

Fixes: 2a9e92d371db ("ASoC: qdsp6: q6asm: Add q6asm dai driver")
Signed-off-by: Dan Carpenter <dan.carpenter@oracle.com>
Signed-off-by: Mark Brown <broonie@kernel.org>
5 years agoASoC: intel: skylake: Add missing break in skl_tplg_get_token()
Takashi Iwai [Wed, 3 Oct 2018 17:31:44 +0000 (19:31 +0200)]
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: 6277e83292a2 ("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>
5 years agoASoC: qcom: qdsp6: remove duplicated include
YueHaibing [Wed, 26 Sep 2018 07:33:03 +0000 (15:33 +0800)]
ASoC: qcom: qdsp6: remove duplicated include

Remove duplicated includes linux/of_platform.h
and linux/wait.h

Signed-off-by: YueHaibing <yuehaibing@huawei.com>
Signed-off-by: Mark Brown <broonie@kernel.org>
5 years agoASoC: rsnd: Add r8a7744 support
Biju Das [Thu, 27 Sep 2018 13:51:25 +0000 (14:51 +0100)]
ASoC: rsnd: Add r8a7744 support

Document RZ/G1N (R8A7744) SoC bindings.

Signed-off-by: Biju Das <biju.das@bp.renesas.com>
Reviewed-by: Chris Paterson <Chris.Paterson2@renesas.com>
Signed-off-by: Mark Brown <broonie@kernel.org>
5 years agoASoC: wm9712: fix unused variable warning
Arnd Bergmann [Wed, 26 Sep 2018 19:37:40 +0000 (21:37 +0200)]
ASoC: wm9712: fix unused variable warning

The 'ret' variable is now only used in an #ifdef, and causes a
warning if it is declared outside of that block:

sound/soc/codecs/wm9712.c: In function 'wm9712_soc_probe':
sound/soc/codecs/wm9712.c:641:6: error: unused variable 'ret' [-Werror=unused-variable]

Fixes: 2ed1a8e0ce8d ("ASoC: wm9712: add ac97 new bus support")
Signed-off-by: Arnd Bergmann <arnd@arndb.de>
Acked-by: Charles Keepax <ckeepax@opensource.cirrus.com>
Signed-off-by: Mark Brown <broonie@kernel.org>
5 years agoASoC: atmel: add SND_SOC_I2C_AND_SPI dependency
Arnd Bergmann [Wed, 26 Sep 2018 12:59:40 +0000 (14:59 +0200)]
ASoC: atmel: add SND_SOC_I2C_AND_SPI dependency

Selecting SND_SOC_WM8731 is only allowed when all its dependencies
are already there:

WARNING: unmet direct dependencies detected for SND_SOC_WM8731
  Depends on [m]: SOUND [=y] && !UML && SND [=y] && SND_SOC [=y] && SND_SOC_I2C_AND_SPI [=m]
  Selected by [y]:
  - SND_SOC_MIKROE_PROTO [=y] && SOUND [=y] && !UML && SND [=y] && SND_SOC [=y] && SND_ATMEL_SOC [=y] && OF [=y]
  Selected by [m]:
  - SND_AT91_SOC_SAM9X5_WM8731 [=m] && SOUND [=y] && !UML && SND [=y] && SND_SOC [=y] && SND_ATMEL_SOC [=y] && (ARCH_AT91 [=y] || COMPILE_TEST [=y]) && ATMEL_SSC [=y] && SND_SOC_I2C_AND_SPI [=m]
  - SND_SOC_ALL_CODECS [=m] && SOUND [=y] && !UML && SND [=y] && SND_SOC [=y] && COMPILE_TEST [=y] && SND_SOC_I2C_AND_SPI [=m]

Fixes: a45f8853a5f9 ("ASoC: Add driver for PROTO Audio CODEC (with a WM8731)")
Signed-off-by: Arnd Bergmann <arnd@arndb.de>
Reviewed-by: Codrin Ciubotariu <codrin.ciubotariu@microchip.com>
Signed-off-by: Mark Brown <broonie@kernel.org>
5 years agoASoC: pxa: avoid AC97_BUS build warning
Arnd Bergmann [Wed, 26 Sep 2018 12:46:35 +0000 (14:46 +0200)]
ASoC: pxa: avoid AC97_BUS build warning

Selecting AC97_BUS_NEW from SND_PXA2XX_SOC_AC97 leads to a Kconfig
warning if any other driver selects AC97_BUS:

WARNING: unmet direct dependencies detected for AC97_BUS_COMPAT
  Depends on [n]: SOUND [=y] && !UML && SND [=y] && AC97_BUS_NEW [=y] && !AC97_BUS [=y]
  Selected by [y]:
  - SND_SOC_WM9713 [=y] && SOUND [=y] && !UML && SND [=y] && SND_SOC [=y] && AC97_BUS_NEW [=y]

I don't know if that combination is supposed to work.
Assuming it is not, this adds a dependency on all users
for PXA to avoids the combination.

Fixes: 1c8bc7b3de5e ("ASoC: pxa: switch to new ac97 bus support")
Signed-off-by: Arnd Bergmann <arnd@arndb.de>
Signed-off-by: Mark Brown <broonie@kernel.org>
5 years agoASoC: soc-utils: Rename dummy_dma_ops to snd_dummy_dma_ops
Matthias Kaehlcke [Tue, 25 Sep 2018 18:09:14 +0000 (11:09 -0700)]
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>
5 years agoASoC: max98088: add OF support
Andreas Färber [Tue, 25 Sep 2018 14:23:49 +0000 (16:23 +0200)]
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>
5 years agoASoC: dt-bindings: add max98088 audio codec
Andreas Färber [Tue, 25 Sep 2018 14:23:48 +0000 (16:23 +0200)]
ASoC: dt-bindings: add max98088 audio codec

This patch adds the bindings for maxim max98088/9 audio codec.

Signed-off-by: Andreas Färber <afaerber@suse.de>
[m.felsch@pengutronix.de: adapt commit message]
[m.felsch@pengutronix.de: adapt formatting]
Signed-off-by: Marco Felsch <m.felsch@pengutronix.de>
Signed-off-by: Mark Brown <broonie@kernel.org>
5 years agoASoC: cs4265: Add a MIC pre. route
Matt Flax [Tue, 25 Sep 2018 06:40:18 +0000 (16:40 +1000)]
ASoC: cs4265: Add a MIC pre. route

The cs4265 driver is missing a microphone preamp enable.
This patch enables/disables the microphone preamp when mic
selection is made using the kcontrol.

Signed-off-by: Matt Flax <flatmax@flatmax.org>
Reviewed-by: Charles Keepax <ckeepax@opensource.cirrus.com>
Signed-off-by: Mark Brown <broonie@kernel.org>
5 years agoASoC: add for_each_component_dais() macro
Kuninori Morimoto [Fri, 21 Sep 2018 05:23:17 +0000 (05:23 +0000)]
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>
5 years agoASoC: add for_each_component() macro
Kuninori Morimoto [Fri, 21 Sep 2018 05:23:01 +0000 (05:23 +0000)]
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>
5 years agoASoC: rsnd: fixup SSI clock during suspend/resume modes
Dmytro Prokopchuk [Fri, 21 Sep 2018 04:59:59 +0000 (04:59 +0000)]
ASoC: rsnd: fixup SSI clock during suspend/resume modes

Prepare <-> Cleanup functions pair has balanced calls.
But in case of suspend mode no call to rsnd_soc_dai_shutdown()
function, so cleanup isn't called. OTOH during resume mode
function rsnd_soc_dai_prepare() is called, but calling
rsnd_ssi_prepare() is skipped (rsnd_status_update() returns zero,
bacause was not cleanup before).
We need to call rsnd_ssi_prepare(), because it enables SSI clocks
by calling rsnd_ssi_master_clk_start().

This patch allows to call prepare/cleanup functions always.

Signed-off-by: Dmytro Prokopchuk <dmytro.prokopchuk@globallogic.com>
Tested-by: Hiroyuki Yokoyama <hiroyuki.yokoyama.vx@renesas.com>
[kuninori: adjusted to upstream]
Signed-off-by: Kuninori Morimoto <kuninori.morimoto.gx@renesas.com>
Signed-off-by: Mark Brown <broonie@kernel.org>
5 years agoASoC: qcom: qdsp6: remove duplicated include from q6adm.c
zhong jiang [Fri, 21 Sep 2018 10:24:58 +0000 (18:24 +0800)]
ASoC: qcom: qdsp6: remove duplicated include from q6adm.c

We include wait.h twice in q6adm.c. it is unnecessary. hence remove
it.  Further, order the include files as alphabet.

Signed-off-by: zhong jiang <zhongjiang@huawei.com>
Signed-off-by: Mark Brown <broonie@kernel.org>
5 years agoASoC: tidyup for_each_card_prelinks() dai_link
Kuninori Morimoto [Fri, 21 Sep 2018 07:46:28 +0000 (07:46 +0000)]
ASoC: tidyup for_each_card_prelinks() dai_link

commit 7fe072b4df5d0 ("ASoC: add for_each_card_prelinks() macro")
added new for_each_card_prelinks() macro, but it had typo.
This patch fixup it

Signed-off-by: Kuninori Morimoto <kuninori.morimoto.gx@renesas.com>
Signed-off-by: Mark Brown <broonie@kernel.org>
5 years agoASoC: rt5663: Remove the boost volume in the beginning of playback
Oder Chiou [Wed, 19 Sep 2018 01:56:47 +0000 (09:56 +0800)]
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>
5 years agoASoC: add for_each_dpcm_be() macro
Kuninori Morimoto [Tue, 18 Sep 2018 01:31:09 +0000 (01:31 +0000)]
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>
5 years agoASoC: add for_each_dpcm_fe() macro
Kuninori Morimoto [Tue, 18 Sep 2018 01:30:54 +0000 (01:30 +0000)]
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>
5 years agoASoC: add for_each_comp_order() macro
Kuninori Morimoto [Tue, 18 Sep 2018 01:30:41 +0000 (01:30 +0000)]
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>
5 years agoASoC: add for_each_card_components() macro
Kuninori Morimoto [Tue, 18 Sep 2018 01:29:55 +0000 (01:29 +0000)]
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>
5 years agoASoC: add for_each_card_rtds() macro
Kuninori Morimoto [Tue, 18 Sep 2018 01:29:35 +0000 (01:29 +0000)]
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>
5 years agoASoC: add for_each_card_links() macro
Kuninori Morimoto [Tue, 18 Sep 2018 01:29:16 +0000 (01:29 +0000)]
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>
5 years agoASoC: add for_each_card_prelinks() macro
Kuninori Morimoto [Tue, 18 Sep 2018 01:28:49 +0000 (01:28 +0000)]
ASoC: add for_each_card_prelinks() macro

To be more readable code, this patch adds
new for_each_card_prelinks() 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>
5 years agoASoC: rename for_each_rtd_codec_dai_reverse to rollback
Kuninori Morimoto [Tue, 18 Sep 2018 01:28:30 +0000 (01:28 +0000)]
ASoC: rename for_each_rtd_codec_dai_reverse to rollback

commit 0b7990e38971 ("ASoC: add for_each_rtd_codec_dai() macro")
added for_each_rtd_codec_dai_reverse(). but _rollback() is better
naming than _reverse(). This patch rename it.

Signed-off-by: Kuninori Morimoto <kuninori.morimoto.gx@renesas.com>
Signed-off-by: Mark Brown <broonie@kernel.org>
5 years agoASoC: convert for_each_rtd_codec_dai() for missing part
Kuninori Morimoto [Tue, 18 Sep 2018 01:28:04 +0000 (01:28 +0000)]
ASoC: convert for_each_rtd_codec_dai() for missing part

commit 0b7990e38971 ("ASoC: add for_each_rtd_codec_dai() macro")
added for_each_rtd_codec_dai(), but it didn't convert few loop
which is not using "rtd". This patch fixup it.

Signed-off-by: Kuninori Morimoto <kuninori.morimoto.gx@renesas.com>
Signed-off-by: Mark Brown <broonie@kernel.org>
5 years agoASoC: q6afe: dt-bindings: Update input range for qcom,sd-lines
Rohit kumar [Wed, 19 Sep 2018 06:11:21 +0000 (11:41 +0530)]
ASoC: q6afe: dt-bindings: Update input range for qcom,sd-lines

Input to qcom,sd-lines should be between 0 and 3 instead of
1 to 4 as 0 corresponds to BIT(0) which is MI2S_SD0 line.
Bit 1 to 3 corresponds to SD1 to SD3 lines respectively.
Updated documentation for the same.

Signed-off-by: Rohit kumar <rohitkr@codeaurora.org>
Signed-off-by: Mark Brown <broonie@kernel.org>
5 years agoASoC: rt5677-spi: Drop unused GPIO include
Linus Walleij [Tue, 18 Sep 2018 19:11:57 +0000 (12:11 -0700)]
ASoC: rt5677-spi: Drop unused GPIO include

This SPI driver does not use the legacy GPIO header so
just delete it.

Signed-off-by: Linus Walleij <linus.walleij@linaro.org>
Signed-off-by: Mark Brown <broonie@kernel.org>
5 years agoASoC: rt5682: Minor code modification
Shuming Fan [Tue, 18 Sep 2018 11:51:53 +0000 (19:51 +0800)]
ASoC: rt5682: Minor code modification

Minor code changes are:
 - improve the readability in patch list
 - add i2c remove function
 - regmap_register_patch changes to regmap_multi_reg_write

Signed-off-by: Shuming Fan <shumingf@realtek.com>
Signed-off-by: Mark Brown <broonie@kernel.org>
5 years agoASoC: AMD: Fix capture unstable in beginning for some runs
Akshu Agrawal [Tue, 18 Sep 2018 07:23:13 +0000 (12:53 +0530)]
ASoC: AMD: Fix capture unstable in beginning for some runs

alsa_conformance_test -C hw:0,4 -p 1024 --debug
would sometime show:
TIME_DIFF(s)    HW_LEVEL       READ              RATE
0.000095970         1024       1024    10670001.041992
0.042609555         1024       2048       24032.168372
0.021330364         1024       3072       48006.681930
0.021339559         1024       4096       47985.996337
The issue is that in dma pointer function we can have stale value
of the register for current descriptor of channel.
The register retains the number of the last descriptor that
was transferred.

Fix ensures that we report position, 0, till the one period worth of
data is transferred.  After one period of data, in handler of period
completion interrupt we update the config and correct value of descriptor
starts reflecting.

Signed-off-by: Akshu Agrawal <akshu.agrawal@amd.com>
Signed-off-by: Mark Brown <broonie@kernel.org>
5 years agoASoC: rt5682: Fix the boost volume at the begining of playback
Shuming Fan [Tue, 18 Sep 2018 11:51:38 +0000 (19:51 +0800)]
ASoC: rt5682: Fix the boost volume at the begining of playback

This patch fixed the boost volume at the begining of playback
while DAC volume set to lower level.

Signed-off-by: Shuming Fan <shumingf@realtek.com>
Signed-off-by: Mark Brown <broonie@kernel.org>
5 years agoASoC: rt5682: Update calibration function
Shuming Fan [Tue, 18 Sep 2018 11:50:38 +0000 (19:50 +0800)]
ASoC: rt5682: Update calibration function

The ADC/DAC path should open while calibration process.

Signed-off-by: Shuming Fan <shumingf@realtek.com>
Signed-off-by: Mark Brown <broonie@kernel.org>
5 years agoMerge branch 'asoc-4.19' into asoc-4.20 for rt5682 deps.
Mark Brown [Tue, 18 Sep 2018 17:30:14 +0000 (10:30 -0700)]
Merge branch 'asoc-4.19' into asoc-4.20 for rt5682 deps.

5 years agoASoC: rt5682: Remove HP volume control
Shuming Fan [Tue, 18 Sep 2018 11:51:24 +0000 (19:51 +0800)]
ASoC: rt5682: Remove HP volume control

This patch removed Headphone Playback Volume control.
Due to codec settings, we don't want the user to change HP analog gain.
The user could use DAC1 Playback Volume control to
change playback volume.

Signed-off-by: Shuming Fan <shumingf@realtek.com>
Signed-off-by: Mark Brown <broonie@kernel.org>
5 years agoASoC: rt5682: Improve HP performance
Shuming Fan [Tue, 18 Sep 2018 11:51:08 +0000 (19:51 +0800)]
ASoC: rt5682: Improve HP performance

We change the settings while HP power-up for better performance.

Signed-off-by: Shuming Fan <shumingf@realtek.com>
Signed-off-by: Mark Brown <broonie@kernel.org>
5 years agoASoC: remove redundant include
zhong jiang [Tue, 18 Sep 2018 08:16:24 +0000 (16:16 +0800)]
ASoC: remove redundant include

module.h already contained moduleparam.h,  so it is safe to remove
the redundant include.

The issue is detected with the help of Coccinelle.

Signed-off-by: zhong jiang <zhongjiang@huawei.com>
Acked-by: Charles Keepax <ckeepax@opensource.cirrus.com>
Signed-off-by: Mark Brown <broonie@kernel.org>
5 years agoASoC: rt5514-spi: Get the period_bytes in the copy work to make sure the value correctly
Oder Chiou [Mon, 17 Sep 2018 11:03:09 +0000 (19:03 +0800)]
ASoC: rt5514-spi: Get the period_bytes in the copy work to make sure the value correctly

The value of period_bytes will get the zero before the hw_params() is not
run completely. Move the function snd_pcm_lib_period_bytes() to copy work,
and make sure that is not zero.

Signed-off-by: Oder Chiou <oder_chiou@realtek.com>
Signed-off-by: Mark Brown <broonie@kernel.org>
5 years agoASoC: soc-core: add snd_soc_is_matching_component()
Kuninori Morimoto [Tue, 11 Sep 2018 06:51:45 +0000 (06:51 +0000)]
ASoC: soc-core: add snd_soc_is_matching_component()

To find (CPU/)Codec/Platform, we need to find component first
(= on CPU/Codec/Platform), and find DAI from it (= CPU/Codec).
These are similar operation but difficult to be simple,
and has many duplicate code to finding component.
This patch adds new snd_soc_is_matching_component(),
and reduce duplicate codes.

Signed-off-by: Kuninori Morimoto <kuninori.morimoto.gx@renesas.com>
Signed-off-by: Mark Brown <broonie@kernel.org>
5 years agoASoC: soc-core: manage platform name under snd_soc_init_platform()
Kuninori Morimoto [Tue, 11 Sep 2018 06:51:14 +0000 (06:51 +0000)]
ASoC: soc-core: manage platform name under snd_soc_init_platform()

Now "platform" is controlled by snd_soc_dai_link_component,
thus its "name" can be initialized in snd_soc_init_platform(),
instead of soc_bind_dai_link() local.
This patch do it.

Signed-off-by: Kuninori Morimoto <kuninori.morimoto.gx@renesas.com>
Signed-off-by: Mark Brown <broonie@kernel.org>
5 years agoASoC: qdsp6: q6asm-dai: remove duplicated include from q6asm-dai.c
YueHaibing [Fri, 14 Sep 2018 01:36:04 +0000 (01:36 +0000)]
ASoC: qdsp6: q6asm-dai: remove duplicated include from q6asm-dai.c

Remove duplicated include.

Signed-off-by: YueHaibing <yuehaibing@huawei.com>
Acked-by: Srinivas Kandagatla <srinivas.kandagatla@linaro.org>
Signed-off-by: Mark Brown <broonie@kernel.org>
5 years agoASoC: hisilicon: fix fall-through annotations
Gustavo A. R. Silva [Thu, 13 Sep 2018 19:11:07 +0000 (14:11 -0500)]
ASoC: hisilicon: fix fall-through annotations

Replace "fallthru" with a proper "fall through" annotation.

This fix is part of the ongoing efforts to enabling
-Wimplicit-fallthrough

Signed-off-by: Gustavo A. R. Silva <gustavo@embeddedor.com>
Signed-off-by: Mark Brown <broonie@kernel.org>
5 years agoASoC: es8328: Fix fall-through annotations
Gustavo A. R. Silva [Thu, 13 Sep 2018 19:08:15 +0000 (14:08 -0500)]
ASoC: es8328: Fix fall-through annotations

Replace "fallthru" with a proper "fall through" annotation.

This fix is part of the ongoing efforts to enabling
-Wimplicit-fallthrough

Signed-off-by: Gustavo A. R. Silva <gustavo@embeddedor.com>
Signed-off-by: Mark Brown <broonie@kernel.org>
5 years agoALSA: hda: Fix implicit definition of pci_iomap() on SH
Mark Brown [Wed, 12 Sep 2018 11:31:32 +0000 (12:31 +0100)]
ALSA: hda: Fix implicit definition of pci_iomap() on SH

Include asm/io.h directly so we've got a definition of pci_iomap(), the
current set of includes do this implicitly on most architectures but not
on SH.

Reported-by: kbuild test robot <lkp@intel.com>
Signed-off-by: Mark Brown <broonie@kernel.org>
5 years agosound: don't call skl_init_chip() to reset intel skl soc
Yu Zhao [Tue, 11 Sep 2018 21:15:16 +0000 (15:15 -0600)]
sound: don't call skl_init_chip() to reset intel skl soc

Internally, skl_init_chip() calls snd_hdac_bus_init_chip() which
1) sets bus->chip_init to prevent multiple entrances before device
is stopped; 2) enables interrupt.

We shouldn't use it for the purpose of resetting device only because
1) when we really want to initialize device, we won't be able to do
so; 2) we are ready to handle interrupt yet, and kernel crashes when
interrupt comes in.

Rename azx_reset() to snd_hdac_bus_reset_link(), and use it to reset
device properly.

Fixes: 60767abcea3d ("ASoC: Intel: Skylake: Reset the controller in probe")
Reviewed-by: Takashi Iwai <tiwai@suse.de>
Signed-off-by: Yu Zhao <yuzhao@google.com>
Signed-off-by: Mark Brown <broonie@kernel.org>
5 years agosound: enable interrupt after dma buffer initialization
Yu Zhao [Tue, 11 Sep 2018 21:14:04 +0000 (15:14 -0600)]
sound: enable interrupt after dma buffer initialization

In snd_hdac_bus_init_chip(), we enable interrupt before
snd_hdac_bus_init_cmd_io() initializing dma buffers. If irq has
been acquired and irq handler uses the dma buffer, kernel may crash
when interrupt comes in.

Fix the problem by postponing enabling irq after dma buffer
initialization. And warn once on null dma buffer pointer during the
initialization.

Reviewed-by: Takashi Iwai <tiwai@suse.de>
Signed-off-by: Yu Zhao <yuzhao@google.com>
Signed-off-by: Mark Brown <broonie@kernel.org>
5 years agoRevert "ASoC: Intel: Skylake: Acquire irq after RIRB allocation"
Yu Zhao [Tue, 11 Sep 2018 21:12:46 +0000 (15:12 -0600)]
Revert "ASoC: Intel: Skylake: Acquire irq after RIRB allocation"

This reverts commit 12eeeb4f4733bbc4481d01df35933fc15beb8b19.

The patch doesn't fix accessing memory with null pointer in
skl_interrupt().

There are two problems: 1) skl_init_chip() is called twice, before
and after dma buffer is allocate. The first call sets bus->chip_init
which prevents the second from initializing bus->corb.buf and
rirb.buf from bus->rb.area. 2) snd_hdac_bus_init_chip() enables
interrupt before snd_hdac_bus_init_cmd_io() initializing dma buffers.
There is a small window which skl_interrupt() can be called if irq
has been acquired. If so, it crashes when using null dma buffer
pointers.

Will fix the problems in the following patches. Also attaching the
crash for future reference.

[   16.949148] general protection fault: 0000 [#1] PREEMPT SMP KASAN PTI
<snipped>
[   16.950903] Call Trace:
[   16.950906]  <IRQ>
[   16.950918]  skl_interrupt+0x19e/0x2d6 [snd_soc_skl]
[   16.950926]  ? dma_supported+0xb5/0xb5 [snd_soc_skl]
[   16.950933]  __handle_irq_event_percpu+0x27a/0x6c8
[   16.950937]  ? __irq_wake_thread+0x1d1/0x1d1
[   16.950942]  ? __do_softirq+0x57a/0x69e
[   16.950944]  handle_irq_event_percpu+0x95/0x1ba
[   16.950948]  ? _raw_spin_unlock+0x65/0xdc
[   16.950951]  ? __handle_irq_event_percpu+0x6c8/0x6c8
[   16.950953]  ? _raw_spin_unlock+0x65/0xdc
[   16.950957]  ? time_cpufreq_notifier+0x483/0x483
[   16.950959]  handle_irq_event+0x89/0x123
[   16.950962]  handle_fasteoi_irq+0x16f/0x425
[   16.950965]  handle_irq+0x1fe/0x28e
[   16.950969]  do_IRQ+0x6e/0x12e
[   16.950972]  common_interrupt+0x7a/0x7a
[   16.950974]  </IRQ>
<snipped>
[   16.951031] RIP: snd_hdac_bus_update_rirb+0x19b/0x4cf [snd_hda_core] RSP: ffff88015c807c08
[   16.951036] ---[ end trace 58bf9ece1775bc92 ]---

Fixes: 2eeeb4f4733b ("ASoC: Intel: Skylake: Acquire irq after RIRB allocation")
Signed-off-by: Yu Zhao <yuzhao@google.com>
Signed-off-by: Mark Brown <broonie@kernel.org>
5 years agoASoC: soc-core: remove dai->driver NULL check
Kuninori Morimoto [Tue, 11 Sep 2018 06:50:27 +0000 (15:50 +0900)]
ASoC: soc-core: remove dai->driver NULL check

It is strange if it has "dai" but doesn't have "dai->driver".
And more over "dai->driver->xxx" is used everywhere without
"dai->driver" pointer NULL checking.
It got Oops already if "dai->driver" was NULL.
Let's remove un-needed "dai->driver" NULL check.

Signed-off-by: Kuninori Morimoto <kuninori.morimoto.gx@renesas.com>
Signed-off-by: Mark Brown <broonie@kernel.org>
5 years agoASoC: core: add support to card rebind
Srinivas Kandagatla [Wed, 12 Sep 2018 09:15:00 +0000 (10:15 +0100)]
ASoC: core: add support to card rebind

Current behaviour of ASoC core w.r.t to component removal is that it
unregisters dependent sound card totally. There is no support to
rebind the card if the component comes back.
Typical use case is DSP restart or kernel modules itself.

With this patch, core now maintains list of cards that are unbind due to
any of its depended components are removed and card not unregistered yet.
This list is cleared when the card is rebind successfully or when the
card is unregistered from machine driver.

This list of unbind cards are tried to bind once again after every new
component is successfully added, giving a fair chance for card bind
to be successful.

Signed-off-by: Srinivas Kandagatla <srinivas.kandagatla@linaro.org>
Signed-off-by: Mark Brown <broonie@kernel.org>
5 years agoASoC: remove unneeded static set .owner field in platform_driver
zhong jiang [Wed, 12 Sep 2018 03:41:49 +0000 (11:41 +0800)]
ASoC: remove unneeded static set .owner field in platform_driver

platform_driver_register will set the .owner field. So it is safe
to remove the redundant assignment.

The issue is detected with the help of Coccinelle.

Signed-off-by: zhong jiang <zhongjiang@huawei.com>
Signed-off-by: Mark Brown <broonie@kernel.org>