platform/kernel/linux-rpi.git
5 years agoASoC: pxa: e800_wm9712: use modern dai_link style
Kuninori Morimoto [Thu, 6 Jun 2019 04:11:12 +0000 (13:11 +0900)]
ASoC: pxa: e800_wm9712: use modern dai_link style

ASoC is now supporting modern style dai_link
(= snd_soc_dai_link_component) for CPU/Codec/Platform.
This patch switches to use it.

Signed-off-by: Kuninori Morimoto <kuninori.morimoto.gx@renesas.com>
Signed-off-by: Mark Brown <broonie@kernel.org>
5 years agoASoC: pxa: e750_wm9705: use modern dai_link style
Kuninori Morimoto [Thu, 6 Jun 2019 04:11:06 +0000 (13:11 +0900)]
ASoC: pxa: e750_wm9705: use modern dai_link style

ASoC is now supporting modern style dai_link
(= snd_soc_dai_link_component) for CPU/Codec/Platform.
This patch switches to use it.

Signed-off-by: Kuninori Morimoto <kuninori.morimoto.gx@renesas.com>
Signed-off-by: Mark Brown <broonie@kernel.org>
5 years agoASoC: pxa: e740_wm9705: use modern dai_link style
Kuninori Morimoto [Thu, 6 Jun 2019 04:11:01 +0000 (13:11 +0900)]
ASoC: pxa: e740_wm9705: use modern dai_link style

ASoC is now supporting modern style dai_link
(= snd_soc_dai_link_component) for CPU/Codec/Platform.
This patch switches to use it.

Signed-off-by: Kuninori Morimoto <kuninori.morimoto.gx@renesas.com>
Signed-off-by: Mark Brown <broonie@kernel.org>
5 years agoASoC: pxa: corgi: use modern dai_link style
Kuninori Morimoto [Thu, 6 Jun 2019 04:10:56 +0000 (13:10 +0900)]
ASoC: pxa: corgi: use modern dai_link style

ASoC is now supporting modern style dai_link
(= snd_soc_dai_link_component) for CPU/Codec/Platform.
This patch switches to use it.

Signed-off-by: Kuninori Morimoto <kuninori.morimoto.gx@renesas.com>
Signed-off-by: Mark Brown <broonie@kernel.org>
5 years agoASoC: pxa: brownstone: use modern dai_link style
Kuninori Morimoto [Thu, 6 Jun 2019 04:10:51 +0000 (13:10 +0900)]
ASoC: pxa: brownstone: use modern dai_link style

ASoC is now supporting modern style dai_link
(= snd_soc_dai_link_component) for CPU/Codec/Platform.
This patch switches to use it.

Signed-off-by: Kuninori Morimoto <kuninori.morimoto.gx@renesas.com>
Signed-off-by: Mark Brown <broonie@kernel.org>
5 years agoASoC: samsung: jive_wm8750: use modern dai_link style
Kuninori Morimoto [Thu, 6 Jun 2019 04:10:46 +0000 (13:10 +0900)]
ASoC: samsung: jive_wm8750: use modern dai_link style

ASoC is now supporting modern style dai_link
(= snd_soc_dai_link_component) for CPU/Codec/Platform.
This patch switches to use it.

Signed-off-by: Kuninori Morimoto <kuninori.morimoto.gx@renesas.com>
Signed-off-by: Mark Brown <broonie@kernel.org>
5 years agoASoC: samsung: littlemill: use modern dai_link style
Kuninori Morimoto [Thu, 6 Jun 2019 04:10:41 +0000 (13:10 +0900)]
ASoC: samsung: littlemill: use modern dai_link style

ASoC is now supporting modern style dai_link
(= snd_soc_dai_link_component) for CPU/Codec/Platform.
This patch switches to use it.

Signed-off-by: Kuninori Morimoto <kuninori.morimoto.gx@renesas.com>
Signed-off-by: Mark Brown <broonie@kernel.org>
5 years agoASoC: samsung: lowland: use modern dai_link style
Kuninori Morimoto [Thu, 6 Jun 2019 04:10:36 +0000 (13:10 +0900)]
ASoC: samsung: lowland: use modern dai_link style

ASoC is now supporting modern style dai_link
(= snd_soc_dai_link_component) for CPU/Codec/Platform.
This patch switches to use it.

Signed-off-by: Kuninori Morimoto <kuninori.morimoto.gx@renesas.com>
Signed-off-by: Mark Brown <broonie@kernel.org>
5 years agoASoC: samsung: neo1973_wm8753: use modern dai_link style
Kuninori Morimoto [Thu, 6 Jun 2019 04:10:32 +0000 (13:10 +0900)]
ASoC: samsung: neo1973_wm8753: use modern dai_link style

ASoC is now supporting modern style dai_link
(= snd_soc_dai_link_component) for CPU/Codec/Platform.
This patch switches to use it.

Signed-off-by: Kuninori Morimoto <kuninori.morimoto.gx@renesas.com>
Signed-off-by: Mark Brown <broonie@kernel.org>
5 years agoASoC: samsung: odroid: use modern dai_link style
Kuninori Morimoto [Thu, 6 Jun 2019 04:10:26 +0000 (13:10 +0900)]
ASoC: samsung: odroid: use modern dai_link style

ASoC is now supporting modern style dai_link
(= snd_soc_dai_link_component) for CPU/Codec/Platform.
This patch switches to use it.

Signed-off-by: Kuninori Morimoto <kuninori.morimoto.gx@renesas.com>
Signed-off-by: Mark Brown <broonie@kernel.org>
5 years agoASoC: samsung: rx1950_uda1380: use modern dai_link style
Kuninori Morimoto [Thu, 6 Jun 2019 04:10:21 +0000 (13:10 +0900)]
ASoC: samsung: rx1950_uda1380: use modern dai_link style

ASoC is now supporting modern style dai_link
(= snd_soc_dai_link_component) for CPU/Codec/Platform.
This patch switches to use it.

Signed-off-by: Kuninori Morimoto <kuninori.morimoto.gx@renesas.com>
Signed-off-by: Mark Brown <broonie@kernel.org>
5 years agoASoC: samsung: s3c24xx_simtec_hermes: use modern dai_link style
Kuninori Morimoto [Thu, 6 Jun 2019 04:10:16 +0000 (13:10 +0900)]
ASoC: samsung: s3c24xx_simtec_hermes: use modern dai_link style

ASoC is now supporting modern style dai_link
(= snd_soc_dai_link_component) for CPU/Codec/Platform.
This patch switches to use it.

Signed-off-by: Kuninori Morimoto <kuninori.morimoto.gx@renesas.com>
Signed-off-by: Mark Brown <broonie@kernel.org>
5 years agoASoC: samsung: s3c24xx_simtec_tlv320aic23: use modern dai_link style
Kuninori Morimoto [Thu, 6 Jun 2019 04:10:11 +0000 (13:10 +0900)]
ASoC: samsung: s3c24xx_simtec_tlv320aic23: use modern dai_link style

ASoC is now supporting modern style dai_link
(= snd_soc_dai_link_component) for CPU/Codec/Platform.
This patch switches to use it.

Signed-off-by: Kuninori Morimoto <kuninori.morimoto.gx@renesas.com>
Signed-off-by: Mark Brown <broonie@kernel.org>
5 years agoASoC: samsung: s3c24xx_uda134x: use modern dai_link style
Kuninori Morimoto [Thu, 6 Jun 2019 04:10:06 +0000 (13:10 +0900)]
ASoC: samsung: s3c24xx_uda134x: use modern dai_link style

ASoC is now supporting modern style dai_link
(= snd_soc_dai_link_component) for CPU/Codec/Platform.
This patch switches to use it.

Signed-off-by: Kuninori Morimoto <kuninori.morimoto.gx@renesas.com>
Signed-off-by: Mark Brown <broonie@kernel.org>
5 years agoASoC: samsung: smartq_wm8987: use modern dai_link style
Kuninori Morimoto [Thu, 6 Jun 2019 04:10:01 +0000 (13:10 +0900)]
ASoC: samsung: smartq_wm8987: use modern dai_link style

ASoC is now supporting modern style dai_link
(= snd_soc_dai_link_component) for CPU/Codec/Platform.
This patch switches to use it.

Signed-off-by: Kuninori Morimoto <kuninori.morimoto.gx@renesas.com>
Signed-off-by: Mark Brown <broonie@kernel.org>
5 years agoASoC: samsung: snow: use modern dai_link style
Kuninori Morimoto [Thu, 6 Jun 2019 04:09:56 +0000 (13:09 +0900)]
ASoC: samsung: snow: use modern dai_link style

ASoC is now supporting modern style dai_link
(= snd_soc_dai_link_component) for CPU/Codec/Platform.
This patch switches to use it.

Signed-off-by: Kuninori Morimoto <kuninori.morimoto.gx@renesas.com>
Signed-off-by: Mark Brown <broonie@kernel.org>
5 years agoASoC: samsung: speyside: use modern dai_link style
Kuninori Morimoto [Thu, 6 Jun 2019 04:09:50 +0000 (13:09 +0900)]
ASoC: samsung: speyside: use modern dai_link style

ASoC is now supporting modern style dai_link
(= snd_soc_dai_link_component) for CPU/Codec/Platform.
This patch switches to use it.

Signed-off-by: Kuninori Morimoto <kuninori.morimoto.gx@renesas.com>
Signed-off-by: Mark Brown <broonie@kernel.org>
5 years agoASoC: samsung: tm2_wm5110: use modern dai_link style
Kuninori Morimoto [Thu, 6 Jun 2019 04:09:44 +0000 (13:09 +0900)]
ASoC: samsung: tm2_wm5110: use modern dai_link style

ASoC is now supporting modern style dai_link
(= snd_soc_dai_link_component) for CPU/Codec/Platform.
This patch switches to use it.

Signed-off-by: Kuninori Morimoto <kuninori.morimoto.gx@renesas.com>
Signed-off-by: Mark Brown <broonie@kernel.org>
5 years agoASoC: samsung: tobermory: use modern dai_link style
Kuninori Morimoto [Thu, 6 Jun 2019 04:09:36 +0000 (13:09 +0900)]
ASoC: samsung: tobermory: use modern dai_link style

ASoC is now supporting modern style dai_link
(= snd_soc_dai_link_component) for CPU/Codec/Platform.
This patch switches to use it.

Signed-off-by: Kuninori Morimoto <kuninori.morimoto.gx@renesas.com>
Signed-off-by: Mark Brown <broonie@kernel.org>
5 years agoASoC: samsung: arndale_rt5631: use modern dai_link style
Kuninori Morimoto [Thu, 6 Jun 2019 04:09:30 +0000 (13:09 +0900)]
ASoC: samsung: arndale_rt5631: use modern dai_link style

ASoC is now supporting modern style dai_link
(= snd_soc_dai_link_component) for CPU/Codec/Platform.
This patch switches to use it.

Signed-off-by: Kuninori Morimoto <kuninori.morimoto.gx@renesas.com>
Signed-off-by: Mark Brown <broonie@kernel.org>
5 years agoASoC: samsung: h1940_uda1380: use modern dai_link style
Kuninori Morimoto [Thu, 6 Jun 2019 04:09:25 +0000 (13:09 +0900)]
ASoC: samsung: h1940_uda1380: use modern dai_link style

ASoC is now supporting modern style dai_link
(= snd_soc_dai_link_component) for CPU/Codec/Platform.
This patch switches to use it.

Signed-off-by: Kuninori Morimoto <kuninori.morimoto.gx@renesas.com>
Signed-off-by: Mark Brown <broonie@kernel.org>
5 years agoASoC: samsung: smdk_spdif: use modern dai_link style
Kuninori Morimoto [Thu, 6 Jun 2019 04:09:19 +0000 (13:09 +0900)]
ASoC: samsung: smdk_spdif: use modern dai_link style

ASoC is now supporting modern style dai_link
(= snd_soc_dai_link_component) for CPU/Codec/Platform.
This patch switches to use it.

Signed-off-by: Kuninori Morimoto <kuninori.morimoto.gx@renesas.com>
Signed-off-by: Mark Brown <broonie@kernel.org>
5 years agoASoC: samsung: smdk_wm8994pcm: use modern dai_link style
Kuninori Morimoto [Thu, 6 Jun 2019 04:09:12 +0000 (13:09 +0900)]
ASoC: samsung: smdk_wm8994pcm: use modern dai_link style

ASoC is now supporting modern style dai_link
(= snd_soc_dai_link_component) for CPU/Codec/Platform.
This patch switches to use it.

Signed-off-by: Kuninori Morimoto <kuninori.morimoto.gx@renesas.com>
Signed-off-by: Mark Brown <broonie@kernel.org>
5 years agoASoC: samsung: smdk_wm8994: use modern dai_link style
Kuninori Morimoto [Thu, 6 Jun 2019 04:09:06 +0000 (13:09 +0900)]
ASoC: samsung: smdk_wm8994: use modern dai_link style

ASoC is now supporting modern style dai_link
(= snd_soc_dai_link_component) for CPU/Codec/Platform.
This patch switches to use it.

Signed-off-by: Kuninori Morimoto <kuninori.morimoto.gx@renesas.com>
Signed-off-by: Mark Brown <broonie@kernel.org>
5 years agoASoC: samsung: smdk_wm8580: use modern dai_link style
Kuninori Morimoto [Thu, 6 Jun 2019 04:09:01 +0000 (13:09 +0900)]
ASoC: samsung: smdk_wm8580: use modern dai_link style

ASoC is now supporting modern style dai_link
(= snd_soc_dai_link_component) for CPU/Codec/Platform.
This patch switches to use it.

Signed-off-by: Kuninori Morimoto <kuninori.morimoto.gx@renesas.com>
Signed-off-by: Mark Brown <broonie@kernel.org>
5 years agoASoC: samsung: bells: use modern dai_link style
Kuninori Morimoto [Thu, 6 Jun 2019 04:08:55 +0000 (13:08 +0900)]
ASoC: samsung: bells: use modern dai_link style

ASoC is now supporting modern style dai_link
(= snd_soc_dai_link_component) for CPU/Codec/Platform.
This patch switches to use it.

Signed-off-by: Kuninori Morimoto <kuninori.morimoto.gx@renesas.com>
Signed-off-by: Mark Brown <broonie@kernel.org>
5 years agoASoC: mediatek: mt8183-mt6358-ts3a227-max98357: use modern dai_link style
Kuninori Morimoto [Thu, 6 Jun 2019 04:08:49 +0000 (13:08 +0900)]
ASoC: mediatek: mt8183-mt6358-ts3a227-max98357: use modern dai_link style

ASoC is now supporting modern style dai_link
(= snd_soc_dai_link_component) for CPU/Codec/Platform.
This patch switches to use it.

Signed-off-by: Kuninori Morimoto <kuninori.morimoto.gx@renesas.com>
Signed-off-by: Mark Brown <broonie@kernel.org>
5 years agoASoC: mediatek: mt8183-da7219-max98357: use modern dai_link style
Kuninori Morimoto [Thu, 6 Jun 2019 04:08:43 +0000 (13:08 +0900)]
ASoC: mediatek: mt8183-da7219-max98357: use modern dai_link style

ASoC is now supporting modern style dai_link
(= snd_soc_dai_link_component) for CPU/Codec/Platform.
This patch switches to use it.

Signed-off-by: Kuninori Morimoto <kuninori.morimoto.gx@renesas.com>
Signed-off-by: Mark Brown <broonie@kernel.org>
5 years agoASoC: mediatek: mt8173-rt5650-rt5514: use modern dai_link style
Kuninori Morimoto [Thu, 6 Jun 2019 04:08:38 +0000 (13:08 +0900)]
ASoC: mediatek: mt8173-rt5650-rt5514: use modern dai_link style

ASoC is now supporting modern style dai_link
(= snd_soc_dai_link_component) for CPU/Codec/Platform.
This patch switches to use it.

Signed-off-by: Kuninori Morimoto <kuninori.morimoto.gx@renesas.com>
Signed-off-by: Mark Brown <broonie@kernel.org>
5 years agoASoC: mediatek: mt8173-rt5650-rt5676: use modern dai_link style
Kuninori Morimoto [Thu, 6 Jun 2019 04:08:23 +0000 (13:08 +0900)]
ASoC: mediatek: mt8173-rt5650-rt5676: use modern dai_link style

ASoC is now supporting modern style dai_link
(= snd_soc_dai_link_component) for CPU/Codec/Platform.
This patch switches to use it.

Signed-off-by: Kuninori Morimoto <kuninori.morimoto.gx@renesas.com>
Signed-off-by: Mark Brown <broonie@kernel.org>
5 years agoASoC: mediatek: mt8173-rt5650: use modern dai_link style
Kuninori Morimoto [Thu, 6 Jun 2019 04:08:16 +0000 (13:08 +0900)]
ASoC: mediatek: mt8173-rt5650: use modern dai_link style

ASoC is now supporting modern style dai_link
(= snd_soc_dai_link_component) for CPU/Codec/Platform.
This patch switches to use it.

Signed-off-by: Kuninori Morimoto <kuninori.morimoto.gx@renesas.com>
Signed-off-by: Mark Brown <broonie@kernel.org>
5 years agoASoC: mediatek: mt8173-max98090: use modern dai_link style
Kuninori Morimoto [Thu, 6 Jun 2019 04:08:11 +0000 (13:08 +0900)]
ASoC: mediatek: mt8173-max98090: use modern dai_link style

ASoC is now supporting modern style dai_link
(= snd_soc_dai_link_component) for CPU/Codec/Platform.
This patch switches to use it.

Signed-off-by: Kuninori Morimoto <kuninori.morimoto.gx@renesas.com>
Signed-off-by: Mark Brown <broonie@kernel.org>
5 years agoASoC: mediatek: mt2701-cs42448: use modern dai_link style
Kuninori Morimoto [Thu, 6 Jun 2019 04:08:04 +0000 (13:08 +0900)]
ASoC: mediatek: mt2701-cs42448: use modern dai_link style

ASoC is now supporting modern style dai_link
(= snd_soc_dai_link_component) for CPU/Codec/Platform.
This patch switches to use it.

Signed-off-by: Kuninori Morimoto <kuninori.morimoto.gx@renesas.com>
Signed-off-by: Mark Brown <broonie@kernel.org>
5 years agoASoC: mediatek: mt2701-wm8960: use modern dai_link style
Kuninori Morimoto [Thu, 6 Jun 2019 04:07:57 +0000 (13:07 +0900)]
ASoC: mediatek: mt2701-wm8960: use modern dai_link style

ASoC is now supporting modern style dai_link
(= snd_soc_dai_link_component) for CPU/Codec/Platform.
This patch switches to use it.

Signed-off-by: Kuninori Morimoto <kuninori.morimoto.gx@renesas.com>
Signed-off-by: Mark Brown <broonie@kernel.org>
5 years agoASoC: mediatek: mt6797-mt6351: use modern dai_link style
Kuninori Morimoto [Thu, 6 Jun 2019 04:07:49 +0000 (13:07 +0900)]
ASoC: mediatek: mt6797-mt6351: use modern dai_link style

ASoC is now supporting modern style dai_link
(= snd_soc_dai_link_component) for CPU/Codec/Platform.
This patch switches to use it.

Signed-off-by: Kuninori Morimoto <kuninori.morimoto.gx@renesas.com>
Signed-off-by: Mark Brown <broonie@kernel.org>
5 years agoASoC: soc.h: add sound dai_link connection macro
Kuninori Morimoto [Thu, 6 Jun 2019 04:07:42 +0000 (13:07 +0900)]
ASoC: soc.h: add sound dai_link connection macro

Modern style dai_link requests CPU/Codec/Platform component
pointer array and its size, but it will be very verbose code.
To avoid such scene, this patch adds dai_link connection macro.

Signed-off-by: Kuninori Morimoto <kuninori.morimoto.gx@renesas.com>
Signed-off-by: Mark Brown <broonie@kernel.org>
5 years agoASoC: simple-card: support snd_soc_dai_link_component style for cpu
Kuninori Morimoto [Thu, 6 Jun 2019 04:07:35 +0000 (13:07 +0900)]
ASoC: simple-card: support snd_soc_dai_link_component style for cpu

ASoC supports modern style dai_link (= snd_soc_dai_link_component) for
CPU. legacy style dai_link (= cpu_dai_name, cpu_name, cpu_of_node) are
no longer needed.
This patch switches to modern style.

Signed-off-by: Kuninori Morimoto <kuninori.morimoto.gx@renesas.com>
Signed-off-by: Mark Brown <broonie@kernel.org>
5 years agoASoC: soc-core: use snd_soc_dai_link_component for CPU
Kuninori Morimoto [Thu, 6 Jun 2019 04:07:22 +0000 (13:07 +0900)]
ASoC: soc-core: use snd_soc_dai_link_component for CPU

current ALSA SoC is starting to support modern style dai_linke
(= struct snd_soc_dai_link_component) which is mainly used for
multipul DAI/component connection.
Now Codec has full multi-codec support, Platform is using modern
style but still for single Platform.
Only CPU is not yet supporting modern style yet.
If we could support it for CPU, we can switch to modern style
dai_link on all CPU/Codec/Platform, and remove legacy style
from ALSA SoC.

Multi-CPU will be supported in the future.
This patch is initial support for modern style for CPU

Signed-off-by: Kuninori Morimoto <kuninori.morimoto.gx@renesas.com>
Signed-off-by: Mark Brown <broonie@kernel.org>
5 years agoASoC: rt1011: fix warning reported by kbuild test robot and minor issue
Shuming Fan [Thu, 6 Jun 2019 06:22:32 +0000 (14:22 +0800)]
ASoC: rt1011: fix warning reported by kbuild test robot and minor issue

This patch fixes following issues:
- warning: this decimal constant is unsigned only in ISO C90
- sparse: incorrect type in assignment
- check if value.integer.value is zero for "R0 Load Mode" control

Signed-off-by: Shuming Fan <shumingf@realtek.com>
Signed-off-by: Mark Brown <broonie@kernel.org>
5 years agoASoC: rt1011: Mark format integer literals as unsigned
Nathan Chancellor [Thu, 6 Jun 2019 05:12:27 +0000 (22:12 -0700)]
ASoC: rt1011: Mark format integer literals as unsigned

Clang warns:

sound/soc/codecs/rt1011.c:1291:12: warning: integer literal is too large
to be represented in type 'long', interpreting as 'unsigned long' per
C89; this literal will have type 'long long' in C99 onwards
[-Wc99-compat]
                format = 2147483648; /* 2^24 * 128 */
                         ^
sound/soc/codecs/rt1011.c:2123:13: warning: integer literal is too large
to be represented in type 'long', interpreting as 'unsigned long' per
C89; this literal will have type 'long long' in C99 onwards
[-Wc99-compat]
                        format = 2147483648; /* 2^24 * 128 */
                                 ^
2 warnings generated.

Mark the integer literals as unsigned explicitly so that if the kernel
does ever bump the C standard it uses, the behavior is consitent.

Fixes: d6e65bb7ff0d ("ASoC: rt1011: Add RT1011 amplifier driver")
Link: https://github.com/ClangBuiltLinux/linux/issues/506
Signed-off-by: Nathan Chancellor <natechancellor@gmail.com>
Reviewed-by: Nick Desaulniers <ndesaulniers@google.com>
Signed-off-by: Mark Brown <broonie@kernel.org>
5 years agoASoC: core: Tell codec that jack is being removed
Amadeusz Sławiński [Wed, 5 Jun 2019 13:45:53 +0000 (15:45 +0200)]
ASoC: core: Tell codec that jack is being removed

When component is being removed we should disable jack, otherwise some
codecs will try to trigger interrupt using freed structures.

Signed-off-by: Amadeusz Sławiński <amadeuszx.slawinski@linux.intel.com>
Signed-off-by: Mark Brown <broonie@kernel.org>
5 years agoASoC: sun4i-i2s: Change SR and WSS computation
Maxime Ripard [Wed, 5 Jun 2019 10:08:01 +0000 (12:08 +0200)]
ASoC: sun4i-i2s: Change SR and WSS computation

The current computation for the SR (sample resolution) and the WSS (word
slot size) register parameters is based on a switch returning the matching
parameters for a given params width.

Later SoCs (A83t, H3, A64) changed that calculation, which was loosely the
same with an offset. Therefore, an offset was added to adjust those
parameters.

However, the calculation is a bit less trivial than initially thought.
Indeed, while we assumed that SR and WSS were always the same, on older
SoCs, SR will max at 24 (since those SoCs do not support 32 bits formats),
but the word size can be 32.

Newer SoCs can also support a much larger range (8 bits to 32 bits, by
increments of 4) of size than the older SoCs could.

Finally, the A64 and A83t were never adjusted to have that offset in the
first place, and were therefore broken from that point of view.

In order to fix all those issues, let's introduce two functions, get_wss
and get_sr, with their respective implementations for all the SoCs
supported so far.

Fixes: 21faaea1343f ("ASoC: sun4i-i2s: Add support for A83T")
Fixes: 66ecce332538 ("ASoC: sun4i-i2s: Add compatibility with A64 codec I2S")
Signed-off-by: Maxime Ripard <maxime.ripard@bootlin.com>
Signed-off-by: Mark Brown <broonie@kernel.org>
5 years agoASoC: pcm3168a: Implement set_tdm_slot callback
Peter Ujfalusi [Tue, 4 Jun 2019 11:12:49 +0000 (14:12 +0300)]
ASoC: pcm3168a: Implement set_tdm_slot callback

Initially we only going to care about the slot_width as for example
DSP_A/B needs 32 bclk per slots and to be able to use TDM mode the codec
(and CPU) needs to use DSP_A/B modes.

Signed-off-by: Peter Ujfalusi <peter.ujfalusi@ti.com>
Signed-off-by: Mark Brown <broonie@kernel.org>
5 years agoASoC: mediatek: Make some symbols static
YueHaibing [Wed, 29 May 2019 15:04:37 +0000 (23:04 +0800)]
ASoC: mediatek: Make some symbols static

Fix sparse warnings:

sound/soc/mediatek/common/mtk-btcvsd.c:410:5: warning: symbol 'mtk_btcvsd_write_to_bt' was not declared. Should it be static?
sound/soc/mediatek/common/mtk-btcvsd.c:698:9: warning: symbol 'mtk_btcvsd_snd_read' was not declared. Should it be static?
sound/soc/mediatek/common/mtk-btcvsd.c:779:9: warning: symbol 'mtk_btcvsd_snd_write' was not declared. Should it be static?

Reported-by: Hulk Robot <hulkci@huawei.com>
Signed-off-by: YueHaibing <yuehaibing@huawei.com>
Signed-off-by: Mark Brown <broonie@kernel.org>
5 years agoASoC: cx2072x: remove set but not used variable 'is_right_j '
YueHaibing [Sat, 25 May 2019 12:32:04 +0000 (20:32 +0800)]
ASoC: cx2072x: remove set but not used variable 'is_right_j '

Fixes gcc '-Wunused-but-set-variable' warning:

sound/soc/codecs/cx2072x.c: In function cx2072x_config_i2spcm:
sound/soc/codecs/cx2072x.c:679:6: warning: variable is_right_j set but not used [-Wunused-but-set-variable]

It's never used and can be removed.

Signed-off-by: YueHaibing <yuehaibing@huawei.com>
Reviewed-by: Takashi Iwai <tiwai@suse.de>
Signed-off-by: Mark Brown <broonie@kernel.org>
5 years agoASoC: rt1011: Add RT1011 amplifier driver
Shuming Fan [Tue, 28 May 2019 04:30:17 +0000 (12:30 +0800)]
ASoC: rt1011: Add RT1011 amplifier driver

This is the initial amplifier driver for rt1011.

Signed-off-by: Shuming Fan <shumingf@realtek.com>
Signed-off-by: Mark Brown <broonie@kernel.org>
5 years agoASoC: SOF: debug: add new debugfs entries for IPC flood test
Ranjani Sridharan [Mon, 3 Jun 2019 16:18:20 +0000 (11:18 -0500)]
ASoC: SOF: debug: add new debugfs entries for IPC flood test

Add a couple of new debugfs entries "ipc_flood_count"
and "ipc_flood_duration_ms" that can be used to
execute the IPC flood test. "ipc_flood_count" floods the DSP
with the number of test IPCs specified and ipc_flood_duration_ms
floods the DSP with test IPC's for the duration(in ms) specified.
The test stats such as average, min and max IPC response times
are logged in the dmesg and saved in the debugfs entry cache buffer.

Signed-off-by: Ranjani Sridharan <ranjani.sridharan@linux.intel.com>
Signed-off-by: Pierre-Louis Bossart <pierre-louis.bossart@linux.intel.com>
Signed-off-by: Mark Brown <broonie@kernel.org>
5 years agoASoC: SOF: ipc: Introduce SOF_IPC_GLB_TEST_MSG IPC command
Ranjani Sridharan [Mon, 3 Jun 2019 16:18:19 +0000 (11:18 -0500)]
ASoC: SOF: ipc: Introduce SOF_IPC_GLB_TEST_MSG IPC command

Add a new class of IPC command along with the first
test type, IPC_FLOOD, which will be used for flooding the DSP
with IPCs.

Signed-off-by: Ranjani Sridharan <ranjani.sridharan@linux.intel.com>
Signed-off-by: Pierre-Louis Bossart <pierre-louis.bossart@linux.intel.com>
Signed-off-by: Mark Brown <broonie@kernel.org>
5 years agoASoC: SOF: send time stamp to FW for alignment
Bard liao [Mon, 3 Jun 2019 16:18:17 +0000 (11:18 -0500)]
ASoC: SOF: send time stamp to FW for alignment

Timer will be reset when DSP is powered down. So the time stamp of trace
log will be reset after resume. Send time stamp to FW can align the time
stamp and avoid reset time stamp in trace log.

Signed-off-by: Bard liao <yung-chuan.liao@linux.intel.com>
Signed-off-by: Pierre-Louis Bossart <pierre-louis.bossart@linux.intel.com>
Signed-off-by: Mark Brown <broonie@kernel.org>
5 years agoMerge branch 'asoc-5.2' into asoc-5.3
Mark Brown [Mon, 3 Jun 2019 17:38:15 +0000 (18:38 +0100)]
Merge branch 'asoc-5.2' into asoc-5.3

5 years agoASoC: SOF: topology: add support for mux/demux component
Jaska Uimonen [Mon, 3 Jun 2019 16:18:21 +0000 (11:18 -0500)]
ASoC: SOF: topology: add support for mux/demux component

Add enumerations to support mux/demux processing component.

Signed-off-by: Jaska Uimonen <jaska.uimonen@intel.com>
Signed-off-by: Pierre-Louis Bossart <pierre-louis.bossart@linux.intel.com>
Signed-off-by: Mark Brown <broonie@kernel.org>
5 years agoASoC: SOF: fix DSP oops definitions in FW ABI
Kai Vehmanen [Mon, 3 Jun 2019 16:18:15 +0000 (11:18 -0500)]
ASoC: SOF: fix DSP oops definitions in FW ABI

The definitions for DSP oops structures were not aligned
correctly to current FW ABI version 3.6.0, leading to
invalid data being printed out to debug logs. Fix the structs
and update related platform code accordingly.

Signed-off-by: Kai Vehmanen <kai.vehmanen@linux.intel.com>
Signed-off-by: Pierre-Louis Bossart <pierre-louis.bossart@linux.intel.com>
Signed-off-by: Mark Brown <broonie@kernel.org>
5 years agoASoC: SOF: soundwire: add initial soundwire support
Pan Xiuli [Mon, 3 Jun 2019 16:18:14 +0000 (11:18 -0500)]
ASoC: SOF: soundwire: add initial soundwire support

Add soundwire dai type and update ABI version.

Signed-off-by: Pan Xiuli <xiuli.pan@linux.intel.com>
Signed-off-by: Pierre-Louis Bossart <pierre-louis.bossart@linux.intel.com>
Signed-off-by: Mark Brown <broonie@kernel.org>
5 years agoASoC: SOF: Intel: ipc: don't check for HIPCCTL register value
Pierre-Louis Bossart [Mon, 3 Jun 2019 16:20:31 +0000 (11:20 -0500)]
ASoC: SOF: Intel: ipc: don't check for HIPCCTL register value

The HIPCCTL register controls the IPC interrupts. It can be set or
cleared to mask or enable these interrupts, but it makes no sense to
read and test its fields in an interrupt (which can only executed if
its fields are set).

Signed-off-by: Pierre-Louis Bossart <pierre-louis.bossart@linux.intel.com>
Signed-off-by: Mark Brown <broonie@kernel.org>
5 years agoASoC: SOF: Intel: hda-ipc: re-enable IPC IRQ at end of handler
Pierre-Louis Bossart [Mon, 3 Jun 2019 16:20:30 +0000 (11:20 -0500)]
ASoC: SOF: Intel: hda-ipc: re-enable IPC IRQ at end of handler

Align with Skylake driver and enable the IRQ at end of handler,
instead of at beginning.

Also add an error log if we have nothing to do in this handler.

Signed-off-by: Pierre-Louis Bossart <pierre-louis.bossart@linux.intel.com>
Signed-off-by: Mark Brown <broonie@kernel.org>
5 years agoASoC: SOF: Intel: hda-ipc: read all IPC registers first
Pierre-Louis Bossart [Mon, 3 Jun 2019 16:20:29 +0000 (11:20 -0500)]
ASoC: SOF: Intel: hda-ipc: read all IPC registers first

Align with hardware recommended sequences, and read all IPC registers
before doing any other actions. Playing with BUSY and DONE bits may
invalidate values.

The values read may not actually be necessary but at least this
provides a snapshot of the IPC registers with no consistency issues.

Signed-off-by: Pierre-Louis Bossart <pierre-louis.bossart@linux.intel.com>
Signed-off-by: Mark Brown <broonie@kernel.org>
5 years agoASoC: SOF: Intel: cnl-ipc: re-enable IPC IRQ at end of handler
Pierre-Louis Bossart [Mon, 3 Jun 2019 16:20:28 +0000 (11:20 -0500)]
ASoC: SOF: Intel: cnl-ipc: re-enable IPC IRQ at end of handler

Align with Skylake driver and enable the IRQ at end of handler,
instead of at beginning.

Also add an error log if we have nothing to do in this handler.

Signed-off-by: Pierre-Louis Bossart <pierre-louis.bossart@linux.intel.com>
Signed-off-by: Mark Brown <broonie@kernel.org>
5 years agoASoC: SOF: Intel: cnl-ipc: move code around for clarity
Pierre-Louis Bossart [Mon, 3 Jun 2019 16:20:27 +0000 (11:20 -0500)]
ASoC: SOF: Intel: cnl-ipc: move code around for clarity

Move all register access to cnl_ipc_host_done()
No functionality change.

Signed-off-by: Pierre-Louis Bossart <pierre-louis.bossart@linux.intel.com>
Signed-off-by: Mark Brown <broonie@kernel.org>
5 years agoASoC: SOF: Intel: cnl-ipc: read all IPC registers first
Pierre-Louis Bossart [Mon, 3 Jun 2019 16:20:26 +0000 (11:20 -0500)]
ASoC: SOF: Intel: cnl-ipc: read all IPC registers first

Align with hardware recommended sequences, and read all IPC registers
before doing any other actions. Playing with BUSY and DONE bits may
invalidate values.

The values read may not actually be necessary but at least this
provides a snapshot of the IPC registers with no consistency issues.

Signed-off-by: Pierre-Louis Bossart <pierre-louis.bossart@linux.intel.com>
Signed-off-by: Mark Brown <broonie@kernel.org>
5 years agoASoC: SOF: Do not send cmd via SHIM register
Daniel Baluta [Mon, 3 Jun 2019 16:20:25 +0000 (11:20 -0500)]
ASoC: SOF: Do not send cmd via SHIM register

We use shim registers only to notify the other
side that a message was sent. The actual information
for the message is transmitted via mailbox.

cmd information inside shim register is not used by
the DSP, so we remove it to avoid confusion.

Signed-off-by: Daniel Baluta <daniel.baluta@gmail.com>
Signed-off-by: Pierre-Louis Bossart <pierre-louis.bossart@linux.intel.com>
Signed-off-by: Mark Brown <broonie@kernel.org>
5 years agoASoC: SOF: add mode parameter for snd_sof_debugfs_buf_item
Ranjani Sridharan [Mon, 3 Jun 2019 16:18:18 +0000 (11:18 -0500)]
ASoC: SOF: add mode parameter for snd_sof_debugfs_buf_item

Add mode parameter for snd_sof_debugfs_buf_item() to specify
the mode while creating debugfs entries.

Signed-off-by: Ranjani Sridharan <ranjani.sridharan@linux.intel.com>
Signed-off-by: Pierre-Louis Bossart <pierre-louis.bossart@linux.intel.com>
Signed-off-by: Mark Brown <broonie@kernel.org>
5 years agoRevert "ASoC: core: use component driver name as component name"
Krzysztof Kozlowski [Fri, 31 May 2019 10:34:02 +0000 (12:34 +0200)]
Revert "ASoC: core: use component driver name as component name"

Using component driver as a name is not unique and it breaks audio in
certain configurations, e.g. Hardkernel Odroid XU3 board where following
components are registered:
 - "3830000.i2s" with driver name "snd_dmaengine_pcm"
 - "3830000.i2s-sec" with driver name "snd_dmaengine_pcm"
 - "3830000.i2s" with driver name "samsung-i2s"

This reverts commit b19671d6caf1ac393681864d5d85dda9fa99a448.

Signed-off-by: Krzysztof Kozlowski <krzk@kernel.org>
Signed-off-by: Mark Brown <broonie@kernel.org>
5 years agoASoC: stm32: sai: manage identification registers
Olivier Moysan [Mon, 3 Jun 2019 08:16:34 +0000 (10:16 +0200)]
ASoC: stm32: sai: manage identification registers

Add support of identification registers in STM32 SAI.

Signed-off-by: Olivier Moysan <olivier.moysan@st.com>
Signed-off-by: Mark Brown <broonie@kernel.org>
5 years agoASoC: hda: fix unbalanced codec dev refcount for HDA_DEV_ASOC
Ranjani Sridharan [Fri, 31 May 2019 16:01:37 +0000 (09:01 -0700)]
ASoC: hda: fix unbalanced codec dev refcount for HDA_DEV_ASOC

HDA_DEV_ASOC type codec device refcounts are managed differently
from HDA_DEV_LEGACY devices. The refcount is released explicitly
in snd_hdac_ext_bus_device_remove() for ASOC type devices.
So, remove the put_device() call in snd_hda_codec_dev_free()
for such devices to make the refcount balanced. This will prevent
the NULL pointer exception when the codec driver is released
after the card is freed.

Signed-off-by: Ranjani Sridharan <ranjani.sridharan@linux.intel.com>
Reviewed-by: Takashi Iwai <tiwai@suse.de>
Signed-off-by: Mark Brown <broonie@kernel.org>
5 years agoASoC: SOF: ipc: replace fw ready bitfield with explicit bit ordering
Slawomir Blauciak [Mon, 3 Jun 2019 16:20:32 +0000 (11:20 -0500)]
ASoC: SOF: ipc: replace fw ready bitfield with explicit bit ordering

Previously the structure used bitfields, which do not guarantee bit
ordering.

This change makes sure the order is clearly defined.  It also renames
and repurposes the field for general use.

Signed-off-by: Slawomir Blauciak <slawomir.blauciak@linux.intel.com>
Signed-off-by: Pierre-Louis Bossart <pierre-louis.bossart@linux.intel.com>
Signed-off-by: Mark Brown <broonie@kernel.org>
5 years agoASoC: SOF: bump to ABI 3.6
Pierre-Louis Bossart [Mon, 3 Jun 2019 16:18:16 +0000 (11:18 -0500)]
ASoC: SOF: bump to ABI 3.6

We had a couple of misses with ABI changes, e.g. for Xtensa oops
information and the integration of sound trigger, before we set-up a
formal process to track evolutions.

With this patch, the SOF kernel patches are officially aligned with
the firmware 3.6 level. Changing this level has no impact on existing
users and is fully backwards-compatible.

Signed-off-by: Pierre-Louis Bossart <pierre-louis.bossart@linux.intel.com>
Signed-off-by: Mark Brown <broonie@kernel.org>
5 years agoASoC: SOF: soundwire: add initial soundwire support
Pan Xiuli [Mon, 3 Jun 2019 16:18:14 +0000 (11:18 -0500)]
ASoC: SOF: soundwire: add initial soundwire support

Add soundwire dai type and update ABI version.

Signed-off-by: Pan Xiuli <xiuli.pan@linux.intel.com>
Signed-off-by: Pierre-Louis Bossart <pierre-louis.bossart@linux.intel.com>
Signed-off-by: Mark Brown <broonie@kernel.org>
5 years agoASoC: SOF: uapi: mirror firmware changes
Pierre-Louis Bossart [Mon, 3 Jun 2019 16:18:13 +0000 (11:18 -0500)]
ASoC: SOF: uapi: mirror firmware changes

We missed these two definitions for GDB support and component
notifications, they are defined for the SOF firmware. Since they are
not used by the kernel so far, we can still add them without any ABI
change.

Signed-off-by: Pierre-Louis Bossart <pierre-louis.bossart@linux.intel.com>
Signed-off-by: Mark Brown <broonie@kernel.org>
5 years agoASoC: Intel: Baytrail: add quirk for Aegex 10 (RU2) tablet
Kovács Tamás [Fri, 31 May 2019 17:22:26 +0000 (19:22 +0200)]
ASoC: Intel: Baytrail: add quirk for Aegex 10 (RU2) tablet

This tablet has an incorrect acpi identifier just like
Thinkpad10 tablet, which is why it is trying to load the RT5640 driver
instead of the RT5762 driver. The RT5640 driver, on the other hand, checks
the hardware ID, so no driver are loaded during boot. This fix resolves to
load the RT5672 driver on this tablet during boot. It also provides the
correct IO configuration, like the jack detect mode 3, for 1.8V pullup. I
would like to thank Pierre-Louis Bossart for helping with this patch.

Signed-off-by: Kovács Tamás <kepszlok@zohomail.eu>
Signed-off-by: Mark Brown <broonie@kernel.org>
5 years agoASoC: SOF: Intel: hda: use the defined ppcap functions
Zhu Yingjiang [Fri, 24 May 2019 19:09:25 +0000 (14:09 -0500)]
ASoC: SOF: Intel: hda: use the defined ppcap functions

There are already defined ppcap and ppcap interrupt functions, use
the already defined functions for easy code read.

Fixes: 8a300c8fb17 ("ASoC: SOF: Intel: Add HDA controller for Intel DSP")
Reviewed-by: Takashi Iwai <tiwai@suse.de>
Signed-off-by: Zhu Yingjiang <yingjiang.zhu@linux.intel.com>
Signed-off-by: Pierre-Louis Bossart <pierre-louis.bossart@linux.intel.com>
Signed-off-by: Mark Brown <broonie@kernel.org>
5 years agoMerge branch 'asoc-5.2' into asoc-5.3
Mark Brown [Thu, 30 May 2019 15:47:43 +0000 (16:47 +0100)]
Merge branch 'asoc-5.2' into asoc-5.3

5 years agoASoC: SOF: add COMPILE_TEST for PCI options
Pierre-Louis Bossart [Thu, 30 May 2019 11:50:15 +0000 (06:50 -0500)]
ASoC: SOF: add COMPILE_TEST for PCI options

Add COMPILE_TEST and use IS_ENABLED(CONFIG_PCI) to sort out
cross-compilation issues.

Signed-off-by: Pierre-Louis Bossart <pierre-louis.bossart@linux.intel.com>
Signed-off-by: Mark Brown <broonie@kernel.org>
5 years agoASoC: Intel: boards: Add COMPILE_TEST for new machine drivers
Pierre-Louis Bossart [Thu, 30 May 2019 11:50:14 +0000 (06:50 -0500)]
ASoC: Intel: boards: Add COMPILE_TEST for new machine drivers

We recently added COMPILE_TEST but new machine drivers were not
updated. Fix.

Signed-off-by: Pierre-Louis Bossart <pierre-louis.bossart@linux.intel.com>
Signed-off-by: Mark Brown <broonie@kernel.org>
5 years agoASoC: Intel: boards: remove dependency on asm/platform_sst_audio.h
Pierre-Louis Bossart [Thu, 30 May 2019 11:50:13 +0000 (06:50 -0500)]
ASoC: Intel: boards: remove dependency on asm/platform_sst_audio.h

This is not needed. Probably a copy/paste that was never removed.

Signed-off-by: Pierre-Louis Bossart <pierre-louis.bossart@linux.intel.com>
Signed-off-by: Mark Brown <broonie@kernel.org>
5 years agoASoc: fix sound/soc/intel/skylake/slk-ssp-clk.c build error on IA64
Randy Dunlap [Thu, 30 May 2019 11:50:12 +0000 (06:50 -0500)]
ASoc: fix sound/soc/intel/skylake/slk-ssp-clk.c build error on IA64

skl-ssp-clk.c does not build on IA64 because the driver
uses the common clock interface, so make the driver depend
on COMMON_CLK.

Fixes this build error:
../sound/soc/intel/skylake/skl-ssp-clk.c:26:16: error: field 'hw' has incomplete type
  struct clk_hw hw;
                ^~
[Corrections for SKL support by Pierre Bossart]

Reported-by: kbuild test robot <lkp@intel.com>
Signed-off-by: Randy Dunlap <rdunlap@infradead.org>
Signed-off-by: Pierre-Louis Bossart <pierre-louis.bossart@linux.intel.com>
Cc: Mark Brown <broonie@kernel.org>
Cc: Liam Girdwood <liam.r.girdwood@linux.intel.com>
Cc: Jie Yang <yang.jie@linux.intel.com>
Cc: alsa-devel@alsa-project.org
Signed-off-by: Mark Brown <broonie@kernel.org>
5 years agoASoC: Intel: use common helpers to detect CPUs
Pierre-Louis Bossart [Thu, 30 May 2019 11:50:11 +0000 (06:50 -0500)]
ASoC: Intel: use common helpers to detect CPUs

We have duplicated code in multiple locations (atom, machine drivers,
SOF) to detect Baytrail, Cherrytrail and other SOCs. This is not very
elegant, and introduces dependencies on CONFIG_X86 that prevent
COMPILE_TEST from working.

Add common helpers to provide same functionality in a cleaner
way. This will also help support the DMI-based quirks being introduced
to handle SOF/SST autodetection.

Reviewed-by: Takashi Iwai <tiwai@suse.de>
Signed-off-by: Pierre-Louis Bossart <pierre-louis.bossart@linux.intel.com>
Signed-off-by: Mark Brown <broonie@kernel.org>
5 years agoASoC: rt5677: Add missing voice activation register definitions
Curtis Malainey [Wed, 29 May 2019 19:30:48 +0000 (12:30 -0700)]
ASoC: rt5677: Add missing voice activation register definitions

Most of the voice activation definitions were missing, they will be
needed for when hotwording is added. Also the source bits are only 2
wide not 3 and needed to be corrected.

Signed-off-by: Curtis Malainey <cujomalainey@chromium.org>
Signed-off-by: Mark Brown <broonie@kernel.org>
5 years agoASoC: core: use component driver name as component name
Tzung-Bi Shih [Wed, 29 May 2019 06:22:14 +0000 (14:22 +0800)]
ASoC: core: use component driver name as component name

fmt_single_name() uses device name to determine component name.  If
multiple components bind to the same device, the debugfs creation in
soc_init_component_debugfs() would fail due to duplicated entity
names.

Name provided by component driver is unique enough to represent each
component.  Use component driver name as the component name to avoid
name duplication.

Signed-off-by: Tzung-Bi Shih <tzungbi@google.com>
Signed-off-by: Mark Brown <broonie@kernel.org>
5 years agoASoC: cs42xx8: Fix build error with CONFIG_GPIOLIB is not set
Shengjiu Wang [Wed, 29 May 2019 03:30:02 +0000 (11:30 +0800)]
ASoC: cs42xx8: Fix build error with CONFIG_GPIOLIB is not set

config: x86_64-randconfig-x000201921-201921
compiler: gcc-7 (Debian 7.3.0-1) 7.3.0
reproduce:
        make ARCH=x86_64

sound/soc/codecs/cs42xx8.c: In function ‘cs42xx8_probe’:
sound/soc/codecs/cs42xx8.c:472:25: error: implicit declaration of function ‘devm_gpiod_get_optional’; did you mean ‘devm_clk_get_optional’? [-Werror=implicit-function-declaration]
  cs42xx8->gpiod_reset = devm_gpiod_get_optional(dev, "reset",
                         ^~~~~~~~~~~~~~~~~~~~~~~
                         devm_clk_get_optional
sound/soc/codecs/cs42xx8.c:473:8: error: ‘GPIOD_OUT_HIGH’ undeclared (first use in this function); did you mean ‘GPIOF_INIT_HIGH’?
        GPIOD_OUT_HIGH);
        ^~~~~~~~~~~~~~
        GPIOF_INIT_HIGH
sound/soc/codecs/cs42xx8.c:473:8: note: each undeclared identifier is reported only once for each function it appears in
sound/soc/codecs/cs42xx8.c:477:2: error: implicit declaration of function ‘gpiod_set_value_cansleep’; did you mean ‘gpio_set_value_cansleep’? [-Werror=implicit-function-declaration]
  gpiod_set_value_cansleep(cs42xx8->gpiod_reset, 0);
  ^~~~~~~~~~~~~~~~~~~~~~~~
  gpio_set_value_cansleep

Fixes: bfe95dfa4dac ("ASoC: cs42xx8: Add reset gpio handling")
Reported-by: kbuild test robot <lkp@intel.com>
Signed-off-by: Shengjiu Wang <shengjiu.wang@nxp.com>
Signed-off-by: Mark Brown <broonie@kernel.org>
5 years agoASoC: Intel: sof-rt5682: fix undefined references with Baytrail-only support
Pierre-Louis Bossart [Tue, 28 May 2019 16:28:22 +0000 (11:28 -0500)]
ASoC: Intel: sof-rt5682: fix undefined references with Baytrail-only support

The sof-rt5682 machine driver supports both legacy Baytrail devices
and more recent ApolloLake/CometLake platforms. When only Baytrail is
selected, the compilation fails with the following errors:

ERROR: "hdac_hdmi_jack_port_init"
[sound/soc/intel/boards/snd-soc-sof_rt5682.ko] undefined!

ERROR: "hdac_hdmi_jack_init"
[sound/soc/intel/boards/snd-soc-sof_rt5682.ko] undefined!

Fix by selecting SND_SOC_HDAC_HDMI unconditionally. The code for HDMI
support is not reachable on Baytrail so this change has no functional
impact.

Fixes: f70abd75b7c6 ("ASoC: Intel: add sof-rt5682 machine driver")
Reported-by: kbuild test robot <lkp@intel.com>
Signed-off-by: Pierre-Louis Bossart <pierre-louis.bossart@linux.intel.com>
Signed-off-by: Mark Brown <broonie@kernel.org>
5 years agowcd9335: fix a incorrect use of kstrndup()
Gen Zhang [Wed, 29 May 2019 01:53:05 +0000 (09:53 +0800)]
wcd9335: fix a incorrect use of kstrndup()

In wcd9335_codec_enable_dec(), 'widget_name' is allocated by kstrndup().
However, according to doc: "Note: Use kmemdup_nul() instead if the size
is known exactly." So we should use kmemdup_nul() here instead of
kstrndup().

Signed-off-by: Gen Zhang <blackgod016574@gmail.com>
Signed-off-by: Mark Brown <broonie@kernel.org>
5 years agoASoC: sun4i-codec: fix first delay on Speaker
Georgii Staroselskii [Tue, 28 May 2019 10:47:39 +0000 (13:47 +0300)]
ASoC: sun4i-codec: fix first delay on Speaker

Allwinner DAC seems to have a delay in the Speaker audio routing. When
playing a sound for the first time, the sound gets chopped. On a second
play the sound is played correctly. After some time (~5s) the issue gets
back.

This commit seems to be fixing the same issue as bf14da7 but
for another codepath.

This is the DTS that was used to debug the problem.

&codec {
        allwinner,pa-gpios = <&r_pio 0 11 GPIO_ACTIVE_HIGH>; /* PL11 */
        allwinner,audio-routing =
                "Speaker", "LINEOUT";

        status = "okay";
}

Signed-off-by: Georgii Staroselskii <georgii.staroselskii@emlid.com>
Reviewed-by: Chen-Yu Tsai <wens@csie.org>
Signed-off-by: Mark Brown <broonie@kernel.org>
5 years agoASoC: sun4i-spdif: Add support for H6 SoC
Clément Péron [Mon, 27 May 2019 20:06:24 +0000 (22:06 +0200)]
ASoC: sun4i-spdif: Add support for H6 SoC

Allwinner H6 has a different mapping for the fifo register controller.

Actually only the fifo TX bit is used in the drivers.

Use the freshly introduced quirks to make this drivers compatible with
the Allwinner H6.

Signed-off-by: Clément Péron <peron.clem@gmail.com>
Acked-by: Maxime Ripard <maxime.ripard@bootlin.com>
Signed-off-by: Mark Brown <broonie@kernel.org>
5 years agoASoC: sun4i-spdif: Add TX fifo bit flush quirks
Clément Péron [Mon, 27 May 2019 20:06:23 +0000 (22:06 +0200)]
ASoC: sun4i-spdif: Add TX fifo bit flush quirks

Allwinner H6 has a different bit to flush the TX FIFO.

Add a quirks to prepare introduction of H6 SoC.

Signed-off-by: Clément Péron <peron.clem@gmail.com>
Acked-by: Maxime Ripard <maxime.ripard@bootlin.com>
Signed-off-by: Mark Brown <broonie@kernel.org>
5 years agoASoC: sun4i-spdif: Move quirks to the top
Clément Péron [Mon, 27 May 2019 20:06:22 +0000 (22:06 +0200)]
ASoC: sun4i-spdif: Move quirks to the top

The quirks are actually defines in the middle of the file with
short explanation.

Move this at the top and add a section to have coherency with
sun4i-i2s.

Signed-off-by: Clément Péron <peron.clem@gmail.com>
Acked-by: Maxime Ripard <maxime.ripard@bootlin.com>
Signed-off-by: Mark Brown <broonie@kernel.org>
5 years agoASoC: cx2072x: fix spelling mistake "configued" -> "configured"
Colin Ian King [Sat, 25 May 2019 20:32:44 +0000 (21:32 +0100)]
ASoC: cx2072x: fix spelling mistake "configued" -> "configured"

There is a spelling mistake in a dev_err error message. Fit it.

Signed-off-by: Colin Ian King <colin.king@canonical.com>
Reviewed-by: Takashi Iwai <tiwai@suse.de>
Signed-off-by: Mark Brown <broonie@kernel.org>
5 years agoASoC: cx2072x: fix integer overflow on unsigned int multiply
Colin Ian King [Fri, 24 May 2019 22:25:51 +0000 (23:25 +0100)]
ASoC: cx2072x: fix integer overflow on unsigned int multiply

In the case where frac_div larger than 96 the result of an unsigned
multiplication overflows an unsigned int.  For example, this can
happen when the sample_rate is 192000 and pll_input is 122.  Fix
this by casing the first term of the mutiply to a u64. Also remove
the extraneous parentheses around the expression.

Addresses-Coverity: ("Unintentional integer overflow")
Fixes: a497a4363706 ("ASoC: Add support for Conexant CX2072X CODEC")
Signed-off-by: Colin Ian King <colin.king@canonical.com>
Reviewed-by: Takashi Iwai <tiwai@suse.de>
Signed-off-by: Mark Brown <broonie@kernel.org>
5 years agodt-bindings: sound: sun4i-i2s: Document that the RX channel can be missing
Maxime Ripard [Fri, 24 May 2019 12:57:59 +0000 (14:57 +0200)]
dt-bindings: sound: sun4i-i2s: Document that the RX channel can be missing

The A83t and compatibles controllers don't have any reception capabilities
on some instances of the controllers, even though it was never documented
as such in the binding before.

Therefore, on those controllers, we don't have the option to set an RX DMA
channel.

This was already done in the DTSI, but the binding itself was never
updated. Let's add a special case in the schemas.

Signed-off-by: Maxime Ripard <maxime.ripard@bootlin.com>
Reviewed-by: Rob Herring <robh@kernel.org>
Signed-off-by: Mark Brown <broonie@kernel.org>
5 years agodt-bindings: sound: Convert Allwinner I2S binding to YAML
Maxime Ripard [Fri, 24 May 2019 12:57:58 +0000 (14:57 +0200)]
dt-bindings: sound: Convert Allwinner I2S binding to YAML

The Allwinner SoCs feature an I2S controller across multiple SoC
generations.

However, earlier generations were a bit simpler than the subsequent ones,
and for example would always have RX and TX capabilities, and no reset
lines.

Signed-off-by: Maxime Ripard <maxime.ripard@bootlin.com>
Reviewed-by: Rob Herring <robh@kernel.org>
Signed-off-by: Mark Brown <broonie@kernel.org>
5 years agoASoC: SOF: force end-of-file for debugfs trace at suspend
Kai Vehmanen [Fri, 24 May 2019 19:23:06 +0000 (14:23 -0500)]
ASoC: SOF: force end-of-file for debugfs trace at suspend

Current trace implementation gets out of sync when sof device
is put to suspend. The debugfs file handle is kept open, but
firmware will reset its state. After resume, debugfs client's
read offset will not be synchronized to firmware and this may
result in traces read in incorrect order and/or stale data being
read after resume.

Add logic to signal end-of-file to read() when firmware tracing
has ended, and all trace data has been read. This allows debugfs
client to capture all trace data, and reopen the trace file to
ensure proper synchronization with firmware after reopening
the node.

Signed-off-by: Kai Vehmanen <kai.vehmanen@linux.intel.com>
Signed-off-by: Pierre-Louis Bossart <pierre-louis.bossart@linux.intel.com>
Signed-off-by: Mark Brown <broonie@kernel.org>
5 years agoASoC: SOF: trace: remove code duplication in sof_wait_trace_avail()
Kai Vehmanen [Fri, 24 May 2019 19:23:05 +0000 (14:23 -0500)]
ASoC: SOF: trace: remove code duplication in sof_wait_trace_avail()

Move duplicated code in sof_wait_trace_avail() to a helper function.

Signed-off-by: Kai Vehmanen <kai.vehmanen@linux.intel.com>
Signed-off-by: Pierre-Louis Bossart <pierre-louis.bossart@linux.intel.com>
Signed-off-by: Mark Brown <broonie@kernel.org>
5 years agoASoC: SOF: Use struct_size() in kmemdup()
Gustavo A. R. Silva [Thu, 23 May 2019 15:58:00 +0000 (10:58 -0500)]
ASoC: SOF: Use struct_size() in kmemdup()

Make use of the struct_size() helper instead of an open-coded version
in order to avoid any potential type mistakes, in particular in the
context in which this code is being used.

So, replace code of the following form:

sizeof(*w) + sizeof(struct sof_ipc_window_elem) * w->num_windows

with:

struct_size(w, window, w->num_windows)

Notice that variable size is unnecessary, hence it is removed.

This code was detected with the help of Coccinelle.

Signed-off-by: Gustavo A. R. Silva <gustavo@embeddedor.com>
Signed-off-by: Mark Brown <broonie@kernel.org>
5 years agoASoC: max98357a: Show KConfig entry
Maxime Jourdan [Mon, 27 May 2019 16:38:09 +0000 (18:38 +0200)]
ASoC: max98357a: Show KConfig entry

The SEI510 board features a standalone MAX98357A codec.
Add a tristate prompt to allow selecting the codec.

Signed-off-by: Maxime Jourdan <mjourdan@baylibre.com>
Signed-off-by: Mark Brown <broonie@kernel.org>
5 years agodt-bindings: sound: sun4i-spdif: Add Allwinner H6 compatible
Clément Péron [Mon, 27 May 2019 20:06:21 +0000 (22:06 +0200)]
dt-bindings: sound: sun4i-spdif: Add Allwinner H6 compatible

Allwinner H6 has a SPDIF controller with an increase of the fifo
size and a sligher difference in memory mapping compare to H3/A64.

This make it not compatible with the previous generation.

Introduce a specific bindings for H6 SoC.

Signed-off-by: Clément Péron <peron.clem@gmail.com>
Reviewed-by: Rob Herring <robh@kernel.org>
Acked-by: Maxime Ripard <maxime.ripard@bootlin.com>
Signed-off-by: Mark Brown <broonie@kernel.org>
5 years agoASoC: SOF: topology: Use struct_size() helper
Gustavo A. R. Silva [Fri, 24 May 2019 16:10:51 +0000 (11:10 -0500)]
ASoC: SOF: topology: Use struct_size() helper

Make use of the struct_size() helper instead of an open-coded version
in order to avoid any potential type mistakes, in particular in the
context in which this code is being used.

So, replace the following form:

sizeof(struct sof_ipc_ctrl_data) + sizeof(struct sof_ipc_ctrl_value_chan) *
le32_to_cpu(mc->num_channels)

with:

struct_size(scontrol->control_data, chanv, le32_to_cpu(mc->num_channels))

and so on...

This code was detected with the help of Coccinelle.

Signed-off-by: Gustavo A. R. Silva <gustavo@embeddedor.com>
Signed-off-by: Mark Brown <broonie@kernel.org>
5 years agoASoC: cx2072x: remove redundant assignment to pulse_len
Colin Ian King [Fri, 24 May 2019 21:44:19 +0000 (22:44 +0100)]
ASoC: cx2072x: remove redundant assignment to pulse_len

Variable pulse_len is being initialized to 1 however this value is
never read and pulse_len is being re-assigned later in a switch
statement.  Clean up the code by removing the redundant initialization.

Addresses-Coverity: ("Unused value")
Signed-off-by: Colin Ian King <colin.king@canonical.com>
Reviewed-by: Takashi Iwai <tiwai@suse.de>
Signed-off-by: Mark Brown <broonie@kernel.org>
5 years agoASoC: SOF: Intel: hda: fix the hda init chip
Zhu Yingjiang [Fri, 24 May 2019 19:09:24 +0000 (14:09 -0500)]
ASoC: SOF: Intel: hda: fix the hda init chip

re-write hda_init_caps and remove the HDA reset, clean HDA
streams and clear interrupt steps in hda_dsp_probe so the
HDA init steps will not be called twice if the
CONFIG_SND_SOC_SOF_HDA is true.

Fixes: 8a300c8fb17 ("ASoC: SOF: Intel: Add HDA controller for Intel DSP")
Reviewed-by: Takashi Iwai <tiwai@suse.de>
Signed-off-by: Zhu Yingjiang <yingjiang.zhu@linux.intel.com>
Signed-off-by: Pierre-Louis Bossart <pierre-louis.bossart@linux.intel.com>
Signed-off-by: Mark Brown <broonie@kernel.org>
5 years agoASoC: SOF: ipc: fix a race, leading to IPC timeouts
Guennadi Liakhovetski [Fri, 24 May 2019 19:09:23 +0000 (14:09 -0500)]
ASoC: SOF: ipc: fix a race, leading to IPC timeouts

Currently on all supported platforms the IPC IRQ thread first signals
the sender when an IPC response is received from the DSP, then unmasks
the IPC interrupt. Those actions are performed without holding any
locks, so the thread can be interrupted between them. IPC timeouts
have been observed in such scenarios: if the sender is woken up and it
proceeds with sending the next message without unmasking the IPC
interrupt, it can miss the next response. This patch takes a spin-lock
to prevent the IRQ thread from being preempted at that point. It also
makes sure, that the next IPC transmission by the host cannot take
place before the IRQ thread has finished updating all the required IPC
registers.

Fixes: 53e0c72d98b ("ASoC: SOF: Add support for IPC IO between DSP and Host")
Reviewed-by: Takashi Iwai <tiwai@suse.de>
Signed-off-by: Guennadi Liakhovetski <guennadi.liakhovetski@linux.intel.com>
Signed-off-by: Pierre-Louis Bossart <pierre-louis.bossart@linux.intel.com>
Signed-off-by: Mark Brown <broonie@kernel.org>
5 years agoASoC: SOF: control: correct the copy size for bytes kcontrol put
Keyon Jie [Fri, 24 May 2019 19:09:22 +0000 (14:09 -0500)]
ASoC: SOF: control: correct the copy size for bytes kcontrol put

The size for the bytes kcontrol should include the abi header, that is,
data->size + sizeof(*data), it is also aligned with get method after
this change.

Fixes: c3078f53970 ("ASoC: SOF: Add Sound Open Firmware KControl support")
Reviewed-by: Takashi Iwai <tiwai@suse.de>
Signed-off-by: Keyon Jie <yang.jie@linux.intel.com>
Signed-off-by: Pierre-Louis Bossart <pierre-louis.bossart@linux.intel.com>
Signed-off-by: Mark Brown <broonie@kernel.org>
5 years agoASoC: SOF: pcm: remove warning - initialize workqueue on open
Pierre-Louis Bossart [Fri, 24 May 2019 19:09:21 +0000 (14:09 -0500)]
ASoC: SOF: pcm: remove warning - initialize workqueue on open

If the SOF hw_params() fail, typically with an IPC error thrown by the
firmware, the period_elapsed workqueue is not initialized, but we
still cancel it in hw_free(), which results in a kernel warning.

Move the initialization to the .open callback. Tested on Broadwell
(Samus) and IceLake.

Fixes: e2803e610ae ("ASoC: SOF: PCM: add period_elapsed work to fix
race condition in interrupt context")

GitHub issue: https://github.com/thesofproject/linux/issues/932
Reviewed-by: Takashi Iwai <tiwai@suse.de>
Signed-off-by: Pierre-Louis Bossart <pierre-louis.bossart@linux.intel.com>
Signed-off-by: Mark Brown <broonie@kernel.org>