openwrt/staging/blogic.git
5 years agoASoC: meson: add axg spdif input DT binding documentation
Jerome Brunet [Tue, 11 Dec 2018 13:47:11 +0000 (14:47 +0100)]
ASoC: meson: add axg spdif input DT binding documentation

Add the DT binding documentation for axg's SPDIF input.

Signed-off-by: Jerome Brunet <jbrunet@baylibre.com>
Signed-off-by: Mark Brown <broonie@kernel.org>
5 years agoASoC: meson: axg-toddr: add support for spdifin backend
Jerome Brunet [Tue, 11 Dec 2018 13:47:10 +0000 (14:47 +0100)]
ASoC: meson: axg-toddr: add support for spdifin backend

add IEC958_SUBFRAME_LE to the list of format accepted by the fifo frontend.

As opposed to what was initially noted in the toddr dai driver, the spdifin
does not place the msb at bit 28, it just output a whole spdif subframe.

Placing the msb at bit 28 in the toddr driver just filters out the parity,
user, channel status and validity bits. It is better to just provide the
whole spdif subframe to the userspace and let the iec958 plugin deal with
it.

Signed-off-by: Jerome Brunet <jbrunet@baylibre.com>
Signed-off-by: Mark Brown <broonie@kernel.org>
5 years agoASoC: simple-card: Dereference pointer for memcpy sizeof in asoc_simple_card_probe
Nathan Chancellor [Thu, 13 Dec 2018 05:15:20 +0000 (14:15 +0900)]
ASoC: simple-card: Dereference pointer for memcpy sizeof in asoc_simple_card_probe

Commit 4fb7f4df49d3 ("ASoC: simple-card: use cpu/codec pointer on
simple_dai_props") updated {cpu,codec}_dai to be pointers in struct
simple_dai_props but didn't update these locations to dereference the
pointers.
This patch fixup it for non DT simple-card use case.

Signed-off-by: Nathan Chancellor <natechancellor@gmail.com>
Signed-off-by: Kuninori Morimoto <kuninori.morimoto.gx@renesas.com>
Signed-off-by: Mark Brown <broonie@kernel.org>
5 years agoASoC: fsl-sai: Fix typo in "transmitter"
Fabio Estevam [Thu, 13 Dec 2018 10:36:38 +0000 (08:36 -0200)]
ASoC: fsl-sai: Fix typo in "transmitter"

Fix the spelling of "transmitter".

Signed-off-by: Fabio Estevam <festevam@gmail.com>
Signed-off-by: Mark Brown <broonie@kernel.org>
5 years agoASoC: fsl: Fix SND_SOC_EUKREA_TLV320 build error on i.MX8M
Fabio Estevam [Thu, 13 Dec 2018 02:08:38 +0000 (00:08 -0200)]
ASoC: fsl: Fix SND_SOC_EUKREA_TLV320 build error on i.MX8M

eukrea-tlv320.c machine driver runs on non-DT platforms
and include <asm/mach-types.h> header file in order to be able
to use some machine_is_eukrea_xxx() macros.

Building it for ARM64 causes the following build error:

sound/soc/fsl/eukrea-tlv320.c:28:10: fatal error: asm/mach-types.h: No such file or directory

Avoid this error by not allowing to build the SND_SOC_EUKREA_TLV320
driver when ARM64 is selected.

This is needed in preparation for the i.MX8M support.

Reported-by: kbuild test robot <lkp@intel.com>
Signed-off-by: Fabio Estevam <festevam@gmail.com>
Acked-by: Shawn Guo <shawnguo@kernel.org>
Signed-off-by: Mark Brown <broonie@kernel.org>
5 years agoASoC: rsnd: remove RSND_REG_ from rsnd_reg
Kuninori Morimoto [Wed, 12 Dec 2018 07:03:58 +0000 (16:03 +0900)]
ASoC: rsnd: remove RSND_REG_ from rsnd_reg

Current rsnd is using RSND_REG_xxx for register naming,
and using RSND_REG_##f style macro for read/write.
The biggest reason why it uses this style is that
we can avoid non-existing register access.
But, its demerit is sequential register access code will
be very ugly.
Current rsnd driver is well tested, so, let's remove RSND_REG_
from rsnd_reg, and cleanup sequential register access code.

Signed-off-by: Kuninori Morimoto <kuninori.morimoto.gx@renesas.com>
Tested-by: Hiroyuki Yokoyama <hiroyuki.yokoyama.vx@renesas.com>
Signed-off-by: Mark Brown <broonie@kernel.org>
5 years agoASoC: simple-scu-card: care multi DPCM codec_conf
Kuninori Morimoto [Tue, 11 Dec 2018 03:25:37 +0000 (03:25 +0000)]
ASoC: simple-scu-card: care multi DPCM codec_conf

Current simple-scu-card didn't care about codec_conf
for multi DPCM case. This patch cares it.

Signed-off-by: Kuninori Morimoto <kuninori.morimoto.gx@renesas.com>
Signed-off-by: Mark Brown <broonie@kernel.org>
5 years agoASoC: simple-scu-card: use cpu/codec pointer on graph_dai_props
Kuninori Morimoto [Tue, 11 Dec 2018 03:25:27 +0000 (03:25 +0000)]
ASoC: simple-scu-card: use cpu/codec pointer on graph_dai_props

In  DPCM case, it uses CPU-dummy / dummy-Codec dai links, and
non DPCM case, it uses CPU-Codec dai links.

Now, we want to merge simple-card and simple-scu-card.

These sound cards are using silimar but not same logic on each functions.
Then, of course we want to share same logic.
To compromise, this patch uses cpu/codec pointer on simple-scu-card.
It is same logic with simple-card, thus easy merging.
This is prepare for merging simple card

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 "convert-rate/channels" parsing
Kuninori Morimoto [Tue, 11 Dec 2018 03:25:18 +0000 (03:25 +0000)]
ASoC: simple-scu-card: tidyup "convert-rate/channels" parsing

simple-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: simple-scu-card: care link / dai count
Kuninori Morimoto [Tue, 11 Dec 2018 03:25:08 +0000 (03:25 +0000)]
ASoC: simple-scu-card: care link / dai count

In DPCM case, it uses CPU-dummy / dummy-Codec dai links.
If sound card is caring only DPCM, link count = dai count,
but, if non DPCM case, link count != dai count.
Now, we want to merge simple-card and simple-scu-card,
then, we need to care both link / dai count more carefly
This patch cares it, and prepare for merging simple card

Signed-off-by: Kuninori Morimoto <kuninori.morimoto.gx@renesas.com>
Signed-off-by: Mark Brown <broonie@kernel.org>
5 years agoASoC: simple-scu-card: add dai-link support
Kuninori Morimoto [Tue, 11 Dec 2018 03:24:57 +0000 (03:24 +0000)]
ASoC: simple-scu-card: add dai-link support

simple-card is supporting dai-link support, but simple-scu-card
doesn't have it.
This patch support it. This is prepare for merging simple-card
and simple-scu-card.

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 asoc_simple_card_parse_daifmt() timing
Kuninori Morimoto [Tue, 4 Dec 2018 08:20:13 +0000 (08:20 +0000)]
ASoC: simple-scu-card: tidyup asoc_simple_card_parse_daifmt() timing

Current simple-scu-card driver is parsing codec position for DPCM
and consider DAI format. But, current operation is doing totally pointless,
because 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: simple-card: use cpu/codec pointer on simple_dai_props
Kuninori Morimoto [Tue, 4 Dec 2018 08:19:43 +0000 (08:19 +0000)]
ASoC: simple-card: use cpu/codec pointer on simple_dai_props

In  DPCM case, it uses CPU-dummy / dummy-Codec dai links, and
non DPCM case, it uses CPU-Codec dai links.

Now, we want to merge simple-card and simple-scu-card.

These sound cards are using silimar but not same logic on each functions.
Then, of course we want to share same logic.
To compromise, this patch uses cpu/codec pointer on simple-card.
It is same logic with simple-scu-card, thus easy merging.
This is prepare for merging audio card

Signed-off-by: Kuninori Morimoto <kuninori.morimoto.gx@renesas.com>
Signed-off-by: Mark Brown <broonie@kernel.org>
5 years agoASoC: simple-card-utils: fix build warning without CONFIG_OF
Arnd Bergmann [Mon, 10 Dec 2018 20:46:10 +0000 (21:46 +0100)]
ASoC: simple-card-utils: fix build warning without CONFIG_OF

When CONFIG_OF is disabled, of_graph_parse_endpoint() does not
initialize 'info', and gcc can see that:

sound/soc/generic/simple-card-utils.c: In function 'asoc_simple_card_parse_graph_dai':
sound/soc/generic/simple-card-utils.c:284:13: error: 'info.port' may be used uninitialized in this function [-Werror=maybe-uninitialized]

It's probably best to check the return code anyway, and that also
takes care of the warning.

Fixes: b6f3fc005a2c ("ASoC: simple-card-utils: fixup asoc_simple_card_get_dai_id() counting")
Signed-off-by: Arnd Bergmann <arnd@arndb.de>
Acked-by: Kuninori Morimoto <kuninori.morimoto.gx@renesas.com>
Signed-off-by: Mark Brown <broonie@kernel.org>
5 years agoASoC: sdm845: add rt5663 codec select
Arnd Bergmann [Mon, 10 Dec 2018 20:49:28 +0000 (21:49 +0100)]
ASoC: sdm845: add rt5663 codec select

Calling into the codec driver adds a dependency on that being reachable
from the module:

ERROR: "rt5663_sel_asrc_clk_src" [sound/soc/qcom/snd-soc-sdm845.ko]
undefined!

Add the corresponding select statement, as it is done in the other user
(Intel).

Fixes: f7485875a687 ("ASoC: sdm845: Add configuration for headset codec")
Signed-off-by: Arnd Bergmann <arnd@arndb.de>
Signed-off-by: Mark Brown <broonie@kernel.org>
5 years agoASoC: Intel: kbl_da7219_max98927: fix the audio jack button remapping
Zhuohao Lee [Mon, 10 Dec 2018 04:32:13 +0000 (12:32 +0800)]
ASoC: Intel: kbl_da7219_max98927: fix the audio jack button remapping

From the da7219 spec, the button A, B, C and D are remapped to
0, 1, 2 and 3 respectively where button A is KEY_PLAYPAUSE,
B is KEY_VOLUMEUP, C is KEY_VOLUMEDOWN and D is KEY_VOICECOMMAND.

Signed-off-by: Zhuohao Lee <zhuohao@chromium.org>
Signed-off-by: Max Chang <changmax@chromium.org>
Acked-by: Pierre-Louis Bossart <pierre-louis.bossart@linux.intel.com>
Signed-off-by: Mark Brown <broonie@kernel.org>
5 years agoASoC: Intel: bytcr_rt5640: Add quirk for the Point of View Mobii TAB-P1005W-232
Hans de Goede [Sat, 8 Dec 2018 13:01:14 +0000 (14:01 +0100)]
ASoC: Intel: bytcr_rt5640: Add quirk for the Point of View Mobii TAB-P1005W-232

Add a quirk for the Point of View Mobii TAB-P1005W-232 v2.0 tablet, this
BYTCR device uses IN1 for its MIC and JD2 for jack-detect, rather then the
default IN3 and JD1.

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>
5 years agoASoC: Intel: bytcr_rt5640: Add quirk for the Prowise PT301 tablet
Hans de Goede [Sat, 8 Dec 2018 13:01:13 +0000 (14:01 +0100)]
ASoC: Intel: bytcr_rt5640: Add quirk for the Prowise PT301 tablet

Add a quirk for the Prowise PT301 tablet, this BYTCR tablet has no CHAN
package in its ACPI tables and uses SSP0-AIF1 rather then SSP0-AIF2 which
is the default for BYTCR devices.

Also it uses IN1 for its MIC and JD2 for jack-detect, rather then the
default IN3 and JD1.

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>
5 years agoASoC: max9867: Add copyright and module author
Ladislav Michl [Thu, 6 Dec 2018 21:06:38 +0000 (22:06 +0100)]
ASoC: max9867: Add copyright and module author

Driver rewritten, assign copyright notice and change module author
as original one remains silent and I want to be notified about bugs.

Signed-off-by: Ladislav Michl <ladis@linux-mips.org>
Signed-off-by: Mark Brown <broonie@kernel.org>
5 years agoASoC: sdm845: Add configuration for headset codec
Cheng-Yi Chiang [Wed, 28 Nov 2018 09:00:36 +0000 (17:00 +0800)]
ASoC: sdm845: Add configuration for headset codec

Set DAI format and sysclk for headset codec.

Signed-off-by: Cheng-Yi Chiang <cychiang@chromium.org>
Acked-by: Srinivas Kandagatla <srinivas.kandagatla@linaro.org>
Signed-off-by: Mark Brown <broonie@kernel.org>
5 years agoASoC: sdm845: Add TDM configuration for speaker
Cheng-Yi Chiang [Wed, 28 Nov 2018 09:00:35 +0000 (17:00 +0800)]
ASoC: sdm845: Add TDM configuration for speaker

Set TDM time slots and DAI format for speaker codec.

Signed-off-by: Cheng-Yi Chiang <cychiang@chromium.org>
Acked-by: Srinivas Kandagatla <srinivas.kandagatla@linaro.org>
Signed-off-by: Mark Brown <broonie@kernel.org>
5 years agoASoC: max9867: Fix signal paths
Ladislav Michl [Tue, 4 Dec 2018 18:21:33 +0000 (19:21 +0100)]
ASoC: max9867: Fix signal paths

Sound capture and line bypass currently do not work as well as
some mixer controls. Fix that by building proper audio paths and
adjusting volume controls to match datasheet.

Signed-off-by: Ladislav Michl <ladis@linux-mips.org>
Signed-off-by: Mark Brown <broonie@kernel.org>
5 years agoASoC: max9867: Calculate LRCLK divider
Ladislav Michl [Tue, 4 Dec 2018 18:21:04 +0000 (19:21 +0100)]
ASoC: max9867: Calculate LRCLK divider

Drop "Common NI Values Table" and calculate LRCLK divider, then
add allowed rate constraints based on master clock frequency.

Signed-off-by: Ladislav Michl <ladis@linux-mips.org>
Signed-off-by: Mark Brown <broonie@kernel.org>
5 years agoASoC: max9867: Fix power management
Ladislav Michl [Tue, 4 Dec 2018 18:19:51 +0000 (19:19 +0100)]
ASoC: max9867: Fix power management

Implement set_bias_level to drive shutdown bit, so device is
put to sleep when unused.

Signed-off-by: Ladislav Michl <ladis@linux-mips.org>
Signed-off-by: Mark Brown <broonie@kernel.org>
5 years agoASoC: max9867: Remove useless assignment
Ladislav Michl [Tue, 4 Dec 2018 18:18:17 +0000 (19:18 +0100)]
ASoC: max9867: Remove useless assignment

ret is assigned later, no need to initialize it.

Signed-off-by: Ladislav Michl <ladis@linux-mips.org>
Signed-off-by: Mark Brown <broonie@kernel.org>
5 years agoASoC: codecs: ak4104: move to GPIO consumer API
Daniel Mack [Thu, 6 Dec 2018 12:24:57 +0000 (13:24 +0100)]
ASoC: codecs: ak4104: move to GPIO consumer API

Get the reset GPIO through the GPIO consumer API. This allows specifying the
DT property as "reset-gpios" without breaking existing DT users.

Signed-off-by: Daniel Mack <daniel@zonque.org>
Signed-off-by: Mark Brown <broonie@kernel.org>
5 years agoASoC: dt-bindings: ak4104: use 'reset-gpios' rather than 'reset-gpio'
Daniel Mack [Thu, 6 Dec 2018 12:24:56 +0000 (13:24 +0100)]
ASoC: dt-bindings: ak4104: use 'reset-gpios' rather than 'reset-gpio'

Bindings should use 'reset-gpios', not 'reset-gpio'. The driver needs to
switch to the gpiod consume API to handle this correctly.

Signed-off-by: Daniel Mack <daniel@zonque.org>
Signed-off-by: Mark Brown <broonie@kernel.org>
5 years agoASoC: codecs: cs4270: move to GPIO consumer API
Daniel Mack [Thu, 6 Dec 2018 12:24:26 +0000 (13:24 +0100)]
ASoC: codecs: cs4270: move to GPIO consumer API

Get the reset GPIO through the GPIO consumer API. This allows specifying the
DT property as "reset-gpios" without breaking existing DT users.

Signed-off-by: Daniel Mack <daniel@zonque.org>
Signed-off-by: Mark Brown <broonie@kernel.org>
5 years agoASoC: dt-bindings: cs4270: use 'reset-gpios' rather than 'reset-gpio'
Daniel Mack [Thu, 6 Dec 2018 12:24:25 +0000 (13:24 +0100)]
ASoC: dt-bindings: cs4270: use 'reset-gpios' rather than 'reset-gpio'

Bindings should use 'reset-gpios', not 'reset-gpio'. The driver needs to
switch to the gpiod consume API to handle this correctly.

Signed-off-by: Daniel Mack <daniel@zonque.org>
Signed-off-by: Mark Brown <broonie@kernel.org>
5 years agoASoC: Use of_node_name_eq for node name comparisons
Rob Herring [Wed, 5 Dec 2018 19:50:49 +0000 (13:50 -0600)]
ASoC: Use of_node_name_eq for node name comparisons

Convert string compares of DT node names to use of_node_name_eq helper
instead. This removes direct access to the node name pointer.

For the FSL ASoC card, the full node names appear to be "ssi", "esai",
and "sai", so there's not any reason to use strstr and of_node_name_eq
can be used instead.

Cc: Timur Tabi <timur@kernel.org>
Cc: Nicolin Chen <nicoleotsuka@gmail.com>
Cc: Xiubo Li <Xiubo.Lee@gmail.com>
Cc: Fabio Estevam <fabio.estevam@nxp.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
Signed-off-by: Rob Herring <robh@kernel.org>
Signed-off-by: Mark Brown <broonie@kernel.org>
5 years agoASoC: use dma_ops of parent device for acp_audio_dma
Yu Zhao [Tue, 4 Dec 2018 22:42:53 +0000 (15:42 -0700)]
ASoC: use dma_ops of parent device for acp_audio_dma

AMD platform device acp_audio_dma can only be created by parent PCI
device driver (drivers/gpu/drm/amd/amdgpu/amdgpu_acp.c). Pass struct
device of the parent to snd_pcm_lib_preallocate_pages() so
dma_alloc_coherent() can use correct dma_ops. Otherwise, it will
use default dma_ops which is nommu_dma_ops on x86_64 even when
IOMMU is enabled and set to non passthrough mode.

Though platform device inherits some dma related fields during its
creation in mfd_add_device(), we can't simply pass its struct device
to snd_pcm_lib_preallocate_pages() because dma_ops is not among the
inherited fields. Even it were, drivers/iommu/amd_iommu.c would
ignore it because get_device_id() doesn't handle platform device.

This change shouldn't give us any trouble even struct device of the
parent becomes null or represents some non PCI device in the future,
because get_dma_ops() correctly handles null struct device or uses
the default dma_ops if struct device doesn't have it set.

Signed-off-by: Yu Zhao <yuzhao@google.com>
Signed-off-by: Mark Brown <broonie@kernel.org>
5 years agoASoC: use DMA addr rather than CPU pa for acp_audio_dma
Yu Zhao [Tue, 4 Dec 2018 22:42:52 +0000 (15:42 -0700)]
ASoC: use DMA addr rather than CPU pa for acp_audio_dma

We shouldn't assume CPU physical address we get from page_to_phys()
is same as DMA address we get from dma_alloc_coherent(). On x86_64,
we won't run into any problem with the assumption when dma_ops is
nommu_dma_ops. However, DMA address is IOVA when IOMMU is enabled.
And it's most likely different from CPU physical address when AMD
IOMMU is not in passthrough mode.

Signed-off-by: Yu Zhao <yuzhao@google.com>
Signed-off-by: Mark Brown <broonie@kernel.org>
5 years agoASoC: max98373: Added max98373_reset for stable amp reset
Ryan Lee [Fri, 30 Nov 2018 03:21:09 +0000 (03:21 +0000)]
ASoC: max98373: Added max98373_reset for stable amp reset

This patch added max98373_reset function to avoid amp software reset failure and code duplication.
Reset verification step has been added for stable amp reset and it repeats verification maximum 3 times when it is failed.
Chip revision ID is available when the amp is in the idle state which means software reset is completed well.
Additional 10ms delay was added for every retrial and maximum 30ms delay can be applied.

Signed-off-by: Ryan Lee <ryans.lee@maximintegrated.com>
Signed-off-by: Mark Brown <broonie@kernel.org>
5 years agoASoC: audio-graph-card: use cpu/codec pointer on graph_dai_props
Kuninori Morimoto [Fri, 30 Nov 2018 02:07:48 +0000 (02:07 +0000)]
ASoC: audio-graph-card: use cpu/codec pointer on graph_dai_props

In  DPCM case, it uses CPU-dummy / dummy-Codec dai links, and
non DPCM case, it uses CPU-Codec dai links.

Now, we want to merge audio-graph-card and audio-graph-scu-card.

These sound cards are using silimar but not same logic on each functions.
Then, of course we want to share same logic.
To compromise, this patch uses cpu/codec pointer on audio-graph-card.
It is same logic with audio-graph-scu-card, thus easy merging.
This is prepare for merging audio card

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: care multi DPCM codec_conf
Kuninori Morimoto [Fri, 30 Nov 2018 02:07:32 +0000 (02:07 +0000)]
ASoC: audio-graph-scu-card: care multi DPCM codec_conf

Current audio-graph-scu-card didn't care about codec_conf
for multi DPCM case. This patch cares it.

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: use cpu/codec pointer on graph_dai_props
Kuninori Morimoto [Fri, 30 Nov 2018 02:07:15 +0000 (02:07 +0000)]
ASoC: audio-graph-scu-card: use cpu/codec pointer on graph_dai_props

In  DPCM case, it uses CPU-dummy / dummy-Codec dai links, and
non DPCM case, it uses CPU-Codec dai links.

Now, we want to merge audio-graph-card and audio-graph-scu-card.

These sound cards are using silimar but not same logic on each functions.
Then, of course we want to share same logic.
To compromise, this patch uses cpu/codec pointer on audio-graph-scu-card.
It is same logic with audio-graph-card, thus easy merging.
This is prepare for merging audio card

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: care link / dai count
Kuninori Morimoto [Fri, 30 Nov 2018 02:06:51 +0000 (02:06 +0000)]
ASoC: audio-graph-scu-card: care link / dai count

In DPCM case, it uses CPU-dummy / dummy-Codec dai links.
If sound card is caring only DPCM, link count = dai count,
but, if non DPCM case, link count != dai count.
Now, we want to merge audio-graph-card and audio-graph-scu-card,
then, we need to care both link / dai count more carefly
This patch cares it, and prepare for merging audio card

Signed-off-by: Kuninori Morimoto <kuninori.morimoto.gx@renesas.com>
Signed-off-by: Mark Brown <broonie@kernel.org>
5 years agoASoC: simple-card-utils: fixup asoc_simple_card_get_dai_id() counting
Kuninori Morimoto [Fri, 30 Nov 2018 02:04:13 +0000 (02:04 +0000)]
ASoC: simple-card-utils: fixup asoc_simple_card_get_dai_id() counting

asoc_simple_card_get_dai_id() returns DAI ID, but it is based on
DT node's "endpoint" position.
Almost all cases 1 port has 1 endpoint, thus, it was no problem.
But in reality, port : endpoint = 1 : N, thus, counting endpoint
is BUG, it should based on "port" ID.
This patch fixup it.

Signed-off-by: Kuninori Morimoto <kuninori.morimoto.gx@renesas.com>
Signed-off-by: Mark Brown <broonie@kernel.org>
5 years agoASoC: rsnd: add missing TDM Split mode support for simple-card
Kuninori Morimoto [Tue, 4 Dec 2018 08:02:43 +0000 (08:02 +0000)]
ASoC: rsnd: add missing TDM Split mode support for simple-card

commit f69f452243e4e1 ("ASoC: rsnd: add TDM Split mode support")
added TDM Split mode support for rsnd driver.
But, it cares audio-graph-card style only. We can't use TDM Split
mode on simple-card style now.
This patch fixup this issue.

Fixes: f69f452243e4e1 ("ASoC: rsnd: add TDM Split mode support")
Signed-off-by: Kuninori Morimoto <kuninori.morimoto.gx@renesas.com>
Signed-off-by: Mark Brown <broonie@kernel.org>
5 years agoASoC: rsnd: fixup mod ID for CTU regmap read/write
Kuninori Morimoto [Tue, 4 Dec 2018 08:00:47 +0000 (08:00 +0000)]
ASoC: rsnd: fixup mod ID for CTU regmap read/write

commit c16015f36cc12824 ("ASoC: rsnd: add .get_id/.get_id_sub")
add new .get_id/.get_id_sub to indicate module ID/subID.
It is used for SSIU and CTU. In SSIU case, subID indicates BUSIF,
but register settings is based on SSIU ID.
OTOH, in CTU case, subID indicates CTU channel, and register settings
is based on it. This means regmap read/write function needs to care it.
This patch fixup this issue. It can't play MIXed sound without this
patch.

Fixes: c16015f36cc12824 ("ASoC: rsnd: add .get_id/.get_id_sub")
Signed-off-by: Kuninori Morimoto <kuninori.morimoto.gx@renesas.com>
Signed-off-by: Mark Brown <broonie@kernel.org>
5 years agoASoC: rsnd: indicates Channel and Mode for debug
Kuninori Morimoto [Tue, 4 Dec 2018 07:59:05 +0000 (07:59 +0000)]
ASoC: rsnd: indicates Channel and Mode for debug

For TDM debug purpose, indicating Channel and Mode is very
useful. This patch indicate it if it has #define DEBUG

Signed-off-by: Kuninori Morimoto <kuninori.morimoto.gx@renesas.com>
Signed-off-by: Mark Brown <broonie@kernel.org>
5 years agoASoC: pxa: remove raumfeld machine driver
Daniel Mack [Sat, 1 Dec 2018 14:08:46 +0000 (15:08 +0100)]
ASoC: pxa: remove raumfeld machine driver

These boards are now fully ported to devicetree and make use of the
simple-card driver, so the platform specific machine driver can be
removed.

Signed-off-by: Daniel Mack <daniel@zonque.org>
Signed-off-by: Mark Brown <broonie@kernel.org>
5 years agoASoC: Intel: common: add ACPI matching tables for ICL
Pierre-Louis Bossart [Sat, 1 Dec 2018 00:54:37 +0000 (18:54 -0600)]
ASoC: Intel: common: add ACPI matching tables for ICL

Entry needed for ICL RVP w/ RT274

Signed-off-by: Pierre-Louis Bossart <pierre-louis.bossart@linux.intel.com>
Signed-off-by: Mark Brown <broonie@kernel.org>
5 years agoASoC: dt-bindings: use a generic node name for rt5631
Lubomir Rintel [Mon, 3 Dec 2018 11:47:28 +0000 (12:47 +0100)]
ASoC: dt-bindings: use a generic node name for rt5631

The example should follow the practice or using a generic node name
instead of the precise programming model, as recommended by the DTSpec.

Signed-off-by: Lubomir Rintel <lkundrak@v3.sk>
Signed-off-by: Mark Brown <broonie@kernel.org>
5 years agoASoC: au8540: use 64-bit arithmetic instead of 32-bit
Young_X [Tue, 27 Nov 2018 06:33:16 +0000 (06:33 +0000)]
ASoC: au8540: use 64-bit arithmetic instead of 32-bit

Add suffix ULL to constant 256 in order to give the compiler complete
information about the proper arithmetic to use.

Notice that such constant is used in a context that expects an
expression of type u64 (64 bits, unsigned) and the following
expression is currently being evaluated using 32-bit arithmetic:

    256 * fs * 2 * mclk_src_scaling[i].param

Signed-off-by: Young_X <YangX92@hotmail.com>
Signed-off-by: Mark Brown <broonie@kernel.org>
5 years agoASoC: dmic: introduce module_param wakeup_delay
Jenny TC [Wed, 28 Nov 2018 06:52:46 +0000 (12:22 +0530)]
ASoC: dmic: introduce module_param wakeup_delay

Introducing a module param for wakeup_delay in order to
align with modeswitch_delay parameter. With this change, both
wakeup_delay and modeswitch_delay parameters can be passed
as module parameters.

Signed-off-by: Jenny TC <jenny.tc@intel.com>
Signed-off-by: Mark Brown <broonie@kernel.org>
5 years agoASoC: dmic: introduce mode switch delay
Jenny TC [Wed, 28 Nov 2018 06:52:45 +0000 (12:22 +0530)]
ASoC: dmic: introduce mode switch delay

On startup, applications such as PulseAudio or CRAS enable playback or
capture on all PCM devices to verify that configurations are correct,
and close them immediately. For DMICs, this can result in the clock
being turned off very quickly, which may not compatible with internal
state machine transition requirements.

This patch add a mode-switch delay which will prevent the clock from
being turned off without complying with manufacturer timing
specifications. While the DMIC clock may be controlled at a lower level,
be it with hardware or firmware, applying the delay during the
STOP_TRIGGER phase ensures that there is no race condition, e.g. with
the hardware/firmware turning off the clock earlier

Signed-off-by: Sathyanarayana Nujella <sathyanarayana.nujella@intel.com>
Signed-off-by: Jairaj Arava <jairaj.arava@intel.com>
Signed-off-by: Harsha Priya <harshapriya.n@intel.com>
Signed-off-by: Jenny TC <jenny.tc@intel.com>
Signed-off-by: Mark Brown <broonie@kernel.org>
5 years agodt-bindings: sound: omap-mcpdm: Update documentation for pdmclk
Peter Ujfalusi [Wed, 14 Nov 2018 12:46:30 +0000 (14:46 +0200)]
dt-bindings: sound: omap-mcpdm: Update documentation for pdmclk

McPDM module receives it's functional clock from external source. This
clock is the pdmclk provided by the twl6040 audio IC. If the clock is not
available all register accesses to McPDM fails and the module is not
operational.

Signed-off-by: Peter Ujfalusi <peter.ujfalusi@ti.com>
Acked-by: Rob Herring <robh@kernel.org>
Signed-off-by: Mark Brown <broonie@kernel.org>
5 years agoASoC: qcom: sdm845: Create and setup jack in init callback
Cheng-Yi Chiang [Sat, 24 Nov 2018 11:09:46 +0000 (19:09 +0800)]
ASoC: qcom: sdm845: Create and setup jack in init callback

Add a callback for init ops on dai_link to create and setup jack.

Signed-off-by: Rohit kumar <rohitkr@codeaurora.org>
Signed-off-by: Cheng-Yi Chiang <cychiang@chromium.org>
Acked-by: Srinivas Kandagatla <srinivas.kandagatla@linaro.org>
Signed-off-by: Mark Brown <broonie@kernel.org>
5 years agoASoC: qcom: sdm845: Add board specific dapm widgets
Cheng-Yi Chiang [Sat, 24 Nov 2018 11:09:45 +0000 (19:09 +0800)]
ASoC: qcom: sdm845: Add board specific dapm widgets

Add board specific dapm widgets so these widgets can be used
in the route.

Signed-off-by: Rohit kumar <rohitkr@codeaurora.org>
Signed-off-by: Cheng-Yi Chiang <cychiang@chromium.org>
Acked-by: Srinivas Kandagatla <srinivas.kandagatla@linaro.org>
Signed-off-by: Mark Brown <broonie@kernel.org>
5 years agoASoC: davinci-mcasp: Implement configurable dismod handling
Peter Ujfalusi [Fri, 16 Nov 2018 13:41:41 +0000 (15:41 +0200)]
ASoC: davinci-mcasp: Implement configurable dismod handling

If the dismod is specified in the DT node, use the specified custom value
to configure the drive on state of the inactive TX slots.

If the dismod is not present or booted in legacy mode, the dismod is set
to low as it was the original behavior.

Signed-off-by: Peter Ujfalusi <peter.ujfalusi@ti.com>
Signed-off-by: Mark Brown <broonie@kernel.org>
5 years agoASoC: davinci-mcasp: Document dismod optional property
Peter Ujfalusi [Fri, 16 Nov 2018 13:41:40 +0000 (15:41 +0200)]
ASoC: davinci-mcasp: Document dismod optional property

The dismod property can be used to specify the drive on level of inactive
TX slots.

Signed-off-by: Peter Ujfalusi <peter.ujfalusi@ti.com>
Signed-off-by: Mark Brown <broonie@kernel.org>
5 years agoASoC: davinci-mcasp: Update PDIR (pin direction) register handling
Peter Ujfalusi [Fri, 16 Nov 2018 13:41:39 +0000 (15:41 +0200)]
ASoC: davinci-mcasp: Update PDIR (pin direction) register handling

When McASP is master and the PDIR for the clock pins are configured as
outputs before the clocking is configured it will output whatever clock
is generated at the moment internally.
The clock will switch to the correct rate only when the we start the clock
generators.

To avoid this we must only set the pin as output after the clock is
configured and enabled.

AXR pins configured as outputs behaves somehow interesting as well:
when McASP is not enabled and the pin is selected as output it will not
honor the DISMOD settings for the inactive state, but will pull the pin
down.

Add a new bitfield and mark the pins there which needs to be output and
set the pins only at the time when they will behave correctly.

On stream stop configure the pins back to input which makes them to obey
the global pin configuration regarding to pull up/down.

Signed-off-by: Peter Ujfalusi <peter.ujfalusi@ti.com>
Signed-off-by: Mark Brown <broonie@kernel.org>
5 years agoASoC: davinci-mcasp: Clear TXSTAT register before activating serializers
Peter Ujfalusi [Fri, 16 Nov 2018 13:41:38 +0000 (15:41 +0200)]
ASoC: davinci-mcasp: Clear TXSTAT register before activating serializers

Follow the guideline from the TRM:
Before starting, clear the respective transmitter and receiver status
registers

To avoid stale state stored in the status registers.

Signed-off-by: Peter Ujfalusi <peter.ujfalusi@ti.com>
Signed-off-by: Mark Brown <broonie@kernel.org>
5 years agoASoC: Intel: Skylake: Add FW reply for MCLK/SCLK IPC
Subhransu S. Prusty [Mon, 29 Jan 2018 16:16:00 +0000 (21:46 +0530)]
ASoC: Intel: Skylake: Add FW reply for MCLK/SCLK IPC

If mclk/sclk is already running, FW responds with IPC reply MCLK/SCLK
already running. Add these to the IPC reply lookup table.

Signed-off-by: Subhransu S. Prusty <subhransu.s.prusty@intel.com>
Signed-off-by: Sriram Periyasamy <sriramx.periyasamy@intel.com>
Signed-off-by: Vinod Koul <vinod.koul@intel.com>
Signed-off-by: Mark Brown <broonie@kernel.org>
5 years agoASoC: Intel: Skylake: Make DSP replies more human readable
Subhransu S. Prusty [Mon, 29 Jan 2018 16:15:59 +0000 (21:45 +0530)]
ASoC: Intel: Skylake: Make DSP replies more human readable

Add more meaning to the IPC replies for easy debugging. Replace the switch
case with a lookup table to lookup for the IPC replies and print in human
readable form.

Signed-off-by: Subhransu S. Prusty <subhransu.s.prusty@intel.com>
Signed-off-by: Sriram Periyasamy <sriramx.periyasamy@intel.com>
Signed-off-by: Vinod Koul <vinod.koul@intel.com>
Signed-off-by: Mark Brown <broonie@kernel.org>
5 years agoASoC: max9867: Fix whitespace
Ladislav Michl [Fri, 23 Nov 2018 14:27:00 +0000 (15:27 +0100)]
ASoC: max9867: Fix whitespace

Minor changes to match coding style.

Signed-off-by: Ladislav Michl <ladis@linux-mips.org>
Signed-off-by: Mark Brown <broonie@kernel.org>
5 years agoASoC: soc.h: makes snd_soc_of_parse_audio_prefix() inline
Kuninori Morimoto [Mon, 26 Nov 2018 01:21:22 +0000 (01:21 +0000)]
ASoC: soc.h: makes snd_soc_of_parse_audio_prefix() inline

commit 3b7103562c03c ("ASoC: soc-core: add
snd_soc_of_parse_node_prefix()") maked snd_soc_of_parse_audio_prefix()
as #define. But it'd be better to make this a static inline rather than
a #define. It helps with error messages and type safety.
This patch makes it inline.

Signed-off-by: Kuninori Morimoto <kuninori.morimoto.gx@renesas.com>
Signed-off-by: Mark Brown <broonie@kernel.org>
5 years agoASoC: rsnd: tidyup for SSIU subnode
Kuninori Morimoto [Mon, 26 Nov 2018 01:17:01 +0000 (01:17 +0000)]
ASoC: rsnd: tidyup for SSIU subnode

commit da48a6eb82ea2 ("ASoC: rsnd: add SSIU BUSIF support for
Document") updated Documentation for SSIU, but 1) we want to
keep old/deprecated DMA description, 2) it is missing SSIU
subnode properties. 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: amd: Fix a NULL vs IS_ERR() check in probe
Dan Carpenter [Mon, 26 Nov 2018 08:13:07 +0000 (11:13 +0300)]
ASoC: amd: Fix a NULL vs IS_ERR() check in probe

The platform_device_register_full() function doesn't return NULL, it
returns error pointers.

Fixes: 7894a7e7ea3d ("ASoC: amd: create ACP3x PCM platform device")
Signed-off-by: Dan Carpenter <dan.carpenter@oracle.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: 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 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: 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>