openwrt/staging/blogic.git
5 years agoASoC: meson: add sm1 compatibles
Jerome Brunet [Thu, 5 Sep 2019 12:01:13 +0000 (14:01 +0200)]
ASoC: meson: add sm1 compatibles

Document the compatible strings of the audio devices of the sm1 SoC
family

Signed-off-by: Jerome Brunet <jbrunet@baylibre.com>
Link: https://lore.kernel.org/r/20190905120120.31752-2-jbrunet@baylibre.com
Signed-off-by: Mark Brown <broonie@kernel.org>
5 years agoASoC: qcom: common: Include link-name in error messages
Bjorn Andersson [Thu, 5 Sep 2019 04:03:06 +0000 (21:03 -0700)]
ASoC: qcom: common: Include link-name in error messages

Reading out the link-name earlier and including it in the various error
messages makes it much more convenient to figure out what links have
unmet dependencies.

Signed-off-by: Bjorn Andersson <bjorn.andersson@linaro.org>
Link: https://lore.kernel.org/r/20190905040306.21399-1-bjorn.andersson@linaro.org
Signed-off-by: Mark Brown <broonie@kernel.org>
5 years agoASoC: soc-core: add comment to jack at soc_remove_component()
Kuninori Morimoto [Wed, 4 Sep 2019 00:14:35 +0000 (09:14 +0900)]
ASoC: soc-core: add comment to jack at soc_remove_component()

Basically, driver which setups snd_soc_component_set_jack() need
to release it by themselves. But, as framework level robustness,
soc_remove_component() also releases it.

To avoid code reader confuse, this patch makes it clarify.

This patch makes it clarify.

Signed-off-by: Kuninori Morimoto <kuninori.morimoto.gx@renesas.com>
Link: https://lore.kernel.org/r/875zm8q5n8.wl-kuninori.morimoto.gx@renesas.com
Signed-off-by: Mark Brown <broonie@kernel.org>
5 years agoASoC: tegra: use devm_platform_ioremap_resource() to simplify code
YueHaibing [Wed, 4 Sep 2019 08:39:09 +0000 (16:39 +0800)]
ASoC: tegra: use devm_platform_ioremap_resource() to simplify code

Use devm_platform_ioremap_resource() to simplify the code a bit.
This is detected by coccinelle.

Reported-by: Hulk Robot <hulkci@huawei.com>
Signed-off-by: YueHaibing <yuehaibing@huawei.com>
Link: https://lore.kernel.org/r/20190904083909.18804-1-yuehaibing@huawei.com
Signed-off-by: Mark Brown <broonie@kernel.org>
5 years agoASoC: sirf-audio: use devm_platform_ioremap_resource() to simplify code
YueHaibing [Wed, 4 Sep 2019 08:34:12 +0000 (16:34 +0800)]
ASoC: sirf-audio: use devm_platform_ioremap_resource() to simplify code

Use devm_platform_ioremap_resource() to simplify the code a bit.
This is detected by coccinelle.

Reported-by: Hulk Robot <hulkci@huawei.com>
Signed-off-by: YueHaibing <yuehaibing@huawei.com>
Link: https://lore.kernel.org/r/20190904083412.18700-1-yuehaibing@huawei.com
Signed-off-by: Mark Brown <broonie@kernel.org>
5 years agoASoC: ep93xx: use devm_platform_ioremap_resource() to simplify code
YueHaibing [Wed, 4 Sep 2019 08:25:07 +0000 (16:25 +0800)]
ASoC: ep93xx: use devm_platform_ioremap_resource() to simplify code

Use devm_platform_ioremap_resource() to simplify the code a bit.
This is detected by coccinelle.

Reported-by: Hulk Robot <hulkci@huawei.com>
Signed-off-by: YueHaibing <yuehaibing@huawei.com>
Link: https://lore.kernel.org/r/20190904082507.24300-1-yuehaibing@huawei.com
Signed-off-by: Mark Brown <broonie@kernel.org>
5 years agoASoC: amd: use devm_platform_ioremap_resource() to simplify code
YueHaibing [Wed, 4 Sep 2019 07:48:33 +0000 (15:48 +0800)]
ASoC: amd: use devm_platform_ioremap_resource() to simplify code

Use devm_platform_ioremap_resource() to simplify the code a bit.
This is detected by coccinelle.

Reported-by: Hulk Robot <hulkci@huawei.com>
Signed-off-by: YueHaibing <yuehaibing@huawei.com>
Link: https://lore.kernel.org/r/20190904074833.23572-1-yuehaibing@huawei.com
Signed-off-by: Mark Brown <broonie@kernel.org>
5 years agoASoC: es8316: add clock control of MCLK
Katsuhiro Suzuki [Tue, 3 Sep 2019 16:53:20 +0000 (01:53 +0900)]
ASoC: es8316: add clock control of MCLK

This patch introduce clock property for MCLK master freq control.
Driver will set rate of MCLK master if set_sysclk is called and
changing sysclk by board driver.

[Modified slightly to apply without an earlier patch in the series due
to context diffs -- broonie]

Signed-off-by: Katsuhiro Suzuki <katsuhiro@katsuster.net>
Link: https://lore.kernel.org/r/20190903165322.20791-2-katsuhiro@katsuster.net
Signed-off-by: Mark Brown <broonie@kernel.org>
5 years agoASoC: es8316: add DT-bindings
Katsuhiro Suzuki [Tue, 3 Sep 2019 16:53:22 +0000 (01:53 +0900)]
ASoC: es8316: add DT-bindings

This patch adds missing DT-bindings document for Everest ES8316.

Signed-off-by: Katsuhiro Suzuki <katsuhiro@katsuster.net>
Link: https://lore.kernel.org/r/20190903165322.20791-4-katsuhiro@katsuster.net
Signed-off-by: Mark Brown <broonie@kernel.org>
5 years agoASoC: audio-graph: indicate rebind issue
Kuninori Morimoto [Tue, 3 Sep 2019 08:16:05 +0000 (17:16 +0900)]
ASoC: audio-graph: indicate rebind issue

ALSA SoC try to rebind Sound Card if Card/CPU/Codec/Platform
were unbinded and re-binded again.
But, Audio Graph Card might can't rebind again if user do for example

unbind CPU or Codec driver
bind   CPU or Codec driver

Because Audio Graph Card is still pointing old/unbinded
CPU or Codec driver's DAI name at dlc->dai_name.

To avoid this issue, it needs to alloc memory and keep DAI name
even though if CPU or Codec driver was unbinded.
Or, always do unbind/bind at Sound Card.

For now, this patch indicates this issue as FIXME.

Signed-off-by: Kuninori Morimoto <kuninori.morimoto.gx@renesas.com>
Link: https://lore.kernel.org/r/87sgpdu75m.wl-kuninori.morimoto.gx@renesas.com
Signed-off-by: Mark Brown <broonie@kernel.org>
5 years agoASoC: simple-card: indicate rebind issue
Kuninori Morimoto [Tue, 3 Sep 2019 08:15:54 +0000 (17:15 +0900)]
ASoC: simple-card: indicate rebind issue

ALSA SoC try to rebind Sound Card if Card/CPU/Codec/Platform
were unbinded and re-binded again.
But, Simple Card might can't rebind again if user do for example

unbind CPU or Codec driver
bind   CPU or Codec driver

Because Simple Card is still pointing old/unbinded
CPU or Codec driver's DAI name at dlc->dai_name.

To avoid this issue, it needs to alloc memory and keep DAI name
even though if CPU or Codec driver was unbinded.
Or, always do unbind/bind at Sound Card.

For now, this patch indicates this issue as FIXME.

Signed-off-by: Kuninori Morimoto <kuninori.morimoto.gx@renesas.com>
Link: https://lore.kernel.org/r/87tv9tu75x.wl-kuninori.morimoto.gx@renesas.com
Signed-off-by: Mark Brown <broonie@kernel.org>
5 years agoASoC: soc-core: move soc_probe_link_components() position
Kuninori Morimoto [Fri, 23 Aug 2019 00:58:58 +0000 (09:58 +0900)]
ASoC: soc-core: move soc_probe_link_components() position

It is easy to read code if it is cleanly using paired function/naming,
like start <-> stop, register <-> unregister, etc, etc.
But, current ALSA SoC code is very random, unbalance, not paired, etc.
It is easy to create bug at the such code, and it will be difficult to
debug.

soc_probe_link_components() has paired soc_remove_link_components(),
but, these are implemented at different place.
So it is difficult to confirm code.
This patch moves soc_probe_link_components() next to
soc_remove_link_components().

Signed-off-by: Kuninori Morimoto <kuninori.morimoto.gx@renesas.com>
Link: https://lore.kernel.org/r/87o90g7lbd.wl-kuninori.morimoto.gx@renesas.com
Signed-off-by: Mark Brown <broonie@kernel.org>
5 years agoASoC: soc-core: add snd_soc_dapm_init()
Kuninori Morimoto [Fri, 23 Aug 2019 00:58:52 +0000 (09:58 +0900)]
ASoC: soc-core: add snd_soc_dapm_init()

It is easy to read code if it is cleanly using paired function/naming,
like start <-> stop, register <-> unregister, etc, etc.
But, current ALSA SoC code is very random, unbalance, not paired, etc.
It is easy to create bug at the such code, and it will be difficult to
debug.

soc-dapm has snd_soc_dapm_free() which cleanups debugfs, widgets, list.
But, there is no paired initialize function.
This patch adds snd_soc_dapm_init() and initilaizing dapm

Signed-off-by: Kuninori Morimoto <kuninori.morimoto.gx@renesas.com>
Link: https://lore.kernel.org/r/87pnkw7lbj.wl-kuninori.morimoto.gx@renesas.com
Signed-off-by: Mark Brown <broonie@kernel.org>
5 years agoASoC: soc-core: dapm related setup at one place
Kuninori Morimoto [Fri, 23 Aug 2019 00:58:47 +0000 (09:58 +0900)]
ASoC: soc-core: dapm related setup at one place

Current ASoC setups some dapm related member at
snd_soc_component_initialize() which is called when component was
registered, and setups remaining member at soc_probe_component()
which is called when component was probed.
This kind of setup separation is no meanings, and it is very
difficult to read and confusable.
This patch setups all dapm settings at one place.

Signed-off-by: Kuninori Morimoto <kuninori.morimoto.gx@renesas.com>
Link: https://lore.kernel.org/r/87r25c7lbo.wl-kuninori.morimoto.gx@renesas.com
Signed-off-by: Mark Brown <broonie@kernel.org>
5 years agoASoC: soc-core: move soc_probe_component() position
Kuninori Morimoto [Fri, 23 Aug 2019 00:58:42 +0000 (09:58 +0900)]
ASoC: soc-core: move soc_probe_component() position

It is easy to read code if it is cleanly using paired function/naming,
like start <-> stop, register <-> unregister, etc, etc.
But, current ALSA SoC code is very random, unbalance, not paired, etc.
It is easy to create bug at the such code, and it will be difficult to
debug.

soc_probe_comonent() has paired soc_remove_comonent(),
but, these are implemented at different place.
So it is difficult to confirm code.
This patch moves soc_probe_component() next to
soc_remove_component().

Signed-off-by: Kuninori Morimoto <kuninori.morimoto.gx@renesas.com>
Link: https://lore.kernel.org/r/87sgps7lbt.wl-kuninori.morimoto.gx@renesas.com
Signed-off-by: Mark Brown <broonie@kernel.org>
5 years agoASoC: soc-core: add soc_rtd_free()
Kuninori Morimoto [Fri, 23 Aug 2019 00:58:37 +0000 (09:58 +0900)]
ASoC: soc-core: add soc_rtd_free()

It is easy to read code if it is cleanly using paired function/naming,
like start <-> stop, register <-> unregister, etc, etc.
But, current ALSA SoC code is very random, unbalance, not paired, etc.
It is easy to create bug at the such code, and it will be difficult to
debug.

soc_rtd_init() was soc_post_component_init(), but there was no
its paired soc_post_component_free(), but it is done at
soc_remove_link_dais().
This means it is difficult to find related code.

This patch adds soc_rtd_free() which is paired soc_rtd_init().
soc_rtd_xxx() will be more cleanuped in the future.

Signed-off-by: Kuninori Morimoto <kuninori.morimoto.gx@renesas.com>
Link: https://lore.kernel.org/r/87tva87lby.wl-kuninori.morimoto.gx@renesas.com
Signed-off-by: Mark Brown <broonie@kernel.org>
5 years agoASoC: dt-bindings: Convert Allwinner A64 analog codec to a schema
Maxime Ripard [Wed, 28 Aug 2019 12:52:09 +0000 (14:52 +0200)]
ASoC: dt-bindings: Convert Allwinner A64 analog codec to a schema

The Allwinner A64 SoC has an embedded audio codec that uses a separate
controller to drive its analog part, which is supported in Linux, with a
matching Device Tree binding.

Now that we have the DT validation in place, let's convert the device tree
bindings for that controller over to a YAML schemas.

Signed-off-by: Maxime Ripard <maxime.ripard@bootlin.com>
Link: https://lore.kernel.org/r/20190828125209.28173-5-mripard@kernel.org
Reviewed-by: Rob Herring <robh@kernel.org>
Signed-off-by: Mark Brown <broonie@kernel.org>
5 years agoASoC: dt-bindings: Convert Allwinner A33 codec to a schema
Maxime Ripard [Wed, 28 Aug 2019 12:52:07 +0000 (14:52 +0200)]
ASoC: dt-bindings: Convert Allwinner A33 codec to a schema

The Allwinner A33 SoC have an embedded audio codec that is supported in Linux,
with a matching Device Tree binding.

Now that we have the DT validation in place, let's convert the device tree
bindings for that controller over to a YAML schemas.

Signed-off-by: Maxime Ripard <maxime.ripard@bootlin.com>
Link: https://lore.kernel.org/r/20190828125209.28173-3-mripard@kernel.org
Reviewed-by: Rob Herring <robh@kernel.org>
Signed-off-by: Mark Brown <broonie@kernel.org>
5 years agoASoC: dt-bindings: sun4i-spdif: Fix dma-names warning
Maxime Ripard [Wed, 28 Aug 2019 12:52:05 +0000 (14:52 +0200)]
ASoC: dt-bindings: sun4i-spdif: Fix dma-names warning

Even though the H6 compatible has been properly added, the exeption for the
number of DMA channels hasn't been updated, leading in a validation
warning.

Fix this.

Fixes: b20453031472 ("dt-bindings: sound: sun4i-spdif: Add Allwinner H6 compatible")
Signed-off-by: Maxime Ripard <maxime.ripard@bootlin.com>
Link: https://lore.kernel.org/r/20190828125209.28173-1-mripard@kernel.org
Reviewed-by: Rob Herring <robh@kernel.org>
Signed-off-by: Mark Brown <broonie@kernel.org>
5 years agoASoC: mediatek: mt8183: fix space issues
Tzung-Bi Shih [Fri, 30 Aug 2019 07:42:40 +0000 (15:42 +0800)]
ASoC: mediatek: mt8183: fix space issues

Fix space issues:
- No space before ';'.
- No trailing blank line.

Signed-off-by: Tzung-Bi Shih <tzungbi@google.com>
Link: https://lore.kernel.org/r/20190830074240.195166-5-tzungbi@google.com
Signed-off-by: Mark Brown <broonie@kernel.org>
5 years agoASoC: mediatek: mt8183: remove forward declaration of headset_init
Tzung-Bi Shih [Fri, 30 Aug 2019 07:42:39 +0000 (15:42 +0800)]
ASoC: mediatek: mt8183: remove forward declaration of headset_init

The forward declaration of mt8183_mt6358_ts3a227_max98357_headset_init
is for cyclic dependency between card, headset_dev, and headset_init.

It used to be:
- card depends on headset_dev
- headset_dev depends on headset_init
- headset_init depends on card

Commit a962a809e5e4 ("ASoC: mediatek: mt8183: make headset codec
optional") removed the cyclic dependency.

Thus, it is safe to remove the forward declaration.

Signed-off-by: Tzung-Bi Shih <tzungbi@google.com>
Link: https://lore.kernel.org/r/20190830074240.195166-4-tzungbi@google.com
Signed-off-by: Mark Brown <broonie@kernel.org>
5 years agoASoC: mediatek: mt8183: move headset jack to card-specific storage
Tzung-Bi Shih [Fri, 30 Aug 2019 07:42:38 +0000 (15:42 +0800)]
ASoC: mediatek: mt8183: move headset jack to card-specific storage

Move headset jack descriptor from module global scope to card-specific
storage to make its ownership more explicit.

Signed-off-by: Tzung-Bi Shih <tzungbi@google.com>
Link: https://lore.kernel.org/r/20190830074240.195166-3-tzungbi@google.com
Signed-off-by: Mark Brown <broonie@kernel.org>
5 years agoASoC: mediatek: mt8183: move private structure
Tzung-Bi Shih [Fri, 30 Aug 2019 07:42:37 +0000 (15:42 +0800)]
ASoC: mediatek: mt8183: move private structure

Move private structure to the beginning of file to declare earlier
so that most functions can see it.

Signed-off-by: Tzung-Bi Shih <tzungbi@google.com>
Link: https://lore.kernel.org/r/20190830074240.195166-2-tzungbi@google.com
Signed-off-by: Mark Brown <broonie@kernel.org>
5 years agoASoC: SOF/Intel: fix selection of SND_INTEL_NHTL
Pierre-Louis Bossart [Thu, 29 Aug 2019 21:42:13 +0000 (16:42 -0500)]
ASoC: SOF/Intel: fix selection of SND_INTEL_NHTL

We should only select SND_INTEL_NHLT when ACPI is defined. This was
done for the legacy HDAudio driver but not for DSP-enabled cases,
leading to compilation errors with randconfig.

Fix by aligning on the same solution.

For the Skylake driver this is overkill since there is a top-level
dependency on ACPI, but it doesn't hurt and it's better to have
consistency.

Fixes: 68b953aeb50d9 ('ASoC: SOF: Intel: hda: fixup HDaudio topology name with DMIC number')
Reported-by: Randy Dunlap <rdunlap@infradead.org>
Signed-off-by: Pierre-Louis Bossart <pierre-louis.bossart@linux.intel.com>
Link: https://lore.kernel.org/r/20190829214213.11653-1-pierre-louis.bossart@linux.intel.com
Signed-off-by: Mark Brown <broonie@kernel.org>
5 years agoASoC: Intel: broadwell: Simplify device probe
Cezary Rojewski [Thu, 22 Aug 2019 11:36:16 +0000 (13:36 +0200)]
ASoC: Intel: broadwell: Simplify device probe

With legacy ADSP private context adjusted, there is no need for double
safety.

Signed-off-by: Cezary Rojewski <cezary.rojewski@intel.com>
Link: https://lore.kernel.org/r/20190822113616.22702-5-cezary.rojewski@intel.com
Tested-by: Pierre-Louis Bossart <pierre-louis.bossart@linux.intel.com>
Signed-off-by: Mark Brown <broonie@kernel.org>
5 years agoASoC: Intel: bdw-rt5677: Simplify device probe
Cezary Rojewski [Thu, 22 Aug 2019 11:36:15 +0000 (13:36 +0200)]
ASoC: Intel: bdw-rt5677: Simplify device probe

With legacy ADSP private context adjusted, there is no need for double
safety.

Signed-off-by: Cezary Rojewski <cezary.rojewski@intel.com>
Link: https://lore.kernel.org/r/20190822113616.22702-4-cezary.rojewski@intel.com
Tested-by: Pierre-Louis Bossart <pierre-louis.bossart@linux.intel.com>
Signed-off-by: Mark Brown <broonie@kernel.org>
5 years agoASoC: Intel: haswell: Simplify device probe
Cezary Rojewski [Thu, 22 Aug 2019 11:36:14 +0000 (13:36 +0200)]
ASoC: Intel: haswell: Simplify device probe

With legacy ADSP private context adjusted, there is no need for double
safety.

Signed-off-by: Cezary Rojewski <cezary.rojewski@intel.com>
Link: https://lore.kernel.org/r/20190822113616.22702-3-cezary.rojewski@intel.com
Tested-by: Pierre-Louis Bossart <pierre-louis.bossart@linux.intel.com>
Signed-off-by: Mark Brown <broonie@kernel.org>
5 years agoASoC: Intel: Haswell: Adjust machine device private context
Cezary Rojewski [Thu, 22 Aug 2019 11:36:13 +0000 (13:36 +0200)]
ASoC: Intel: Haswell: Adjust machine device private context

Apart from Haswell machines, all other devices have their private data
set to snd_soc_acpi_mach instance.

Changes for HSW/ BDW boards introduced with series:
https://patchwork.kernel.org/cover/10782035/

added support for dai_link platform_name adjustments within card probe
routines. These take for granted private_data points to
snd_soc_acpi_mach whereas for Haswell, it's sst_pdata instead. Change
private context of platform_device - representing machine board - to
address this.

Fixes: e87055d732e3 ("ASoC: Intel: haswell: platform name fixup support")
Fixes: 7e40ddcf974a ("ASoC: Intel: bdw-rt5677: platform name fixup support")
Fixes: 2d067b2807f9 ("ASoC: Intel: broadwell: platform name fixup support")
Signed-off-by: Cezary Rojewski <cezary.rojewski@intel.com>
Link: https://lore.kernel.org/r/20190822113616.22702-2-cezary.rojewski@intel.com
Tested-by: Pierre-Louis Bossart <pierre-louis.bossart@linux.intel.com>
Signed-off-by: Mark Brown <broonie@kernel.org>
5 years agoASoC: ti: davinci-evm: Do not fail if the dai_set_sysclk returns -ENOTSUPP
Peter Ujfalusi [Fri, 30 Aug 2019 10:38:41 +0000 (13:38 +0300)]
ASoC: ti: davinci-evm: Do not fail if the dai_set_sysclk returns -ENOTSUPP

The davinci McBSP (davinci-i2s) driver does not implement the set_sysclk
callback, which is fine and should not be treated as error.

Signed-off-by: Peter Ujfalusi <peter.ujfalusi@ti.com>
Link: https://lore.kernel.org/r/20190830103841.25128-5-peter.ujfalusi@ti.com
Signed-off-by: Mark Brown <broonie@kernel.org>
5 years agoASoC: ti: edma-pcm: Fix for legacy dma_slave_map based channel lookup
Peter Ujfalusi [Fri, 30 Aug 2019 10:38:40 +0000 (13:38 +0300)]
ASoC: ti: edma-pcm: Fix for legacy dma_slave_map based channel lookup

Most of the daVinci devices does not boot with DT. In this case the DMA
channel is looked up with dma_slave_map and for that the chan_names[]
must be configured.

Both McASP and ASP/McBSP uses "tx" and "rx" as channel names, so we can
just do this when the dev->of_node is not valid.

Signed-off-by: Peter Ujfalusi <peter.ujfalusi@ti.com>
Link: https://lore.kernel.org/r/20190830103841.25128-4-peter.ujfalusi@ti.com
Signed-off-by: Mark Brown <broonie@kernel.org>
5 years agoASoC: ti: davinci-i2s: Add S32_LE as support format
Peter Ujfalusi [Fri, 30 Aug 2019 10:38:38 +0000 (13:38 +0300)]
ASoC: ti: davinci-i2s: Add S32_LE as support format

ASP/McBSP can support 8/16/20/24/32 bits word in theory. I have only tested
S16_LE and S32_LE, the other formats might not work so only extend the
supported formats with S32_LE for now.

Signed-off-by: Peter Ujfalusi <peter.ujfalusi@ti.com>
Link: https://lore.kernel.org/r/20190830103841.25128-2-peter.ujfalusi@ti.com
Signed-off-by: Mark Brown <broonie@kernel.org>
5 years agoASoC: wcd9335: Fix primary interpolator max rate
Srinivas Kandagatla [Thu, 22 Aug 2019 09:56:51 +0000 (10:56 +0100)]
ASoC: wcd9335: Fix primary interpolator max rate

On this codec SLIMBus RX path supports 384000 rate on primary interpolator.
Add this missing rate as supported rate.

Signed-off-by: Srinivas Kandagatla <srinivas.kandagatla@linaro.org>
Link: https://lore.kernel.org/r/20190822095653.7200-3-srinivas.kandagatla@linaro.org
Signed-off-by: Mark Brown <broonie@kernel.org>
5 years agoALSA: pcm: add support for 352.8KHz and 384KHz sample rate
Vidyakumar Athota [Thu, 22 Aug 2019 09:56:50 +0000 (10:56 +0100)]
ALSA: pcm: add support for 352.8KHz and 384KHz sample rate

Most of the modern codecs supports 352.8KHz and 384KHz sample rates.
Currenlty HW params fails to set 352.8Kz and 384KHz sample rate
as these are not in known rates list.
Add these new rates to known list to allow them.

This patch also adds defines in pcm.h so that drivers can use it.

Signed-off-by: Vidyakumar Athota <vathota@codeaurora.org>
Signed-off-by: Banajit Goswami <bgoswami@codeaurora.org>
Signed-off-by: Srinivas Kandagatla <srinivas.kandagatla@linaro.org>
Link: https://lore.kernel.org/r/20190822095653.7200-2-srinivas.kandagatla@linaro.org
Signed-off-by: Mark Brown <broonie@kernel.org>
5 years agoASoC: mediatek: mt8183: fix tdm out data is valid on rising edge
Jiaxin Yu [Sat, 24 Aug 2019 04:37:25 +0000 (12:37 +0800)]
ASoC: mediatek: mt8183: fix tdm out data is valid on rising edge

This patch correct tdm out bck inverse register to AUDIO_TOP_CON3[3].

Signed-off-by: Jiaxin Yu <jiaxin.yu@mediatek.com>
Link: https://lore.kernel.org/r/1566621445-26989-4-git-send-email-jiaxin.yu@mediatek.com
Signed-off-by: Mark Brown <broonie@kernel.org>
5 years agoASoC: mediatek: mt8183: tdm hw support tdm out and 8ch i2s out
Jiaxin Yu [Sat, 24 Aug 2019 04:37:24 +0000 (12:37 +0800)]
ASoC: mediatek: mt8183: tdm hw support tdm out and 8ch i2s out

This patch refined tdm driver code, and allow tdm hw to support two
configurations in machine driver to output tdm signal or i2s signal.

Signed-off-by: Jiaxin Yu <jiaxin.yu@mediatek.com>
Link: https://lore.kernel.org/r/1566621445-26989-3-git-send-email-jiaxin.yu@mediatek.com
Signed-off-by: Mark Brown <broonie@kernel.org>
5 years agoASoC: atmel_ssc_dai: implement left-justified data mode
Michał Mirosław [Sat, 24 Aug 2019 20:26:54 +0000 (22:26 +0200)]
ASoC: atmel_ssc_dai: implement left-justified data mode

Enable support for left-justified data mode for SSC-codec link.

Signed-off-by: Michał Mirosław <mirq-linux@rere.qmqm.pl>
Reviewed-by: Codrin Ciubotariu <codrin.ciubotariu@microchip.com>
Link: https://lore.kernel.org/r/44fa6b700421e80778f20ff9ead2b148cf6d2e92.1566677788.git.mirq-linux@rere.qmqm.pl
Signed-off-by: Mark Brown <broonie@kernel.org>
5 years agoASoC: atmel_ssc_dai: rework DAI format configuration
Michał Mirosław [Sat, 24 Aug 2019 20:26:53 +0000 (22:26 +0200)]
ASoC: atmel_ssc_dai: rework DAI format configuration

Rework DAI format calculation in preparation for adding more formats
later. As a side-effect this enables all CBM/CBS x CFM/CFS combinations
for supported formats. (Note: the additional modes are not tested.)

Note: this changes FSEDGE to POSITIVE for I2S CBM_CFS mode as the TXSYN
interrupt is not used anyway.

Signed-off-by: Michał Mirosław <mirq-linux@rere.qmqm.pl>
Link: https://lore.kernel.org/r/f5949b0326fdcdca072f3ed03f77de9e207631cd.1566677788.git.mirq-linux@rere.qmqm.pl
Signed-off-by: Mark Brown <broonie@kernel.org>
5 years agoASoC: atmel: enable SOC_SSC_PDC and SOC_SSC_DMA in Kconfig
Michał Mirosław [Sat, 24 Aug 2019 20:26:52 +0000 (22:26 +0200)]
ASoC: atmel: enable SOC_SSC_PDC and SOC_SSC_DMA in Kconfig

Allow SSC to be used on platforms described using audio-graph-card
in Device Tree.

Signed-off-by: Michał Mirosław <mirq-linux@rere.qmqm.pl>
Reviewed-by: Codrin Ciubotariu <codrin.ciubotariu@microchip.com>
Acked-by: Alexandre Belloni <alexandre.belloni@bootlin.com>
Link: https://lore.kernel.org/r/233d5461f4448df151755de7b69a0cd3ad310d5c.1566677788.git.mirq-linux@rere.qmqm.pl
Signed-off-by: Mark Brown <broonie@kernel.org>
5 years agoASoC: cs42xx8: Force suspend/resume during system suspend/resume
Shengjiu Wang [Tue, 27 Aug 2019 22:13:46 +0000 (18:13 -0400)]
ASoC: cs42xx8: Force suspend/resume during system suspend/resume

Use force_suspend/resume to make sure clocks are disabled/enabled
accordingly during system suspend/resume.

Signed-off-by: Dong Aisheng <aisheng.dong@nxp.com>
Signed-off-by: Shengjiu Wang <shengjiu.wang@nxp.com>
Reviewed-by: Daniel Baluta <daniel.baluta@nxp.com>
Link: https://lore.kernel.org/r/1566944026-18113-1-git-send-email-shengjiu.wang@nxp.com
Signed-off-by: Mark Brown <broonie@kernel.org>
5 years agoASoC: Intel: Skylake: Release topology when we are done with it
Amadeusz Sławiński [Tue, 27 Aug 2019 14:17:11 +0000 (16:17 +0200)]
ASoC: Intel: Skylake: Release topology when we are done with it

Currently topology is kept in memory while driver is running. It's
unnecessary, as it's only needed during parsing.

Signed-off-by: Amadeusz Sławiński <amadeuszx.slawinski@linux.intel.com>
Link: https://lore.kernel.org/r/20190827141712.21015-6-amadeuszx.slawinski@linux.intel.com
Reviewed-by: Pierre-Louis Bossart <pierre-louis.bossart@linux.intel.com>
Signed-off-by: Mark Brown <broonie@kernel.org>
5 years agoASoC: Intel: Skylake: Print module type instead of id
Amadeusz Sławiński [Tue, 27 Aug 2019 14:17:10 +0000 (16:17 +0200)]
ASoC: Intel: Skylake: Print module type instead of id

When we are printing module params, we were actually printing module id
instead of type, but debug message was saying that number we get is type.
So print module type, as it is useful when debugging paths, but also
keep printing module id, as it is used in all other logs.

Signed-off-by: Amadeusz Sławiński <amadeuszx.slawinski@intel.com>
Link: https://lore.kernel.org/r/20190827141712.21015-5-amadeuszx.slawinski@linux.intel.com
Reviewed-by: Pierre-Louis Bossart <pierre-louis.bossart@linux.intel.com>
Signed-off-by: Mark Brown <broonie@kernel.org>
5 years agoASoC: SOF: imx8: Fix an is IS_ERR() vs NULL check
Dan Carpenter [Mon, 26 Aug 2019 13:18:55 +0000 (16:18 +0300)]
ASoC: SOF: imx8: Fix an is IS_ERR() vs NULL check

The device_link_add() function only returns NULL on error, it doesn't
return error pointers.

Fixes: 202acc565a1f ("ASoC: SOF: imx: Add i.MX8 HW support")
Signed-off-by: Dan Carpenter <dan.carpenter@oracle.com>
Reviewed-by: Daniel Baluta <daniel.baluta@nxp.com>
Link: https://lore.kernel.org/r/20190826131855.GA6840@mwanda
Signed-off-by: Mark Brown <broonie@kernel.org>
5 years agoASoC: sun4i: Revert A83t description
Maxime Ripard [Tue, 27 Aug 2019 12:31:31 +0000 (14:31 +0200)]
ASoC: sun4i: Revert A83t description

The last set of reworks included some fixes to change the A83t behaviour
and "fix" it.

It turns out that the controller described in the datasheet and the one
supported here are not the same, yet the A83t has the two of them, and the
one supported in the driver wasn't the one described in the datasheet.

Fix this by reintroducing the proper quirks.

Fixes: 69e450e50ca6 ("ASoC: sun4i-i2s: Fix the LRCK period on A83t")
Fixes: bf943d527987 ("ASoC: sun4i-i2s: Fix MCLK Enable bit offset on A83t")
Fixes: 2e04fc4dbf50 ("ASoC: sun4i-i2s: Fix WSS and SR fields for the A83t")
Fixes: 515fcfbc7736 ("ASoC: sun4i-i2s: Fix LRCK and BCLK polarity offsets on newer SoCs")
Fixes: c1d3a921d72b ("ASoC: sun4i-i2s: Fix the MCLK and BCLK dividers on newer SoCs")
Fixes: fb19739d7f68 ("ASoC: sun4i-i2s: Use module clock as BCLK parent on newer SoCs")
Fixes: 71137bcd0a9a ("ASoC: sun4i-i2s: Move the format configuration to a callback")
Fixes: d70be625f25a ("ASoC: sun4i-i2s: Move the channel configuration to a callback")
Reported-by: Chen-Yu Tsai <wens@csie.org>
Tested-by: Chen-Yu Tsai <wens@csie.org>
Signed-off-by: Maxime Ripard <maxime.ripard@bootlin.com>
Link: https://lore.kernel.org/r/20190827123131.29129-2-mripard@kernel.org
Signed-off-by: Mark Brown <broonie@kernel.org>
5 years agoASoC: SOF: imx8: Fix return value check in imx8_probe()
Wei Yongjun [Mon, 26 Aug 2019 12:00:03 +0000 (12:00 +0000)]
ASoC: SOF: imx8: Fix return value check in imx8_probe()

In case of error, the function devm_ioremap_wc() returns NULL pointer
not ERR_PTR(). The IS_ERR() test in the return value check should be
replaced with NULL test.

Fixes: 202acc565a1f ("ASoC: SOF: imx: Add i.MX8 HW support")
Signed-off-by: Wei Yongjun <weiyongjun1@huawei.com>
Reviewed-by: Daniel Baluta <daniel.baluta@nxp.com>
Link: https://lore.kernel.org/r/20190826120003.183279-1-weiyongjun1@huawei.com
Signed-off-by: Mark Brown <broonie@kernel.org>
5 years agoASoC: mediatek: mt8183: remove unused DAPM-related variables
Tzung-Bi Shih [Mon, 26 Aug 2019 03:26:42 +0000 (11:26 +0800)]
ASoC: mediatek: mt8183: remove unused DAPM-related variables

Remove unused variable mt8183_mt6358_ts3a227_max98357_dapm_widgets and
mt8183_mt6358_ts3a227_max98357_dapm_routes.  They are accidentially
included when rebasing commits.

Fixes: 6191cbde5ff0 ("ASoC: mediatek: mt8183: switch tdm pins gpio function when playback on or off")
Signed-off-by: Tzung-Bi Shih <tzungbi@google.com>
Link: https://lore.kernel.org/r/20190826032642.27324-1-tzungbi@google.com
Signed-off-by: Mark Brown <broonie@kernel.org>
5 years agoASoC: sunxi: Revert initial A83t support
Maxime Ripard [Tue, 27 Aug 2019 09:32:05 +0000 (11:32 +0200)]
ASoC: sunxi: Revert initial A83t support

This reverts commit 3e9acd7ac6933c (ASoC: sun4i-i2s: Remove
duplicated quirks structure").

It turns out that while one I2S controller is described in the A83t
datasheet, the driver supports another, undocumented, one that has been
inherited from the older SoCs, while the documented one uses the new
design.

Fixes: 3e9acd7ac693 ("ASoC: sun4i-i2s: Remove duplicated quirks structure")
Signed-off-by: Maxime Ripard <maxime.ripard@bootlin.com>
Link: https://lore.kernel.org/r/20190827093206.17919-1-mripard@kernel.org
Signed-off-by: Mark Brown <broonie@kernel.org>
5 years agoASoC: imx-audmix: register the card on a proper dev
Shengjiu Wang [Tue, 27 Aug 2019 15:55:15 +0000 (11:55 -0400)]
ASoC: imx-audmix: register the card on a proper dev

This platform device is registered from "fsl_audmix", which is
its parent device. If use pdev->dev.parent for the priv->card.dev,
the value set by dev_set_drvdata in parent device will be covered
by the value in child device.

Fixes: b86ef5367761 ("ASoC: fsl: Add Audio Mixer machine driver")
Signed-off-by: Viorel Suman <viorel.suman@nxp.com>
Signed-off-by: Shengjiu Wang <shengjiu.wang@nxp.com>
Reviewed-by: Daniel Baluta <daniel.baluta@nxp.com>
Link: https://lore.kernel.org/r/1566921315-23402-1-git-send-email-shengjiu.wang@nxp.com
Signed-off-by: Mark Brown <broonie@kernel.org>
5 years agoASoC: SOF: imx8: Make some functions static
YueHaibing [Fri, 23 Aug 2019 12:59:39 +0000 (20:59 +0800)]
ASoC: SOF: imx8: Make some functions static

Fix sparse warnings:

sound/soc/sof/imx/imx8.c:104:6: warning: symbol 'imx8_dsp_handle_reply' was not declared. Should it be static?
sound/soc/sof/imx/imx8.c:115:6: warning: symbol 'imx8_dsp_handle_request' was not declared. Should it be static?
sound/soc/sof/imx/imx8.c:336:5: warning: symbol 'imx8_get_bar_index' was not declared. Should it be static?
sound/soc/sof/imx/imx8.c:341:6: warning: symbol 'imx8_ipc_msg_data' was not declared. Should it be static?
sound/soc/sof/imx/imx8.c:348:5: warning: symbol 'imx8_ipc_pcm_params' was not declared. Should it be static?

Reported-by: Hulk Robot <hulkci@huawei.com>
Signed-off-by: YueHaibing <yuehaibing@huawei.com>
Reviewed-by: Daniel Baluta <daniel.baluta@nxp.com>
Link: https://lore.kernel.org/r/20190823125939.30012-1-yuehaibing@huawei.com
Signed-off-by: Mark Brown <broonie@kernel.org>
5 years agoASoC: soc-core: rename soc_post_component_init() to soc_rtd_init()
Kuninori Morimoto [Fri, 23 Aug 2019 00:58:32 +0000 (09:58 +0900)]
ASoC: soc-core: rename soc_post_component_init() to soc_rtd_init()

It is easy to read code if it is cleanly using paired function/naming,
like start <-> stop, register <-> unregister, etc, etc.
But, current ALSA SoC code is very random, unbalance, not paired, etc.
It is easy to create bug at the such code, and it will be difficult to
debug.

From function name point of view, "soc_post_component_init()" sounds
like "component initialize function".
But in reality it is rtd setup function.

This patch renames soc_post_component_init() to soc_rtd_init()

Signed-off-by: Kuninori Morimoto <kuninori.morimoto.gx@renesas.com>
Link: https://lore.kernel.org/r/87v9uo7lc3.wl-kuninori.morimoto.gx@renesas.com
Signed-off-by: Mark Brown <broonie@kernel.org>
5 years agoASoC: soc-core: initialize list at one place
Kuninori Morimoto [Tue, 20 Aug 2019 05:05:20 +0000 (14:05 +0900)]
ASoC: soc-core: initialize list at one place

Initialize component related list at random place is very difficult
to read. This patch initialize it at snd_soc_component_initialize().

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/87y2zozazp.wl-kuninori.morimoto.gx@renesas.com
Signed-off-by: Mark Brown <broonie@kernel.org>
5 years agoASoC: SOF: topology: fix get control data return type and arguments
Jaska Uimonen [Wed, 21 Aug 2019 21:11:38 +0000 (00:11 +0300)]
ASoC: SOF: topology: fix get control data return type and arguments

sof_get_control_data returns negative values even though the return
value is defined unsigned (size_t). So change the return value type to
int and add the data size as pointer argument to sof_get_control_data to
avoid ambiquity in the meaning of the return type.

Fixes: cac974a51ebb ("ASoC: SOF: topology: use set_get_data in process load")
Reported by: Dan Carpenter <dan.carpenter@oracle.com>
Signed-off-by: Jaska Uimonen <jaska.uimonen@intel.com>
Link: https://lore.kernel.org/r/20190821211138.14618-1-jaska.uimonen@linux.intel.com
Signed-off-by: Mark Brown <broonie@kernel.org>
5 years agoASoC: soc-core: initialize component list
Kuninori Morimoto [Tue, 20 Aug 2019 05:05:16 +0000 (14:05 +0900)]
ASoC: soc-core: initialize component list

It might return without initializing in error case.
In such case, uninitialized variable might be used at error handler.
This patch initializes all necessary variable before return.

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/87zhk4zazt.wl-kuninori.morimoto.gx@renesas.com
Signed-off-by: Mark Brown <broonie@kernel.org>
5 years agoASoC: soc-topology: use for_each_component_dais() at remove_dai()
Kuninori Morimoto [Tue, 20 Aug 2019 05:05:32 +0000 (14:05 +0900)]
ASoC: soc-topology: use for_each_component_dais() at remove_dai()

commit 52abe6cc1866a ("ASoC: topology: fix oops/use-after-free case
with dai driver") fixups remove_dai() error, but it is using
list_for_each_entry() for component->dai_list.

We already have for_each_component_dais() macro for it.
Let's use exising method.

Signed-off-by: Kuninori Morimoto <kuninori.morimoto.gx@renesas.com>
Link: https://lore.kernel.org/r/87tvaczazd.wl-kuninori.morimoto.gx@renesas.com
Signed-off-by: Mark Brown <broonie@kernel.org>
5 years agoASoC: soc-dai: use bit field for bus_control
Kuninori Morimoto [Tue, 20 Aug 2019 05:05:28 +0000 (14:05 +0900)]
ASoC: soc-dai: use bit field for bus_control

.bus_control can be bit field.
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/87v9uszazh.wl-kuninori.morimoto.gx@renesas.com
Signed-off-by: Mark Brown <broonie@kernel.org>
5 years agoASoC: soc-core: soc_cleanup_card_resources() become void
Kuninori Morimoto [Tue, 20 Aug 2019 05:05:10 +0000 (14:05 +0900)]
ASoC: soc-core: soc_cleanup_card_resources() become void

There is no need to check return value for
soc_cleanup_card_resources(). Let't makes it as void.

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/871rxg1lda.wl-kuninori.morimoto.gx@renesas.com
Signed-off-by: Mark Brown <broonie@kernel.org>
5 years agoASoC: soc-core: add NOTE to snd_soc_rtdcom_lookup()
Kuninori Morimoto [Tue, 20 Aug 2019 05:05:02 +0000 (14:05 +0900)]
ASoC: soc-core: add NOTE to snd_soc_rtdcom_lookup()

We can find specified name component via snd_soc_rtdcom_lookup().
But, it is not enough under multi CPU/Codec/Platform, because many
components which have same driver name might be connected to same rtd.

Not using this function as much as possible is best solution,
but some drivers are already deeply depended to it.

We can expand this function, for example having "num" which specifies
found order at parameter, etc (In such case, it need to have fixed
probing order).
Or, use different driver name in such component, etc.

We will have such issue if multi CPU/Codec/Platform were supported.
To indicate it, this patch adds NOTE to this function.

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/874l2c1ldi.wl-kuninori.morimoto.gx@renesas.com
Signed-off-by: Mark Brown <broonie@kernel.org>
5 years agoASoC: soc-core: use device_register()
Kuninori Morimoto [Tue, 20 Aug 2019 05:04:49 +0000 (14:04 +0900)]
ASoC: soc-core: use device_register()

It is easy to read code if it is cleanly using paired function/naming,
like start <-> stop, register <-> unregister, etc, etc.
But, current ALSA SoC code is very random, unbalance, not paired, etc.

soc-core.c is using device_unregiser(), but there is no its paired
device_regiser(). We can find its code at soc_post_component_init()
which is using device_initialize() and device_add().
Here, device_initialize() + device_add() = device_register().

-- linux/drivers/base/core.c --
int device_register(struct device *dev)
{
device_initialize(dev);
return device_add(dev);
}

device_initialize() is doing each dev member's initialization only,
not related to device parent/release/groups.
Thus, we can postpone it.
let's use device_register() instead of device_initialize()/device_add().

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/878sro1ldw.wl-kuninori.morimoto.gx@renesas.com
Signed-off-by: Mark Brown <broonie@kernel.org>
5 years agoASoC: mediatek: mt8183: switch tdm pins gpio function when playback on or off
Jiaxin Yu [Thu, 22 Aug 2019 12:51:00 +0000 (20:51 +0800)]
ASoC: mediatek: mt8183: switch tdm pins gpio function when playback on or off

Pull TDM pins down when TDM BE shutdown to avoid current leakage.

Signed-off-by: Jiaxin Yu <jiaxin.yu@mediatek.com>
Link: https://lore.kernel.org/r/1566478261-13464-2-git-send-email-jiaxin.yu@mediatek.com
Signed-off-by: Mark Brown <broonie@kernel.org>
5 years agoASoC: mediatek: mt2701: Fix -Wunused-const-variable warnings
YueHaibing [Thu, 22 Aug 2019 14:37:47 +0000 (22:37 +0800)]
ASoC: mediatek: mt2701: Fix -Wunused-const-variable warnings

sound/soc/mediatek/mt2701/mt2701-afe-common.h:66:27: warning:
 mt2701_afe_backup_list defined but not used [-Wunused-const-variable=]

mt2701_afe_backup_list is only used in mt2701-afe-pcm.c,
so just move the definition over there.

Reported-by: Hulk Robot <hulkci@huawei.com>
Signed-off-by: YueHaibing <yuehaibing@huawei.com>
Link: https://lore.kernel.org/r/20190822143747.20944-1-yuehaibing@huawei.com
Signed-off-by: Mark Brown <broonie@kernel.org>
5 years agoASoC: wm8988: fix typo in wm8988_right_line_controls
YueHaibing [Thu, 22 Aug 2019 14:36:08 +0000 (22:36 +0800)]
ASoC: wm8988: fix typo in wm8988_right_line_controls

sound/soc/codecs/wm8988.c:270:30: warning:
 wm8988_rline_enum defined but not used [-Wunused-const-variable=]

wm8988_rline_enum should be used in wm8988_right_line_controls.

Reported-by: Hulk Robot <hulkci@huawei.com>
Fixes: 5409fb4e327a ("ASoC: Add WM8988 CODEC driver")
Signed-off-by: YueHaibing <yuehaibing@huawei.com>
Link: https://lore.kernel.org/r/20190822143608.59824-1-yuehaibing@huawei.com
Signed-off-by: Mark Brown <broonie@kernel.org>
5 years agoASoC: SOF: imx: Add i.MX8 HW support
Daniel Baluta [Wed, 21 Aug 2019 16:47:30 +0000 (11:47 -0500)]
ASoC: SOF: imx: Add i.MX8 HW support

Add support for the audio DSP hardware found on NXP i.MX8 platform.

Signed-off-by: Daniel Baluta <daniel.baluta@nxp.com>
Signed-off-by: Pierre-Louis Bossart <pierre-louis.bossart@linux.intel.com>
Link: https://lore.kernel.org/r/20190821164730.7385-4-pierre-louis.bossart@linux.intel.com
Signed-off-by: Mark Brown <broonie@kernel.org>
5 years agoASoC: SOF: Add OF DSP device support
Daniel Baluta [Wed, 21 Aug 2019 16:47:29 +0000 (11:47 -0500)]
ASoC: SOF: Add OF DSP device support

Add support for device tree based SOF DSP devices.

Signed-off-by: Daniel Baluta <daniel.baluta@nxp.com>
Signed-off-by: Pierre-Louis Bossart <pierre-louis.bossart@linux.intel.com>
Link: https://lore.kernel.org/r/20190821164730.7385-3-pierre-louis.bossart@linux.intel.com
Signed-off-by: Mark Brown <broonie@kernel.org>
5 years agodt-bindings: dsp: fsl: Add DSP core binding support
Daniel Baluta [Wed, 21 Aug 2019 16:47:28 +0000 (11:47 -0500)]
dt-bindings: dsp: fsl: Add DSP core binding support

This describes the DSP device tree node.

Signed-off-by: Daniel Baluta <daniel.baluta@nxp.com>
Reviewed-by: Rob Herring <robh@kernel.org>
Signed-off-by: Pierre-Louis Bossart <pierre-louis.bossart@linux.intel.com>
Link: https://lore.kernel.org/r/20190821164730.7385-2-pierre-louis.bossart@linux.intel.com
Signed-off-by: Mark Brown <broonie@kernel.org>
5 years agoASoC: sun4i-i2s: Add support for DSP formats
Maxime Ripard [Wed, 21 Aug 2019 13:06:56 +0000 (15:06 +0200)]
ASoC: sun4i-i2s: Add support for DSP formats

In addition to the I2S format, the controller also supports the DSP_*
formats.

This requires some extra care on the LRCK period calculation, since the
controller, with the PCM formats, require that the value set is no longer
the periods of LRCK for a single channel, but for all of them.

Let's add the code to deal with this, and support the DSP_A and DSP_B
formats.

Signed-off-by: Maxime Ripard <maxime.ripard@bootlin.com>
Link: https://lore.kernel.org/r/5562db1ac8759f12b1b87c3258223eed629ef771.1566392800.git-series.maxime.ripard@bootlin.com
Signed-off-by: Mark Brown <broonie@kernel.org>
5 years agoASoC: sun4i-i2s: Replace call to params_width by local variable
Maxime Ripard [Wed, 21 Aug 2019 13:06:55 +0000 (15:06 +0200)]
ASoC: sun4i-i2s: Replace call to params_width by local variable

The sun4i_i2s_hw_params function already has a variable holding the value
returned by params_width, so let's just use that variable instead of
calling params_width multiple times.

Signed-off-by: Maxime Ripard <maxime.ripard@bootlin.com>
Link: https://lore.kernel.org/r/f85a1c1e014080a4bbc3abd19bc8fdcb86f0981a.1566392800.git-series.maxime.ripard@bootlin.com
Signed-off-by: Mark Brown <broonie@kernel.org>
5 years agoASoC: sun4i-i2s: Use the actual format width instead of an hardcoded one
Maxime Ripard [Wed, 21 Aug 2019 13:06:54 +0000 (15:06 +0200)]
ASoC: sun4i-i2s: Use the actual format width instead of an hardcoded one

The LRCK period field in the FMT0 register holds the number of LRCK period
for one channel in I2S mode.

This has been hardcoded to 32, while it really should be the physical width
of the format, which creates an improper clock when using a 16bit format,
with the i2s controller as LRCK master.

Fixes: 7d2993811a1e ("ASoC: sun4i-i2s: Add support for H3")
Signed-off-by: Maxime Ripard <maxime.ripard@bootlin.com>
Link: https://lore.kernel.org/r/f08a0c3605cd1d79752b38d704690190183f7865.1566392800.git-series.maxime.ripard@bootlin.com
Signed-off-by: Mark Brown <broonie@kernel.org>
5 years agoASoC: sun4i-i2s: Use the physical / slot width for the clocks
Maxime Ripard [Wed, 21 Aug 2019 13:06:53 +0000 (15:06 +0200)]
ASoC: sun4i-i2s: Use the physical / slot width for the clocks

The clock dividers function has been using the word size to compute the
clock rate at which it's supposed to be running, but the proper formula
would be to use the physical width and / or slot width in TDM.

It doesn't make any difference at the moment since all the formats
supported have the same sample width and physical width, but it's not going
to last forever.

Fixes: 7d2993811a1e ("ASoC: sun4i-i2s: Add support for H3")
Signed-off-by: Maxime Ripard <maxime.ripard@bootlin.com>
Link: https://lore.kernel.org/r/41a359d9885f397e066816961e5e3236afcbe0a1.1566392800.git-series.maxime.ripard@bootlin.com
Signed-off-by: Mark Brown <broonie@kernel.org>
5 years agoASoC: sun4i-i2s: Add support for TDM slots
Maxime Ripard [Mon, 19 Aug 2019 19:25:27 +0000 (21:25 +0200)]
ASoC: sun4i-i2s: Add support for TDM slots

The i2s controller supports TDM, for up to 8 slots. Let's support the TDM
API.

Signed-off-by: Maxime Ripard <maxime.ripard@bootlin.com>
Link: https://lore.kernel.org/r/26392af30b3e7b31ee48d5b867d45be8675db046.1566242458.git-series.maxime.ripard@bootlin.com
Signed-off-by: Mark Brown <broonie@kernel.org>
5 years agoASoC: soc-core: remove unneeded dai_link check from snd_soc_remove_dai_link()
Kuninori Morimoto [Tue, 20 Aug 2019 05:04:58 +0000 (14:04 +0900)]
ASoC: soc-core: remove unneeded dai_link check from snd_soc_remove_dai_link()

snd_soc_remove_dai_link() has card connected dai_link check. but
1) we need to call list_del() anyway,
   because it is "remove" function,
2) It is doing many thing for this card / dai_link already
   before checking dai_link.

This patch removes poinless dai_link check

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/875zms1ldm.wl-kuninori.morimoto.gx@renesas.com
Signed-off-by: Mark Brown <broonie@kernel.org>
5 years agoASoC: soc-core: merge snd_soc_initialize_card_lists()
Kuninori Morimoto [Tue, 20 Aug 2019 05:04:54 +0000 (14:04 +0900)]
ASoC: soc-core: merge snd_soc_initialize_card_lists()

snd_soc_initialize_card_lists() is doing card related
INIT_LIST_HEAD(), but, it is already doing at
snd_soc_register_card(). We don't need to do it separately.
This patch merges these.

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/877e781ldq.wl-kuninori.morimoto.gx@renesas.com
Signed-off-by: Mark Brown <broonie@kernel.org>
5 years agoASoC: dt-bindings: Introduce compatible string for imx8qm
Daniel Baluta [Wed, 14 Aug 2019 08:29:11 +0000 (11:29 +0300)]
ASoC: dt-bindings: Introduce compatible string for imx8qm

Register map for i.MX8QM is similar with i.MX6 series. Integration
of SAI IP into i.MX8QM SOC features a FIFO size of 64 X 32 bits samples.

Signed-off-by: Daniel Baluta <daniel.baluta@nxp.com>
Link: https://lore.kernel.org/r/20190814082911.665-3-daniel.baluta@nxp.com
Signed-off-by: Mark Brown <broonie@kernel.org>
5 years agoASoC: fsl_sai: Add support for imx8qm
Daniel Baluta [Wed, 14 Aug 2019 08:29:10 +0000 (11:29 +0300)]
ASoC: fsl_sai: Add support for imx8qm

SAI module on imx8qm features a register map similar with imx6 series
(it doesn't have VERID and PARAM registers at the beginning
of address spece).

Also, it has one FIFO which can help up to 64 * 32 bit samples.

Signed-off-by: Daniel Baluta <daniel.baluta@nxp.com>
Link: https://lore.kernel.org/r/20190814082911.665-2-daniel.baluta@nxp.com
Signed-off-by: Mark Brown <broonie@kernel.org>
5 years agoASoC: mchp-i2s-mcc: Fix simultaneous capture and playback in master mode
Codrin Ciubotariu [Tue, 20 Aug 2019 16:24:11 +0000 (19:24 +0300)]
ASoC: mchp-i2s-mcc: Fix simultaneous capture and playback in master mode

This controller supports capture and playback running at the same time,
with the limitation that both capture and playback must be configured the
same way (sample rate, sample format, number of channels, etc). For this,
we have to assure that the configuration registers look the same when
capture and playback are initiated.
This patch fixes a bug in which the controller is in master mode and the
hw_params() callback fails for the second audio stream. The fail occurs
because the divisors are calculated after comparing the configuration
registers for capture and playback. The fix consists in calculating the
divisors before comparing the configuration registers. BCLK and LRC are
then configured and started only if the controller is not already running.

Fixes: 7e0cdf545a55 ("ASoC: mchp-i2s-mcc: add driver for I2SC Multi-Channel Controller")
Signed-off-by: Codrin Ciubotariu <codrin.ciubotariu@microchip.com>
Link: https://lore.kernel.org/r/20190820162411.24836-4-codrin.ciubotariu@microchip.com
Signed-off-by: Mark Brown <broonie@kernel.org>
5 years agoASoC: sun4i-i2s: Support more channels
Maxime Ripard [Mon, 19 Aug 2019 19:25:26 +0000 (21:25 +0200)]
ASoC: sun4i-i2s: Support more channels

We've been limited to 2 channels in the driver while the controller
supports from 1 to 8 channels, in both capture and playback. let's remove
the hardcoded checks and numbers, and extend the range of channel numbers
we can use.

Signed-off-by: Maxime Ripard <maxime.ripard@bootlin.com>
Link: https://lore.kernel.org/r/27d9de5cd56f3a544851b8cd8af08bf836d19637.1566242458.git-series.maxime.ripard@bootlin.com
Signed-off-by: Mark Brown <broonie@kernel.org>
5 years agoASoC: sun4i-i2s: Pass the channels number as an argument
Maxime Ripard [Mon, 19 Aug 2019 19:25:25 +0000 (21:25 +0200)]
ASoC: sun4i-i2s: Pass the channels number as an argument

The channels number have been hardcoded to 2 so far, while the controller
supports more than that.

Remove the instance where it has been hardcoded to compute the BCLK
divider, and pass it through as an argument to ease further support of more
channels.

Signed-off-by: Maxime Ripard <maxime.ripard@bootlin.com>
Link: https://lore.kernel.org/r/48887cf7abfaab6597db233b24d7a088a913e48a.1566242458.git-series.maxime.ripard@bootlin.com
Signed-off-by: Mark Brown <broonie@kernel.org>
5 years agoASoC: sun4i-i2s: Remove duplicated quirks structure
Maxime Ripard [Mon, 19 Aug 2019 19:25:24 +0000 (21:25 +0200)]
ASoC: sun4i-i2s: Remove duplicated quirks structure

The A83t and H3 have the same quirks, so it doesn't make sense to duplicate
the quirks structure.

Signed-off-by: Maxime Ripard <maxime.ripard@bootlin.com>
Link: https://lore.kernel.org/r/5ade5de27d23918c5ef30387c23aead951d5ad64.1566242458.git-series.maxime.ripard@bootlin.com
Signed-off-by: Mark Brown <broonie@kernel.org>
5 years agoASoC: sun4i-i2s: Fix the LRCK period on A83t
Maxime Ripard [Mon, 19 Aug 2019 19:25:23 +0000 (21:25 +0200)]
ASoC: sun4i-i2s: Fix the LRCK period on A83t

Unlike the previous SoCs, the A83t, like the newer ones, need the LRCK
bitfield to be set. Let's add it.

Fixes: 21faaea1343f ("ASoC: sun4i-i2s: Add support for A83T")
Signed-off-by: Maxime Ripard <maxime.ripard@bootlin.com>
Link: https://lore.kernel.org/r/6a0ee0bc1375bcb53840d3fb2d2f3d9732b8e57e.1566242458.git-series.maxime.ripard@bootlin.com
Signed-off-by: Mark Brown <broonie@kernel.org>
5 years agoASoC: sun4i-i2s: Fix MCLK Enable bit offset on A83t
Maxime Ripard [Mon, 19 Aug 2019 19:25:22 +0000 (21:25 +0200)]
ASoC: sun4i-i2s: Fix MCLK Enable bit offset on A83t

The A83t, unlike previous SoCs, has the MCLK enable bit at the 8th bit of
the CLK_DIV register, unlike what is declared in the driver.

Fixes: 21faaea1343f ("ASoC: sun4i-i2s: Add support for A83T")
Signed-off-by: Maxime Ripard <maxime.ripard@bootlin.com>
Link: https://lore.kernel.org/r/43b07f8cd8e0e280c64ce61d57c307678c923e9b.1566242458.git-series.maxime.ripard@bootlin.com
Signed-off-by: Mark Brown <broonie@kernel.org>
5 years agoASoC: sun4i-i2s: Fix WSS and SR fields for the A83t
Maxime Ripard [Mon, 19 Aug 2019 19:25:21 +0000 (21:25 +0200)]
ASoC: sun4i-i2s: Fix WSS and SR fields for the A83t

The A83t has the same bit fields offsets than the A10 and A31, while this
was the first device with the new layout, fix that.

Fixes: 21faaea1343f ("ASoC: sun4i-i2s: Add support for A83T")
Signed-off-by: Maxime Ripard <maxime.ripard@bootlin.com>
Link: https://lore.kernel.org/r/d93f0943cc39d880750daf459a0eeab34c63518e.1566242458.git-series.maxime.ripard@bootlin.com
Signed-off-by: Mark Brown <broonie@kernel.org>
5 years agoASoC: sun4i-i2s: Fix the LRCK polarity
Maxime Ripard [Mon, 19 Aug 2019 19:25:20 +0000 (21:25 +0200)]
ASoC: sun4i-i2s: Fix the LRCK polarity

The LRCK polarity "normal" polarity in the I2S/TDM specs and in the
Allwinner datasheet are not the same. In the case where the i2s controller
is being used as the LRCK master, it's pretty clear when looked at under a
scope.

Let's fix this, and add a comment to clear up as much the confusion as
possible.

Fixes: 7d2993811a1e ("ASoC: sun4i-i2s: Add support for H3")
Fixes: 21faaea1343f ("ASoC: sun4i-i2s: Add support for A83T")
Signed-off-by: Maxime Ripard <maxime.ripard@bootlin.com>
Link: https://lore.kernel.org/r/e03fb6b2a916223070b9f18405b0ef117a452ff4.1566242458.git-series.maxime.ripard@bootlin.com
Signed-off-by: Mark Brown <broonie@kernel.org>
5 years agoASoC: sun4i-i2s: Fix LRCK and BCLK polarity offsets on newer SoCs
Maxime Ripard [Mon, 19 Aug 2019 19:25:19 +0000 (21:25 +0200)]
ASoC: sun4i-i2s: Fix LRCK and BCLK polarity offsets on newer SoCs

The LRCK and BCLK polarity offsets on newer SoCs has been
changed, yet the driver didn't take it into account for all of them.

This was taken into account for the H3, but not the A83t. This was handled
using a reg_field for the H3.

However, the value in that field will not be the same, so reg_field is not
adapted in that case. Let's change for proper calls with the regular
values.

Fixes: 21faaea1343f ("ASoC: sun4i-i2s: Add support for A83T")
Signed-off-by: Maxime Ripard <maxime.ripard@bootlin.com>
Link: https://lore.kernel.org/r/9cbdde80a299288878e58225df4d7884e0301348.1566242458.git-series.maxime.ripard@bootlin.com
Signed-off-by: Mark Brown <broonie@kernel.org>
5 years agoASoC: sun4i-i2s: RX and TX counter registers are swapped
Maxime Ripard [Mon, 19 Aug 2019 19:25:17 +0000 (21:25 +0200)]
ASoC: sun4i-i2s: RX and TX counter registers are swapped

The RX and TX counters registers offset have been swapped, fix that.

Fixes: fa7c0d13cb26 ("ASoC: sunxi: Add Allwinner A10 Digital Audio driver")
Signed-off-by: Maxime Ripard <maxime.ripard@bootlin.com>
Link: https://lore.kernel.org/r/8b26477560ad5fd8f69e037b167c5e61de5c26a3.1566242458.git-series.maxime.ripard@bootlin.com
Signed-off-by: Mark Brown <broonie@kernel.org>
5 years agoASoC: sun4i-i2s: Fix the MCLK and BCLK dividers on newer SoCs
Maxime Ripard [Mon, 19 Aug 2019 19:25:16 +0000 (21:25 +0200)]
ASoC: sun4i-i2s: Fix the MCLK and BCLK dividers on newer SoCs

From: Marcus Cooper <codekipper@gmail.com>

The clock division dividers have changed between the older (A10/A31) and
newer (H3, A64, etc) SoCs.

While this was addressed through an offset on some SoCs, it was missing
some dividers as well, so the support wasn't perfect. Let's introduce a
pointer in the quirk structure for the divider calculation functions to use
so we can have the proper range now.

Signed-off-by: Marcus Cooper <codekipper@gmail.com>
[Maxime: Fix the commit log, use a field in the quirk structure]
Signed-off-by: Maxime Ripard <maxime.ripard@bootlin.com>
Link: https://lore.kernel.org/r/0e5b4abf06cd3202354315201c6af44caeb20236.1566242458.git-series.maxime.ripard@bootlin.com
Signed-off-by: Mark Brown <broonie@kernel.org>
5 years agoASoC: sun4i-i2s: Use module clock as BCLK parent on newer SoCs
Maxime Ripard [Mon, 19 Aug 2019 19:25:15 +0000 (21:25 +0200)]
ASoC: sun4i-i2s: Use module clock as BCLK parent on newer SoCs

On the first generation of Allwinner SoCs (A10-A31), the i2s controller was
using the MCLK as BCLK parent. However, this changed since the introduction
of the A83t and BCLK now uses the module clock as its parent.

Let's introduce a hook to get the parent rate and use that in our divider
calculations.

Fixes: 7d2993811a1e ("ASoC: sun4i-i2s: Add support for H3")
Fixes: 21faaea1343f ("ASoC: sun4i-i2s: Add support for A83T")
Signed-off-by: Maxime Ripard <maxime.ripard@bootlin.com>
Link: https://lore.kernel.org/r/0b6665be216b3bd0e7bc43724818f05f3f8ee881.1566242458.git-series.maxime.ripard@bootlin.com
Signed-off-by: Mark Brown <broonie@kernel.org>
5 years agoASoC: sun4i-i2s: Move the format configuration to a callback
Maxime Ripard [Mon, 19 Aug 2019 19:25:12 +0000 (21:25 +0200)]
ASoC: sun4i-i2s: Move the format configuration to a callback

The two main generations of our I2S controller require a slightly different
format configuration, mostly because of a quite different register layout
and some additional registers being needed on the newer generation.

This used to be controlled through a bunch of booleans, however this proved
to be quite impractical, especially since a bunch of SoCs forgot to set
those parameters and therefore were broken from that point of view.

Fixes: 21faaea1343f ("ASoC: sun4i-i2s: Add support for A83T")
Signed-off-by: Maxime Ripard <maxime.ripard@bootlin.com>
Link: https://lore.kernel.org/r/dc818644c3e40734e7a97247c994b1fca1c3c047.1566242458.git-series.maxime.ripard@bootlin.com
Signed-off-by: Mark Brown <broonie@kernel.org>
5 years agoASoC: sun4i-i2s: Move the channel configuration to a callback
Maxime Ripard [Mon, 19 Aug 2019 19:25:11 +0000 (21:25 +0200)]
ASoC: sun4i-i2s: Move the channel configuration to a callback

The two main generations of our I2S controller require a slightly different
channel configuration, mostly because of a quite different register layout
and some additional registers being needed on the newer generation.

This used to be controlled through a bunch of booleans, however this proved
to be quite impractical, especially since a bunch of SoCs forgot to set
those parameters and therefore were broken from that point of view.

Fixes: 21faaea1343f ("ASoC: sun4i-i2s: Add support for A83T")
Signed-off-by: Maxime Ripard <maxime.ripard@bootlin.com>
Link: https://lore.kernel.org/r/6414463de69584e8227fa495b13aa5f4798e1f0e.1566242458.git-series.maxime.ripard@bootlin.com
Signed-off-by: Mark Brown <broonie@kernel.org>
5 years agoMerge branch 'asoc-5.3' into asoc-5.4
Mark Brown [Tue, 20 Aug 2019 17:28:43 +0000 (18:28 +0100)]
Merge branch 'asoc-5.3' into asoc-5.4

5 years agoASoC: intel: cht_bsw_max98090_ti: Add all Chromebooks that need pmc_plt_clk_0 quirk
Daniel Stuart [Thu, 15 Aug 2019 17:12:55 +0000 (14:12 -0300)]
ASoC: intel: cht_bsw_max98090_ti: Add all Chromebooks that need pmc_plt_clk_0 quirk

Every single baytrail chromebook sets PMC to 0, as can be seeing
below by searching through coreboot source code:
$ grep -rl "PMC_PLT_CLK\[0\]" .
./rambi/variants/glimmer/devicetree.cb
./rambi/variants/clapper/devicetree.cb
./rambi/variants/swanky/devicetree.cb
./rambi/variants/enguarde/devicetree.cb
./rambi/variants/winky/devicetree.cb
./rambi/variants/kip/devicetree.cb
./rambi/variants/squawks/devicetree.cb
./rambi/variants/orco/devicetree.cb
./rambi/variants/ninja/devicetree.cb
./rambi/variants/heli/devicetree.cb
./rambi/variants/sumo/devicetree.cb
./rambi/variants/banjo/devicetree.cb
./rambi/variants/candy/devicetree.cb
./rambi/variants/gnawty/devicetree.cb
./rambi/variants/rambi/devicetree.cb
./rambi/variants/quawks/devicetree.cb

Plus, Cyan (only non-baytrail chromebook with max98090) also needs
this patch for audio to work.

Thus, this commit adds all the missing devices to bsw_max98090 quirk
table, implemented by commit a182ecd3809c ("ASoC: intel:
cht_bsw_max98090_ti: Add quirk for boards using pmc_plt_clk_0").

Signed-off-by: Daniel Stuart <daniel.stuart14@gmail.com>
Link: https://lore.kernel.org/r/20190815171300.30126-1-daniel.stuart14@gmail.com
Signed-off-by: Mark Brown <broonie@kernel.org>
5 years agoASoC: sun4i-i2s: Rework MCLK divider calculation
Maxime Ripard [Mon, 19 Aug 2019 19:25:13 +0000 (21:25 +0200)]
ASoC: sun4i-i2s: Rework MCLK divider calculation

The MCLK divider calculation is currently computing the ideal divider using
the oversample rate, the sample rate and the parent rate.

However, since we have access to the frequency is supposed to be running at
already, and as it turns out we're using it to compute the oversample rate,
we can just use the ratio between the parent rate and the MCLK rate to
simplify a bit the formula.

Signed-off-by: Maxime Ripard <maxime.ripard@bootlin.com>
Link: https://lore.kernel.org/r/dcc5deb2eb650758d268bddd20f60ba58856d024.1566242458.git-series.maxime.ripard@bootlin.com
Signed-off-by: Mark Brown <broonie@kernel.org>
5 years agoASoC: sun4i-i2s: Replace call to params_channels by local variable
Maxime Ripard [Mon, 19 Aug 2019 19:25:10 +0000 (21:25 +0200)]
ASoC: sun4i-i2s: Replace call to params_channels by local variable

The sun4i_i2s_hw_params already has a variable holding the value returned
by params_channels, so let's just use that variable instead of calling
params_channels multiple times.

Signed-off-by: Maxime Ripard <maxime.ripard@bootlin.com>
Link: https://lore.kernel.org/r/c0faaac69ad40248f24eed3c3b2fa1ccc4a85b70.1566242458.git-series.maxime.ripard@bootlin.com
Signed-off-by: Mark Brown <broonie@kernel.org>
5 years agoASoC: sun4i-i2s: Don't use the oversample to calculate BCLK
Maxime Ripard [Mon, 19 Aug 2019 19:25:14 +0000 (21:25 +0200)]
ASoC: sun4i-i2s: Don't use the oversample to calculate BCLK

The BCLK divider should be calculated using the parameters that actually
make the BCLK rate: the number of channels, the sampling rate and the
sample width.

We've been using the oversample_rate previously because in the former SoCs,
the BCLK's parent is MCLK, which in turn is being used to generate the
oversample rate, so we end up with something like this:

oversample = mclk_rate / sampling_rate
bclk_div = oversample / word_size / channels

So, bclk_div = mclk_rate / sampling_rate / word_size / channels.

And this is actually better, since the oversampling ratio only plays a role
because the MCLK is its parent, not because of what BCLK is supposed to be.

Furthermore, that assumption of MCLK being the parent has been broken on
newer SoCs, so let's use the proper formula, and have the parent rate as an
argument.

Fixes: 7d2993811a1e ("ASoC: sun4i-i2s: Add support for H3")
Fixes: 21faaea1343f ("ASoC: sun4i-i2s: Add support for A83T")
Fixes: 66ecce332538 ("ASoC: sun4i-i2s: Add compatibility with A64 codec I2S")
Signed-off-by: Maxime Ripard <maxime.ripard@bootlin.com>
Link: https://lore.kernel.org/r/c3595e3a9788c2ef2dcc30aa3c8c4953bb5cc249.1566242458.git-series.maxime.ripard@bootlin.com
Signed-off-by: Mark Brown <broonie@kernel.org>
5 years agoASoC: sun4i-i2s: Switch to devm for PCM register
Maxime Ripard [Mon, 19 Aug 2019 19:25:09 +0000 (21:25 +0200)]
ASoC: sun4i-i2s: Switch to devm for PCM register

Since the introduction of the driver, a new managed helper for the
dmaengine PCM registration has been created. Let's use it to simplify a bit
our probe and remove functions.

Signed-off-by: Maxime Ripard <maxime.ripard@bootlin.com>
Link: https://lore.kernel.org/r/606d271187091e858e8c15e20555af0b79798fe1.1566242458.git-series.maxime.ripard@bootlin.com
Signed-off-by: Mark Brown <broonie@kernel.org>
5 years agoASoC: sun4i-i2s: Register regmap and PCM before our component
Maxime Ripard [Mon, 19 Aug 2019 19:25:08 +0000 (21:25 +0200)]
ASoC: sun4i-i2s: Register regmap and PCM before our component

So far the regmap and the dmaengine PCM are registered after our component
has been, which means that our driver isn't properly initialised by then.

Let's fix that.

Signed-off-by: Maxime Ripard <maxime.ripard@bootlin.com>
Link: https://lore.kernel.org/r/67e303f37f141ef73ce9ed47d7f831b63c694424.1566242458.git-series.maxime.ripard@bootlin.com
Signed-off-by: Mark Brown <broonie@kernel.org>
5 years agoASoC: wm8904: implement input mode select as a mux
Michał Mirosław [Tue, 20 Aug 2019 11:02:37 +0000 (13:02 +0200)]
ASoC: wm8904: implement input mode select as a mux

Make '* Capture Mode' a mux. This makes DAPM know that in single-ended
mode only inverting mux paths need to be enabled.

Signed-off-by: Michał Mirosław <mirq-linux@rere.qmqm.pl>
Acked-by: Charles Keepax <ckeepax@opensource.cirrus.com>
Link: https://lore.kernel.org/r/125cd3c9f298da9b08a4d6002d4c00d70a898950.1566298834.git.mirq-linux@rere.qmqm.pl
Signed-off-by: Mark Brown <broonie@kernel.org>
5 years agoASoC: wm8904: fix typo in DAPM kcontrol name
Michał Mirosław [Tue, 20 Aug 2019 11:02:35 +0000 (13:02 +0200)]
ASoC: wm8904: fix typo in DAPM kcontrol name

Trivial fix for typo in "Capture Inverting Mux"es' name.

Signed-off-by: Michał Mirosław <mirq-linux@rere.qmqm.pl>
Acked-by: Charles Keepax <ckeepax@opensource.cirrus.com>
Link: https://lore.kernel.org/r/f95ae1085f9f3c137a122c4d95728711613c15f7.1566298834.git.mirq-linux@rere.qmqm.pl
Signed-off-by: Mark Brown <broonie@kernel.org>
5 years agoASoC: intel: cht_bsw_max98090_ti: Add all Chromebooks that need pmc_plt_clk_0 quirk
Daniel Stuart [Thu, 15 Aug 2019 17:12:55 +0000 (14:12 -0300)]
ASoC: intel: cht_bsw_max98090_ti: Add all Chromebooks that need pmc_plt_clk_0 quirk

Every single baytrail chromebook sets PMC to 0, as can be seeing
below by searching through coreboot source code:
$ grep -rl "PMC_PLT_CLK\[0\]" .
./rambi/variants/glimmer/devicetree.cb
./rambi/variants/clapper/devicetree.cb
./rambi/variants/swanky/devicetree.cb
./rambi/variants/enguarde/devicetree.cb
./rambi/variants/winky/devicetree.cb
./rambi/variants/kip/devicetree.cb
./rambi/variants/squawks/devicetree.cb
./rambi/variants/orco/devicetree.cb
./rambi/variants/ninja/devicetree.cb
./rambi/variants/heli/devicetree.cb
./rambi/variants/sumo/devicetree.cb
./rambi/variants/banjo/devicetree.cb
./rambi/variants/candy/devicetree.cb
./rambi/variants/gnawty/devicetree.cb
./rambi/variants/rambi/devicetree.cb
./rambi/variants/quawks/devicetree.cb

Plus, Cyan (only non-baytrail chromebook with max98090) also needs
this patch for audio to work.

Thus, this commit adds all the missing devices to bsw_max98090 quirk
table, implemented by commit a182ecd3809c ("ASoC: intel:
cht_bsw_max98090_ti: Add quirk for boards using pmc_plt_clk_0").

Signed-off-by: Daniel Stuart <daniel.stuart14@gmail.com>
Link: https://lore.kernel.org/r/20190815171300.30126-1-daniel.stuart14@gmail.com
Signed-off-by: Mark Brown <broonie@kernel.org>
5 years agoASoC: meson: g12a-tohdmitx: require regmap mmio
Jerome Brunet [Tue, 20 Aug 2019 12:35:10 +0000 (14:35 +0200)]
ASoC: meson: g12a-tohdmitx: require regmap mmio

The tohdmitx glue uses regmap MMIO so it should require it.

Fixes: c8609f3870f7 ("ASoC: meson: add g12a tohdmitx control")
Signed-off-by: Jerome Brunet <jbrunet@baylibre.com>
Link: https://lore.kernel.org/r/20190820123510.22491-1-jbrunet@baylibre.com
Signed-off-by: Mark Brown <broonie@kernel.org>
5 years agoASoC: meson: axg-tdm-formatter: free reset on device removal
Jerome Brunet [Tue, 20 Aug 2019 12:34:13 +0000 (14:34 +0200)]
ASoC: meson: axg-tdm-formatter: free reset on device removal

Use the devm variant to get the formatter reset so it is properly freed
on device removal

Fixes: 751bd5db5260 ("ASoC: meson: axg-tdm-formatter: add reset")
Signed-off-by: Jerome Brunet <jbrunet@baylibre.com>
Link: https://lore.kernel.org/r/20190820123413.22249-1-jbrunet@baylibre.com
Signed-off-by: Mark Brown <broonie@kernel.org>
5 years agoASoC: uniphier: Fix double reset assersion when transitioning to suspend state
Kunihiko Hayashi [Tue, 20 Aug 2019 06:16:04 +0000 (15:16 +0900)]
ASoC: uniphier: Fix double reset assersion when transitioning to suspend state

When transitioning to supend state, uniphier_aio_dai_suspend() is called
and asserts reset lines and disables clocks.

However, if there are two or more DAIs, uniphier_aio_dai_suspend() are
called multiple times, and double reset assersion will cause.

This patch defines the counter that has the number of DAIs at first, and
whenever uniphier_aio_dai_suspend() are called, it decrements the
counter. And only if the counter is zero, it asserts reset lines and
disables clocks.

In the same way, uniphier_aio_dai_resume() are called, it increments the
counter after deasserting reset lines and enabling clocks.

Fixes: 139a34200233 ("ASoC: uniphier: add support for UniPhier AIO CPU DAI driver")
Signed-off-by: Kunihiko Hayashi <hayashi.kunihiko@socionext.com>
Link: https://lore.kernel.org/r/1566281764-14059-1-git-send-email-hayashi.kunihiko@socionext.com
Signed-off-by: Mark Brown <broonie@kernel.org>
5 years agoASoC: SOF: pcm: add ALH support
Pierre-Louis Bossart [Thu, 15 Aug 2019 19:20:18 +0000 (14:20 -0500)]
ASoC: SOF: pcm: add ALH support

Even if ALH has no specific configuration, we still need to handle the
common parameters for all DAIs

Signed-off-by: Pierre-Louis Bossart <pierre-louis.bossart@linux.intel.com>
Link: https://lore.kernel.org/r/20190815192018.30570-5-pierre-louis.bossart@linux.intel.com
Signed-off-by: Mark Brown <broonie@kernel.org>