platform/kernel/linux-starfive.git
3 years agosoundwire: intel: introduce shim and alh base
Bard Liao [Fri, 23 Jul 2021 11:54:51 +0000 (19:54 +0800)]
soundwire: intel: introduce shim and alh base

shim base and alh base are platform-dependent. Adding these two
parameters allows us to use different shim/alh base for each
platform.

Signed-off-by: Bard Liao <yung-chuan.liao@linux.intel.com>
Reviewed-by: Pierre-Louis Bossart <pierre-louis.bossart@linux.intel.com>
Reviewed-by: Ranjani Sridharan <ranjani.sridharan@linux.intel.com>
Acked-By: Vinod Koul <vkoul@kernel.org>
Link: https://lore.kernel.org/r/20210723115451.7245-7-yung-chuan.liao@linux.intel.com
Signed-off-by: Mark Brown <broonie@kernel.org>
3 years agoASoC: SOF: intel: add snd_sof_dsp_check_sdw_irq ops
Bard Liao [Fri, 23 Jul 2021 11:54:50 +0000 (19:54 +0800)]
ASoC: SOF: intel: add snd_sof_dsp_check_sdw_irq ops

SoundWire IRQ status checks are platform-dependent, add new ops structure
to provide abstraction.

Signed-off-by: Bard Liao <yung-chuan.liao@linux.intel.com>
Reviewed-by: Pierre-Louis Bossart <pierre-louis.bossart@linux.intel.com>
Reviewed-by: Ranjani Sridharan <ranjani.sridharan@linux.intel.com>
Link: https://lore.kernel.org/r/20210723115451.7245-6-yung-chuan.liao@linux.intel.com
Signed-off-by: Mark Brown <broonie@kernel.org>
3 years agoASoC: SOF: intel: move sof_intel_dsp_desc() forward
Bard Liao [Fri, 23 Jul 2021 11:54:49 +0000 (19:54 +0800)]
ASoC: SOF: intel: move sof_intel_dsp_desc() forward

sof_intel_dsp_desc() will be used by hda_dsp_check_sdw_irq() in the
following commit.

Signed-off-by: Bard Liao <yung-chuan.liao@linux.intel.com>
Reviewed-by: Pierre-Louis Bossart <pierre-louis.bossart@linux.intel.com>
Reviewed-by: Ranjani Sridharan <ranjani.sridharan@linux.intel.com>
Link: https://lore.kernel.org/r/20210723115451.7245-5-yung-chuan.liao@linux.intel.com
Signed-off-by: Mark Brown <broonie@kernel.org>
3 years agoASoC: SOF: intel: hda: remove HDA_DSP_REG_SNDW_WAKE_STS definition
Bard Liao [Fri, 23 Jul 2021 11:54:48 +0000 (19:54 +0800)]
ASoC: SOF: intel: hda: remove HDA_DSP_REG_SNDW_WAKE_STS definition

HDA_DSP_REG_SNDW_WAKE_STS is actually (SDW_SHIM_BASE + SDW_SHIM_WAKESTS)
and SDW_SHIM_BASE is platform-dependent. Removing HDA_DSP_REG_SNDW_WAKE_STS
and use (hdev->desc->sdw_shim_base + SDW_SHIM_WAKESTS) instead.

Signed-off-by: Bard Liao <yung-chuan.liao@linux.intel.com>
Reviewed-by: Pierre-Louis Bossart <pierre-louis.bossart@linux.intel.com>
Reviewed-by: Ranjani Sridharan <ranjani.sridharan@linux.intel.com>
Link: https://lore.kernel.org/r/20210723115451.7245-4-yung-chuan.liao@linux.intel.com
Signed-off-by: Mark Brown <broonie@kernel.org>
3 years agoASoC: SOF: intel: add sdw_shim/alh_base to sof_intel_dsp_desc
Bard Liao [Fri, 23 Jul 2021 11:54:47 +0000 (19:54 +0800)]
ASoC: SOF: intel: add sdw_shim/alh_base to sof_intel_dsp_desc

sdw_shim_base and sdw_alh_base are platform-dependent. This change allow
us to define different sdw shim/alh base for each platform.

Signed-off-by: Bard Liao <yung-chuan.liao@linux.intel.com>
Reviewed-by: Pierre-Louis Bossart <pierre-louis.bossart@linux.intel.com>
Reviewed-by: Ranjani Sridharan <ranjani.sridharan@linux.intel.com>
Link: https://lore.kernel.org/r/20210723115451.7245-3-yung-chuan.liao@linux.intel.com
Signed-off-by: Mark Brown <broonie@kernel.org>
3 years agosoundwire: move intel sdw register definitions to sdw_intel.h
Bard Liao [Fri, 23 Jul 2021 11:54:46 +0000 (19:54 +0800)]
soundwire: move intel sdw register definitions to sdw_intel.h

Those Intel sdw registers will be used by ASoC SOF drivers in the
following commits. So move those definitions to sdw_intel.h and it can
be visible to SOF drivers.

Signed-off-by: Bard Liao <yung-chuan.liao@linux.intel.com>
Reviewed-by: Pierre-Louis Bossart <pierre-louis.bossart@linux.intel.com>
Reviewed-by: Ranjani Sridharan <ranjani.sridharan@linux.intel.com>
Acked-By: Vinod Koul <vkoul@kernel.org>
Link: https://lore.kernel.org/r/20210723115451.7245-2-yung-chuan.liao@linux.intel.com
Signed-off-by: Mark Brown <broonie@kernel.org>
3 years agoMerge series "ASoC: soc-topology: cleanup cppcheck warning" from Kuninori Morimoto...
Mark Brown [Mon, 2 Aug 2021 14:42:31 +0000 (15:42 +0100)]
Merge series "ASoC: soc-topology: cleanup cppcheck warning" from Kuninori Morimoto <kuninori.morimoto.gx@renesas.com>:

Hi Mark

Now I'm posting audio-graph-card2 patch-set, but it seems it needs longer
discussion. Thus I want to post more easy patch first, and reduce my
local patches.

These are cppcheck warning cleanup patches for soc-topology.

Kuninori Morimoto (5):
  ASoC: soc-topology: cleanup cppcheck warning at soc_tplg_process_headers()
  ASoC: soc-topology: cleanup cppcheck warning at soc_tplg_dai_elems_load()
  ASoC: soc-topology: cleanup cppcheck warning at soc_tplg_dapm_widget_elems_load()
  ASoC: soc-topology: cleanup cppcheck warning at soc_tplg_kcontrol_elems_load()
  ASoC: soc-topology: cleanup cppcheck warning at snd_soc_find_dai_link()

 sound/soc/soc-topology.c | 23 +++++++++++------------
 1 file changed, 11 insertions(+), 12 deletions(-)

--
2.25.1

3 years agoASoC: soc-topology: cleanup cppcheck warning at snd_soc_find_dai_link()
Kuninori Morimoto [Mon, 2 Aug 2021 06:01:12 +0000 (15:01 +0900)]
ASoC: soc-topology: cleanup cppcheck warning at snd_soc_find_dai_link()

This patch cleanups below cppcheck warning.

sound/soc/soc-topology.c:2129:27: style: The scope of the variable 'link' can be reduced. [variableScope]
 struct snd_soc_dai_link *link;
                          ^

Signed-off-by: Kuninori Morimoto <kuninori.morimoto.gx@renesas.com>
Link: https://lore.kernel.org/r/87mtq0wfkn.wl-kuninori.morimoto.gx@renesas.com
Signed-off-by: Mark Brown <broonie@kernel.org>
3 years agoASoC: soc-topology: cleanup cppcheck warning at soc_tplg_kcontrol_elems_load()
Kuninori Morimoto [Mon, 2 Aug 2021 06:01:04 +0000 (15:01 +0900)]
ASoC: soc-topology: cleanup cppcheck warning at soc_tplg_kcontrol_elems_load()

This patch cleanups below cppcheck warning.

sound/soc/soc-topology.c:1038:31: style: The scope of the variable 'control_hdr' can be reduced. [variableScope]
 struct snd_soc_tplg_ctl_hdr *control_hdr;
                              ^

Signed-off-by: Kuninori Morimoto <kuninori.morimoto.gx@renesas.com>
Link: https://lore.kernel.org/r/87o8agwfkv.wl-kuninori.morimoto.gx@renesas.com
Signed-off-by: Mark Brown <broonie@kernel.org>
3 years agoASoC: soc-topology: cleanup cppcheck warning at soc_tplg_dapm_widget_elems_load()
Kuninori Morimoto [Mon, 2 Aug 2021 06:00:52 +0000 (15:00 +0900)]
ASoC: soc-topology: cleanup cppcheck warning at soc_tplg_dapm_widget_elems_load()

This patch cleanups below cppcheck warning.

sound/soc/soc-topology.c:1599:35: style: The scope of the variable 'widget' can be reduced. [variableScope]
 struct snd_soc_tplg_dapm_widget *widget;
                                  ^
sound/soc/soc-topology.c:1600:6: style: The scope of the variable 'ret' can be reduced. [variableScope]
 int ret, count, i;
     ^

Signed-off-by: Kuninori Morimoto <kuninori.morimoto.gx@renesas.com>
Link: https://lore.kernel.org/r/87pmuwwfl7.wl-kuninori.morimoto.gx@renesas.com
Signed-off-by: Mark Brown <broonie@kernel.org>
3 years agoASoC: soc-topology: cleanup cppcheck warning at soc_tplg_dai_elems_load()
Kuninori Morimoto [Mon, 2 Aug 2021 06:00:42 +0000 (15:00 +0900)]
ASoC: soc-topology: cleanup cppcheck warning at soc_tplg_dai_elems_load()

This patch cleanups below cppcheck warning.

sound/soc/soc-topology.c:2350:27: style: The scope of the variable 'dai' can be reduced. [variableScope]
 struct snd_soc_tplg_dai *dai;
                          ^
sound/soc/soc-topology.c:2352:9: style: The scope of the variable 'ret' can be reduced. [variableScope]
 int i, ret;
        ^

Signed-off-by: Kuninori Morimoto <kuninori.morimoto.gx@renesas.com>
Link: https://lore.kernel.org/r/87r1fcwflh.wl-kuninori.morimoto.gx@renesas.com
Signed-off-by: Mark Brown <broonie@kernel.org>
3 years agoASoC: soc-topology: cleanup cppcheck warning at soc_tplg_process_headers()
Kuninori Morimoto [Mon, 2 Aug 2021 06:00:27 +0000 (15:00 +0900)]
ASoC: soc-topology: cleanup cppcheck warning at soc_tplg_process_headers()

This patch cleanups below cppcheck warning.

sound/soc/soc-topology.c:2576:27: style: The scope of the variable 'hdr' can be reduced. [variableScope]
 struct snd_soc_tplg_hdr *hdr;
                          ^

Signed-off-by: Kuninori Morimoto <kuninori.morimoto.gx@renesas.com>
Link: https://lore.kernel.org/r/87sfzswflw.wl-kuninori.morimoto.gx@renesas.com
Signed-off-by: Mark Brown <broonie@kernel.org>
3 years agoASoC: rsnd: make some arrays static const, makes object smaller
Colin Ian King [Sun, 1 Aug 2021 06:32:37 +0000 (07:32 +0100)]
ASoC: rsnd: make some arrays static const, makes object smaller

Don't populate arrays on the stack but instead them static const.
Makes the object code smaller by 242 bytes.

Before:
   text    data     bss     dec     hex filename
  23827    8764       0   32591    7f4f ./sound/soc/sh/rcar/ssi.o

After:
   text    data     bss     dec     hex filename
  23361    8988       0   32349    7e5d ./sound/soc/sh/rcar/ssi.o

gcc version 10.2.0)

Signed-off-by: Colin Ian King <colin.king@canonical.com>
Link: https://lore.kernel.org/r/20210801063237.137998-1-colin.king@canonical.com
Signed-off-by: Mark Brown <broonie@kernel.org>
3 years agoMerge series "Add RZ/G2L Sound support" from Biju Das <biju.das.jz@bp.renesas.com>:
Mark Brown [Fri, 30 Jul 2021 17:34:50 +0000 (18:34 +0100)]
Merge series "Add RZ/G2L Sound support" from Biju Das <biju.das.jz@bp.renesas.com>:

This patch series aims to add ASoC support on RZ/G2L SoC's.

It is based on the work done by Chris Brandt for RZ/A ASoC driver.

Biju Das (8):
  ASoC: dt-bindings: Document RZ/G2L bindings
  sound: soc: sh: Add RZ/G2L SSIF-2 driver
  arm64: dts: renesas: r9a07g044: Add external audio clock nodes
  arm64: dts: renesas: r9a07g044: Add SSI support
  arm64: defconfig: Enable ASoC sound support for RZ/G2L SoC
  ASoC: dt-bindings: sound: renesas,rz-ssi: Document DMA support
  sound: sh: rz-ssi: Add SSI DMAC support
  arm64: dts: renesas: r9a07g044: Add SSI DMA support

 .../bindings/sound/renesas,rz-ssi.yaml        |  100 ++
 arch/arm64/boot/dts/renesas/r9a07g044.dtsi    |  105 ++
 arch/arm64/configs/defconfig                  |    1 +
 sound/soc/sh/Kconfig                          |   10 +
 sound/soc/sh/Makefile                         |    4 +
 sound/soc/sh/rz-ssi.c                         | 1078 +++++++++++++++++
 6 files changed, 1298 insertions(+)
 create mode 100644 Documentation/devicetree/bindings/sound/renesas,rz-ssi.yaml
 create mode 100644 sound/soc/sh/rz-ssi.c

--
2.17.1

3 years agoASoC: intel: skylake: Drop superfluous mmap callback
Takashi Iwai [Wed, 28 Jul 2021 14:19:30 +0000 (16:19 +0200)]
ASoC: intel: skylake: Drop superfluous mmap callback

skl_platform_soc_mmap() just calls the standard mmap helper, hence
it's superfluous.  Let's drop it.

Signed-off-by: Takashi Iwai <tiwai@suse.de>
Reviewed-by: Cezary Rojewski <cezary.rojewski@intel.com>
Link: https://lore.kernel.org/r/20210728141930.17740-1-tiwai@suse.de
Signed-off-by: Mark Brown <broonie@kernel.org>
3 years agoASoC: amd: Drop superfluous mmap callbacks
Takashi Iwai [Wed, 28 Jul 2021 14:18:43 +0000 (16:18 +0200)]
ASoC: amd: Drop superfluous mmap callbacks

All ASoC AMD drivers just call the standard mmap handler, hence those
are superfluous.  Let's drop them.

Signed-off-by: Takashi Iwai <tiwai@suse.de>
Link: https://lore.kernel.org/r/20210728141843.17685-1-tiwai@suse.de
Signed-off-by: Mark Brown <broonie@kernel.org>
3 years agoASoC: dt-bindings: sound: renesas,rz-ssi: Document DMA support
Biju Das [Mon, 19 Jul 2021 13:40:38 +0000 (14:40 +0100)]
ASoC: dt-bindings: sound: renesas,rz-ssi: Document DMA support

Document DMA support in binding document.

Signed-off-by: Biju Das <biju.das.jz@bp.renesas.com>
Reviewed-by: Lad Prabhakar <prabhakar.mahadev-lad.rj@bp.renesas.com>
Reviewed-by: Rob Herring <robh@kernel.org>
Link: https://lore.kernel.org/r/20210719134040.7964-7-biju.das.jz@bp.renesas.com
Signed-off-by: Mark Brown <broonie@kernel.org>
3 years agoASoC: dt-bindings: Document RZ/G2L bindings
Biju Das [Mon, 19 Jul 2021 13:40:33 +0000 (14:40 +0100)]
ASoC: dt-bindings: Document RZ/G2L bindings

Document RZ/G2L ASoC serial sound interface bindings.

Signed-off-by: Biju Das <biju.das.jz@bp.renesas.com>
Reviewed-by: Lad Prabhakar <prabhakar.mahadev-lad.rj@bp.renesas.com>
Reviewed-by: Rob Herring <robh@kernel.org>
Link: https://lore.kernel.org/r/20210719134040.7964-2-biju.das.jz@bp.renesas.com
Signed-off-by: Mark Brown <broonie@kernel.org>
3 years agoMerge series "ASoC: soc-core: cleanup cppcheck warning" from Kuninori Morimoto <kunin...
Mark Brown [Thu, 29 Jul 2021 16:24:46 +0000 (17:24 +0100)]
Merge series "ASoC: soc-core: cleanup cppcheck warning" from Kuninori Morimoto <kuninori.morimoto.gx@renesas.com>:

Hi Mark

Now I'm posting audio-graph-card2 patch-set, but it seems it needs longer
discussion. Thus I want to post more easy patch first, and reduce my
local patches.

These are cppcheck warning cleanup patches for soc-core.

Kuninori Morimoto (7):
  ASoC: soc-core: cleanup cppcheck warning at snd_soc_set_dmi_name()
  ASoC: soc-core: cleanup cppcheck warning at snd_soc_get_dai_name()
  ASoC: soc-core: cleanup cppcheck warning at snd_soc_daifmt_parse_format()
  ASoC: soc-core: cleanup cppcheck warning at snd_soc_unregister_component()
  ASoC: soc-core: cleanup cppcheck warning at snd_soc_add_controls()
  ASoC: soc-core: cleanup cppcheck warning at snd_soc_of_parse_audio_simple_widgets()
  ASoC: soc-core: cleanup cppcheck warning at snd_soc_of_parse_audio_routing()

 sound/soc/soc-core.c | 36 ++++++++++++++++++------------------
 1 file changed, 18 insertions(+), 18 deletions(-)

--
2.25.1

3 years agoASoC: v253_init: eliminate pointer to string
Jiri Slaby [Thu, 22 Jul 2021 11:51:41 +0000 (13:51 +0200)]
ASoC: v253_init: eliminate pointer to string

There is no need to have an extra pointer to a string (v253_init).
Convert it to an array.

Signed-off-by: Jiri Slaby <jslaby@suse.cz>
Link: https://lore.kernel.org/r/20210722115141.516-2-jslaby@suse.cz
Signed-off-by: Mark Brown <broonie@kernel.org>
3 years agoASoC: cx20442: tty_ldisc_ops::write_wakeup is optional
Jiri Slaby [Thu, 22 Jul 2021 11:51:40 +0000 (13:51 +0200)]
ASoC: cx20442: tty_ldisc_ops::write_wakeup is optional

TTY layer does nothing if tty_ldisc_ops::write_wakeup is NULL, so there
is no need to implement an empty one in cx20442. Drop it.

Signed-off-by: Jiri Slaby <jslaby@suse.cz>
Link: https://lore.kernel.org/r/20210722115141.516-1-jslaby@suse.cz
Signed-off-by: Mark Brown <broonie@kernel.org>
3 years agoASoC: samsung: Constify static snd_soc_ops
Rikard Falkeborn [Wed, 28 Jul 2021 17:25:48 +0000 (19:25 +0200)]
ASoC: samsung: Constify static snd_soc_ops

These are only assigned to the ops field in the snd_soc_dai_link struct
which is a pointer to const struct snd_soc_ops. Make them const to allow
the compiler to put them in read-only memory.

Signed-off-by: Rikard Falkeborn <rikard.falkeborn@gmail.com>
Reviewed-by: Krzysztof Kozlowski <krzysztof.kozlowski@canonical.com>
Link: https://lore.kernel.org/r/20210728172548.234943-1-rikard.falkeborn@gmail.com
Signed-off-by: Mark Brown <broonie@kernel.org>
3 years agoASoC: soc-core: cleanup cppcheck warning at snd_soc_of_parse_audio_routing()
Kuninori Morimoto [Thu, 29 Jul 2021 01:16:01 +0000 (10:16 +0900)]
ASoC: soc-core: cleanup cppcheck warning at snd_soc_of_parse_audio_routing()

This patch cleanups below cppcheck warning.

sound/soc/soc-core.c:2931:9: style: The scope of the variable 'ret' can be reduced. [variableScope]
 int i, ret;
        ^

Signed-off-by: Kuninori Morimoto <kuninori.morimoto.gx@renesas.com>
Link: https://lore.kernel.org/r/87o8alyl67.wl-kuninori.morimoto.gx@renesas.com
Signed-off-by: Mark Brown <broonie@kernel.org>
3 years agoASoC: soc-core: cleanup cppcheck warning at snd_soc_of_parse_audio_simple_widgets()
Kuninori Morimoto [Thu, 29 Jul 2021 01:15:56 +0000 (10:15 +0900)]
ASoC: soc-core: cleanup cppcheck warning at snd_soc_of_parse_audio_simple_widgets()

This patch cleanups below cppcheck warning.

sound/soc/soc-core.c:2777:25: style: The scope of the variable 'ret' can be reduced. [variableScope]
 int i, j, num_widgets, ret;
                        ^

Signed-off-by: Kuninori Morimoto <kuninori.morimoto.gx@renesas.com>
Link: https://lore.kernel.org/r/87pmv1yl6b.wl-kuninori.morimoto.gx@renesas.com
Signed-off-by: Mark Brown <broonie@kernel.org>
3 years agoASoC: soc-core: cleanup cppcheck warning at snd_soc_add_controls()
Kuninori Morimoto [Thu, 29 Jul 2021 01:15:52 +0000 (10:15 +0900)]
ASoC: soc-core: cleanup cppcheck warning at snd_soc_add_controls()

This patch cleanups below cppcheck warning.

sound/soc/soc-core.c:2239:6: style: The scope of the variable 'err' can be reduced. [variableScope]
 int err, i;
     ^

Signed-off-by: Kuninori Morimoto <kuninori.morimoto.gx@renesas.com>
Link: https://lore.kernel.org/r/87r1fhyl6f.wl-kuninori.morimoto.gx@renesas.com
Signed-off-by: Mark Brown <broonie@kernel.org>
3 years agoASoC: soc-core: cleanup cppcheck warning at snd_soc_unregister_component()
Kuninori Morimoto [Thu, 29 Jul 2021 01:15:47 +0000 (10:15 +0900)]
ASoC: soc-core: cleanup cppcheck warning at snd_soc_unregister_component()

This patch cleanups below cppcheck warning.

sound/soc/soc-core.c:2719:28: style: The scope of the variable 'component' can be reduced. [variableScope]
 struct snd_soc_component *component;
                           ^

Signed-off-by: Kuninori Morimoto <kuninori.morimoto.gx@renesas.com>
Link: https://lore.kernel.org/r/87sfzxyl6k.wl-kuninori.morimoto.gx@renesas.com
Signed-off-by: Mark Brown <broonie@kernel.org>
3 years agoASoC: soc-core: cleanup cppcheck warning at snd_soc_daifmt_parse_format()
Kuninori Morimoto [Thu, 29 Jul 2021 01:15:42 +0000 (10:15 +0900)]
ASoC: soc-core: cleanup cppcheck warning at snd_soc_daifmt_parse_format()

This patch cleanups below cppcheck warning.

sound/soc/soc-core.c:3056:11: style: The scope of the variable 'i' can be reduced. [variableScope]
 int ret, i;
          ^

Signed-off-by: Kuninori Morimoto <kuninori.morimoto.gx@renesas.com>
Link: https://lore.kernel.org/r/87tukdyl6p.wl-kuninori.morimoto.gx@renesas.com
Signed-off-by: Mark Brown <broonie@kernel.org>
3 years agoASoC: soc-core: cleanup cppcheck warning at snd_soc_get_dai_name()
Kuninori Morimoto [Thu, 29 Jul 2021 01:15:38 +0000 (10:15 +0900)]
ASoC: soc-core: cleanup cppcheck warning at snd_soc_get_dai_name()

This patch cleanups below cppcheck warning.

sound/soc/soc-core.c:3203:22: style: The scope of the variable 'component_of_node' can be reduced. [variableScope]
 struct device_node *component_of_node;
                     ^

Signed-off-by: Kuninori Morimoto <kuninori.morimoto.gx@renesas.com>
Link: https://lore.kernel.org/r/87v94tyl6t.wl-kuninori.morimoto.gx@renesas.com
Signed-off-by: Mark Brown <broonie@kernel.org>
3 years agoASoC: soc-core: cleanup cppcheck warning at snd_soc_set_dmi_name()
Kuninori Morimoto [Thu, 29 Jul 2021 01:15:33 +0000 (10:15 +0900)]
ASoC: soc-core: cleanup cppcheck warning at snd_soc_set_dmi_name()

This patch cleanups below cppcheck warning.

 const char *vendor, *product, *product_version, *board;
                                ^

sound/soc/soc-core.c:1721:33: style: The scope of the variable 'product_version' can be reduced. [variableScope]
Signed-off-by: Kuninori Morimoto <kuninori.morimoto.gx@renesas.com>
Link: https://lore.kernel.org/r/87wnp9yl6y.wl-kuninori.morimoto.gx@renesas.com
Signed-off-by: Mark Brown <broonie@kernel.org>
3 years agoASoC: bcm: cygnus-pcm: Fix unused assignment about 'rc'
Tang Bin [Wed, 28 Jul 2021 12:44:11 +0000 (20:44 +0800)]
ASoC: bcm: cygnus-pcm: Fix unused assignment about 'rc'

Delete unused initialized value of 'rc', because it will
be assigned by the function devm_request_irq().

Signed-off-by: Zhang Shengju <zhangshengju@cmss.chinamobile.com>
Signed-off-by: Tang Bin <tangbin@cmss.chinamobile.com>
Link: https://lore.kernel.org/r/20210728124411.3168-1-tangbin@cmss.chinamobile.com
Signed-off-by: Mark Brown <broonie@kernel.org>
3 years agoASoC: Intel: Fix spelling contraction "cant" -> "can't"
Colin Ian King [Wed, 28 Jul 2021 10:36:02 +0000 (11:36 +0100)]
ASoC: Intel: Fix spelling contraction "cant" -> "can't"

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

Signed-off-by: Colin Ian King <colin.king@canonical.com>
Reviewed-by: Cezary Rojewski <cezary.rojewski@intel.com>
Link: https://lore.kernel.org/r/20210728103602.171817-1-colin.king@canonical.com
Signed-off-by: Mark Brown <broonie@kernel.org>
3 years agoMerge series "ASoC: soc-pcm: cleanup cppcheck warning" from Kuninori Morimoto <kunino...
Mark Brown [Tue, 27 Jul 2021 15:14:20 +0000 (16:14 +0100)]
Merge series "ASoC: soc-pcm: cleanup cppcheck warning" from Kuninori Morimoto <kuninori.morimoto.gx@renesas.com>:

Hi Mark

Now I'm posting audio-graph-card2 patch-set, but it seems it needs longer
discussion. Thus I want to post more easy patch first, and reduce my
local patches.

These are cppcheck warning cleanup patches for soc-pcm.

Kuninori Morimoto (5):
  ASoC: soc-pcm: cleanup cppcheck warning at soc_pcm_apply_msb()
  ASoC: soc-pcm: cleanup cppcheck warning at soc_pcm_components_close()
  ASoC: soc-pcm: cleanup cppcheck warning at soc_get_playback_capture()
  ASoC: soc-pcm: cleanup cppcheck warning at dpcm_be_is_active()
  ASoC: soc-pcm: cleanup cppcheck warning at dpcm_runtime_setup_be_chan()

 sound/soc/soc-pcm.c | 22 +++++++++++-----------
 1 file changed, 11 insertions(+), 11 deletions(-)

--
2.25.1

Thank you for your help !!

Best regards
---
Kuninori Morimoto

3 years agoASoC: amd: fix an IS_ERR() vs NULL bug in probe
Dan Carpenter [Tue, 27 Jul 2021 08:17:56 +0000 (11:17 +0300)]
ASoC: amd: fix an IS_ERR() vs NULL bug in probe

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

Fixes: e550339ee652 ("ASoC: amd: add vangogh i2s controller driver")
Signed-off-by: Dan Carpenter <dan.carpenter@oracle.com>
Link: https://lore.kernel.org/r/20210727081756.GA19121@kili
Signed-off-by: Mark Brown <broonie@kernel.org>
3 years agoASoC: rt5682: enable SAR ADC power saving mode during suspend
Shuming Fan [Tue, 27 Jul 2021 08:48:46 +0000 (16:48 +0800)]
ASoC: rt5682: enable SAR ADC power saving mode during suspend

The SAR ADC power saving mode could reduce power consumption on MICVDD rail.
Therefore, this patch saves power consumption during suspend state if the headset was connected.

Signed-off-by: Shuming Fan <shumingf@realtek.com>
Link: https://lore.kernel.org/r/20210727084846.9867-1-shumingf@realtek.com
Signed-off-by: Mark Brown <broonie@kernel.org>
3 years agoASoC: soc-pcm: cleanup cppcheck warning at dpcm_runtime_setup_be_chan()
Kuninori Morimoto [Tue, 27 Jul 2021 02:05:51 +0000 (11:05 +0900)]
ASoC: soc-pcm: cleanup cppcheck warning at dpcm_runtime_setup_be_chan()

This patch cleanups below cppcheck warning.

sound/soc/soc-pcm.c:1624:30: style: The scope of the variable 'codec_stream' can be reduced. [variableScope]
  struct snd_soc_pcm_stream *codec_stream;
                             ^

Signed-off-by: Kuninori Morimoto <kuninori.morimoto.gx@renesas.com>
Link: https://lore.kernel.org/r/87o8aozf28.wl-kuninori.morimoto.gx@renesas.com
Signed-off-by: Mark Brown <broonie@kernel.org>
3 years agoASoC: soc-pcm: cleanup cppcheck warning at dpcm_be_is_active()
Kuninori Morimoto [Tue, 27 Jul 2021 02:05:47 +0000 (11:05 +0900)]
ASoC: soc-pcm: cleanup cppcheck warning at dpcm_be_is_active()

This patch cleanups below cppcheck warning.

sound/soc/soc-pcm.c:1305:30: style: The scope of the variable 'widget' can be reduced. [variableScope]
 struct snd_soc_dapm_widget *widget;
                             ^

Signed-off-by: Kuninori Morimoto <kuninori.morimoto.gx@renesas.com>
Link: https://lore.kernel.org/r/87pmv4zf2c.wl-kuninori.morimoto.gx@renesas.com
Signed-off-by: Mark Brown <broonie@kernel.org>
3 years agoASoC: soc-pcm: cleanup cppcheck warning at soc_get_playback_capture()
Kuninori Morimoto [Tue, 27 Jul 2021 02:05:43 +0000 (11:05 +0900)]
ASoC: soc-pcm: cleanup cppcheck warning at soc_get_playback_capture()

This patch cleanups below cppcheck warning.

sound/soc/soc-pcm.c:2578:22: style: The scope of the variable 'codec_dai' can be reduced. [variableScope]
 struct snd_soc_dai *codec_dai;
                     ^
sound/soc/soc-pcm.c:2580:6: style: The scope of the variable 'stream' can be reduced. [variableScope]
 int stream;
     ^

Signed-off-by: Kuninori Morimoto <kuninori.morimoto.gx@renesas.com>
Link: https://lore.kernel.org/r/87r1fkzf2g.wl-kuninori.morimoto.gx@renesas.com
Signed-off-by: Mark Brown <broonie@kernel.org>
3 years agoASoC: soc-pcm: cleanup cppcheck warning at soc_pcm_components_close()
Kuninori Morimoto [Tue, 27 Jul 2021 02:05:38 +0000 (11:05 +0900)]
ASoC: soc-pcm: cleanup cppcheck warning at soc_pcm_components_close()

This patch cleanups below cppcheck warning.

sound/soc/soc-pcm.c:631:9: style: The scope of the variable 'r' can be reduced. [variableScope]
 int i, r, ret = 0;
        ^

Signed-off-by: Kuninori Morimoto <kuninori.morimoto.gx@renesas.com>
Link: https://lore.kernel.org/r/87sg00zf2l.wl-kuninori.morimoto.gx@renesas.com
Signed-off-by: Mark Brown <broonie@kernel.org>
3 years agoASoC: soc-pcm: cleanup cppcheck warning at soc_pcm_apply_msb()
Kuninori Morimoto [Tue, 27 Jul 2021 02:05:34 +0000 (11:05 +0900)]
ASoC: soc-pcm: cleanup cppcheck warning at soc_pcm_apply_msb()

This patch cleanups below cppcheck warning.

sound/soc/soc-pcm.c:446:29: style: The scope of the variable 'pcm_codec' can be reduced. [variableScope]
 struct snd_soc_pcm_stream *pcm_codec, *pcm_cpu;
                            ^
sound/soc/soc-pcm.c:446:41: style: The scope of the variable 'pcm_cpu' can be reduced. [variableScope]
 struct snd_soc_pcm_stream *pcm_codec, *pcm_cpu;
                                        ^

Signed-off-by: Kuninori Morimoto <kuninori.morimoto.gx@renesas.com>
Link: https://lore.kernel.org/r/87tukgzf2p.wl-kuninori.morimoto.gx@renesas.com
Signed-off-by: Mark Brown <broonie@kernel.org>
3 years agoASoC: rt1015: Remove unnecessary flush work on rt1015 driver
Jack Yu [Mon, 26 Jul 2021 09:15:41 +0000 (09:15 +0000)]
ASoC: rt1015: Remove unnecessary flush work on rt1015 driver

Remove workqueue of flush work in rt1015 driver since we don't need it
after internal discussion, and there is no impact on performance
without this workqueue.

Signed-off-by: Jack Yu <jack.yu@realtek.com>
Link: https://lore.kernel.org/r/3ef458a6ad754589b96d6a94abda1e55@realtek.com
Signed-off-by: Mark Brown <broonie@kernel.org>
3 years agoASoC: amd: Use dev_probe_err helper
Mario Limonciello [Thu, 22 Jul 2021 13:27:28 +0000 (08:27 -0500)]
ASoC: amd: Use dev_probe_err helper

Replace the pattern of check for err to match -EPROBE_DEFER and only
output errors to use the dev_err_probe helper instead.

Signed-off-by: Mario Limonciello <mario.limonciello@amd.com>
Link: https://lore.kernel.org/r/20210722132731.13264-2-mario.limonciello@amd.com
Signed-off-by: Mark Brown <broonie@kernel.org>
3 years agoASoC: amd: Don't show messages about deferred probing by default
Mario Limonciello [Thu, 22 Jul 2021 13:27:27 +0000 (08:27 -0500)]
ASoC: amd: Don't show messages about deferred probing by default

Nearly every boot with a Lenovo P14s is showing
acp_pdm_mach acp_pdm_mach.0: snd_soc_register_card(acp) failed: -517

This isn't useful to a user, especially as probing will run again.
Use the dev_err_probe helper to hide the deferrerd probing messages.

CC: markpearson@lenovo.com
Signed-off-by: Mario Limonciello <mario.limonciello@amd.com>
Link: https://lore.kernel.org/r/20210722132731.13264-1-mario.limonciello@amd.com
Signed-off-by: Mark Brown <broonie@kernel.org>
3 years agoASoC: amd: enable vangogh acp5x driver build
Vijendar Mukunda [Wed, 21 Jul 2021 18:04:28 +0000 (23:34 +0530)]
ASoC: amd: enable vangogh acp5x driver build

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

Reviewed-by: Pierre-Louis Bossart <pierre-louis.bossart@linux.intel.com>
Signed-off-by: Vijendar Mukunda <Vijendar.Mukunda@amd.com>
Link: https://lore.kernel.org/r/20210721180430.11571-13-Vijendar.Mukunda@amd.com
Signed-off-by: Mark Brown <broonie@kernel.org>
3 years agoASoC: amd: add vangogh i2s dma driver pm ops
Vijendar Mukunda [Wed, 21 Jul 2021 18:04:27 +0000 (23:34 +0530)]
ASoC: amd: add vangogh i2s dma driver pm ops

Add Vangogh i2s dma driver pm ops

Reviewed-by: Pierre-Louis Bossart <pierre-louis.bossart@linux.intel.com>
Signed-off-by: Vijendar Mukunda <Vijendar.Mukunda@amd.com>
Link: https://lore.kernel.org/r/20210721180430.11571-12-Vijendar.Mukunda@amd.com
Signed-off-by: Mark Brown <broonie@kernel.org>
3 years agoASoC: amd: add vangogh pci driver pm ops
Vijendar Mukunda [Wed, 21 Jul 2021 18:04:26 +0000 (23:34 +0530)]
ASoC: amd: add vangogh pci driver pm ops

Add Vangogh acp pci driver pm ops.

Reviewed-by: Pierre-Louis Bossart <pierre-louis.bossart@linux.intel.com>
Signed-off-by: Vijendar Mukunda <Vijendar.Mukunda@amd.com>
Link: https://lore.kernel.org/r/20210721180430.11571-11-Vijendar.Mukunda@amd.com
Signed-off-by: Mark Brown <broonie@kernel.org>
3 years agoASoC: amd: add vangogh i2s dai driver ops
Vijendar Mukunda [Wed, 21 Jul 2021 18:04:25 +0000 (23:34 +0530)]
ASoC: amd: add vangogh i2s dai driver ops

Add Vangogh i2s dai driver ops.

Reviewed-by: Pierre-Louis Bossart <pierre-louis.bossart@linux.intel.com>
Signed-off-by: Vijendar Mukunda <Vijendar.Mukunda@amd.com>
Link: https://lore.kernel.org/r/20210721180430.11571-10-Vijendar.Mukunda@amd.com
Signed-off-by: Mark Brown <broonie@kernel.org>
3 years agoASoC: amd: add vangogh i2s controller driver
Vijendar Mukunda [Wed, 21 Jul 2021 18:04:24 +0000 (23:34 +0530)]
ASoC: amd: add vangogh i2s controller driver

Add Vangogh I2S controller driver to support two I2S controller
instances.

Reviewed-by: Pierre-Louis Bossart <pierre-louis.bossart@linux.intel.com>
Signed-off-by: Vijendar Mukunda <Vijendar.Mukunda@amd.com>
Link: https://lore.kernel.org/r/20210721180430.11571-9-Vijendar.Mukunda@amd.com
Signed-off-by: Mark Brown <broonie@kernel.org>
3 years agoASoC: amd: add ACP5x pcm dma driver ops
Vijendar Mukunda [Wed, 21 Jul 2021 18:04:23 +0000 (23:34 +0530)]
ASoC: amd: add ACP5x pcm dma driver ops

This patch adds ACP5x PCM driver DMA operations.

Reviewed-by: Pierre-Louis Bossart <pierre-louis.bossart@linux.intel.com>
Signed-off-by: Vijendar Mukunda <Vijendar.Mukunda@amd.com>
Link: https://lore.kernel.org/r/20210721180430.11571-8-Vijendar.Mukunda@amd.com
Signed-off-by: Mark Brown <broonie@kernel.org>
3 years agoASoC: amd: irq handler changes for ACP5x PCM dma driver
Vijendar Mukunda [Wed, 21 Jul 2021 18:04:22 +0000 (23:34 +0530)]
ASoC: amd: irq handler changes for ACP5x PCM dma driver

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

Reviewed-by: Pierre-Louis Bossart <pierre-louis.bossart@linux.intel.com>
Signed-off-by: Vijendar Mukunda <Vijendar.Mukunda@amd.com>
Link: https://lore.kernel.org/r/20210721180430.11571-7-Vijendar.Mukunda@amd.com
Signed-off-by: Mark Brown <broonie@kernel.org>
3 years agoASoC: amd: add ACP5x PCM platform driver
Vijendar Mukunda [Wed, 21 Jul 2021 18:04:21 +0000 (23:34 +0530)]
ASoC: amd: add ACP5x PCM platform driver

PCM platform driver binds to the platform device created by
ACP5x PCI device. PCM driver registers ALSA DMA components
with ASoC framework.

Reviewed-by: Pierre-Louis Bossart <pierre-louis.bossart@linux.intel.com>
Signed-off-by: Vijendar Mukunda <Vijendar.Mukunda@amd.com>
Link: https://lore.kernel.org/r/20210721180430.11571-6-Vijendar.Mukunda@amd.com
Signed-off-by: Mark Brown <broonie@kernel.org>
3 years agoASoC: amd: create acp5x platform devices
Vijendar Mukunda [Wed, 21 Jul 2021 18:04:20 +0000 (23:34 +0530)]
ASoC: amd: create acp5x platform devices

ACP5.x IP has multiple I2S controllers and DMA controller.
Create platform devices for I2S HS controller instance, I2S SP controller
instance and DMA controller.
Pass PCI resources like MMIO, irq to these platform devices.

Reviewed-by: Pierre-Louis Bossart <pierre-louis.bossart@linux.intel.com>
Signed-off-by: Vijendar Mukunda <Vijendar.Mukunda@amd.com>
Link: https://lore.kernel.org/r/20210721180430.11571-5-Vijendar.Mukunda@amd.com
Signed-off-by: Mark Brown <broonie@kernel.org>
3 years agoASoc: amd: add acp5x init/de-init functions
Vijendar Mukunda [Wed, 21 Jul 2021 18:04:19 +0000 (23:34 +0530)]
ASoc: amd: add acp5x init/de-init functions

Add Vangogh ACP PCI driver init/deinit functions.

Reviewed-by: Pierre-Louis Bossart <pierre-louis.bossart@linux.intel.com>
Signed-off-by: Vijendar Mukunda <Vijendar.Mukunda@amd.com>
Link: https://lore.kernel.org/r/20210721180430.11571-4-Vijendar.Mukunda@amd.com
Signed-off-by: Mark Brown <broonie@kernel.org>
3 years agoASoC: amd: add Vangogh ACP PCI driver
Vijendar Mukunda [Wed, 21 Jul 2021 18:04:18 +0000 (23:34 +0530)]
ASoC: amd: add Vangogh ACP PCI driver

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

Reviewed-by: Pierre-Louis Bossart <pierre-louis.bossart@linux.intel.com>
Signed-off-by: Vijendar Mukunda <Vijendar.Mukunda@amd.com>
Link: https://lore.kernel.org/r/20210721180430.11571-3-Vijendar.Mukunda@amd.com
Signed-off-by: Mark Brown <broonie@kernel.org>
3 years agoASoC: amd: add Vangogh ACP5x IP register header
Vijendar Mukunda [Wed, 21 Jul 2021 18:04:17 +0000 (23:34 +0530)]
ASoC: amd: add Vangogh ACP5x IP register header

Add register header for ACP5x IP in Vangogh platform.

Reviewed-by: Pierre-Louis Bossart <pierre-louis.bossart@linux.intel.com>
Signed-off-by: Vijendar Mukunda <Vijendar.Mukunda@amd.com>
Link: https://lore.kernel.org/r/20210721180430.11571-2-Vijendar.Mukunda@amd.com
Signed-off-by: Mark Brown <broonie@kernel.org>
3 years agoASOC: Intel: sof_sdw: add quirk for Intel 'Bishop County' NUC M15
Pierre-Louis Bossart [Mon, 19 Jul 2021 23:32:48 +0000 (18:32 -0500)]
ASOC: Intel: sof_sdw: add quirk for Intel 'Bishop County' NUC M15

The same quirk is used for LAPBC510 and LAPBC710 skews who use the
same audio design, with an RT711 headset codec using JD1 mode and one
RT1308 amplifier, along with 4 DMICs.

BugLink: https://github.com/thesofproject/linux/issues/3049
Signed-off-by: Pierre-Louis Bossart <pierre-louis.bossart@linux.intel.com>
Reviewed-by: Bard Liao <bard.liao@intel.com>
Reviewed-by: Kai Vehmanen <kai.vehmanen@linux.intel.com>
Reviewed-by: Rander Wang <rander.wang@intel.com>
Link: https://lore.kernel.org/r/20210719233248.557923-3-pierre-louis.bossart@linux.intel.com
Signed-off-by: Mark Brown <broonie@kernel.org>
3 years agoASoC: ti: j721e-evm: Convert the audio domain IDs to enum
Peter Ujfalusi [Sat, 17 Jul 2021 12:28:20 +0000 (15:28 +0300)]
ASoC: ti: j721e-evm: Convert the audio domain IDs to enum

Convert the J721E_AUDIO_DOMAIN_* from defines to enum to make it possible
to extend the number of domains in the future.

Signed-off-by: Peter Ujfalusi <peter.ujfalusi@gmail.com>
Link: https://lore.kernel.org/r/20210717122820.1467-4-peter.ujfalusi@gmail.com
Signed-off-by: Mark Brown <broonie@kernel.org>
3 years agoASoC: codecs: wcd938x: remove unused port-map reference
Srinivas Kandagatla [Fri, 16 Jul 2021 10:56:12 +0000 (11:56 +0100)]
ASoC: codecs: wcd938x: remove unused port-map reference

port_map field was added prior to adding static port map support in soundwire.
This makes port_map array in struct wcd938x_sdw_priv redundant and unused,
so remove this.

Signed-off-by: Srinivas Kandagatla <srinivas.kandagatla@linaro.org>
Link: https://lore.kernel.org/r/20210716105612.5284-1-srinivas.kandagatla@linaro.org
Signed-off-by: Mark Brown <broonie@kernel.org>
3 years agoASoC: codecs: lpass-rx-macro: clean up for-loop indentation in switch statement
Colin Ian King [Fri, 9 Jul 2021 15:24:24 +0000 (16:24 +0100)]
ASoC: codecs: lpass-rx-macro: clean up for-loop indentation in switch statement

The for-loop is not indented enough and needs one more level
of indentation. Add in the indentation across the block of code.

Signed-off-by: Colin Ian King <colin.king@canonical.com>
Link: https://lore.kernel.org/r/20210709152424.460446-1-colin.king@canonical.com
Signed-off-by: Mark Brown <broonie@kernel.org>
3 years agoMerge series "soundwire/ASoC: add mockup codec support" from Bard Liao <yung-chuan...
Mark Brown [Wed, 14 Jul 2021 17:29:58 +0000 (18:29 +0100)]
Merge series "soundwire/ASoC: add mockup codec support" from Bard Liao <yung-chuan.liao@linux.intel.com>:

Adding mockup SoundWire codec is useful to debug driver/topology changes
without having any actual device connected.

Bard Liao (2):
  soundwire: stream: don't abort bank switch on Command_Ignored/-ENODATA
  soundwire: stream: don't program mockup device ports

Pierre-Louis Bossart (8):
  ASoC: codecs: add SoundWire mockup device support
  ASoC: soc-acpi: cnl: add table for SoundWire mockup devices
  ASoC: soc-acpi: tgl: add table for SoundWire mockup devices
  ASoC: Intel: boards: sof_sdw: add SoundWire mockup codecs for tests
  soundwire: add flag to ignore all command/control for mockup devices
  soundwire: bus: squelch error returned by mockup devices
  soundwire: cadence: add debugfs interface for PDI loopbacks
  soundwire: cadence: override PDI configurations to create loopback

 drivers/soundwire/bus.c                       |  10 +-
 drivers/soundwire/cadence_master.c            | 174 ++++++++--
 drivers/soundwire/cadence_master.h            |   3 +
 drivers/soundwire/stream.c                    |   5 +-
 include/linux/soundwire/sdw.h                 |   3 +
 sound/soc/codecs/Kconfig                      |  18 +
 sound/soc/codecs/Makefile                     |   2 +
 sound/soc/codecs/sdw-mockup.c                 | 312 ++++++++++++++++++
 sound/soc/intel/boards/Kconfig                |   1 +
 sound/soc/intel/boards/sof_sdw.c              |  41 +++
 sound/soc/intel/common/Makefile               |   3 +-
 .../intel/common/soc-acpi-intel-cnl-match.c   |  15 +
 .../common/soc-acpi-intel-sdw-mockup-match.c  | 166 ++++++++++
 .../common/soc-acpi-intel-sdw-mockup-match.h  |  17 +
 .../intel/common/soc-acpi-intel-tgl-match.c   |  23 ++
 15 files changed, 754 insertions(+), 39 deletions(-)
 create mode 100644 sound/soc/codecs/sdw-mockup.c
 create mode 100644 sound/soc/intel/common/soc-acpi-intel-sdw-mockup-match.c
 create mode 100644 sound/soc/intel/common/soc-acpi-intel-sdw-mockup-match.h

base-commit: e73f0f0ee7541171d89f2e2491130c7771ba58d3

--
2.17.1

3 years agoASoC: Intel: boards: sof_sdw: add SoundWire mockup codecs for tests
Pierre-Louis Bossart [Wed, 14 Jul 2021 03:22:03 +0000 (11:22 +0800)]
ASoC: Intel: boards: sof_sdw: add SoundWire mockup codecs for tests

Add support for SoundWire mockup devices. The configurations assume the
same topology as the CML SoundWire devices and can be used to test the
SOF firmware on a development board (RVP, UpExtreme) without any
hardware connected.

Signed-off-by: Pierre-Louis Bossart <pierre-louis.bossart@linux.intel.com>
Reviewed-by: Rander Wang <rander.wang@intel.com>
Signed-off-by: Bard Liao <yung-chuan.liao@linux.intel.com>
Link: https://lore.kernel.org/r/20210714032209.11284-5-yung-chuan.liao@linux.intel.com
Signed-off-by: Mark Brown <broonie@kernel.org>
3 years agoASoC: soc-acpi: tgl: add table for SoundWire mockup devices
Pierre-Louis Bossart [Wed, 14 Jul 2021 03:22:02 +0000 (11:22 +0800)]
ASoC: soc-acpi: tgl: add table for SoundWire mockup devices

Follow the same idea as for CNL/UpExtreme and add mockup test
first. They will only be selected if the SSDT is modified to add such
mockup devices.

Signed-off-by: Pierre-Louis Bossart <pierre-louis.bossart@linux.intel.com>
Reviewed-by: Rander Wang <rander.wang@intel.com>
Signed-off-by: Bard Liao <yung-chuan.liao@linux.intel.com>
Link: https://lore.kernel.org/r/20210714032209.11284-4-yung-chuan.liao@linux.intel.com
Signed-off-by: Mark Brown <broonie@kernel.org>
3 years agoASoC: soc-acpi: cnl: add table for SoundWire mockup devices
Pierre-Louis Bossart [Wed, 14 Jul 2021 03:22:01 +0000 (11:22 +0800)]
ASoC: soc-acpi: cnl: add table for SoundWire mockup devices

Add support for two configurations with SoundWire mockup devices that
emulate the two CometLake configurations with one and two amps. This
patch helps test the SOF firmware on an UpExtreme board without any
hardware connected, e.g. by doing a loopback of the playback stream on
capture streams.

The mapping of the partIDs is as follows:

0xAAAA: generic full-duplex codec (not currently used)
0xAA55: headset codec (mock-up of RT711/RT5682) - full-duplex
0x55AA: amplifier (mock-up of RT1308/RT1316/Maxim 98373) - playback
with IV sense feedback
0x5555: mic codec (mock-up of RT715) - capture-only

The tables are added in a separate file to allow for mockup codecs to be
added on other platforms, but the mapping to specific topologies
remains platform-specific.

Signed-off-by: Pierre-Louis Bossart <pierre-louis.bossart@linux.intel.com>
Reviewed-by: Rander Wang <rander.wang@intel.com>
Signed-off-by: Bard Liao <yung-chuan.liao@linux.intel.com>
Link: https://lore.kernel.org/r/20210714032209.11284-3-yung-chuan.liao@linux.intel.com
Signed-off-by: Mark Brown <broonie@kernel.org>
3 years agoASoC: codecs: add SoundWire mockup device support
Pierre-Louis Bossart [Wed, 14 Jul 2021 03:22:00 +0000 (11:22 +0800)]
ASoC: codecs: add SoundWire mockup device support

To test the host controller and bus management code, it is currently
required to have a physical SoundWire peripheral attached to the
bus. To help with pre-silicon or early hardware enablement, it would
be very useful to have a SoundWire 'mockup' device that is exposed in
platform firmware but does not drive any signal on the bus.

This is different to the existing ASoC 'dummy' codec uses for I2S/TDM,
the SoundWire spec makes it clear that a device that is not attached
to the bus is not permitted to interact with the bus, be it for
command/control or data.

This patch exposes a 'mockup' device, with a minimalist driver, with 4
partID values reserved by Intel for such test configurations. The
mockup device exposes one full-duplex DAI based on 2 ports (DP1 for
playback and DP8 for capture). The capture data port is just virtual,
such a mockup device is prevented by the SoundWire specification from
presenting any data generated by a Source port without being Attached.

All the callbacks exposed by the SoundWire Slave interface are
populated, even if they just return immediately. This is intentional
to describe what a minimal codec driver should do and implement and
help new codec vendors provide support for their devices.

Signed-off-by: Pierre-Louis Bossart <pierre-louis.bossart@linux.intel.com>
Reviewed-by: Rander Wang <rander.wang@intel.com>
Signed-off-by: Bard Liao <yung-chuan.liao@linux.intel.com>
Link: https://lore.kernel.org/r/20210714032209.11284-2-yung-chuan.liao@linux.intel.com
Signed-off-by: Mark Brown <broonie@kernel.org>
3 years agoASoC: Intel: sof_sdw: update quirk for jack detection in ADL RVP
jairaj arava [Mon, 12 Jul 2021 20:32:40 +0000 (15:32 -0500)]
ASoC: Intel: sof_sdw: update quirk for jack detection in ADL RVP

ADL RVP uses different circuits for jack detection, hence
adding external resister 100k mode.

Reviewed-by: Rander Wang <rander.wang@intel.com>
Signed-off-by: jairaj arava <jairaj.arava@intel.com>
Signed-off-by: Sathya Prakash M R <sathya.prakash.m.r@intel.com>
Signed-off-by: Pierre-Louis Bossart <pierre-louis.bossart@linux.intel.com>
Link: https://lore.kernel.org/r/20210712203240.46960-8-pierre-louis.bossart@linux.intel.com
Signed-off-by: Mark Brown <broonie@kernel.org>
3 years agoASoC: Intel: sof_sdw: include rt711.h for RT711 JD mode
Bard Liao [Mon, 12 Jul 2021 20:32:39 +0000 (15:32 -0500)]
ASoC: Intel: sof_sdw: include rt711.h for RT711 JD mode

We don't need to redefine enum rt711_jd_src.

Reviewed-by: Rander Wang <rander.wang@intel.com>
Signed-off-by: Bard Liao <yung-chuan.liao@linux.intel.com>
Signed-off-by: Pierre-Louis Bossart <pierre-louis.bossart@linux.intel.com>
Link: https://lore.kernel.org/r/20210712203240.46960-7-pierre-louis.bossart@linux.intel.com
Signed-off-by: Mark Brown <broonie@kernel.org>
3 years agoASoC: Intel: sof_sdw: extends SOF_RT711_JDSRC to 4 bits
Bard Liao [Mon, 12 Jul 2021 20:32:38 +0000 (15:32 -0500)]
ASoC: Intel: sof_sdw: extends SOF_RT711_JDSRC to 4 bits

commit 683b0df26c33 ("ASoC: rt711: add two jack detection modes")
added two jack detection modes. Rt711 has 4 JD modes now.
Reserve 4 bits in case rt711 adds more JD modes in the future.

Reviewed-by: Rander Wang <rander.wang@intel.com>
Signed-off-by: Bard Liao <yung-chuan.liao@linux.intel.com>
Signed-off-by: Pierre-Louis Bossart <pierre-louis.bossart@linux.intel.com>
Link: https://lore.kernel.org/r/20210712203240.46960-6-pierre-louis.bossart@linux.intel.com
Signed-off-by: Mark Brown <broonie@kernel.org>
3 years agoASoC: Intel: sof_rt5682: code refactor for max98360a
Brent Lu [Mon, 12 Jul 2021 20:32:37 +0000 (15:32 -0500)]
ASoC: Intel: sof_rt5682: code refactor for max98360a

Refactor the machine driver by using the common code in maxim-common
module to support max98360a.

Reviewed-by: Bard Liao <bard.liao@intel.com>
Signed-off-by: Brent Lu <brent.lu@intel.com>
Signed-off-by: Pierre-Louis Bossart <pierre-louis.bossart@linux.intel.com>
Link: https://lore.kernel.org/r/20210712203240.46960-5-pierre-louis.bossart@linux.intel.com
Signed-off-by: Mark Brown <broonie@kernel.org>
3 years agoASoC: Intel: sof_cs42l42: add support for jsl_cs4242_mx98360a
Brent Lu [Mon, 12 Jul 2021 20:32:36 +0000 (15:32 -0500)]
ASoC: Intel: sof_cs42l42: add support for jsl_cs4242_mx98360a

This patch adds driver data for jsl_cs4242_mx98360a which supports two
max98360a speaker amplifiers on SSP1 and cs42l42 headphone codec on
SSP0 running on JSL platform.

Reviewed-by: Bard Liao <bard.liao@intel.com>
Signed-off-by: Brent Lu <brent.lu@intel.com>
Signed-off-by: Pierre-Louis Bossart <pierre-louis.bossart@linux.intel.com>
Link: https://lore.kernel.org/r/20210712203240.46960-4-pierre-louis.bossart@linux.intel.com
Signed-off-by: Mark Brown <broonie@kernel.org>
3 years agoASoC: Intel: maxim-common: support max98360a
Brent Lu [Mon, 12 Jul 2021 20:32:35 +0000 (15:32 -0500)]
ASoC: Intel: maxim-common: support max98360a

Move max98360a code to this common module so it could be shared
between multiple SOF machine drivers. MAX98357A and MAX98360A are
sharing same codec driver so here we also share some function and
structures.

Reviewed-by: Bard Liao <bard.liao@intel.com>
Signed-off-by: Brent Lu <brent.lu@intel.com>
Signed-off-by: Pierre-Louis Bossart <pierre-louis.bossart@linux.intel.com>
Link: https://lore.kernel.org/r/20210712203240.46960-3-pierre-louis.bossart@linux.intel.com
Signed-off-by: Mark Brown <broonie@kernel.org>
3 years agoASoC: Intel: sof_cs42l42: support arbitrary DAI link sequence
Brent Lu [Mon, 12 Jul 2021 20:32:34 +0000 (15:32 -0500)]
ASoC: Intel: sof_cs42l42: support arbitrary DAI link sequence

Currently there are two types of DAI Link sequences defined in
topology files, one starts from speaker link and the other starts from
headphone link.

Type 1: SPK - HP - DMIC - HDMI
Type 2: HP - DMIC - HDMI - SPK

Here we add a macro SOF_CS42L42_DAILINK to define the DAI Link
sequence in quirk and refactor the sof_card_dai_links_create()
function to support arbitrary DAI Link sequence.

Reviewed-by: Bard Liao <bard.liao@intel.com>
Signed-off-by: Brent Lu <brent.lu@intel.com>
Signed-off-by: Pierre-Louis Bossart <pierre-louis.bossart@linux.intel.com>
Link: https://lore.kernel.org/r/20210712203240.46960-2-pierre-louis.bossart@linux.intel.com
Signed-off-by: Mark Brown <broonie@kernel.org>
3 years agoMerge series "ASoC: ti: davinci-mcasp: Fix the DIT mode and OMAP4 support" from Peter...
Mark Brown [Mon, 12 Jul 2021 10:30:32 +0000 (11:30 +0100)]
Merge series "ASoC: ti: davinci-mcasp: Fix the DIT mode and OMAP4 support" from Peter Ujfalusi <peter.ujfalusi@gmail.com>:

Hi,

Changes since v1:
- Do not calculat that we allow one serializer in DIT mode, just set the
  max_active_serializers to 1.
Reported-by: kernel test robot <lkp@intel.com>
it has been on my todo list for several years to support McASP on OMAP4 devices.
For Galaxy Nexus we had an omap-mcasp driver (which was mostly a stripped down
davinci-mcasp driver) to support what was needed on that specific phone + it's
dock for S/PDIF (48KHz, 16bit, stereo).

Not many (if any) device available to test the DIT mode of McASP.
I have used BeagleBone White (McASP1 AXR3 can be routed to a pin) to get the
S/PDIF mode working then PandaES for OMAP4 support (on PandaES the gpio_121 is
not used and the signal is routed to expansion J6 pin14).

In theory the McASP in OMAP5 should be working after this series, but the OMAP5
TRM is not public and I do not have one to check the addresses and see if there
is a way to test it on omap5-uevm.

Mark, Tony:
The ASoC and dts patches can go via separate tree I felt that it is better if
they are together, at least initially.

Nikolaus: fyi, this might be useful for Pyra?

Regards,
Péter
---
Peter Ujfalusi (5):
  ASoC: ti: davinci-mcasp: Fix DIT mode support
  ASoC: dt-bindings: davinci-mcasp: Add compatible string for OMAP4
  ASoC: ti: davinci-mcasp: Add support for the OMAP4 version of McASP
  ARM: dts: omap4-l4-abe: Correct sidle modes for McASP
  ARM: dts: omap4-l4-abe: Add McASP configuration

 .../bindings/sound/davinci-mcasp-audio.txt    |   1 +
 arch/arm/boot/dts/omap4-l4-abe.dtsi           |  39 ++--
 include/linux/platform_data/davinci_asp.h     |   1 +
 sound/soc/ti/Kconfig                          |   1 +
 sound/soc/ti/davinci-mcasp.c                  | 176 +++++++++++++++---
 5 files changed, 175 insertions(+), 43 deletions(-)

--
2.32.0

3 years agoMerge series "Fix unbalanced pm_runtime_enable in error handle" from Zhang Qilong...
Mark Brown [Mon, 12 Jul 2021 10:30:31 +0000 (11:30 +0100)]
Merge series "Fix unbalanced pm_runtime_enable in error handle" from Zhang Qilong <zhangqilong3@huawei.com>:

This two patches fixed the unbalanced PM disable depth. It could
avoid pm_runtime implementation complains when removing and probing
again the driver.

Zhang Qilong (2):
  ASoC: mediatek: mt8192:Fix Unbalanced pm_runtime_enable in
    mt8192_afe_pcm_dev_probe
  ASoC: mediatek: mt8183: Fix Unbalanced pm_runtime_enable in
    mt8183_afe_pcm_dev_probe

 sound/soc/mediatek/mt8183/mt8183-afe-pcm.c | 43 ++++++++++++++--------
 sound/soc/mediatek/mt8192/mt8192-afe-pcm.c | 27 +++++++++-----
 2 files changed, 44 insertions(+), 26 deletions(-)

--
2.31.1

3 years agoMerge series "ASoC: Intel: machine driver corrections" from Pierre-Louis Bossart...
Mark Brown [Mon, 12 Jul 2021 10:30:30 +0000 (11:30 +0100)]
Merge series "ASoC: Intel: machine driver corrections" from Pierre-Louis Bossart <pierre-louis.bossart@linux.intel.com>:

The first fix solves an underflow in SoundWire platforms using the
max98373 amplifier, the rest of the patches are minor corrections in
machine drivers.

The fix should be queued for the 5.14 cycle, the rest should be
harmless but can be deferred for 5.15 if it's too late already.

Brent Lu (2):
  ASoC: SOF: add a helper to get topology configured bclk
  ASoC: Intel: sof_cs42l42: use helper function to get bclk frequency

Gongjun Song (1):
  ASoC: Intel: soc-acpi: add support for SoundWire of TGL-H-RVP

Rander Wang (1):
  ASoC: Intel: boards: fix xrun issue on platform with max98373

 include/sound/sof.h                           |  1 +
 sound/soc/intel/boards/sof_cs42l42.c          |  8 +-
 sound/soc/intel/boards/sof_sdw_max98373.c     | 81 ++++++++++++-------
 .../intel/common/soc-acpi-intel-tgl-match.c   | 15 ++++
 sound/soc/sof/sof-audio.c                     | 42 ++++++++--
 5 files changed, 111 insertions(+), 36 deletions(-)

--
2.25.1

3 years agoASoC: amd: fix spelling mistakes
Gu Shengxian [Tue, 6 Jul 2021 06:42:07 +0000 (23:42 -0700)]
ASoC: amd: fix spelling mistakes

Fix some spelling mistakes as follows:
descritor ==> descriptor
descriptore ==> descriptor
contiguos ==> contiguous
initiailize ==> initialize
descriptiors ==> descriptor

Signed-off-by: Gu Shengxian <gushengxian@yulong.com>
Link: https://lore.kernel.org/r/20210706064207.672491-1-gushengxian507419@gmail.com
Signed-off-by: Mark Brown <broonie@kernel.org>
3 years agoASoC: tlv320aic32x4: Fix TAS2505/TAS2521 channel count
Marek Vasut [Thu, 8 Jul 2021 09:12:29 +0000 (11:12 +0200)]
ASoC: tlv320aic32x4: Fix TAS2505/TAS2521 channel count

The TAS2505/TAS2521 does support up to two channels, LEFT and RIGHT,
which are being alternated on the audio data bus by Word Clock, WCLK.
This is documented in TI slau472 2.7.1 Digital Audio Interface. Note
that both the LEFT and RIGHT channels are only used for audio INPUT,
while only the LEFT channel is used for audio OUTPUT.

Fixes: b4525b6196cd7 ("ASoC: tlv320aic32x4: add support for TAS2505")
Signed-off-by: Marek Vasut <marex@denx.de>
Cc: Claudius Heine <ch@denx.de>
Cc: Mark Brown <broonie@kernel.org>
Link: https://lore.kernel.org/r/20210708091229.56443-1-marex@denx.de
Signed-off-by: Mark Brown <broonie@kernel.org>
3 years agoASoC: fsl_xcvr: Omit superfluous error message in fsl_xcvr_probe()
Tang Bin [Thu, 24 Jun 2021 10:45:05 +0000 (18:45 +0800)]
ASoC: fsl_xcvr: Omit superfluous error message in fsl_xcvr_probe()

In the function fsl_xcvr__probe(), when get irq failed,
the function platform_get_irq() logs an error message, so remove
redundant message here.

Signed-off-by: Tang Bin <tangbin@cmss.chinamobile.com>
Link: https://lore.kernel.org/r/20210624104505.13680-1-tangbin@cmss.chinamobile.com
Signed-off-by: Mark Brown <broonie@kernel.org>
3 years agoASoC: sh: rcar: dma: : use proper DMAENGINE API for termination
Wolfram Sang [Wed, 23 Jun 2021 10:05:45 +0000 (12:05 +0200)]
ASoC: sh: rcar: dma: : use proper DMAENGINE API for termination

dmaengine_terminate_all() is deprecated in favor of explicitly saying if
it should be sync or async. Here, we want dmaengine_terminate_sync()
because there is no other synchronization code in the driver to handle
an async case.

Signed-off-by: Wolfram Sang <wsa+renesas@sang-engineering.com>
Link: https://lore.kernel.org/r/20210623100545.3926-1-wsa+renesas@sang-engineering.com
Signed-off-by: Mark Brown <broonie@kernel.org>
3 years agoASoC: wm_adsp: Remove pointless string comparison
Charles Keepax [Sat, 26 Jun 2021 15:59:41 +0000 (16:59 +0100)]
ASoC: wm_adsp: Remove pointless string comparison

The control fw_name is always directly assigned from the wm_adsp_fw_text
array, so it isn't necessary to compare the actual strings just the
pointer values.

Signed-off-by: Charles Keepax <ckeepax@opensource.cirrus.com>
Link: https://lore.kernel.org/r/20210626155941.12251-3-ckeepax@opensource.cirrus.com
Signed-off-by: Mark Brown <broonie@kernel.org>
3 years agoASoC: codecs: wcd938x: fix returnvar.cocci warnings
kernel test robot [Tue, 29 Jun 2021 13:29:09 +0000 (21:29 +0800)]
ASoC: codecs: wcd938x: fix returnvar.cocci warnings

sound/soc/codecs/wcd938x.c:1628:5-8: Unneeded variable: "ret". Return "0" on line 1656
sound/soc/codecs/wcd938x.c:1871:5-8: Unneeded variable: "ret". Return "0" on line 1907

 Remove unneeded variable used to store return value.

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

Fixes: 045442228868 ("ASoC: codecs: wcd938x: add audio routing and Kconfig")
CC: Srinivas Kandagatla <srinivas.kandagatla@linaro.org>
Reported-by: kernel test robot <lkp@intel.com>
Signed-off-by: kernel test robot <lkp@intel.com>
Acked-by: Souptick Joarder <jrdr.linux@gmail.com>
Link: https://lore.kernel.org/r/20210629132909.GA7935@233d919f385f
Signed-off-by: Mark Brown <broonie@kernel.org>
3 years agoASoC: atmel: ATMEL drivers don't need HAS_DMA
Randy Dunlap [Wed, 7 Jul 2021 21:47:52 +0000 (14:47 -0700)]
ASoC: atmel: ATMEL drivers don't need HAS_DMA

On a config (such as arch/sh/) which does not set HAS_DMA when MMU
is not set, several ATMEL ASoC drivers select symbols that cause
kconfig warnings. There is one "depends on HAS_DMA" which is no longer
needed. Dropping it eliminates the kconfig warnings and still builds
with no problems reported.

Fix the following kconfig warnings:

WARNING: unmet direct dependencies detected for SND_ATMEL_SOC_PDC
  Depends on [n]: SOUND [=m] && !UML && SND [=m] && SND_SOC [=m] && SND_ATMEL_SOC [=m] && HAS_DMA [=n]
  Selected by [m]:
  - SND_ATMEL_SOC_SSC [=m] && SOUND [=m] && !UML && SND [=m] && SND_SOC [=m] && SND_ATMEL_SOC [=m]
  - SND_ATMEL_SOC_SSC_PDC [=m] && SOUND [=m] && !UML && SND [=m] && SND_SOC [=m] && SND_ATMEL_SOC [=m] && ATMEL_SSC [=m]

WARNING: unmet direct dependencies detected for SND_ATMEL_SOC_SSC_PDC
  Depends on [n]: SOUND [=m] && !UML && SND [=m] && SND_SOC [=m] && SND_ATMEL_SOC [=m] && ATMEL_SSC [=m] && HAS_DMA [=n]
  Selected by [m]:
  - SND_AT91_SOC_SAM9G20_WM8731 [=m] && SOUND [=m] && !UML && SND [=m] && SND_SOC [=m] && SND_ATMEL_SOC [=m] && (ARCH_AT91 || COMPILE_TEST [=y]) && ATMEL_SSC [=m] && SND_SOC_I2C_AND_SPI [=m]

WARNING: unmet direct dependencies detected for SND_ATMEL_SOC_SSC
  Depends on [n]: SOUND [=m] && !UML && SND [=m] && SND_SOC [=m] && SND_ATMEL_SOC [=m] && HAS_DMA [=n]
  Selected by [m]:
  - SND_ATMEL_SOC_SSC_DMA [=m] && SOUND [=m] && !UML && SND [=m] && SND_SOC [=m] && SND_ATMEL_SOC [=m] && ATMEL_SSC [=m]

WARNING: unmet direct dependencies detected for SND_ATMEL_SOC_SSC_DMA
  Depends on [n]: SOUND [=m] && !UML && SND [=m] && SND_SOC [=m] && SND_ATMEL_SOC [=m] && ATMEL_SSC [=m] && HAS_DMA [=n]
  Selected by [m]:
  - SND_ATMEL_SOC_WM8904 [=m] && SOUND [=m] && !UML && SND [=m] && SND_SOC [=m] && SND_ATMEL_SOC [=m] && (ARCH_AT91 || COMPILE_TEST [=y]) && ATMEL_SSC [=m] && I2C [=m]
  - SND_AT91_SOC_SAM9X5_WM8731 [=m] && SOUND [=m] && !UML && SND [=m] && SND_SOC [=m] && SND_ATMEL_SOC [=m] && (ARCH_AT91 || COMPILE_TEST [=y]) && ATMEL_SSC [=m] && SND_SOC_I2C_AND_SPI [=m]

Signed-off-by: Randy Dunlap <rdunlap@infradead.org>
Reviewed-by: Codrin Ciubotariu <codrin.ciubotariu@microchip.com>
Acked-by: Alexandre Belloni <alexandre.belloni@bootlin.com>
Link: https://lore.kernel.org/r/20210707214752.3831-1-rdunlap@infradead.org
Signed-off-by: Mark Brown <broonie@kernel.org>
3 years agoASoC: ti: delete some dead code in omap_abe_probe()
Dan Carpenter [Wed, 30 Jun 2021 11:18:53 +0000 (14:18 +0300)]
ASoC: ti: delete some dead code in omap_abe_probe()

This code checks "priv->mclk_freq" twice and the second check is not
required.  The code is left over from when removed support for legacy
boot.

Fixes: 8fe120b5a665 ("ASoC: omap-abe-twl6040: Remove support for pdata (legacy boot)")
Signed-off-by: Dan Carpenter <dan.carpenter@oracle.com>
Acked-by: Peter Ujfalusi <peter.ujfalusi@gmail.com>
Link: https://lore.kernel.org/r/YNxTHXz58dhgbFtG@mwanda
Signed-off-by: Mark Brown <broonie@kernel.org>
3 years agoASoC: atmel: fix spelling mistakes
Gu Shengxian [Tue, 6 Jul 2021 10:02:30 +0000 (18:02 +0800)]
ASoC: atmel: fix spelling mistakes

Fix some spelling mistakes as follows:
regaedles ==> regardless
prezent ==> present
underrrun ==> underrun
controlls ==> controls

Signed-off-by: Gu Shengxian <gushengxian@yulong.com>
Link: https://lore.kernel.org/r/20210706100230.32633-1-gushengxian507419@gmail.com
Signed-off-by: Mark Brown <broonie@kernel.org>
3 years agoASoC: Intel: sof_cs42l42: use helper function to get bclk frequency
Brent Lu [Fri, 25 Jun 2021 20:50:42 +0000 (15:50 -0500)]
ASoC: Intel: sof_cs42l42: use helper function to get bclk frequency

Use sof_dai_get_bclk() function to get bclk frequency instead of a
hard-coded magic number depending on configuration in topology.

Reviewed-by: Bard Liao <bard.liao@intel.com>
Signed-off-by: Brent Lu <brent.lu@intel.com>
Signed-off-by: Pierre-Louis Bossart <pierre-louis.bossart@linux.intel.com>
Link: https://lore.kernel.org/r/20210625205042.65181-5-pierre-louis.bossart@linux.intel.com
Signed-off-by: Mark Brown <broonie@kernel.org>
3 years agoASoC: SOF: add a helper to get topology configured bclk
Brent Lu [Fri, 25 Jun 2021 20:50:41 +0000 (15:50 -0500)]
ASoC: SOF: add a helper to get topology configured bclk

Add helper function sof_dai_ssp_bclk() to get the BCLK frequency
configured by topology.

Reviewed-by: Bard Liao <bard.liao@intel.com>
Signed-off-by: Brent Lu <brent.lu@intel.com>
Signed-off-by: Pierre-Louis Bossart <pierre-louis.bossart@linux.intel.com>
Link: https://lore.kernel.org/r/20210625205042.65181-4-pierre-louis.bossart@linux.intel.com
Signed-off-by: Mark Brown <broonie@kernel.org>
3 years agoASoC: Intel: soc-acpi: add support for SoundWire of TGL-H-RVP
Gongjun Song [Fri, 25 Jun 2021 20:50:40 +0000 (15:50 -0500)]
ASoC: Intel: soc-acpi: add support for SoundWire of TGL-H-RVP

snd_soc_acpi_intel_tgl_sdw_machines structure array does not contain
the configuration information of TGL-H-RVP, which results in the
inability to enable soundwire on the TGL-H-RVP platform.

Add the corresponding configuration information to enable soundwire
on the TGL-H-RVP platform.

Reviewed-by: Kai Vehmanen <kai.vehmanen@linux.intel.com>
Signed-off-by: Gongjun Song <gongjun.song@intel.com>
Signed-off-by: Pierre-Louis Bossart <pierre-louis.bossart@linux.intel.com>
Link: https://lore.kernel.org/r/20210625205042.65181-3-pierre-louis.bossart@linux.intel.com
Signed-off-by: Mark Brown <broonie@kernel.org>
3 years agoASoC: mediatek: mt8183: Fix Unbalanced pm_runtime_enable in mt8183_afe_pcm_dev_probe
Zhang Qilong [Fri, 18 Jun 2021 14:11:04 +0000 (22:11 +0800)]
ASoC: mediatek: mt8183: Fix Unbalanced pm_runtime_enable in mt8183_afe_pcm_dev_probe

Add missing pm_runtime_disable() when probe error out. It could
avoid pm_runtime implementation complains when removing and probing
again the driver.

Fixes:a94aec035a122 ("ASoC: mediatek: mt8183: add platform driver")

Signed-off-by: Zhang Qilong <zhangqilong3@huawei.com>
Link: https://lore.kernel.org/r/20210618141104.105047-3-zhangqilong3@huawei.com
Signed-off-by: Mark Brown <broonie@kernel.org>
3 years agoASoC: mediatek: mt8192:Fix Unbalanced pm_runtime_enable in mt8192_afe_pcm_dev_probe
Zhang Qilong [Fri, 18 Jun 2021 14:11:03 +0000 (22:11 +0800)]
ASoC: mediatek: mt8192:Fix Unbalanced pm_runtime_enable in mt8192_afe_pcm_dev_probe

Add missing pm_runtime_disable() when probe error out. It could
avoid pm_runtime implementation complains when removing and probing
again the driver.

Fixes:125ab5d588b0b ("ASoC: mediatek: mt8192: add platform driver")

Signed-off-by: Zhang Qilong <zhangqilong3@huawei.com>
Link: https://lore.kernel.org/r/20210618141104.105047-2-zhangqilong3@huawei.com
Signed-off-by: Mark Brown <broonie@kernel.org>
3 years agoASoC: ti: davinci-mcasp: Add support for the OMAP4 version of McASP
Peter Ujfalusi [Mon, 5 Jul 2021 19:42:47 +0000 (22:42 +0300)]
ASoC: ti: davinci-mcasp: Add support for the OMAP4 version of McASP

There is a single McASP on OMAP4 (and OMAP5) which is configured to only
support DIT playback mode on a single serializer.

Add 0x200 offset to DAT port address as the TRM suggests it.

Signed-off-by: Peter Ujfalusi <peter.ujfalusi@ti.com>
Link: https://lore.kernel.org/r/20210705194249.2385-4-peter.ujfalusi@gmail.com
Signed-off-by: Mark Brown <broonie@kernel.org>
3 years agoASoC: dt-bindings: davinci-mcasp: Add compatible string for OMAP4
Peter Ujfalusi [Mon, 5 Jul 2021 19:42:46 +0000 (22:42 +0300)]
ASoC: dt-bindings: davinci-mcasp: Add compatible string for OMAP4

OMAP4 has one McASP instance with single serializer and supporting only
DIT mode.
According to the TRM the DAT port needs to be accessed as specific offset
compared to other devices where access to any part of the DAT region is
valid.
To handle this constraint we need to introduce a new compatiple string for
OMAP4.

Signed-off-by: Peter Ujfalusi <peter.ujfalusi@gmail.com>
Link: https://lore.kernel.org/r/20210705194249.2385-3-peter.ujfalusi@gmail.com
Signed-off-by: Mark Brown <broonie@kernel.org>
3 years agoASoC: ti: davinci-mcasp: Fix DIT mode support
Peter Ujfalusi [Mon, 5 Jul 2021 19:42:45 +0000 (22:42 +0300)]
ASoC: ti: davinci-mcasp: Fix DIT mode support

The DIT mode support has not been tested due to lack of platform where it
can be tested.
To be able to use the McASP on OMAP4/5 (only supporting DIT mode) we need
to have DIT mode working in the McASP driver on a know platform.
After hacking around (on BBW, mcasp1.axr1 can be routed out for this) it
appeared that DIT mode is broken.

This patch fixes it up and 16/24 bit audio works along with passthrough,
but I have only tested with DTS example and test files.

Signed-off-by: Peter Ujfalusi <peter.ujfalusi@gmail.com>
Link: https://lore.kernel.org/r/20210705194249.2385-2-peter.ujfalusi@gmail.com
Signed-off-by: Mark Brown <broonie@kernel.org>
3 years agoMerge existing fixes from asoc/for-5.14
Mark Brown [Sun, 11 Jul 2021 22:44:54 +0000 (23:44 +0100)]
Merge existing fixes from asoc/for-5.14

3 years agoLinux 5.14-rc1
Linus Torvalds [Sun, 11 Jul 2021 22:07:40 +0000 (15:07 -0700)]
Linux 5.14-rc1

3 years agomm/rmap: try_to_migrate() skip zone_device !device_private
Hugh Dickins [Wed, 7 Jul 2021 20:13:33 +0000 (13:13 -0700)]
mm/rmap: try_to_migrate() skip zone_device !device_private

I know nothing about zone_device pages and !device_private pages; but if
try_to_migrate_one() will do nothing for them, then it's better that
try_to_migrate() filter them first, than trawl through all their vmas.

Signed-off-by: Hugh Dickins <hughd@google.com>
Reviewed-by: Shakeel Butt <shakeelb@google.com>
Reviewed-by: Alistair Popple <apopple@nvidia.com>
Link: https://lore.kernel.org/lkml/1241d356-8ec9-f47b-a5ec-9b2bf66d242@google.com/
Cc: Andrew Morton <akpm@linux-foundation.org>
Cc: Jason Gunthorpe <jgg@nvidia.com>
Cc: Ralph Campbell <rcampbell@nvidia.com>
Cc: Christoph Hellwig <hch@lst.de>
Cc: Yang Shi <shy828301@gmail.com>
Cc: Kirill A. Shutemov <kirill.shutemov@linux.intel.com>
Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
3 years agomm/rmap: fix new bug: premature return from page_mlock_one()
Hugh Dickins [Wed, 7 Jul 2021 20:11:24 +0000 (13:11 -0700)]
mm/rmap: fix new bug: premature return from page_mlock_one()

In the unlikely race case that page_mlock_one() finds VM_LOCKED has been
cleared by the time it got page table lock, page_vma_mapped_walk_done()
must be called before returning, either explicitly, or by a final call
to page_vma_mapped_walk() - otherwise the page table remains locked.

Fixes: cd62734ca60d ("mm/rmap: split try_to_munlock from try_to_unmap")
Signed-off-by: Hugh Dickins <hughd@google.com>
Reviewed-by: Alistair Popple <apopple@nvidia.com>
Reviewed-by: Shakeel Butt <shakeelb@google.com>
Reported-by: kernel test robot <oliver.sang@intel.com>
Link: https://lore.kernel.org/lkml/20210711151446.GB4070@xsang-OptiPlex-9020/
Link: https://lore.kernel.org/lkml/f71f8523-cba7-3342-40a7-114abc5d1f51@google.com/
Cc: Andrew Morton <akpm@linux-foundation.org>
Cc: Jason Gunthorpe <jgg@nvidia.com>
Cc: Ralph Campbell <rcampbell@nvidia.com>
Cc: Christoph Hellwig <hch@lst.de>
Cc: Yang Shi <shy828301@gmail.com>
Cc: Kirill A. Shutemov <kirill.shutemov@linux.intel.com>
Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
3 years agomm/rmap: fix old bug: munlocking THP missed other mlocks
Hugh Dickins [Wed, 7 Jul 2021 20:08:53 +0000 (13:08 -0700)]
mm/rmap: fix old bug: munlocking THP missed other mlocks

The kernel recovers in due course from missing Mlocked pages: but there
was no point in calling page_mlock() (formerly known as
try_to_munlock()) on a THP, because nothing got done even when it was
found to be mapped in another VM_LOCKED vma.

It's true that we need to be careful: Mlocked accounting of pte-mapped
THPs is too difficult (so consistently avoided); but Mlocked accounting
of only-pmd-mapped THPs is supposed to work, even when multiple mappings
are mlocked and munlocked or munmapped.  Refine the tests.

There is already a VM_BUG_ON_PAGE(PageDoubleMap) in page_mlock(), so
page_mlock_one() does not even have to worry about that complication.

(I said the kernel recovers: but would page reclaim be likely to split
THP before rediscovering that it's VM_LOCKED? I've not followed that up)

Fixes: 9a73f61bdb8a ("thp, mlock: do not mlock PTE-mapped file huge pages")
Signed-off-by: Hugh Dickins <hughd@google.com>
Reviewed-by: Shakeel Butt <shakeelb@google.com>
Acked-by: Kirill A. Shutemov <kirill.shutemov@linux.intel.com>
Link: https://lore.kernel.org/lkml/cfa154c-d595-406-eb7d-eb9df730f944@google.com/
Cc: Andrew Morton <akpm@linux-foundation.org>
Cc: Alistair Popple <apopple@nvidia.com>
Cc: Jason Gunthorpe <jgg@nvidia.com>
Cc: Ralph Campbell <rcampbell@nvidia.com>
Cc: Christoph Hellwig <hch@lst.de>
Cc: Yang Shi <shy828301@gmail.com>
Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
3 years agomm/rmap: fix comments left over from recent changes
Hugh Dickins [Wed, 7 Jul 2021 20:06:17 +0000 (13:06 -0700)]
mm/rmap: fix comments left over from recent changes

Parallel developments in mm/rmap.c have left behind some out-of-date
comments: try_to_migrate_one() also accepts TTU_SYNC (already commented
in try_to_migrate() itself), and try_to_migrate() returns nothing at
all.

TTU_SPLIT_FREEZE has just been deleted, so reword the comment about it
in mm/huge_memory.c; and TTU_IGNORE_ACCESS was removed in 5.11, so
delete the "recently referenced" comment from try_to_unmap_one() (once
upon a time the comment was near the removed codeblock, but they drifted
apart).

Signed-off-by: Hugh Dickins <hughd@google.com>
Reviewed-by: Shakeel Butt <shakeelb@google.com>
Reviewed-by: Alistair Popple <apopple@nvidia.com>
Link: https://lore.kernel.org/lkml/563ce5b2-7a44-5b4d-1dfd-59a0e65932a9@google.com/
Cc: Andrew Morton <akpm@linux-foundation.org>
Cc: Jason Gunthorpe <jgg@nvidia.com>
Cc: Ralph Campbell <rcampbell@nvidia.com>
Cc: Christoph Hellwig <hch@lst.de>
Cc: Yang Shi <shy828301@gmail.com>
Cc: Kirill A. Shutemov <kirill.shutemov@linux.intel.com>
Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
3 years agoMerge tag 'irq-urgent-2021-07-11' of git://git.kernel.org/pub/scm/linux/kernel/git...
Linus Torvalds [Sun, 11 Jul 2021 18:17:57 +0000 (11:17 -0700)]
Merge tag 'irq-urgent-2021-07-11' of git://git./linux/kernel/git/tip/tip

Pull irq fixes from Ingo Molnar:
 "Two fixes:

   - Fix a MIPS IRQ handling RCU bug

   - Remove a DocBook annotation for a parameter that doesn't exist
     anymore"

* tag 'irq-urgent-2021-07-11' of git://git.kernel.org/pub/scm/linux/kernel/git/tip/tip:
  irqchip/mips: Fix RCU violation when using irqdomain lookup on interrupt entry
  genirq/irqdesc: Drop excess kernel-doc entry @lookup

3 years agoMerge tag 'sched-urgent-2021-07-11' of git://git.kernel.org/pub/scm/linux/kernel...
Linus Torvalds [Sun, 11 Jul 2021 18:13:57 +0000 (11:13 -0700)]
Merge tag 'sched-urgent-2021-07-11' of git://git./linux/kernel/git/tip/tip

Pull scheduler fixes from Ingo Molnar:
 "Three fixes:

   - Fix load tracking bug/inconsistency

   - Fix a sporadic CFS bandwidth constraints enforcement bug

   - Fix a uclamp utilization tracking bug for newly woken tasks"

* tag 'sched-urgent-2021-07-11' of git://git.kernel.org/pub/scm/linux/kernel/git/tip/tip:
  sched/uclamp: Ignore max aggregation if rq is idle
  sched/fair: Fix CFS bandwidth hrtimer expiry type
  sched/fair: Sync load_sum with load_avg after dequeue

3 years agoMerge tag 'perf-urgent-2021-07-11' of git://git.kernel.org/pub/scm/linux/kernel/git...
Linus Torvalds [Sun, 11 Jul 2021 18:10:48 +0000 (11:10 -0700)]
Merge tag 'perf-urgent-2021-07-11' of git://git./linux/kernel/git/tip/tip

Pull perf fixes from Ingo Molnar:
 "A fix and a hardware-enablement addition:

   - Robustify uncore_snbep's skx_iio_set_mapping()'s error cleanup

   - Add cstate event support for Intel ICELAKE_X and ICELAKE_D"

* tag 'perf-urgent-2021-07-11' of git://git.kernel.org/pub/scm/linux/kernel/git/tip/tip:
  perf/x86/intel/uncore: Clean up error handling path of iio mapping
  perf/x86/cstate: Add ICELAKE_X and ICELAKE_D support

3 years agoMerge tag 'locking-urgent-2021-07-11' of git://git.kernel.org/pub/scm/linux/kernel...
Linus Torvalds [Sun, 11 Jul 2021 18:06:09 +0000 (11:06 -0700)]
Merge tag 'locking-urgent-2021-07-11' of git://git./linux/kernel/git/tip/tip

Pull locking fixes from Ingo Molnar:

 - Fix a Sparc crash

 - Fix a number of objtool warnings

 - Fix /proc/lockdep output on certain configs

 - Restore a kprobes fail-safe

* tag 'locking-urgent-2021-07-11' of git://git.kernel.org/pub/scm/linux/kernel/git/tip/tip:
  locking/atomic: sparc: Fix arch_cmpxchg64_local()
  kprobe/static_call: Restore missing static_call_text_reserved()
  static_call: Fix static_call_text_reserved() vs __init
  jump_label: Fix jump_label_text_reserved() vs __init
  locking/lockdep: Fix meaningless /proc/lockdep output of lock classes on !CONFIG_PROVE_LOCKING