linux-2.6-block.git
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: 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: 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>
5 years agoASoC: rockchip: add missing INTERLEAVED PCM attribute
Katsuhiro Suzuki [Mon, 10 Sep 2018 16:39:32 +0000 (01:39 +0900)]
ASoC: rockchip: add missing INTERLEAVED PCM attribute

This patch adds SNDRV_PCM_INFO_INTERLEAVED into PCM hardware info.

Signed-off-by: Katsuhiro Suzuki <katsuhiro@katsuster.net>
Signed-off-by: Mark Brown <broonie@kernel.org>
5 years agoASoC: soc-core: remove unused num_dai_links
Kuninori Morimoto [Tue, 11 Sep 2018 06:59:01 +0000 (06:59 +0000)]
ASoC: soc-core: remove unused num_dai_links

ALSA SoC is counting card->dai_link_list user,
but no-one is using it.
Let's remove it.

Signed-off-by: Kuninori Morimoto <kuninori.morimoto.gx@renesas.com>
Signed-off-by: Mark Brown <broonie@kernel.org>
5 years agoASoC: soc-core: avoid nested code on soc_remove_dai()
Kuninori Morimoto [Tue, 11 Sep 2018 06:54:26 +0000 (06:54 +0000)]
ASoC: soc-core: avoid nested code on soc_remove_dai()

Nested code is not readable.
This patch avoid it on soc_remove_dai().

Signed-off-by: Kuninori Morimoto <kuninori.morimoto.gx@renesas.com>
Signed-off-by: Mark Brown <broonie@kernel.org>
5 years agoASoC: rt5668: remove empty rt5668_i2c_remove()
Kuninori Morimoto [Tue, 11 Sep 2018 07:02:04 +0000 (07:02 +0000)]
ASoC: rt5668: remove empty rt5668_i2c_remove()

rt5668_i2c_remove() is empty, and no longer needed.
Let's remove it.

Signed-off-by: Kuninori Morimoto <kuninori.morimoto.gx@renesas.com>
Signed-off-by: Mark Brown <broonie@kernel.org>
5 years agoASoC: Fix UBSAN warning at snd_soc_get/put_volsw_sx()
Rohit kumar [Tue, 11 Sep 2018 09:29:21 +0000 (14:59 +0530)]
ASoC: Fix UBSAN warning at snd_soc_get/put_volsw_sx()

In functions snd_soc_get_volsw_sx() or snd_soc_put_volsw_sx(),
if the result of (min + max) is negative, then fls() returns
signed integer with value as 32. This leads to signed integer
overflow as complete operation is considered as signed integer.

UBSAN: Undefined behaviour in sound/soc/soc-ops.c:382:50
signed integer overflow:
-2147483648 - 1 cannot be represented in type 'int'
Call trace:
[<ffffff852f746fe4>] __dump_stack lib/dump_stack.c:15 [inline]
[<ffffff852f746fe4>] dump_stack+0xec/0x158 lib/dump_stack.c:51
[<ffffff852f7b5f3c>] ubsan_epilogue+0x18/0x50 lib/ubsan.c:164
[<ffffff852f7b6840>] handle_overflow+0xf8/0x130 lib/ubsan.c:195
[<ffffff852f7b68f0>] __ubsan_handle_sub_overflow+0x34/0x44 lib/ubsan.c:211
[<ffffff85307971a0>] snd_soc_get_volsw_sx+0x1a8/0x1f8 sound/soc/soc-ops.c:382

Typecast the operation to unsigned int to fix the issue.

Signed-off-by: Rohit kumar <rohitkr@codeaurora.org>
Signed-off-by: Mark Brown <broonie@kernel.org>
5 years agoMerge branch 'asoc-4.19' into asoc-4.20 Cirrus conflict
Mark Brown [Mon, 10 Sep 2018 17:55:12 +0000 (18:55 +0100)]
Merge branch 'asoc-4.19' into asoc-4.20 Cirrus conflict

5 years agoASoC: pxa: switch to new ac97 bus support
Robert Jarzmik [Sat, 25 Aug 2018 08:46:18 +0000 (10:46 +0200)]
ASoC: pxa: switch to new ac97 bus support

Switch to the new ac97 bus support in sound/ac97 instead of the legacy
snd_ac97 one.

Signed-off-by: Robert Jarzmik <robert.jarzmik@free.fr>
Signed-off-by: Mark Brown <broonie@kernel.org>
5 years agoASoC: AMD: Fix simultaneous playback and capture on different channel
Akshu Agrawal [Mon, 10 Sep 2018 17:20:27 +0000 (22:50 +0530)]
ASoC: AMD: Fix simultaneous playback and capture on different channel

If capture and playback are started on different channel (I2S/BT)
there is a possibilty that channel information passed from machine driver
is overwritten before the configuration is done in dma driver.
Example:
113.597588: cz_max_startup: ---playback sets BT channel
113.597694: cz_dmic1_startup: ---capture sets I2S channel
113.597979: acp_dma_hw_params: ---configures capture for I2S channel
113.598114: acp_dma_hw_params: ---configures playback for I2S channel

This is fixed by having 2 separate instance for playback and capture.

Signed-off-by: Akshu Agrawal <akshu.agrawal@amd.com>
Signed-off-by: Mark Brown <broonie@kernel.org>
5 years agoASoC: cs4265: fix MMTLR Data switch control
Sébastien Szymanski [Thu, 6 Sep 2018 09:16:00 +0000 (11:16 +0200)]
ASoC: cs4265: fix MMTLR Data switch control

The MMTLR bit is in the CS4265_SPDIF_CTL2 register at address 0x12 bit 0
and not at address 0x0 bit 1. Fix this.

Signed-off-by: Sébastien Szymanski <sebastien.szymanski@armadeus.com>
Signed-off-by: Mark Brown <broonie@kernel.org>
Cc: stable@vger.kernel.org
5 years agoASoC: dapm: Add missing return value check for snd_soc_dapm_new_dai
Charles Keepax [Mon, 10 Sep 2018 14:28:39 +0000 (15:28 +0100)]
ASoC: dapm: Add missing return value check for snd_soc_dapm_new_dai

snd_soc_dapm_new_dai may return an error pointer and currently this
isn't checked for in dapm_connect_dai_link_widgets. Add code to check
the return value and not add routes in that case.

Fixes: 778ff5bb8689 ("ASoC: dapm: Move connection of CODEC to CODEC DAIs")
Reported-by: Dan Carpenter <dan.carpenter@oracle.com>
Signed-off-by: Charles Keepax <ckeepax@opensource.cirrus.com>
Signed-off-by: Mark Brown <broonie@kernel.org>
5 years agoASoC: skl-topology: Use kmemdup to replace kzalloc + memcpy
zhong jiang [Sat, 8 Sep 2018 08:36:20 +0000 (16:36 +0800)]
ASoC: skl-topology: Use kmemdup to replace kzalloc + memcpy

kmemdup has implemented the function that kzalloc() + memcpy() will
do. and we prefer to kmemdup rather than the open coded implementation.

Signed-off-by: zhong jiang <zhongjiang@huawei.com>
Signed-off-by: Mark Brown <broonie@kernel.org>
5 years agoASoC: q6core: Use kmemdup to replace kzalloc + memcpy
zhong jiang [Sat, 8 Sep 2018 08:36:19 +0000 (16:36 +0800)]
ASoC: q6core: Use kmemdup to replace kzalloc + memcpy

kmemdup has implemented the function that kzalloc() + memcpy() will
do. and we prefer to use the kmemdup rather than the open coded implementation.

Signed-off-by: zhong jiang <zhongjiang@huawei.com>
Signed-off-by: Mark Brown <broonie@kernel.org>
5 years agoASoC: txx9: use devm_snd_soc_register_component()
Kuninori Morimoto [Fri, 7 Sep 2018 01:03:53 +0000 (01:03 +0000)]
ASoC: txx9: use devm_snd_soc_register_component()

Now we have devm_snd_soc_register_component().
Let's use it instead of snd_soc_register_component().

Signed-off-by: Kuninori Morimoto <kuninori.morimoto.gx@renesas.com>
Signed-off-by: Mark Brown <broonie@kernel.org>
5 years agoASoC: sh: use devm_snd_soc_register_component()
Kuninori Morimoto [Fri, 7 Sep 2018 01:03:25 +0000 (01:03 +0000)]
ASoC: sh: use devm_snd_soc_register_component()

Now we have devm_snd_soc_register_component().
Let's use it instead of snd_soc_register_component().

Signed-off-by: Kuninori Morimoto <kuninori.morimoto.gx@renesas.com>
Signed-off-by: Mark Brown <broonie@kernel.org>
5 years agoASoC: omap: use devm_snd_soc_register_component()
Kuninori Morimoto [Fri, 7 Sep 2018 01:02:54 +0000 (01:02 +0000)]
ASoC: omap: use devm_snd_soc_register_component()

Now we have devm_snd_soc_register_component().
Let's use it instead of snd_soc_register_component().

Signed-off-by: Kuninori Morimoto <kuninori.morimoto.gx@renesas.com>
Signed-off-by: Mark Brown <broonie@kernel.org>
5 years agoASoC: nuc900: use devm_snd_soc_register_component()
Kuninori Morimoto [Fri, 7 Sep 2018 01:02:38 +0000 (01:02 +0000)]
ASoC: nuc900: use devm_snd_soc_register_component()

Now we have devm_snd_soc_register_component().
Let's use it instead of snd_soc_register_component().

Signed-off-by: Kuninori Morimoto <kuninori.morimoto.gx@renesas.com>
Signed-off-by: Mark Brown <broonie@kernel.org>
5 years agoASoC: tscs454: use devm_snd_soc_register_component()
Kuninori Morimoto [Fri, 7 Sep 2018 01:01:50 +0000 (01:01 +0000)]
ASoC: tscs454: use devm_snd_soc_register_component()

Now we have devm_snd_soc_register_component().
Let's use it instead of snd_soc_register_component().

Signed-off-by: Kuninori Morimoto <kuninori.morimoto.gx@renesas.com>
Signed-off-by: Mark Brown <broonie@kernel.org>
5 years agoASoC: rt5668: use devm_snd_soc_register_component()
Kuninori Morimoto [Fri, 7 Sep 2018 01:01:34 +0000 (01:01 +0000)]
ASoC: rt5668: use devm_snd_soc_register_component()

Now we have devm_snd_soc_register_component().
Let's use it instead of snd_soc_register_component().

Signed-off-by: Kuninori Morimoto <kuninori.morimoto.gx@renesas.com>
Signed-off-by: Mark Brown <broonie@kernel.org>
5 years agoASoC: hdac_hda: use devm_snd_soc_register_component()
Kuninori Morimoto [Fri, 7 Sep 2018 01:01:19 +0000 (01:01 +0000)]
ASoC: hdac_hda: use devm_snd_soc_register_component()

Now we have devm_snd_soc_register_component().
Let's use it instead of snd_soc_register_component().

Signed-off-by: Kuninori Morimoto <kuninori.morimoto.gx@renesas.com>
Signed-off-by: Mark Brown <broonie@kernel.org>
5 years agoASoC: bcm: use devm_snd_soc_register_component()
Kuninori Morimoto [Fri, 7 Sep 2018 01:00:49 +0000 (01:00 +0000)]
ASoC: bcm: use devm_snd_soc_register_component()

Now we have devm_snd_soc_register_component().
Let's use it instead of snd_soc_register_component().

Signed-off-by: Kuninori Morimoto <kuninori.morimoto.gx@renesas.com>
Signed-off-by: Mark Brown <broonie@kernel.org>