commit ef050bece1b55 ("ASoC: Remove platform code now everything is
componentised") removed platform code, but it didn't remove
.pcm_new/free which existed only for platform.
This patch remove these
Signed-off-by: Kuninori Morimoto <kuninori.morimoto.gx@renesas.com> Reviewed-by: Charles Keepax <ckeepax@opensource.wolfsonmicro.com> Signed-off-by: Mark Brown <broonie@kernel.org>
To setup regmap, ALSA SoC has snd_soc_component_init_regmap() and
.get_regmap. But these are duplicated feature.
Now, no one is using .get_regmap, let's remove it.
Signed-off-by: Kuninori Morimoto <kuninori.morimoto.gx@renesas.com> Reviewed-by: Charles Keepax <ckeepax@opensource.wolfsonmicro.com> Signed-off-by: Mark Brown <broonie@kernel.org>
Codec reg_cache is legacy feature, almost all driver are now using
common regmap, and very few driver had been used this legacy feature.
Because of this background, it is now implemented on each
driver internally now.
So now, no one is using codec reg_cache. Let's remove it.
Signed-off-by: Kuninori Morimoto <kuninori.morimoto.gx@renesas.com> Reviewed-by: Charles Keepax <ckeepax@opensource.wolfsonmicro.com> Signed-off-by: Mark Brown <broonie@kernel.org>
No one is using codec hw_write/control_data any more.
Let's remove these.
Signed-off-by: Kuninori Morimoto <kuninori.morimoto.gx@renesas.com> Reviewed-by: Charles Keepax <ckeepax@opensource.wolfsonmicro.com> Signed-off-by: Mark Brown <broonie@kernel.org>
Peter Ujfalusi [Mon, 7 May 2018 08:49:59 +0000 (11:49 +0300)]
ASoC: omap-mcbsp: Convert to use the sdma-pcm instead of omap-pcm
Use the new platform driver.
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>
Peter Ujfalusi [Mon, 7 May 2018 08:49:58 +0000 (11:49 +0300)]
ASoC: omap-mcpdm: Convert to use the sdma-pcm instead of omap-pcm
Use the new platform driver.
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>
Peter Ujfalusi [Mon, 7 May 2018 08:49:57 +0000 (11:49 +0300)]
ASoC: omap-dmic: Convert to use the sdma-pcm instead of omap-pcm
Use the new platform driver.
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>
Peter Ujfalusi [Mon, 7 May 2018 08:49:56 +0000 (11:49 +0300)]
ASoC: omap-hdmi-audio: Convert to use the sdma-pcm instead of omap-pcm
Use the new platform driver.
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>
Peter Ujfalusi [Mon, 7 May 2018 08:49:54 +0000 (11:49 +0300)]
ASoC: omap: Introduce the generic_dmaengine_pcm based sdma-pcm
With the generic dmaengine_pcm support the omap-cpm can be replaced with a
much smaller wrapper.
CPU DAI drivers can use the:
int sdma_pcm_platform_register(struct device *dev,
char *txdmachan, char *rxdmachan);
To register the platform driver, txdmachan/rxdmachan is only needed to be
provided if the DMA channel names are not standard tx/rx, like in case of
McPDM, or the DAI is only capable of one audio direction (DMIC, HDMI).
This patch only introduces the source file and changes to the
Kconfig/Makefile, but does not change any of the DAI drivers to use it.
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>
Wei Yongjun [Mon, 7 May 2018 01:39:45 +0000 (01:39 +0000)]
ASoC: fix return value check in mt6351_codec_driver_probe()
In case of error, the function dev_get_regmap() returns NULL pointer not
ERR_PTR(). The IS_ERR() test in the return value check should be
replaced with NULL test.
Signed-off-by: Wei Yongjun <weiyongjun1@huawei.com> Signed-off-by: Mark Brown <broonie@kernel.org>
ASoC: tas6424: Allow disabling auto diagnostics for faster power-on
The TAS6424 incorporates both DC-load and AC-load diagnostics which are
used to determine the status of the load. The DC diagnostics runs when any
channel is directed to leave the Hi-Z state and enter the MUTE or PLAY
state.
The DC diagnostics are turned on by default but, if a fast startup without
diagnostics is required, the diagnostics can be disabled using a dedicated
ALSA control.
Signed-off-by: Jean-Jacques Hiblot <jjhiblot@ti.com> Signed-off-by: Mark Brown <broonie@kernel.org>
John Hsu [Thu, 3 May 2018 02:46:41 +0000 (10:46 +0800)]
ASoC: nau8810: change input PGA mixer stage
Organize the paths of the mixer, "Input Boost Stage", including
the routes of the mixer. The control is not used correctly before.
Besides, the driver changes the name of the mixer controls.
Signed-off-by: John Hsu <KCHSU0@nuvoton.com> Signed-off-by: Mark Brown <broonie@kernel.org>
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>
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
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>
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>
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>
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>
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>
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>
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>
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>
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>
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>
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>
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>
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>
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>
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>
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>
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>
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>
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>
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>
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>
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>
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>