OSDN Git Service

uclinux-h8/linux.git
3 years agoMerge tag 'asoc-hdmi-codec-improvements-v2' of git://git.kernel.org/pub/scm/linux...
Mark Brown [Mon, 14 Jun 2021 10:13:53 +0000 (11:13 +0100)]
Merge tag 'asoc-hdmi-codec-improvements-v2' of git://git./linux/kernel/git/mripard/linux into asoc-5.14

Improvements to the hdmi-codec driver and ALSA infrastructure around it
to support the HDMI Channel Mapping and IEC958 controls

3 years agoASoC: hdmi-codec: Add a prepare hook
Maxime Ripard [Tue, 25 May 2021 13:23:47 +0000 (15:23 +0200)]
ASoC: hdmi-codec: Add a prepare hook

The IEC958 status bit is usually set by the userspace after hw_params
has been called, so in order to use whatever is set by the userspace, we
need to implement the prepare hook. Let's add it to the hdmi_codec_ops,
and mandate that either prepare or hw_params is implemented.

Signed-off-by: Maxime Ripard <maxime@cerno.tech>
Acked-by: Mark Brown <broonie@kernel.org>
Link: https://lore.kernel.org/r/20210525132354.297468-6-maxime@cerno.tech
3 years agoASoC: hdmi-codec: Add iec958 controls
Maxime Ripard [Tue, 25 May 2021 13:23:46 +0000 (15:23 +0200)]
ASoC: hdmi-codec: Add iec958 controls

The IEC958 status bits can be exposed and modified by the userspace
through dedicated ALSA controls.

This patch implements those controls for the hdmi-codec driver. It
relies on a default value being setup at probe time that can later be
overridden by the control put.

The hw_params callback is then called with a buffer filled with the
proper bits for the current parameters being passed on so the underlying
driver can just reuse those bits as is.

Signed-off-by: Maxime Ripard <maxime@cerno.tech>
Acked-by: Mark Brown <broonie@kernel.org>
Link: https://lore.kernel.org/r/20210525132354.297468-5-maxime@cerno.tech
3 years agoASoC: hdmi-codec: Rework to support more controls
Maxime Ripard [Tue, 25 May 2021 13:23:45 +0000 (15:23 +0200)]
ASoC: hdmi-codec: Rework to support more controls

We're going to add more controls to support the IEC958 output, so let's
rework the control registration a bit to support more of them.

Signed-off-by: Maxime Ripard <maxime@cerno.tech>
Acked-by: Mark Brown <broonie@kernel.org>
Link: https://lore.kernel.org/r/20210525132354.297468-4-maxime@cerno.tech
3 years agoALSA: iec958: Split status creation and fill
Maxime Ripard [Tue, 25 May 2021 13:23:44 +0000 (15:23 +0200)]
ALSA: iec958: Split status creation and fill

In some situations, like a codec probe, we need to provide an IEC status
default but don't have access to the sampling rate and width yet since
no stream has been configured yet.

Each and every driver has its own default, whereas the core iec958 code
also has some buried in the snd_pcm_create_iec958_consumer functions.

Let's split these functions in two to provide a default that doesn't
rely on the sampling rate and width, and another function to fill them
when available.

Signed-off-by: Maxime Ripard <maxime@cerno.tech>
Reviewed-by: Takashi Iwai <tiwai@suse.de>
Link: https://lore.kernel.org/r/20210525132354.297468-3-maxime@cerno.tech
3 years agoALSA: doc: Clarify IEC958 controls iface
Maxime Ripard [Tue, 25 May 2021 13:23:43 +0000 (15:23 +0200)]
ALSA: doc: Clarify IEC958 controls iface

The doc currently mentions that the IEC958 Playback Default should be
exposed on the PCM iface, and the Playback Mask on the mixer iface.

It's a bit confusing to advise to have two related controls on two
separate ifaces, and it looks like the drivers that currently expose
those controls use any combination of the mixer and PCM ifaces.

Let's try to clarify the situation a bit, and encourage to at least have
the controls on the same iface.

Signed-off-by: Maxime Ripard <maxime@cerno.tech>
Reviewed-by: Takashi Iwai <tiwai@suse.de>
Link: https://lore.kernel.org/r/20210525132354.297468-2-maxime@cerno.tech
3 years agoASoC: remove unneeded semicolons in wcd934x.c
Wan Jiabing [Tue, 8 Jun 2021 03:06:55 +0000 (11:06 +0800)]
ASoC: remove unneeded semicolons in wcd934x.c

Fix following coccicheck warning:
./sound/soc/codecs/wcd934x.c:5136:2-3: Unneeded semicolon
./sound/soc/codecs/wcd934x.c:2466:2-3: Unneeded semicolon
./sound/soc/codecs/wcd934x.c:2527:2-3: Unneeded semicolon

Signed-off-by: Wan Jiabing <wanjiabing@vivo.com>
Link: https://lore.kernel.org/r/20210608030656.24052-1-wanjiabing@vivo.com
Signed-off-by: Mark Brown <broonie@kernel.org>
3 years agoASoC: soc-core: don't use discriminatory terms on snd_soc_runtime_get_dai_fmt()
Kuninori Morimoto [Tue, 8 Jun 2021 00:11:50 +0000 (09:11 +0900)]
ASoC: soc-core: don't use discriminatory terms on snd_soc_runtime_get_dai_fmt()

snd_soc_runtime_get_dai_fmt() is using discriminatory terms.
This patch fixup it.

Fixes: ba9e82a1c891 ("ASoC: soc-core: add snd_soc_runtime_get_dai_fmt()")
Signed-off-by: Kuninori Morimoto <kuninori.morimoto.gx@renesas.com>
Link: https://lore.kernel.org/r/874ke9dxkp.wl-kuninori.morimoto.gx@renesas.com
Signed-off-by: Mark Brown <broonie@kernel.org>
3 years agoASoC: mediatek: mtk-btcvsd: Fix an error handling path in 'mtk_btcvsd_snd_probe()'
Christophe JAILLET [Sun, 6 Jun 2021 14:31:09 +0000 (16:31 +0200)]
ASoC: mediatek: mtk-btcvsd: Fix an error handling path in 'mtk_btcvsd_snd_probe()'

If an error occurs after a successful 'of_iomap()' call, it must be undone
by a corresponding 'iounmap()' call, as already done in the remove
function.

While at it, remove the useless initialization of 'ret' at the beginning of
the function.

Fixes: 4bd8597dc36c ("ASoC: mediatek: add btcvsd driver")
Signed-off-by: Christophe JAILLET <christophe.jaillet@wanadoo.fr>
Link: https://lore.kernel.org/r/0c2ba562c3364e61bfbd5b3013a99dfa0d9045d7.1622989685.git.christophe.jaillet@wanadoo.fr
Signed-off-by: Mark Brown <broonie@kernel.org>
3 years agoMerge series "ASoC: adds new .auto_selectable_formats support" from Kuninori Morimoto...
Mark Brown [Mon, 7 Jun 2021 18:53:01 +0000 (19:53 +0100)]
Merge series "ASoC: adds new .auto_selectable_formats support" from Kuninori Morimoto <kuninori.morimoto.gx@renesas.com>:

Hi Mark

These are v3 of "ASoC: adds new .get_fmt support",
but renamed Subject.

This is a little bit challenging patch-set.
The idea/code is almost same as v1 / v2.
v3 has "priority" support.

We need to set dai_link->dai_fmt to select CPU/Codec settings,
and it is selected by Sound Card Driver, today.

Because of it, Sound Card user need to know both CPU / Codec
available dai_fmt, and needs to select it.
For example simple-card / audio-graph case, it is selected by
"format" and "bitclock/frame-master/inversion" on DT.

But, it can be automatically selected if both CPU and Codec drivers
indicate it to ALSA SoC Framework, somehow.

By this patch, dai_fmt can be automatically selected from each
driver if both CPU / Codec driver had .auto_selectable_formats.
Automatically selectable *field* is depends on each drivers.

For example, some driver want to select format "automatically",
but want to select other fields "manually", because of complex limitation.
Or other example, in case of both CPU and Codec are possible to be
clock provider, but the quality was different.
In these case, user need/want to *manually* select each fields
from Sound Card driver.

It uses Sound Card specified fields preferentially, and try to select
non-specific fields from CPU and Codec driver settings if driver had
.auto_selectable_formats.
In other words, we can select all dai_fmt via Sound Card driver
same as before.

Select dai_fmt 100% automatically is very difficult and will be very complex,
but select automatically some fields only is very easy, I guess.
This patch-set is based on such assumption.

v1 -> v2
- Add more detail explanation on git-log, code, comment.
- Possible to be Clock/Frame provider is depends on driver's situation.

v2 -> v3
- has priority
- tidyup function explanation for snd_soc_dai_get_fmt()
- Each driver don't try to have SND_SOC_DAIFMT_CBx_CFx to avoid confusion

Link: https://lore.kernel.org/r/871rb3hypy.wl-kuninori.morimoto.gx@renesas.com
Link: https://lore.kernel.org/r/871racbx0w.wl-kuninori.morimoto.gx@renesas.com
Kuninori Morimoto (7):
  ASoC: soc-core: move snd_soc_runtime_set_dai_fmt() to upside
  ASoC: soc-core: add snd_soc_runtime_get_dai_fmt()
  ASoC: ak4613: add .auto_selectable_formats support
  ASoC: pcm3168a: add .auto_selectable_formats support
  ASoC: rsnd: add .auto_selectable_formats support
  ASoC: fsi: add .auto_selectable_formats support
  ASoC: hdmi-codec: add .auto_selectable_formats support

 include/sound/soc-dai.h       |  55 +++++++
 sound/soc/codecs/ak4613.c     |  11 ++
 sound/soc/codecs/hdmi-codec.c |  21 +++
 sound/soc/codecs/pcm3168a.c   |  26 +++
 sound/soc/sh/fsi.c            |  15 ++
 sound/soc/sh/rcar/core.c      |  31 +++-
 sound/soc/soc-core.c          | 288 ++++++++++++++++++++++++++--------
 sound/soc/soc-dai.c           |  63 ++++++++
 sound/soc/soc-utils.c         |  29 ++++
 9 files changed, 475 insertions(+), 64 deletions(-)

--
2.25.1

3 years agoASoC: rk817: remove redundant assignment to pointer node, add missing of_node_put
Colin Ian King [Thu, 3 Jun 2021 11:36:59 +0000 (12:36 +0100)]
ASoC: rk817: remove redundant assignment to pointer node, add missing of_node_put

The pointer node is being initialized with a value that is never read and
it is being updated later with a new value.  The initialization is
redundant and can be removed.

The function is missing a of_node_put on node, fix this by adding the call
before returning.

Addresses-Coverity: ("Unused value")
Fixes: 0d6a04da9b25 ("ASoC: Add Rockchip rk817 audio CODEC support")
Signed-off-by: Colin Ian King <colin.king@canonical.com>
Tested-by: Chris Morgan <macromorgan@hotmail.com>
Link: https://lore.kernel.org/r/20210603113659.82031-1-colin.king@canonical.com
Signed-off-by: Mark Brown <broonie@kernel.org>
3 years agoASoC: rk817: Remove unneeded semicolon
Jiapeng Chong [Fri, 4 Jun 2021 10:23:29 +0000 (18:23 +0800)]
ASoC: rk817: Remove unneeded semicolon

Fix the following coccicheck warnings:

./sound/soc/codecs/rk817_codec.c:49:2-3: Unneeded semicolon.

Reported-by: Abaci Robot <abaci@linux.alibaba.com>
Signed-off-by: Jiapeng Chong <jiapeng.chong@linux.alibaba.com>
Link: https://lore.kernel.org/r/1622802209-45031-1-git-send-email-jiapeng.chong@linux.alibaba.com
Signed-off-by: Mark Brown <broonie@kernel.org>
3 years agoMerge tag 'tb-mfd-asoc-v5.14-1' of https://git.kernel.org/pub/scm/linux/kernel/git...
Mark Brown [Mon, 7 Jun 2021 15:18:18 +0000 (16:18 +0100)]
Merge tag 'tb-mfd-asoc-v5.14-1' of https://git./linux/kernel/git/lee/mfd into asoc-5.14

Immutable branch between MFD and ASoC due for the v5.14 merge window

3 years agoASoC: hdmi-codec: add .auto_selectable_formats support
Kuninori Morimoto [Thu, 27 May 2021 02:28:09 +0000 (11:28 +0900)]
ASoC: hdmi-codec: add .auto_selectable_formats support

By this patch, DAI format might be automatically selected
(Depends on paired DAI).

Link: https://lore.kernel.org/r/871rb3hypy.wl-kuninori.morimoto.gx@renesas.com
Link: https://lore.kernel.org/r/871racbx0w.wl-kuninori.morimoto.gx@renesas.com
Signed-off-by: Kuninori Morimoto <kuninori.morimoto.gx@renesas.com>
Link: https://lore.kernel.org/r/87a6ognc5i.wl-kuninori.morimoto.gx@renesas.com
Signed-off-by: Mark Brown <broonie@kernel.org>
3 years agoASoC: fsi: add .auto_selectable_formats support
Kuninori Morimoto [Thu, 27 May 2021 02:27:54 +0000 (11:27 +0900)]
ASoC: fsi: add .auto_selectable_formats support

By this patch, DAI format might be automatically selected
(Depends on paired DAI).

Link: https://lore.kernel.org/r/871rb3hypy.wl-kuninori.morimoto.gx@renesas.com
Link: https://lore.kernel.org/r/871racbx0w.wl-kuninori.morimoto.gx@renesas.com
Signed-off-by: Kuninori Morimoto <kuninori.morimoto.gx@renesas.com>
Link: https://lore.kernel.org/r/87bl8wnc5x.wl-kuninori.morimoto.gx@renesas.com
Signed-off-by: Mark Brown <broonie@kernel.org>
3 years agoASoC: rsnd: add .auto_selectable_formats support
Kuninori Morimoto [Thu, 27 May 2021 02:27:31 +0000 (11:27 +0900)]
ASoC: rsnd: add .auto_selectable_formats support

By this patch, DAI format might be automatically selected
(Depends on paired DAI).

Link: https://lore.kernel.org/r/871rb3hypy.wl-kuninori.morimoto.gx@renesas.com
Link: https://lore.kernel.org/r/871racbx0w.wl-kuninori.morimoto.gx@renesas.com
Signed-off-by: Kuninori Morimoto <kuninori.morimoto.gx@renesas.com>
Link: https://lore.kernel.org/r/87cztcnc6k.wl-kuninori.morimoto.gx@renesas.com
Signed-off-by: Mark Brown <broonie@kernel.org>
3 years agoASoC: pcm3168a: add .auto_selectable_formats support
Kuninori Morimoto [Thu, 27 May 2021 02:27:16 +0000 (11:27 +0900)]
ASoC: pcm3168a: add .auto_selectable_formats support

By this patch, DAI format might be automatically selected
(Depends on paired DAI).

Link: https://lore.kernel.org/r/871rb3hypy.wl-kuninori.morimoto.gx@renesas.com
Link: https://lore.kernel.org/r/871racbx0w.wl-kuninori.morimoto.gx@renesas.com
Signed-off-by: Kuninori Morimoto <kuninori.morimoto.gx@renesas.com>
Link: https://lore.kernel.org/r/87eedsnc6z.wl-kuninori.morimoto.gx@renesas.com
Signed-off-by: Mark Brown <broonie@kernel.org>
3 years agoASoC: ak4613: add .auto_selectable_formats support
Kuninori Morimoto [Thu, 27 May 2021 02:26:51 +0000 (11:26 +0900)]
ASoC: ak4613: add .auto_selectable_formats support

By this patch, DAI format might be automatically selected
(Depends on paired DAI).

Link: https://lore.kernel.org/r/871rb3hypy.wl-kuninori.morimoto.gx@renesas.com
Link: https://lore.kernel.org/r/871racbx0w.wl-kuninori.morimoto.gx@renesas.com
Signed-off-by: Kuninori Morimoto <kuninori.morimoto.gx@renesas.com>
Link: https://lore.kernel.org/r/87fsy8nc7o.wl-kuninori.morimoto.gx@renesas.com
Signed-off-by: Mark Brown <broonie@kernel.org>
3 years agoASoC: soc-core: add snd_soc_runtime_get_dai_fmt()
Kuninori Morimoto [Thu, 27 May 2021 02:26:12 +0000 (11:26 +0900)]
ASoC: soc-core: add snd_soc_runtime_get_dai_fmt()

ASoC is using dai_link which specify DAI format (= dai_link->dai_fmt),
and it is selected by "Sound Card" driver in corrent implementation.
In other words, Sound Card *needs* to setup it.
But, it should be possible to automatically selected from CPU and
Codec driver settings.

This patch adds new .auto_selectable_formats support
at snd_soc_dai_ops.

By this patch, dai_fmt can be automatically selected from each
driver if both CPU / Codec driver had it.
Automatically selectable *field* is depends on each drivers.

For example, some driver want to select format "automatically",
but want to select other fields "manually", because of complex limitation.
Or other example, in case of both CPU and Codec are possible to be
clock provider, but the quality was different.
In these case, user need/want to *manually* select each fields
from Sound Card driver.

This .auto_selectable_formats can set priority.
For example, no limitaion format can be HI priority,
supported but has picky limitation format can be next priority, etc.

It uses Sound Card specified fields preferentially, and try to select
non-specific fields from CPU and Codec driver automatically
if all drivers have .auto_selectable_formats.

In other words, we can select all dai_fmt via Sound Card driver
same as before.

Link: https://lore.kernel.org/r/871rb3hypy.wl-kuninori.morimoto.gx@renesas.com
Link: https://lore.kernel.org/r/871racbx0w.wl-kuninori.morimoto.gx@renesas.com
Signed-off-by: Kuninori Morimoto <kuninori.morimoto.gx@renesas.com>
Link: https://lore.kernel.org/r/87h7ionc8s.wl-kuninori.morimoto.gx@renesas.com
Signed-off-by: Mark Brown <broonie@kernel.org>
3 years agoASoC: soc-core: move snd_soc_runtime_set_dai_fmt() to upside
Kuninori Morimoto [Thu, 27 May 2021 02:25:36 +0000 (11:25 +0900)]
ASoC: soc-core: move snd_soc_runtime_set_dai_fmt() to upside

This patch moves snd_soc_runtime_set_dai_fmt() to upside.
This is prepare to support snd_soc_runtime_get_dai_fmt().

Signed-off-by: Kuninori Morimoto <kuninori.morimoto.gx@renesas.com>
Link: https://lore.kernel.org/r/87im34nc9r.wl-kuninori.morimoto.gx@renesas.com
Signed-off-by: Mark Brown <broonie@kernel.org>
3 years agoMerge series "ASoC: codecs: wcd934x: add Headset and button detection support" from...
Mark Brown [Fri, 4 Jun 2021 16:26:54 +0000 (17:26 +0100)]
Merge series "ASoC: codecs: wcd934x: add Headset and button detection support" from Srinivas Kandagatla <srinivas.kandagatla@linaro.org>:

This patchset adds support to MBHC(Multi Button Headset Control) block found in
Qualcomm WCD codecs. MBHC support headset type detection, both Mechanical and
electrical insert/removal detection along with 8 buttons detection,
Over current interrupts on HPHL/R, Impedance Measurements on HPHL/R.

Eventhough MBHC block supports things like OverCurrent detection, Currently its
reported as a kernel debug message. Should this be reported as an uevent to
userspace? like the way USB reports?
Any suggestions?

First patch adds a common mbhc driver and the second one wcd934x specific driver
changes along with sdm845 soundcard related changes.

Common wcd-mbhc-v2 driver should be reusable across multiple codecs like
WCD9335, WCD934x, WCD937x and WCD938x.

Most of the work is derived from downstream Qualcomm kernels.
Credits to various Qualcomm authors from Patrick Lai's team who have
contributed to this code.

Changes since v2:
- switched to EXPORT_SYMBOL_GPL from EXPORT_SYMBOL
- converted one of the if else to switch case.

Srinivas Kandagatla (4):
  ASoC: dt-bindings: wcd934x: add bindings for Headset Button detection
  ASoC: codecs: wcd: add multi button Headset detection support
  ASoC: codecs: wcd934x: add mbhc support
  ASoC: qcom: sdm845: add jack support for WCD934x

 .../bindings/sound/qcom,wcd934x.yaml          |   30 +
 include/linux/mfd/wcd934x/registers.h         |   57 +
 sound/soc/codecs/Kconfig                      |    4 +
 sound/soc/codecs/Makefile                     |    2 +
 sound/soc/codecs/wcd-mbhc-v2.c                | 1475 +++++++++++++++++
 sound/soc/codecs/wcd-mbhc-v2.h                |  340 ++++
 sound/soc/codecs/wcd934x.c                    |  884 +++++++++-
 sound/soc/qcom/sdm845.c                       |    8 +
 8 files changed, 2785 insertions(+), 15 deletions(-)
 create mode 100644 sound/soc/codecs/wcd-mbhc-v2.c
 create mode 100644 sound/soc/codecs/wcd-mbhc-v2.h

--
2.21.0

3 years agoASoC: qcom: sdm845: add jack support for WCD934x
Srinivas Kandagatla [Fri, 4 Jun 2021 11:52:30 +0000 (12:52 +0100)]
ASoC: qcom: sdm845: add jack support for WCD934x

Signed-off-by: Srinivas Kandagatla <srinivas.kandagatla@linaro.org>
Link: https://lore.kernel.org/r/20210604115230.23259-5-srinivas.kandagatla@linaro.org
Signed-off-by: Mark Brown <broonie@kernel.org>
3 years agoASoC: codecs: wcd934x: add mbhc support
Srinivas Kandagatla [Fri, 4 Jun 2021 11:52:29 +0000 (12:52 +0100)]
ASoC: codecs: wcd934x: add mbhc support

WCD934x has Multi Button Headset Control hardware to support Headset insertion,
type detection, 8 headset buttons detection, Over Current detection and Impedence
measurements.

This patch adds support for this feature via common mbhc layer.

Signed-off-by: Srinivas Kandagatla <srinivas.kandagatla@linaro.org>
Link: https://lore.kernel.org/r/20210604115230.23259-4-srinivas.kandagatla@linaro.org
Signed-off-by: Mark Brown <broonie@kernel.org>
3 years agoASoC: codecs: wcd: add multi button Headset detection support
Srinivas Kandagatla [Fri, 4 Jun 2021 11:52:28 +0000 (12:52 +0100)]
ASoC: codecs: wcd: add multi button Headset detection support

Most new Qualcomm WCD codecs support MBHC(Multi Button Headset Control) via ADC.

This patchset adds support to Common parts of this MBHC support so that
WCD codecs need not duplicate them. To do that codec exposes set of
register fields and callbacks to this common driver to control it.

Signed-off-by: Srinivas Kandagatla <srinivas.kandagatla@linaro.org>
Link: https://lore.kernel.org/r/20210604115230.23259-3-srinivas.kandagatla@linaro.org
Signed-off-by: Mark Brown <broonie@kernel.org>
3 years agoASoC: dt-bindings: wcd934x: add bindings for Headset Button detection
Srinivas Kandagatla [Fri, 4 Jun 2021 11:52:27 +0000 (12:52 +0100)]
ASoC: dt-bindings: wcd934x: add bindings for Headset Button detection

Add bindings required for Multi Button Headset detection.
WCD934x support Headsets with upto 8 buttons including, impedance measurement
on both L/R Headset speakers and cross connection detection.

Signed-off-by: Srinivas Kandagatla <srinivas.kandagatla@linaro.org>
Reviewed-by: Rob Herring <robh@kernel.org>
Link: https://lore.kernel.org/r/20210604115230.23259-2-srinivas.kandagatla@linaro.org
Signed-off-by: Mark Brown <broonie@kernel.org>
3 years agoASoC: snd-soc-lpass requires REGMAP_MMIO
Bertrand Jacquin [Thu, 3 Jun 2021 22:18:16 +0000 (23:18 +0100)]
ASoC: snd-soc-lpass requires REGMAP_MMIO

With CONFIG_SND_SOC_LPASS_RX_MACRO=m and CONFIG_REGMAP_MMIO undefined,
build fails with the following error

  make -f /var/tmp/portage/sys-kernel/stable-sources-5.12.8/work/linux-5.12.8-stable/scripts/Makefile.modpost
    sed 's/\.ko$/\.o/' modules.order | scripts/mod/modpost   -E  -o modules-only.symvers -i vmlinux.symvers   -T -
  ERROR: modpost: "__devm_regmap_init_mmio_clk" [sound/soc/codecs/snd-soc-lpass-rx-macro.ko] undefined!

This does also apply to other Qualcomm Macro LPASS all making call to
devm_regmap_init_mmio()

Signed-off-by: Bertrand Jacquin <bertrand@jacquin.bzh>
Link: https://lore.kernel.org/r/20210603221816.2642402-1-bertrand@jacquin.bzh
Signed-off-by: Mark Brown <broonie@kernel.org>
3 years agoASoC: ti: davinci-mcasp: Fix fall-through warning for Clang
Gustavo A. R. Silva [Fri, 4 Jun 2021 07:27:14 +0000 (02:27 -0500)]
ASoC: ti: davinci-mcasp: Fix fall-through warning for Clang

In preparation to enable -Wimplicit-fallthrough for Clang, fix a warning
by explicitly adding a fallthrough; statement.

Link: https://github.com/KSPP/linux/issues/115
Signed-off-by: Gustavo A. R. Silva <gustavoars@kernel.org>
Acked-by: Peter Ujfalusi <peter.ujflausi@gmail.com>
Link: https://lore.kernel.org/r/20210604072714.GA244640@embeddedor
Signed-off-by: Mark Brown <broonie@kernel.org>
3 years agoMerge series "ASoC: rsnd: tidyup adg and header" from Kuninori Morimoto <kuninori...
Mark Brown [Thu, 3 Jun 2021 18:36:04 +0000 (19:36 +0100)]
Merge series "ASoC: rsnd: tidyup adg and header" from Kuninori Morimoto <kuninori.morimoto.gx@renesas.com>:

Hi Mark

I noticed that adg can be more clean code.
And rsnd.h header comment was not so good
because patch has been randomly added.

This patch tidyup these.

Kuninori Morimoto (5):
  ASoC: rsnd: adg: supply __printf(x, y) formatting for dbg_msg()
  ASoC: rsnd: adg: tidyup rsnd_adg_get_clkin/out() parameter
  ASoC: rsnd: adg: use more simple method for null_clk
  ASoC: rsnd: adg: check return value for rsnd_adg_get_clkin/out()
  ASoC: rsnd: tidyup __rsnd_mod_xxx macro comments

 sound/soc/sh/rcar/adg.c  | 139 +++++++++++++++++++++++++--------------
 sound/soc/sh/rcar/rsnd.h |  21 ++----
 2 files changed, 97 insertions(+), 63 deletions(-)

--
2.25.1

3 years agoASoC: img: Fix PM reference leak in img_i2s_in_probe()
Yufen Yu [Mon, 24 May 2021 09:35:21 +0000 (05:35 -0400)]
ASoC: img: Fix PM reference leak in img_i2s_in_probe()

pm_runtime_get_sync will increment pm usage counter even it failed.
Forgetting to putting operation will result in reference leak here.
Fix it by replacing it with pm_runtime_resume_and_get to keep usage
counter balanced.

Reported-by: Hulk Robot <hulkci@huawei.com>
Signed-off-by: Yufen Yu <yuyufen@huawei.com>
Link: https://lore.kernel.org/r/20210524093521.612176-1-yuyufen@huawei.com
Signed-off-by: Mark Brown <broonie@kernel.org>
3 years agoASoC: fsl: imx-es8328: use devm_snd_soc_register_card()
Yang Yingliang [Wed, 2 Jun 2021 13:33:59 +0000 (21:33 +0800)]
ASoC: fsl: imx-es8328: use devm_snd_soc_register_card()

Using devm_snd_soc_register_card() can make the code
shorter and cleaner.

Signed-off-by: Yang Yingliang <yangyingliang@huawei.com>
Link: https://lore.kernel.org/r/20210602133359.310647-1-yangyingliang@huawei.com
Signed-off-by: Mark Brown <broonie@kernel.org>
3 years agoASoC: rsnd: check for zero node count
Colin Ian King [Thu, 3 Jun 2021 11:03:15 +0000 (12:03 +0100)]
ASoC: rsnd: check for zero node count

Most callers of_get_child_count() check that "nr" is non-zero so it
causes a static checker warning when we don't do that here.  This
does not cause a problem or a crash, but having zero SSUIes does not
make sense either so let's add a check.

Addresses-Coverity: ("Unchecked return value")
Fixes: c413983eb66a ("ASoC: rsnd: adjust disabled module")
Acked-by: Kuninori Morimoto <kuninori.morimoto.gx@renesas.com>
Signed-off-by: Colin Ian King <colin.king@canonical.com>
Link: https://lore.kernel.org/r/20210603110315.81146-1-colin.king@canonical.com
Signed-off-by: Mark Brown <broonie@kernel.org>
3 years agoASoC: dt-bindings: Convert imx-audmux binding to json schema
Oleksij Rempel [Mon, 31 May 2021 06:47:52 +0000 (08:47 +0200)]
ASoC: dt-bindings: Convert imx-audmux binding to json schema

Convert the imx-audmux binding to DT schema format using json-schema

Signed-off-by: Oleksij Rempel <o.rempel@pengutronix.de>
Reviewed-by: Rob Herring <robh@kernel.org>
Link: https://lore.kernel.org/r/20210531064752.8809-1-o.rempel@pengutronix.de
Signed-off-by: Mark Brown <broonie@kernel.org>
3 years agoASoC: imx-audio-rpmsg: use module_rpmsg_driver to simplify the code
Yang Yingliang [Wed, 2 Jun 2021 08:26:10 +0000 (16:26 +0800)]
ASoC: imx-audio-rpmsg: use module_rpmsg_driver to simplify the code

module_rpmsg_driver() makes the code simpler by eliminating
boilerplate code.

Signed-off-by: Yang Yingliang <yangyingliang@huawei.com>
Link: https://lore.kernel.org/r/20210602082610.3828408-1-yangyingliang@huawei.com
Signed-off-by: Mark Brown <broonie@kernel.org>
3 years agoASoC: atmel: sam9x5_wm8731: use devm_snd_soc_register_card()
Yang Yingliang [Wed, 2 Jun 2021 14:16:19 +0000 (22:16 +0800)]
ASoC: atmel: sam9x5_wm8731: use devm_snd_soc_register_card()

Using devm_snd_soc_register_card() can make the code
shorter and cleaner.

Signed-off-by: Yang Yingliang <yangyingliang@huawei.com>
Link: https://lore.kernel.org/r/20210602141619.323286-1-yangyingliang@huawei.com
Signed-off-by: Mark Brown <broonie@kernel.org>
3 years agoASoC: rsnd: tidyup __rsnd_mod_xxx macro comments
Kuninori Morimoto [Tue, 1 Jun 2021 23:44:39 +0000 (08:44 +0900)]
ASoC: rsnd: tidyup __rsnd_mod_xxx macro comments

status and __rsnd_mod_xxx were updated, but some related comments were
not. And it has verbose comments. This patch cleanup/tidyup these.

1) adds missing "D" to status sample
2) remove verbose list for "H"
3) add "needs protect" to __rsnd_mod_call_xxx

Signed-off-by: Kuninori Morimoto <kuninori.morimoto.gx@renesas.com>
Link: https://lore.kernel.org/r/87o8cpi1zs.wl-kuninori.morimoto.gx@renesas.com
Signed-off-by: Mark Brown <broonie@kernel.org>
3 years agoASoC: rsnd: adg: check return value for rsnd_adg_get_clkin/out()
Kuninori Morimoto [Tue, 1 Jun 2021 23:44:09 +0000 (08:44 +0900)]
ASoC: rsnd: adg: check return value for rsnd_adg_get_clkin/out()

Current rsnd_adg_get_clkin/out() are void function,
thus adg->clk/clkout[i] might be NULL.

But, for_each_rsnd_clk/clkout() macros are assuming
all clks are non NULL.

Because of this mismatch, code can be complex and/or buggy.
These functions return error by this patch,
and make sure all clks are non NULL.

Signed-off-by: Kuninori Morimoto <kuninori.morimoto.gx@renesas.com>
Link: https://lore.kernel.org/r/87pmx5i20m.wl-kuninori.morimoto.gx@renesas.com
Signed-off-by: Mark Brown <broonie@kernel.org>
3 years agoASoC: rsnd: adg: use more simple method for null_clk
Kuninori Morimoto [Tue, 1 Jun 2021 23:43:50 +0000 (08:43 +0900)]
ASoC: rsnd: adg: use more simple method for null_clk

commit 965386c97616c ("ASoC: rsnd: call unregister for null_hw when
removed") tried unregister null_clk, but it has some issues.

1st issue is kernel will indicate below message when unregistering,
because of its timing. unregistering should be happen after clk_disable().

clk_unregister: unregistering prepared clock: rsnd_adg_null

2nd issue is, it is using priv->null_clk, but it should be adg->null_clk.

3rd issue is it is using very complex clk registering method.
more simple clk_register/unregister_fixed_rate() should be OK.

This patch fixes these.

Fixes: 965386c97616c ("ASoC: rsnd: call unregister for null_hw when removed")
Signed-off-by: Kuninori Morimoto <kuninori.morimoto.gx@renesas.com>
Link: https://lore.kernel.org/r/87r1hli215.wl-kuninori.morimoto.gx@renesas.com
Signed-off-by: Mark Brown <broonie@kernel.org>
3 years agoASoC: rsnd: adg: tidyup rsnd_adg_get_clkin/out() parameter
Kuninori Morimoto [Tue, 1 Jun 2021 23:43:36 +0000 (08:43 +0900)]
ASoC: rsnd: adg: tidyup rsnd_adg_get_clkin/out() parameter

set priv->adg before rsnd_adg_get_clkin/out() to be more simple code.
Nothing is changed, but is preparation for
next "ASoC: rsnd: adg: use more simple method for null_clk" patch

Signed-off-by: Kuninori Morimoto <kuninori.morimoto.gx@renesas.com>
Link: https://lore.kernel.org/r/87sg21i21j.wl-kuninori.morimoto.gx@renesas.com
Signed-off-by: Mark Brown <broonie@kernel.org>
3 years agoASoC: rsnd: adg: supply __printf(x, y) formatting for dbg_msg()
Kuninori Morimoto [Tue, 1 Jun 2021 23:43:28 +0000 (08:43 +0900)]
ASoC: rsnd: adg: supply __printf(x, y) formatting for dbg_msg()

Fixes the following W=1 kernel build warning(s):

sound/soc/sh/rcar/adg.c: In function 'dbg_msg':
sound/soc/sh/rcar/adg.c:594:2: warning: function 'dbg_msg' might \
 be a candidate for 'gnu_printf' format attribute\
 [-Wsuggest-attribute=format]

Fixes: 1f9c82b5ab83 ("ASoC: rsnd: add debugfs support")
Reported-by: kernel test robot <lkp@intel.com>
Signed-off-by: Kuninori Morimoto <kuninori.morimoto.gx@renesas.com>
Link: https://lore.kernel.org/r/87tumhi21r.wl-kuninori.morimoto.gx@renesas.com
Signed-off-by: Mark Brown <broonie@kernel.org>
3 years agoASoC: Intel: Skylake: use DEVICE_ATTR_RO macro
YueHaibing [Mon, 24 May 2021 11:55:06 +0000 (19:55 +0800)]
ASoC: Intel: Skylake: use DEVICE_ATTR_RO macro

Use DEVICE_ATTR_RO() helper instead of plain DEVICE_ATTR(),
which makes the code a bit shorter and easier to read.

Signed-off-by: YueHaibing <yuehaibing@huawei.com>
Reviewed-by: Cezary Rojewski <cezary.rojewski@intel.com>
Link: https://lore.kernel.org/r/20210524115506.35724-1-yuehaibing@huawei.com
Signed-off-by: Mark Brown <broonie@kernel.org>
3 years agoASoC: codecs: tfa989x: Add support for optional vddd-supply
Vincent Knecht [Fri, 28 May 2021 10:51:01 +0000 (12:51 +0200)]
ASoC: codecs: tfa989x: Add support for optional vddd-supply

Allow specifying Vddd regulator/supply to be enabled on I2C probing.

Signed-off-by: Vincent Knecht <vincent.knecht@mailoo.org>
Reviewed-by: Stephan Gerhold <stephan@gerhold.net>
Link: https://lore.kernel.org/r/20210528105101.508254-4-vincent.knecht@mailoo.org
Signed-off-by: Mark Brown <broonie@kernel.org>
3 years agoASoC: dt-bindings: nxp, tfa989x: Add vddd-supply property
Vincent Knecht [Fri, 28 May 2021 10:51:00 +0000 (12:51 +0200)]
ASoC: dt-bindings: nxp, tfa989x: Add vddd-supply property

Add optional vddd-supply property to allow regulator control.

Signed-off-by: Vincent Knecht <vincent.knecht@mailoo.org>
Link: https://lore.kernel.org/r/20210528105101.508254-3-vincent.knecht@mailoo.org
Signed-off-by: Mark Brown <broonie@kernel.org>
3 years agoASoC: codecs: tfa989x: Add support for tfa9897
Vincent Knecht [Fri, 28 May 2021 10:50:59 +0000 (12:50 +0200)]
ASoC: codecs: tfa989x: Add support for tfa9897

Add specific init function to poke needed registers & values for this IC

Signed-off-by: Vincent Knecht <vincent.knecht@mailoo.org>
Reviewed-by: Stephan Gerhold <stephan@gerhold.net>
Link: https://lore.kernel.org/r/20210528105101.508254-2-vincent.knecht@mailoo.org
Signed-off-by: Mark Brown <broonie@kernel.org>
3 years agoASoC: dt-bindings: nxp,tfa989x: Add tfa9897 support
Vincent Knecht [Fri, 28 May 2021 10:50:58 +0000 (12:50 +0200)]
ASoC: dt-bindings: nxp,tfa989x: Add tfa9897 support

Document TFA9897 bindings.

Signed-off-by: Vincent Knecht <vincent.knecht@mailoo.org>
Reviewed-by: Stephan Gerhold <stephan@gerhold.net>
Link: https://lore.kernel.org/r/20210528105101.508254-1-vincent.knecht@mailoo.org
Signed-off-by: Mark Brown <broonie@kernel.org>
3 years agoASoC: sigmadsp: Remove the repeated declaration
Shaokun Zhang [Sat, 29 May 2021 09:14:50 +0000 (17:14 +0800)]
ASoC: sigmadsp: Remove the repeated declaration

Function 'sigmadsp_reset' is declared twice, so remove the repeated
declaration.

Cc: Mark Brown <broonie@kernel.org>
Signed-off-by: Shaokun Zhang <zhangshaokun@hisilicon.com>
Link: https://lore.kernel.org/r/1622279690-3740-1-git-send-email-zhangshaokun@hisilicon.com
Signed-off-by: Mark Brown <broonie@kernel.org>
3 years agoASoC: rk817: fix a warning in rk817_probe()
Chris Morgan [Tue, 1 Jun 2021 21:44:24 +0000 (16:44 -0500)]
ASoC: rk817: fix a warning in rk817_probe()

The return value of snd_soc_component_write() is stored but not
evaluated and this results in a warning when W=1 is set. Stop storing
the return value to be consistent with all other calls of
snd_soc_component_write() and to remove the warning.

Fixes: 0d6a04da9b25 ("ASoC: Add Rockchip rk817 audio CODEC support")

Signed-off-by: Chris Morgan <macromorgan@hotmail.com>
Signed-off-by: Lee Jones <lee.jones@linaro.org>
3 years agoMerge series "ASoC: Constify snd_compress_ops" from Rikard Falkeborn <rikard.falkebor...
Mark Brown [Tue, 1 Jun 2021 17:10:41 +0000 (18:10 +0100)]
Merge series "ASoC: Constify snd_compress_ops" from Rikard Falkeborn <rikard.falkeborn@gmail.com>:

The only use of the static and global snd_compress_ops structs is to
assign their address to the compress_ops field in the
snd_soc_component_driver struct which is a pointer to const. Make them
const to allow the compiler to put them in read-only memory.

Rikard Falkeborn (5):
  ASoC: cs47125: Constify static struct snd_compress_ops
  ASoC: wm5102: Constify static struct snd_compress_ops
  ASoC: wm5110: Constify static struct snd_compress_ops
  ASoC: qcom: q6asm-dai: Constify static struct snd_compress_ops
  ASoC: SOF: Intel: Constify sof_probe_compressed_ops

 sound/soc/codecs/cs47l24.c       | 2 +-
 sound/soc/codecs/wm5102.c        | 2 +-
 sound/soc/codecs/wm5110.c        | 2 +-
 sound/soc/qcom/qdsp6/q6asm-dai.c | 2 +-
 sound/soc/sof/compress.c         | 2 +-
 sound/soc/sof/compress.h         | 2 +-
 6 files changed, 6 insertions(+), 6 deletions(-)

--
2.31.1

3 years agoMerge series "ASoC: rsnd: adjust disabled module for R-Car D3" from Kuninori Morimoto...
Mark Brown [Tue, 1 Jun 2021 17:10:39 +0000 (18:10 +0100)]
Merge series "ASoC: rsnd: adjust disabled module for R-Car D3" from Kuninori Morimoto <kuninori.morimoto.gx@renesas.com>:

Hi Mark, Geert

Renesas Sound driver is assuming that all SSI/SRC
are connected.
But some SSI/SRC are not connected on Some Renesas SoC.
ex)
H2 E2

SRC0       <=
SRC1 SRC1
SRC2 SRC2
... ...

We accepted it by using "status = disabled" on DT before.

ex)
rcar_sound,src {
src-0 {
=> status = "disabled";
};
src1: src-1 {
...
};
...

But R-Car D3 have many disabled modules (It has SSI3/SSI4, SRC5/SRC6),
and Renesas SoC maintainer don't want above style on DT.

ex)
rcar_sound,src {
=> src0: src-0 { status = "disabled"; };
=> src1: src-1 { status = "disabled"; };
=> src2: src-2 { status = "disabled"; };
=> src3: src-3 { status = "disabled"; };
=> src4: src-4 { status = "disabled"; };
src5: src-5 {
...
};
...

This patch-set adjust to this situation, and enables to intuitive DT settings.

rcar_sound,src {
src5: src-5 {
...
};
src6: src-6 {
...
};
};

Kuninori Morimoto (4):
  ASoC: rsnd: tidyup rsnd_parse_connect_common()
  ASoC: rsnd: tidyup rsnd_dma_request_channel()
  ASoC: rsnd: tidyup rsnd_parse_connect_xxx()
  ASoC: rsnd: adjust disabled module

 sound/soc/sh/rcar/core.c | 58 ++++++++++++++++++++++++++++++++++++++--
 sound/soc/sh/rcar/dma.c  |  8 +++---
 sound/soc/sh/rcar/dvc.c  |  2 +-
 sound/soc/sh/rcar/rsnd.h | 16 ++++++-----
 sound/soc/sh/rcar/src.c  |  6 +++--
 sound/soc/sh/rcar/ssi.c  | 12 ++++++---
 sound/soc/sh/rcar/ssiu.c | 10 ++++---
 7 files changed, 91 insertions(+), 21 deletions(-)

--
2.25.1

3 years agoASoC: SOF: Intel: pci-tgl: add ADL-M support
Kai Vehmanen [Fri, 28 May 2021 18:41:53 +0000 (21:41 +0300)]
ASoC: SOF: Intel: pci-tgl: add ADL-M support

Add PCI DID for Intel AlderLake-M.

Signed-off-by: Kai Vehmanen <kai.vehmanen@linux.intel.com>
Reviewed-by: Péter Ujfalusi <peter.ujfalusi@linux.intel.com>
Reviewed-by: Ranjani Sridharan <ranjani.sridharan@linux.intel.com>
Reviewed-by: Pierre-Louis Bossart <pierre-louis.bossart@linux.intel.com>
Link: https://lore.kernel.org/r/20210528184153.18251-1-kai.vehmanen@linux.intel.com
Signed-off-by: Mark Brown <broonie@kernel.org>
3 years agoASoC: SOF: Intel: hda: don't print ROM status if cl_dsp_init() fails
Ranjani Sridharan [Fri, 28 May 2021 16:05:51 +0000 (19:05 +0300)]
ASoC: SOF: Intel: hda: don't print ROM status if cl_dsp_init() fails

cl_dsp_init() dumps the ROM status if it fails after max
attempts before powering off the DSP. Remove the duplicate
log to print the ROM status and error in
hda_dsp_cl_boot_firmware(). These values are invalid anyway
as the DSP is already powered off.

Co-developed-by: Pierre-Louis Bossart <pierre-louis.bossart@linux.intel.com>
Signed-off-by: Pierre-Louis Bossart <pierre-louis.bossart@linux.intel.com>
Signed-off-by: Ranjani Sridharan <ranjani.sridharan@linux.intel.com>
Reviewed-by: Bard Liao <bard.liao@intel.com>
Signed-off-by: Kai Vehmanen <kai.vehmanen@linux.intel.com>
Link: https://lore.kernel.org/r/20210528160551.10145-2-kai.vehmanen@linux.intel.com
Signed-off-by: Mark Brown <broonie@kernel.org>
3 years agoASoC: SOF: Intel: hda: clean up hda_dsp_dump()
Ranjani Sridharan [Fri, 28 May 2021 16:05:50 +0000 (19:05 +0300)]
ASoC: SOF: Intel: hda: clean up hda_dsp_dump()

Clean up the hda_dsp_dump() function to avoid duplicating
the ROM status and error.

Signed-off-by: Ranjani Sridharan <ranjani.sridharan@linux.intel.com>
Reviewed-by: Pierre-Louis Bossart <pierre-louis.bossart@linux.intel.com>
Reviewed-by: Bard Liao <bard.liao@intel.com>
Signed-off-by: Kai Vehmanen <kai.vehmanen@linux.intel.com>
Link: https://lore.kernel.org/r/20210528160551.10145-1-kai.vehmanen@linux.intel.com
Signed-off-by: Mark Brown <broonie@kernel.org>
3 years agoASoC: ti: omap-mcbsp: use DEVICE_ATTR_RW macro
YueHaibing [Fri, 28 May 2021 06:30:33 +0000 (14:30 +0800)]
ASoC: ti: omap-mcbsp: use DEVICE_ATTR_RW macro

Use DEVICE_ATTR_RW() helper instead of plain DEVICE_ATTR(),
which makes the code a bit shorter and easier to read.

Signed-off-by: YueHaibing <yuehaibing@huawei.com>
Acked-by: Jarkko Nikula <jarkko.nikula@bitmer.com>
Acked-by: Peter Ujfalusi <peter.ujfalusi@gmail.com>
Link: https://lore.kernel.org/r/20210528063033.19904-1-yuehaibing@huawei.com
Signed-off-by: Mark Brown <broonie@kernel.org>
3 years agoASoC: SOF: Intel: Constify sof_probe_compressed_ops
Rikard Falkeborn [Wed, 26 May 2021 23:10:13 +0000 (01:10 +0200)]
ASoC: SOF: Intel: Constify sof_probe_compressed_ops

The only usage of sof_probe_compressed_ops is to assign its address to
the compress_ops field in the snd_soc_component_driver struct, which is
a pointer to const. The assignment is done in sound/soc/sof/pcm.c. Make
it const to allow the compiler to put it in read-only memory.

Signed-off-by: Rikard Falkeborn <rikard.falkeborn@gmail.com>
Link: https://lore.kernel.org/r/20210526231013.46530-6-rikard.falkeborn@gmail.com
Signed-off-by: Mark Brown <broonie@kernel.org>
3 years agoASoC: qcom: q6asm-dai: Constify static struct snd_compress_ops
Rikard Falkeborn [Wed, 26 May 2021 23:10:12 +0000 (01:10 +0200)]
ASoC: qcom: q6asm-dai: Constify static struct snd_compress_ops

The snd_compress_ops structs are only stored in the compress_ops field
of a snd_soc_component_driver struct, so make it const to allow the
compiler to put it in read-only memory.

Signed-off-by: Rikard Falkeborn <rikard.falkeborn@gmail.com>
Reviewed-by: Srinivas Kandagatla <srinivas.kandagatla@linaro.org>
Link: https://lore.kernel.org/r/20210526231013.46530-5-rikard.falkeborn@gmail.com
Signed-off-by: Mark Brown <broonie@kernel.org>
3 years agoASoC: wm5110: Constify static struct snd_compress_ops
Rikard Falkeborn [Wed, 26 May 2021 23:10:11 +0000 (01:10 +0200)]
ASoC: wm5110: Constify static struct snd_compress_ops

The snd_compress_ops structs are only stored in the compress_ops field
of a snd_soc_component_driver struct, so make it const to allow the
compiler to put it in read-only memory.

Signed-off-by: Rikard Falkeborn <rikard.falkeborn@gmail.com>
Link: https://lore.kernel.org/r/20210526231013.46530-4-rikard.falkeborn@gmail.com
Signed-off-by: Mark Brown <broonie@kernel.org>
3 years agoASoC: wm5102: Constify static struct snd_compress_ops
Rikard Falkeborn [Wed, 26 May 2021 23:10:10 +0000 (01:10 +0200)]
ASoC: wm5102: Constify static struct snd_compress_ops

The snd_compress_ops structs are only stored in the compress_ops field
of a snd_soc_component_driver struct, so make it const to allow the
compiler to put it in read-only memory.

Signed-off-by: Rikard Falkeborn <rikard.falkeborn@gmail.com>
Link: https://lore.kernel.org/r/20210526231013.46530-3-rikard.falkeborn@gmail.com
Signed-off-by: Mark Brown <broonie@kernel.org>
3 years agoASoC: cs47125: Constify static struct snd_compress_ops
Rikard Falkeborn [Wed, 26 May 2021 23:10:09 +0000 (01:10 +0200)]
ASoC: cs47125: Constify static struct snd_compress_ops

The snd_compress_ops structs are only stored in the compress_ops field
of a snd_soc_component_driver struct, so make it const to allow the
compiler to put it in read-only memory.

Signed-off-by: Rikard Falkeborn <rikard.falkeborn@gmail.com>
Link: https://lore.kernel.org/r/20210526231013.46530-2-rikard.falkeborn@gmail.com
Signed-off-by: Mark Brown <broonie@kernel.org>
3 years agoASoC: rsnd: adjust disabled module
Kuninori Morimoto [Mon, 31 May 2021 04:19:32 +0000 (13:19 +0900)]
ASoC: rsnd: adjust disabled module

In general Renesas SoC's SSI/SRC are all enabled, but some SoC is not.

H2 E2

SRC0       <=
SRC1 SRC1
SRC2 SRC2
... ...

Renesas Sound driver is assuming that *all* modules are
enabled, and thus it is using *data array* to access each modules.
Because of it, we have been using "status = disabled" at DT,
and using *full size* array but avoiding disabled module.

ex)
rcar_sound,src {
src-0 {
=> status = "disabled";
};
src1: src-1 {
...
};
...

But R-Car D3 have many disabled modules (It has SSI3/SSI4, SRC5/SRC6),
and Renesas SoC maintainer don't want above style on DT.

ex)
rcar_sound,src {
=> src0: src-0 { status = "disabled"; };
=> src1: src-1 { status = "disabled"; };
=> src2: src-2 { status = "disabled"; };
=> src3: src-3 { status = "disabled"; };
=> src4: src-4 { status = "disabled"; };
src5: src-5 {
...
};
src6: src-6 {
...
};
};

rcar_sound,ssi {
=> ssi0: ssi-0 { status = "disabled"; };
=> ssi1: ssi-1 { status = "disabled"; };
=> ssi2: ssi-2 { status = "disabled"; };
ssi3: ssi-3 {
...
};
ssi4: ssi-4 {
...
};
};

To adjust it, it needs to care about related for_each_child_of_node()
loop on rsnd driver, and it is used from...

> grep -l for_each_child_of_node sound/soc/sh/rcar/*
sound/soc/sh/rcar/core.c
sound/soc/sh/rcar/ctu.c
sound/soc/sh/rcar/dma.c
sound/soc/sh/rcar/dvc.c
sound/soc/sh/rcar/mix.c
sound/soc/sh/rcar/src.c
sound/soc/sh/rcar/ssi.c
sound/soc/sh/rcar/ssiu.c

This patch adjust to this situation.
By this patch, we can avoid disabled modules on DT

rcar_sound,src {
src5: src-5 {
...
};
src6: src-6 {
...
};
};

rcar_sound,ssi {
ssi3: ssi-3 {
...
};
ssi4: ssi-4 {
...
};
};

Signed-off-by: Kuninori Morimoto <kuninori.morimoto.gx@renesas.com>
Link: https://lore.kernel.org/r/875yyzk017.wl-kuninori.morimoto.gx@renesas.com
Signed-off-by: Mark Brown <broonie@kernel.org>
3 years agoASoC: rsnd: tidyup rsnd_parse_connect_xxx()
Kuninori Morimoto [Mon, 31 May 2021 04:19:18 +0000 (13:19 +0900)]
ASoC: rsnd: tidyup rsnd_parse_connect_xxx()

This patch tidyup rsnd_parse_connect_xxx() style.
Nothing is changed, but is preparation for
next "ASoC: rsnd: adjust disabled module" patch

Signed-off-by: Kuninori Morimoto <kuninori.morimoto.gx@renesas.com>
Link: https://lore.kernel.org/r/877djfk01l.wl-kuninori.morimoto.gx@renesas.com
Signed-off-by: Mark Brown <broonie@kernel.org>
3 years agoASoC: rsnd: tidyup rsnd_dma_request_channel()
Kuninori Morimoto [Mon, 31 May 2021 04:19:13 +0000 (13:19 +0900)]
ASoC: rsnd: tidyup rsnd_dma_request_channel()

This patch adds "char *name" to rsnd_dma_request_channel().
It is not yet used so far, but is preparation for
next "ASoC: rsnd: adjust disabled module" patch

Signed-off-by: Kuninori Morimoto <kuninori.morimoto.gx@renesas.com>
Link: https://lore.kernel.org/r/878s3vk01q.wl-kuninori.morimoto.gx@renesas.com
Signed-off-by: Mark Brown <broonie@kernel.org>
3 years agoASoC: rsnd: tidyup rsnd_parse_connect_common()
Kuninori Morimoto [Mon, 31 May 2021 04:19:09 +0000 (13:19 +0900)]
ASoC: rsnd: tidyup rsnd_parse_connect_common()

This patch adds "char *name" to rsnd_parse_connect_common().
It is not yet used so far, but is preparation for
next "ASoC: rsnd: adjust disabled module" patch

Signed-off-by: Kuninori Morimoto <kuninori.morimoto.gx@renesas.com>
Link: https://lore.kernel.org/r/87a6obk01v.wl-kuninori.morimoto.gx@renesas.com
Signed-off-by: Mark Brown <broonie@kernel.org>
3 years agodt-bindings: Add Rockchip rk817 audio CODEC support
Chris Morgan [Wed, 19 May 2021 20:37:53 +0000 (15:37 -0500)]
dt-bindings: Add Rockchip rk817 audio CODEC support

Create dt-binding documentation to document rk817 codec.
New property name of rockchip,mic-in-differential added to control if
the microphone is in differential mode or not.

Signed-off-by: Chris Morgan <macromorgan@hotmail.com>
Tested-by: Maciej Matuszczyk <maccraft123mc@gmail.com>
Acked-by: Rob Herring <robh@kernel.org>
Signed-off-by: Lee Jones <lee.jones@linaro.org>
3 years agoASoC: Add Rockchip rk817 audio CODEC support
Chris Morgan [Wed, 19 May 2021 20:37:52 +0000 (15:37 -0500)]
ASoC: Add Rockchip rk817 audio CODEC support

Add support for the Rockchip rk817 audio codec integrated into the
rk817 PMIC. This is based on the sources provided by Rockchip from
their BSP kernel.

Signed-off-by: Chris Morgan <macromorgan@hotmail.com>
Tested-by: Maciej Matuszczyk <maccraft123mc@gmail.com>
Reviewed-by: Mark Brown <broonie@kernel.org>
Signed-off-by: Lee Jones <lee.jones@linaro.org>
3 years agomfd: Add Rockchip rk817 audio CODEC support
Chris Morgan [Wed, 19 May 2021 20:37:51 +0000 (15:37 -0500)]
mfd: Add Rockchip rk817 audio CODEC support

Add rk817 codec support cell to rk808 mfd driver.

Signed-off-by: Chris Morgan <macromorgan@hotmail.com>
Tested-by: Maciej Matuszczyk <maccraft123mc@gmail.com>
Signed-off-by: Lee Jones <lee.jones@linaro.org>
3 years agoASoC: imx-rpmsg: fix platform_no_drv_owner.cocci warnings
Zou Wei [Thu, 27 May 2021 11:07:32 +0000 (19:07 +0800)]
ASoC: imx-rpmsg: fix platform_no_drv_owner.cocci warnings

./sound/soc/fsl/imx-rpmsg.c:140:3-8: No need to set .owner here. The core will do it.

 Remove .owner field if calls are used which set it automatically

Generated by: scripts/coccinelle/api/platform_no_drv_owner.cocci

Reported-by: Hulk Robot <hulkci@huawei.com>
Signed-off-by: Zou Wei <zou_wei@huawei.com>
Message-Id: <1622113652-56646-1-git-send-email-zou_wei@huawei.com>
Signed-off-by: Mark Brown <broonie@kernel.org>
3 years agoASoC: rsnd: tidyup rsnd_ssiu_busif_err_irq_ctrl()
Kuninori Morimoto [Thu, 27 May 2021 02:42:03 +0000 (11:42 +0900)]
ASoC: rsnd: tidyup rsnd_ssiu_busif_err_irq_ctrl()

rsnd_ssiu_busif_err_irq_ctrl() has very similar duplicated code.
This patch merge and tidyup the code.

Signed-off-by: Kuninori Morimoto <kuninori.morimoto.gx@renesas.com>
Message-Id: <87sg28lwxw.wl-kuninori.morimoto.gx@renesas.com>
Signed-off-by: Mark Brown <broonie@kernel.org>
3 years agoASoC: rsnd: tidyup rsnd_ssiu_busif_err_status_clear()
Kuninori Morimoto [Thu, 27 May 2021 02:41:56 +0000 (11:41 +0900)]
ASoC: rsnd: tidyup rsnd_ssiu_busif_err_status_clear()

rsnd_ssiu_busif_err_status_clear() has very similar duplicated code.
This patch merge and tidyup the code.

Signed-off-by: Kuninori Morimoto <kuninori.morimoto.gx@renesas.com>
Message-Id: <87tumolwy3.wl-kuninori.morimoto.gx@renesas.com>
Signed-off-by: Mark Brown <broonie@kernel.org>
3 years agoASoC: rsnd: implement BUSIF related code in ssiu.c
Kuninori Morimoto [Thu, 27 May 2021 02:41:50 +0000 (11:41 +0900)]
ASoC: rsnd: implement BUSIF related code in ssiu.c

BUSIF is SSIU feature, but its related code is
implemented at ssi.c today.
This patch moves it to ssiu.c

Signed-off-by: Kuninori Morimoto <kuninori.morimoto.gx@renesas.com>
Message-Id: <87v974lwy9.wl-kuninori.morimoto.gx@renesas.com>
Signed-off-by: Mark Brown <broonie@kernel.org>
3 years agoASoC: rsnd: protect mod->status
Kuninori Morimoto [Thu, 27 May 2021 02:41:42 +0000 (11:41 +0900)]
ASoC: rsnd: protect mod->status

Renesas Sound uses many modules (SSI/SSIU/SRC/CTU/MIX/DVC/DMA),
and supports complex connections/path.
Thus each modules needs to save its status to correctly control it.
This status is updated when by .trigger, and .hw_params/.hw_free.

Renesas Sound is protecting modules by using lock when .trigger,
but it was not enough to protecting each modules "status" if it was
used from many paths.

1) .hw_params/.hw_free update status
2) another doesn't update status, but overwrites by same value

This patch do
1) protects .hw_params/.hw_free by lock
2) do nothing if no status update

Without this patch, protected mod->status (= .trigger) might be
overwrote by non protected mod->status (= .hw_params / .hw_free),
and in such case, CTU/MIX/DVC/SSIU/SSI which are used from
many paths might get damage.

If above issue happens, Renesas Sound will be hung (= silence)
and never be recoverd.
I could reproduce this issue by continue playing very short sound
with loop very long term (3-4 hours) through 2 inputs (= MIXer).

For updating rsnd_status_update(), this patch removes rsnd_dai_call()
debug message. Because we already have debugfs support, and is not
good match to new code.

Reported-by: Linh Phung T. Y <linh.phung.jy@renesas.com>
Signed-off-by: Kuninori Morimoto <kuninori.morimoto.gx@renesas.com>
Message-Id: <87wnrklwyh.wl-kuninori.morimoto.gx@renesas.com>
Signed-off-by: Mark Brown <broonie@kernel.org>
3 years agoASoC: rsnd: add debugfs support
Kuninori Morimoto [Thu, 27 May 2021 02:41:36 +0000 (11:41 +0900)]
ASoC: rsnd: add debugfs support

Current rsnd supports #define DEBUG, but it is not helpful
if issue happen after 4-5 hours.
This patch adds debugfs support for it.

Signed-off-by: Kuninori Morimoto <kuninori.morimoto.gx@renesas.com>
Message-Id: <87y2c0lwyn.wl-kuninori.morimoto.gx@renesas.com>
Signed-off-by: Mark Brown <broonie@kernel.org>
3 years agoASoC: rsnd: incidate irq error message
Kuninori Morimoto [Thu, 27 May 2021 02:41:28 +0000 (11:41 +0900)]
ASoC: rsnd: incidate irq error message

Current rsnd is using dev_dbg() if irq error happen,
but it makes debug very difficult if some strange things happen.
This patch uses dev_info() for it, and rename the macro name.

Signed-off-by: Kuninori Morimoto <kuninori.morimoto.gx@renesas.com>
Message-Id: <87zgwglwyv.wl-kuninori.morimoto.gx@renesas.com>
Signed-off-by: Mark Brown <broonie@kernel.org>
3 years agoASoC: rsnd: indicate unknown error at rsnd_dai_call()
Kuninori Morimoto [Thu, 27 May 2021 02:41:21 +0000 (11:41 +0900)]
ASoC: rsnd: indicate unknown error at rsnd_dai_call()

Current rsnd_dai_call() doesn't indicate error message,
thus it is very difficult to know the issue
when strange things happen.
This patch indicates error for it.

Signed-off-by: Kuninori Morimoto <kuninori.morimoto.gx@renesas.com>
Message-Id: <871r9snbji.wl-kuninori.morimoto.gx@renesas.com>
Signed-off-by: Mark Brown <broonie@kernel.org>
3 years agoASoC: rsnd: check BUIF error everytime
Kuninori Morimoto [Thu, 27 May 2021 02:41:12 +0000 (11:41 +0900)]
ASoC: rsnd: check BUIF error everytime

Current ssi.c checks BUSIF when TDM mode, but it should be checked
everytime.
This patch do it.

Signed-off-by: Kuninori Morimoto <kuninori.morimoto.gx@renesas.com>
Message-Id: <8735u8nbjr.wl-kuninori.morimoto.gx@renesas.com>
Signed-off-by: Mark Brown <broonie@kernel.org>
3 years agoASoC: rsnd: attach SSIU when SSI was DMA mode
Kuninori Morimoto [Thu, 27 May 2021 02:40:47 +0000 (11:40 +0900)]
ASoC: rsnd: attach SSIU when SSI was DMA mode

SSIU is not needed if SSI was PIO mode.
This patch ignores such case.

Signed-off-by: Kuninori Morimoto <kuninori.morimoto.gx@renesas.com>
Message-Id: <874keonbkg.wl-kuninori.morimoto.gx@renesas.com>
Signed-off-by: Mark Brown <broonie@kernel.org>
3 years agoASoC: rsnd: ignore runtime NULL case at rsnd_runtime_channel_original_with_params()
Kuninori Morimoto [Thu, 27 May 2021 02:40:34 +0000 (11:40 +0900)]
ASoC: rsnd: ignore runtime NULL case at rsnd_runtime_channel_original_with_params()

runtime might be NULL. Let's ignore such case.

Signed-off-by: Kuninori Morimoto <kuninori.morimoto.gx@renesas.com>
Message-Id: <875yz4nbkt.wl-kuninori.morimoto.gx@renesas.com>
Signed-off-by: Mark Brown <broonie@kernel.org>
3 years agoASoC: rsnd: call unregister for null_hw when removed
Kuninori Morimoto [Thu, 27 May 2021 02:40:22 +0000 (11:40 +0900)]
ASoC: rsnd: call unregister for null_hw when removed

commit d6956a7dde6fb ("ASoC: rsnd: add null CLOCKIN support")
added null_clk, but it is using local static valuable.
It will be leaked if rsnd driver was removed.
This patch moves it to priv, and call unregister when removing.

Fixes: d6956a7dde6fb ("ASoC: rsnd: add null CLOCKIN support")
Link: https://lore.kernel.org/r/87tumsoe2p.wl-kuninori.morimoto.gx@renesas.com
Reported-by: Geert Uytterhoeven <geert@linux-m68k.org>
Signed-off-by: Kuninori Morimoto <kuninori.morimoto.gx@renesas.com>
Message-Id: <877djknbl5.wl-kuninori.morimoto.gx@renesas.com>
Signed-off-by: Mark Brown <broonie@kernel.org>
3 years agoASoC: cs42l52: use DEVICE_ATTR_WO macro
YueHaibing [Mon, 24 May 2021 11:42:39 +0000 (19:42 +0800)]
ASoC: cs42l52: use DEVICE_ATTR_WO macro

Use DEVICE_ATTR_WO() helper instead of plain DEVICE_ATTR(),
which makes the code a bit shorter and easier to read.

Signed-off-by: YueHaibing <yuehaibing@huawei.com>
Reviewed-by: Charles Keepax <ckeepax@opensource.cirrus.com>
Message-Id: <20210524114239.7960-1-yuehaibing@huawei.com>
Signed-off-by: Mark Brown <broonie@kernel.org>
3 years agoASoC: cs35l3x: Use neutral language in amp drivers
David Rhodes [Tue, 25 May 2021 19:44:39 +0000 (14:44 -0500)]
ASoC: cs35l3x: Use neutral language in amp drivers

Revise variable names and comments in
cs35l35 and cs35l36 amp drivers.

Signed-off-by: David Rhodes <drhodes@opensource.cirrus.com>
Reviewed-by: Pierre-Louis Bossart <pierre-louis.bossart@linux.intel.com>
Message-Id: <20210525194439.2232908-1-drhodes@opensource.cirrus.com>
Signed-off-by: Mark Brown <broonie@kernel.org>
3 years agoASoC: cs43130: Use DEVICE_ATTR_RO macro
YueHaibing [Mon, 24 May 2021 11:40:17 +0000 (19:40 +0800)]
ASoC: cs43130: Use DEVICE_ATTR_RO macro

Use DEVICE_ATTR_RO() helper instead of plain DEVICE_ATTR(),
which makes the code a bit shorter and easier to read.

Signed-off-by: YueHaibing <yuehaibing@huawei.com>
Reviewed-by: Charles Keepax <ckeepax@opensource.cirrus.com>
Message-Id: <20210524114017.18672-1-yuehaibing@huawei.com>
Signed-off-by: Mark Brown <broonie@kernel.org>
3 years agoASoC: wm8962: Use DEVICE_ATTR_WO macro
YueHaibing [Mon, 24 May 2021 11:47:53 +0000 (19:47 +0800)]
ASoC: wm8962: Use DEVICE_ATTR_WO macro

Use DEVICE_ATTR_WO() helper instead of plain DEVICE_ATTR(),
which makes the code a bit shorter and easier to read.

Signed-off-by: YueHaibing <yuehaibing@huawei.com>
Acked-by: Charles Keepax <ckeepax@opensource.cirrus.com>
Message-Id: <20210524114753.39544-1-yuehaibing@huawei.com>
Signed-off-by: Mark Brown <broonie@kernel.org>
3 years agoASoC: cs42l56: use DEVICE_ATTR_WO macro
YueHaibing [Mon, 24 May 2021 11:45:03 +0000 (19:45 +0800)]
ASoC: cs42l56: use DEVICE_ATTR_WO macro

Use DEVICE_ATTR_WO() helper instead of plain DEVICE_ATTR(),
which makes the code a bit shorter and easier to read.

Signed-off-by: YueHaibing <yuehaibing@huawei.com>
Reviewed-by: Charles Keepax <ckeepax@opensource.cirrus.com>
Message-Id: <20210524114503.26460-1-yuehaibing@huawei.com>
Signed-off-by: Mark Brown <broonie@kernel.org>
3 years agoASoC: imx-card: Make some symbols static
Wei Yongjun [Mon, 24 May 2021 13:35:53 +0000 (13:35 +0000)]
ASoC: imx-card: Make some symbols static

The sparse tool complains as follows:

sound/soc/fsl/imx-card.c:121:27: warning:
 symbol 'ak4458_fs_mul' was not declared. Should it be static?
sound/soc/fsl/imx-card.c:138:31: warning:
 symbol 'ak4458_tdm_fs_mul' was not declared. Should it be static?
sound/soc/fsl/imx-card.c:149:27: warning:
 symbol 'ak4497_fs_mul' was not declared. Should it be static?
sound/soc/fsl/imx-card.c:166:27: warning:
 symbol 'ak5558_fs_mul' was not declared. Should it be static?
sound/soc/fsl/imx-card.c:180:31: warning:
 symbol 'ak5558_tdm_fs_mul' was not declared. Should it be static?

Those symbols are not used outside of imx-card.c, so marks
them static.

Fixes: aa736700f42f ("ASoC: imx-card: Add imx-card machine driver")
Reported-by: Hulk Robot <hulkci@huawei.com>
Signed-off-by: Wei Yongjun <weiyongjun1@huawei.com>
Message-Id: <20210524133553.2366502-1-weiyongjun1@huawei.com>
Signed-off-by: Mark Brown <broonie@sirena.org.uk>
3 years agoASoC: tlv320aic26: use DEVICE_ATTR_RW macro
YueHaibing [Mon, 24 May 2021 11:51:31 +0000 (19:51 +0800)]
ASoC: tlv320aic26: use DEVICE_ATTR_RW macro

Use DEVICE_ATTR_RW() helper instead of plain DEVICE_ATTR(),
which makes the code a bit shorter and easier to read.

Signed-off-by: YueHaibing <yuehaibing@huawei.com>
Message-Id: <20210524115131.46288-1-yuehaibing@huawei.com>
Signed-off-by: Mark Brown <broonie@sirena.org.uk>
3 years agoASoC: cs42l42: Check jack status before reporting button events
Lucas Tanure [Tue, 25 May 2021 09:08:22 +0000 (10:08 +0100)]
ASoC: cs42l42: Check jack status before reporting button events

Jack must be connected before reporting button events and
if the jack is disconnected button release must be reported

Signed-off-by: Lucas Tanure <tanureal@opensource.cirrus.com>
Reviewed-by: Richard Fitzgerald <rf@opensource.cirrus.com>
Message-Id: <20210525090822.64577-4-tanureal@opensource.cirrus.com>
Signed-off-by: Mark Brown <broonie@sirena.org.uk>
3 years agoASoC: cs42l42: Add support for 2400000 Bit clock
Lucas Tanure [Tue, 25 May 2021 09:08:21 +0000 (10:08 +0100)]
ASoC: cs42l42: Add support for 2400000 Bit clock

Add support for 2.4MHz clock source

Signed-off-by: Lucas Tanure <tanureal@opensource.cirrus.com>
Reviewed-by: Richard Fitzgerald <rf@opensource.cirrus.com>
Message-Id: <20210525090822.64577-3-tanureal@opensource.cirrus.com>
Signed-off-by: Mark Brown <broonie@sirena.org.uk>
3 years agoASoC: cs42l42: Add support for 2304000 Bit clock
Lucas Tanure [Tue, 25 May 2021 09:08:20 +0000 (10:08 +0100)]
ASoC: cs42l42: Add support for 2304000 Bit clock

Add support for 24bits, 2 channels, 48k Sample rate bit clock

Signed-off-by: Lucas Tanure <tanureal@opensource.cirrus.com>
Reviewed-by: Richard Fitzgerald <rf@opensource.cirrus.com>
Message-Id: <20210525090822.64577-2-tanureal@opensource.cirrus.com>
Signed-off-by: Mark Brown <broonie@sirena.org.uk>
3 years agoASoC: cs42l42: Fix 1536000 Bit Clock instability
Lucas Tanure [Tue, 25 May 2021 09:08:19 +0000 (10:08 +0100)]
ASoC: cs42l42: Fix 1536000 Bit Clock instability

The 16 Bits, 2 channels, 48K sample rate use case needs
to configure a safer pll_divout during the start of PLL
After 800us from the start of PLL the correct pll_divout
can be set

Signed-off-by: Lucas Tanure <tanureal@opensource.cirrus.com>
Reviewed-by: Richard Fitzgerald <rf@opensource.cirrus.com>
Message-Id: <20210525090822.64577-1-tanureal@opensource.cirrus.com>
Signed-off-by: Mark Brown <broonie@sirena.org.uk>
3 years agoMerge branch 'for-5.13' of https://git.kernel.org/pub/scm/linux/kernel/git/broonie...
Mark Brown [Tue, 25 May 2021 15:44:26 +0000 (16:44 +0100)]
Merge branch 'for-5.13' of https://git./linux/kernel/git/broonie/sound into asoc-5.14

3 years agoMerge series "ASoC: rsnd: add D3 support" from Kuninori Morimoto <kuninori.morimoto...
Mark Brown [Mon, 24 May 2021 11:54:49 +0000 (12:54 +0100)]
Merge series "ASoC: rsnd: add D3 support" from Kuninori Morimoto <kuninori.morimoto.gx@renesas.com>:

Hi Mark, Rob

These adds R-Car D3 support for rsnd driver.
[1/3] is tidyup patch for dt-bindings (not only for D3).
[2/3], [3/3] are for R-Car D3.

Kuninori Morimoto (3):
  ASoC: dt-bindings: renesas: rsnd: tidyup properties
  ASoC: rsnd: tidyup loop on rsnd_adg_clk_query()
  ASoC: rsnd: add null CLOCKIN support

 .../bindings/sound/renesas,rsnd.yaml          | 10 ++++-
 sound/soc/sh/rcar/adg.c                       | 37 ++++++++++++++++---
 2 files changed, 41 insertions(+), 6 deletions(-)

--
2.25.1

3 years agoASoC: codecs: Add driver for NXP/Goodix TFA989x (TFA1) amplifiers
Stephan Gerhold [Thu, 13 May 2021 10:41:29 +0000 (12:41 +0200)]
ASoC: codecs: Add driver for NXP/Goodix TFA989x (TFA1) amplifiers

NXP's TFA98xx (now part of Goodix) are fairly popular speaker amplifiers
used in many smartphones and tablets. Most of them are sold as "smart
amplifiers" with built-in "CoolFlux DSP" that is used for volume control,
plus a "sophisticated speaker-boost and protection algorithm".

Unfortunately, they are also almost entirely undocumented. The short
datasheets (e.g. [1] for TFA9897) describe the available features,
but do not provide any information about the registers or how to use
the "CoolFlux DSP".

The amplifiers are most often configured through proprietary userspace
libraries. There are also some (rather complex) kernel drivers (e.g. [2])
but even those rely on obscure firmware blobs for configuration (so-called
"containers"). They seem to contain different "profiles" with tuned speaker
settings, sample rates and volume steps (which would be better exposed
as separate ALSA mixers).

The format of the firmware files seems to have changed a lot over the time,
so it's not even possible to simply re-use the firmware originally provided
by the vendor.

Overall, it seems close to impossible to develop a proper mainline driver
for these amplifiers that could make proper use of the built-in DSP.

This commit implements a compromise: At least the TFA1 family of the
TFA98xx amplifiers (usually called TFA989x) provide a way to *bypass*
the DSP using a special register sequence. The register sequence can be
found in similar variations in the kernel drivers from lots of vendors
e.g. in [3] and was probably mainly used for factory testing.

With the DSP bypassed, the amplifier acts mostly like a dumb standard
speaker amplifier, without (hardware) volume control. However, the setup
is much simpler and it works without any obscure firmware.

This driver implements the DSP bypass combined with chip-specific
initialization sequences adapted from [2]. Only TFA9895 is supported in
this initial commit. Except for the lack of volume control I can not hear
any difference with or without the DSP, it works just fine.

This driver allows the speaker to work on mainline Linux running on the
Samsung Galaxy A3/A5 (2015) [TFA9895] and Alcatel Idol 3 [TFA9897].
TFA9897 support will be added in separate patch set later.

[1]: https://product.goodix.com/en/docview/TFA9897%20SDS_Rev.3.1?objectId=47&objectType=document&version=78
[2]: https://source.codeaurora.org/external/mas/tfa98xx
[3]: https://github.com/sonyxperiadev/kernel/blob/57b5050e340f40a88e1ddb8d16fd9adb44418923/sound/soc/codecs/tfa98xx.c#L1422-L1462

Signed-off-by: Stephan Gerhold <stephan@gerhold.net>
Link: https://lore.kernel.org/r/20210513104129.36583-2-stephan@gerhold.net
Signed-off-by: Mark Brown <broonie@kernel.org>
3 years agoASoC: dt-bindings: codecs: Add bindings for nxp, tfa989x
Stephan Gerhold [Thu, 13 May 2021 10:41:28 +0000 (12:41 +0200)]
ASoC: dt-bindings: codecs: Add bindings for nxp, tfa989x

NXP/Goodix TFA989X (TFA1) amplifiers are controlled via an I2C bus.
Add simple device tree bindings that describe how to set them up
in the device tree.

Right now only nxp,tfa9895 is supported but this will be extended
to at least nxp,tfa9897 in the near future.

Signed-off-by: Stephan Gerhold <stephan@gerhold.net>
Reviewed-by: Rob Herring <robh@kernel.org>
Link: https://lore.kernel.org/r/20210513104129.36583-1-stephan@gerhold.net
Signed-off-by: Mark Brown <broonie@kernel.org>
3 years agoASoC: rsnd: add null CLOCKIN support
Kuninori Morimoto [Mon, 24 May 2021 06:12:14 +0000 (15:12 +0900)]
ASoC: rsnd: add null CLOCKIN support

Some Renesas SoC doesn't have full CLOCKIN.
This patch add null_clk, and accepts it.

Signed-off-by: Kuninori Morimoto <kuninori.morimoto.gx@renesas.com>
Link: https://lore.kernel.org/r/87tumsoe2p.wl-kuninori.morimoto.gx@renesas.com
Signed-off-by: Mark Brown <broonie@kernel.org>
3 years agoASoC: rsnd: tidyup loop on rsnd_adg_clk_query()
Kuninori Morimoto [Mon, 24 May 2021 06:12:09 +0000 (15:12 +0900)]
ASoC: rsnd: tidyup loop on rsnd_adg_clk_query()

commit 06e8f5c842f2d ("ASoC: rsnd: don't call clk_get_rate() under
atomic context") used saved clk_rate, thus for_each_rsnd_clk()
is no longer needed. This patch fixes it.

Fixes: 06e8f5c842f2d ("ASoC: rsnd: don't call clk_get_rate() under atomic context")
Signed-off-by: Kuninori Morimoto <kuninori.morimoto.gx@renesas.com>
Link: https://lore.kernel.org/r/87v978oe2u.wl-kuninori.morimoto.gx@renesas.com
Signed-off-by: Mark Brown <broonie@kernel.org>
3 years agoASoC: dt-bindings: renesas: rsnd: tidyup properties
Kuninori Morimoto [Mon, 24 May 2021 06:12:04 +0000 (15:12 +0900)]
ASoC: dt-bindings: renesas: rsnd: tidyup properties

1) resets/reset-names needs minItems
2) It can use ports, not only port
3) It is not using audio-graph properties

Without this patch, we will get warnings

Signed-off-by: Kuninori Morimoto <kuninori.morimoto.gx@renesas.com>
Link: https://lore.kernel.org/r/87wnrooe2z.wl-kuninori.morimoto.gx@renesas.com
Signed-off-by: Mark Brown <broonie@kernel.org>
3 years agoASoC: core: Fix Null-point-dereference in fmt_single_name()
Kefeng Wang [Mon, 24 May 2021 02:49:41 +0000 (10:49 +0800)]
ASoC: core: Fix Null-point-dereference in fmt_single_name()

Check the return value of devm_kstrdup() in case of
Null-point-dereference.

Fixes: 45dd9943fce0 ("ASoC: core: remove artificial component and DAI name constraint")
Cc: Dmitry Baryshkov <dmitry.baryshkov@linaro.org>
Reported-by: Hulk Robot <hulkci@huawei.com>
Signed-off-by: Kefeng Wang <wangkefeng.wang@huawei.com>
Link: https://lore.kernel.org/r/20210524024941.159952-1-wangkefeng.wang@huawei.com
Signed-off-by: Mark Brown <broonie@kernel.org>
3 years agoASoC: Intel: sof_sdw: add quirk support for Brya and BT-offload
Vamshi Krishna Gopal [Fri, 21 May 2021 15:56:32 +0000 (18:56 +0300)]
ASoC: Intel: sof_sdw: add quirk support for Brya and BT-offload

Brya is another ADL-P product.

AlderLake has support for Bluetooth audio offload capability.
Enable the BT-offload quirk for ADL-P Brya and the Intel RVP.

Signed-off-by: Vamshi Krishna Gopal <vamshi.krishna.gopal@intel.com>
Signed-off-by: Yong Zhi <yong.zhi@intel.com>
Reviewed-by: Bard Liao <bard.liao@intel.com>
Reviewed-by: Ranjani Sridharan <ranjani.sridharan@linux.intel.com>
Signed-off-by: Kai Vehmanen <kai.vehmanen@linux.intel.com>
Link: https://lore.kernel.org/r/20210521155632.3736393-2-kai.vehmanen@linux.intel.com
Signed-off-by: Mark Brown <broonie@kernel.org>
3 years agoASoC: Intel: common: Add entries for sdw codecs in ADL match table
Vamshi Krishna Gopal [Fri, 21 May 2021 15:56:31 +0000 (18:56 +0300)]
ASoC: Intel: common: Add entries for sdw codecs in ADL match table

RT5682 and Max98373 are added with SDW0,SDW2 links respectively.

Signed-off-by: Vamshi Krishna Gopal <vamshi.krishna.gopal@intel.com>
Reviewed-by: Bard Liao <bard.liao@intel.com>
Reviewed-by: Ranjani Sridharan <ranjani.sridharan@linux.intel.com>
Signed-off-by: Kai Vehmanen <kai.vehmanen@linux.intel.com>
Link: https://lore.kernel.org/r/20210521155632.3736393-1-kai.vehmanen@linux.intel.com
Signed-off-by: Mark Brown <broonie@kernel.org>
3 years agoASoC: SOF: Intel: hda: Remove conditions against CONFIG_PCI
Peter Ujfalusi [Fri, 21 May 2021 09:28:04 +0000 (12:28 +0300)]
ASoC: SOF: Intel: hda: Remove conditions against CONFIG_PCI

The HDA support can only be compiled when SND_SOC_SOF_PCI is enabled which
depends on CONFIG_PCI.

This makes the IS_ENABLED(CONFIG_PCI) checks redundant in the code, they
will resolve to true all the time.

Signed-off-by: Peter Ujfalusi <peter.ujfalusi@linux.intel.com>
Reviewed-by: Ranjani Sridharan <ranjani.sridharan@linux.intel.com>
Reviewed-by: Pierre-Louis Bossart <pierre-louis.bossart@linux.intel.com>
Signed-off-by: Kai Vehmanen <kai.vehmanen@linux.intel.com>
Link: https://lore.kernel.org/r/20210521092804.3721324-8-kai.vehmanen@linux.intel.com
Signed-off-by: Mark Brown <broonie@kernel.org>
3 years agoASoC: SOF: ops: don't return void value
Pierre-Louis Bossart [Fri, 21 May 2021 09:28:03 +0000 (12:28 +0300)]
ASoC: SOF: ops: don't return void value

Sparse throws the following warning:

sound/soc/sof/ops.h:247:17: error: returning void-valued expression

Remove the useless returns.

Signed-off-by: Pierre-Louis Bossart <pierre-louis.bossart@linux.intel.com>
Reviewed-by: Paul Olaru <paul.olaru@oss.nxp.com>
Reviewed-by: Guennadi Liakhovetski <guennadi.liakhovetski@linux.intel.com>
Reviewed-by: Rander Wang <rander.wang@intel.com>
Signed-off-by: Kai Vehmanen <kai.vehmanen@linux.intel.com>
Link: https://lore.kernel.org/r/20210521092804.3721324-7-kai.vehmanen@linux.intel.com
Signed-off-by: Mark Brown <broonie@kernel.org>
3 years agoASoC: SOF: topology: fix assignment to use le32_to_cpu
Jaska Uimonen [Fri, 21 May 2021 09:28:02 +0000 (12:28 +0300)]
ASoC: SOF: topology: fix assignment to use le32_to_cpu

Fix sparse warning by using le32_to_cpu.

Signed-off-by: Jaska Uimonen <jaska.uimonen@linux.intel.com>
Reviewed-by: Pierre-Louis Bossart <pierre-louis.bossart@linux.intel.com>
Reviewed-by: Ranjani Sridharan <ranjani.sridharan@linux.intel.com>
Signed-off-by: Kai Vehmanen <kai.vehmanen@linux.intel.com>
Link: https://lore.kernel.org/r/20210521092804.3721324-6-kai.vehmanen@linux.intel.com
Signed-off-by: Mark Brown <broonie@kernel.org>