Commit graph

811622 commits

Author SHA1 Message Date
Andy Shevchenko
4d1f7a6eab
gpiolib: acpi: Introduce ACPI_GPIO_QUIRK_ONLY_GPIOIO
New quirk enforces search for GPIO based on its type,
i.e. iterate over GpioIo resources only.

Signed-off-by: Andy Shevchenko <andriy.shevchenko@linux.intel.com>
Acked-by: Mika Westerberg <mika.westerberg@linux.intel.com>
Acked-by: Linus Walleij <linus.walleij@linaro.org>
Tested-by: Hans de Goede <hdegoede@redhat.com>
Signed-off-by: Mark Brown <broonie@kernel.org>
2019-02-08 17:29:51 +00:00
Johan Hovold
3ebc584ce7
ASoC: msm8916-wcd-digital: convert license header to SPDX
Convert the GPLv2-only license header to SPDX.

Signed-off-by: Johan Hovold <johan@kernel.org>
Signed-off-by: Mark Brown <broonie@kernel.org>
2019-02-08 16:28:11 +00:00
Johan Hovold
3f22e31da8
ASoC: msm8916-wcd-analog: add missing license information
Add the missing license and copyright information which never made it
into the analog driver when the original driver was split in two as part
of the review process.

Link: https://lkml.kernel.org/r/1465582725-30183-3-git-send-email-srinivas.kandagatla@linaro.org
Fixes: 585e881e5b ("ASoC: codecs: Add msm8916-wcd analog codec")
Cc: Srinivas Kandagatla <srinivas.kandagatla@linaro.org>
Signed-off-by: Johan Hovold <johan@kernel.org>
Signed-off-by: Mark Brown <broonie@kernel.org>
2019-02-08 16:28:10 +00:00
Guennadi Liakhovetski
0bb423f2ea
ASoC: regulator notifier registration should be managed
Regulator notifiers, that were registered during codec driver probing,
must be unregistered during driver release, or device managed versions
have to be used. This patch fixes codec drivers, that weren't explicitly
unregistering notifiers and simplifies those, that did that manually.

Signed-off-by: Guennadi Liakhovetski <guennadi.liakhovetski@linux.intel.com>
Signed-off-by: Mark Brown <broonie@kernel.org>
2019-02-08 16:18:49 +00:00
Johan Hovold
5101355353
dt-bindings: sound: msm8916-wcd-analog: fix example regulator names
Fix upper-case regulator names in the binding example which do not match
the corresponding required properties.

While at it, add a blank line after the required-properties section to
improve readability.

Signed-off-by: Johan Hovold <johan@kernel.org>
Signed-off-by: Mark Brown <broonie@kernel.org>
2019-02-08 13:01:47 +00:00
Olivier Moysan
6a68eeee0f
SoC: stm32: i2s: manage clock power
Kernel clock management:
Enable/disable I2S kernel clock on audio stream startup/shutdown.

Peripheral clock management:
Manage I2S peripheral clock power through regmap services.

Signed-off-by: Olivier Moysan <olivier.moysan@st.com>
Signed-off-by: Mark Brown <broonie@kernel.org>
2019-02-08 13:01:22 +00:00
Olivier Moysan
307cce4a00
ASoC: stm32: i2s: add power management
Add suspend and resume sleep callbacks,
to support system low power modes.

Signed-off-by: Olivier Moysan <olivier.moysan@st.com>
Signed-off-by: Mark Brown <broonie@kernel.org>
2019-02-08 13:01:07 +00:00
Nathan Chancellor
d9186330c8
ASoC: codecs: jz4725b: Remove unnecessary const qualifier
Clang warns:

sound/soc/codecs/jz4725b.c:177:14: warning: duplicate 'const' declaration specifier [-Wduplicate-decl-specifier]
static const SOC_VALUE_ENUM_SINGLE_DECL(jz4725b_codec_adc_src_enum,
             ^
include/sound/soc.h:356:2: note: expanded from macro 'SOC_VALUE_ENUM_SINGLE_DECL'
        SOC_VALUE_ENUM_DOUBLE_DECL(name, xreg, xshift, xshift, xmask, xtexts, xvalues)
        ^
include/sound/soc.h:353:2: note: expanded from macro 'SOC_VALUE_ENUM_DOUBLE_DECL'
        const struct soc_enum name = SOC_VALUE_ENUM_DOUBLE(xreg, xshift_l, xshift_r, xmask, \
        ^

As it points out, SOC_VALUE_ENUM_DOUBLE_DECL has the const attribute in
its definition so remove it here.

Fixes: e9d97b05a8 ("ASoC: codecs: Add jz4725b-codec driver")
Link: https://github.com/ClangBuiltLinux/linux/issues/354
Signed-off-by: Nathan Chancellor <natechancellor@gmail.com>
Signed-off-by: Mark Brown <broonie@kernel.org>
2019-02-08 13:00:52 +00:00
James Schulman
0d250bf24a
ASoC: cs35l36: Add device tree documentation for CS35L36
Add device tree documentation for Cirrus Logic CS35L36
speaker amplifier

Signed-off-by: James Schulman <james.schulman@cirrus.com>
Reviewed-by: Charles Keepax <ckeepax@opensource.cirrus.com>
Acked-by: Brian Austin <brian.austin@cirrus.com>
Signed-off-by: Mark Brown <broonie@kernel.org>
2019-02-08 13:00:43 +00:00
James Schulman
6ba9dd6c89
ASoC: cs35l36: Add support for Cirrus CS35L36 Amplifier
Add driver support for Cirrus Logic CS35L36 boosted
speaker amplifier

Signed-off-by: James Schulman <james.schulman@cirrus.com>
Reviewed-by: Charles Keepax <ckeepax@opensource.cirrus.com>
Acked-by: Brian Austin <brian.austin@cirrus.com>
Signed-off-by: Mark Brown <broonie@kernel.org>
2019-02-08 13:00:28 +00:00
Sylwester Nawrocki
511d53ac86
ASoC: doc: Fix typos in dpcm.rst
This patch fixes a few typos in the DPCM documentation.

Signed-off-by: Sylwester Nawrocki <s.nawrocki@samsung.com>
Signed-off-by: Mark Brown <broonie@kernel.org>
2019-02-08 12:58:31 +00:00
Paul Cercueil
a50e32694f
ASoC: codecs: jz4725b: Use C++ style comments in header
Change the header comment to use C++ style, so that it looks more
consistent with the rest of ASoC.

Signed-off-by: Paul Cercueil <paul@crapouillou.net>
Signed-off-by: Mark Brown <broonie@kernel.org>
2019-02-07 14:38:49 +00:00
Paul Cercueil
edcd3ed182
ASoC: codecs: Kconfig: Show knob, and depend on MIPS || COMPILE_TEST
Show the knob to enable or disable the jz4740-codec driver, add a
proper description, and add a dependency on MIPS || COMPILE_TEST, as
this driver is only useful on MIPS.

Signed-off-by: Paul Cercueil <paul@crapouillou.net>
Signed-off-by: Mark Brown <broonie@kernel.org>
2019-02-07 14:38:39 +00:00
Paul Cercueil
030a79e977
ASoC: codecs: jz4740: Add support for devicetree
Add support for probing the driver from devicetree.

Signed-off-by: Paul Cercueil <paul@crapouillou.net>
Signed-off-by: Mark Brown <broonie@kernel.org>
2019-02-07 14:38:25 +00:00
Paul Cercueil
06a334ae98
ASoC: codecs: jz4740: Use SPDX license notifier
Add license information as a standard SPDX license notifier instead of
custom text.

Signed-off-by: Paul Cercueil <paul@crapouillou.net>
Signed-off-by: Mark Brown <broonie@kernel.org>
2019-02-07 14:38:10 +00:00
Paul Cercueil
f58f2b0a9f
dt-bindings: sound: Document jz4725b-codec bindings
Add documentation about how to probe the jz4725b-codec driver from
devicetree.

Signed-off-by: Paul Cercueil <paul@crapouillou.net>
Signed-off-by: Mark Brown <broonie@kernel.org>
2019-02-07 14:38:01 +00:00
Paul Cercueil
7c536bade3
dt-bindings: sound: Document jz4740-codec bindings
Add documentation about how to probe the jz4740-codec driver from
devicetree.

Signed-off-by: Paul Cercueil <paul@crapouillou.net>
Signed-off-by: Mark Brown <broonie@kernel.org>
2019-02-07 14:36:04 +00:00
Danny Milosavljevic
67690c286d
ASoC: sun4i-codec: Add Line Playback Volume, Line Boost Volume, Line Right, Line Left, Line Playback Switch
Add Line Playback Volume for Allwinner A10 and Allwinner A20.
Add Line Boost Volume for Allwinner A10 and Allwinner A20.
Add Line Right, Line Left, Line Playback Switch for Allwinner A10 and
Allwinner A20.

Signed-off-by: Danny Milosavljevic <dannym@scratchpost.org>
Reviewed-by: Chen-Yu Tsai <wens@csie.org>
Signed-off-by: Mark Brown <broonie@kernel.org>
2019-02-07 12:15:23 +00:00
Danny Milosavljevic
50d1641948
ASoC: sun4i-codec: Add FM Playback Volume, FM Left, FM Right, FM Playback Switch
Add FM Playback Volume for Allwinner A10 and Allwinner A20.
Add FM Left, FM Right, FM Playback Switch for Allwinner A10 and
Allwinner A20.

Signed-off-by: Danny Milosavljevic <dannym@scratchpost.org>
Reviewed-by: Chen-Yu Tsai <wens@csie.org>
Signed-off-by: Mark Brown <broonie@kernel.org>
2019-02-07 12:15:17 +00:00
Danny Milosavljevic
44a1f4e8cf
ASoC: sun4i-codec: Add Mic1 Playback Switch, Mic2 Playback Switch
Add Mic1 Playback Switch and Mic2 Playback Switch for Allwinner A10 and
Allwinner A20.

Signed-off-by: Danny Milosavljevic <dannym@scratchpost.org>
Reviewed-by: Chen-Yu Tsai <wens@csie.org>
Signed-off-by: Mark Brown <broonie@kernel.org>
2019-02-07 12:15:14 +00:00
Danny Milosavljevic
0bbb8e83cf
ASoC: sun4i-codec: Merge sun4i_codec_left_mixer_controls and sun4i_codec_right_mixer_controls into sun4i_codec_mixer_controls
Since it's now possible to have a DAPM mixer control with multiple
channels, use it to cut down the total number of controls.

Keep "Left Mixer Left DAC Playback Switch" and "Right Mixer Right DAC
Playback Switch" name & layout the same as before for compatibility.

Signed-off-by: Danny Milosavljevic <dannym@scratchpost.org>
Reviewed-by: Chen-Yu Tsai <wens@csie.org>
Signed-off-by: Mark Brown <broonie@kernel.org>
2019-02-07 12:15:08 +00:00
Danny Milosavljevic
b329c78eb0
ASoC: sun4i-codec: Add Mic1 Boost Volume, Mic2 Boost Volume
Add Mic1 Boost Volume and Mic2 Boost Volume for Allwinner A10 and for
Allwinner A20.

Those controls are in different registers per chip model, so put the
Allwinner A10 controls and the Allwinner A20 controls into the newly
split sun4i_codec_controls and sun7i_codec_controls, respectively.

Signed-off-by: Danny Milosavljevic <dannym@scratchpost.org>
Reviewed-by: Chen-Yu Tsai <wens@csie.org>
Signed-off-by: Mark Brown <broonie@kernel.org>
2019-02-07 12:15:04 +00:00
Danny Milosavljevic
b71a7eb56c
ASoC: sun4i-codec: Add sun7i_codec_controls, sun7i_codec_codec
Introduce sun7i_codec_controls because some of the controls are different
on Allwinner A20 compared to Allwinner A10.

Also introduce sun7i_codec_codec in order to use sun7i_codec_controls and
make sun7i_codec_quirks use sun7i_codec_codec.

Signed-off-by: Danny Milosavljevic <dannym@scratchpost.org>
Reviewed-by: Chen-Yu Tsai <wens@csie.org>
Signed-off-by: Mark Brown <broonie@kernel.org>
2019-02-07 12:15:00 +00:00
Danny Milosavljevic
b5a656030c
ASoC: sun4i-codec: Add Mic Playback Volume
Add a control "Mic Playback Volume" that allows the user to control the
MIC gain stage (common for Mic1 and Mic2) leading to the output mixer.

Signed-off-by: Danny Milosavljevic <dannym@scratchpost.org>
Reviewed-by: Chen-Yu Tsai <wens@csie.org>
Signed-off-by: Mark Brown <broonie@kernel.org>
2019-02-07 12:14:57 +00:00
Danny Milosavljevic
63bd84890f
ASoC: sun4i-codec: Add MIC2 Pre-Amplifier, Mic2 input
Add MIC2 Pre-Amplifier, Mic2 input for Allwinner A10 and Allwinner A20.

Previously, there only the Mic1 input and MIC1 Pre-Amplifier was exposed.
This exposes the Mic2 input and MIC2 Pre-Amplifier.

Signed-off-by: Danny Milosavljevic <dannym@scratchpost.org>
Reviewed-by: Chen-Yu Tsai <wens@csie.org>
Signed-off-by: Mark Brown <broonie@kernel.org>
2019-02-07 12:14:53 +00:00
Colin Ian King
6c3e630236
ASoC: codecs: jz4725b: fix spelling mistake "Deemphatize" -> "Deemphasize"
There is a spelling mistake in the SOC_SINGLE control name. Fix this.

Signed-off-by: Colin Ian King <colin.king@canonical.com>
Signed-off-by: Mark Brown <broonie@kernel.org>
2019-02-07 12:10:33 +00:00
kbuild test robot
afb8662650
ASoC: wcd9335: fix semicolon.cocci warnings
sound/soc/codecs/wcd-clsh-v2.c:545:2-3: Unneeded semicolon
sound/soc/codecs/wcd-clsh-v2.c:211:2-3: Unneeded semicolon
sound/soc/codecs/wcd-clsh-v2.c:250:2-3: Unneeded semicolon

 Remove unneeded semicolon.

Generated by: scripts/coccinelle/misc/semicolon.cocci

Fixes: cc2e324d39 ("ASoC: wcd9335: add CLASS-H Controller support")
CC: Srinivas Kandagatla <srinivas.kandagatla@linaro.org>
Signed-off-by: kbuild test robot <fengguang.wu@intel.com>
Signed-off-by: Mark Brown <broonie@kernel.org>
2019-02-07 12:08:33 +00:00
Paul Cercueil
e9d97b05a8
ASoC: codecs: Add jz4725b-codec driver
Add jz4725b-codec driver to support the internal CODEC found in the
JZ4725B SoC from Ingenic.

Signed-off-by: Paul Cercueil <paul@crapouillou.net>
Signed-off-by: Mark Brown <broonie@kernel.org>
2019-02-06 18:16:38 +00:00
Pierre-Louis Bossart
f13d4b5f85
ASoC: dapm: harden use of lookup tables
To detect potential errors, let's add:

a) build-time warnings when the table size isn't aligned with the enum
list
b) run-time warnings when the values are not initialized. This
requires an increase by one of all values to avoid the default 0.

Suggested-by: Takashi Iwai <tiwai@suse.de>
Signed-off-by: Pierre-Louis Bossart <pierre-louis.bossart@linux.intel.com>
Signed-off-by: Mark Brown <broonie@kernel.org>
2019-02-06 17:32:02 +00:00
Mark Brown
e29fe437ea
Merge branch 'asoc-5.0' into asoc-5.1 for dapm table 2019-02-06 17:31:39 +00:00
Pierre-Louis Bossart
c16e120100
ASoC: dapm: fix out-of-bounds accesses to DAPM lookup tables
KASAN reports and additional traces point to out-of-bounds accesses to
the dapm_up_seq and dapm_down_seq lookup tables. The indices used are
larger than the array definition.

Fix by adding missing entries for the new widget types in these two
lookup tables, and align them with PGA values.

Also the sequences for the following widgets were not defined. Since
their values defaulted to zero, assign them explicitly

 snd_soc_dapm_input
 snd_soc_dapm_output
 snd_soc_dapm_vmid
 snd_soc_dapm_siggen
 snd_soc_dapm_sink

Fixes: 8a70b4544e ('ASoC: dapm: Add new widget type for constructing DAPM graphs on DSPs.').
Signed-off-by: Pierre-Louis Bossart <pierre-louis.bossart@linux.intel.com>
Signed-off-by: Mark Brown <broonie@kernel.org>
2019-02-06 17:25:49 +00:00
Marco Felsch
4730640183
ASoC: ssm2602: switch to SPDX identifier
Drop old license header and switch to SPDX-License-Identifier.

Signed-off-by: Marco Felsch <m.felsch@pengutronix.de>
Signed-off-by: Mark Brown <broonie@kernel.org>
2019-02-06 17:05:53 +00:00
Charles Keepax
4ef0ecb80e
ASoC: compress: Add helper functions for component trigger/set_params
The trigger and set_params callbacks are called from 3 and 2 separate
loops respectively, tidy up the code a little by factoring these out
into helper functions.

Signed-off-by: Charles Keepax <ckeepax@opensource.cirrus.com>
Signed-off-by: Mark Brown <broonie@kernel.org>
2019-02-06 15:51:04 +00:00
Charles Keepax
52cadf1fdb
ASoC: compress: Clarify the intent of current compressed ops handling
For callbacks configuring the state of the components (trigger,
set_params, ack and set_metadata) simplify the code a little and make
intention clearer by aborting as soon as an error is encountered. The
operation has already failed and there is nothing to be gained from
processing the callbacks on additional components. The operations
currently abort after the callbacks, so this simply shortens the
error path.

For callbacks returning information from the driver (copy,
get_metadata, pointer, get_codec_caps, get_caps and get_params)
only look for the first callback provided, currently the code will
call every callback only returning the information provided by the
last. Since we can only return one set of data, it makes no sense to
request the data from every component. Again this just makes the
currently supported feature set a little more clear.

Signed-off-by: Charles Keepax <ckeepax@opensource.cirrus.com>
Signed-off-by: Mark Brown <broonie@kernel.org>
2019-02-06 15:50:50 +00:00
Dan Carpenter
d22b411753
ASoC: wcd9335: remove some unnecessary NULL checks
These are arrays, not pointers, and they can't be NULL.

Signed-off-by: Dan Carpenter <dan.carpenter@oracle.com>
Signed-off-by: Mark Brown <broonie@kernel.org>
2019-02-06 15:46:42 +00:00
Philipp Zabel
37768e3917
ASoC: ssm2602: Fix ADC powerup sequencing
According to the ssm2603 data sheet (control register sequencing), the
digital core should be activated only after all necessary bits in the
power register are enabled, and a delay determined by the decoupling
capacitor on the VMID pin has passed. If the digital core is activated
too early, or even before the ADC is powered up, audible artifacts
appear at the beginning of the recorded signal.

The digital core is also needed for playback, so when recording starts
it may already be enabled. This means we cannot get the power sequence
correct when we want to be able to start recording after playback.

As a workaround put the MIC mute switch into the DAPM routes. This
way we can keep the recording disabled until the MIC Bias has settled
and thus get rid of audible artifacts.

Signed-off-by: Philipp Zabel <p.zabel@pengutronix.de>
m.felsch@pengutronix.de: adapt commit message
m.felsch@pengutronix.de: drop of configuration as mentioned by Mark:
			 https://patchwork.kernel.org/patch/10407449/
Signed-off-by: Marco Felsch <m.felsch@pengutronix.de>
Signed-off-by: Mark Brown <broonie@kernel.org>
2019-02-06 15:46:06 +00:00
Charles Keepax
cf17a5ffd2
ASoC: dapm: Check for NULL widget in dapm_update_dai_unlocked
DAIs linked to the dummy will not have an associated playback/capture
widget, so we need to skip the update in that case.

Fixes: 078a85f280 ("ASoC: dapm: Only power up active channels from a DAI")
Reported-by: Krzysztof Kozlowski <krzk@kernel.org>
Signed-off-by: Charles Keepax <ckeepax@opensource.cirrus.com>
Tested-by: Sylwester Nawrocki <s.nawrocki@samsung.com>
Tested-by: Krzysztof Kozlowski <krzk@kernel.org>
Signed-off-by: Mark Brown <broonie@kernel.org>
2019-02-06 15:42:27 +00:00
Clément Péron
0f747bb273
ASoC: ak4118: fix missing header
This driver use the gpio consumer interface.
Add the header as it's needed.

Signed-off-by: Clément Péron <peron.clem@gmail.com>
Signed-off-by: Mark Brown <broonie@kernel.org>
2019-02-04 17:12:05 +01:00
Colin Ian King
766cc4965a
ASoC: mediatek: btcvsd: fix spelling mistake "offest" -> "offset"
There is a spelling mistake in a dev_warn message. Fix this.

Signed-off-by: Colin Ian King <colin.king@canonical.com>
Signed-off-by: Mark Brown <broonie@kernel.org>
2019-02-04 17:12:03 +01:00
Bard liao
adfebb51e1
ASoC: topology: unload physical dai link in remove
soc_tplg_link_config() will find the physical dai link and call
soc_tplg_dai_link_load() to load the BE dai link. Currently remove_link()
is only used to remove the FE dai link which is created by the topology.
The BE dai link cannot however be unloaded in snd_soc_tplg_component
_remove(), which is problematic if anything needs to be released or
reinitialized.

This patch aligns the definitions of dynamic types with the existing
UAPI and adds a new remove_backend_link() routine to unload the the BE
dai link when snd_soc_tplg_component_remove() is invoked.

Signed-off-by: Bard liao <yung-chuan.liao@linux.intel.com>
Signed-off-by: Pierre-Louis Bossart <pierre-louis.bossart@linux.intel.com>
Signed-off-by: Mark Brown <broonie@kernel.org>
2019-02-04 11:59:30 +01:00
Curtis Malainey
78a24e10cd
ASoC: soc-core: clear platform pointers on error
Originally snd_soc_init_platform was not cleaning up its pointers, this
was fixed to always reallocate dynamic memory but created a memory leak
when snd_soc_init_platform was called multiple times during the same
probe attempt and also threw away any changes made to the struct between
calls. In order to avoid reallocating memory that is still valid, the
behaviour will be changed to clear the dynamically set pointers on a
probe error and a unregister event and snd_soc_init_platform will go
back to its original behaviour of only allocating null pointers so it will
stop throwing away valid changes.

Signed-off-by: Curtis Malainey <cujomalainey@chromium.org>
Signed-off-by: Mark Brown <broonie@kernel.org>
2019-02-04 10:23:51 +01:00
wen yang
11907e9d35
ASoC: fsl-asoc-card: fix object reference leaks in fsl_asoc_card_probe
The of_find_device_by_node() takes a reference to the underlying device
structure, we should release that reference.

Signed-off-by: Wen Yang <yellowriver2010@hotmil.com>
Cc: Timur Tabi <timur@kernel.org>
Cc: Nicolin Chen <nicoleotsuka@gmail.com>
Cc: Xiubo Li <Xiubo.Lee@gmail.com>
Cc: Fabio Estevam <festevam@gmail.com>
Cc: Liam Girdwood <lgirdwood@gmail.com>
Cc: Mark Brown <broonie@kernel.org>
Cc: Jaroslav Kysela <perex@perex.cz>
Cc: Takashi Iwai <tiwai@suse.com>
Cc: alsa-devel@alsa-project.org
Cc: linuxppc-dev@lists.ozlabs.org
Cc: linux-kernel@vger.kernel.org
Signed-off-by: Mark Brown <broonie@kernel.org>
2019-02-04 10:03:44 +01:00
Zhiwei Jiang
411db2ab7d
ASoC: dapm: Add warnings for widget overwrite when adding route
Currently, in some complex cases, more than one widgets have same
name and registed from differnt dapm context, and route add from
another context too. When snd_soc_dapm_add_route, the previous
registered widget will overwritten by the latest same name widget,
will cause unexpect error. For Asoc framework we cant avoid this
situation and we cant decide which widget that wanted with route.
At least we can give users a notice.

Signed-off-by: Zhiwei Jiang <qq282012236@gmail.com>
Signed-off-by: Mark Brown <broonie@kernel.org>
2019-02-02 17:15:27 +01:00
Charles Keepax
078a85f280
ASoC: dapm: Only power up active channels from a DAI
Currently all widgets attached to a DAI link will be powered
up when the DAI is active, however this may include routes
that are not actually in use if there are unused channels
available on the DAI.

The macros for creating AIF widgets already include an entry for
slot, it is proposed to change that to channel. The effective
difference here being respresenting the logical channel index
rather than the physical slot index. The CODECs currently
using the slot entry on the DAPM_AIF macros are using it in
a manner consistent with this, the CODECs not using it just
have the field set to zero.

A variable is added to snd_soc_dapm_widget to represent
this channel index and then for each AIF widget attached to
a DAI this is compared against the number of channels on
the stream. Enabling the links for those which will be in
use. This has the nice property that the CODECs which haven't
used the slot/channel entry in the macro will function exactly
as before due to all the AIF widgets having a channel of zero
and a stream by definition having at least one channel.

Signed-off-by: Charles Keepax <ckeepax@opensource.cirrus.com>
Signed-off-by: Mark Brown <broonie@kernel.org>
2019-02-02 17:15:17 +01:00
Guennadi Liakhovetski
52abe6cc18
ASoC: topology: fix oops/use-after-free case with dai driver
rmmod/modprobe tests expose a kernel oops when accessing the dai
driver pointer. This comes from the topology design which operates in
multiple passes. Each object removal happens at a specific iteration,
and the code checks for the iteration (order) number after the memory
containing the order was freed.

Fix this be clearing a reference to the dai driver and check its
validity to avoid dereferences.

Signed-off-by: Guennadi Liakhovetski <guennadi.liakhovetski@intel.com>
Signed-off-by: Pierre-Louis Bossart <pierre-louis.bossart@linux.intel.com>
Signed-off-by: Mark Brown <broonie@kernel.org>
2019-02-02 17:13:28 +01:00
Pierre-Louis Bossart
199ed3e81c
ASoC: dapm: fix use-after-free issue with dailink sname
Commit 7620fe9161 ("ASoC: topology: fix memory leak in
soc_tplg_dapm_widget_create") fixed a memory leak issue, but
additional tests and KASAN reports show a use-after-free in soc-dapm.

The widgets are created with a kmemdup operating on a template. The
"name" string is also duplicated, but the "sname" string is not. As a
result, when the template is freed after widget creation, its sname
string is still used.

Fix by explicitly duplicating the "sname" string, and freeing it when
required.

Signed-off-by: Pierre-Louis Bossart <pierre-louis.bossart@linux.intel.com>
Signed-off-by: Mark Brown <broonie@kernel.org>
2019-02-02 17:13:09 +01:00
KaiChieh Chuang
4bd8597dc3
ASoC: mediatek: add btcvsd driver
The driver function for transferring/receiving
BT encoded data to/from BT firmware.

Signed-off-by: KaiChieh Chuang <kaichieh.chuang@mediatek.com>
Signed-off-by: Mark Brown <broonie@kernel.org>
2019-02-02 15:59:27 +00:00
KaiChieh Chuang
425da20a98
ASoC: mediatek: add documents for btcvsd driver
document for btcvsd driver

Signed-off-by: KaiChieh Chuang <kaichieh.chuang@mediatek.com>
Signed-off-by: Mark Brown <broonie@kernel.org>
2019-02-02 15:58:43 +00:00
Charles Keepax
909d74e39f
ASoC: arizona: Add channel numbers to AIFs
Set the channel number on each AIF widget to allow unused channels not
to be powered up across AIFs.

Signed-off-by: Charles Keepax <ckeepax@opensource.cirrus.com>
Signed-off-by: Mark Brown <broonie@kernel.org>
2019-02-02 15:42:34 +00:00
Kuninori Morimoto
2264cf2e5d
ASoC: rsnd: fixup TDM Split mode check for CTU
Renesas sound card need to judge that whether it is using
"TDM Split mode". To judge it and for other purpose, it has
rsnd_parse_connect_simple() and rsnd_parse_connect_graph(),
but these are using different judgement policy for
TDM Split mode.
It is pointless and confusable.
This patch add new rsnd_parse_tdm_split_mode() and use common
judgement policy for simple-card/audio-graph.

Without this patch, CTU will be judged as TDM Split mode
on audio-graph card.

Signed-off-by: Kuninori Morimoto <kuninori.morimoto.gx@renesas.com>
Signed-off-by: Mark Brown <broonie@kernel.org>
2019-02-02 15:42:11 +00:00