]> git.proxmox.com Git - mirror_ubuntu-jammy-kernel.git/log
mirror_ubuntu-jammy-kernel.git
4 years agoASoC: mmp-sspa: A trivial typo fix
Lubomir Rintel [Mon, 11 May 2020 21:01:26 +0000 (23:01 +0200)]
ASoC: mmp-sspa: A trivial typo fix

"Transmit", not "Tansmit".

Signed-off-by: Lubomir Rintel <lkundrak@v3.sk>
Link: https://lore.kernel.org/r/20200511210134.1224532-4-lkundrak@v3.sk
Signed-off-by: Mark Brown <broonie@kernel.org>
4 years agoASoC: ti: omap-mcbsp: Fix an error handling path in 'asoc_mcbsp_probe()'
Christophe JAILLET [Tue, 12 May 2020 13:43:25 +0000 (15:43 +0200)]
ASoC: ti: omap-mcbsp: Fix an error handling path in 'asoc_mcbsp_probe()'

If an error occurs after the call to 'omap_mcbsp_init()', the reference to
'mcbsp->fclk' must be decremented, as already done in the remove function.

This can be achieved easily by using the devm_ variant of 'clk_get()'
when the reference is taken in 'omap_mcbsp_init()'

This fixes the leak in the probe and has the side effect to simplify both
the error handling path of 'omap_mcbsp_init()' and the remove function.

Signed-off-by: Christophe JAILLET <christophe.jaillet@wanadoo.fr>
Acked-by: Peter Ujfalusi <peter.ujflausi@ti.com>
Link: https://lore.kernel.org/r/20200512134325.252073-1-christophe.jaillet@wanadoo.fr
Signed-off-by: Mark Brown <broonie@kernel.org>
4 years agoASoC: Intel: Skylake: Update description for HDaudio kconfig
Cezary Rojewski [Wed, 6 May 2020 21:21:14 +0000 (23:21 +0200)]
ASoC: Intel: Skylake: Update description for HDaudio kconfig

With 'ASoC: Intel: Skylake: Fix HDaudio and Dmic' series applied,
warning is no longer true. Remove it and update the description.

Signed-off-by: Cezary Rojewski <cezary.rojewski@intel.com>
Link: https://lore.kernel.org/r/20200506212114.8502-1-cezary.rojewski@intel.com
Signed-off-by: Mark Brown <broonie@kernel.org>
4 years agoASoC: rockchip-i2s: add description for rk3308
Johan Jonker [Thu, 7 May 2020 11:32:38 +0000 (13:32 +0200)]
ASoC: rockchip-i2s: add description for rk3308

The description below is already in use for rk3308.dtsi,
but was somehow never added to a document, so add
"rockchip,rk3308-i2s", "rockchip,rk3066-i2s"
for i2s nodes on a rk3308 platform to rockchip-i2s.yaml.
One of the rk3308 i2s nodes also has a different dma layout,
so change that as well.

Signed-off-by: Johan Jonker <jbx6244@gmail.com>
Link: https://lore.kernel.org/r/20200507113238.7904-1-jbx6244@gmail.com
Signed-off-by: Mark Brown <broonie@kernel.org>
4 years agoASoC: ux500: mop500: Fix some refcounted resources issues
Christophe JAILLET [Tue, 12 May 2020 10:07:05 +0000 (12:07 +0200)]
ASoC: ux500: mop500: Fix some refcounted resources issues

There are 2 issues here:
   - if one of the 'of_parse_phandle' fails, calling 'mop500_of_node_put()'
     is a no-op because the 'mop500_dai_links' structure has not been
     initialized yet, so the referenced are not decremented
   - The reference stored in 'mop500_dai_links[i].codecs' is refcounted
     only once in the probe and must be decremented only once.

Fixes: 39013bd60e79 ("ASoC: Ux500: Dispose of device nodes correctly")
Signed-off-by: Christophe JAILLET <christophe.jaillet@wanadoo.fr>
Link: https://lore.kernel.org/r/20200512100705.246349-1-christophe.jaillet@wanadoo.fr
Signed-off-by: Mark Brown <broonie@kernel.org>
4 years agoASoC: Intel: Skylake: Replace zero-length array with flexible-array
Gustavo A. R. Silva [Mon, 11 May 2020 17:46:47 +0000 (12:46 -0500)]
ASoC: Intel: Skylake: Replace zero-length array with flexible-array

The current codebase makes use of the zero-length array language
extension to the C90 standard, but the preferred mechanism to declare
variable-length types such as these ones is a flexible array member[1][2],
introduced in C99:

struct foo {
        int stuff;
        struct boo array[];
};

By making use of the mechanism above, we will get a compiler warning
in case the flexible array does not occur last in the structure, which
will help us prevent some kind of undefined behavior bugs from being
inadvertently introduced[3] to the codebase from now on.

Also, notice that, dynamic memory allocations won't be affected by
this change:

"Flexible array members have incomplete type, and so the sizeof operator
may not be applied. As a quirk of the original implementation of
zero-length arrays, sizeof evaluates to zero."[1]

sizeof(flexible-array-member) triggers a warning because flexible array
members have incomplete type[1]. There are some instances of code in
which the sizeof operator is being incorrectly/erroneously applied to
zero-length arrays and the result is zero. Such instances may be hiding
some bugs. So, this work (flexible-array member conversions) will also
help to get completely rid of those sorts of issues.

This issue was found with the help of Coccinelle.

[1] https://gcc.gnu.org/onlinedocs/gcc/Zero-Length.html
[2] https://github.com/KSPP/linux/issues/21
[3] commit 76497732932f ("cxgb3/l2t: Fix undefined behaviour")

Signed-off-by: Gustavo A. R. Silva <gustavoars@kernel.org>
Acked-by: Cezary Rojewski <cezary.rojewski@intel.com>
Link: https://lore.kernel.org/r/20200511174647.GA17318@embeddedor
Signed-off-by: Mark Brown <broonie@kernel.org>
4 years agoMerge branch 'for-5.7' of https://git.kernel.org/pub/scm/linux/kernel/git/broonie...
Mark Brown [Tue, 12 May 2020 15:12:47 +0000 (16:12 +0100)]
Merge branch 'for-5.7' of https://git.kernel.org/pub/scm/linux/kernel/git/broonie/sound into asoc-5.8

4 years agoASoC: mmp-sspa: Drop S20_3LE case
Lubomir Rintel [Mon, 11 May 2020 21:01:25 +0000 (23:01 +0200)]
ASoC: mmp-sspa: Drop S20_3LE case

It does nothing, because the corresponding bit s not flipped on in .formats
and the audio SRAM DMA engine is not able to handle 20-bit transfers
anyway.

Signed-off-by: Lubomir Rintel <lkundrak@v3.sk>
Link: https://lore.kernel.org/r/20200511210134.1224532-3-lkundrak@v3.sk
Signed-off-by: Mark Brown <broonie@kernel.org>
4 years agoASoC: mmp-sspa: Flip SNDRV_PCM_FMTBIT_S24_3LE on
Lubomir Rintel [Mon, 11 May 2020 21:01:24 +0000 (23:01 +0200)]
ASoC: mmp-sspa: Flip SNDRV_PCM_FMTBIT_S24_3LE on

The hw_params() callback handles the 3-byte format, not
SNDRV_PCM_FMTBIT_S24_LE.

Signed-off-by: Lubomir Rintel <lkundrak@v3.sk>
Link: https://lore.kernel.org/r/20200511210134.1224532-2-lkundrak@v3.sk
Signed-off-by: Mark Brown <broonie@kernel.org>
4 years agoASoC: Intel: Use readq to read 64 bit registers
Amadeusz Sławiński [Thu, 7 May 2020 13:34:05 +0000 (09:34 -0400)]
ASoC: Intel: Use readq to read 64 bit registers

In order to fix issue described in:
"ASoC: Intel: sst: ipc command timeout"
https://patchwork.kernel.org/patch/11482829/

use readq function, which is meant to read 64 bit values from registers.
On 32 bit platforms it falls back to two readl calls.

Reported-by: Brent Lu <brent.lu@intel.com>
Signed-off-by: Amadeusz Sławiński <amadeuszx.slawinski@linux.intel.com>
Tested-by: Brent Lu <brent.lu@intel.com>
Acked-by: Cezary Rojewski <cezary.rojewski@intel.com>
Link: https://lore.kernel.org/r/20200507133405.32251-2-amadeuszx.slawinski@linux.intel.com
Signed-off-by: Mark Brown <broonie@kernel.org>
4 years agoASoC: Intel: baytrail: Fix register access
Amadeusz Sławiński [Thu, 7 May 2020 13:34:04 +0000 (09:34 -0400)]
ASoC: Intel: baytrail: Fix register access

Baytrail has 64 bit registers, so we should use *read64* to read from it
and then use proper mask values to check status.

Signed-off-by: Amadeusz Sławiński <amadeuszx.slawinski@linux.intel.com>
Tested-by: Brent Lu <brent.lu@intel.com>
Acked-by: Cezary Rojewski <cezary.rojewski@intel.com>
Link: https://lore.kernel.org/r/20200507133405.32251-1-amadeuszx.slawinski@linux.intel.com
Signed-off-by: Mark Brown <broonie@kernel.org>
4 years agoSoC: rsnd: add interrupt support for SSI BUSIF buffer
Yongbo Zhang [Tue, 12 May 2020 09:30:03 +0000 (17:30 +0800)]
SoC: rsnd: add interrupt support for SSI BUSIF buffer

SSI BUSIF buffer is possible to overflow or underflow, especially in a
hypervisor environment. If there is no interrupt support, it will eventually
lead to errors in pcm data.
This patch adds overflow and underflow interrupt support for SSI BUSIF buffer.

Reported-by: Chen Li <licheng0822@thundersoft.com>
Signed-off-by: Yongbo Zhang <giraffesnn123@gmail.com>
Tested-by: Chen Li <licheng0822@thundersoft.com>
Acked-by: Kuninori Morimoto <kuninori.morimoto.gx@renesas.com>
Link: https://lore.kernel.org/r/20200512093003.28332-1-giraffesnn123@gmail.com
Signed-off-by: Mark Brown <broonie@kernel.org>
4 years agoASoC: SOF: core: fix error return code in sof_probe_continue()
Wei Yongjun [Sat, 9 May 2020 09:33:37 +0000 (09:33 +0000)]
ASoC: SOF: core: fix error return code in sof_probe_continue()

Fix to return negative error code -ENOMEM from the IPC init error
handling case instead of 0, as done elsewhere in this function.

Fixes: c16211d6226d ("ASoC: SOF: Add Sound Open Firmware driver core")
Reported-by: Hulk Robot <hulkci@huawei.com>
Signed-off-by: Wei Yongjun <weiyongjun1@huawei.com>
Link: https://lore.kernel.org/r/20200509093337.78897-1-weiyongjun1@huawei.com
Signed-off-by: Mark Brown <broonie@kernel.org>
4 years agoASoC: mediatek: mt8183-da7219: set headset button maps
Tzung-Bi Shih [Mon, 11 May 2020 04:40:00 +0000 (12:40 +0800)]
ASoC: mediatek: mt8183-da7219: set headset button maps

Sets headset button maps.

Signed-off-by: Tzung-Bi Shih <tzungbi@google.com>
Link: https://lore.kernel.org/r/20200511044000.86161-1-tzungbi@google.com
Signed-off-by: Mark Brown <broonie@kernel.org>
4 years agoASoC: cros_ec_codec: allocate shash_desc dynamically
Arnd Bergmann [Thu, 7 May 2020 21:33:51 +0000 (23:33 +0200)]
ASoC: cros_ec_codec: allocate shash_desc dynamically

The wov_hotword_model_put() function has multiple large variables on
its stack, the largest of which is the result of SHASH_DESC_ON_STACK().
In total, this exceeds the warning limit for 32-bit architectures:

sound/soc/codecs/cros_ec_codec.c:776:12: error: stack frame size of 1152 bytes in function 'wov_hotword_model_put' [-Werror,-Wframe-larger-than=]

The function already has a dynamic crypto_alloc_shash() allocation, so
using kmalloc() for the descriptor is correct as well and does not
introduce any additional failure scenarios. With this, the stack usage
of wov_hotword_model_put() gets reduced to 480 bytes in my test
configuration.

Fixes: b6bc07d4360d ("ASoC: cros_ec_codec: support WoV")
Signed-off-by: Arnd Bergmann <arnd@arndb.de>
Reviewed-by: Tzung-Bi Shih <tzungbi@google.com>
Link: https://lore.kernel.org/r/20200507213405.1869430-1-arnd@arndb.de
Signed-off-by: Mark Brown <broonie@kernel.org>
4 years agoASoC: soc-core: Replace zero-length array with flexible-array
Gustavo A. R. Silva [Thu, 7 May 2020 19:22:28 +0000 (14:22 -0500)]
ASoC: soc-core: Replace zero-length array with flexible-array

The current codebase makes use of the zero-length array language
extension to the C90 standard, but the preferred mechanism to declare
variable-length types such as these ones is a flexible array member[1][2],
introduced in C99:

struct foo {
        int stuff;
        struct boo array[];
};

By making use of the mechanism above, we will get a compiler warning
in case the flexible array does not occur last in the structure, which
will help us prevent some kind of undefined behavior bugs from being
inadvertently introduced[3] to the codebase from now on.

Also, notice that, dynamic memory allocations won't be affected by
this change:

"Flexible array members have incomplete type, and so the sizeof operator
may not be applied. As a quirk of the original implementation of
zero-length arrays, sizeof evaluates to zero."[1]

sizeof(flexible-array-member) triggers a warning because flexible array
members have incomplete type[1]. There are some instances of code in
which the sizeof operator is being incorrectly/erroneously applied to
zero-length arrays and the result is zero. Such instances may be hiding
some bugs. So, this work (flexible-array member conversions) will also
help to get completely rid of those sorts of issues.

This issue was found with the help of Coccinelle.

[1] https://gcc.gnu.org/onlinedocs/gcc/Zero-Length.html
[2] https://github.com/KSPP/linux/issues/21
[3] commit 76497732932f ("cxgb3/l2t: Fix undefined behaviour")

Signed-off-by: Gustavo A. R. Silva <gustavoars@kernel.org>
Link: https://lore.kernel.org/r/20200507192228.GA16355@embeddedor
Signed-off-by: Mark Brown <broonie@kernel.org>
4 years agoASoC: SOF: Intel: Fix unused variable warning
YueHaibing [Thu, 7 May 2020 07:27:35 +0000 (15:27 +0800)]
ASoC: SOF: Intel: Fix unused variable warning

When CONFIG_SND_SOC_SOF_BAYTRAIL is not set, gcc warns:

sound/soc/sof/intel/byt.c:85:41: warning: ‘cht_debugfs’ defined but not used [-Wunused-const-variable=]
 static const struct snd_sof_debugfs_map cht_debugfs[] = {
                                         ^~~~~~~~~~~
Move the variable inside #ifdef

Reported-by: Hulk Robot <hulkci@huawei.com>
Suggested-by: Joe Perches <joe@perches.com>
Signed-off-by: YueHaibing <yuehaibing@huawei.com>
Link: https://lore.kernel.org/r/20200507072735.16588-1-yuehaibing@huawei.com
Signed-off-by: Mark Brown <broonie@kernel.org>
4 years agosoc: fsl_asrc: Make some functions static
ChenTao [Thu, 7 May 2020 02:29:59 +0000 (10:29 +0800)]
soc: fsl_asrc: Make some functions static

Fix the following warning:

sound/soc/fsl/fsl_asrc.c:157:5: warning:
symbol 'fsl_asrc_request_pair' was not declared. Should it be static?
sound/soc/fsl/fsl_asrc.c:200:6: warning:
symbol 'fsl_asrc_release_pair' was not declared. Should it be static?

Reported-by: Hulk Robot <hulkci@huawei.com>
Signed-off-by: ChenTao <chentao107@huawei.com>
Link: https://lore.kernel.org/r/20200507022959.183739-1-chentao107@huawei.com
Signed-off-by: Mark Brown <broonie@kernel.org>
4 years agoASoC: rt1016: Add the devicetree file for the rt1016
Oder Chiou [Thu, 7 May 2020 02:15:39 +0000 (10:15 +0800)]
ASoC: rt1016: Add the devicetree file for the rt1016

The patch adds the devicetree file for the rt1016.

Signed-off-by: Oder Chiou <oder_chiou@realtek.com>
Link: https://lore.kernel.org/r/20200507021539.7133-2-oder_chiou@realtek.com
Signed-off-by: Mark Brown <broonie@kernel.org>
4 years agoASoC: rt1016: Add the rt1016 support
Oder Chiou [Thu, 7 May 2020 02:15:38 +0000 (10:15 +0800)]
ASoC: rt1016: Add the rt1016 support

The patch adds the rt1016 support.

Signed-off-by: Oder Chiou <oder_chiou@realtek.com>
Link: https://lore.kernel.org/r/20200507021539.7133-1-oder_chiou@realtek.com
Signed-off-by: Mark Brown <broonie@kernel.org>
4 years agoASoC: rt5677: Use devm_snd_soc_register_component()
Wei Yongjun [Thu, 7 May 2020 09:43:35 +0000 (09:43 +0000)]
ASoC: rt5677: Use devm_snd_soc_register_component()

Using devm_snd_soc_register_component() can make the code
shorter and cleaner.

Signed-off-by: Wei Yongjun <weiyongjun1@huawei.com>
Link: https://lore.kernel.org/r/20200507094335.14302-1-weiyongjun1@huawei.com
Signed-off-by: Mark Brown <broonie@kernel.org>
4 years agoASoC: mediatek: mt8183: fix error handling of platform_get_irq()
Tzung-Bi Shih [Thu, 7 May 2020 01:54:42 +0000 (09:54 +0800)]
ASoC: mediatek: mt8183: fix error handling of platform_get_irq()

platform_get_irq() returns negative value on error instead of 0.

Signed-off-by: Tzung-Bi Shih <tzungbi@google.com>
Link: https://lore.kernel.org/r/20200507015442.191336-1-tzungbi@google.com
Signed-off-by: Mark Brown <broonie@kernel.org>
4 years agoASoC: mediatek: Fix error handling
Tang Bin [Wed, 6 May 2020 14:30:09 +0000 (22:30 +0800)]
ASoC: mediatek: Fix error handling

If the function platform_get_irq() failed, the negative value
returned will not be detected here. So fix error handling in
mt6797_afe_pcm_dev_probe(). And when get irq failed, the function
platform_get_irq() logs an error message, so remove redundant
message here.

Signed-off-by: Zhang Shengju <zhangshengju@cmss.chinamobile.com>
Signed-off-by: Tang Bin <tangbin@cmss.chinamobile.com>
Link: https://lore.kernel.org/r/20200506143009.13368-1-tangbin@cmss.chinamobile.com
Signed-off-by: Mark Brown <broonie@kernel.org>
4 years agoASoC: amd :High hw_level while simultaneous capture
Akshu Agrawal [Wed, 6 May 2020 10:26:00 +0000 (15:56 +0530)]
ASoC: amd :High hw_level while simultaneous capture

Simultaneous capture on dmic and headset mic is having
issue with high hw_level being reported.

Issue Can be reproduced by:
arecord -D hw:2,0 -f dat -d 60 /tmp/test0 &
arecord -D hw:2,2 -f dat -d 60 /tmp/test1 &
cat /proc/asound/card2/pcm?c/sub0/status

Actual issue is :
When we open one capture stream on one instance lets say I2S_SP and then
once again if we open other capture on other instance lets say I2S_BT while
first capture is in progress and when we try to read the status of both
running instances by below command cat /proc/asound/card2/pcm?c/sub0/status
we observe that avail_max is being doubled on first opened
capture(I2S_SP in the example).

This is because our previous implementation was like when any instance is
opened it gets initialized in dma_open irrespective of on what instance it
called open.

For example:
First I2S_SP called opened it initializes both SP/BT capture streams
irrespective of on which instance the stream opened.next time I2S_BT
called opened and it initializes both SP/BT this corrupts the behaviour .

So with this patch the stream gets initialized only on specific instance
when ever it gets opened calls hw_params.

This rectifies the issue.

Signed-off-by: Ravulapati Vishnu vardhan rao <Vishnuvardhanrao.Ravulapati@amd.com>
Signed-off-by: Akshu Agrawal <akshu.agrawal@amd.com>
Link: https://lore.kernel.org/r/20200506102602.140790-1-akshu.agrawal@amd.com
Signed-off-by: Mark Brown <broonie@kernel.org>
4 years agoASoC: qcom: lpass-cpu: Make I2S SD lines configurable
Stephan Gerhold [Sat, 25 Apr 2020 18:46:57 +0000 (20:46 +0200)]
ASoC: qcom: lpass-cpu: Make I2S SD lines configurable

The LPASS hardware allows configuring the MI2S SD lines to use
when playing/recording audio. However, at the moment the lpass-cpu
driver has SD0 hard-coded for mono/stereo (or additional fixed
SD lines for more channels).

For weird reasons there seems to be hardware that uses one of the
other SD lines for mono/stereo. For example, some Samsung devices
use an external Speaker amplifier connected to Quaternary MI2S.
For some reason, the SD line for audio playback was connected to
SD1 rather than SD0. (I have no idea why...)
At the moment, the lpass-cpu driver cannot be configured to work
for the Speaker on these devices.

The q6afe driver already allows configuring the MI2S SD lines
through the "qcom,sd-lines" device tree property, but this works
only when routing audio through the ADSP.

This commit adds a very similar configuration for the lpass-cpu driver.
It is now possible to add additional subnodes to the lpass device in
the device tree, to configure the SD lines for playback and/or capture.
E.g. for the Samsung devices mentioned above:

&lpass {
dai@3 {
reg = <MI2S_QUATERNARY>;
qcom,playback-sd-lines = <1>;
};
};

qcom,playback/capture-sd-lines takes a list of SD lines (0-3)
in the same format as the q6afe driver. (The difference here is that
q6afe has separate DAIs for playback/capture, while lpass-cpu has one
for both...)

For backwards compatibility with older device trees, the lpass-cpu driver
defaults to LPAIF_I2SCTL_MODE_8CH if the subnode for a DAI is missing.
This is equivalent to the previous behavior: Up to 8 channels can be
configured, and SD0/QUAT01 will be chosen when setting up a stream
with fewer channels.

This allows the speaker to work on Samsung MSM8916 devices
that use an external speaker amplifier.

Signed-off-by: Stephan Gerhold <stephan@gerhold.net>
Cc: Srinivas Kandagatla <srinivas.kandagatla@linaro.org>
Link: https://lore.kernel.org/r/20200425184657.121991-2-stephan@gerhold.net
Signed-off-by: Mark Brown <broonie@kernel.org>
4 years agodt-bindings: sound: lpass-cpu: Document DAI subnodes
Stephan Gerhold [Sat, 25 Apr 2020 18:46:56 +0000 (20:46 +0200)]
dt-bindings: sound: lpass-cpu: Document DAI subnodes

The lpass-cpu driver now allows configuring the MI2S SD lines
by defining subnodes for one of the DAIs.

Document this in the device tree bindings.

Signed-off-by: Stephan Gerhold <stephan@gerhold.net>
Link: https://lore.kernel.org/r/20200425184657.121991-1-stephan@gerhold.net
Signed-off-by: Mark Brown <broonie@kernel.org>
4 years agoASoC: wm8524: Add support S32_LE
Shengjiu Wang [Fri, 22 Nov 2019 10:30:13 +0000 (18:30 +0800)]
ASoC: wm8524: Add support S32_LE

Allow 32bit sample with this codec.

Signed-off-by: Shengjiu Wang <shengjiu.wang@nxp.com>
Link: https://lore.kernel.org/r/cff745cc041c5208910821f0740f988926af8a66.1574418380.git.shengjiu.wang@nxp.com
Signed-off-by: Mark Brown <broonie@kernel.org>
4 years agoASoC: qcom: Use the defined variable to simplify code
Tang Bin [Mon, 4 May 2020 06:59:47 +0000 (14:59 +0800)]
ASoC: qcom: Use the defined variable to simplify code

Use the defined variable "dev" to make the code cleaner.

Signed-off-by: Zhang Shengju <zhangshengju@cmss.chinamobile.com>
Signed-off-by: Tang Bin <tangbin@cmss.chinamobile.com>
Link: https://lore.kernel.org/r/20200504065947.12172-1-tangbin@cmss.chinamobile.com
Signed-off-by: Mark Brown <broonie@kernel.org>
4 years agoASoC: rt1015: Add condition to prevent SoC providing bclk in ratio of 50 times of...
Jack Yu [Mon, 4 May 2020 11:20:13 +0000 (19:20 +0800)]
ASoC: rt1015: Add condition to prevent SoC providing bclk in ratio of 50 times of sample rate.

Add condition to prevent SoC providing bclk in ratio of 50 times of sample rate.

Signed-off-by: Jack Yu <jack.yu@realtek.com>
Link: https://lore.kernel.org/r/20200504112013.2499-1-jack.yu@realtek.com
Signed-off-by: Mark Brown <broonie@kernel.org>
4 years agoASoC: rl6231: Add the K bypass for the PLL parameters
Oder Chiou [Mon, 4 May 2020 07:40:07 +0000 (15:40 +0800)]
ASoC: rl6231: Add the K bypass for the PLL parameters

The patch adds the K bypass for the PLL parameters.

Signed-off-by: Oder Chiou <oder_chiou@realtek.com>
Link: https://lore.kernel.org/r/20200504074007.13002-2-oder_chiou@realtek.com
Signed-off-by: Mark Brown <broonie@kernel.org>
4 years agoASoC: adau7118: Mark the ADAU7118 reset register as volatile
Chris Garren [Mon, 4 May 2020 13:43:20 +0000 (09:43 -0400)]
ASoC: adau7118: Mark the ADAU7118 reset register as volatile

Without this the previously written value was written to this reg,
which caused the different configuration registers to be reset.

Signed-off-by: Chris Garren <cdgarren@indesign-llc.com>
Link: https://lore.kernel.org/r/1588599820-57994-1-git-send-email-cdgarren@indesign-llc.com
Signed-off-by: Mark Brown <broonie@kernel.org>
4 years agoASoC: codecs: max9768: update contact email
Wolfram Sang [Sat, 2 May 2020 14:26:46 +0000 (16:26 +0200)]
ASoC: codecs: max9768: update contact email

The 'pengutronix' address is defunct for years. Use the proper contact
address.

Signed-off-by: Wolfram Sang <wsa@kernel.org>
Link: https://lore.kernel.org/r/20200502142646.19033-1-wsa@kernel.org
Signed-off-by: Mark Brown <broonie@kernel.org>
4 years agoASoC: max98373: reorder max98373_reset() in resume
Yong Zhi [Fri, 1 May 2020 23:44:21 +0000 (18:44 -0500)]
ASoC: max98373: reorder max98373_reset() in resume

During S3 test, the following error was observed:

[ 726.174237] i2c_designware i2c_designware.0: platform_pm_resume+0x0/0x3d returned 0 after 0 usecs
[ 726.184187] max98373 i2c-MX98373:00: calling max98373_resume+0x0/0x30 [snd_soc_max98373] @ 12698, parent: i2c-11
[ 726.195589] max98373 i2c-MX98373:00: Reset command failed. (ret:-16)

When calling regmap_update_bits(), since map->reg_update_bits is NULL,
_regmap_read() is entered with the following logic:

if (!map->cache_bypass) {
ret = regcache_read(map, reg, val);
if (ret == 0)
return 0;
}

if (map->cache_only)
return -EBUSY;

regcache_read() hits -EINVAL because MAX98373_R2000_SW_RESET is volatile,
as map->cache_only is set by codec suspend, thus -EBUSY is returned.
Fix by moving max98373_reset() after cache_only set to false in max98373_resume().

Signed-off-by: Yong Zhi <yong.zhi@intel.com>
Link: https://lore.kernel.org/r/1588376661-29799-1-git-send-email-yong.zhi@intel.com
Signed-off-by: Mark Brown <broonie@kernel.org>
4 years agoASoC: rt1308: Revise the devicetree file mode
Oder Chiou [Mon, 4 May 2020 07:40:06 +0000 (15:40 +0800)]
ASoC: rt1308: Revise the devicetree file mode

The patch changes the devicetree file mode correctly.

Signed-off-by: Oder Chiou <oder_chiou@realtek.com>
Link: https://lore.kernel.org/r/20200504074007.13002-1-oder_chiou@realtek.com
Signed-off-by: Mark Brown <broonie@kernel.org>
4 years agoASoC: SOF/Intel: clarify SPDX license with GPL-2.0-only
Pierre-Louis Bossart [Fri, 1 May 2020 14:58:50 +0000 (09:58 -0500)]
ASoC: SOF/Intel: clarify SPDX license with GPL-2.0-only

Remove the ambiguity with GPL-2.0 and use an explicit GPL-2.0-only
tag.

Signed-off-by: Pierre-Louis Bossart <pierre-louis.bossart@linux.intel.com>
Reviewed-by: Daniel Baluta <daniel.baluta@nxp.com>
Reviewed-by: Kai Vehmanen <kai.vehmanen@linux.intel.com>
Reviewed-by: Guennadi Liakhovetski <guennadi.liakhovetski@linux.intel.com>
Link: https://lore.kernel.org/r/20200501145850.15178-1-pierre-louis.bossart@linux.intel.com
Signed-off-by: Mark Brown <broonie@kernel.org>
4 years agodt-bindings: sound: wm8994: Correct required supplies based on actual implementaion
Krzysztof Kozlowski [Fri, 1 May 2020 13:35:34 +0000 (15:35 +0200)]
dt-bindings: sound: wm8994: Correct required supplies based on actual implementaion

The required supplies in bindings were actually not matching
implementation making the bindings incorrect and misleading.  The Linux
kernel driver requires all supplies to be present.  Also for wlf,wm8994
uses just DBVDD-supply instead of DBVDDn-supply (n: <1,3>).

Reported-by: Jonathan Bakker <xc-racer2@live.ca>
Signed-off-by: Krzysztof Kozlowski <krzk@kernel.org>
Link: https://lore.kernel.org/r/20200501133534.6706-1-krzk@kernel.org
Signed-off-by: Mark Brown <broonie@kernel.org>
4 years agoASoC: Intel: boards: sof-wm8804: support for Hifiberry Digiplus boards
Pierre-Louis Bossart [Fri, 1 May 2020 15:16:25 +0000 (10:16 -0500)]
ASoC: Intel: boards: sof-wm8804: support for Hifiberry Digiplus boards

Add a new machine driver to interface with WM8804. The code is based
on settings found in sound/soc/bcm/hifiberry-digi.c in the Raspberry
PI tree.

Tested on Up2 with Digi+ IO (capture+playback) and Digi+ PRO (playback
with two local oscillators supported). The codec is clock master in
both cases.

Capture support has known clocking restrictions: the transmitter needs
to be active for the clock recovery, the "Tx Source" mixer set to
"S/PDIF RX". Playback will only work while capture is active.

When Capture is not desired, or when there is no RX connector, the "Tx
Source" mixer should be set to "AIF"

Signed-off-by: Pierre-Louis Bossart <pierre-louis.bossart@linux.intel.com>
Reviewed-by: Ranjani Sridharan <ranjani.sridharan@linux.intel.com>
Link: https://lore.kernel.org/r/20200501151625.17820-1-pierre-louis.bossart@linux.intel.com
Signed-off-by: Mark Brown <broonie@kernel.org>
4 years agoASoC: SOF: Update correct LED status at the first time usage of update_mute_led()
Kai-Heng Feng [Thu, 30 Apr 2020 09:11:39 +0000 (17:11 +0800)]
ASoC: SOF: Update correct LED status at the first time usage of update_mute_led()

At the first time update_mute_led() gets called, if channels are already
muted, the temp value equals to led_value as 0, skipping the following
LED setting.

So set led_value to -1 as an uninitialized state, to update the correct
LED status at first time usage.

Fixes: 5d43001ae436 ("ASoC: SOF: acpi led support for switch controls")
Signed-off-by: Kai-Heng Feng <kai.heng.feng@canonical.com>
Reviewed-by: Ranjani Sridharan <ranjani.sridharan@linux.intel.com>
Acked-by: Kai Vehmanen <kai.vehmanen@linux.intel.com>
Link: https://lore.kernel.org/r/20200430091139.7003-1-kai.heng.feng@canonical.com
Signed-off-by: Mark Brown <broonie@kernel.org>
4 years agoMerge series "ASoC: rt5682: apply some refactors" from Tzung-Bi Shih <tzungbi@google...
Mark Brown [Thu, 30 Apr 2020 13:39:46 +0000 (14:39 +0100)]
Merge series "ASoC: rt5682: apply some refactors" from Tzung-Bi Shih <tzungbi@google.com>:

The series tries to refactor the coding style to follow most conventions.

The 4th patch converts pr_() to dev_().
(https://mailman.alsa-project.org/pipermail/alsa-devel/2020-March/164849.html)

The 6th patch changes the behavior a bit to restore its original intent.

Tzung-Bi Shih (6):
  ASoC: rt5682: simplify assertions
  ASoC: rt5682: fix space issues
  ASoC: rt5682: remove empty default case
  ASoC: rt5682: replace message printing from pr_() to dev_()
  ASoC: rt5682: remove duplicate rt5682_reset() calls
  ASoC: rt5682: remove unwanted btn_type assignment

 sound/soc/codecs/rt5682.c | 198 ++++++++++++++++----------------------
 1 file changed, 84 insertions(+), 114 deletions(-)

--
2.26.2.303.gf8c07b1a785-goog

4 years agoMerge series "SOF topology parsing updates" from Ranjani Sridharan <ranjani.sridharan...
Mark Brown [Thu, 30 Apr 2020 13:39:45 +0000 (14:39 +0100)]
Merge series "SOF topology parsing updates" from Ranjani Sridharan <ranjani.sridharan@linux.intel.com>:

This series includes updates in the topology parser for DAIs
and their config.

The first three patches address the problem of sending the DAI
config to the DSP when there are multiple DAIs associated with
a DAI link.

The last patch deals with setting the default trigger order
for all links. Exceptions needed for HDA links are moved to
the DAI link fixup() callback.

Bard Liao (3):
  ASoC: SOF: topology: send ipc for all found DAIs in sof_set_dai_config
  ASoC: topology: set component dai_index to ipc dai config dai_index
  ASoC: SOF: topology: replace sof_link_hda_process by
    sof_set_dai_config

randerwang (1):
  ASoC: SOF: Intel: change trigger sequence to fix pop noise when
    stopping playback on sdw platforms

 sound/soc/sof/pcm.c      |  12 ++-
 sound/soc/sof/topology.c | 167 ++++++++++-----------------------------
 2 files changed, 51 insertions(+), 128 deletions(-)

--
2.17.1

4 years agoASoC: SOF: sort out Kconfig, again
Arnd Bergmann [Tue, 28 Apr 2020 21:27:36 +0000 (23:27 +0200)]
ASoC: SOF: sort out Kconfig, again

The imx8 config keeps causing issues:

WARNING: unmet direct dependencies detected for SND_SOC_SOF_IMX8M
  Depends on [n]: SOUND [=y] && !UML && SND [=y] && SND_SOC [=m] && SND_SOC_SOF_TOPLEVEL [=y] && SND_SOC_SOF_IMX_TOPLEVEL [=y] && IMX_DSP [=n]
  Selected by [m]:
  - SND_SOC_SOF_IMX_OF [=m] && SOUND [=y] && !UML && SND [=y] && SND_SOC [=m] && SND_SOC_SOF_TOPLEVEL [=y] && SND_SOC_SOF_IMX_TOPLEVEL [=y] && SND_SOC_SOF_IMX8M_SUPPORT [=y]

This is complicated by two drivers having dependencies on both
platform specific drivers and the SND_SOC_SOF_OF framework code,
and using an somewhat obscure method to build them the same way
as the SOC_SOF_OF symbol (built-in or modular).

My solution now ensures that the two drivers can only be enabled
when the dependencies are met:

- When the platform specific drivers are built-in, everything is
  fine, as SOC_SOF_OF is either =y or =m

- When both are loadable modules, it also works, both for Kconfig
  and at runtime

- When the hardware drivers are loadable modules or disabled, and
  SOC_SOF_OF=y, prevent the IMX_SOF_OF drivers from being turned on,
  as this would be broken.

It seems that this is just an elaborate way to describe two tristate
symbols that have straight dependencies, but maybe I'm missing some
subtle point. It seems to always build for me now.

Fixes: fe57a92c8858 ("ASoC: SOF: Add missing dependency on IMX_SCU")
Fixes: afb93d716533 ("ASoC: SOF: imx: Add i.MX8M HW support")
Fixes: cb0312f61c3e ("ASoC: SOF: imx: fix undefined reference issue")
Fixes: afb93d716533dd ("ASoC: SOF: imx: Add i.MX8M HW support")
Signed-off-by: Arnd Bergmann <arnd@arndb.de>
Signed-off-by: Pierre-Louis Bossart <pierre-louis.bossart@linux.intel.com>
Acked-by: Daniel Baluta <daniel.baluta@nxp.com>
Link: https://lore.kernel.org/r/20200428212752.2901778-1-arnd@arndb.de
Signed-off-by: Mark Brown <broonie@kernel.org>
4 years agoASoC: rt5682: remove unwanted btn_type assignment
Tzung-Bi Shih [Thu, 30 Apr 2020 08:22:31 +0000 (16:22 +0800)]
ASoC: rt5682: remove unwanted btn_type assignment

The following dev_err() is intended to print unexpected btn_type.
Removes the unwanted btn_type assignment.

Signed-off-by: Tzung-Bi Shih <tzungbi@google.com>
Link: https://lore.kernel.org/r/20200430082231.151127-7-tzungbi@google.com
Signed-off-by: Mark Brown <broonie@kernel.org>
4 years agoASoC: rt5682: remove duplicate rt5682_reset() calls
Tzung-Bi Shih [Thu, 30 Apr 2020 08:22:30 +0000 (16:22 +0800)]
ASoC: rt5682: remove duplicate rt5682_reset() calls

Removes duplicate rt5682_reset() calls.  rt5682_calibrate() calls
rt5682_reset() anyway.

Signed-off-by: Tzung-Bi Shih <tzungbi@google.com>
Link: https://lore.kernel.org/r/20200430082231.151127-6-tzungbi@google.com
Signed-off-by: Mark Brown <broonie@kernel.org>
4 years agoASoC: rt5682: replace message printing from pr_() to dev_()
Tzung-Bi Shih [Thu, 30 Apr 2020 08:22:29 +0000 (16:22 +0800)]
ASoC: rt5682: replace message printing from pr_() to dev_()

Replaces message printing from pr_() to dev_().

Signed-off-by: Tzung-Bi Shih <tzungbi@google.com>
Link: https://lore.kernel.org/r/20200430082231.151127-5-tzungbi@google.com
Signed-off-by: Mark Brown <broonie@kernel.org>
4 years agoASoC: rt5682: remove empty default case
Tzung-Bi Shih [Thu, 30 Apr 2020 08:22:28 +0000 (16:22 +0800)]
ASoC: rt5682: remove empty default case

Removes empty default case.  Also adds a missing break statement.

Signed-off-by: Tzung-Bi Shih <tzungbi@google.com>
Link: https://lore.kernel.org/r/20200430082231.151127-4-tzungbi@google.com
Signed-off-by: Mark Brown <broonie@kernel.org>
4 years agoASoC: rt5682: fix space issues
Tzung-Bi Shih [Thu, 30 Apr 2020 08:22:27 +0000 (16:22 +0800)]
ASoC: rt5682: fix space issues

Fixes blank lines and indent issues.

Signed-off-by: Tzung-Bi Shih <tzungbi@google.com>
Link: https://lore.kernel.org/r/20200430082231.151127-3-tzungbi@google.com
Signed-off-by: Mark Brown <broonie@kernel.org>
4 years agoASoC: rt5682: simplify assertions
Tzung-Bi Shih [Thu, 30 Apr 2020 08:22:26 +0000 (16:22 +0800)]
ASoC: rt5682: simplify assertions

Simplifies assertions for errors.

Signed-off-by: Tzung-Bi Shih <tzungbi@google.com>
Link: https://lore.kernel.org/r/20200430082231.151127-2-tzungbi@google.com
Signed-off-by: Mark Brown <broonie@kernel.org>
4 years agoASoC: SOF: Intel: change trigger sequence to fix pop noise when stopping playback...
randerwang [Mon, 27 Apr 2020 17:29:39 +0000 (10:29 -0700)]
ASoC: SOF: Intel: change trigger sequence to fix pop noise when stopping playback on sdw platforms

Now the trigger sequence is set to SND_SOC_DPCM_TRIGGER_POST for
SOF. This means FE will be stopped before BE, so BE will consume
invalid data and this generates huge pop noise. This sequence is
introduced for HDA DAI which requires SND_SOC_DPCM_TRIGGER_POST for
some reasons. Now set default trigger sequence to SND_SOC_DPCM_TRIGGER_PRE
for playback with all DAI and fix sequence only for HDA DAI.

Fully tested on Comet Lake for a few cycles.

Signed-off-by: randerwang <rander.wang@linux.intel.com>
Signed-off-by: Ranjani Sridharan <ranjani.sridharan@linux.intel.com>
Reviewed-by: Clarex Zhou <clarex.zhou@intel.com>
Reviewed-by: Guennadi Liakhovetski <guennadi.liakhovetski@linux.intel.com>
Reviewed-by: Pierre-Louis Bossart <pierre-louis.bossart@linux.intel.com>
Link: https://lore.kernel.org/r/20200427172939.25848-5-ranjani.sridharan@linux.intel.com
Signed-off-by: Mark Brown <broonie@kernel.org>
4 years agoASoC: SOF: topology: replace sof_link_hda_process by sof_set_dai_config
Bard Liao [Mon, 27 Apr 2020 17:29:38 +0000 (10:29 -0700)]
ASoC: SOF: topology: replace sof_link_hda_process by sof_set_dai_config

Now we send ipc in sof_set_dai_config(), too. Therefore, we can use
sof_set_dai_config() in sof_link_hda_load() just like other link load
functions do.

Signed-off-by: Bard Liao <yung-chuan.liao@linux.intel.com>
Signed-off-by: Ranjani Sridharan <ranjani.sridharan@linux.intel.com>
Reviewed-by: Guennadi Liakhovetski <guennadi.liakhovetski@linux.intel.com>
Reviewed-by: Kai Vehmanen <kai.vehmanen@linux.intel.com>
Link: https://lore.kernel.org/r/20200427172939.25848-4-ranjani.sridharan@linux.intel.com
Signed-off-by: Mark Brown <broonie@kernel.org>
4 years agoASoC: topology: set component dai_index to ipc dai config dai_index
Bard Liao [Mon, 27 Apr 2020 17:29:37 +0000 (10:29 -0700)]
ASoC: topology: set component dai_index to ipc dai config dai_index

The ipc dai config dai_index is from topology. However, the same dai
config will be applied to all DAIs in the same dai link. We have to
ensure that the ipc dai config's dai_index match to the component's
dai_index.

Signed-off-by: Bard Liao <yung-chuan.liao@linux.intel.com>
Signed-off-by: Ranjani Sridharan <ranjani.sridharan@linux.intel.com>
Reviewed-by: Guennadi Liakhovetski <guennadi.liakhovetski@linux.intel.com>
Reviewed-by: Kai Vehmanen <kai.vehmanen@linux.intel.com>
Link: https://lore.kernel.org/r/20200427172939.25848-3-ranjani.sridharan@linux.intel.com
Signed-off-by: Mark Brown <broonie@kernel.org>
4 years agoASoC: SOF: topology: send ipc for all found DAIs in sof_set_dai_config
Bard Liao [Mon, 27 Apr 2020 17:29:36 +0000 (10:29 -0700)]
ASoC: SOF: topology: send ipc for all found DAIs in sof_set_dai_config

We may find more than one DAIs in sof_set_dai_config() and we should
send message to DSP for each DAI we found.

Signed-off-by: Bard Liao <yung-chuan.liao@linux.intel.com>
Signed-off-by: Ranjani Sridharan <ranjani.sridharan@linux.intel.com>
Reviewed-by: Guennadi Liakhovetski <guennadi.liakhovetski@linux.intel.com>
Reviewed-by: Kai Vehmanen <kai.vehmanen@linux.intel.com>
Link: https://lore.kernel.org/r/20200427172939.25848-2-ranjani.sridharan@linux.intel.com
Signed-off-by: Mark Brown <broonie@kernel.org>
4 years agoASoC: Intel: broadwell: Fix oops during module removal
Ranjani Sridharan [Mon, 27 Apr 2020 16:29:53 +0000 (09:29 -0700)]
ASoC: Intel: broadwell: Fix oops during module removal

When removing the SOF module, the RT286 jack detect
handler will oops if jack detection is not disabled.
Disable the jack in the machine driver remove callback
to prevent this. This fix is only for SOF support and is
not needed for earlier versions.

Signed-off-by: Ranjani Sridharan <ranjani.sridharan@linux.intel.com>
Reviewed-by: Kai Vehmanen <kai.vehmanen@linux.intel.com>
Link: https://lore.kernel.org/r/20200427162953.21107-1-ranjani.sridharan@linux.intel.com
Signed-off-by: Mark Brown <broonie@kernel.org>
4 years agoASoC: dt-bindings: simple-card: switch to yaml base Documentation
Kuninori Morimoto [Wed, 1 Apr 2020 00:00:04 +0000 (09:00 +0900)]
ASoC: dt-bindings: simple-card: switch to yaml base Documentation

This patch switches from .txt base to .yaml base Document.

Signed-off-by: Kuninori Morimoto <kuninori.morimoto.gx@renesas.com>
Reviewed-by: Rob Herring <robh@kernel.org>
Link: https://lore.kernel.org/r/87sghovzwb.wl-kuninori.morimoto.gx@renesas.com
Signed-off-by: Mark Brown <broonie@kernel.org>
4 years agoMerge series "ASoC: soc-dai: add snd_soc_dai_xxx()" from Kuninori Morimoto <kuninori...
Mark Brown [Wed, 29 Apr 2020 16:21:35 +0000 (17:21 +0100)]
Merge series "ASoC: soc-dai: add snd_soc_dai_xxx()" from Kuninori Morimoto <kuninori.morimoto.gx@renesas.com>
Kuninori Morimoto <kuninori.morimoto.gx@renesas.com>:

From: Kuninori Morimoto <kuninori.morimoto.gx@renesas.com>

We have soc-dai.c today. DAI related functions
should be implemented in it.
These patches are v2 of doing it.

Link: https://lore.kernel.org/r/871rofunaq.wl-kuninori.morimoto.gx@renesas.com
Kuninori Morimoto (17):
  ASoC: soc-dai: add soc_dai_err()
  ASoC: soc-dai: don't overwide dai->driver->ops
  ASoC: soc-dai: add snd_soc_pcm_dai_new()
  ASoC: soc-dai: add snd_soc_pcm_dai_prepare()
  ASoC: soc-dai: add snd_soc_pcm_dai_trigger()
  ASoC: soc-dai: add snd_soc_pcm_dai_bespoke_trigger()
  ASoC: soc-dai: add snd_soc_pcm_dai_probe()
  ASoC: soc-dai: add snd_soc_pcm_dai_remove()
  ASoC: soc-dai: add snd_soc_dai_compr_start()
  ASoC: soc-dai: add snd_soc_dai_compr_shutdown()
  ASoC: soc-dai: add snd_soc_dai_compr_trigger()
  ASoC: soc-dai: add snd_soc_dai_compr_set_params()
  ASoC: soc-dai: add snd_soc_dai_compr_get_params()
  ASoC: soc-dai: add snd_soc_dai_compr_ack()
  ASoC: soc-dai: add snd_soc_dai_compr_pointer()
  ASoC: soc-dai: add snd_soc_dai_compr_set_metadata()
  ASoC: soc-dai: add snd_soc_dai_compr_get_metadata()

 include/sound/soc-dai.h  |  41 +++-
 sound/soc/soc-compress.c | 104 ++++-----
 sound/soc/soc-core.c     |  85 +-------
 sound/soc/soc-dai.c      | 453 +++++++++++++++++++++++++++++----------
 sound/soc/soc-pcm.c      |  50 +----
 5 files changed, 434 insertions(+), 299 deletions(-)

--
2.17.1

4 years agoASoC: rt5682: fix I2C/Soundwire dependencies
Arnd Bergmann [Tue, 28 Apr 2020 21:46:14 +0000 (23:46 +0200)]
ASoC: rt5682: fix I2C/Soundwire dependencies

If one of the two is a loadable module, the combined driver must
not be built-in:

aarch64-linux-ld: sound/soc/codecs/rt5682.o: in function `rt5682_sdw_hw_free':
rt5682.c:(.text+0xb34): undefined reference to `sdw_stream_remove_slave'
aarch64-linux-ld: sound/soc/codecs/rt5682.o: in function `rt5682_sdw_hw_params':
rt5682.c:(.text+0xe78): undefined reference to `sdw_stream_add_slave'

In particular, the soundwire driver must not be built-in if
CONFIG_I2C=m.

Fixes: 5549ea647997 ("ASoC: rt5682: fix unmet dependencies")
Signed-off-by: Arnd Bergmann <arnd@arndb.de>
Link: https://lore.kernel.org/r/20200428214642.3925004-1-arnd@arndb.de
Signed-off-by: Mark Brown <broonie@kernel.org>
4 years agoASoC: fsl_easrc: mark PM functions __maybe_unused
Arnd Bergmann [Tue, 28 Apr 2020 21:28:08 +0000 (23:28 +0200)]
ASoC: fsl_easrc: mark PM functions __maybe_unused

ifdefs are hard, and in this driver the suspend/resume functions are
the only callers of some other helpers that trigger a harmless warning
when CONFIG_PM is disabled:

sound/soc/fsl/fsl_easrc.c:1807:12: warning: 'fsl_easrc_get_firmware' defined but not used [-Wunused-function]
 1807 | static int fsl_easrc_get_firmware(struct fsl_asrc *easrc)
      |            ^~~~~~~~~~~~~~~~~~~~~~
sound/soc/fsl/fsl_easrc.c:303:12: warning: 'fsl_easrc_resampler_config' defined but not used [-Wunused-function]
  303 | static int fsl_easrc_resampler_config(struct fsl_asrc *easrc)
      |            ^~~~~~~~~~~~~~~~~~~~~~~~~~

Remove the #ifdef and just mark the callers as __maybe_unused to
suppress the warnings altogether.

Fixes: 955ac624058f ("ASoC: fsl_easrc: Add EASRC ASoC CPU DAI drivers")
Signed-off-by: Arnd Bergmann <arnd@arndb.de>
Acked-by: Nicolin Chen <nicoleotsuka@gmail.com>
Link: https://lore.kernel.org/r/20200428212847.2926376-1-arnd@arndb.de
Signed-off-by: Mark Brown <broonie@kernel.org>
4 years agoASoC: mxs-saif: Fix unused assignment
Tang Bin [Wed, 29 Apr 2020 09:38:23 +0000 (17:38 +0800)]
ASoC: mxs-saif: Fix unused assignment

Delete unused initialized value, because 'ret' will be assigined
by the function of_alias_get_id().

Signed-off-by: Zhang Shengju <zhangshengju@cmss.chinamobile.com>
Signed-off-by: Tang Bin <tangbin@cmss.chinamobile.com>
Link: https://lore.kernel.org/r/20200429093823.1372-1-tangbin@cmss.chinamobile.com
Signed-off-by: Mark Brown <broonie@kernel.org>
4 years agoASoc: nau8810: add AUX related dapm widgets and routes
Seven Lee [Wed, 29 Apr 2020 09:00:02 +0000 (17:00 +0800)]
ASoc: nau8810: add AUX related dapm widgets and routes

This patch implements the following features:
- AUX input for recording.
- An input AUX output to SPK/MOUT.

Signed-off-by: Seven Lee <wtli@nuvoton.com>
Link: https://lore.kernel.org/r/20200429090002.28556-1-wtli@nuvoton.com
Signed-off-by: Mark Brown <broonie@kernel.org>
4 years agoASoC: codecs: wm97xx: fix ac97 dependency
Arnd Bergmann [Tue, 28 Apr 2020 21:26:59 +0000 (23:26 +0200)]
ASoC: codecs: wm97xx: fix ac97 dependency

A recent build fix got the dependency slightly wrong, breaking
builds with CONFIG_AC97_BUS_NEW:

WARNING: unmet direct dependencies detected for SND_SOC_WM9713
  Depends on [n]: SOUND [=y] && !UML && SND [=y] && SND_SOC [=y] && SND_SOC_AC97_BUS [=n]
  Selected by [m]:
  - SND_SOC_ZYLONITE [=m] && SOUND [=y] && !UML && SND [=y] && SND_SOC [=y] && SND_PXA2XX_SOC [=m] && MACH_ZYLONITE [=y] && AC97_BUS [=n]=n

WARNING: unmet direct dependencies detected for SND_SOC_WM9712
  Depends on [n]: SOUND [=y] && !UML && SND [=y] && SND_SOC [=y] && SND_SOC_AC97_BUS [=n]
  Selected by [m]:
  - SND_PXA2XX_SOC_EM_X270 [=m] && SOUND [=y] && !UML && SND [=y] && SND_SOC [=y] && SND_PXA2XX_SOC [=m] && (MACH_EM_X270 [=n] || MACH_EXEDA [=n] || MACH_CM_X300 [=y]) && AC97_BUS [=n]=n

Change the dependency to allow either version of the AC97 library
code.

Fixes: 5a309875787d ("ASoC: Fix SND_SOC_ALL_CODECS imply ac97 fallout")
Signed-off-by: Arnd Bergmann <arnd@arndb.de>
Acked-by: Charles Keepax <ckeepax@opensource.cirrus.com>
Link: https://lore.kernel.org/r/20200428212721.2877627-1-arnd@arndb.de
Signed-off-by: Mark Brown <broonie@kernel.org>
4 years agoASoC: component: suppress uninitialized-variable warning
Arnd Bergmann [Tue, 28 Apr 2020 21:47:31 +0000 (23:47 +0200)]
ASoC: component: suppress uninitialized-variable warning

Old versions of gcc (tested on gcc-4.8) produce a warning for
correct code:

sound/soc/soc-compress.c: In function 'soc_compr_open':
sound/soc/soc-compress.c:75:28: error: 'component' is used uninitialized in this function [-Werror=uninitialized]
  struct snd_soc_component *component, *save = NULL;

Change the for_each_rtd_components() macro to ensure 'component'
gets initialized to a value the compiler does not complain about.

Signed-off-by: Arnd Bergmann <arnd@arndb.de>
Link: https://lore.kernel.org/r/20200428214754.3925368-1-arnd@arndb.de
Signed-off-by: Mark Brown <broonie@kernel.org>
4 years agoASoC: soc-dai: add snd_soc_dai_compr_get_metadata()
Kuninori Morimoto [Thu, 23 Apr 2020 23:15:59 +0000 (08:15 +0900)]
ASoC: soc-dai: add snd_soc_dai_compr_get_metadata()

dai related function should be implemented at soc-dai.c.
This patch adds snd_soc_dai_compr_get_metadata().

Signed-off-by: Kuninori Morimoto <kuninori.morimoto.gx@renesas.com>
Reviewed-By: Ranjani Sridharan <ranjani.sridharan@linux.intel.com>
Link: https://lore.kernel.org/r/87eesdssi8.wl-kuninori.morimoto.gx@renesas.com
Signed-off-by: Mark Brown <broonie@kernel.org>
4 years agoASoC: soc-dai: add snd_soc_dai_compr_set_metadata()
Kuninori Morimoto [Thu, 23 Apr 2020 23:15:54 +0000 (08:15 +0900)]
ASoC: soc-dai: add snd_soc_dai_compr_set_metadata()

dai related function should be implemented at soc-dai.c.
This patch adds snd_soc_dai_compr_set_metadata().

Signed-off-by: Kuninori Morimoto <kuninori.morimoto.gx@renesas.com>
Reviewed-By: Ranjani Sridharan <ranjani.sridharan@linux.intel.com>
Link: https://lore.kernel.org/r/87ftctssid.wl-kuninori.morimoto.gx@renesas.com
Signed-off-by: Mark Brown <broonie@kernel.org>
4 years agoASoC: soc-dai: add snd_soc_dai_compr_pointer()
Kuninori Morimoto [Thu, 23 Apr 2020 23:15:49 +0000 (08:15 +0900)]
ASoC: soc-dai: add snd_soc_dai_compr_pointer()

dai related function should be implemented at soc-dai.c.
This patch adds snd_soc_dai_compr_pointer().

Signed-off-by: Kuninori Morimoto <kuninori.morimoto.gx@renesas.com>
Reviewed-By: Ranjani Sridharan <ranjani.sridharan@linux.intel.com>
Link: https://lore.kernel.org/r/87h7x9ssii.wl-kuninori.morimoto.gx@renesas.com
Signed-off-by: Mark Brown <broonie@kernel.org>
4 years agoASoC: soc-dai: add snd_soc_dai_compr_ack()
Kuninori Morimoto [Thu, 23 Apr 2020 23:15:45 +0000 (08:15 +0900)]
ASoC: soc-dai: add snd_soc_dai_compr_ack()

dai related function should be implemented at soc-dai.c.
This patch adds snd_soc_dai_compr_ack().

Signed-off-by: Kuninori Morimoto <kuninori.morimoto.gx@renesas.com>
Reviewed-By: Ranjani Sridharan <ranjani.sridharan@linux.intel.com>
Link: https://lore.kernel.org/r/87imhpssim.wl-kuninori.morimoto.gx@renesas.com
Signed-off-by: Mark Brown <broonie@kernel.org>
4 years agoASoC: soc-dai: add snd_soc_dai_compr_get_params()
Kuninori Morimoto [Thu, 23 Apr 2020 23:15:40 +0000 (08:15 +0900)]
ASoC: soc-dai: add snd_soc_dai_compr_get_params()

dai related function should be implemented at soc-dai.c.
This patch adds snd_soc_dai_compr_get_params().

Signed-off-by: Kuninori Morimoto <kuninori.morimoto.gx@renesas.com>
Reviewed-By: Ranjani Sridharan <ranjani.sridharan@linux.intel.com>
Link: https://lore.kernel.org/r/87k125ssir.wl-kuninori.morimoto.gx@renesas.com
Signed-off-by: Mark Brown <broonie@kernel.org>
4 years agoASoC: soc-dai: add snd_soc_dai_compr_set_params()
Kuninori Morimoto [Thu, 23 Apr 2020 23:15:36 +0000 (08:15 +0900)]
ASoC: soc-dai: add snd_soc_dai_compr_set_params()

dai related function should be implemented at soc-dai.c.
This patch adds snd_soc_dai_compr_set_params().

Signed-off-by: Kuninori Morimoto <kuninori.morimoto.gx@renesas.com>
Reviewed-By: Ranjani Sridharan <ranjani.sridharan@linux.intel.com>
Link: https://lore.kernel.org/r/87lfmlssiv.wl-kuninori.morimoto.gx@renesas.com
Signed-off-by: Mark Brown <broonie@kernel.org>
4 years agoASoC: soc-dai: add snd_soc_dai_compr_trigger()
Kuninori Morimoto [Thu, 23 Apr 2020 23:15:32 +0000 (08:15 +0900)]
ASoC: soc-dai: add snd_soc_dai_compr_trigger()

dai related function should be implemented at soc-dai.c.
This patch adds snd_soc_dai_compr_trigger().

Signed-off-by: Kuninori Morimoto <kuninori.morimoto.gx@renesas.com>
Reviewed-By: Ranjani Sridharan <ranjani.sridharan@linux.intel.com>
Link: https://lore.kernel.org/r/87mu71ssiz.wl-kuninori.morimoto.gx@renesas.com
Signed-off-by: Mark Brown <broonie@kernel.org>
4 years agoASoC: soc-dai: add snd_soc_dai_compr_shutdown()
Kuninori Morimoto [Thu, 23 Apr 2020 23:15:28 +0000 (08:15 +0900)]
ASoC: soc-dai: add snd_soc_dai_compr_shutdown()

dai related function should be implemented at soc-dai.c.
This patch adds snd_soc_dai_compr_shutdown().

Signed-off-by: Kuninori Morimoto <kuninori.morimoto.gx@renesas.com>
Reviewed-By: Ranjani Sridharan <ranjani.sridharan@linux.intel.com>
Link: https://lore.kernel.org/r/87o8rhssj3.wl-kuninori.morimoto.gx@renesas.com
Signed-off-by: Mark Brown <broonie@kernel.org>
4 years agoASoC: soc-dai: add snd_soc_dai_compr_start()
Kuninori Morimoto [Thu, 23 Apr 2020 23:15:24 +0000 (08:15 +0900)]
ASoC: soc-dai: add snd_soc_dai_compr_start()

dai related function should be implemented at soc-dai.c.
This patch adds snd_soc_dai_compr_start().

Signed-off-by: Kuninori Morimoto <kuninori.morimoto.gx@renesas.com>
Reviewed-By: Ranjani Sridharan <ranjani.sridharan@linux.intel.com>
Link: https://lore.kernel.org/r/87pnbxssj7.wl-kuninori.morimoto.gx@renesas.com
Signed-off-by: Mark Brown <broonie@kernel.org>
4 years agoASoC: soc-dai: add snd_soc_pcm_dai_remove()
Kuninori Morimoto [Thu, 23 Apr 2020 23:15:20 +0000 (08:15 +0900)]
ASoC: soc-dai: add snd_soc_pcm_dai_remove()

We have 2 type of component functions
snd_soc_dai_xxx()     is focusing to dai itself,
snd_soc_pcm_dai_xxx() is focusing to rtd related dai.

Now we can update snd_soc_dai_remove() to
snd_soc_pcm_dai_remove(). This patch do it.

Signed-off-by: Kuninori Morimoto <kuninori.morimoto.gx@renesas.com>
Reviewed-By: Ranjani Sridharan <ranjani.sridharan@linux.intel.com>
Link: https://lore.kernel.org/r/87r1wdssjc.wl-kuninori.morimoto.gx@renesas.com
Signed-off-by: Mark Brown <broonie@kernel.org>
4 years agoASoC: soc-dai: add snd_soc_pcm_dai_probe()
Kuninori Morimoto [Thu, 23 Apr 2020 23:15:15 +0000 (08:15 +0900)]
ASoC: soc-dai: add snd_soc_pcm_dai_probe()

We have 2 type of component functions
snd_soc_dai_xxx()     is focusing to dai itself,
snd_soc_pcm_dai_xxx() is focusing to rtd related dai.

Now we can update snd_soc_dai_probe() to
snd_soc_pcm_dai_probe(). This patch do it.

Signed-off-by: Kuninori Morimoto <kuninori.morimoto.gx@renesas.com>
Reviewed-By: Ranjani Sridharan <ranjani.sridharan@linux.intel.com>
Link: https://lore.kernel.org/r/87sggtssjg.wl-kuninori.morimoto.gx@renesas.com
Signed-off-by: Mark Brown <broonie@kernel.org>
4 years agoASoC: soc-dai: add snd_soc_pcm_dai_bespoke_trigger()
Kuninori Morimoto [Thu, 23 Apr 2020 23:15:09 +0000 (08:15 +0900)]
ASoC: soc-dai: add snd_soc_pcm_dai_bespoke_trigger()

We have 2 type of component functions
snd_soc_dai_xxx()     is focusing to dai itself,
snd_soc_pcm_dai_xxx() is focusing to rtd related dai.

Now we can update soc_pcm_bespoke_trigger() to
snd_soc_pcm_dai_bespoke_trigger(). This patch do it.

Signed-off-by: Kuninori Morimoto <kuninori.morimoto.gx@renesas.com>
Reviewed-By: Ranjani Sridharan <ranjani.sridharan@linux.intel.com>
Link: https://lore.kernel.org/r/87tv19ssjm.wl-kuninori.morimoto.gx@renesas.com
Signed-off-by: Mark Brown <broonie@kernel.org>
4 years agoASoC: soc-dai: add snd_soc_pcm_dai_trigger()
Kuninori Morimoto [Thu, 23 Apr 2020 23:15:04 +0000 (08:15 +0900)]
ASoC: soc-dai: add snd_soc_pcm_dai_trigger()

We have 2 type of component functions
snd_soc_dai_xxx()     is focusing to dai itself,
snd_soc_pcm_dai_xxx() is focusing to rtd related dai.

Now we can update snd_soc_dai_trigger() to
snd_soc_pcm_dai_trigger(). This patch do it.

Signed-off-by: Kuninori Morimoto <kuninori.morimoto.gx@renesas.com>
Reviewed-By: Ranjani Sridharan <ranjani.sridharan@linux.intel.com>
Link: https://lore.kernel.org/r/87v9lpssjr.wl-kuninori.morimoto.gx@renesas.com
Signed-off-by: Mark Brown <broonie@kernel.org>
4 years agoASoC: soc-dai: add snd_soc_pcm_dai_prepare()
Kuninori Morimoto [Thu, 23 Apr 2020 23:14:53 +0000 (08:14 +0900)]
ASoC: soc-dai: add snd_soc_pcm_dai_prepare()

We have 2 type of component functions
snd_soc_dai_xxx()     is focusing to dai itself,
snd_soc_pcm_dai_xxx() is focusing to rtd related dai.

Now we can update snd_soc_dai_prepare() to
snd_soc_pcm_dai_prepare(). This patch do it.

Signed-off-by: Kuninori Morimoto <kuninori.morimoto.gx@renesas.com>
Reviewed-By: Ranjani Sridharan <ranjani.sridharan@linux.intel.com>
Link: https://lore.kernel.org/r/87wo65ssk2.wl-kuninori.morimoto.gx@renesas.com
Signed-off-by: Mark Brown <broonie@kernel.org>
4 years agoASoC: soc-dai: add snd_soc_pcm_dai_new()
Kuninori Morimoto [Thu, 23 Apr 2020 23:14:48 +0000 (08:14 +0900)]
ASoC: soc-dai: add snd_soc_pcm_dai_new()

We have 2 type of component functions
snd_soc_dai_xxx()     is focusing to dai itself,
snd_soc_pcm_dai_xxx() is focusing to rtd related dai.

Now we can update soc_dai_pcm_new() to
snd_soc_pcm_dai_new(). This patch do it.

Signed-off-by: Kuninori Morimoto <kuninori.morimoto.gx@renesas.com>
Reviewed-By: Ranjani Sridharan <ranjani.sridharan@linux.intel.com>
Link: https://lore.kernel.org/r/87y2qlssk7.wl-kuninori.morimoto.gx@renesas.com
Signed-off-by: Mark Brown <broonie@kernel.org>
4 years agoASoC: soc-dai: don't overwide dai->driver->ops
Kuninori Morimoto [Thu, 23 Apr 2020 23:14:43 +0000 (08:14 +0900)]
ASoC: soc-dai: don't overwide dai->driver->ops

Current ASoC overwrites null_dai_ops to dai->driver->ops if it
was NULL. But, we can remove it if framework always checks
dai->driver->ops when it uses DAI callbacks.
This patch do it, and removes null_dai_ops.

Signed-off-by: Kuninori Morimoto <kuninori.morimoto.gx@renesas.com>
Reviewed-By: Ranjani Sridharan <ranjani.sridharan@linux.intel.com>
Link: https://lore.kernel.org/r/87zhb1sskc.wl-kuninori.morimoto.gx@renesas.com
Signed-off-by: Mark Brown <broonie@kernel.org>
4 years agoASoC: soc-dai: add soc_dai_err()
Kuninori Morimoto [Thu, 23 Apr 2020 23:14:38 +0000 (08:14 +0900)]
ASoC: soc-dai: add soc_dai_err()

At soc-dai.c, it is good idea to indicate error function and
its component name if there was error.
This patch adds soc_dai_err() for it.

Signed-off-by: Kuninori Morimoto <kuninori.morimoto.gx@renesas.com>
Reviewed-By: Ranjani Sridharan <ranjani.sridharan@linux.intel.com>
Link: https://lore.kernel.org/r/871rodu74x.wl-kuninori.morimoto.gx@renesas.com
Signed-off-by: Mark Brown <broonie@kernel.org>
4 years agoMerge series "Kconfig updates for DMIC and SOF HDMI support" from Ranjani Sridharan...
Mark Brown [Tue, 28 Apr 2020 15:40:38 +0000 (16:40 +0100)]
Merge series "Kconfig updates for DMIC and SOF HDMI support" from Ranjani Sridharan <ranjani.sridharan@linux.intel.com>:

This series provides the following updtes to the Intel machine driver
Kconfig:

1. The first patch adds the explicit dependency on GPIOLIB when
SND_SOC_DMIC is selected.

2. SND_SOC_SOF_HDA_AUDIO_CODEC is required for using the legacy
HDA codec driver for HDMI support in SOF. The last 3 three patches
make the required changes to account for this.

Libin Yang (3):
  ASoC: intel: add depends on SND_SOC_SOF_HDA_AUDIO_CODEC for common
    hdmi
  ASoC: sof-sdw: remove CONFIG_SND_SOC_SOF_HDA_AUDIO_CODEC condition
  ASoC: sof_pcm512x: remove CONFIG_SND_HDA_CODEC_HDMI condition

Pierre-Louis Bossart (1):
  ASoC: Intel: boards: add explicit dependency on GPIOLIB when DMIC is
    used

 sound/soc/intel/boards/Kconfig        | 51 ++++++++++++++-------------
 sound/soc/intel/boards/sof_pcm512x.c  |  9 -----
 sound/soc/intel/boards/sof_sdw.c      |  8 -----
 sound/soc/intel/boards/sof_sdw_hdmi.c |  7 ----
 4 files changed, 26 insertions(+), 49 deletions(-)

--
2.17.1

4 years agoMerge series "add channel constraint for BDW machine drivers" from Brent Lu <brent...
Mark Brown [Tue, 28 Apr 2020 15:40:37 +0000 (16:40 +0100)]
Merge series "add channel constraint for BDW machine drivers" from Brent Lu <brent.lu@intel.com>:

The machine driver bdw-rt5650 (for Google buddy) supports 2 or 4-channel
recording while other two drivers support only 2-channel recording. HW
constraints are implemented to reflect the hardware limitation on BDW
platform.

Changes since v1:
- Change the patch title.
- Remove the DUAL_CHANNEL and QUAD_CHANNEL macros which are too obvious.
- Follow the naming convertion, using 'bdw_rt5650_' and 'bdw_rt5677_' to
  name startup functions.
- Refine the comments in startup functions.
- Redesign the bdw_rt5650_fe_startup() function for readability.
- Add an assignment to initialize runtime->hw.channels_max variable.

Brent Lu (3):
  ASoC: bdw-rt5677: add channel constraint
  ASoC: bdw-rt5650: add channel constraint
  ASoC: broadwell: add channel constraint

 sound/soc/intel/boards/bdw-rt5650.c | 29 +++++++++++++++++++++++++++++
 sound/soc/intel/boards/bdw-rt5677.c | 26 ++++++++++++++++++++++++++
 sound/soc/intel/boards/broadwell.c  | 26 ++++++++++++++++++++++++++
 3 files changed, 81 insertions(+)

--
2.7.4

4 years agoASoC: tegra: tegra_wm8903: Use devm_snd_soc_register_card()
Wei Yongjun [Tue, 28 Apr 2020 11:07:42 +0000 (11:07 +0000)]
ASoC: tegra: tegra_wm8903: Use devm_snd_soc_register_card()

Using devm_snd_soc_register_card() can make the code
shorter and cleaner.

Signed-off-by: Wei Yongjun <weiyongjun1@huawei.com>
Link: https://lore.kernel.org/r/20200428110742.110335-1-weiyongjun1@huawei.com
Signed-off-by: Mark Brown <broonie@kernel.org>
4 years agoMerge branch 'for-5.7' of https://git.kernel.org/pub/scm/linux/kernel/git/broonie...
Mark Brown [Tue, 28 Apr 2020 15:05:35 +0000 (16:05 +0100)]
Merge branch 'for-5.7' of https://git.kernel.org/pub/scm/linux/kernel/git/broonie/sound into asoc-5.8

4 years agoASoC: broadwell: add channel constraint
Brent Lu [Mon, 27 Apr 2020 17:13:34 +0000 (01:13 +0800)]
ASoC: broadwell: add channel constraint

BDW boards using this machine driver supports only stereo capture and
playback. Implement a constraint to enforce it.

Signed-off-by: Brent Lu <brent.lu@intel.com>
Acked-by: Pierre-Louis Bossart <pierre-louis.bossart@linux.intel.com>
Link: https://lore.kernel.org/r/1588007614-25061-4-git-send-email-brent.lu@intel.com
Signed-off-by: Mark Brown <broonie@kernel.org>
4 years agoASoC: bdw-rt5650: add channel constraint
Brent Lu [Mon, 27 Apr 2020 17:13:33 +0000 (01:13 +0800)]
ASoC: bdw-rt5650: add channel constraint

BDW boards using this machine driver supports only 2 or 4-channel capture.
Implement a constraint to enforce it.

Signed-off-by: Brent Lu <brent.lu@intel.com>
Acked-by: Pierre-Louis Bossart <pierre-louis.bossart@linux.intel.com>
Link: https://lore.kernel.org/r/1588007614-25061-3-git-send-email-brent.lu@intel.com
Signed-off-by: Mark Brown <broonie@kernel.org>
4 years agoASoC: bdw-rt5677: add channel constraint
Brent Lu [Mon, 27 Apr 2020 17:13:32 +0000 (01:13 +0800)]
ASoC: bdw-rt5677: add channel constraint

BDW boards using this machine driver supports only stereo capture and
playback. Implement a constraint to enforce it.

Signed-off-by: Brent Lu <brent.lu@intel.com>
Acked-by: Pierre-Louis Bossart <pierre-louis.bossart@linux.intel.com>
Link: https://lore.kernel.org/r/1588007614-25061-2-git-send-email-brent.lu@intel.com
Signed-off-by: Mark Brown <broonie@kernel.org>
4 years agoASoC: Intel: boards: add explicit dependency on GPIOLIB when DMIC is used
Pierre-Louis Bossart [Mon, 27 Apr 2020 16:52:08 +0000 (09:52 -0700)]
ASoC: Intel: boards: add explicit dependency on GPIOLIB when DMIC is used

SND_SOC_DMIC depends on GPIOLIB, so let's add the dependency before
selecting SND_SOC_DMIC.

Signed-off-by: Pierre-Louis Bossart <pierre-louis.bossart@linux.intel.com>
Signed-off-by: Ranjani Sridharan <ranjani.sridharan@linux.intel.com>
Reviewed-by: Guennadi Liakhovetski <guennadi.liakhovetski@linux.intel.com>
Reviewed-by: Kai Vehmanen <kai.vehmanen@linux.intel.com>
Link: https://lore.kernel.org/r/20200427165211.23463-2-ranjani.sridharan@linux.intel.com
Signed-off-by: Mark Brown <broonie@kernel.org>
4 years agoASoC: tlv320adcx140: Fix mic gain registers
Dan Murphy [Mon, 27 Apr 2020 20:36:08 +0000 (15:36 -0500)]
ASoC: tlv320adcx140: Fix mic gain registers

Fix the mic gain registers for channels 2-4.
The incorret register was being set as it was touching the CH1 config
registers.

Fixes: 37bde5acf040 ("ASoC: tlv320adcx140: Add the tlv320adcx140 codec driver family")
Signed-off-by: Dan Murphy <dmurphy@ti.com>
Cc: stable@vger.kernel.org
Link: https://lore.kernel.org/r/20200427203608.7031-1-dmurphy@ti.com
Signed-off-by: Mark Brown <broonie@kernel.org>
4 years agoASoC: davinci-mcasp: Fix dma_chan refcnt leak when getting dma type
Xiyu Yang [Sat, 25 Apr 2020 12:48:35 +0000 (20:48 +0800)]
ASoC: davinci-mcasp: Fix dma_chan refcnt leak when getting dma type

davinci_mcasp_get_dma_type() invokes dma_request_chan(), which returns a
reference of the specified dma_chan object to "chan" with increased
refcnt.

When davinci_mcasp_get_dma_type() returns, local variable "chan" becomes
invalid, so the refcount should be decreased to keep refcount balanced.

The reference counting issue happens in one exception handling path of
davinci_mcasp_get_dma_type(). When chan device is NULL, the function
forgets to decrease the refcnt increased by dma_request_chan(), causing
a refcnt leak.

Fix this issue by calling dma_release_channel() when chan device is
NULL.

Signed-off-by: Xiyu Yang <xiyuyang19@fudan.edu.cn>
Signed-off-by: Xin Tan <tanxin.ctf@gmail.com>
Acked-by: Peter Ujfalusi <peter.ujfalusi@ti.com>
Link: https://lore.kernel.org/r/1587818916-38730-1-git-send-email-xiyuyang19@fudan.edu.cn
Signed-off-by: Mark Brown <broonie@kernel.org>
4 years agoASoC: Intel: Skylake: Automatic DMIC format configuration according to information...
Mateusz Gorski [Mon, 27 Apr 2020 13:27:27 +0000 (15:27 +0200)]
ASoC: Intel: Skylake: Automatic DMIC format configuration according to information from NHLT

Automatically choose DMIC pipeline format configuration depending on
information included in NHLT.
Change the access rights of appropriate kcontrols to read-only in order
to prevent user interference.

Signed-off-by: Mateusz Gorski <mateusz.gorski@linux.intel.com>
Reviewed-by: Cezary Rojewski <cezary.rojewski@intel.com>
Reviewed-by: Pierre-Louis Bossart <pierre-louis.bossart@linux.intel.com>
Link: https://lore.kernel.org/r/20200427132727.24942-4-mateusz.gorski@linux.intel.com
Signed-off-by: Mark Brown <broonie@kernel.org>
4 years agoASoC: Intel: Multiple I/O PCM format support for pipe
Mateusz Gorski [Mon, 27 Apr 2020 13:27:26 +0000 (15:27 +0200)]
ASoC: Intel: Multiple I/O PCM format support for pipe

For pipes supporting multiple input/output formats, kcontrol is
created and selection of pipe input and output configuration
is done based on control set.

If more than one configuration is supported, then this patch
allows user to select configuration of choice
using amixer settings.

Signed-off-by: Mateusz Gorski <mateusz.gorski@linux.intel.com>
Signed-off-by: Pavan K S <pavan.k.s@intel.com>
Reviewed-by: Cezary Rojewski <cezary.rojewski@intel.com>
Reviewed-by: Pierre-Louis Bossart <pierre-louis.bossart@linux.intel.com>
Link: https://lore.kernel.org/r/20200427132727.24942-3-mateusz.gorski@linux.intel.com
Signed-off-by: Mark Brown <broonie@kernel.org>
4 years agoASoC: Intel: Skylake: Add alternative topology binary name
Mateusz Gorski [Mon, 27 Apr 2020 13:27:25 +0000 (15:27 +0200)]
ASoC: Intel: Skylake: Add alternative topology binary name

Add alternative topology binary file name based on used machine driver
and fallback to use this name after failed attempt to load topology file
with name based on NHLT.
This change addresses multiple issues with current mechanism, for
example - there are devices without NHLT table, and that currently
results in tplg_name being empty.

Signed-off-by: Mateusz Gorski <mateusz.gorski@linux.intel.com>
Reviewed-by: Cezary Rojewski <cezary.rojewski@intel.com>
Reviewed-by: Pierre-Louis Bossart <pierre-louis.bossart@linux.intel.com>
Link: https://lore.kernel.org/r/20200427132727.24942-2-mateusz.gorski@linux.intel.com
Signed-off-by: Mark Brown <broonie@kernel.org>
4 years agoASoC: hisilicon: Use the defined variable to clean code
Tang Bin [Mon, 27 Apr 2020 09:15:20 +0000 (17:15 +0800)]
ASoC: hisilicon: Use the defined variable to clean code

Use the defined variable "dev" to make the code cleaner.

Signed-off-by: Zhang Shengju <zhangshengju@cmss.chinamobile.com>
Signed-off-by: Tang Bin <tangbin@cmss.chinamobile.com>
Link: https://lore.kernel.org/r/20200427091520.12412-1-tangbin@cmss.chinamobile.com
Signed-off-by: Mark Brown <broonie@kernel.org>
4 years agoASoC: fsl_easrc: Check for null pointer before dereferencing "ctx" in fsl_easrc_hw_free()
Shengjiu Wang [Sat, 25 Apr 2020 07:19:29 +0000 (15:19 +0800)]
ASoC: fsl_easrc: Check for null pointer before dereferencing "ctx" in fsl_easrc_hw_free()

The patch 955ac624058f: "ASoC: fsl_easrc: Add EASRC ASoC CPU DAI
drivers" from Apr 16, 2020, leads to the following Smatch complaint:

sound/soc/fsl/fsl_easrc.c:1529 fsl_easrc_hw_free()
warn: variable dereferenced before check 'ctx' (see line 1527)

sound/soc/fsl/fsl_easrc.c
  1526          struct fsl_asrc_pair *ctx = runtime->private_data;
  1527          struct fsl_easrc_ctx_priv *ctx_priv = ctx->private;
                                                      ^^^^^
Dereference

  1528
  1529          if (ctx && (ctx_priv->ctx_streams & BIT(substream->stream))) {
                    ^^^
This check is too late, to prevent a NULL dereference.

  1530                  ctx_priv->ctx_streams &= ~BIT(substream->stream);
  1531                  fsl_easrc_release_context(ctx);

Fixes: 955ac624058f ("ASoC: fsl_easrc: Add EASRC ASoC CPU DAI drivers")
Reported-by: Dan Carpenter <dan.carpenter@oracle.com>
Signed-off-by: Shengjiu Wang <shengjiu.wang@nxp.com>
Acked-by: Nicolin Chen <nicoleotsuka@gmail.com>
Link: https://lore.kernel.org/r/d23c939f1c9eeb3fce34b6c34d44e2d6156f663a.1587799355.git.shengjiu.wang@nxp.com
Signed-off-by: Mark Brown <broonie@kernel.org>
4 years agoASoC: ti: remove comparison to bool in omap_mcbsp_dai_set_dai_fmt()
Jason Yan [Sun, 26 Apr 2020 09:42:38 +0000 (17:42 +0800)]
ASoC: ti: remove comparison to bool in omap_mcbsp_dai_set_dai_fmt()

Fix the following coccicheck warning:

sound/soc/ti/omap-mcbsp.c:1188:5-11: WARNING: Comparison to bool

Signed-off-by: Jason Yan <yanaijie@huawei.com>
Acked-by: Jarkko Nikula <jarkko.nikula@bitmer.com>
Link: https://lore.kernel.org/r/20200426094238.23914-1-yanaijie@huawei.com
Signed-off-by: Mark Brown <broonie@kernel.org>
4 years agoASoC: mxs-saif: Avoid unnecessary check
Tang Bin [Mon, 20 Apr 2020 14:25:09 +0000 (22:25 +0800)]
ASoC: mxs-saif: Avoid unnecessary check

The function mxs_saif_probe() is only called with an
openfirmware platform device. Therefore there is no
need to check that it has an openfirmware node.

Signed-off-by: Shengju Zhang <zhangshengju@cmss.chinamobile.com>
Signed-off-by: Tang Bin <tangbin@cmss.chinamobile.com>
Link: https://lore.kernel.org/r/20200420142509.9728-1-tangbin@cmss.chinamobile.com
Signed-off-by: Mark Brown <broonie@kernel.org>
4 years agoASoC: Intel: sof_sdw: add amp number in components string for ucm
randerwang [Sun, 19 Apr 2020 18:35:09 +0000 (02:35 +0800)]
ASoC: Intel: sof_sdw: add amp number in components string for ucm

The number of speaker amplifiers may vary between platforms. UCM
needs to check amp number to include different configuration files.
This patch keeps track of the number of speaker amplifiers and
stores it in components string of the card.

Tested on Comet Lake platforms.

Signed-off-by: randerwang <rander.wang@linux.intel.com>
Signed-off-by: Pierre-Louis Bossart <pierre-louis.bossart@linux.intel.com>
Signed-off-by: Bard Liao <yung-chuan.liao@linux.intel.com>
Reviewed-by: Guennadi Liakhovetski <guennadi.liakhovetski@linux.intel.com>
Link: https://lore.kernel.org/r/20200419183509.4134-1-yung-chuan.liao@linux.intel.com
Signed-off-by: Mark Brown <broonie@kernel.org>
4 years agoASoC: hisilicon: Use IS_ERR() instead of IS_ERR_OR_NULL()
Tang Bin [Mon, 27 Apr 2020 09:11:45 +0000 (17:11 +0800)]
ASoC: hisilicon: Use IS_ERR() instead of IS_ERR_OR_NULL()

In the function hi6210_i2s_probe(), devm_clk_get() doesn't return NULL.
Thus use IS_ERR() to validate the return value instead of IS_ERR_OR_NULL().

Signed-off-by: Zhang Shengju <zhangshengju@cmss.chinamobile.com>
Signed-off-by: Tang Bin <tangbin@cmss.chinamobile.com>
Link: https://lore.kernel.org/r/20200427091145.4268-1-tangbin@cmss.chinamobile.com
Signed-off-by: Mark Brown <broonie@kernel.org>
4 years agoASoC: fsl_esai: Disable exception interrupt before scheduling tasklet
Shengjiu Wang [Mon, 27 Apr 2020 06:23:21 +0000 (14:23 +0800)]
ASoC: fsl_esai: Disable exception interrupt before scheduling tasklet

Disable exception interrupt before scheduling tasklet, otherwise if
the tasklet isn't handled immediately, there will be endless xrun
interrupt.

Fixes: 7ccafa2b3879 ("ASoC: fsl_esai: recover the channel swap after xrun")
Signed-off-by: Shengjiu Wang <shengjiu.wang@nxp.com>
Acked-by: Nicolin Chen <nicoleotsuka@gmail.com>
Link: https://lore.kernel.org/r/a8f2ad955aac9e52587beedc1133b3efbe746895.1587968824.git.shengjiu.wang@nxp.com
Signed-off-by: Mark Brown <broonie@kernel.org>
4 years agoASoC: snd-sof-intel-hda-common - add hda_model parameter and pass it to HDA codec...
Jaroslav Kysela [Fri, 24 Apr 2020 09:25:20 +0000 (11:25 +0200)]
ASoC: snd-sof-intel-hda-common - add hda_model parameter and pass it to HDA codec driver

It may be useful to pass the specific model to the generic HDA codec
routines like the legacy HDA driver (snd-hda-intel) allows.
The model name "sofbus" is tricky anyway.

Original proposal: https://lore.kernel.org/alsa-devel/20191203161908.7496-1-perex@perex.cz/

Signed-off-by: Jaroslav Kysela <perex@perex.cz>
Reviewed-by: Takashi Iwai <tiwai@suse.de>
Reviewed-by: Kai Vehmanen <kai.vehmanen@linux.intel.com>
Cc: Pierre-Louis Bossart <pierre-louis.bossart@linux.intel.com>
Cc: Mark Brown <broonie@kernel.org>
Link: https://lore.kernel.org/r/20200424092520.23989-1-perex@perex.cz
Signed-off-by: Mark Brown <broonie@kernel.org>
4 years agoASoC: soc-compress: avoid false-positive Wuninitialized warning
Rong Chen [Fri, 24 Apr 2020 00:54:37 +0000 (08:54 +0800)]
ASoC: soc-compress: avoid false-positive Wuninitialized warning

gcc-6.5 and earlier show a new warning:

sound/soc/soc-compress.c: In function ‘soc_compr_open’:
sound/soc/soc-compress.c:75:28: warning: ‘component’ is used uninitialized in this function [-Wuninitialized]
  struct snd_soc_component *component, *save = NULL;
                              ^~~~~~~~~

Simplest fix is to initialize it to avoid the warning.

Reported-by: kbuild test robot <lkp@intel.com>
Signed-off-by: Rong Chen <rong.a.chen@intel.com>
Acked-by: Kuninori Morimoto <kuninori.morimoto.gx@renesas.com>
Cc: Kuninori Morimoto <kuninori.morimoto.gx@renesas.com>
Link: https://lore.kernel.org/lkml/202004201540.vYPhhYMs%25lkp@intel.com
Link: https://lore.kernel.org/r/20200424005437.3941-1-rong.a.chen@intel.com
Signed-off-by: Mark Brown <broonie@kernel.org>
4 years agoASoC: wm8962: set CLOCKING2 as non-volatile register
Shengjiu Wang [Fri, 24 Apr 2020 02:01:38 +0000 (10:01 +0800)]
ASoC: wm8962: set CLOCKING2 as non-volatile register

Previously CLOCKING2 is set as a volatile register, but cause
issue at suspend & resume, that some bits of CLOCKING2 is not
restored at resume, for example SYSCLK_SRC bits, then the output
clock is wrong.

The volatile property is caused by CLASSD_CLK_DIV bits,
which are controlled by the chip itself. But the datasheet
claims these are read only and protected by the security key,
and they are not read by the driver at all.

So it should be safe to change CLOCKING2 to be non-volatile.

Signed-off-by: Shengjiu Wang <shengjiu.wang@nxp.com>
Acked-by: Charles Keepax <ckeepax@opensource.cirrus.com>
Link: https://lore.kernel.org/r/6d25d5b36d4b9aeb8655b5e947dad52214e34177.1587693523.git.shengjiu.wang@nxp.com
Signed-off-by: Mark Brown <broonie@kernel.org>