linux
5 years agoASoC: omap-mcbsp: Fix latency value calculation for pm_qos
Peter Ujfalusi [Wed, 14 Nov 2018 11:06:21 +0000 (13:06 +0200)]
ASoC: omap-mcbsp: Fix latency value calculation for pm_qos

The latency number is in usec for the pm_qos. Correct the calculation to
give us the time in usec

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>
5 years agoASoC: audio-graph-card: tidyup define position
Kuninori Morimoto [Thu, 22 Nov 2018 00:57:40 +0000 (00:57 +0000)]
ASoC: audio-graph-card: tidyup define position

commit f986907c9225 ("ASoC: audio-graph-card: add widgets and routing for
external amplifier support") added new function
asoc_graph_card_outdrv_event(), but the inserted position breaks
define area. This patch tidyup it

Signed-off-by: Kuninori Morimoto <kuninori.morimoto.gx@renesas.com>
Signed-off-by: Mark Brown <broonie@kernel.org>
5 years agoASoC: audio-graph-card: tidyup typo SND_AUDIO_GRAPH_CARD
Kuninori Morimoto [Thu, 22 Nov 2018 00:57:23 +0000 (00:57 +0000)]
ASoC: audio-graph-card: tidyup typo SND_AUDIO_GRAPH_CARD

1 "simple" is enough on Kconfig help

Signed-off-by: Kuninori Morimoto <kuninori.morimoto.gx@renesas.com>
Signed-off-by: Mark Brown <broonie@kernel.org>
5 years agoASoC: audio-graph-scu-card: tidyup asoc_simple_card_parse_daifmt() timing
Kuninori Morimoto [Thu, 22 Nov 2018 00:57:09 +0000 (00:57 +0000)]
ASoC: audio-graph-scu-card: tidyup asoc_simple_card_parse_daifmt() timing

Current audio-graph-scu-card driver is parsing codec position for DPCM
and consider DAI format. But, current operation is doing totally pointless,
because 1) asoc_simple_card_parse_daifmt() will be called not only for 1st
codec on current implementation, and it will be used as fixed format
2) it should be called for each CPU/Codec pair.
Let's tidyup asoc_simple_card_parse_daifmt() timing.

Signed-off-by: Kuninori Morimoto <kuninori.morimoto.gx@renesas.com>
Signed-off-by: Mark Brown <broonie@kernel.org>
5 years agoASoC: audio-graph-scu-card: tidyup "convert-rate/channels" parsing
Kuninori Morimoto [Thu, 22 Nov 2018 00:56:53 +0000 (00:56 +0000)]
ASoC: audio-graph-scu-card: tidyup "convert-rate/channels" parsing

audio-graph-scu-card.c is supporting "convert-rate/channels" which is
used for DPCM.
But, sound card might have multi codecs, and each codec might need
each convert-rate/channels.

This patch supports each codec's convert-rate/channles support.
top node convert-rate/channels will overwrite settings if exist.

It can't support each codec's convert-rate/channels if sound card had
multi codecs without this patch.

Signed-off-by: Kuninori Morimoto <kuninori.morimoto.gx@renesas.com>
Signed-off-by: Mark Brown <broonie@kernel.org>
5 years agoASoC: audio-graph-scu-card: tidyup "convert-rate/channels" parsing on Doc
Kuninori Morimoto [Thu, 22 Nov 2018 00:56:41 +0000 (00:56 +0000)]
ASoC: audio-graph-scu-card: tidyup "convert-rate/channels" parsing on Doc

audio-graph-scu-card.c is supporting "convert-rate/channels" which is
used for DPCM.
But, sound card might have multi codecs, and each codec might need
each convert-rate/channels.

This patch supports each codec's convert-rate/channles support.
top node convert-rate/channels will overwrite settings if exist.

It can't support each codec's convert-rate/channels if sound card had
multi codecs without this patch.

Signed-off-by: Kuninori Morimoto <kuninori.morimoto.gx@renesas.com>
Signed-off-by: Mark Brown <broonie@kernel.org>
5 years agoASoC: audio-graph-scu-card: tidyup "prefix" parsing
Kuninori Morimoto [Thu, 22 Nov 2018 00:56:21 +0000 (00:56 +0000)]
ASoC: audio-graph-scu-card: tidyup "prefix" parsing

audio-graph-scu-card.c is supporting "prefix" which is used to avoid
DAI naming conflict when CPU/Codec matching.
But, sound card might have multi sub-devices, and each codec might need
each prefix.

Now, ASoC is supporting snd_soc_of_parse_node_prefix(), let's support
it on audio-graph-scu-card, too. It is keeping existing DT style.

It can't support each codec's prefix if sound card had multi sub-devices
without this patch.

Signed-off-by: Kuninori Morimoto <kuninori.morimoto.gx@renesas.com>
Signed-off-by: Mark Brown <broonie@kernel.org>
5 years agoASoC: audio-graph-scu-card: tidyup "prefix" parsing on Doc
Kuninori Morimoto [Thu, 22 Nov 2018 00:55:54 +0000 (00:55 +0000)]
ASoC: audio-graph-scu-card: tidyup "prefix" parsing on Doc

audio-graph-scu-card.c is supporting "prefix" which is used to avoid
DAI naming conflict when CPU/Codec matching.
But, sound card might have multi sub-devices, and each codec might need
each prefix.

Now, ASoC is supporting snd_soc_of_parse_node_prefix(), let's support
it on audio-graph-scu-card, too. It is keeping existing DT style.

It can't support each codec's prefix if sound card had multi sub-devices
without this patch.

Signed-off-by: Kuninori Morimoto <kuninori.morimoto.gx@renesas.com>
Signed-off-by: Mark Brown <broonie@kernel.org>
5 years agoASoC: simple-scu-card: tidyup "prefix" parsing
Kuninori Morimoto [Thu, 22 Nov 2018 00:55:40 +0000 (00:55 +0000)]
ASoC: simple-scu-card: tidyup "prefix" parsing

simple-scu-card.c is supporting "prefix" which is used to avoid
DAI naming conflict when CPU/Codec matching.
But, sound card might have multi sub-devices, and each codec might need
each prefix.

Now, ASoC is supporting snd_soc_of_parse_node_prefix(), let's support
it on audio-graph-scu-card, too. It is keeping existing DT style.

It can't support each codec's prefix if sound card had multi sub-devices
without this patch.

Signed-off-by: Kuninori Morimoto <kuninori.morimoto.gx@renesas.com>
Signed-off-by: Mark Brown <broonie@kernel.org>
5 years agoASoC: simple-scu-card: tidyup "prefix" parsing on Doc
Kuninori Morimoto [Thu, 22 Nov 2018 00:55:24 +0000 (00:55 +0000)]
ASoC: simple-scu-card: tidyup "prefix" parsing on Doc

simple-scu-card.c is supporting "prefix" which is used to avoid
DAI naming conflict when CPU/Codec matching.
But, sound card might have multi sub-devices, and each codec might need
each prefix.

Now, ASoC is supporting snd_soc_of_parse_node_prefix(), let's support
it on audio-graph-scu-card, too. It is keeping existing DT style.

It can't support each codec's prefix if sound card had multi sub-devices
without this patch.

Signed-off-by: Kuninori Morimoto <kuninori.morimoto.gx@renesas.com>
Signed-off-by: Mark Brown <broonie@kernel.org>
5 years agoASoC: soc-core: add snd_soc_of_parse_node_prefix()
Kuninori Morimoto [Thu, 22 Nov 2018 00:55:09 +0000 (00:55 +0000)]
ASoC: soc-core: add snd_soc_of_parse_node_prefix()

Current ASoC has snd_soc_of_parse_audio_prefix() to get codec_conf
settings from DT which is used to avoid DAI naming conflict when
CPU/Codec matching.

Currently, it is parsing from "top node",
but, we want to parse from "each sub node" if sound card had multi
cpus/codecs.

This patch adds new snd_soc_of_parse_node_prefix() to allow parsing
settings from selected node.
It is keeping existing snd_soc_of_parse_audio_prefix() by using macro.

Signed-off-by: Kuninori Morimoto <kuninori.morimoto.gx@renesas.com>
Signed-off-by: Mark Brown <broonie@kernel.org>
5 years agoASoC: simple-amplifier: add VCC regulator widget
Vasily Khoruzhick [Thu, 22 Nov 2018 10:23:21 +0000 (18:23 +0800)]
ASoC: simple-amplifier: add VCC regulator widget

Amplifier may have assosicated regulator, so add a widget for it
and appropriate route.

Signed-off-by: Vasily Khoruzhick <anarsoul@gmail.com>
Signed-off-by: Chen-Yu Tsai <wens@csie.org>
Acked-by: Maxime Ripard <maxime.ripard@bootlin.com>
Signed-off-by: Mark Brown <broonie@kernel.org>
5 years agoASoC: dt-bindings: add regulator property to simple amplifier
Vasily Khoruzhick [Thu, 22 Nov 2018 10:23:20 +0000 (18:23 +0800)]
ASoC: dt-bindings: add regulator property to simple amplifier

Amplifier may have associated regulator, so add a property for it.

Signed-off-by: Vasily Khoruzhick <anarsoul@gmail.com>
Signed-off-by: Chen-Yu Tsai <wens@csie.org>
Signed-off-by: Mark Brown <broonie@kernel.org>
5 years agoASoC: sunxi: sun50i-codec-analog: Add support for cpvdd regulator supply
Chen-Yu Tsai [Thu, 22 Nov 2018 10:23:19 +0000 (18:23 +0800)]
ASoC: sunxi: sun50i-codec-analog: Add support for cpvdd regulator supply

On the Allwinner A64 SoCs, the audio codec has a built-in headphone
amplifier. This amplifier has a power supply separate from the rest of
the analog audio circuitry, labeled cpvdd.

This patch adds a DAPM widget for this supply, and ties it to the
headphone amp widget.

Signed-off-by: Chen-Yu Tsai <wens@csie.org>
Acked-by: Maxime Ripard <maxime.ripard@bootlin.com>
Signed-off-by: Mark Brown <broonie@kernel.org>
5 years agoASoC: dt-bindings: sun50i-codec-analog: Add headphone amp regulator supply
Chen-Yu Tsai [Thu, 22 Nov 2018 10:23:18 +0000 (18:23 +0800)]
ASoC: dt-bindings: sun50i-codec-analog: Add headphone amp regulator supply

On the Allwinner A64 SoC, the audio codec has a built-in headphone
amplifier. This amplifier has a power supply separate from the rest of
the analog audio circuitry.

Add a regulator supply property to handle this.

Signed-off-by: Chen-Yu Tsai <wens@csie.org>
Signed-off-by: Mark Brown <broonie@kernel.org>
5 years agoASoC: simple_card_utils: remove "option" from asoc_simple_card_of_parse_routing()
Kuninori Morimoto [Wed, 21 Nov 2018 02:11:13 +0000 (02:11 +0000)]
ASoC: simple_card_utils: remove "option" from asoc_simple_card_of_parse_routing()

asoc_simple_card_of_parse_routing() had "option" parameter
to consider error handling, but it is very pointless parameter.
Let's remove it.

Signed-off-by: Kuninori Morimoto <kuninori.morimoto.gx@renesas.com>
Signed-off-by: Mark Brown <broonie@kernel.org>
5 years agoASoC: simple-card-utils: tidyup asoc_simple_card_parse_convert()
Kuninori Morimoto [Wed, 21 Nov 2018 02:10:51 +0000 (02:10 +0000)]
ASoC: simple-card-utils: tidyup asoc_simple_card_parse_convert()

Current simple-card-utils has asoc_simple_card_parse_convert() to parse
convert channel/rate for be_hw_params_fixup.
But, it is parsing from top of node.

If sound card had multi subnode, we need to parse it from each sub node.
This patch tidyup asoc_simple_card_parse_convert() to allow parsing
settings from each node.

Signed-off-by: Kuninori Morimoto <kuninori.morimoto.gx@renesas.com>
Signed-off-by: Mark Brown <broonie@kernel.org>
5 years agoASoC: simple-card-utils: accept NULL parameter on asoc_simple_card_xxx()
Kuninori Morimoto [Wed, 21 Nov 2018 02:09:16 +0000 (02:09 +0000)]
ASoC: simple-card-utils: accept NULL parameter on asoc_simple_card_xxx()

If simple-card-utils accept NULL pointer on asoc_simple_card_xxx(),
each driver code will be more simple.
Let's accept NULL pointer.

Signed-off-by: Kuninori Morimoto <kuninori.morimoto.gx@renesas.com>
Signed-off-by: Mark Brown <broonie@kernel.org>
5 years agoASoC: simple-card-utils: remove asoc_simple_card_clk_register()
Kuninori Morimoto [Wed, 21 Nov 2018 02:08:59 +0000 (02:08 +0000)]
ASoC: simple-card-utils: remove asoc_simple_card_clk_register()

asoc_simple_card_clk_register() is used but only 1 user,
and very pointless code. Let's remove it.

Signed-off-by: Kuninori Morimoto <kuninori.morimoto.gx@renesas.com>
Signed-off-by: Mark Brown <broonie@kernel.org>
5 years agoASoC: rsnd: makes rsnd_ssi_is_dma_mode() static
Kuninori Morimoto [Wed, 21 Nov 2018 08:15:30 +0000 (08:15 +0000)]
ASoC: rsnd: makes rsnd_ssi_is_dma_mode() static

ssi.c only is using rsnd_ssi_is_dma_mode().
Let's move it as static function.

Signed-off-by: Kuninori Morimoto <kuninori.morimoto.gx@renesas.com>
Signed-off-by: Mark Brown <broonie@kernel.org>
5 years agoASoC: rsnd: tidyup rsnd_parse_connect_ssiu_compatible()
Kuninori Morimoto [Wed, 21 Nov 2018 01:58:30 +0000 (01:58 +0000)]
ASoC: rsnd: tidyup rsnd_parse_connect_ssiu_compatible()

rsnd_parse_connect_ssiu_compatible() is doing
 - using rsnd_ssiu_id(), but we use it via rsnd_mod_id()
 - we can break loop if rsnd_dai_connect() was called
This patch fixup these.

Signed-off-by: Kuninori Morimoto <kuninori.morimoto.gx@renesas.com>
Signed-off-by: Mark Brown <broonie@kernel.org>
5 years agoASoC: rsnd: Add device tree support for r8a77995
Hiroyuki Yokoyama [Wed, 21 Nov 2018 01:06:43 +0000 (01:06 +0000)]
ASoC: rsnd: Add device tree support for r8a77995

Simply document new compat strings.
There appears to be no need for a driver updates.

Signed-off-by: Hiroyuki Yokoyama <hiroyuki.yokoyama.vx@renesas.com>
Signed-off-by: Kuninori Morimoto <kuninori.morimoto.gx@renesas.com>
Signed-off-by: Mark Brown <broonie@kernel.org>
5 years agoASoC: sdm845: Add support for Secondary MI2S interface
Rohit kumar [Fri, 16 Nov 2018 07:41:58 +0000 (13:11 +0530)]
ASoC: sdm845: Add support for Secondary MI2S interface

Add support to configure bit clock for secondary MI2S
TX interface.

Signed-off-by: Rohit kumar <rohitkr@codeaurora.org>
Acked-by: Srinivas Kandagatla <srinivas.kandagatla@linaro.org>
Signed-off-by: Mark Brown <broonie@kernel.org>
5 years agoASoC: sdm845: Update slot_width for Quaternary TDM port
Rohit kumar [Fri, 16 Nov 2018 07:41:57 +0000 (13:11 +0530)]
ASoC: sdm845: Update slot_width for Quaternary TDM port

Change slot_width for quaternary TDM port to 16 and
update bclk rate for TDM and MI2S interfaces
accordingly.

Signed-off-by: Rohit kumar <rohitkr@codeaurora.org>
Acked-by: Srinivas Kandagatla <srinivas.kandagatla@linaro.org>
Signed-off-by: Mark Brown <broonie@kernel.org>
5 years agoASoC: Intel: use platform_data for machine drivers
Pierre-Louis Bossart [Sat, 17 Nov 2018 00:47:06 +0000 (18:47 -0600)]
ASoC: Intel: use platform_data for machine drivers

For some reason we have different mechanisms for passing data to
machine drivers. Use the solution used by Atom/SST and SOF instead of
using drv_data as done by Skylake.

Signed-off-by: Pierre-Louis Bossart <pierre-louis.bossart@linux.intel.com>
Signed-off-by: Mark Brown <broonie@kernel.org>
5 years agoASoC: Intel: fix interface for Chromebook machine drivers
Pierre-Louis Bossart [Sat, 17 Nov 2018 00:47:05 +0000 (18:47 -0600)]
ASoC: Intel: fix interface for Chromebook machine drivers

The changes for HDaudio overlooked the fact that the machine drivers
used for Chromebooks rely on the dmic number information passed as
pdata.

Add dmic_num field to standard interface and use standard interface
instead of SKL-specific one.

Also clean-up pdata definition to remove fields that are no longer
used.

Fixes: 842bb5135f10 ('ASoC: Intel: use standard interface for Hdaudio machine driver')
Signed-off-by: Pierre-Louis Bossart <pierre-louis.bossart@linux.intel.com>
Signed-off-by: Mark Brown <broonie@kernel.org>
5 years agoASoC: acpi: fix: continue searching when machine is ignored
Keyon Jie [Sat, 17 Nov 2018 00:47:04 +0000 (18:47 -0600)]
ASoC: acpi: fix: continue searching when machine is ignored

The machine_quirk may return NULL which means the acpi entries should be
skipped and search for next matched entry is needed, here add return
check here and continue for NULL case.

Signed-off-by: Keyon Jie <yang.jie@linux.intel.com>
Signed-off-by: Pierre-Louis Bossart <pierre-louis.bossart@linux.intel.com>
Signed-off-by: Mark Brown <broonie@kernel.org>
5 years agoASoC: Intel: Skylake: fix Kconfigs, make HDaudio codec optional
Pierre-Louis Bossart [Sun, 18 Nov 2018 22:38:09 +0000 (16:38 -0600)]
ASoC: Intel: Skylake: fix Kconfigs, make HDaudio codec optional

The Skylake driver currently has a set of problems supporting
load/unload modules. We need to make the HDaudio codec support
optional to help narrow down the issues.

Support for HDaudio codecs also leads to a Kconfig issue. We want the
hdac_hda codec to be compilable independently of Skylake (e.g. with
ALL_CODECS) but when Skylake is selected as built-in the hdac_hda
codec needs to use the same option due a a code dependency

Solve both problems by adding a user-selectable boolean Kconfig,
select HDAC_HDA as needed and make the HDaudio codec support in the
Skylake driver optional. Tests on a Chell Chromebook device without
HDaudio show no regression for speaker and HDMI playback.

This is submitted as an RFC to allow for comments and more validation.

Signed-off-by: Pierre-Louis Bossart <pierre-louis.bossart@linux.intel.com>
Signed-off-by: Mark Brown <broonie@kernel.org>
5 years agoASoC: tlv320aic3x: Add support for CBM_CFS and CBS_CFM clocking modes
Peter Ujfalusi [Tue, 20 Nov 2018 12:42:53 +0000 (14:42 +0200)]
ASoC: tlv320aic3x: Add support for CBM_CFS and CBS_CFM clocking modes

The codec can support any variation of bclk/fs master/slave configuration.

Signed-off-by: Peter Ujfalusi <peter.ujfalusi@ti.com>
Signed-off-by: Mark Brown <broonie@kernel.org>
5 years agoMAINTAINERS: add ASoC maintainers for sound dt-bindings
Clément Péron [Sat, 17 Nov 2018 12:14:52 +0000 (13:14 +0100)]
MAINTAINERS: add ASoC maintainers for sound dt-bindings

Sound dt-bindings are applied by ASoC maintainers and should be
submit to ASoC list in addition to the devicetree list.

Hence, add this information into the MAINTAINERS file.

Signed-off-by: Clément Péron <peron.clem@gmail.com>
Signed-off-by: Mark Brown <broonie@kernel.org>
5 years agoASoC: rt5663: Fix error handling of regulator_set_load
Cheng-Yi Chiang [Fri, 16 Nov 2018 09:28:56 +0000 (17:28 +0800)]
ASoC: rt5663: Fix error handling of regulator_set_load

The default implementation of regulator_set_load returns
REGULATOR_MODE_NORMAL, which is positive.  [This was a bug which is
being fixed but the change is valid anyway -- bronie]

rt5663_i2c_probe should only do error handling when return value of
regulator_set_load is negative.
In this case, rt5663_i2c_probe should return error.

Also, consolidate err_irq into err_enable.

Fix the missing goto for temporary regmap and rt5663->regmap.

Signed-off-by: Cheng-Yi Chiang <cychiang@chromium.org>
Signed-off-by: Mark Brown <broonie@kernel.org>
5 years agoASoC: amd: fix spelling mistake "Inavlid" -> "Invalid"
Colin Ian King [Fri, 16 Nov 2018 13:39:43 +0000 (13:39 +0000)]
ASoC: amd: fix spelling mistake "Inavlid" -> "Invalid"

There is a spelling mistake in a dev_err message. Fix this.

Signed-off-by: Colin Ian King <colin.king@canonical.com>
Signed-off-by: Mark Brown <broonie@kernel.org>
5 years agoASoC: qcom: clean up indentation, remove extraneous tab
Colin Ian King [Fri, 16 Nov 2018 15:06:36 +0000 (15:06 +0000)]
ASoC: qcom: clean up indentation, remove extraneous tab

The return statement is indented too much by one level, fix this by
removing the extraneous tab.

Signed-off-by: Colin Ian King <colin.king@canonical.com>
Signed-off-by: Mark Brown <broonie@kernel.org>
5 years agoASoC: arizona: fix indentation issue with return statement
Colin Ian King [Fri, 16 Nov 2018 15:06:35 +0000 (15:06 +0000)]
ASoC: arizona: fix indentation issue with return statement

The return statement is indented incorrectly. Fix this by adding in
the missing tab.

Signed-off-by: Colin Ian King <colin.king@canonical.com>
Signed-off-by: Mark Brown <broonie@kernel.org>
5 years agoASoC: tlv320dac33: clean up indentation, remove extraneous tab
Colin Ian King [Fri, 16 Nov 2018 15:06:34 +0000 (15:06 +0000)]
ASoC: tlv320dac33: clean up indentation, remove extraneous tab

The goto statement is indented too much by one level, fix this by
removing the extraneous tab.

Signed-off-by: Colin Ian King <colin.king@canonical.com>
Signed-off-by: Mark Brown <broonie@kernel.org>
5 years agoASoC: tlv320aic31xx: asihpi: clean up indentation, remove extraneous tab
Colin Ian King [Fri, 16 Nov 2018 15:06:33 +0000 (15:06 +0000)]
ASoC: tlv320aic31xx: asihpi: clean up indentation, remove extraneous tab

The return statement is indented too much by one level, fix this by
removing an extraneous tab.

Signed-off-by: Colin Ian King <colin.king@canonical.com>
Signed-off-by: Mark Brown <broonie@kernel.org>
5 years agoASoC: Convert a few more users to using %pOFn instead of device_node.name
Rob Herring [Fri, 16 Nov 2018 21:43:49 +0000 (15:43 -0600)]
ASoC: Convert a few more users to using %pOFn instead of device_node.name

In preparation to remove the node name pointer from struct device_node,
convert printf users to use the %pOFn format specifier.

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: Olivier Moysan <olivier.moysan@st.com>
Cc: Arnaud Pouliquen <arnaud.pouliquen@st.com>
Cc: Maxime Coquelin <mcoquelin.stm32@gmail.com>
Cc: Alexandre Torgue <alexandre.torgue@st.com>
Cc: alsa-devel@alsa-project.org
Cc: linux-stm32@st-md-mailman.stormreply.com
Cc: linux-arm-kernel@lists.infradead.org
Signed-off-by: Rob Herring <robh@kernel.org>
Signed-off-by: Mark Brown <broonie@kernel.org>
5 years agoASoC: rt5663: Add documentation for power supply support
Cheng-Yi Chiang [Fri, 16 Nov 2018 02:12:43 +0000 (10:12 +0800)]
ASoC: rt5663: Add documentation for power supply support

rt5663 codec driver will support setting CPVDD and AVDD power supply
from device tree.

Signed-off-by: Cheng-Yi Chiang <cychiang@chromium.org>
Signed-off-by: Mark Brown <broonie@kernel.org>
5 years agoASoC: Add documentation for pcm3060 property out-single-ended
Kirill Marinushkin [Thu, 15 Nov 2018 07:12:53 +0000 (08:12 +0100)]
ASoC: Add documentation for pcm3060 property out-single-ended

Output of pcm3060 codec may be configured as single-ended or differential

Signed-off-by: Kirill Marinushkin <kmarinushkin@birdec.tech>
Signed-off-by: Mark Brown <broonie@kernel.org>
5 years agoASoC: rt5663: Add regulator support
Cheng-Yi Chiang [Thu, 15 Nov 2018 04:13:34 +0000 (12:13 +0800)]
ASoC: rt5663: Add regulator support

Add regulator support to turn on cpvdd and avdd in probe.
If a regulator is not given from device tree, a dummy regulator will be
used.

Signed-off-by: Cheng-Yi Chiang <cychiang@chromium.org>
Signed-off-by: Mark Brown <broonie@kernel.org>
5 years agoASoC: ak4118: Add support for AK4118 S/PDIF transceiver
Adrien Charruel [Wed, 14 Nov 2018 12:16:41 +0000 (13:16 +0100)]
ASoC: ak4118: Add support for AK4118 S/PDIF transceiver

The AK4118A is a digital audio transceiver supporting 8 input channels
at 192kHz and with 24bits resolution.
It converts the S/PDIF signal to I2S format and is configurable over I2C.

This driver introduce a minimal support of the AK4118, like selecting the
input channel, reading input frequency and detecting some errors.

Datasheet is available here:
https://www.akm.com/akm/en/file/datasheet/AK4118AEQ.pdf

Signed-off-by: Adrien Charruel <adrien.charruel@devialet.com>
Signed-off-by: Clément Péron <peron.clem@gmail.com>
Signed-off-by: Mark Brown <broonie@kernel.org>
5 years agoASoC: dt-bindings: add bindings for AK4118 transceiver
Clément Péron [Wed, 14 Nov 2018 12:16:42 +0000 (13:16 +0100)]
ASoC: dt-bindings: add bindings for AK4118 transceiver

Document the bindings for AK4118 S/PDIF transceiver

Signed-off-by: Clément Péron <peron.clem@gmail.com>
Signed-off-by: Mark Brown <broonie@kernel.org>
5 years agoASoC: pcm186x: Fix device reset-registers trigger value
Andreas Dannenberg [Thu, 15 Nov 2018 17:01:31 +0000 (11:01 -0600)]
ASoC: pcm186x: Fix device reset-registers trigger value

According to the current device datasheet (TI Lit # SLAS831D, revised
March 2018) the value written to the device's PAGE register to trigger
a complete register reset should be 0xfe, not 0xff. So go ahead and
update to the correct value.

Reported-by: Stephane Le Provost <stephane.leprovost@mediatek.com>
Tested-by: Stephane Le Provost <stephane.leprovost@mediatek.com>
Signed-off-by: Andreas Dannenberg <dannenberg@ti.com>
Acked-by: Andrew F. Davis <afd@ti.com>
Signed-off-by: Mark Brown <broonie@kernel.org>
Cc: stable@vger.kernel.org
5 years agoASoC: amd: remove set but not used variable 'dma_buffer'
YueHaibing [Thu, 15 Nov 2018 01:56:35 +0000 (01:56 +0000)]
ASoC: amd: remove set but not used variable 'dma_buffer'

Fixes gcc '-Wunused-but-set-variable' warning:

sound/soc/amd/raven/acp3x-pcm-dma.c: In function 'acp3x_dma_hw_params':
sound/soc/amd/raven/acp3x-pcm-dma.c:333:25: warning:
 variable 'dma_buffer' set but not used [-Wunused-but-set-variable]

It never used since introduction in commit
8de1b5ed0337 ("ASoC: amd: add acp3x system resume pm op")

Signed-off-by: YueHaibing <yuehaibing@huawei.com>
Signed-off-by: Mark Brown <broonie@kernel.org>
5 years agoASoC: amd: Switch to SPDX identifier
Vijendar Mukunda [Thu, 15 Nov 2018 16:13:50 +0000 (21:43 +0530)]
ASoC: amd: Switch to SPDX identifier

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

Reviewed-by: Alex Deucher <alexander.deucher@amd.com>
Signed-off-by: Vijendar Mukunda <vijendar.mukunda@amd.com>
Signed-off-by: Mark Brown <broonie@kernel.org>
5 years agoASoC: amd: Fixed build errors
Vijendar Mukunda [Thu, 15 Nov 2018 16:13:49 +0000 (21:43 +0530)]
ASoC: amd: Fixed build errors

Fixed build errors.
- Implicit declaration of pci_enable_msi() & pci_disable_msi()
api's for openrisc architecture.
- type defaults to 'int' in declaration of 'module_pci_driver'

Enabled build for x86 architecture.

Reviewed-by: Alex Deucher <alexander.deucher@amd.com>
Signed-off-by: Vijendar Mukunda <vijendar.mukunda@amd.com>
Tested-by: Ravulapati Vishnu vardhan Rao <Vishnuvardhanrao.Ravulapati@amd.com>
Signed-off-by: Mark Brown <broonie@kernel.org>
5 years agoASoC: nau8822: convert to SPDX identifiers
David Lin [Thu, 15 Nov 2018 09:49:13 +0000 (17:49 +0800)]
ASoC: nau8822: convert to SPDX identifiers

This patch fixes typo in the comment.

Signed-off-by: David Lin <CTLIN0@nuvoton.com>
Signed-off-by: Mark Brown <broonie@kernel.org>
5 years agoASoC: nau8822: convert to SPDX identifiers
David Lin [Thu, 15 Nov 2018 09:14:47 +0000 (17:14 +0800)]
ASoC: nau8822: convert to SPDX identifiers

This patch updates license to SPDX-License-Identifier
instead of verbose license text.

Signed-off-by: David Lin <CTLIN0@nuvoton.com>
Signed-off-by: Mark Brown <broonie@kernel.org>
5 years agoASoC: dapm: Recalculate audio map forcely when card instantiated
Tzung-Bi Shih [Wed, 14 Nov 2018 09:06:13 +0000 (17:06 +0800)]
ASoC: dapm: Recalculate audio map forcely when card instantiated

Audio map are possible in wrong state before card->instantiated has
been set to true.  Imaging the following examples:

time 1: at the beginning

  in:-1    in:-1    in:-1    in:-1
 out:-1   out:-1   out:-1   out:-1
 SIGGEN        A        B      Spk

time 2: after someone called snd_soc_dapm_new_widgets()
(e.g. create_fill_widget_route_map() in sound/soc/codecs/hdac_hdmi.c)

   in:1     in:0     in:0     in:0
  out:0    out:0    out:0    out:1
 SIGGEN        A        B      Spk

time 3: routes added

   in:1     in:0     in:0     in:0
  out:0    out:0    out:0    out:1
 SIGGEN -----> A -----> B ---> Spk

In the end, the path should be powered on but it did not.  At time 3,
"in" of SIGGEN and "out" of Spk did not propagate to their neighbors
because snd_soc_dapm_add_path() will not invalidate the paths if
the card has not instantiated (i.e. card->instantiated is false).
To correct the state of audio map, recalculate the whole map forcely.

Signed-off-by: Tzung-Bi Shih <tzungbi@google.com>
Signed-off-by: Mark Brown <broonie@kernel.org>
5 years agoASoC: omap-abe-twl6040: Fix missing audio card caused by deferred probing
Peter Ujfalusi [Wed, 14 Nov 2018 12:58:20 +0000 (14:58 +0200)]
ASoC: omap-abe-twl6040: Fix missing audio card caused by deferred probing

The machine driver fails to probe in next-20181113 with:

[    2.539093] omap-abe-twl6040 sound: ASoC: CODEC DAI twl6040-legacy not registered
[    2.546630] omap-abe-twl6040 sound: devm_snd_soc_register_card() failed: -517
...
[    3.693206] omap-abe-twl6040 sound: ASoC: Both platform name/of_node are set for TWL6040
[    3.701446] omap-abe-twl6040 sound: ASoC: failed to init link TWL6040
[    3.708007] omap-abe-twl6040 sound: devm_snd_soc_register_card() failed: -22
[    3.715148] omap-abe-twl6040: probe of sound failed with error -22

Bisect pointed to a merge commit:
first bad commit: [0f688ab20a540aafa984c5dbd68a71debebf4d7f] Merge remote-tracking branch 'net-next/master'

and a diff between a working kernel does not reveal anything which would
explain the change in behavior.

Further investigation showed that on the second try of loading fails
because the dai_link->platform is no longer NULL and it might be pointing
to uninitialized memory.

The fix is to move the snd_soc_dai_link and snd_soc_card inside of the
abe_twl6040 struct, which is dynamically allocated every time the driver
probes.

Signed-off-by: Peter Ujfalusi <peter.ujfalusi@ti.com>
Signed-off-by: Mark Brown <broonie@kernel.org>
5 years agoASoC: amd: fix memory leak of i2s_data on error return
Colin Ian King [Wed, 14 Nov 2018 21:31:48 +0000 (21:31 +0000)]
ASoC: amd: fix memory leak of i2s_data on error return

Currently when snd_pcm_hw_constraint_integer fails there is
a memory leak of i2s_data on the error return path. Fix this by
kfree'ing i2s_data before returning.

Detected by CoverityScan, CID#1475479 ("Resource leak")

Fixes: 0b87d6bcd648 ("ASoC: amd: add acp3x pcm driver dma ops")
Signed-off-by: Colin Ian King <colin.king@canonical.com>
Signed-off-by: Mark Brown <broonie@kernel.org>
5 years agoASoC: pcm3060: Add DT property for single-ended output
Kirill Marinushkin [Mon, 12 Nov 2018 07:08:33 +0000 (08:08 +0100)]
ASoC: pcm3060: Add DT property for single-ended output

DAC output may be differential (default) or single-ended.

Signed-off-by: Kirill Marinushkin <kmarinushkin@birdec.tech>
Signed-off-by: Mark Brown <broonie@kernel.org>
5 years agoASoC: pcm3060: Rename output widgets
Kirill Marinushkin [Mon, 12 Nov 2018 07:08:34 +0000 (08:08 +0100)]
ASoC: pcm3060: Rename output widgets

In the initial commit [1], I added differential output of the codec as
separate `+` and `-` widgets:

OUTL+
OUTR+
OUTL-
OUTR-

Later, in the commit [2], I added a device tree property to configure the
output as single-ended or differential. Having this property, the `+` and
`-` separation in widgets seems for me confusing. There are no functional
benefits in such separation, so I find reasonable to get rid of it:

OUTL
OUTR

The new naming is more friendly for sound cards, and is better aligned with
other codec drivers in kernel.

Renaming the output widgets now should not be a problem from the backwards-
compatibility perspective, as the driver for PCM3060 is added into the
mainline very recently, and did not yet appear in any releases.

[1] commit 6ee47d4a8dac ("ASoC: pcm3060: Add codec driver")
[2] commit a78c62de00d5 ("ASoC: pcm3060: Add DT property for single-ended
    output")

Signed-off-by: Kirill Marinushkin <kmarinushkin@birdec.tech>
Signed-off-by: Mark Brown <broonie@kernel.org>
5 years agoASoC: stm32: sai: fix invalid use of sizeof in stm32_sai_add_mclk_provider()
Wei Yongjun [Sat, 27 Oct 2018 02:19:59 +0000 (02:19 +0000)]
ASoC: stm32: sai: fix invalid use of sizeof in stm32_sai_add_mclk_provider()

sizeof() when applied to a pointer typed expression gives the
size of the pointer, not that of the pointed data.

Fixes: 8307b2afd386 ("ASoC: stm32: sai: set sai as mclk clock provider")
Signed-off-by: Wei Yongjun <weiyongjun1@huawei.com>
Signed-off-by: Mark Brown <broonie@kernel.org>
5 years agoASoC: qcom: Set dai_link id to each dai_link
Rohit kumar [Thu, 8 Nov 2018 13:41:40 +0000 (19:11 +0530)]
ASoC: qcom: Set dai_link id to each dai_link

Frontend dai_link id is used for closing ADM sessions.
During concurrent usecase when one session is closed,
it closes other ADM session associated with other usecase
too. Dai_link->id should always point to Frontend dai id.
Set cpu_dai id as dai_link id to fix the issue.

Signed-off-by: Rohit kumar <rohitkr@codeaurora.org>
Acked-by: Srinivas Kandagatla <srinivas.kandagatla@linaro.org>
Signed-off-by: Mark Brown <broonie@kernel.org>
5 years agoASoC: sun8i-codec: add missing route for ADC
Vasily Khoruzhick [Fri, 9 Nov 2018 04:24:19 +0000 (20:24 -0800)]
ASoC: sun8i-codec: add missing route for ADC

sun8i-codec misses a route from ADC to AIF1 Slot 0 ADC. Add it
to the driver to avoid adding it to every dts.

Fixes: eda85d1fee05d ("ASoC: sun8i-codec: Add ADC support for a33")
Signed-off-by: Vasily Khoruzhick <anarsoul@gmail.com>
Signed-off-by: Mark Brown <broonie@kernel.org>
5 years agoASoC: amd: enable acp3x drivers build
Vijendar Mukunda [Mon, 12 Nov 2018 05:35:02 +0000 (11:05 +0530)]
ASoC: amd: enable acp3x drivers build

ACP3x drivers can be built by selecting necessary kernel config option.
The patch enables build support of the same.

Signed-off-by: Maruthi Bayyavarapu <maruthi.bayyavarapu@amd.com>
Tested-by: Ravulapati Vishnu vardhan Rao <Vishnuvardhanrao.Ravulapati@amd.com>
Signed-off-by: Vijendar Mukunda <vijendar.mukunda@amd.com>
Signed-off-by: Mark Brown <broonie@kernel.org>
5 years agoASoC: amd: add acp3x system resume pm op
Vijendar Mukunda [Mon, 12 Nov 2018 05:35:01 +0000 (11:05 +0530)]
ASoC: amd: add acp3x system resume pm op

When system wide suspend happens, ACP will be powered off.
When system resumes, all the runtime configuration data for
ACP needs to be programmed again.
Added 'resume'pm call back to ACP pm ops.

Signed-off-by: Maruthi Bayyavarapu <maruthi.bayyavarapu@amd.com>
Tested-by: Ravulapati Vishnu vardhan Rao <Vishnuvardhanrao.Ravulapati@amd.com>
Signed-off-by: Vijendar Mukunda <vijendar.mukunda@amd.com>
Signed-off-by: Mark Brown <broonie@kernel.org>
5 years agoASoC: amd: add acp3x runtime pm ops
Vijendar Mukunda [Mon, 12 Nov 2018 05:35:00 +0000 (11:05 +0530)]
ASoC: amd: add acp3x runtime pm ops

Added runtime PM operations for ACP3x PCM platform device.

Signed-off-by: Maruthi Bayyavarapu <maruthi.bayyavarapu@amd.com>
Tested-by: Ravulapati Vishnu vardhan Rao <Vishnuvardhanrao.Ravulapati@amd.com>
Signed-off-by: Vijendar Mukunda <vijendar.mukunda@amd.com>
Signed-off-by: Mark Brown <broonie@kernel.org>
5 years agoASoC: amd: add acp3x tdm mode support
Vijendar Mukunda [Mon, 12 Nov 2018 05:34:59 +0000 (11:04 +0530)]
ASoC: amd: add acp3x tdm mode support

ACP3x I2S (CPU DAI) can act in normal I2S and TDM modes.
Added support for TDM mode.
Desired mode can be selected from ASoC machine driver.

Signed-off-by: Maruthi Bayyavarapu <maruthi.bayyavarapu@amd.com>
Tested-by: Ravulapati Vishnu vardhan Rao <Vishnuvardhanrao.Ravulapati@amd.com>
Signed-off-by: Vijendar Mukunda <vijendar.mukunda@amd.com>
Signed-off-by: Mark Brown <broonie@kernel.org>
5 years agoASoC: amd: add acp3x i2s ops
Vijendar Mukunda [Mon, 12 Nov 2018 05:34:58 +0000 (11:04 +0530)]
ASoC: amd: add acp3x i2s ops

ACP3x has a i2s controller block for playback and capture.
This patch adds ACP3x i2s DAI operations.

Signed-off-by: Maruthi Bayyavarapu <maruthi.bayyavarapu@amd.com>
Tested-by: Ravulapati Vishnu vardhan Rao <Vishnuvardhanrao.Ravulapati@amd.com>
Signed-off-by: Vijendar Mukunda <vijendar.mukunda@amd.com>
Signed-off-by: Mark Brown <broonie@kernel.org>
5 years agoASoC: amd: add acp3x pcm driver dma ops
Vijendar Mukunda [Mon, 12 Nov 2018 05:34:57 +0000 (11:04 +0530)]
ASoC: amd: add acp3x pcm driver dma ops

ACP3x has a DMA controller to access system memory.
This controller transfers data from/to system memory
to/from the ACP internal FIFO.
The patch adds PCM driver DMA operations.

Signed-off-by: Maruthi Bayyavarapu <maruthi.bayyavarapu@amd.com>
Tested-by: Ravulapati Vishnu vardhan Rao <Vishnuvardhanrao.Ravulapati@amd.com>
Signed-off-by: Vijendar Mukunda <vijendar.mukunda@amd.com>
Signed-off-by: Mark Brown <broonie@kernel.org>
5 years agoASoC: amd: Interrupt handler changes for ACP3x DMA driver
Vijendar Mukunda [Mon, 12 Nov 2018 05:34:56 +0000 (11:04 +0530)]
ASoC: amd: Interrupt handler changes for ACP3x DMA driver

Whenever audio data equal to the I2S FIFO watermark level are
produced/consumed, interrupt is generated.
Acknowledge the interrupt.

Signed-off-by: Maruthi Bayyavarapu <maruthi.bayyavarapu@amd.com>
Tested-by: Ravulapati Vishnu vardhan Rao <Vishnuvardhanrao.Ravulapati@amd.com>
Signed-off-by: Vijendar Mukunda <vijendar.mukunda@amd.com>
Signed-off-by: Mark Brown <broonie@kernel.org>
5 years agoASoC: amd: add ACP3x PCM platform driver
Vijendar Mukunda [Mon, 12 Nov 2018 05:34:55 +0000 (11:04 +0530)]
ASoC: amd: add ACP3x PCM platform driver

PCM platform driver binds to the platform device created by ACP3x PCI
device. PCM driver registers ALSA DMA and CPU DAI components with ASoC
framework.

Signed-off-by: Maruthi Bayyavarapu <maruthi.bayyavarapu@amd.com>
Tested-by: Ravulapati Vishnu vardhan Rao <Vishnuvardhanrao.Ravulapati@amd.com>
Signed-off-by: Vijendar Mukunda <vijendar.mukunda@amd.com>
Signed-off-by: Mark Brown <broonie@kernel.org>
5 years agoASoC: amd: create ACP3x PCM platform device
Vijendar Mukunda [Mon, 12 Nov 2018 05:34:54 +0000 (11:04 +0530)]
ASoC: amd: create ACP3x PCM platform device

ACP 3x IP has I2S controller device as one of IP blocks.
Create a platform device for it, so that the PCM platform driver
can be bound to this device. Pass PCI resources like MMIO, irq
to the platform device.

Signed-off-by: Maruthi Bayyavarapu <maruthi.bayyavarapu@amd.com>
Tested-by: Ravulapati Vishnu vardhan Rao <vishnuvardhanrao.ravulapati@amd.com>
Signed-off-by: Vijendar Mukunda <vijendar.mukunda@amd.com>
Signed-off-by: Mark Brown <broonie@kernel.org>
5 years agoASoC: AMD: add ACP3.0 PCI driver
Maruthi Srinivas Bayyavarapu [Mon, 12 Nov 2018 05:34:53 +0000 (11:04 +0530)]
ASoC: AMD: add ACP3.0 PCI driver

ACP 3.0 is a PCI audio device. This patch adds PCI driver to bind
to this device and get PCI resources.

Signed-off-by: Maruthi Bayyavarapu <maruthi.bayyavarapu@amd.com>
Signed-off-by: Sanju R Mehta <sanju.mehta@amd.com>
Tested-by: Ravulapati Vishnu vardhan Rao <Vishnuvardhanrao.Ravulapati@amd.com>
Signed-off-by: Vijendar Mukunda <vijendar.mukunda@amd.com>
Signed-off-by: Mark Brown <broonie@kernel.org>
5 years agoASoC: AMD: add ACP 3.x IP register header
Maruthi Srinivas Bayyavarapu [Mon, 12 Nov 2018 05:34:52 +0000 (11:04 +0530)]
ASoC: AMD: add ACP 3.x IP register header

ACP 3.x is a new audio block in raven. Added register header
of the same.

Signed-off-by: Maruthi Bayyavarapu <maruthi.bayyavarapu@amd.com>
Signed-off-by: Vijendar Mukunda <vijendar.mukunda@amd.com>
Signed-off-by: Mark Brown <broonie@kernel.org>
5 years agoASoC: Intel: Power down links before turning off display audio power
Pierre-Louis Bossart [Fri, 9 Nov 2018 19:39:23 +0000 (13:39 -0600)]
ASoC: Intel: Power down links before turning off display audio power

On certain platforms, Display HDMI HDA codec was not going to sleep state
after the use when links are powered down after turning off the display
power. As per the HW recommendation, links are powered down before turning
off the display power to ensure that the codec goes to sleep state.

This patch was updated from an earlier version submitted upstream [1]
which conflicted with the changes merged for HDaudio codec support
with the Intel DSP.

[1] https://patchwork.kernel.org/patch/10540213/

Signed-off-by: Sriram Periyasamy <sriramx.periyasamy@intel.com>
Signed-off-by: Sanyog Kale <sanyog.r.kale@intel.com>
Signed-off-by: Pierre-Louis Bossart <pierre-louis.bossart@linux.intel.com>
Signed-off-by: Mark Brown <broonie@kernel.org>
5 years agoASoC: Intel: hdac_hdmi: add Icelake support
Bard liao [Sat, 10 Nov 2018 21:18:46 +0000 (05:18 +0800)]
ASoC: Intel: hdac_hdmi: add Icelake support

Add Icelake device id. Also, Icelake's pin2port mapping table is
complicated. So we use a mapping table to do the pin2port mapping.

Signed-off-by: Bard liao <bard.liao@intel.com>
Acked-by: Pierre-Louis Bossart <pierre-louis.bossart@linux.intel.com>
Signed-off-by: Mark Brown <broonie@kernel.org>
5 years agoASoC: wm_adsp: Factor out common init code
Richard Fitzgerald [Mon, 12 Nov 2018 13:36:39 +0000 (13:36 +0000)]
ASoC: wm_adsp: Factor out common init code

Factor out the duplicated initialization statements from
wm_adsp1_init() and wm_adsp2_init() into new function
wm_adsp_common_init().

The entire content of wm_adsp1_init() is the common code
but it is convenient to retain this exported function
to hide what we currently treat as common init (which might
change in the future) and also make clear the difference
between an ADSP1 entry point and common code.

Signed-off-by: Richard Fitzgerald <rf@opensource.cirrus.com>
Signed-off-by: Mark Brown <broonie@kernel.org>
5 years agoASoC: wm_adsp: Fix dma-unsafe read of scratch registers
Richard Fitzgerald [Mon, 12 Nov 2018 13:36:38 +0000 (13:36 +0000)]
ASoC: wm_adsp: Fix dma-unsafe read of scratch registers

Stack memory isn't DMA-safe so it isn't safe to use either
regmap_raw_read or regmap_bulk_read to read into stack memory.

The two functions to read the scratch registers were using
stack memory and regmap_raw_read. It's not worth allocating
memory just for this trivial read, and it isn't time-critical.
A simple regmap_read for each register is sufficient.

Signed-off-by: Richard Fitzgerald <rf@opensource.cirrus.com>
Signed-off-by: Mark Brown <broonie@kernel.org>
5 years agoASoC: rockchip: add missing slave_config setting for I2S
Katsuhiro Suzuki [Sat, 10 Nov 2018 15:18:44 +0000 (00:18 +0900)]
ASoC: rockchip: add missing slave_config setting for I2S

This patch adds missing prepare_sleve_config that is needed for
setup the DMA slave channel for I2S.

Signed-off-by: Katsuhiro Suzuki <katsuhiro@katsuster.net>
Signed-off-by: Mark Brown <broonie@kernel.org>
5 years agoASoC: omap-mcbsp: No need to initialize max_xx_thres when it is not used
Peter Ujfalusi [Thu, 8 Nov 2018 07:30:00 +0000 (09:30 +0200)]
ASoC: omap-mcbsp: No need to initialize max_xx_thres when it is not used

Initializing to -EINVAL is not correct as the variables are unsigned and
if buffer_size is 0 then they are not used anyway.

Signed-off-by: Peter Ujfalusi <peter.ujfalusi@ti.com>
Acked-by: Jarkko Nikula <jarkko.nikula@bitmer.com>
Tested-by: Jarkko Nikula <jarkko.nikula@bitmer.com>
Signed-off-by: Mark Brown <broonie@kernel.org>
5 years agoASoC: omap-mcbsp: Remove redundant check for mcbsp->pdata
Peter Ujfalusi [Thu, 8 Nov 2018 07:29:59 +0000 (09:29 +0200)]
ASoC: omap-mcbsp: Remove redundant check for mcbsp->pdata

The driver will not probe if the pdata is not provided or created.

Signed-off-by: Peter Ujfalusi <peter.ujfalusi@ti.com>
Acked-by: Jarkko Nikula <jarkko.nikula@bitmer.com>
Tested-by: Jarkko Nikula <jarkko.nikula@bitmer.com>
Signed-off-by: Mark Brown <broonie@kernel.org>
5 years agoASoC: omap-mcbsp: Re-arrange files for core McBSP and Sidetone function split
Peter Ujfalusi [Thu, 8 Nov 2018 07:29:58 +0000 (09:29 +0200)]
ASoC: omap-mcbsp: Re-arrange files for core McBSP and Sidetone function split

The mcbsp.c was copied a while back from arch/arm/plat-omap/mcbsp.c and it
contained a mix of McBSP and McBSP sidetone functions.

Create new file structure with the following split:
omap-mcbsp.c - McBSP related functions
omap-mcbsp-st.c - McBSP sidetone functionality
omap-mcbsp-priv.h - Private header for internal use
omap-mcbsp.h - Header for user drivers

I have tried to do the code move with minimal code change, cleanup patches
can be based on the new structure.

Signed-off-by: Peter Ujfalusi <peter.ujfalusi@ti.com>
Acked-by: Jarkko Nikula <jarkko.nikula@bitmer.com>
Tested-by: Jarkko Nikula <jarkko.nikula@bitmer.com>
Signed-off-by: Mark Brown <broonie@kernel.org>
5 years agoASoC: omap-mcbsp: Move out the FIFO check from set_threshold and get_delay
Peter Ujfalusi [Thu, 8 Nov 2018 07:29:57 +0000 (09:29 +0200)]
ASoC: omap-mcbsp: Move out the FIFO check from set_threshold and get_delay

Check if the McBSP have FIFO in the omap_mcbsp_set_threshold() and
omap_mcbsp_dai_delay() delay function to skip calling the lower layer if
it is not needed.

Signed-off-by: Peter Ujfalusi <peter.ujfalusi@ti.com>
Acked-by: Jarkko Nikula <jarkko.nikula@bitmer.com>
Tested-by: Jarkko Nikula <jarkko.nikula@bitmer.com>
Signed-off-by: Mark Brown <broonie@kernel.org>
5 years agoASoC: omap-mcbsp: Simplify the mcbsp_start/_stop function parameters
Peter Ujfalusi [Thu, 8 Nov 2018 07:29:56 +0000 (09:29 +0200)]
ASoC: omap-mcbsp: Simplify the mcbsp_start/_stop function parameters

We either start/stop TX or RX, never both. Move the tx/rx direction
selection within the functions.

Signed-off-by: Peter Ujfalusi <peter.ujfalusi@ti.com>
Acked-by: Jarkko Nikula <jarkko.nikula@bitmer.com>
Tested-by: Jarkko Nikula <jarkko.nikula@bitmer.com>
Signed-off-by: Mark Brown <broonie@kernel.org>
5 years agoASoC: omap-mcbsp: Clean up the interrupt handlers
Peter Ujfalusi [Thu, 8 Nov 2018 07:29:55 +0000 (09:29 +0200)]
ASoC: omap-mcbsp: Clean up the interrupt handlers

The parameter name of dev_id is leftover from the old times when we passed
numeric ID as data for the interrupt handlers.

The mcbsp_rx and mcbsp_tx is misleading as they are pointers to the mcbsp
struct.

Signed-off-by: Peter Ujfalusi <peter.ujfalusi@ti.com>
Acked-by: Jarkko Nikula <jarkko.nikula@bitmer.com>
Tested-by: Jarkko Nikula <jarkko.nikula@bitmer.com>
Signed-off-by: Mark Brown <broonie@kernel.org>
5 years agoASoC: omap-mcbsp: Skip dma_data.maxburst initialization
Peter Ujfalusi [Thu, 8 Nov 2018 07:29:54 +0000 (09:29 +0200)]
ASoC: omap-mcbsp: Skip dma_data.maxburst initialization

It is configured runtime so no need to initialize it.

Signed-off-by: Peter Ujfalusi <peter.ujfalusi@ti.com>
Acked-by: Jarkko Nikula <jarkko.nikula@bitmer.com>
Tested-by: Jarkko Nikula <jarkko.nikula@bitmer.com>
Signed-off-by: Mark Brown <broonie@kernel.org>
5 years agoASoC: omap-mcbsp: Clean up dma_data addr initialization code
Peter Ujfalusi [Thu, 8 Nov 2018 07:29:53 +0000 (09:29 +0200)]
ASoC: omap-mcbsp: Clean up dma_data addr initialization code

Make the omap_mcbsp_dma_reg_params() a bit more intuitive to read for the
first glance by using SNDRV_PCM_STREAM_PLAYBACK/CAPTURE and to group the
outermost if case by stream direction.

While there, fix the outdated comment for the function.

Signed-off-by: Peter Ujfalusi <peter.ujfalusi@ti.com>
Acked-by: Jarkko Nikula <jarkko.nikula@bitmer.com>
Tested-by: Jarkko Nikula <jarkko.nikula@bitmer.com>
Signed-off-by: Mark Brown <broonie@kernel.org>
5 years agoASoC: rsnd: use ring buffer for rsnd_mod_name()
Kuninori Morimoto [Fri, 9 Nov 2018 04:15:46 +0000 (04:15 +0000)]
ASoC: rsnd: use ring buffer for rsnd_mod_name()

commit c0ea089dbad4 ("ASoC: rsnd: rsnd_mod_name() handles both name and
ID") merged "name" and "ID" on rsnd_mod_name() to handle sub-ID
(= for CTU/BUSIF).
Then, it decided to share static char to avoid pointless memory.
But, it doesn't work correctry in below case, because last called
name will be used.

dev_xxx(dev, "%s is connected to %s\n",
rsnd_mod_name(mod_a),  /* ssiu[00] */
rsnd_mod_name(mod_b)); /* ssi[0]   */
->
rcar_sound ec500000.sound: ssi[0] is connected to ssi[0]
                           ~~~~~~                 ~~~~~~
We still don't want to have pointless memory, so let's use ring buffer.
16byte x 5 is very enough for this purpose.

dev_xxx(dev, "%s is connected to %s\n",
rsnd_mod_name(mod_a),  /* ssiu[00] */
rsnd_mod_name(mod_b)); /* ssi[0]   */
->
rcar_sound ec500000.sound: ssiu[00] is connected to ssi[0]
                           ~~~~~~~~                 ~~~~~~
Signed-off-by: Kuninori Morimoto <kuninori.morimoto.gx@renesas.com>
Signed-off-by: Mark Brown <broonie@kernel.org>
5 years agoASoC: sun8i-codec: fix crash on module removal
Vasily Khoruzhick [Fri, 9 Nov 2018 04:31:35 +0000 (20:31 -0800)]
ASoC: sun8i-codec: fix crash on module removal

drvdata is actually sun8i_codec, not snd_soc_card, so it crashes
when calling snd_soc_card_get_drvdata().

Drop card and scodec vars anyway since we don't need to
disable/unprepare clocks - it's already done by calling
runtime_suspend()

Drop clk_disable_unprepare() calls for the same reason.

Fixes: 36c684936fae7 ("ASoC: Add sun8i digital audio codec")
Signed-off-by: Vasily Khoruzhick <anarsoul@gmail.com>
Acked-by: Maxime Ripard <maxime.ripard@bootlin.com>
Signed-off-by: Mark Brown <broonie@kernel.org>
5 years agoASoC: fsl_ssi: Change to use DEFINE_SHOW_ATTRIBUTE macro
Yangtao Li [Mon, 5 Nov 2018 14:37:30 +0000 (09:37 -0500)]
ASoC: fsl_ssi: Change to use DEFINE_SHOW_ATTRIBUTE macro

Use DEFINE_SHOW_ATTRIBUTE macro to simplify the code.

Signed-off-by: Yangtao Li <tiny.windzz@gmail.com>
Signed-off-by: Mark Brown <broonie@kernel.org>
5 years agoASoC: rsnd: add TDM Split mode support
Kuninori Morimoto [Tue, 6 Nov 2018 05:21:46 +0000 (05:21 +0000)]
ASoC: rsnd: add TDM Split mode support

This patch adds TDM Split mode support. rsnd driver is assuming
audio-graph-scu-card is used for Sound Card.

This is very simple sample DT settings to use it.

sound_card: sound {
compatible = "audio-graph-scu-card";
...
convert-channels = <8>; /* TDM Split */

dais = <&rsnd_port0     /* playback ch1/ch2 */
&rsnd_port1     /* playback ch3/ch4 */
&rsnd_port2     /* playback ch5/ch6 */
&rsnd_port3     /* playback ch7/ch8 */
>;
};

audio-codec {
...
port {
codec_0: endpoint@1 {
remote-endpoint = <&rsnd_ep0>;
};
codec_1: endpoint@2 {
remote-endpoint = <&rsnd_ep1>;
};
codec_2: endpoint@3 {
remote-endpoint = <&rsnd_ep2>;
};
codec_3: endpoint@4 {
remote-endpoint = <&rsnd_ep3>;
};
};
};

&rcar_sound {
...
ports {
rsnd_port0: port@0 {
rsnd_ep0: endpoint {
remote-endpoint = <&codec_0>;
...
playback = <&ssiu30 &ssi3>;
};
};
rsnd_port1: port@1 {
rsnd_ep1: endpoint {
remote-endpoint = <&codec_1>;
...
playback = <&ssiu31 &ssi3>;
};
};
rsnd_port2: port@2 {
rsnd_ep2: endpoint {
remote-endpoint = <&codec_2>;
...
playback = <&ssiu32 &ssi3>;
};
};
rsnd_port3: port@3 {
rsnd_ep3: endpoint {
remote-endpoint = <&codec_3>;
...
playback = <&ssiu33 &ssi3>;
};
};
};
};

Signed-off-by: Kuninori Morimoto <kuninori.morimoto.gx@renesas.com>
Signed-off-by: Mark Brown <broonie@kernel.org>
5 years agoASoC: rsnd: add TDM Split mode support for Document
Kuninori Morimoto [Tue, 6 Nov 2018 05:21:22 +0000 (05:21 +0000)]
ASoC: rsnd: add TDM Split mode support for Document

This patch adds TDM Split mode support. rsnd driver is assuming
audio-graph-scu-card is used for Sound Card.

Signed-off-by: Kuninori Morimoto <kuninori.morimoto.gx@renesas.com>
Signed-off-by: Mark Brown <broonie@kernel.org>
5 years agoASoC: rsnd: add SSIU BUSIF support
Kuninori Morimoto [Tue, 6 Nov 2018 05:21:08 +0000 (05:21 +0000)]
ASoC: rsnd: add SSIU BUSIF support

Gen2 has BUSIF0-3, Gen3 has BUSIF0-7 on some SSIU.
Current driver is assuming it is using BUSIF0 as default.
Thus, SSI is attaching SSIU (with BUSIF0) by using rsnd_ssiu_attach().
But, TDM split mode also needs other BUSIF to use it.
This patch adds missing SSIU BUSIFx support.

BUSIF is handled by SSIU instead of SSI anymore.
Thus, its settings no longer needed on SSI node on DT.
This patch removes its settings from Document, but driver is still
keeping compatibility. Thus, old DT style is still working.
But, to avoid confusing, it doesn't indicate old compatibility things on
Document. New SoC should have SSIU on DT from this patch.

1) old style DT is still supported (= no rcar_sound,ssiu node on DT)
2) If ssiu is not indicated on playback/capture,
   BUSIF0 will be used as default
playback = <&ssi3>; /* ssiu30 will be selected */
3) you can select own ssiu
playback = <&ssi32 &ssi3>; /* ssiu32 will be selected */

Signed-off-by: Kuninori Morimoto <kuninori.morimoto.gx@renesas.com>
Signed-off-by: Mark Brown <broonie@kernel.org>
5 years agoASoC: rsnd: add SSIU BUSIF support for Document
Kuninori Morimoto [Tue, 6 Nov 2018 05:20:56 +0000 (05:20 +0000)]
ASoC: rsnd: add SSIU BUSIF support for Document

Gen2 has BUSIF0-3, Gen3 has BUSIF0-7 on some SSIU.
Current driver is assuming it is using BUSIF0 as default.
Thus, SSI is attaching SSIU (with BUSIF0) by using rsnd_ssiu_attach().
But, TDM split mode also needs other BUSIF to use it.
This patch adds missing SSIU BUSIFx support.

BUSIF is handled by SSIU instead of SSI anymore.
Thus, its settings no longer needed on SSI node on DT.
This patch removes its settings from Document, but driver is still
keeping compatibility. Thus, old DT style is still working.
But, to avoid confusing, it doesn't indicate old compatibility things on
Document. New SoC should have SSIU on DT from this patch.

1) old style DT is still supported (= no rcar_sound,ssiu node on DT)
2) If ssiu is not indicated on playback/capture,
   BUSIF0 will be used as default
playback = <&ssi3>; /* ssiu30 will be selected */
3) you can select own ssiu
playback = <&ssi32 &ssi3>; /* ssiu32 will be selected */

Signed-off-by: Kuninori Morimoto <kuninori.morimoto.gx@renesas.com>
Signed-off-by: Mark Brown <broonie@kernel.org>
5 years agoASoC: rsnd: tidyup Document for DT binding
Kuninori Morimoto [Tue, 6 Nov 2018 05:20:25 +0000 (05:20 +0000)]
ASoC: rsnd: tidyup Document for DT binding

It has duplicated DT example code on Document.
This patch tidyup these.

Signed-off-by: Kuninori Morimoto <kuninori.morimoto.gx@renesas.com>
Signed-off-by: Mark Brown <broonie@kernel.org>
5 years agoASoC: rsnd: handle DPCM converted rate/chan under core
Kuninori Morimoto [Tue, 6 Nov 2018 05:20:10 +0000 (05:20 +0000)]
ASoC: rsnd: handle DPCM converted rate/chan under core

converted rate/chan are handled each rated module, but
it will be used other module too.
For examle, converted channel is currently used for CTU,
but, it will be used for TDM Split mode, too.

This patch move/merge SRC/CTU hw_param under core.c
and handles converted rate/chan under rsnd_dai_stream.

Signed-off-by: Kuninori Morimoto <kuninori.morimoto.gx@renesas.com>
Signed-off-by: Mark Brown <broonie@kernel.org>
5 years agoASoC: rsnd: move HDMI information from ssi.c to core.c
Kuninori Morimoto [Tue, 6 Nov 2018 05:19:48 +0000 (05:19 +0000)]
ASoC: rsnd: move HDMI information from ssi.c to core.c

Current driver is supporting HDMI output, and its information
are handled under ssi.c. But, it is stream information.
Let's move it from ssi.c to core.c.

Signed-off-by: Kuninori Morimoto <kuninori.morimoto.gx@renesas.com>
Signed-off-by: Mark Brown <broonie@kernel.org>
5 years agoASoC: rsnd: use defined io_playback/io_capture
Kuninori Morimoto [Tue, 6 Nov 2018 05:19:33 +0000 (05:19 +0000)]
ASoC: rsnd: use defined io_playback/io_capture

rdai->playback/rdai->capture are defined as io_playback/io_capture
on __rsnd_dai_probe(). Let's use it instead of original one.

Signed-off-by: Kuninori Morimoto <kuninori.morimoto.gx@renesas.com>
Signed-off-by: Mark Brown <broonie@kernel.org>
5 years agoASoC: rsnd: rename rsnd_runtime_is_ssi_xxx()
Kuninori Morimoto [Tue, 6 Nov 2018 05:19:19 +0000 (05:19 +0000)]
ASoC: rsnd: rename rsnd_runtime_is_ssi_xxx()

Current rsnd driver has rsnd_runtime_is_ssi_xxx() functions,
but it is not only related to SSI, thus, it is misunderstandable.
This patch renames it.

Signed-off-by: Kuninori Morimoto <kuninori.morimoto.gx@renesas.com>
Signed-off-by: Mark Brown <broonie@kernel.org>
5 years agoASoC: rsnd: remove endpoint bidirectional check
Kuninori Morimoto [Tue, 6 Nov 2018 05:18:58 +0000 (05:18 +0000)]
ASoC: rsnd: remove endpoint bidirectional check

DTC commit df536831d02c ("checks: add graph binding checks")
is checking endpoint bidirectional, and it is upstreamed to linux by
commit 50aafd60898a ("scripts/dtc: Update to upstream version
v1.4.6-21-g84e414b0b5bc").
Let's remove own bidirectional check

Signed-off-by: Kuninori Morimoto <kuninori.morimoto.gx@renesas.com>
Signed-off-by: Mark Brown <broonie@kernel.org>
5 years agoASoC: audio-graph-scu-card: remove error check which never happen
Kuninori Morimoto [Tue, 6 Nov 2018 04:36:55 +0000 (04:36 +0000)]
ASoC: audio-graph-scu-card: remove error check which never happen

Current driver is checking situation that can not happen.
This patch removes over-kill check

Signed-off-by: Kuninori Morimoto <kuninori.morimoto.gx@renesas.com>
Signed-off-by: Mark Brown <broonie@kernel.org>
5 years agoASoC: audio-graph-scu-card: remove endpoint bidirectional check
Kuninori Morimoto [Tue, 6 Nov 2018 04:36:41 +0000 (04:36 +0000)]
ASoC: audio-graph-scu-card: remove endpoint bidirectional check

DTC commit df536831d02c ("checks: add graph binding checks")
is checking endpoint bidirectional, and it is upstreamed to linux by
commit 50aafd60898a ("scripts/dtc: Update to upstream version
v1.4.6-21-g84e414b0b5bc").
Let's remove own bidirectional check

Signed-off-by: Kuninori Morimoto <kuninori.morimoto.gx@renesas.com>
Signed-off-by: Mark Brown <broonie@kernel.org>
5 years agoASoC: audio-graph-card: remove endpoint bidirectional check
Kuninori Morimoto [Tue, 6 Nov 2018 04:36:27 +0000 (04:36 +0000)]
ASoC: audio-graph-card: remove endpoint bidirectional check

DTC commit df536831d02c ("checks: add graph binding checks")
is checking endpoint bidirectional, and it is upstreamed to linux by
commit 50aafd60898a ("scripts/dtc: Update to upstream version
v1.4.6-21-g84e414b0b5bc").
Let's remove own bidirectional check

Signed-off-by: Kuninori Morimoto <kuninori.morimoto.gx@renesas.com>
Signed-off-by: Mark Brown <broonie@kernel.org>
5 years agoASoC: Intel: common: add quirk for APL RVP boards
Pierre-Louis Bossart [Thu, 1 Nov 2018 21:34:54 +0000 (16:34 -0500)]
ASoC: Intel: common: add quirk for APL RVP boards

For some reason the RVP/LeafHill SSDT exposes an INT34C3 ID which is
used on other boards to point to the TDF8532 amplifier. Yay BIOS.

Add a DMI-quirk to ignore this ID and check for other valid machine
driver descriptors.

Reviewed-by: Andy Shevchenko <andriy.shevchenko@linux.intel.com>
Signed-off-by: Pierre-Louis Bossart <pierre-louis.bossart@linux.intel.com>
Signed-off-by: Mark Brown <broonie@kernel.org>
5 years agoASoC: Intel: common: add SOF information for APL RVP
Bard liao [Thu, 1 Nov 2018 21:34:53 +0000 (16:34 -0500)]
ASoC: Intel: common: add SOF information for APL RVP

Add firmware/topology information for APL RVP

Reviewed-by: Andy Shevchenko <andriy.shevchenko@linux.intel.com>
Signed-off-by: Bard liao <bard.liao@intel.com>
Signed-off-by: Pierre-Louis Bossart <pierre-louis.bossart@linux.intel.com>
Signed-off-by: Mark Brown <broonie@kernel.org>
5 years agoASoC: Intel: remove GFP_ATOMIC, use GFP_KERNEL
Pierre-Louis Bossart [Thu, 1 Nov 2018 21:34:52 +0000 (16:34 -0500)]
ASoC: Intel: remove GFP_ATOMIC, use GFP_KERNEL

GFP_ATOMIC is not required on any Intel drivers, use GFP_KERNEL
instead. A first cleanup was merged in April but missed a number
occurrences and new ones were added by copy/paste inertia.

While we are at it, make checkpatch happy with a sizeof(*msg)

Reviewed-by: Andy Shevchenko <andriy.shevchenko@linux.intel.com>
Signed-off-by: Pierre-Louis Bossart <pierre-louis.bossart@linux.intel.com>
Signed-off-by: Mark Brown <broonie@kernel.org>
5 years agoASoC: Intel: boards: fix Skylake typo
Pierre-Louis Bossart [Thu, 1 Nov 2018 21:34:51 +0000 (16:34 -0500)]
ASoC: Intel: boards: fix Skylake typo

s/skylaye/skylake

Reviewed-by: Andy Shevchenko <andriy.shevchenko@linux.intel.com>
Signed-off-by: Pierre-Louis Bossart <pierre-louis.bossart@linux.intel.com>
Signed-off-by: Mark Brown <broonie@kernel.org>