linux-2.6-microblaze.git
6 years agoMerge remote-tracking branch 'asoc/for-4.17' into asoc-4.18 to resolve a
Mark Brown [Tue, 1 May 2018 21:12:18 +0000 (06:12 +0900)]
Merge remote-tracking branch 'asoc/for-4.17' into asoc-4.18 to resolve a
conflict between a fix and new development in mtk

6 years agoASoC: dai playback and capture active may be greater than 1
Jerome Brunet [Fri, 27 Apr 2018 11:31:51 +0000 (13:31 +0200)]
ASoC: dai playback and capture active may be greater than 1

At the moment playback_active and capture_active are using only 1 bit so
the maximum active count is 1.

However, snd_soc_runtime_activate() may be called several time on the
same dai. This happens when a dai is part of several dai_links. It is
often the case for "snd-soc-dummy-dai".

This is a problem if snd_soc_runtime_activate() is called an even number
of times on a dai. In this case the active count overflow back to 0. As
consequence, ASoC functions, such as soc_dpcm_runtime_update(), won't run
correctly.

Storing these usage counts on plain 'unsigned int' solves the problem.

Fixes: f0fba2ad1b6b ("ASoC: multi-component - ASoC Multi-Component Support")
Signed-off-by: Jerome Brunet <jbrunet@baylibre.com>
Signed-off-by: Mark Brown <broonie@kernel.org>
6 years agoASoC: cirrus: i2s: Fix {TX|RX}LinCtrlData setup
Alexander Sverdlin [Sat, 28 Apr 2018 20:51:39 +0000 (22:51 +0200)]
ASoC: cirrus: i2s: Fix {TX|RX}LinCtrlData setup

According to "EP93xx User’s Guide", I2STXLinCtrlData and I2SRXLinCtrlData
registers actually have different format. The only currently used bit
(Left_Right_Justify) has different position. Fix this and simplify the
whole setup taking into account the fact that both registers have zero
default value.

The practical effect of the above is repaired SND_SOC_DAIFMT_RIGHT_J
support (currently unused).

Signed-off-by: Alexander Sverdlin <alexander.sverdlin@gmail.com>
Signed-off-by: Mark Brown <broonie@kernel.org>
Cc: stable@vger.kernel.org
6 years agoASoC: cirrus: i2s: Fix LRCLK configuration
Alexander Sverdlin [Sat, 28 Apr 2018 20:51:38 +0000 (22:51 +0200)]
ASoC: cirrus: i2s: Fix LRCLK configuration

The bit responsible for LRCLK polarity is i2s_tlrs (0), not i2s_trel (2)
(refer to "EP93xx User's Guide").

Previously card drivers which specified SND_SOC_DAIFMT_NB_IF actually got
SND_SOC_DAIFMT_NB_NF, an adaptation is necessary to retain the old
behavior.

Signed-off-by: Alexander Sverdlin <alexander.sverdlin@gmail.com>
Signed-off-by: Mark Brown <broonie@kernel.org>
Cc: stable@vger.kernel.org
6 years agoASoC: amd: fix spelling mistake: "failer" -> "failure"
Colin Ian King [Tue, 1 May 2018 08:20:01 +0000 (09:20 +0100)]
ASoC: amd: fix spelling mistake: "failer" -> "failure"

Trivial fix to spelling mistake in dev_err error message

Signed-off-by: Colin Ian King <colin.king@canonical.com>
Signed-off-by: Mark Brown <broonie@kernel.org>
6 years agoASoC: mediatek: add the .probe() callback in mt2701_afe_pcm_dai_component
Ryder Lee [Mon, 30 Apr 2018 12:15:31 +0000 (20:15 +0800)]
ASoC: mediatek: add the .probe() callback in mt2701_afe_pcm_dai_component

For the sake of uniformity, this patch adds a callback mt2701_afe_pcm_probe()
in mt2701_afe_pcm_dai_component to retrieve the regmap - the canonical way to
obtain the pointer..

Doing so, we could switch to use devm_snd_soc_register_component() to register
the component driver.

Signed-off-by: Ryder Lee <ryder.lee@mediatek.com>
Signed-off-by: Mark Brown <broonie@kernel.org>
6 years agoASoC: Intel: cht-bsw-rt5672: allow for topology-defined codec-dai setup
Pierre-Louis Bossart [Fri, 27 Apr 2018 21:36:00 +0000 (16:36 -0500)]
ASoC: Intel: cht-bsw-rt5672: allow for topology-defined codec-dai setup

Hard-coded setups conflict with topology defined ones. Move this code to
codec_fixup so that SOF can override codec dai settings, e.g. to only use
2 channels.

Signed-off-by: Pierre-Louis Bossart <pierre-louis.bossart@linux.intel.com>
Acked-by: Vinod Koul <vkoul@kernel.org>
Signed-off-by: Mark Brown <broonie@kernel.org>
6 years agoASoC: mediatek: avoid using snd_soc_platform
Kai Chieh Chuang [Sat, 28 Apr 2018 05:21:26 +0000 (13:21 +0800)]
ASoC: mediatek: avoid using snd_soc_platform

avoid using snd_soc_platform, which is removed after 4.18

Signed-off-by: KaiChieh Chuang <kaichieh.chuang@mediatek.com>
Signed-off-by: Mark Brown <broonie@kernel.org>
6 years agoASoC: tas6424: Add support for the mute pin
Jean-Jacques Hiblot [Fri, 27 Apr 2018 13:55:48 +0000 (15:55 +0200)]
ASoC: tas6424: Add support for the mute pin

mute can be connected to GPIO. In that case we have to drive it to the
correct value

Signed-off-by: Jean-Jacques Hiblot <jjhiblot@ti.com>
Signed-off-by: Mark Brown <broonie@kernel.org>
6 years agoASoC: tas6424: Add support for the standby pin
Jean-Jacques Hiblot [Fri, 27 Apr 2018 13:55:47 +0000 (15:55 +0200)]
ASoC: tas6424: Add support for the standby pin

The standby pin can be connected to a GPIO. In that case we have to drive
it to the correct values for the TAS6424 to operate properly.

Signed-off-by: Jean-Jacques Hiblot <jjhiblot@ti.com>
Signed-off-by: Mark Brown <broonie@kernel.org>
6 years agoASoC: core: Allow codec_conf DT lookups to match parent of_node
Charles Keepax [Fri, 27 Apr 2018 12:54:36 +0000 (13:54 +0100)]
ASoC: core: Allow codec_conf DT lookups to match parent of_node

For devices implemented as a MFD it is common to only have a single node
in devicetree representing the whole device. As such when looking up
codec_conf mappings we should match against both the devices of_node and
the devices parent's of_node, as is already done for DAIs and platform
components.

Signed-off-by: Charles Keepax <ckeepax@opensource.cirrus.com>
Signed-off-by: Mark Brown <broonie@kernel.org>
6 years agoASoC: mediatek: preallocate pages use platform device
Kai Chieh Chuang [Fri, 27 Apr 2018 02:11:35 +0000 (10:11 +0800)]
ASoC: mediatek: preallocate pages use platform device

preallocate pages should use platform device,
since we set dma mask for platform device.

Signed-off-by: KaiChieh Chuang <kaichieh.chuang@mediatek.com>
Signed-off-by: Mark Brown <broonie@kernel.org>
Cc: stable@vger.kernel.org
6 years agoASoC: mediatek: preallocate pages use platform device
Kai Chieh Chuang [Fri, 27 Apr 2018 02:11:35 +0000 (10:11 +0800)]
ASoC: mediatek: preallocate pages use platform device

preallocate pages should use platform device,
since we set dma mask for platform device.

Signed-off-by: KaiChieh Chuang <kaichieh.chuang@mediatek.com>
Signed-off-by: Mark Brown <broonie@kernel.org>
6 years agoASoC: omap: Remove OMAP_MUX dependency from Nokia N810 audio support
Jarkko Nikula [Fri, 27 Apr 2018 08:17:15 +0000 (11:17 +0300)]
ASoC: omap: Remove OMAP_MUX dependency from Nokia N810 audio support

Commit e9f5f1e45608 ("ARM: OMAP2+: Remove legacy mux code") removed
CONFIG_OMAP_MUX making impossible to build Nokia N810 audio support. Remove
this dependency so we can do at least build tests.

Fixes: e9f5f1e45608 ("ARM: OMAP2+: Remove legacy mux code")
Signed-off-by: Jarkko Nikula <jarkko.nikula@bitmer.com>
Signed-off-by: Peter Ujfalusi <peter.ujfalusi@ti.com>
Signed-off-by: Mark Brown <broonie@kernel.org>
6 years agoASoC: omap: n810: HS mic is not working, add a widget for it with comment
Peter Ujfalusi [Fri, 27 Apr 2018 08:17:14 +0000 (11:17 +0300)]
ASoC: omap: n810: HS mic is not working, add a widget for it with comment

The bias for the analog HS microphone is coming from Retu/Vilma chip and
we do not have control over it, yet.

For clarity, add a new DAPM_MIC widget for the HS mic and document the
current state.

Signed-off-by: Peter Ujfalusi <peter.ujfalusi@ti.com>
Signed-off-by: Mark Brown <broonie@kernel.org>
6 years agoMerge branch 'asoc-4.17' into asoc-4.18 n810 dependencies
Mark Brown [Fri, 27 Apr 2018 10:58:05 +0000 (11:58 +0100)]
Merge branch 'asoc-4.17' into asoc-4.18 n810 dependencies

6 years agoASoC: omap: n810: Correct the cpu_dai, platform and codec name
Peter Ujfalusi [Fri, 27 Apr 2018 08:17:13 +0000 (11:17 +0300)]
ASoC: omap: n810: Correct the cpu_dai, platform and codec name

The non DT boot is no longer supported and when booting with DT the device
names are different.

Fix them up for now, but the n810.c should be updated to support probing
via DT with proper bindings.

Signed-off-by: Peter Ujfalusi <peter.ujfalusi@ti.com>
Acked-by: Jarkko Nikula <jarkko.nikula@bitmer.com>
Signed-off-by: Mark Brown <broonie@kernel.org>
6 years agoASoC: omap: n810: Correct the card level dapm_route
Peter Ujfalusi [Fri, 27 Apr 2018 08:17:12 +0000 (11:17 +0300)]
ASoC: omap: n810: Correct the card level dapm_route

Fix the capture DAPM route due to core changes regarding to mic bias.

Signed-off-by: Peter Ujfalusi <peter.ujfalusi@ti.com>
Acked-by: Jarkko Nikula <jarkko.nikula@bitmer.com>
Signed-off-by: Mark Brown <broonie@kernel.org>
6 years agoASoC: mt6797: switch to SPDX license tag
Kai Chieh Chuang [Fri, 27 Apr 2018 01:54:44 +0000 (09:54 +0800)]
ASoC: mt6797: switch to SPDX license tag

Signed-off-by: KaiChieh Chuang <kaichieh.chuang@mediatek.com>
Reviewed-by: Matthias Brugger <matthias.bgg@gmail.com>
Signed-off-by: Mark Brown <broonie@kernel.org>
6 years agoASoC: mt6797: add structure define and clock control function for 6797
Kai Chieh Chuang [Wed, 25 Apr 2018 02:48:49 +0000 (10:48 +0800)]
ASoC: mt6797: add structure define and clock control function for 6797

Signed-off-by: KaiChieh Chuang <kaichieh.chuang@mediatek.com>
Signed-off-by: Mark Brown <broonie@kernel.org>
6 years agoASoC: add mt6797-mt6351 driver and config option
Kai Chieh Chuang [Wed, 25 Apr 2018 07:25:21 +0000 (15:25 +0800)]
ASoC: add mt6797-mt6351 driver and config option

Signed-off-by: KaiChieh Chuang <kaichieh.chuang@mediatek.com>
Signed-off-by: Mark Brown <broonie@kernel.org>
6 years agoASoC: mt6351 switch to SPDX license tag
Kai Chieh Chuang [Fri, 27 Apr 2018 01:54:45 +0000 (09:54 +0800)]
ASoC: mt6351 switch to SPDX license tag

Signed-off-by: KaiChieh Chuang <kaichieh.chuang@mediatek.com>
Signed-off-by: Mark Brown <broonie@kernel.org>
6 years agoASoC: uniphier: remove boilerplate from lisence comment
Katsuhiro Suzuki [Fri, 27 Apr 2018 05:27:34 +0000 (14:27 +0900)]
ASoC: uniphier: remove boilerplate from lisence comment

This patch removes boilerplate of GPLv2, use only SPDX identifier as
same as other recently ASoC DAI drivers.

Signed-off-by: Katsuhiro Suzuki <suzuki.katsuhiro@socionext.com>
Signed-off-by: Mark Brown <broonie@kernel.org>
6 years agoASoC: fsl_ssi: Use u32 variable type when using regmap_read()
Fabio Estevam [Wed, 25 Apr 2018 22:53:52 +0000 (19:53 -0300)]
ASoC: fsl_ssi: Use u32 variable type when using regmap_read()

Convert the sisr and sisr2 variable types to u32 to avoid the following
sparse warnings:

sound/soc/fsl/fsl_ssi.c:391:42: warning: incorrect type in argument 3 (different base types)
sound/soc/fsl/fsl_ssi.c:391:42:    expected unsigned int *val
sound/soc/fsl/fsl_ssi.c:391:42:    got restricted __be32 *<noident>
sound/soc/fsl/fsl_ssi.c:393:17: warning: restricted __be32 degrades to integer
sound/soc/fsl/fsl_ssi.c:393:15: warning: incorrect type in assignment (different base types)
sound/soc/fsl/fsl_ssi.c:393:15:    expected restricted __be32 [usertype] sisr2
sound/soc/fsl/fsl_ssi.c:393:15:    got unsigned int
sound/soc/fsl/fsl_ssi.c:396:50: warning: incorrect type in argument 3 (different base types)
sound/soc/fsl/fsl_ssi.c:396:50:    expected unsigned int [unsigned] val
sound/soc/fsl/fsl_ssi.c:396:50:    got restricted __be32 [usertype] sisr2
sound/soc/fsl/fsl_ssi.c:398:42: warning: incorrect type in argument 2 (different base types)
sound/soc/fsl/fsl_ssi.c:398:42:    expected unsigned int [unsigned] [usertype] sisr
sound/soc/fsl/fsl_ssi.c:398:42:    got restricted __be32 [addressable] [usertype] sisr

In other places where regmap_read() is used a u32 variable is passed
to store the register read value, so do the same here as well.

regmap API already takes care of endianness, so the usage of u32 is safe.

Signed-off-by: Fabio Estevam <fabio.estevam@nxp.com>
Signed-off-by: Mark Brown <broonie@kernel.org>
6 years agoASoC: amd: rename audio_substream_data variable
Mukunda, Vijendar [Thu, 26 Apr 2018 11:15:47 +0000 (16:45 +0530)]
ASoC: amd: rename audio_substream_data variable

In order to make audio_substream_data structure variable
consistent throughout the code, changed the name from
audio_config to rtd wherever applicable.

Signed-off-by: Vijendar Mukunda <Vijendar.Mukunda@amd.com>
Signed-off-by: Mark Brown <broonie@kernel.org>
6 years agoASoC: mediatek: switch to SPDX license tag
Ryder Lee [Wed, 25 Apr 2018 04:19:59 +0000 (12:19 +0800)]
ASoC: mediatek: switch to SPDX license tag

Add SPDX identifiers to all remaining files in sound/soc/mediatek/

Signed-off-by: Ryder Lee <ryder.lee@mediatek.com>
Signed-off-by: Mark Brown <broonie@kernel.org>
6 years agoASoC: mediatek: add MT7622 AFE compatible in documentation
Ryder Lee [Wed, 25 Apr 2018 04:19:58 +0000 (12:19 +0800)]
ASoC: mediatek: add MT7622 AFE compatible in documentation

Add support for MT7622 AFE which shares the same binding with MT2701.

Cc: devicetree@vger.kernel.org
Signed-off-by: Ryder Lee <ryder.lee@mediatek.com>
Signed-off-by: Mark Brown <broonie@kernel.org>
6 years agoASoC: mediatek: add MT7622 AFE support
Ryder Lee [Wed, 25 Apr 2018 04:19:57 +0000 (12:19 +0800)]
ASoC: mediatek: add MT7622 AFE support

This patch adds support for the MT7622 AFE which reuses MT2701 driver.

We also introduce the 'struct mt2701_soc_variants' to differentiate
between the SoC generations as there might be other (existing or future)
chips that use the same binding and driver, then being a little more
abstract could help in the long run.

Cc: Jia Zeng <jia.zeng@mediatek.com>
Signed-off-by: Ryder Lee <ryder.lee@mediatek.com>
Reviewed-by: Garlic Tseng <garlic.tseng@mediatek.com>
Signed-off-by: Mark Brown <broonie@kernel.org>
6 years agoASoC: mediatek: Add MTK_STREAM_NUM to mtk-base-afe.h
Ryder Lee [Wed, 25 Apr 2018 04:19:56 +0000 (12:19 +0800)]
ASoC: mediatek: Add MTK_STREAM_NUM to mtk-base-afe.h

Add MTK_STREAM_NUM to common header and modify related stuff so that
the other SoCs can reuse it.

Signed-off-by: Ryder Lee <ryder.lee@mediatek.com>
Reviewed-by: Garlic Tseng <garlic.tseng@mediatek.com>
Signed-off-by: Mark Brown <broonie@kernel.org>
6 years agoASoC: mediatek: simplify the control logic of MT2701 I2S
Ryder Lee [Wed, 25 Apr 2018 04:19:55 +0000 (12:19 +0800)]
ASoC: mediatek: simplify the control logic of MT2701 I2S

This patch adjusts the mt2701_afe_i2s_ops to simplify the control
logic of the I2S path.

Signed-off-by: Ryder Lee <ryder.lee@mediatek.com>
Reviewed-by: Garlic Tseng <garlic.tseng@mediatek.com>
Signed-off-by: Mark Brown <broonie@kernel.org>
6 years agoASoC: add mt6351 codec driver
Kai Chieh Chuang [Thu, 26 Apr 2018 02:41:44 +0000 (10:41 +0800)]
ASoC: add mt6351 codec driver

This patch adds the MediaTek MT6351 codec driver.
MT6351 communicate with SoC through MediaTek PMIC wrapper.
MT6351 use MediaTek proprietary audio interface.

Signed-off-by: KaiChieh Chuang <kaichieh.chuang@mediatek.com>
Signed-off-by: Mark Brown <broonie@kernel.org>
6 years agoASoC: compress: Add helper functions for component open/free
Charles Keepax [Tue, 24 Apr 2018 15:39:03 +0000 (16:39 +0100)]
ASoC: compress: Add helper functions for component open/free

There are 2 loops calling open and 4 loops calling free for all the
components on a DAI link. Factor out these loops into helper functions
to make the code a little clearer.

Signed-off-by: Charles Keepax <ckeepax@opensource.cirrus.com>
Acked-by: Vinod Koul <vkoul@kernel.org>
Signed-off-by: Mark Brown <broonie@kernel.org>
6 years agoASoC: Remove platform code now everything is componentised
Charles Keepax [Tue, 24 Apr 2018 15:39:02 +0000 (16:39 +0100)]
ASoC: Remove platform code now everything is componentised

As all drivers have been moved over to the new generic component
code remove the now unused platform specific code.

Signed-off-by: Charles Keepax <ckeepax@opensource.cirrus.com>
Acked-by: Vinod Koul <vkoul@kernel.org>
Signed-off-by: Mark Brown <broonie@kernel.org>
6 years agoMerge branch 'asoc-4.17' into asoc-4.18 for compress dependencies
Mark Brown [Thu, 26 Apr 2018 11:24:28 +0000 (12:24 +0100)]
Merge branch 'asoc-4.17' into asoc-4.18 for compress dependencies

6 years agoASoC: compress: Only call free for components which have been opened
Charles Keepax [Tue, 24 Apr 2018 15:39:01 +0000 (16:39 +0100)]
ASoC: compress: Only call free for components which have been opened

The core should only call free on a component if said component has
already had open called on it. This is not presently the case and most
compressed drivers in the kernel assume it will be. This causes null
pointer dereferences in the drivers as they attempt clean up for stuff
that was never put in place.

This is fixed by aborting calling open callbacks once a failure is
encountered and then during clean up only iterating through the
component list to that point.

This is a fairly quick fix to the issue, to allow backporting. There
is more refactoring to follow to tidy the code up a little.

Fixes: 9e7e3738ab0e ("ASoC: snd_soc_component_driver has snd_compr_ops")
Signed-off-by: Charles Keepax <ckeepax@opensource.cirrus.com>
Acked-by: Vinod Koul <vkoul@kernel.org>
Signed-off-by: Mark Brown <broonie@kernel.org>
6 years agoASoC: Update email address for Vinod
Vinod Koul [Thu, 26 Apr 2018 06:44:50 +0000 (12:14 +0530)]
ASoC: Update email address for Vinod

Update the email address for compressed audio maintainer
Also update .mailmap.

Signed-off-by: Vinod Koul <vkoul@kernel.org>
Signed-off-by: Mark Brown <broonie@kernel.org>
6 years agoASoC: mediatek: use snd_soc_dai_get_drvdata() to get the private data
Ryder Lee [Wed, 25 Apr 2018 04:19:54 +0000 (12:19 +0800)]
ASoC: mediatek: use snd_soc_dai_get_drvdata() to get the private data

Reduce the boilerplate code to retrieve the private data.
No functional change intended.

Signed-off-by: Ryder Lee <ryder.lee@mediatek.com>
Reviewed-by: Garlic Tseng <garlic.tseng@mediatek.com>
Signed-off-by: Mark Brown <broonie@kernel.org>
6 years agoASoC: mediatek: add documents for mt6797
Kai Chieh Chuang [Wed, 25 Apr 2018 07:25:22 +0000 (15:25 +0800)]
ASoC: mediatek: add documents for mt6797

Signed-off-by: KaiChieh Chuang <kaichieh.chuang@mediatek.com>
Signed-off-by: Mark Brown <broonie@kernel.org>
6 years agoASoC: mt6797: add mt6797 platform driver
Kai Chieh Chuang [Wed, 25 Apr 2018 07:25:20 +0000 (15:25 +0800)]
ASoC: mt6797: add mt6797 platform driver

Signed-off-by: KaiChieh Chuang <kaichieh.chuang@mediatek.com>
Signed-off-by: Mark Brown <broonie@kernel.org>
6 years agoASoC: wm_adsp: Account for name prefixes when toggling preloader
Charles Keepax [Tue, 24 Apr 2018 15:53:09 +0000 (16:53 +0100)]
ASoC: wm_adsp: Account for name prefixes when toggling preloader

Use the correct functions to allow a name prefix assigned through
codec_conf to be taken into consideration whilst enabling and disabling
the preloader widget.

Signed-off-by: Charles Keepax <ckeepax@opensource.cirrus.com>
Signed-off-by: Mark Brown <broonie@kernel.org>
6 years agoASoC: sgtl5000: Switch to SPDX identifier
Fabio Estevam [Mon, 23 Apr 2018 00:02:11 +0000 (21:02 -0300)]
ASoC: sgtl5000: Switch to SPDX identifier

Adopt the SPDX license identifier headers to ease license compliance
management.

Signed-off-by: Fabio Estevam <fabio.estevam@nxp.com>
Signed-off-by: Mark Brown <broonie@kernel.org>
6 years agoASoC: sgtl5000: Fix the spelling of 'exceed'
Fabio Estevam [Mon, 23 Apr 2018 00:02:10 +0000 (21:02 -0300)]
ASoC: sgtl5000: Fix the spelling of 'exceed'

Fix the spelling of 'exceed' in two comments.

Signed-off-by: Fabio Estevam <fabio.estevam@nxp.com>
Signed-off-by: Mark Brown <broonie@kernel.org>
6 years agoASoC: sh: Update menu title and platform dependency
Geert Uytterhoeven [Fri, 20 Apr 2018 13:28:32 +0000 (15:28 +0200)]
ASoC: sh: Update menu title and platform dependency

Change the menu title to refer to "Renesas SoCs" instead of "SuperH", as
both SuperH and ARM SoCs are supported.

Since commit 9b5ba0df4ea4f940 ("ARM: shmobile: Introduce ARCH_RENESAS")
is ARCH_RENESAS a more appropriate platform dependency for Renesas ARM
SoCs than the legacy ARCH_SHMOBILE, hence use the former.
Renesas SuperH SH-Mobile SoCs are still covered by the SUPERH
dependency.

This will allow to drop ARCH_SHMOBILE on ARM and ARM64 in the near
future.

Signed-off-by: Geert Uytterhoeven <geert+renesas@glider.be>
Signed-off-by: Mark Brown <broonie@kernel.org>
6 years agoASoC: sh: Drop SUPERH platform dependency
Geert Uytterhoeven [Fri, 20 Apr 2018 14:22:14 +0000 (16:22 +0200)]
ASoC: sh: Drop SUPERH platform dependency

The SIU sound peripheral is used only on SuperH SH-Mobile platforms.
As both SUPERH and ARCH_SHMOBILE are set for these platforms, the SUPERH
dependency can be dropped.

Signed-off-by: Geert Uytterhoeven <geert+renesas@glider.be>
Signed-off-by: Mark Brown <broonie@kernel.org>
6 years agoASoC: Intel: kbl_rt5663_rt5514_max98927: Replace GFP_ATOMIC with GFP_KERNEL
Vinod Koul [Fri, 20 Apr 2018 10:44:32 +0000 (16:14 +0530)]
ASoC: Intel: kbl_rt5663_rt5514_max98927: Replace GFP_ATOMIC with GFP_KERNEL

In kabylake_audio_probe which is not atomic context, we use GFP_ATOMIC
flag with memory allocation, fix that by using GFP_KERNEL.

Signed-off-by: Vinod Koul <vinod.koul@intel.com>
Signed-off-by: Mark Brown <broonie@kernel.org>
6 years agoASoC: Intel: kbl_rt5663_max98927: Replace GFP_ATOMIC with GFP_KERNEL
Vinod Koul [Fri, 20 Apr 2018 10:44:31 +0000 (16:14 +0530)]
ASoC: Intel: kbl_rt5663_max98927: Replace GFP_ATOMIC with GFP_KERNEL

In kabylake_audio_probe which is not atomic context, we use GFP_ATOMIC
flag with memory allocation, fix that by using GFP_KERNEL.

Signed-off-by: Vinod Koul <vinod.koul@intel.com>
Signed-off-by: Mark Brown <broonie@kernel.org>
6 years agoASoC: Intel: kbl_da7219_max98357a: Replace GFP_ATOMIC with GFP_KERNEL
Vinod Koul [Fri, 20 Apr 2018 10:44:30 +0000 (16:14 +0530)]
ASoC: Intel: kbl_da7219_max98357a: Replace GFP_ATOMIC with GFP_KERNEL

In kabylake_audio_probe which is not atomic context, we use GFP_ATOMIC
flag with memory allocation, fix that by using GFP_KERNEL.

Signed-off-by: Vinod Koul <vinod.koul@intel.com>
Signed-off-by: Mark Brown <broonie@kernel.org>
6 years agoASoC: Intel: cht_bsw_nau8824: Replace GFP_ATOMIC with GFP_KERNEL
Vinod Koul [Fri, 20 Apr 2018 10:44:29 +0000 (16:14 +0530)]
ASoC: Intel: cht_bsw_nau8824: Replace GFP_ATOMIC with GFP_KERNEL

In snd_cht_mc_probe which is not atomic context, we use GFP_ATOMIC
flag with memory allocation, fix that by using GFP_KERNEL.

Signed-off-by: Vinod Koul <vinod.koul@intel.com>
Signed-off-by: Mark Brown <broonie@kernel.org>
6 years agoASoC: Intel: bytcr_rt5651: Replace GFP_ATOMIC with GFP_KERNEL
Vinod Koul [Fri, 20 Apr 2018 10:44:28 +0000 (16:14 +0530)]
ASoC: Intel: bytcr_rt5651: Replace GFP_ATOMIC with GFP_KERNEL

In snd_byt_rt5651_mc_probe which is not atomic context, we use
GFP_ATOMIC flag with memory allocation, fix that by using GFP_KERNEL.

Signed-off-by: Vinod Koul <vinod.koul@intel.com>
Signed-off-by: Mark Brown <broonie@kernel.org>
6 years agoASoC: Intel: bytcht_es8316: Replace GFP_ATOMIC with GFP_KERNEL
Vinod Koul [Fri, 20 Apr 2018 10:44:27 +0000 (16:14 +0530)]
ASoC: Intel: bytcht_es8316: Replace GFP_ATOMIC with GFP_KERNEL

In snd_byt_cht_es8316_mc_probe which is not atomic context, we use
GFP_ATOMIC flag with memory allocation, fix that by using GFP_KERNEL.

Signed-off-by: Vinod Koul <vinod.koul@intel.com>
Signed-off-by: Mark Brown <broonie@kernel.org>
6 years agoASoC: Intel: byt-max98090: Replace GFP_ATOMIC with GFP_KERNEL
Vinod Koul [Fri, 20 Apr 2018 10:44:26 +0000 (16:14 +0530)]
ASoC: Intel: byt-max98090: Replace GFP_ATOMIC with GFP_KERNEL

In byt_max98090_probe which is not atomic context, we use GFP_ATOMIC
flag with memory allocation, fix that by using GFP_KERNEL.

Signed-off-by: Vinod Koul <vinod.koul@intel.com>
Signed-off-by: Mark Brown <broonie@kernel.org>
6 years agoASoC: atmel: simplify getting .drvdata
Wolfram Sang [Thu, 19 Apr 2018 14:06:31 +0000 (16:06 +0200)]
ASoC: atmel: simplify getting .drvdata

We should get drvdata from struct device directly. Going via
platform_device is an unneeded step back and forth.

Signed-off-by: Wolfram Sang <wsa+renesas@sang-engineering.com>
Signed-off-by: Mark Brown <broonie@kernel.org>
6 years agoASoC: rt5668: fix incorrect 'and' operator
Colin Ian King [Thu, 19 Apr 2018 14:34:31 +0000 (15:34 +0100)]
ASoC: rt5668: fix incorrect 'and' operator

Currently logical and is being used instead of bitwise and. Fix this.

Detected by CoverityScan, CID#1468008 ("Logical vs bitwise operator")

Fixes: d59fb2856223 ("ASoC: rt5668: add rt5668B codec driver")
Signed-off-by: Colin Ian King <colin.king@canonical.com>
Signed-off-by: Mark Brown <broonie@kernel.org>
6 years agoASoC: Intel: Disable SND_SOC_INTEL_BAYTRAIL when SND_SST_ATOM_HIFI2_PLATFORM is enabled
Hans de Goede [Fri, 13 Apr 2018 12:45:37 +0000 (14:45 +0200)]
ASoC: Intel: Disable SND_SOC_INTEL_BAYTRAIL when SND_SST_ATOM_HIFI2_PLATFORM is enabled

The sound/soc/intel/common/sst-acpi.c code only tries to load the
"baytrail-pcm-audio" driver (and supporting board drivers) when
SND_SST_ATOM_HIFI2_PLATFORM is not enabled, since otherwise these
are handled by snd-soc-sst-atom-hifi2-platform.ko.

Since these thus will never be used when SND_SST_ATOM_HIFI2_PLATFORM is
enabled, building these drivers when it is enabled is useless.

Add a Kconfig dependency to reflect this, so that SND_SOC_INTEL_BAYTRAIL
cannot be enabled when SND_SST_ATOM_HIFI2_PLATFORM is also enabled.

Signed-off-by: Hans de Goede <hdegoede@redhat.com>
Acked-by: Pierre-Louis Bossart <pierre-louis.bossart@linux.intel.com>
Signed-off-by: Mark Brown <broonie@kernel.org>
6 years agoASoC: msm8916-wcd-analog: use threaded context for mbhc events
Srinivas Kandagatla [Wed, 18 Apr 2018 17:46:37 +0000 (18:46 +0100)]
ASoC: msm8916-wcd-analog: use threaded context for mbhc events

As snd_soc_jack_report() can sleep, move handling of mbhc events to a
thread context rather than in interrupt context.

Fixes: de66b3455023 ('ASoC: codecs: msm8916-wcd-analog: add MBHC support')
Reported-by: Bjorn Andersson <bjorn.andersson@linaro.org>
Signed-off-by: Srinivas Kandagatla <srinivas.kandagatla@linaro.org>
Signed-off-by: Mark Brown <broonie@kernel.org>
6 years agoASoC: topology: Revert recent changes while boot errors are investigated
Mark Brown [Thu, 19 Apr 2018 11:14:10 +0000 (12:14 +0100)]
ASoC: topology: Revert recent changes while boot errors are investigated

Krzysztof Kozlowski reported a NULL dereference in _instantiate_card()
on Odroid XU3 and XU boards which he bisected to 45f8cb57da0d7 (ASoC:
core: Allow topology to override machine driver FE DAI link config).
Revert that commit for now, along with f11a5c27f928 (ASoC: core: Add
name prefix for machines with topology rewrites) due to dependency
issues, in order to keep things booting cleanly in -next.

Reported-by: Krzysztof Kozlowski <krzk@kernel.org>
Signed-off-by: Mark Brown <broonie@kernel.org>
6 years agoASoC: topology: Fix build errors
Mark Brown [Wed, 18 Apr 2018 14:40:41 +0000 (15:40 +0100)]
ASoC: topology: Fix build errors

The two commits:

   81e9b0a07889 ASoC: topology: Give more data to clients via callbacks
   28aa6f7779f7 ASoC: topology: Add callback for DAPM route load/unload

break the build so revert them.

Reported-by: Stephen Rothwell <sfr@canb.auug.org.au>
Signed-off-by: Mark Brown <broonie@kernel.org>
6 years agoASoC: Remove depends on HAS_DMA in case of platform dependency
Geert Uytterhoeven [Tue, 17 Apr 2018 17:49:01 +0000 (19:49 +0200)]
ASoC: Remove depends on HAS_DMA in case of platform dependency

Remove dependencies on HAS_DMA where a Kconfig symbol depends on another
symbol that implies HAS_DMA, and, optionally, on "|| COMPILE_TEST".
In most cases this other symbol is an architecture or platform specific
symbol, or PCI.

Generic symbols and drivers without platform dependencies keep their
dependencies on HAS_DMA, to prevent compiling subsystems or drivers that
cannot work anyway.

This simplifies the dependencies, and allows to improve compile-testing.

Note:
  - The various SND_SOC_LPASS_* symbols had to loose their dependencies
    on HAS_DMA, as they are selected by SND_SOC_STORM and/or
    SND_SOC_APQ8016_SBC.

Signed-off-by: Geert Uytterhoeven <geert@linux-m68k.org>
Reviewed-by: Mark Brown <broonie@kernel.org>
Acked-by: Robin Murphy <robin.murphy@arm.com>
Acked-by: Mark Brown <broonie@kernel.org>
Signed-off-by: Mark Brown <broonie@kernel.org>
6 years agoASoC: topology: Add support for compressed PCMs
Liam Girdwood [Tue, 27 Mar 2018 13:30:45 +0000 (14:30 +0100)]
ASoC: topology: Add support for compressed PCMs

Register a compressed PCM if topology defines one.

Signed-off-by: Liam Girdwood <liam.r.girdwood@linux.intel.com>
Signed-off-by: Mark Brown <broonie@kernel.org>
6 years agoASoC: topology: Add callback for DAPM route load/unload
Liam Girdwood [Tue, 27 Mar 2018 13:30:43 +0000 (14:30 +0100)]
ASoC: topology: Add callback for DAPM route load/unload

Add a callback fro clients for notification about DAPM route loading and
unloading.

Signed-off-by: Liam Girdwood <liam.r.girdwood@linux.intel.com>
Signed-off-by: Mark Brown <broonie@kernel.org>
6 years agoASoC: topology: Give more data to clients via callbacks
Liam Girdwood [Tue, 27 Mar 2018 13:30:42 +0000 (14:30 +0100)]
ASoC: topology: Give more data to clients via callbacks

Give topology clients more access to the topology data by passing index,
pcm, link_config and dai_driver to clients. This allows clients to fully
instantiate and track topology objects.

The SOF driver is the first user of these new APIs and needs them to build
component topology driver and FW objects.

Signed-off-by: Liam Girdwood <liam.r.girdwood@linux.intel.com>
Signed-off-by: Mark Brown <broonie@kernel.org>
6 years agoASoC: core: Add name prefix for machines with topology rewrites
Liam Girdwood [Tue, 27 Mar 2018 13:30:41 +0000 (14:30 +0100)]
ASoC: core: Add name prefix for machines with topology rewrites

Signed-off-by: Liam Girdwood <liam.r.girdwood@linux.intel.com>
Signed-off-by: Mark Brown <broonie@kernel.org>
6 years agoASoC: core: Allow topology to override machine driver FE DAI link config.
Liam Girdwood [Tue, 27 Mar 2018 13:30:40 +0000 (14:30 +0100)]
ASoC: core: Allow topology to override machine driver FE DAI link config.

Machine drivers statically define a number of DAI links that currently
cannot be changed or removed by topology. This means PCMs and platform
components cannot be changed by topology at runtime AND machine drivers
are tightly coupled to topology.

This patch allows topology to override the machine driver DAI link config
in order to reuse machine drivers with different topologies and platform
components. The patch supports :-

1) create new FE PCMs with a topology defined PCM ID.
2) destroy existing static FE PCMs
3) change the platform component driver.
4) assign any new HW params fixups.

The patch requires no changes to the machine drivers, but does add some
platform component flags that the platform component driver can assign
before loading topologies.

Signed-off-by: Liam Girdwood <liam.r.girdwood@linux.intel.com>
Signed-off-by: Mark Brown <broonie@kernel.org>
6 years agoASoC: topology: Check widget kcontrols before deref
Liam Girdwood [Tue, 27 Mar 2018 13:30:44 +0000 (14:30 +0100)]
ASoC: topology: Check widget kcontrols before deref

Validate the topology input before we dereference the pointer.

Signed-off-by: Liam Girdwood <liam.r.girdwood@linux.intel.com>
Signed-off-by: Mark Brown <broonie@kernel.org>
6 years agoASoC: nau8824: user configuration of key detection
John Hsu [Wed, 21 Mar 2018 07:30:23 +0000 (15:30 +0800)]
ASoC: nau8824: user configuration of key detection

The SAR ADC of key press detection varies depending on headset.
We can't make a set of common threshold values for every case.
Therefore, the driver provides configuration for user and
they can set up values by UCM configuration.

Signed-off-by: John Hsu <KCHSU0@nuvoton.com>
Signed-off-by: Mark Brown <broonie@kernel.org>
6 years agoASoC: amd: fixed checkpatch pl warnings
Mukunda, Vijendar [Tue, 17 Apr 2018 04:59:52 +0000 (10:29 +0530)]
ASoC: amd: fixed checkpatch pl warnings

fixed checkpatch pl warnings.

Signed-off-by: Vijendar Mukunda <Vijendar.Mukunda@amd.com>
Signed-off-by: Mark Brown <broonie@kernel.org>
6 years agoASoC: topology: Fix bugs of freeing soc topology
Yan Wang [Mon, 26 Mar 2018 15:48:00 +0000 (16:48 +0100)]
ASoC: topology: Fix bugs of freeing soc topology

In snd_soc_tplg_component_remove(), it should compare index and
not dobj->index with SND_SOC_TPLG_INDEX_ALL for removing all
topology objects.

Signed-off-by: Yan Wang <yan.wang@linux.intel.com>
Signed-off-by: Liam Girdwood <liam.r.girdwood@linux.intel.com>
Signed-off-by: Mark Brown <broonie@kernel.org>
6 years agoASoC: Intel: Skylake: Reset stream to link mapping
Rakesh Ughreja [Sun, 1 Apr 2018 09:43:23 +0000 (15:13 +0530)]
ASoC: Intel: Skylake: Reset stream to link mapping

By default all the streams are mapped to all links after controller is
reset which causes stream to be broadcast on all the links.

This patch resets the stream-link mapping after controller reset. The
stream is mapped later to the appropriate link as part of stream setup.

Tested-by: Abhijeet Kumar <abhijeet.kumar@intel.com>
Signed-off-by: Rakesh Ughreja <rakesh.a.ughreja@intel.com>
Signed-off-by: Sanyog Kale <sanyog.r.kale@intel.com>
Signed-off-by: Mark Brown <broonie@kernel.org>
6 years agoASoC: Intel: Skylake: Reset DSP Pipelines in prepare
Pardha Saradhi K [Mon, 2 Apr 2018 06:45:48 +0000 (12:15 +0530)]
ASoC: Intel: Skylake: Reset DSP Pipelines in prepare

An application can choose to call .prepare function
any number of times. In such scenarios, there is a
need to reset the DSP pipeline.

Signed-off-by: Pardha Saradhi K <pardha.saradhi.kesapragada@intel.com>
Signed-off-by: Divya Prakash <divya1.prakash@intel.com>
Signed-off-by: Sriram Periyasamy <sriramx.periyasamy@intel.com>
Signed-off-by: Mark Brown <broonie@kernel.org>
6 years agoASoC: Intel: Skylake: Unify the fw ops for SKL and KBL
Pradeep Tewani [Mon, 2 Apr 2018 06:45:50 +0000 (12:15 +0530)]
ASoC: Intel: Skylake: Unify the fw ops for SKL and KBL

SKL and KBL driver used separate set of fw ops for library loading.
However, with the unification of fw binary, use the common set of fw
ops for both

Signed-off-by: Pradeep Tewani <pradeep.d.tewani@intel.com>
Signed-off-by: Sriram Periyasamy <sriramx.periyasamy@intel.com>
Signed-off-by: Mark Brown <broonie@kernel.org>
6 years agoASoC: Intel: Skylake: Reset DSP pipe in skl_pcm_hw_free
Divya Prakash [Mon, 2 Apr 2018 06:45:49 +0000 (12:15 +0530)]
ASoC: Intel: Skylake: Reset DSP pipe in skl_pcm_hw_free

Currently during destroy pipeline the gateway is disabled
before DMA completion. This leads to improper draining of
data and subsequently causing issues on HD-Audio DMA.
Hence added a new pipe reset IPC in skl_pcm_hw_free in
which the Gateway Enable(GEN bit) is reset to 0 after
DMA completion in skl_pcm_trigger.

Signed-off-by: Divya Prakash <divya1.prakash@intel.com>
Signed-off-by: Sriram Periyasamy <sriramx.periyasamy@intel.com>
Signed-off-by: Mark Brown <broonie@kernel.org>
6 years agoASoC: rt1305: fix platform_no_drv_owner.cocci warnings
Fengguang Wu [Mon, 16 Apr 2018 19:41:24 +0000 (03:41 +0800)]
ASoC: rt1305: fix platform_no_drv_owner.cocci warnings

sound/soc/codecs/rt1305.c:1174:3-8: No need to set .owner here. The core will do it.

 Remove .owner field if calls are used which set it automatically

Generated by: scripts/coccinelle/api/platform_no_drv_owner.cocci

Fixes: 29bc643ddd7e ("ASoC: rt1305: Add RT1305/RT1306 amplifier driver")
CC: Shuming Fan <shumingf@realtek.com>
Signed-off-by: Fengguang Wu <fengguang.wu@intel.com>
Signed-off-by: Mark Brown <broonie@kernel.org>
6 years agoASoC: rt1305: fix ACPI_PTR compile error
Shuming Fan [Tue, 17 Apr 2018 02:08:02 +0000 (10:08 +0800)]
ASoC: rt1305: fix ACPI_PTR compile error

This patch added <linux/acpi.h> header

Reported-by: Stephen Rothwell <sfr@canb.auug.org.au>
Signed-off-by: Shuming Fan <shumingf@realtek.com>
Signed-off-by: Mark Brown <broonie@kernel.org>
6 years agoASoC: topology: Modify clock gating parameter parsing to switch
Kirill Marinushkin [Mon, 16 Apr 2018 17:56:44 +0000 (19:56 +0200)]
ASoC: topology: Modify clock gating parameter parsing to switch

This improves the coding style of this piece of code.

Signed-off-by: Kirill Marinushkin <k.marinushkin@gmail.com>
Cc: Mark Brown <broonie@kernel.org>
Cc: Pierre-Louis Bossart <pierre-louis.bossart@linux.intel.com>
Cc: Jaroslav Kysela <perex@perex.cz>
Cc: Takashi Iwai <tiwai@suse.de>
Cc: Pan Xiuli <xiuli.pan@linux.intel.com>
Cc: Liam Girdwood <liam.r.girdwood@linux.intel.com>
Cc: linux-kernel@vger.kernel.org
Cc: alsa-devel@alsa-project.org
Signed-off-by: Mark Brown <broonie@kernel.org>
6 years agoASoC: rt5668: add rt5668B codec driver
Bard Liao [Thu, 22 Mar 2018 06:12:33 +0000 (14:12 +0800)]
ASoC: rt5668: add rt5668B codec driver

This is the initial codec driver for rt5668b.

Signed-off-by: Bard Liao <bardliao@realtek.com>
Signed-off-by: Mark Brown <broonie@kernel.org>
6 years agoASoC: rt1305: Add RT1305/RT1306 amplifier driver
Shuming Fan [Thu, 29 Mar 2018 12:05:14 +0000 (20:05 +0800)]
ASoC: rt1305: Add RT1305/RT1306 amplifier driver

This is the initial amplifier driver for rt1305/rt1306.

Signed-off-by: Shuming Fan <shumingf@realtek.com>
Signed-off-by: Mark Brown <broonie@kernel.org>
6 years agoASoC: amd: acp-da7219-max98357: Make symbol da7219_dai_clk static
Wei Yongjun [Thu, 29 Mar 2018 02:14:03 +0000 (02:14 +0000)]
ASoC: amd: acp-da7219-max98357: Make symbol da7219_dai_clk static

Fixes the following sparse warning:

sound/soc/amd/acp-da7219-max98357a.c:46:12: warning:
 symbol 'da7219_dai_clk' was not declared. Should it be static?

Signed-off-by: Wei Yongjun <weiyongjun1@huawei.com>
Signed-off-by: Mark Brown <broonie@kernel.org>
6 years agoASoC: amd: acp-da7219-max98357: Make symbol da7219_dai_clk static
Wei Yongjun [Thu, 29 Mar 2018 02:14:03 +0000 (02:14 +0000)]
ASoC: amd: acp-da7219-max98357: Make symbol da7219_dai_clk static

Fixes the following sparse warning:

sound/soc/amd/acp-da7219-max98357a.c:46:12: warning:
 symbol 'da7219_dai_clk' was not declared. Should it be static?

Signed-off-by: Wei Yongjun <weiyongjun1@huawei.com>
Signed-off-by: Mark Brown <broonie@kernel.org>
6 years agoASoC: rt5514: Add the missing register in the readable table
oder_chiou@realtek.com [Fri, 30 Mar 2018 07:41:55 +0000 (15:41 +0800)]
ASoC: rt5514: Add the missing register in the readable table

The patch adds the missing register in the readable table.

Signed-off-by: Oder Chiou <oder_chiou@realtek.com>
Signed-off-by: Mark Brown <broonie@kernel.org>
6 years agoASoC: topology: Add definitions for mclk_direction values
Kirill Marinushkin [Wed, 4 Apr 2018 04:19:39 +0000 (06:19 +0200)]
ASoC: topology: Add definitions for mclk_direction values

Current comment makes not clear the direction of mclk. Previously, similar
description caused a misunderstanding for bclk_master and fsync_master.

This commit solves the potential confusion the same way it is solved for
bclk_master and fsync_master.

Signed-off-by: Kirill Marinushkin <k.marinushkin@gmail.com>
Acked-by: Pierre-Louis Bossart <pierre-louis.bossart@linux.intel.com>
Cc: Jaroslav Kysela <perex@perex.cz>
Cc: Takashi Iwai <tiwai@suse.de>
Cc: Mark Brown <broonie@kernel.org>
Cc: Pan Xiuli <xiuli.pan@linux.intel.com>
Cc: Liam Girdwood <liam.r.girdwood@linux.intel.com>
Cc: linux-kernel@vger.kernel.org
Cc: alsa-devel@alsa-project.org
Signed-off-by: Mark Brown <broonie@kernel.org>
6 years agoASoC: topology: Add missing clock gating parameter when parsing hw_configs
Kirill Marinushkin [Wed, 4 Apr 2018 04:19:38 +0000 (06:19 +0200)]
ASoC: topology: Add missing clock gating parameter when parsing hw_configs

Clock gating parameter is a part of `dai_fmt`. It is supported by
`alsa-lib` when creating a topology binary file, but ignored by kernel
when loading this topology file.

After applying this commit, the clock gating parameter is not ignored any
more. This solution is backwards compatible. The existing behaviour is
not broken, because by default the parameter value is 0 and is ignored.

snd_soc_tplg_hw_config.clock_gated = 0 => no effect
snd_soc_tplg_hw_config.clock_gated = 1 => SND_SOC_DAIFMT_GATED
snd_soc_tplg_hw_config.clock_gated = 2 => SND_SOC_DAIFMT_CONT

For example, the following config, based on
alsa-lib/src/conf/topology/broadwell/broadwell.conf, is now supported:

~~~~
SectionHWConfig."CodecHWConfig" {
        id "1"
        format "I2S"            # physical audio format.
        pm_gate_clocks "true"   # clock can be gated
}

SectionLink."Codec" {

        # used for binding to the physical link
        id "0"

        hw_configs [
                "CodecHWConfig"
        ]

        default_hw_conf_id "1"
}
~~~~

Signed-off-by: Kirill Marinushkin <k.marinushkin@gmail.com>
Reviewed-by: Pierre-Louis Bossart <pierre-louis.bossart@linux.intel.com>
Cc: Jaroslav Kysela <perex@perex.cz>
Cc: Takashi Iwai <tiwai@suse.de>
Cc: Mark Brown <broonie@kernel.org>
Cc: Pan Xiuli <xiuli.pan@linux.intel.com>
Cc: Liam Girdwood <liam.r.girdwood@linux.intel.com>
Cc: linux-kernel@vger.kernel.org
Cc: alsa-devel@alsa-project.org
Signed-off-by: Mark Brown <broonie@kernel.org>
6 years agoASoC: topology: Fix bclk and fsync inversion in set_link_hw_format()
Kirill Marinushkin [Wed, 4 Apr 2018 04:19:37 +0000 (06:19 +0200)]
ASoC: topology: Fix bclk and fsync inversion in set_link_hw_format()

The values of bclk and fsync are inverted WRT the codec. But the existing
solution already works for Broadwell, see the alsa-lib config:

`alsa-lib/src/conf/topology/broadwell/broadwell.conf`

This commit provides the backwards-compatible solution to fix this misuse.

Signed-off-by: Kirill Marinushkin <k.marinushkin@gmail.com>
Reviewed-by: Pierre-Louis Bossart <pierre-louis.bossart@linux.intel.com>
Tested-by: Pan Xiuli <xiuli.pan@linux.intel.com>
Tested-by: Pierre-Louis Bossart <pierre-louis.bossart@linux.intel.com>
Cc: Jaroslav Kysela <perex@perex.cz>
Cc: Takashi Iwai <tiwai@suse.de>
Cc: Mark Brown <broonie@kernel.org>
Cc: Liam Girdwood <liam.r.girdwood@linux.intel.com>
Cc: linux-kernel@vger.kernel.org
Cc: alsa-devel@alsa-project.org
Signed-off-by: Mark Brown <broonie@kernel.org>
6 years agoASoC: fsl_esai: Add freq check in set_dai_sysclk()
Nicolin Chen [Mon, 9 Apr 2018 00:33:54 +0000 (17:33 -0700)]
ASoC: fsl_esai: Add freq check in set_dai_sysclk()

The freq parameter indicates the physical frequency of an actual
input clock or a desired frequency of an output clock for HCKT/R.
It should never be passed 0. This might cause Division-by-zero.

So this patch adds a check to fix it.

Signed-off-by: Nicolin Chen <nicoleotsuka@gmail.com>
Reviewed-by: Fabio Estevam <fabio.estevam@nxp.com>
Signed-off-by: Mark Brown <broonie@kernel.org>
6 years agoASoC: adau17x1: Do not reload dsp-fw if samplerate has not changed
Danny Smith [Mon, 9 Apr 2018 13:13:36 +0000 (15:13 +0200)]
ASoC: adau17x1: Do not reload dsp-fw if samplerate has not changed

Reloading fw causes an audiable popping sound, we can avoid this
by not reloading if the samplerate is the same as before.

Signed-off-by: Danny Smith <dannys@axis.com>
Signed-off-by: Robert Rosengren <robert.rosengren@axis.com>
Acked-by: Lars-Peter Clausen <lars@metafoo.de>
Signed-off-by: Mark Brown <broonie@kernel.org>
6 years agoMerge branch 'asoc-4.17' into asoc-4.18 to get adau17x1 changes so
Mark Brown [Mon, 16 Apr 2018 11:58:21 +0000 (12:58 +0100)]
Merge branch 'asoc-4.17' into asoc-4.18 to get adau17x1 changes so
further patches can be applied.

6 years agoASoC: rsnd: ssi: wait maximum 5ms for status check
Kuninori Morimoto [Mon, 16 Apr 2018 00:38:13 +0000 (00:38 +0000)]
ASoC: rsnd: ssi: wait maximum 5ms for status check

It is waiting udelay(50) x 1024 (= 50ms) for status check
in worst case, but it is overkill.
And we shouldn't use udelay() for 50us
(linux/Documentation/timers/timers-howto.txt)

Waiting maximum udelay(5) x 1024 (= 5ms) is very enough
for status check.
This patch fixes these issue.

Reported-by: Hiromitsu Yamasaki <hiromitsu.yamasaki.ym@renesas.com>
Signed-off-by: Kuninori Morimoto <kuninori.morimoto.gx@renesas.com>
Signed-off-by: Mark Brown <broonie@kernel.org>
6 years agoASoC: rsnd: Enable IPMMU v2
Kuninori Morimoto [Mon, 16 Apr 2018 05:14:01 +0000 (05:14 +0000)]
ASoC: rsnd: Enable IPMMU v2

commit 4821d914fe747 ("ASoC: rsnd: use dma_sync_single_for_xxx() for
IOMMU") (= v1) which have been already reverted had supported IPMMU
support on rsnd driver.
Because memory allocating timing and DMAEngine access timing were
different, it used continuous memory and called dma map function by
itself.

OTOH, it is using DMA descriptor mode (= DMA cyclic mode), thus, there
was timing conflict between DMA sync/unsync and DMA transfer starting,
and it maked sound noise.

This patch supports IPMMU with coherent memory, and, it uses Audio DMAC
dev for allocating memory by snd_pcm_lib_preallocate_pages_for_all() to
indicate memory area to IPMMU.
One note is that Playback/Capture need each paired Audio DMAC dev.
Because of this, we need to keep each paired Audio DMAC dev when probing,
and use it when allocating each memory for IPMMU.

Signed-off-by: Kuninori Morimoto <kuninori.morimoto.gx@renesas.com>
Tested-by: Hiroyuki Yokoyama <hiroyuki.yokoyama.vx@renesas.com>
Signed-off-by: Mark Brown <broonie@kernel.org>
6 years agoASoC: max9860: switch to SPDX license tag
Peter Rosin [Fri, 13 Apr 2018 11:47:50 +0000 (13:47 +0200)]
ASoC: max9860: switch to SPDX license tag

It's less overhead, clearer and generally neater.

Signed-off-by: Peter Rosin <peda@axentia.se>
Signed-off-by: Mark Brown <broonie@kernel.org>
6 years agoASoC: AMD: Support headset button on Stoney DA7219
Agrawal, Akshu [Thu, 12 Apr 2018 09:57:11 +0000 (17:57 +0800)]
ASoC: AMD: Support headset button on Stoney DA7219

Adds headset button support.

TEST=Tested Volume UP/Down, Play/Pause functionality

Signed-off-by: Akshu Agrawal <akshu.agrawal@amd.com>
Reviewed-by: Daniel Kurtz <djkurtz@chromium.org>
Signed-off-by: Mark Brown <broonie@kernel.org>
6 years agoASoC: tfa9879: switch to SPDX license tag
Peter Rosin [Fri, 13 Apr 2018 11:47:51 +0000 (13:47 +0200)]
ASoC: tfa9879: switch to SPDX license tag

It's less overhead, clearer and generally neater.

Signed-off-by: Peter Rosin <peda@axentia.se>
Signed-off-by: Mark Brown <broonie@kernel.org>
6 years agoASoC: rsnd: don't assume node full path name for HDMI probing
Kuninori Morimoto [Wed, 11 Apr 2018 02:10:45 +0000 (02:10 +0000)]
ASoC: rsnd: don't assume node full path name for HDMI probing

Current ssi.c is assuming below 2 things to probing HDMI node.
1) remote node is including "hdmi0" or "hdmi1" in node name
2) remote_ep->full_name is including full path name

But, these assumptions are broken by below
1) Node names should not use numerical suffixes
 commit 6b5ac2f1cb11 ("arm64: dts: renesas: r8a7795: Drop bogus HDMI
                       node names suffixes")
2) node full_name no longer include full path name
 commit a7e4cfb0a7ca ("of/fdt: only store the device node basename
                       in full_name")

Because of these reasons, ssi.c can't probe HDMI on current kernel.
This patch probes HDMI0/1 by using its address.
Note is that we need to keep updating for this address for future
generation chip.

Signed-off-by: Kuninori Morimoto <kuninori.morimoto.gx@renesas.com>
Tested-by: Nguyen Viet Dung <dung.nguyen.aj@renesas.com>
Signed-off-by: Mark Brown <broonie@kernel.org>
6 years agoASoC: rsnd: add RSND_GEN3 for R-Car Gen3
Kuninori Morimoto [Wed, 11 Apr 2018 02:10:29 +0000 (02:10 +0000)]
ASoC: rsnd: add RSND_GEN3 for R-Car Gen3

rsnd driver is supporting Gen3. The difference between Gen1 and Gen2
were very big, but, between Gen2 and Gen3 are not so much.
Thus, it is assuming Gen2 and Gen3 have compatible, therefore,
there is no RSND_GEN3 and rsnd_is_gen3() macro.
But in the future, it will need Gen2 and Gen3 different operation,
and for Gen4.
This patch adds missing RSND_GEN3 and rsnd_is_gen3() macro.

Signed-off-by: Kuninori Morimoto <kuninori.morimoto.gx@renesas.com>
Tested-by: Nguyen Viet Dung <dung.nguyen.aj@renesas.com>
Signed-off-by: Mark Brown <broonie@kernel.org>
6 years agoASoC: tfa9879: switch to using .probe_new
Peter Rosin [Thu, 12 Apr 2018 21:14:37 +0000 (23:14 +0200)]
ASoC: tfa9879: switch to using .probe_new

Use the new probe style for i2c drivers.

Signed-off-by: Peter Rosin <peda@axentia.se>
Signed-off-by: Mark Brown <broonie@kernel.org>
6 years agoASoC: tfa9879: fix whitespace issues caused by mindless conversion
Peter Rosin [Thu, 12 Apr 2018 21:14:34 +0000 (23:14 +0200)]
ASoC: tfa9879: fix whitespace issues caused by mindless conversion

Long lines and bad alignment disturbs the reading pleasure.

Signed-off-by: Peter Rosin <peda@axentia.se>
Signed-off-by: Mark Brown <broonie@kernel.org>
6 years agoASoC: max9860: fix whitespace issues caused by mindless conversion
Peter Rosin [Thu, 12 Apr 2018 21:14:33 +0000 (23:14 +0200)]
ASoC: max9860: fix whitespace issues caused by mindless conversion

Long lines and bad alignment disturbs the reading pleasure.

Signed-off-by: Peter Rosin <peda@axentia.se>
Signed-off-by: Mark Brown <broonie@kernel.org>
6 years agoASoC: TSCS42xx: Add CCF support to get sysclk
Steven Eckhoff [Wed, 4 Apr 2018 21:49:52 +0000 (16:49 -0500)]
ASoC: TSCS42xx: Add CCF support to get sysclk

The TSCS42xx relies on set_sysclk to get a unique clock id and rate,
which prevents it from being used with the simple-card.

Remove set_sysclk callback
Add CCF support to get clock id and rate
Add clocks and clock-names to device tree binding

Signed-off-by: Steven Eckhoff <steven.eckhoff.opensource@gmail.com>
Signed-off-by: Mark Brown <broonie@kernel.org>
6 years agoASoC: TSCS42xx: Cleanup private data members
Steven Eckhoff [Wed, 4 Apr 2018 21:49:51 +0000 (16:49 -0500)]
ASoC: TSCS42xx: Cleanup private data members

Remove blrcm from private data
Remove dev from private data

Signed-off-by: Steven Eckhoff <steven.eckhoff.opensource@gmail.com>
Signed-off-by: Mark Brown <broonie@kernel.org>
6 years agoASoC: TSCS42xx: Shorten lines and other cleanup
Steven Eckhoff [Wed, 4 Apr 2018 21:49:50 +0000 (16:49 -0500)]
ASoC: TSCS42xx: Shorten lines and other cleanup

Shorten lines greater than 80 chars
Add const to struct snd_soc_component_driver

Signed-off-by: Steven Eckhoff <steven.eckhoff.opensource@gmail.com>
Signed-off-by: Mark Brown <broonie@kernel.org>
6 years agoASoC: rsnd: makes rsnd_cmd_mod_get() static
Kuninori Morimoto [Fri, 6 Apr 2018 05:41:43 +0000 (05:41 +0000)]
ASoC: rsnd: makes rsnd_cmd_mod_get() static

rsnd_cmd_mod_get() is used from cmd.c only.
Let's makes it static function

Signed-off-by: Kuninori Morimoto <kuninori.morimoto.gx@renesas.com>
Signed-off-by: Mark Brown <broonie@kernel.org>
6 years agoASoC: intel: skl_rt286: Replace GFP_ATOMIC with GFP_KERNEL in skylake_audio_probe
Jia-Ju Bai [Mon, 9 Apr 2018 10:49:58 +0000 (18:49 +0800)]
ASoC: intel: skl_rt286: Replace GFP_ATOMIC with GFP_KERNEL in skylake_audio_probe

skylake_audio_probe() is never called in atomic context.
This function is only set as ".probe" in "struct platform_driver".

Despite never getting called from atomic context,
skylake_audio_probe() calls devm_kzalloc() with GFP_ATOMIC,
which waits busily for allocation.
GFP_ATOMIC is not necessary and can be replaced with GFP_KERNEL,
to avoid busy waiting and improve the possibility of sucessful allocation.

This is found by a static analysis tool named DCNS written by myself.

Signed-off-by: Jia-Ju Bai <baijiaju1990@gmail.com>
Signed-off-by: Mark Brown <broonie@kernel.org>