linux-2.6-microblaze.git
3 years agoASoC: mediatek: mt8192: move rt1015_rt5682 specific data
Tzung-Bi Shih [Tue, 1 Dec 2020 13:26:11 +0000 (21:26 +0800)]
ASoC: mediatek: mt8192: move rt1015_rt5682 specific data

Moves rt1015_rt5682 specific data right before the snd_soc_card
definition for neat purpose.

Signed-off-by: Tzung-Bi Shih <tzungbi@google.com>
Link: https://lore.kernel.org/r/20201201132614.1691352-4-tzungbi@google.com
Signed-off-by: Mark Brown <broonie@kernel.org>
3 years agoASoC: mediatek: mt8192: extract rt1015_rt5682 specific DAI link
Tzung-Bi Shih [Tue, 1 Dec 2020 13:26:10 +0000 (21:26 +0800)]
ASoC: mediatek: mt8192: extract rt1015_rt5682 specific DAI link

Extracts rt1015_rt5682 specific DAI link from the common one.  Fills the
DAI link data according to of_match.

Signed-off-by: Tzung-Bi Shih <tzungbi@google.com>
Link: https://lore.kernel.org/r/20201201132614.1691352-3-tzungbi@google.com
Signed-off-by: Mark Brown <broonie@kernel.org>
3 years agoASoC: mediatek: mt8192: rename common symbols
Tzung-Bi Shih [Tue, 1 Dec 2020 13:26:09 +0000 (21:26 +0800)]
ASoC: mediatek: mt8192: rename common symbols

Renames common symbols from "mt8192_mt6359_rt1015_rt5682" to
"mt8192_mt6359".

They will share between a few machine drivers on MT8192 and MT6359
with some different audio components.

Signed-off-by: Tzung-Bi Shih <tzungbi@google.com>
Link: https://lore.kernel.org/r/20201201132614.1691352-2-tzungbi@google.com
Signed-off-by: Mark Brown <broonie@kernel.org>
3 years agoMerge branch 'for-5.10' of https://git.kernel.org/pub/scm/linux/kernel/git/broonie...
Mark Brown [Mon, 30 Nov 2020 16:05:07 +0000 (16:05 +0000)]
Merge branch 'for-5.10' of https://git./linux/kernel/git/broonie/sound into asoc-5.11

3 years agoMerge series "ASoC: SOF: Intel: fix ICL boot sequence" from Kai Vehmanen <kai.vehmane...
Mark Brown [Mon, 30 Nov 2020 15:59:13 +0000 (15:59 +0000)]
Merge series "ASoC: SOF: Intel: fix ICL boot sequence" from Kai Vehmanen <kai.vehmanen@linux.intel.com>:

Series introducing a modified boot sequence for the Intel Ice Lake
platform. While no bugs are currently open for this, the current
DSP boot implementation does not follow the full programming sequence.

This patchset is the first instance where SOF driver uses data in
the extended manifest (part of the firmware binary), to influence
the boot process. IPC cannot be used to get this information, as it
is already needed for early boot.

This change is backwards compatible with old firmware versions,
where extended manifest is not available.

Fred Oh (5):
  ASoC: SOF: ops: add parse_platform_ext_manifest() op
  ASoC: SOF: Intel: hda: define parse_platform_ext_manifest op
  ASoC: SOF: ext_manifest: parse cavs extra config data elem
  ASoC: SOF: ops: modify the signature of stall op
  ASoC: SOF: Intel: hda: add sof_icl_ops for ICL platforms

 include/sound/sof/ext_manifest.h   |   1 +
 sound/soc/sof/intel/Makefile       |   2 +-
 sound/soc/sof/intel/apl.c          |   3 +
 sound/soc/sof/intel/cnl.c          |  19 +---
 sound/soc/sof/intel/ext_manifest.h |  35 +++++++
 sound/soc/sof/intel/hda-loader.c   | 100 ++++++++++++++++++++
 sound/soc/sof/intel/hda.h          |  11 +++
 sound/soc/sof/intel/icl.c          | 145 +++++++++++++++++++++++++++++
 sound/soc/sof/intel/tgl.c          |   3 +
 sound/soc/sof/loader.c             |   3 +
 sound/soc/sof/ops.h                |  14 ++-
 sound/soc/sof/sof-pci-dev.c        |   2 +-
 sound/soc/sof/sof-priv.h           |   7 +-
 13 files changed, 324 insertions(+), 21 deletions(-)
 create mode 100644 sound/soc/sof/intel/ext_manifest.h
 create mode 100644 sound/soc/sof/intel/icl.c

--
2.28.0

3 years agoMerge series "ASoC: tidyup for jack.h" from Kuninori Morimoto <kuninori.morimoto...
Mark Brown [Mon, 30 Nov 2020 15:59:12 +0000 (15:59 +0000)]
Merge series "ASoC: tidyup for jack.h" from Kuninori Morimoto <kuninori.morimoto.gx@renesas.com>:

Hi Mark

These are jack.h related tidyup.

Kuninori Morimoto (2):
  ASoC: soc-core: tidyup jack.h
  ASoC: add soc-jack.h

 include/sound/soc-jack.h    | 132 ++++++++++++++++++++++++++++++++++++
 include/sound/soc.h         | 122 +--------------------------------
 include/trace/events/asoc.h |   1 +
 sound/soc/soc-core.c        |   1 -
 4 files changed, 134 insertions(+), 122 deletions(-)
 create mode 100644 include/sound/soc-jack.h

--
2.25.1

3 years agoMerge series "ASoC: amd: Minor fixes for error handling" from Takashi Iwai <tiwai...
Mark Brown [Mon, 30 Nov 2020 15:59:10 +0000 (15:59 +0000)]
Merge series "ASoC: amd: Minor fixes for error handling" from Takashi Iwai <tiwai@suse.de>:

Hi,

this is a set of patches to address the errors appearing on the
machine that has no I2S DMIC on AMD machine but probed.

Takashi

===

Takashi Iwai (2):
  ASoC: amd: Downgrade print level for invalid ACP mode
  ASoC: amd: Return -ENODEV for non-existing ACPI call

 sound/soc/amd/raven/pci-acp3x.c     | 2 +-
 sound/soc/amd/renoir/rn-pci-acp3x.c | 2 +-
 2 files changed, 2 insertions(+), 2 deletions(-)

--
2.26.2

3 years agoASoC: Add ADAU1372 audio CODEC support
Lars-Peter Clausen [Fri, 27 Nov 2020 12:30:30 +0000 (13:30 +0100)]
ASoC: Add ADAU1372 audio CODEC support

Add support for the Analog Devices ADAU1372 audio CODEC.

[Alexandre Belloni: allow 32kHz for TDM4 in slave mode]

Signed-off-by: Lars-Peter Clausen <lars@metafoo.de>
Signed-off-by: Alexandre Belloni <alexandre.belloni@bootlin.com>
Link: https://lore.kernel.org/r/20201127123030.1610574-2-alexandre.belloni@bootlin.com
Signed-off-by: Mark Brown <broonie@kernel.org>
3 years agoASoC: adau1372: Add bindings documentation
Alexandre Belloni [Fri, 27 Nov 2020 12:30:29 +0000 (13:30 +0100)]
ASoC: adau1372: Add bindings documentation

Add device tree binding documentation for Analog Devices ADAU1372.

Signed-off-by: Alexandre Belloni <alexandre.belloni@bootlin.com>
Reviewed-by: Rob Herring <robh@kernel.org>
Link: https://lore.kernel.org/r/20201127123030.1610574-1-alexandre.belloni@bootlin.com
Signed-off-by: Mark Brown <broonie@kernel.org>
3 years agoASoC: add soc-jack.h
Kuninori Morimoto [Sun, 29 Nov 2020 23:45:26 +0000 (08:45 +0900)]
ASoC: add soc-jack.h

ALSA SoC has soc-jack.c, but doesn't have soc-jack.h.
This patch creates new soc-jack.h and moves snd_soc_jack_xxx()
from soc.h.

Signed-off-by: Kuninori Morimoto <kuninori.morimoto.gx@renesas.com>
Link: https://lore.kernel.org/r/87wny3u3zg.wl-kuninori.morimoto.gx@renesas.com
Signed-off-by: Mark Brown <broonie@kernel.org>
3 years agoASoC: soc-core: tidyup jack.h
Kuninori Morimoto [Sun, 29 Nov 2020 23:45:19 +0000 (08:45 +0900)]
ASoC: soc-core: tidyup jack.h

soc-core.c don't need sound/jack.h anymore, but asoc.h needs it.
This patch fixup header magic.

Signed-off-by: Kuninori Morimoto <kuninori.morimoto.gx@renesas.com>
Link: https://lore.kernel.org/r/87y2iju3zm.wl-kuninori.morimoto.gx@renesas.com
Signed-off-by: Mark Brown <broonie@kernel.org>
3 years agoASoC: mediatek: btcvsd fix tx stream assign
Lumi Lee [Mon, 30 Nov 2020 03:11:15 +0000 (11:11 +0800)]
ASoC: mediatek: btcvsd fix tx stream assign

Fix tx/rx stream assign in write.
Write should use tx instead of rx.

Signed-off-by: Lumi Lee <lumi.lee@mediatek.com>
Link: https://lore.kernel.org/r/1606705875-1940-1-git-send-email-Lumi.Lee@mediatek.com
Signed-off-by: Mark Brown <broonie@kernel.org>
3 years agoASoC: amd: Return -ENODEV for non-existing ACPI call
Takashi Iwai [Fri, 27 Nov 2020 14:31:59 +0000 (15:31 +0100)]
ASoC: amd: Return -ENODEV for non-existing ACPI call

AMD Renoir driver tries to identify the presence of DMIC by evaluating
ACPI _WOV entry, and it returns -EINVAL when the ACPI call failed.
This ended up an error message like
  snd_rn_pci_acp3x: probe of 0000:04:00.5 failed with error -22
although the system is correctly set up.

For avoiding such a superfluous error message, change the return value
to -ENODEV.  Then the driver core just skips to the next one without
complaining.

Signed-off-by: Takashi Iwai <tiwai@suse.de>
Link: https://lore.kernel.org/r/20201127143200.16272-3-tiwai@suse.de
Signed-off-by: Mark Brown <broonie@kernel.org>
3 years agoASoC: amd: Downgrade print level for invalid ACP mode
Takashi Iwai [Fri, 27 Nov 2020 14:31:58 +0000 (15:31 +0100)]
ASoC: amd: Downgrade print level for invalid ACP mode

The acp3x raven driver skips the probing when the given device isn't
connected with I2S.  This skip behavior itself is fine, but the driver
also emits an error message "Invalid ACP audio mode" with KERN_ERR.
This isn't nice since it appears on the boot screen even if a boot
splash is running, although this itself is no real error.

Downgrade the print level to KERN_INFO so that this message won't
appear on the console unnecessarily.

Signed-off-by: Takashi Iwai <tiwai@suse.de>
Link: https://lore.kernel.org/r/20201127143200.16272-2-tiwai@suse.de
Signed-off-by: Mark Brown <broonie@kernel.org>
3 years agoASoC: SOF: Intel: hda: add sof_icl_ops for ICL platforms
Fred Oh [Fri, 27 Nov 2020 16:40:22 +0000 (18:40 +0200)]
ASoC: SOF: Intel: hda: add sof_icl_ops for ICL platforms

Separate the dsp ops for ICL ops to specify the use of ICCMAX
FW boot sequence in the run op. All other ops are identical with TGL
except post_fw_run. The recommended HW programming sequence for ICL
is to power up core 3 and keep it in stall if HPRO is enabled.

Signed-off-by: Fred Oh <fred.oh@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/20201127164022.2498406-6-kai.vehmanen@linux.intel.com
Signed-off-by: Mark Brown <broonie@kernel.org>
3 years agoASoC: SOF: ops: modify the signature of stall op
Fred Oh [Fri, 27 Nov 2020 16:40:21 +0000 (18:40 +0200)]
ASoC: SOF: ops: modify the signature of stall op

Modify the signature of stall op to specify core_mask to stall cores.

Signed-off-by: Fred Oh <fred.oh@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/20201127164022.2498406-5-kai.vehmanen@linux.intel.com
Signed-off-by: Mark Brown <broonie@kernel.org>
3 years agoASoC: SOF: ext_manifest: parse cavs extra config data elem
Fred Oh [Fri, 27 Nov 2020 16:40:20 +0000 (18:40 +0200)]
ASoC: SOF: ext_manifest: parse cavs extra config data elem

OUTBOX_SIZE, INBOX_SIZE are defined but not being used yet. Handle
these elements to avoid warning about unknown token type.

Signed-off-by: Fred Oh <fred.oh@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/20201127164022.2498406-4-kai.vehmanen@linux.intel.com
Signed-off-by: Mark Brown <broonie@kernel.org>
3 years agoASoC: SOF: Intel: hda: define parse_platform_ext_manifest op
Fred Oh [Fri, 27 Nov 2020 16:40:19 +0000 (18:40 +0200)]
ASoC: SOF: Intel: hda: define parse_platform_ext_manifest op

Define the parse_platform_ext_manifest() op for HDA platforms to parse
the SOF_EXT_MAN_CAVS_CONFIG_CAVS_LPRO config item to determine if the FW
is configured for LPRO. The default clock configuration is assumed to be
HPRO in the absence of this item in the extended manifest.
New member clk_config_lpro is added to struct sof_intel_hda_dev to store
the FW clock config information and that this will be used later to perform
platform-specific operations in the post_fw_run op.

Signed-off-by: Fred Oh <fred.oh@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/20201127164022.2498406-3-kai.vehmanen@linux.intel.com
Signed-off-by: Mark Brown <broonie@kernel.org>
3 years agoASoC: SOF: ops: add parse_platform_ext_manifest() op
Fred Oh [Fri, 27 Nov 2020 16:40:18 +0000 (18:40 +0200)]
ASoC: SOF: ops: add parse_platform_ext_manifest() op

Add parse_platform_ext_manifest() op to parse platform-specific config
data in the extended manifest.

Signed-off-by: Fred Oh <fred.oh@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/20201127164022.2498406-2-kai.vehmanen@linux.intel.com
Signed-off-by: Mark Brown <broonie@kernel.org>
3 years agoASoC: qcom: sc7180: fix 32 bit format for adau7002
xuyuqing [Wed, 18 Nov 2020 00:58:58 +0000 (08:58 +0800)]
ASoC: qcom: sc7180: fix 32 bit format for adau7002

the microphone is attached to external codec(adau7002)
instead of rt5682.We need to always use 32 bit format on sc7180
to meet the clock requirement of adau7002:
The ADAU7002 requires a BCLK rate
that is a minimum of 64× the LRCLK sample rate

Signed-off-by: xuyuqing <xuyuqing@huaqin.corp-partner.google.com>
Link: https://lore.kernel.org/r/20201118005858.123013-2-xuyuqing@huaqin.corp-partner.google.com
Signed-off-by: Mark Brown <broonie@kernel.org>
3 years agoASoC: soc-core: add soc_dapm_suspend_resume()
Kuninori Morimoto [Fri, 27 Nov 2020 00:07:40 +0000 (09:07 +0900)]
ASoC: soc-core: add soc_dapm_suspend_resume()

snd_soc_suspend() and soc_resume_deferred() are calling
same snd_soc_dapm_stream_event() with same logic with different parameter.
This patch adds new soc_dapm_suspend_resume() and share the code.

Signed-off-by: Kuninori Morimoto <kuninori.morimoto.gx@renesas.com>
Link: https://lore.kernel.org/r/87im9rekfp.wl-kuninori.morimoto.gx@renesas.com
Signed-off-by: Mark Brown <broonie@kernel.org>
3 years agoASoC: soc-core: add soc_playback_digital_mute()
Kuninori Morimoto [Fri, 27 Nov 2020 00:07:35 +0000 (09:07 +0900)]
ASoC: soc-core: add soc_playback_digital_mute()

snd_soc_suspend() and soc_resume_deferred() are calling
same snd_soc_dai_digital_mute() with same logic with different parameter.
This patch adds new soc_playback_digital_mute() and share the code.

Signed-off-by: Kuninori Morimoto <kuninori.morimoto.gx@renesas.com>
Link: https://lore.kernel.org/r/87k0u7ekfv.wl-kuninori.morimoto.gx@renesas.com
Signed-off-by: Mark Brown <broonie@kernel.org>
3 years agoMerge series "ASoC: merge soc_compr_open() rollback and soc_compr_free()" from Kunino...
Mark Brown [Thu, 26 Nov 2020 20:03:01 +0000 (20:03 +0000)]
Merge series "ASoC: merge soc_compr_open() rollback and soc_compr_free()" from Kuninori Morimoto <kuninori.morimoto.gx@renesas.com>:

Hi Mark

soc_compr_open() does rollback when failed (A),
but, it is almost same as soc_compr_free().

static int soc_compr_open(xxx)
{
...
if (ret < 0)
goto xxx_err;
...
return 0;

 ^ machine_err:
 | ...
 | out:
(A) ...
 | pm_err:
 | ...
 v return ret;
}

This kind of duplicated code can be a hotbed of bugs,
thus, this patch-set share soc_compr_free() and rollback.

Kuninori Morimoto (5):
  ASoC: soc-compress: move soc_compr_free() next to soc_compr_open()
  ASoC: soc-dai: add mark for snd_soc_dai_compr_startup/shutdown()
  ASoC: soc-component: add mark for snd_soc_component_compr_open/free()
  ASoC: soc-component: add mark for snd_soc_link_compr_startup/shutdown()
  ASoC: soc-compress: add soc_compr_clean() and call it from soc_compr_open/free()

 include/sound/soc-component.h |   6 +-
 include/sound/soc-dai.h       |   4 +-
 include/sound/soc-link.h      |   3 +-
 include/sound/soc.h           |   1 +
 sound/soc/soc-component.c     |  17 +++--
 sound/soc/soc-compress.c      | 115 +++++++++++++++++-----------------
 sound/soc/soc-dai.c           |  13 +++-
 sound/soc/soc-link.c          |  11 +++-
 8 files changed, 95 insertions(+), 75 deletions(-)

--
2.25.1

3 years agoMerge series "ASoC: fix !OF compile test warnings" from Krzysztof Kozlowski <krzk...
Mark Brown [Thu, 26 Nov 2020 20:03:00 +0000 (20:03 +0000)]
Merge series "ASoC: fix !OF compile test warnings" from Krzysztof Kozlowski <krzk@>:

Hi,

Changes since v1:
1. New patch 2/39: ASoC: bd28623: mark OF related data as maybe unused,
2. Patches 1-13: add maybe_unused after discussions with Mark,
3. Add Sylwester's review to two patches (one changed so please review
   one more time).

Best regards,
Krzysztof

Krzysztof Kozlowski (39):
  ASoC: ak5558: mark OF related data as maybe unused
  ASoC: bd28623: mark OF related data as maybe unused
  ASoC: gtm601: mark OF related data as maybe unused
  ASoC: inno_rk3036: mark OF related data as maybe unused
  ASoC: rk3328: mark OF related data as maybe unused
  ASoC: tas571x: mark OF related data as maybe unused
  ASoC: kirkwood: armada-370-db: mark OF related data as maybe unused
  ASoC: meson: t9015: mark OF related data as maybe unused
  ASoC: qcom: mark OF related data as maybe unused
  ASoC: samsung: smdk_wm8994: mark OF related data as maybe unused
  ASoC: rockchip: mark OF related data as maybe unused
  ASoC: ti: davinci: mark OF related data as maybe unused
  ASoC: uniphier: mark OF related data as maybe unused
  ASoC: ak4118: skip of_device_id table when !CONFIG_OF
  ASoC: alc5623: skip of_device_id table when !CONFIG_OF
  ASoC: alc5632: skip of_device_id table when !CONFIG_OF
  ASoC: da7218: skip of_device_id table when !CONFIG_OF
  ASoC: da7219: skip of_device_id table when !CONFIG_OF
  ASoC: da9055: skip of_device_id table when !CONFIG_OF
  ASoC: es8316: skip of_device_id table when !CONFIG_OF
  ASoC: max98090: skip of_device_id table when !CONFIG_OF
  ASoC: max98095: skip of_device_id table when !CONFIG_OF
  ASoC: max98371: skip of_device_id table when !CONFIG_OF
  ASoC: max9867: skip of_device_id table when !CONFIG_OF
  ASoC: max98925: skip of_device_id table when !CONFIG_OF
  ASoC: max98926: skip of_device_id table when !CONFIG_OF
  ASoC: pcm1789: skip of_device_id table when !CONFIG_OF
  ASoC: pcm179x: skip of_device_id table when !CONFIG_OF
  ASoC: rt5660: skip of_device_id table when !CONFIG_OF
  ASoC: tas2562: skip of_device_id table when !CONFIG_OF
  ASoC: tlv320: skip of_device_id table when !CONFIG_OF
  ASoC: ts3a227e: skip of_device_id table when !CONFIG_OF
  ASoC: es7134: mark OF related data as maybe unused
  ASoC: es7241: mark OF related data as maybe unused
  ASoC: samsung: i2s: mark OF related data as maybe unused
  ASoC: max98371: drop driver pm=NULL assignment
  ASoC: max98925: drop driver pm=NULL assignment
  ASoC: max98926: drop driver pm=NULL assignment
  ASoC: samsung: smdk_wm8994: remove redundant of_match_ptr()

 sound/soc/codecs/ak4118.c           | 2 ++
 sound/soc/codecs/ak5558.c           | 2 +-
 sound/soc/codecs/alc5623.c          | 2 ++
 sound/soc/codecs/alc5632.c          | 2 ++
 sound/soc/codecs/bd28623.c          | 2 +-
 sound/soc/codecs/da7218.c           | 2 ++
 sound/soc/codecs/da7219.c           | 2 ++
 sound/soc/codecs/da9055.c           | 2 ++
 sound/soc/codecs/es7134.c           | 4 ++--
 sound/soc/codecs/es7241.c           | 2 +-
 sound/soc/codecs/es8316.c           | 2 ++
 sound/soc/codecs/gtm601.c           | 2 +-
 sound/soc/codecs/inno_rk3036.c      | 2 +-
 sound/soc/codecs/max98090.c         | 2 ++
 sound/soc/codecs/max98095.c         | 2 ++
 sound/soc/codecs/max98371.c         | 3 ++-
 sound/soc/codecs/max9867.c          | 2 ++
 sound/soc/codecs/max98925.c         | 3 ++-
 sound/soc/codecs/max98926.c         | 3 ++-
 sound/soc/codecs/pcm1789-i2c.c      | 2 ++
 sound/soc/codecs/pcm179x-i2c.c      | 2 ++
 sound/soc/codecs/rk3328_codec.c     | 2 +-
 sound/soc/codecs/rt5660.c           | 2 ++
 sound/soc/codecs/tas2562.c          | 2 ++
 sound/soc/codecs/tas571x.c          | 4 ++--
 sound/soc/codecs/tlv320adcx140.c    | 2 ++
 sound/soc/codecs/tlv320aic23-i2c.c  | 2 ++
 sound/soc/codecs/ts3a227e.c         | 2 ++
 sound/soc/kirkwood/armada-370-db.c  | 2 +-
 sound/soc/meson/t9015.c             | 2 +-
 sound/soc/qcom/apq8016_sbc.c        | 2 +-
 sound/soc/qcom/lpass-apq8016.c      | 2 +-
 sound/soc/qcom/lpass-ipq806x.c      | 2 +-
 sound/soc/qcom/lpass-sc7180.c       | 2 +-
 sound/soc/rockchip/rockchip_i2s.c   | 2 +-
 sound/soc/rockchip/rockchip_pdm.c   | 2 +-
 sound/soc/rockchip/rockchip_spdif.c | 2 +-
 sound/soc/samsung/i2s.c             | 8 ++++----
 sound/soc/samsung/smdk_wm8994.c     | 4 ++--
 sound/soc/ti/davinci-i2s.c          | 2 +-
 sound/soc/uniphier/aio-ld11.c       | 2 +-
 sound/soc/uniphier/aio-pxs2.c       | 2 +-
 sound/soc/uniphier/evea.c           | 2 +-
 43 files changed, 69 insertions(+), 32 deletions(-)

--
2.25.1

3 years agoASoC: soc-compress: add soc_compr_clean() and call it from soc_compr_open/free()
Kuninori Morimoto [Wed, 18 Nov 2020 23:50:19 +0000 (08:50 +0900)]
ASoC: soc-compress: add soc_compr_clean() and call it from soc_compr_open/free()

soc_compr_open() does rollback when failed (A),
but, it is almost same as soc_compr_free().

static int soc_compr_open(xxx)
{
...
if (ret < 0)
goto xxx_err;
...
return 0;

 ^ machine_err:
 | ...
 | out:
(A) ...
 | pm_err:
 | ...
 v return ret;
}

The difference is
soc_compr_free()  is for all dai/component/substream,
rollback          is for succeeded part only.

This kind of duplicated code can be a hotbed of bugs,
thus, we want to share soc_compr_free() and rollback.

Now, soc_compr_open/free() are handling
1) snd_soc_dai_compr_startup/shutdown()
2) snd_soc_component_compr_open/free()
3) snd_soc_link_compr_startup/shutdown()

Now, 1) to 3) are handled.
This patch adds new soc_compr_clean() and call it from
soc_compr_open() as rollback, and from soc_compr_free_free() as
normal close handler.

Signed-off-by: Kuninori Morimoto <kuninori.morimoto.gx@renesas.com>
Link: https://lore.kernel.org/r/87ima25iwa.wl-kuninori.morimoto.gx@renesas.com
Signed-off-by: Mark Brown <broonie@kernel.org>
3 years agoASoC: soc-component: add mark for snd_soc_link_compr_startup/shutdown()
Kuninori Morimoto [Wed, 18 Nov 2020 23:50:14 +0000 (08:50 +0900)]
ASoC: soc-component: add mark for snd_soc_link_compr_startup/shutdown()

soc_compr_open() does rollback when failed (A),
but, it is almost same as soc_compr_free().

static int soc_compr_open(xxx)
{
...
if (ret < 0)
goto xxx_err;
...
return 0;

 ^ machine_err:
 | ...
 | out:
(A) ...
 | pm_err:
 | ...
 v return ret;
}

The difference is
soc_compr_free()  is for all dai/component/substream,
rollback          is for succeeded part only.

This kind of duplicated code can be a hotbed of bugs,
thus, we want to share soc_compr_free() and rollback.
1) snd_soc_dai_compr_startup/shutdown()
2) snd_soc_component_compr_open/free()
=> 3) snd_soc_link_compr_startup/shutdown()

This patch is for 3) snd_soc_link_compr_startup/shutdown()
and adds new cstream mark.
It will mark cstream when startup() was suceeded.
If rollback happen *after* that, it will check rollback flag
and marked cstream.

It cares *previous* startup() only now,
but we might want to check *whole* marked cstream in the future.
This patch is using macro so that it can be easily adjust to it.

Signed-off-by: Kuninori Morimoto <kuninori.morimoto.gx@renesas.com>
Link: https://lore.kernel.org/r/87k0ui5iwf.wl-kuninori.morimoto.gx@renesas.com
Signed-off-by: Mark Brown <broonie@kernel.org>
3 years agoASoC: soc-component: add mark for snd_soc_component_compr_open/free()
Kuninori Morimoto [Wed, 18 Nov 2020 23:50:09 +0000 (08:50 +0900)]
ASoC: soc-component: add mark for snd_soc_component_compr_open/free()

soc_compr_open() does rollback when failed (A),
but, it is almost same as soc_compr_free().

static int soc_compr_open(xxx)
{
...
if (ret < 0)
goto xxx_err;
...
return 0;

 ^ machine_err:
 | ...
 | out:
(A) ...
 | pm_err:
 | ...
 v return ret;
}

The difference is
soc_compr_free()  is for all dai/component/substream,
rollback          is for succeeded part only.

This kind of duplicated code can be a hotbed of bugs,
thus, we want to share soc_compr_free() and rollback.
1) snd_soc_dai_compr_startup/shutdown()
=> 2) snd_soc_component_compr_open/free()
3) snd_soc_link_compr_startup/shutdown()

This patch is for 2) snd_soc_component_compr_open/free(),
and adds new cstream mark.
It will mark cstream when startup() was suceeded.
If rollback happen *after* that, it will check rollback flag
and marked cstream.

It cares *previous* startup() only now,
but we might want to check *whole* marked cstream in the future.
This patch is using macro so that it can be easily adjust to it.

Signed-off-by: Kuninori Morimoto <kuninori.morimoto.gx@renesas.com>
Link: https://lore.kernel.org/r/87lfey5iwk.wl-kuninori.morimoto.gx@renesas.com
Signed-off-by: Mark Brown <broonie@kernel.org>
3 years agoASoC: soc-dai: add mark for snd_soc_dai_compr_startup/shutdown()
Kuninori Morimoto [Wed, 18 Nov 2020 23:50:04 +0000 (08:50 +0900)]
ASoC: soc-dai: add mark for snd_soc_dai_compr_startup/shutdown()

soc_compr_open() does rollback when failed (A),
but, it is almost same as soc_compr_free().

static int soc_compr_open(xxx)
{
...
if (ret < 0)
goto xxx_err;
...
return 0;

 ^ machine_err:
 | ...
 | out:
(A) ...
 | pm_err:
 | ...
 v return ret;
}

The difference is
soc_compr_free()  is for all dai/component/substream,
rollback          is for succeeded part only.

This kind of duplicated code can be a hotbed of bugs,
thus, we want to share soc_compr_free() and rollback.
=> 1) snd_soc_dai_compr_startup/shutdown()
2) snd_soc_component_compr_open/free()
3) snd_soc_link_compr_startup/shutdown()

This patch is for 1) snd_soc_dai_compr_startup/shutdown(),
and adds new cstream mark.
It will mark cstream when startup() was suceeded.
If rollback happen *after* that, it will check rollback flag
and marked cstream.

It cares *previous* startup() only now,
but we might want to check *whole* marked cstream in the future.
This patch is using macro so that it can be easily adjust to it.

Signed-off-by: Kuninori Morimoto <kuninori.morimoto.gx@renesas.com>
Link: https://lore.kernel.org/r/87mtze5iwp.wl-kuninori.morimoto.gx@renesas.com
Signed-off-by: Mark Brown <broonie@kernel.org>
3 years agoASoC: soc-compress: move soc_compr_free() next to soc_compr_open()
Kuninori Morimoto [Wed, 18 Nov 2020 23:49:57 +0000 (08:49 +0900)]
ASoC: soc-compress: move soc_compr_free() next to soc_compr_open()

This patch moves soc_compr_free() next to soc_compr_open().
This is prepare for soc_compr_open() cleanup.

Signed-off-by: Kuninori Morimoto <kuninori.morimoto.gx@renesas.com>
Link: https://lore.kernel.org/r/87o8ju5iwv.wl-kuninori.morimoto.gx@renesas.com
Signed-off-by: Mark Brown <broonie@kernel.org>
3 years agoASoC: fsl: Fix config name of CONFIG_ARCH_MXC
Shengjiu Wang [Thu, 26 Nov 2020 06:14:53 +0000 (14:14 +0800)]
ASoC: fsl: Fix config name of CONFIG_ARCH_MXC

CONFIG_ARCH_MXC should be ARCH_MXC

Fixes: 674226db62ec ("ASoC: fsl: SND_SOC_FSL_AUD2HTX should depend on ARCH_MXC")
Signed-off-by: Shengjiu Wang <shengjiu.wang@nxp.com>
Link: https://lore.kernel.org/r/1606371293-29099-1-git-send-email-shengjiu.wang@nxp.com
Signed-off-by: Mark Brown <broonie@kernel.org>
3 years agoASoC: hdmi-codec: Add RX support
Shengjiu Wang [Thu, 26 Nov 2020 06:36:48 +0000 (14:36 +0800)]
ASoC: hdmi-codec: Add RX support

HDMI interface can also be used as receiver, this patch is to
add such support. The most difference compare with TX is that RX
don't need to get edid information.

Signed-off-by: Shengjiu Wang <shengjiu.wang@nxp.com>
Link: https://lore.kernel.org/r/1606372608-2329-1-git-send-email-shengjiu.wang@nxp.com
Signed-off-by: Mark Brown <broonie@kernel.org>
3 years agoASoC: samsung: smdk_wm8994: remove redundant of_match_ptr()
Krzysztof Kozlowski [Wed, 25 Nov 2020 16:44:52 +0000 (17:44 +0100)]
ASoC: samsung: smdk_wm8994: remove redundant of_match_ptr()

of_match_device() already handles properly !CONFIG_OF case, so passing
the argument via of_match_ptr() is not needed.

Signed-off-by: Krzysztof Kozlowski <krzk@kernel.org>
Reviewed-by: Sylwester Nawrocki <snawrocki@kernel.org>
Link: https://lore.kernel.org/r/20201125164452.89239-40-krzk@kernel.org
Signed-off-by: Mark Brown <broonie@kernel.org>
3 years agoASoC: max98926: drop driver pm=NULL assignment
Krzysztof Kozlowski [Wed, 25 Nov 2020 16:44:51 +0000 (17:44 +0100)]
ASoC: max98926: drop driver pm=NULL assignment

There is no point to explicitly set driver .pm field to NULL.

Signed-off-by: Krzysztof Kozlowski <krzk@kernel.org>
Link: https://lore.kernel.org/r/20201125164452.89239-39-krzk@kernel.org
Signed-off-by: Mark Brown <broonie@kernel.org>
3 years agoASoC: max98925: drop driver pm=NULL assignment
Krzysztof Kozlowski [Wed, 25 Nov 2020 16:44:50 +0000 (17:44 +0100)]
ASoC: max98925: drop driver pm=NULL assignment

There is no point to explicitly set driver .pm field to NULL.

Signed-off-by: Krzysztof Kozlowski <krzk@kernel.org>
Link: https://lore.kernel.org/r/20201125164452.89239-38-krzk@kernel.org
Signed-off-by: Mark Brown <broonie@kernel.org>
3 years agoASoC: max98371: drop driver pm=NULL assignment
Krzysztof Kozlowski [Wed, 25 Nov 2020 16:44:49 +0000 (17:44 +0100)]
ASoC: max98371: drop driver pm=NULL assignment

There is no point to explicitly set driver .pm field to NULL.

Signed-off-by: Krzysztof Kozlowski <krzk@kernel.org>
Link: https://lore.kernel.org/r/20201125164452.89239-37-krzk@kernel.org
Signed-off-by: Mark Brown <broonie@kernel.org>
3 years agoASoC: samsung: i2s: mark OF related data as maybe unused
Krzysztof Kozlowski [Wed, 25 Nov 2020 16:44:48 +0000 (17:44 +0100)]
ASoC: samsung: i2s: mark OF related data as maybe unused

The driver can be compile tested with !CONFIG_OF making certain data
unused:

  sound/soc/samsung/i2s.c:1646:42: warning: ‘i2sv5_dai_type_i2s1’ defined but not used [-Wunused-const-variable=]
  sound/soc/samsung/i2s.c:1639:42: warning: ‘i2sv7_dai_type’ defined but not used [-Wunused-const-variable=]

Signed-off-by: Krzysztof Kozlowski <krzk@kernel.org>
Reviewed-by: Sylwester Nawrocki <snawrocki@kernel.org>
Link: https://lore.kernel.org/r/20201125164452.89239-36-krzk@kernel.org
Signed-off-by: Mark Brown <broonie@kernel.org>
3 years agoASoC: es7241: mark OF related data as maybe unused
Krzysztof Kozlowski [Wed, 25 Nov 2020 16:44:47 +0000 (17:44 +0100)]
ASoC: es7241: mark OF related data as maybe unused

The driver can be compile tested with !CONFIG_OF making certain data
unused:

  sound/soc/codecs/es7241.c:206:33: warning: ‘es7241_chip’ defined but not used [-Wunused-const-variable=]

Signed-off-by: Krzysztof Kozlowski <krzk@kernel.org>
Link: https://lore.kernel.org/r/20201125164452.89239-35-krzk@kernel.org
Signed-off-by: Mark Brown <broonie@kernel.org>
3 years agoASoC: es7134: mark OF related data as maybe unused
Krzysztof Kozlowski [Wed, 25 Nov 2020 16:44:46 +0000 (17:44 +0100)]
ASoC: es7134: mark OF related data as maybe unused

The driver can be compile tested with !CONFIG_OF making certain data
unused:

  sound/soc/codecs/es7134.c:264:33: warning: ‘es7154_chip’ defined but not used [-Wunused-const-variable=]

Signed-off-by: Krzysztof Kozlowski <krzk@kernel.org>
Link: https://lore.kernel.org/r/20201125164452.89239-34-krzk@kernel.org
Signed-off-by: Mark Brown <broonie@kernel.org>
3 years agoASoC: ts3a227e: skip of_device_id table when !CONFIG_OF
Krzysztof Kozlowski [Wed, 25 Nov 2020 16:44:45 +0000 (17:44 +0100)]
ASoC: ts3a227e: skip of_device_id table when !CONFIG_OF

The driver can match by multiple methods.  Its of_device_id table is
referenced via of_match_ptr() so it will be unused for !CONFIG_OF
builds:

  sound/soc/codecs/ts3a227e.c:369:34: warning: ‘ts3a227e_of_match’ defined but not used [-Wunused-const-variable=]

Signed-off-by: Krzysztof Kozlowski <krzk@kernel.org>
Link: https://lore.kernel.org/r/20201125164452.89239-33-krzk@kernel.org
Signed-off-by: Mark Brown <broonie@kernel.org>
3 years agoASoC: tlv320: skip of_device_id table when !CONFIG_OF
Krzysztof Kozlowski [Wed, 25 Nov 2020 16:44:44 +0000 (17:44 +0100)]
ASoC: tlv320: skip of_device_id table when !CONFIG_OF

The driver can match by multiple methods.  Its of_device_id table is
referenced via of_match_ptr() so it will be unused for !CONFIG_OF
builds:

  sound/soc/codecs/tlv320aic23-i2c.c:38:34: warning: ‘tlv320aic23_of_match’ defined but not used [-Wunused-const-variable=]
  sound/soc/codecs/tlv320adcx140.c:1076:34: warning: ‘tlv320adcx140_of_match’ defined but not used [-Wunused-const-variable=]

Signed-off-by: Krzysztof Kozlowski <krzk@kernel.org>
Link: https://lore.kernel.org/r/20201125164452.89239-32-krzk@kernel.org
Signed-off-by: Mark Brown <broonie@kernel.org>
3 years agoASoC: tas2562: skip of_device_id table when !CONFIG_OF
Krzysztof Kozlowski [Wed, 25 Nov 2020 16:44:43 +0000 (17:44 +0100)]
ASoC: tas2562: skip of_device_id table when !CONFIG_OF

The driver can match by multiple methods.  Its of_device_id table is
referenced via of_match_ptr() so it will be unused for !CONFIG_OF
builds:

  sound/soc/codecs/tas2562.c:805:34: warning: ‘tas2562_of_match’ defined but not used [-Wunused-const-variable=]

Signed-off-by: Krzysztof Kozlowski <krzk@kernel.org>
Link: https://lore.kernel.org/r/20201125164452.89239-31-krzk@kernel.org
Signed-off-by: Mark Brown <broonie@kernel.org>
3 years agoASoC: rt5660: skip of_device_id table when !CONFIG_OF
Krzysztof Kozlowski [Wed, 25 Nov 2020 16:44:42 +0000 (17:44 +0100)]
ASoC: rt5660: skip of_device_id table when !CONFIG_OF

The driver can match by multiple methods.  Its of_device_id table is
referenced via of_match_ptr() so it will be unused for !CONFIG_OF
builds:

  sound/soc/codecs/rt5660.c:1238:34: warning: ‘rt5660_of_match’ defined but not used [-Wunused-const-variable=]

Signed-off-by: Krzysztof Kozlowski <krzk@kernel.org>
Link: https://lore.kernel.org/r/20201125164452.89239-30-krzk@kernel.org
Signed-off-by: Mark Brown <broonie@kernel.org>
3 years agoASoC: pcm179x: skip of_device_id table when !CONFIG_OF
Krzysztof Kozlowski [Wed, 25 Nov 2020 16:44:41 +0000 (17:44 +0100)]
ASoC: pcm179x: skip of_device_id table when !CONFIG_OF

The driver can match by multiple methods.  Its of_device_id table is
referenced via of_match_ptr() so it will be unused for !CONFIG_OF
builds:

  sound/soc/codecs/pcm179x-i2c.c:33:34: warning: ‘pcm179x_of_match’ defined but not used [-Wunused-const-variable=]

Signed-off-by: Krzysztof Kozlowski <krzk@kernel.org>
Link: https://lore.kernel.org/r/20201125164452.89239-29-krzk@kernel.org
Signed-off-by: Mark Brown <broonie@kernel.org>
3 years agoASoC: pcm1789: skip of_device_id table when !CONFIG_OF
Krzysztof Kozlowski [Wed, 25 Nov 2020 16:44:40 +0000 (17:44 +0100)]
ASoC: pcm1789: skip of_device_id table when !CONFIG_OF

The driver can match by multiple methods.  Its of_device_id table is
referenced via of_match_ptr() so it will be unused for !CONFIG_OF
builds:

  sound/soc/codecs/pcm1789-i2c.c:36:34: warning: ‘pcm1789_of_match’ defined but not used [-Wunused-const-variable=]

Signed-off-by: Krzysztof Kozlowski <krzk@kernel.org>
Link: https://lore.kernel.org/r/20201125164452.89239-28-krzk@kernel.org
Signed-off-by: Mark Brown <broonie@kernel.org>
3 years agoASoC: max98926: skip of_device_id table when !CONFIG_OF
Krzysztof Kozlowski [Wed, 25 Nov 2020 16:44:39 +0000 (17:44 +0100)]
ASoC: max98926: skip of_device_id table when !CONFIG_OF

The driver can match by multiple methods.  Its of_device_id table is
referenced via of_match_ptr() so it will be unused for !CONFIG_OF
builds:

  sound/soc/codecs/max98926.c:574:34: warning: ‘max98926_of_match’ defined but not used [-Wunused-const-variable=]

Signed-off-by: Krzysztof Kozlowski <krzk@kernel.org>
Link: https://lore.kernel.org/r/20201125164452.89239-27-krzk@kernel.org
Signed-off-by: Mark Brown <broonie@kernel.org>
3 years agoASoC: max98925: skip of_device_id table when !CONFIG_OF
Krzysztof Kozlowski [Wed, 25 Nov 2020 16:44:38 +0000 (17:44 +0100)]
ASoC: max98925: skip of_device_id table when !CONFIG_OF

The driver can match by multiple methods.  Its of_device_id table is
referenced via of_match_ptr() so it will be unused for !CONFIG_OF
builds:

  sound/soc/codecs/max98925.c:630:34: warning: ‘max98925_of_match’ defined but not used [-Wunused-const-variable=]

Signed-off-by: Krzysztof Kozlowski <krzk@kernel.org>
Link: https://lore.kernel.org/r/20201125164452.89239-26-krzk@kernel.org
Signed-off-by: Mark Brown <broonie@kernel.org>
3 years agoASoC: max9867: skip of_device_id table when !CONFIG_OF
Krzysztof Kozlowski [Wed, 25 Nov 2020 16:44:37 +0000 (17:44 +0100)]
ASoC: max9867: skip of_device_id table when !CONFIG_OF

The driver can match by multiple methods.  Its of_device_id table is
referenced via of_match_ptr() so it will be unused for !CONFIG_OF
builds:

  sound/soc/codecs/max9867.c:652:34: warning: ‘max9867_of_match’ defined but not used [-Wunused-const-variable=]

Signed-off-by: Krzysztof Kozlowski <krzk@kernel.org>
Link: https://lore.kernel.org/r/20201125164452.89239-25-krzk@kernel.org
Signed-off-by: Mark Brown <broonie@kernel.org>
3 years agoASoC: max98371: skip of_device_id table when !CONFIG_OF
Krzysztof Kozlowski [Wed, 25 Nov 2020 16:44:36 +0000 (17:44 +0100)]
ASoC: max98371: skip of_device_id table when !CONFIG_OF

The driver can match by multiple methods.  Its of_device_id table is
referenced via of_match_ptr() so it will be unused for !CONFIG_OF
builds:

  sound/soc/codecs/max98371.c:411:34: warning: ‘max98371_of_match’ defined but not used [-Wunused-const-variable=]

Signed-off-by: Krzysztof Kozlowski <krzk@kernel.org>
Link: https://lore.kernel.org/r/20201125164452.89239-24-krzk@kernel.org
Signed-off-by: Mark Brown <broonie@kernel.org>
3 years agoASoC: max98095: skip of_device_id table when !CONFIG_OF
Krzysztof Kozlowski [Wed, 25 Nov 2020 16:44:35 +0000 (17:44 +0100)]
ASoC: max98095: skip of_device_id table when !CONFIG_OF

The driver can match by multiple methods.  Its of_device_id table is
referenced via of_match_ptr() so it will be unused for !CONFIG_OF
builds:

  sound/soc/codecs/max98095.c:2151:34: warning: ‘max98095_of_match’ defined but not used [-Wunused-const-variable=]

Signed-off-by: Krzysztof Kozlowski <krzk@kernel.org>
Link: https://lore.kernel.org/r/20201125164452.89239-23-krzk@kernel.org
Signed-off-by: Mark Brown <broonie@kernel.org>
3 years agoASoC: max98090: skip of_device_id table when !CONFIG_OF
Krzysztof Kozlowski [Wed, 25 Nov 2020 16:44:34 +0000 (17:44 +0100)]
ASoC: max98090: skip of_device_id table when !CONFIG_OF

The driver can match by multiple methods.  Its of_device_id table is
referenced via of_match_ptr() so it will be unused for !CONFIG_OF
builds:

  sound/soc/codecs/max98090.c:2671:34: warning: ‘max98090_of_match’ defined but not used [-Wunused-const-variable=]

Signed-off-by: Krzysztof Kozlowski <krzk@kernel.org>
Link: https://lore.kernel.org/r/20201125164452.89239-22-krzk@kernel.org
Signed-off-by: Mark Brown <broonie@kernel.org>
3 years agoASoC: es8316: skip of_device_id table when !CONFIG_OF
Krzysztof Kozlowski [Wed, 25 Nov 2020 16:44:33 +0000 (17:44 +0100)]
ASoC: es8316: skip of_device_id table when !CONFIG_OF

The driver can match by multiple methods.  Its of_device_id table is
referenced via of_match_ptr() so it will be unused for !CONFIG_OF
builds:

  sound/soc/codecs/es8316.c:837:34: warning: ‘es8316_of_match’ defined but not used [-Wunused-const-variable=]

Signed-off-by: Krzysztof Kozlowski <krzk@kernel.org>
Link: https://lore.kernel.org/r/20201125164452.89239-21-krzk@kernel.org
Signed-off-by: Mark Brown <broonie@kernel.org>
3 years agoASoC: da9055: skip of_device_id table when !CONFIG_OF
Krzysztof Kozlowski [Wed, 25 Nov 2020 16:44:32 +0000 (17:44 +0100)]
ASoC: da9055: skip of_device_id table when !CONFIG_OF

The driver can match by multiple methods.  Its of_device_id table is
referenced via of_match_ptr() so it will be unused for !CONFIG_OF
builds:

  sound/soc/codecs/da9055.c:1522:34: warning: ‘da9055_of_match’ defined but not used [-Wunused-const-variable=]

Signed-off-by: Krzysztof Kozlowski <krzk@kernel.org>
Link: https://lore.kernel.org/r/20201125164452.89239-20-krzk@kernel.org
Signed-off-by: Mark Brown <broonie@kernel.org>
3 years agoASoC: da7219: skip of_device_id table when !CONFIG_OF
Krzysztof Kozlowski [Wed, 25 Nov 2020 16:44:31 +0000 (17:44 +0100)]
ASoC: da7219: skip of_device_id table when !CONFIG_OF

The driver can match by multiple methods.  Its of_device_id table is
referenced via of_match_ptr() so it will be unused for !CONFIG_OF
builds:

  sound/soc/codecs/da7219.c:1705:34: warning: ‘da7219_of_match’ defined but not used [-Wunused-const-variable=]

Signed-off-by: Krzysztof Kozlowski <krzk@kernel.org>
Link: https://lore.kernel.org/r/20201125164452.89239-19-krzk@kernel.org
Signed-off-by: Mark Brown <broonie@kernel.org>
3 years agoASoC: da7218: skip of_device_id table when !CONFIG_OF
Krzysztof Kozlowski [Wed, 25 Nov 2020 16:44:30 +0000 (17:44 +0100)]
ASoC: da7218: skip of_device_id table when !CONFIG_OF

The driver can match by multiple methods.  Its of_device_id table is
referenced via of_match_ptr() so it will be unused for !CONFIG_OF
builds:

  sound/soc/codecs/da7218.c:2281:34: warning: ‘da7218_of_match’ defined but not used [-Wunused-const-variable=]

Signed-off-by: Krzysztof Kozlowski <krzk@kernel.org>
Link: https://lore.kernel.org/r/20201125164452.89239-18-krzk@kernel.org
Signed-off-by: Mark Brown <broonie@kernel.org>
3 years agoASoC: alc5632: skip of_device_id table when !CONFIG_OF
Krzysztof Kozlowski [Wed, 25 Nov 2020 16:44:29 +0000 (17:44 +0100)]
ASoC: alc5632: skip of_device_id table when !CONFIG_OF

The driver can match by multiple methods.  Its of_device_id table is
referenced via of_match_ptr() so it will be unused for !CONFIG_OF
builds:

  sound/soc/codecs/alc5632.c:1170:34: warning: ‘alc5632_of_match’ defined but not used [-Wunused-const-variable=]

Signed-off-by: Krzysztof Kozlowski <krzk@kernel.org>
Link: https://lore.kernel.org/r/20201125164452.89239-17-krzk@kernel.org
Signed-off-by: Mark Brown <broonie@kernel.org>
3 years agoASoC: alc5623: skip of_device_id table when !CONFIG_OF
Krzysztof Kozlowski [Wed, 25 Nov 2020 16:44:28 +0000 (17:44 +0100)]
ASoC: alc5623: skip of_device_id table when !CONFIG_OF

The driver can match by multiple methods.  Its of_device_id table is
referenced via of_match_ptr() so it will be unused for !CONFIG_OF
builds:

  sound/soc/codecs/alc5623.c:1071:34: warning: ‘alc5623_of_match’ defined but not used [-Wunused-const-variable=]

Signed-off-by: Krzysztof Kozlowski <krzk@kernel.org>
Link: https://lore.kernel.org/r/20201125164452.89239-16-krzk@kernel.org
Signed-off-by: Mark Brown <broonie@kernel.org>
3 years agoASoC: ak4118: skip of_device_id table when !CONFIG_OF
Krzysztof Kozlowski [Wed, 25 Nov 2020 16:44:27 +0000 (17:44 +0100)]
ASoC: ak4118: skip of_device_id table when !CONFIG_OF

The driver can match by multiple methods.  Its of_device_id table is
referenced via of_match_ptr() so it will be unused for !CONFIG_OF
builds:

  sound/soc/codecs/ak4118.c:407:34: warning: ‘ak4118_of_match’ defined but not used [-Wunused-const-variable=]

Signed-off-by: Krzysztof Kozlowski <krzk@kernel.org>
Link: https://lore.kernel.org/r/20201125164452.89239-15-krzk@kernel.org
Signed-off-by: Mark Brown <broonie@kernel.org>
3 years agoASoC: uniphier: mark OF related data as maybe unused
Krzysztof Kozlowski [Wed, 25 Nov 2020 16:44:26 +0000 (17:44 +0100)]
ASoC: uniphier: mark OF related data as maybe unused

The driver can be compile tested with !CONFIG_OF making certain data
unused:

  sound/soc/uniphier/aio-ld11.c:375:34: warning: ‘uniphier_aio_of_match’ defined but not used [-Wunused-const-variable=]
  sound/soc/uniphier/evea.c:554:34: warning: ‘evea_of_match’ defined but not used [-Wunused-const-variable=]

Signed-off-by: Krzysztof Kozlowski <krzk@kernel.org>
Link: https://lore.kernel.org/r/20201125164452.89239-14-krzk@kernel.org
Signed-off-by: Mark Brown <broonie@kernel.org>
3 years agoASoC: ti: davinci: mark OF related data as maybe unused
Krzysztof Kozlowski [Wed, 25 Nov 2020 16:44:25 +0000 (17:44 +0100)]
ASoC: ti: davinci: mark OF related data as maybe unused

The driver can be compile tested with !CONFIG_OF making certain data
unused:

  sound/soc/ti/davinci-i2s.c:750:34: warning: ‘davinci_i2s_match’ defined but not used [-Wunused-const-variable=]

Signed-off-by: Krzysztof Kozlowski <krzk@kernel.org>
Link: https://lore.kernel.org/r/20201125164452.89239-13-krzk@kernel.org
Signed-off-by: Mark Brown <broonie@kernel.org>
3 years agoASoC: rockchip: mark OF related data as maybe unused
Krzysztof Kozlowski [Wed, 25 Nov 2020 16:44:24 +0000 (17:44 +0100)]
ASoC: rockchip: mark OF related data as maybe unused

The driver can be compile tested with !CONFIG_OF making certain data
unused:

  sound/soc/rockchip/rockchip_i2s.c:569:34: warning: ‘rockchip_i2s_match’ defined but not used [-Wunused-const-variable=]
  sound/soc/rockchip/rockchip_pdm.c:463:34: warning: ‘rockchip_pdm_match’ defined but not used [-Wunused-const-variable=]
  sound/soc/rockchip/rockchip_spdif.c:44:34: warning: ‘rk_spdif_match’ defined but not used [-Wunused-const-variable=]

Signed-off-by: Krzysztof Kozlowski <krzk@kernel.org>
Link: https://lore.kernel.org/r/20201125164452.89239-12-krzk@kernel.org
Signed-off-by: Mark Brown <broonie@kernel.org>
3 years agoASoC: samsung: smdk_wm8994: mark OF related data as maybe unused
Krzysztof Kozlowski [Wed, 25 Nov 2020 16:44:23 +0000 (17:44 +0100)]
ASoC: samsung: smdk_wm8994: mark OF related data as maybe unused

The driver can be compile tested with !CONFIG_OF making certain data
unused:

  sound/soc/samsung/smdk_wm8994.c:139:34: warning: ‘samsung_wm8994_of_match’ defined but not used [-Wunused-const-variable=]

Signed-off-by: Krzysztof Kozlowski <krzk@kernel.org>
Link: https://lore.kernel.org/r/20201125164452.89239-11-krzk@kernel.org
Signed-off-by: Mark Brown <broonie@kernel.org>
3 years agoASoC: qcom: mark OF related data as maybe unused
Krzysztof Kozlowski [Wed, 25 Nov 2020 16:44:22 +0000 (17:44 +0100)]
ASoC: qcom: mark OF related data as maybe unused

The driver can be compile tested with !CONFIG_OF making certain data
unused:

  sound/soc/qcom/lpass-apq8016.c:294:34: warning: ‘apq8016_lpass_cpu_device_id’ defined but not used [-Wunused-const-variable=]

Signed-off-by: Krzysztof Kozlowski <krzk@kernel.org>
Link: https://lore.kernel.org/r/20201125164452.89239-10-krzk@kernel.org
Signed-off-by: Mark Brown <broonie@kernel.org>
3 years agoASoC: meson: t9015: mark OF related data as maybe unused
Krzysztof Kozlowski [Wed, 25 Nov 2020 16:44:21 +0000 (17:44 +0100)]
ASoC: meson: t9015: mark OF related data as maybe unused

The driver can be compile tested with !CONFIG_OF making certain data
unused:

  sound/soc/meson/t9015.c:315:34: warning: ‘t9015_ids’ defined but not used [-Wunused-const-variable=]

Signed-off-by: Krzysztof Kozlowski <krzk@kernel.org>
Link: https://lore.kernel.org/r/20201125164452.89239-9-krzk@kernel.org
Signed-off-by: Mark Brown <broonie@kernel.org>
3 years agoASoC: kirkwood: armada-370-db: mark OF related data as maybe unused
Krzysztof Kozlowski [Wed, 25 Nov 2020 16:44:20 +0000 (17:44 +0100)]
ASoC: kirkwood: armada-370-db: mark OF related data as maybe unused

The driver can be compile tested with !CONFIG_OF making certain data
unused:

  sound/soc/kirkwood/armada-370-db.c:137:34: warning: ‘a370db_dt_ids’ defined but not used [-Wunused-const-variable=]

Signed-off-by: Krzysztof Kozlowski <krzk@kernel.org>
Link: https://lore.kernel.org/r/20201125164452.89239-8-krzk@kernel.org
Signed-off-by: Mark Brown <broonie@kernel.org>
3 years agoASoC: tas571x: mark OF related data as maybe unused
Krzysztof Kozlowski [Wed, 25 Nov 2020 16:44:19 +0000 (17:44 +0100)]
ASoC: tas571x: mark OF related data as maybe unused

The driver can be compile tested with !CONFIG_OF making certain data
unused:

  sound/soc/codecs/tas571x.c:892:34: warning: ‘tas571x_of_match’ defined but not used [-Wunused-const-variable=]

Signed-off-by: Krzysztof Kozlowski <krzk@kernel.org>
Link: https://lore.kernel.org/r/20201125164452.89239-7-krzk@kernel.org
Signed-off-by: Mark Brown <broonie@kernel.org>
3 years agoASoC: rk3328: mark OF related data as maybe unused
Krzysztof Kozlowski [Wed, 25 Nov 2020 16:44:18 +0000 (17:44 +0100)]
ASoC: rk3328: mark OF related data as maybe unused

The driver can be compile tested with !CONFIG_OF making certain data
unused:

  sound/soc/codecs/rk3328_codec.c:502:34: warning: ‘rk3328_codec_of_match’ defined but not used [-Wunused-const-variable=]

Signed-off-by: Krzysztof Kozlowski <krzk@kernel.org>
Link: https://lore.kernel.org/r/20201125164452.89239-6-krzk@kernel.org
Signed-off-by: Mark Brown <broonie@kernel.org>
3 years agoASoC: inno_rk3036: mark OF related data as maybe unused
Krzysztof Kozlowski [Wed, 25 Nov 2020 16:44:17 +0000 (17:44 +0100)]
ASoC: inno_rk3036: mark OF related data as maybe unused

The driver can be compile tested with !CONFIG_OF making certain data
unused:

  sound/soc/codecs/inno_rk3036.c:470:34: warning: ‘rk3036_codec_of_match’ defined but not used [-Wunused-const-variable=]

Signed-off-by: Krzysztof Kozlowski <krzk@kernel.org>
Link: https://lore.kernel.org/r/20201125164452.89239-5-krzk@kernel.org
Signed-off-by: Mark Brown <broonie@kernel.org>
3 years agoASoC: gtm601: mark OF related data as maybe unused
Krzysztof Kozlowski [Wed, 25 Nov 2020 16:44:16 +0000 (17:44 +0100)]
ASoC: gtm601: mark OF related data as maybe unused

The driver can be compile tested with !CONFIG_OF making certain data
unused:

  sound/soc/codecs/gtm601.c:90:34: warning: ‘gtm601_codec_of_match’ defined but not used [-Wunused-const-variable=]

Signed-off-by: Krzysztof Kozlowski <krzk@kernel.org>
Link: https://lore.kernel.org/r/20201125164452.89239-4-krzk@kernel.org
Signed-off-by: Mark Brown <broonie@kernel.org>
3 years agoASoC: bd28623: mark OF related data as maybe unused
Krzysztof Kozlowski [Wed, 25 Nov 2020 16:44:15 +0000 (17:44 +0100)]
ASoC: bd28623: mark OF related data as maybe unused

The driver can be compile tested with !CONFIG_OF making certain data
unused:

  sound/soc/codecs/bd28623.c:225:34: warning: ‘bd28623_of_match’ defined but not used [-Wunused-const-variable=]

Signed-off-by: Krzysztof Kozlowski <krzk@kernel.org>
Link: https://lore.kernel.org/r/20201125164452.89239-3-krzk@kernel.org
Signed-off-by: Mark Brown <broonie@kernel.org>
3 years agoASoC: ak5558: mark OF related data as maybe unused
Krzysztof Kozlowski [Wed, 25 Nov 2020 16:44:14 +0000 (17:44 +0100)]
ASoC: ak5558: mark OF related data as maybe unused

The driver can be compile tested with !CONFIG_OF making certain data
unused:

  sound/soc/codecs/ak5558.c:418:34: warning: ‘ak5558_i2c_dt_ids’ defined but not used [-Wunused-const-variable=]

Signed-off-by: Krzysztof Kozlowski <krzk@kernel.org>
Link: https://lore.kernel.org/r/20201125164452.89239-2-krzk@kernel.org
Signed-off-by: Mark Brown <broonie@kernel.org>
3 years agoASoC: rt5682: change SAR voltage threshold
Shuming Fan [Thu, 26 Nov 2020 09:27:59 +0000 (17:27 +0800)]
ASoC: rt5682: change SAR voltage threshold

To fix errors in some 4 poles headset detection cases,
this patch adjusts the voltage threshold for mic detection.

Signed-off-by: Shuming Fan <shumingf@realtek.com>
Link: https://lore.kernel.org/r/20201126092759.9427-1-shumingf@realtek.com
Signed-off-by: Mark Brown <broonie@kernel.org>
3 years agoASoC: fsl_xcvr: fix potential resource leak
Viorel Suman [Tue, 24 Nov 2020 14:19:57 +0000 (16:19 +0200)]
ASoC: fsl_xcvr: fix potential resource leak

"fw" variable must be relased before return.

Signed-off-by: Viorel Suman <viorel.suman@nxp.com>
Link: https://lore.kernel.org/r/20201124141957.20481-1-viorel.suman@oss.nxp.com
Signed-off-by: Mark Brown <broonie@kernel.org>
3 years agoASoC: wm_adsp: fix error return code in wm_adsp_load()
Luo Meng [Mon, 23 Nov 2020 13:38:39 +0000 (21:38 +0800)]
ASoC: wm_adsp: fix error return code in wm_adsp_load()

Fix to return a negative error code from the error handling case
instead of 0 in function wm_adsp_load(), as done elsewhere in this
function.

Fixes: 170b1e123f38 ("ASoC: wm_adsp: Add support for new Halo core DSPs")
Reported-by: Hulk Robot <hulkci@huawei.com>
Signed-off-by: Luo Meng <luomeng12@huawei.com>
Acked-by: Richard Fitzgerald <rf@opensource.cirrus.com>
Link: https://lore.kernel.org/r/20201123133839.4073787-1-luomeng12@huawei.com
Signed-off-by: Mark Brown <broonie@kernel.org>
3 years agoASoC: SOF: Add `memory_info` file to debugfs
Karol Trzcinski [Tue, 24 Nov 2020 18:00:17 +0000 (20:00 +0200)]
ASoC: SOF: Add `memory_info` file to debugfs

This file content describes memory allocation status
at run-time, typically to detect memory leaks.

Signed-off-by: Karol Trzcinski <karolx.trzcinski@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/20201124180017.2232128-5-kai.vehmanen@linux.intel.com
Signed-off-by: Mark Brown <broonie@kernel.org>
3 years agoASoC: SOF: Change section comment for SOF_IPC_TEST_
Karol Trzcinski [Tue, 24 Nov 2020 18:00:16 +0000 (20:00 +0200)]
ASoC: SOF: Change section comment for SOF_IPC_TEST_

Section comment should be coherent with IPC prefix from define
names.

Signed-off-by: Karol Trzcinski <karolx.trzcinski@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/20201124180017.2232128-4-kai.vehmanen@linux.intel.com
Signed-off-by: Mark Brown <broonie@kernel.org>
3 years agoASoC: SOF: Improve code alignment in header.h
Karol Trzcinski [Tue, 24 Nov 2020 18:00:15 +0000 (20:00 +0200)]
ASoC: SOF: Improve code alignment in header.h

Each define value in series should be aligned and tabs should
be used instead of spaces to follow code-style.

Signed-off-by: Karol Trzcinski <karolx.trzcinski@linux.intel.com>
Reviewed-by: Kai Vehmanen <kai.vehmanen@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/20201124180017.2232128-3-kai.vehmanen@linux.intel.com
Signed-off-by: Mark Brown <broonie@kernel.org>
3 years agoASoC: SOF: ext_manifest: Parse firmware config dictionary
Karol Trzcinski [Tue, 24 Nov 2020 18:00:14 +0000 (20:00 +0200)]
ASoC: SOF: ext_manifest: Parse firmware config dictionary

Values given in this dictionary describes used firmware configuration,
like feature availability, buffer size limits and similar properties.

Signed-off-by: Karol Trzcinski <karolx.trzcinski@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/20201124180017.2232128-2-kai.vehmanen@linux.intel.com
Signed-off-by: Mark Brown <broonie@kernel.org>
3 years agoASoC: imx-audmux: Remove unused .id_table
Fabio Estevam [Mon, 23 Nov 2020 20:09:17 +0000 (17:09 -0300)]
ASoC: imx-audmux: Remove unused .id_table

Since 5.10-rc1 i.MX is a devicetree-only platform and the existing
.id_table support in this driver was only useful for old non-devicetree
platforms.

Get rid of the .id_table since it is no longer used.

Signed-off-by: Fabio Estevam <festevam@gmail.com>
Link: https://lore.kernel.org/r/20201123200917.16447-1-festevam@gmail.com
Signed-off-by: Mark Brown <broonie@kernel.org>
3 years agoASoC: ti: depend on COMMON_CLK to fix compile tests
Krzysztof Kozlowski [Mon, 16 Nov 2020 17:51:33 +0000 (18:51 +0100)]
ASoC: ti: depend on COMMON_CLK to fix compile tests

The TI/OMAP sound drivers use Common Clock Framework thus they cannot be
built on platforms without it (e.g. compile test on MIPS with RALINK and
SOC_RT305X):

    /usr/bin/mips-linux-gnu-ld: sound/soc/ti/davinci-mcasp.o:davinci-mcasp.c:(.text+0x1c64): more undefined references to `clk_set_parent' follow
    /usr/bin/mips-linux-gnu-ld: sound/soc/ti/omap-dmic.o: in function `omap_dmic_set_dai_sysclk':
    omap-dmic.c:(.text+0xa5c): undefined reference to `clk_get_parent'

Reported-by: kernel test robot <lkp@intel.com>
Signed-off-by: Krzysztof Kozlowski <krzk@kernel.org>
Link: https://lore.kernel.org/r/20201116175133.402553-4-krzk@kernel.org
Signed-off-by: Mark Brown <broonie@kernel.org>
3 years agoASoC: stm: depend on COMMON_CLK to fix compile tests
Krzysztof Kozlowski [Mon, 16 Nov 2020 17:51:32 +0000 (18:51 +0100)]
ASoC: stm: depend on COMMON_CLK to fix compile tests

The STM32 I2S drivers use Common Clock Framework thus they cannot be
built on platforms without it (e.g. compile test on MIPS with RALINK and
SOC_RT305X):

    /usr/bin/mips-linux-gnu-ld: sound/soc/stm/stm32_i2s.o: in function `stm32_i2s_hw_params':
    stm32_i2s.c:(.text+0x1870): undefined reference to `clk_set_parent'

Reported-by: kernel test robot <lkp@intel.com>
Signed-off-by: Krzysztof Kozlowski <krzk@kernel.org>
Link: https://lore.kernel.org/r/20201116175133.402553-3-krzk@kernel.org
Signed-off-by: Mark Brown <broonie@kernel.org>
3 years agoASoC: sh: depend on COMMON_CLK to fix compile tests
Krzysztof Kozlowski [Mon, 16 Nov 2020 17:51:31 +0000 (18:51 +0100)]
ASoC: sh: depend on COMMON_CLK to fix compile tests

The SH4 FSI sound drivers use SuperH clocks thus they cannot be built on
platforms without proper clock support (e.g. compile test on MIPS with
RALINK and SOC_RT305X):

    /usr/bin/mips-linux-gnu-ld: sound/soc/sh/fsi.o: in function `fsi_clk_set_rate_external':
    fsi.c:(.text+0x2714): undefined reference to `clk_set_parent'

Reported-by: kernel test robot <lkp@intel.com>
Signed-off-by: Krzysztof Kozlowski <krzk@kernel.org>
Link: https://lore.kernel.org/r/20201116175133.402553-2-krzk@kernel.org
Signed-off-by: Mark Brown <broonie@kernel.org>
3 years agoASoC: hdmi-codec: Get ELD in before reporting plugged event
Cheng-Yi Chiang [Wed, 18 Nov 2020 04:38:52 +0000 (12:38 +0800)]
ASoC: hdmi-codec: Get ELD in before reporting plugged event

In plugged callback, ELD should be updated from display driver so that
user space can query information from ELD immediately after receiving jack
plugged event.

When jack is unplugged, clear ELD buffer so that user space does not get
obsolete information of unplugged HDMI.

Signed-off-by: Cheng-Yi Chiang <cychiang@chromium.org>
Link: https://lore.kernel.org/r/20201118043852.1338877-1-cychiang@chromium.org
Signed-off-by: Mark Brown <broonie@kernel.org>
3 years agoASoC: qcom: Fix enabling BCLK and LRCLK in LPAIF invalid state
Srinivasa Rao Mandadapu [Mon, 23 Nov 2020 16:17:53 +0000 (21:47 +0530)]
ASoC: qcom: Fix enabling BCLK and LRCLK in LPAIF invalid state

Fix enabling BCLK and LRCLK only when LPAIF is invalid state and
bit clock in enable state.
In device suspend/resume scenario LPAIF is going to reset state.
which is causing LRCLK disable and BCLK enable.
Avoid such inconsitency by removing unnecessary cpu dai prepare API,
which is doing LRCLK enable, and by maintaining BLCK  state information.

Fixes: 7e6799d8f87d ("ASoC: qcom: lpass-cpu: Enable MI2S BCLK and LRCLK together")

Signed-off-by: V Sujith Kumar Reddy <vsujithk@codeaurora.org>
Signed-off-by: Srinivasa Rao Mandadapu <srivasam@codeaurora.org>
Link: https://lore.kernel.org/r/1606148273-17325-1-git-send-email-srivasam@codeaurora.org
Signed-off-by: Mark Brown <broonie@kernel.org>
3 years agoASoC: codecs: Fix fall-through warnings for Clang
Gustavo A. R. Silva [Fri, 20 Nov 2020 18:23:50 +0000 (12:23 -0600)]
ASoC: codecs: Fix fall-through warnings for Clang

In preparation to enable -Wimplicit-fallthrough for Clang, fix multiple
warnings by explicitly adding multiple break statements instead of just
letting the code fall through, and also add fallthrough pseudo-keywords
in places where the code is intended to fall through to the next case.

Link: https://github.com/KSPP/linux/issues/115
Signed-off-by: Gustavo A. R. Silva <gustavoars@kernel.org>
Link: https://lore.kernel.org/r/d17b4d8300dbb6aff0d055b06b487c96ca264757.1605896059.git.gustavoars@kernel.org
Signed-off-by: Mark Brown <broonie@kernel.org>
3 years agoASoC: SOF: nocodec: modify DAI link definitions
Ranjani Sridharan [Fri, 20 Nov 2020 14:16:53 +0000 (16:16 +0200)]
ASoC: SOF: nocodec: modify DAI link definitions

The ignore_machine field in the component driver is used to
ignore the FE DAI links defined in the machine driver,
override BE fixups and set the stream names for the
DAI links defined in the machine driver. This is required
to make SOF compatible with the legacy machine drivers.

In the case of the nocodec machine driver in SOF, there is
no need to rely upon this ignore_machine logic in the core.
Modify the machine driver to set DAI link stream names and the
BE hw_params_fixup callback appropriately.

Signed-off-by: Ranjani Sridharan <ranjani.sridharan@linux.intel.com>
Reviewed-by: Bard Liao <yung-chuan.liao@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/20201120141653.2160134-1-kai.vehmanen@linux.intel.com
Signed-off-by: Mark Brown <broonie@kernel.org>
3 years agoASoC: SOF: IPC: fix implicit type overflow
Curtis Malainey [Fri, 20 Nov 2020 14:40:25 +0000 (16:40 +0200)]
ASoC: SOF: IPC: fix implicit type overflow

Implicit values may have a length of 15bits (s16) so we need to declare
the proper size so we don't get undefined behaviour. This appears to be
arch and compiler dependent. This commit is to keep the headers aligned
between the firmware and kernel. UBSan discovered this bug in the
firmware.

Signed-off-by: Curtis Malainey <cujomalainey@chromium.org>
Reviewed-by: Guennadi Liakhovetski <guennadi.liakhovetski@linux.intel.com>
Signed-off-by: Kai Vehmanen <kai.vehmanen@linux.intel.com>
Link: https://lore.kernel.org/r/20201120144025.2166023-1-kai.vehmanen@linux.intel.com
Signed-off-by: Mark Brown <broonie@kernel.org>
3 years agoMerge series "ASoC: mt6359: Fix regulator_dev_lookup() fails for id "LDO_VAUD18"...
Mark Brown [Fri, 20 Nov 2020 16:09:46 +0000 (16:09 +0000)]
Merge series "ASoC: mt6359: Fix regulator_dev_lookup() fails for id "LDO_VAUD18"" from Jiaxin Yu <jiaxin.yu@mediatek.com>:

This series fixed "LDO_VAUD18-supply" regulator register fail.
We can see the error log "mt6359-sound supply LDO_VAUD18 not found, using
dummy regulator" when register the DAPM widget "LDO_VAUD18"
Otherwise, the power can not be turned on correctly when recording.

Jiaxin Yu (2):
  ASoC: mediatek: mt6359: Fix regulator_dev_lookup() fails for id
    "LDO_VAUD18"
  dt-bindings: mediatek: mt6359: remove unused property for mt6359

 Documentation/devicetree/bindings/sound/mt6359.yaml | 9 ---------
 sound/soc/codecs/mt6359.c                           | 7 ++++---
 2 files changed, 4 insertions(+), 12 deletions(-)

--
2.18.0

3 years agoMerge series "ASoC: Intel/SOF: extend run-time driver selection to ACPI devices"...
Mark Brown [Fri, 20 Nov 2020 16:09:39 +0000 (16:09 +0000)]
Merge series "ASoC: Intel/SOF: extend run-time driver selection to ACPI devices" from Pierre-Louis Bossart <pierre-louis.bossart@linux.intel.com>:

The module snd-intel-dspcfg, suggested by Jaroslav last year,
currently provide the means to select a PCI driver at run-time, based
on quirks, recommendations or user selection via a kernel
parameter. This capability removed a lot of confusions in
distributions and removed the need for recompilations to select legacy
HDaudio, SST or SOF drivers.

This patchset extends the concept to ACPI devices. This was driven by
the desire to at some point deprecate the Atom/SST driver for Baytrail
and Cherrytrail, which is no longer maintained by Intel. By having the
SOF driver enabled by distributions for Baytrail/Cherrytrail, we can
enable more end-user tests and make the transition easier for
distributions (likely in 2021 at this point).

This patchset provides the same solution for Broadwell, mainly to have
a single build for all Intel platforms. SOF on Broadwell remains an
option not recommended for distributions, as long as the 'catpt'
driver is maintained there is no burning desire to make SOF the
default on the three Broadwell-based platforms with the DSP
enabled.

Pierre-Louis Bossart (14):
  ASoC: Intel: broadwell: add missing pm_ops
  ASoC: Intel: bdw-rt5677: add missing pm_ops
  ALSA: hda: intel-dsp-config: add helper for ACPI DSP driver selection
  ASoC: soc-acpi: add helper to identify parent driver.
  ASoC: Intel: boards: byt/cht: set card and driver name at run time
  ASoC: Intel: byt/cht: set pm ops dynamically
  ASoC: SOF: acpi: add dynamic selection of DSP driver
  ASoC: Intel: Atom: add dynamic selection of DSP driver
  ASoC: SOF: Intel: allow for coexistence between SOF and Atom/SST
    drivers
  ALSA: hda: intel-dsp-config: add Broadwell ACPI DSP driver selection
  ASoC: Intel: broadwell: set card and driver name dynamically
  ASoC: Intel: catpt: add dynamic selection of DSP driver
  ASoC: SOF: Intel: allow for coexistence between SOF and catpt drivers
  ALSA: hda: intel-dsp-config: ignore dsp_driver parameter for PCI
    legacy devices

 include/sound/intel-dsp-config.h             |   7 ++
 include/sound/soc-acpi.h                     |   6 +
 sound/hda/intel-dsp-config.c                 | 111 +++++++++++++++++++
 sound/soc/intel/Kconfig                      |   2 +
 sound/soc/intel/atom/sst/sst_acpi.c          |   8 ++
 sound/soc/intel/boards/bdw-rt5650.c          |  17 ++-
 sound/soc/intel/boards/bdw-rt5677.c          |  18 ++-
 sound/soc/intel/boards/broadwell.c           |  20 ++--
 sound/soc/intel/boards/bytcht_cx2072x.c      |  27 +++--
 sound/soc/intel/boards/bytcht_da7213.c       |  27 +++--
 sound/soc/intel/boards/bytcht_es8316.c       |  29 +++--
 sound/soc/intel/boards/bytcr_rt5640.c        |  30 +++--
 sound/soc/intel/boards/bytcr_rt5651.c        |  27 +++--
 sound/soc/intel/boards/cht_bsw_max98090_ti.c |  29 +++--
 sound/soc/intel/boards/cht_bsw_nau8824.c     |  29 +++--
 sound/soc/intel/boards/cht_bsw_rt5645.c      |  38 ++++---
 sound/soc/intel/boards/cht_bsw_rt5672.c      |  29 +++--
 sound/soc/intel/catpt/device.c               |  12 ++
 sound/soc/sof/intel/Kconfig                  |  33 +++---
 sound/soc/sof/sof-acpi-dev.c                 |  14 ++-
 20 files changed, 392 insertions(+), 121 deletions(-)

--
2.25.1

3 years agoASoC: qcom: sm8250: fix HDMI audio playback
Dmitry Baryshkov [Thu, 19 Nov 2020 12:31:45 +0000 (15:31 +0300)]
ASoC: qcom: sm8250: fix HDMI audio playback

Current code does not setup CPU dai (causing -EIO errors on playback)
and does not pass SND_SOC_DAIFMT_I2S to codec fmt (causing i2s-hifi
errors). Fix both errors to enable HDMI audio playback on SM8250. Tested
on RB5 platform.

Signed-off-by: Dmitry Baryshkov <dmitry.baryshkov@linaro.org>
Fixes: aa2e2785545a ("ASoC: qcom: sm8250: add sound card qrb5165-rb5 support")
Cc: Srinivas Kandagatla <srinivas.kandagatla@linaro.org>
Reviewed-by: Srinivas Kandagatla <srinivas.kandagatla@linaro.org>
Link: https://lore.kernel.org/r/20201119123145.709891-1-dmitry.baryshkov@linaro.org
Signed-off-by: Mark Brown <broonie@kernel.org>
3 years agoASoC: mmp-sspa: set phase two word length register
Kyle Russell [Thu, 19 Nov 2020 03:41:06 +0000 (22:41 -0500)]
ASoC: mmp-sspa: set phase two word length register

If hw params enables dual phase transmission, then the word length for
the second phase should be set to match the sample format instead of
remaining at the reset default.  This matches the configuration already
being done for the first phase.

This driver already sets the phase two sample size, so this should complete
the phase two configuration.

Signed-off-by: Kyle Russell <bkylerussell@gmail.com>
Link: https://lore.kernel.org/r/20201119034106.1273906-1-bkylerussell@gmail.com
Signed-off-by: Mark Brown <broonie@kernel.org>
3 years agoASoC: codecs: lpass-va-macro: add missing MODULE_DEVICE_TABLE
Srinivas Kandagatla [Fri, 20 Nov 2020 12:38:13 +0000 (12:38 +0000)]
ASoC: codecs: lpass-va-macro: add missing MODULE_DEVICE_TABLE

Fix module loading due by adding missing MODULE_DEVICE_TABLE.

Fixes: 908e6b1df26e ("ASoC: codecs: lpass-va-macro: Add support to VA Macro")
Signed-off-by: Srinivas Kandagatla <srinivas.kandagatla@linaro.org>
Link: https://lore.kernel.org/r/20201120123813.14059-1-srinivas.kandagatla@linaro.org
Signed-off-by: Mark Brown <broonie@kernel.org>
3 years agoASoC: dt-bindings: renesas, rsnd: Fix duplicate 'allOf' entries
Rob Herring [Thu, 19 Nov 2020 16:18:48 +0000 (10:18 -0600)]
ASoC: dt-bindings: renesas, rsnd: Fix duplicate 'allOf' entries

Commit e52f3f291152 ("ASoC: audio-graph-card: Refactor schema") added an
'allOf' entry, but one is already present in the schema. Multiple keys
is not valid and results in an error:

ruamel.yaml.constructor.DuplicateKeyError: while constructing a mapping
  in "<unicode string>", line 4, column 1
found duplicate key "allOf" with value "[]" (original value: "[]")
  in "<unicode string>", line 262, column 1

Fixes: e52f3f291152 ("ASoC: audio-graph-card: Refactor schema")
Cc: Liam Girdwood <lgirdwood@gmail.com>
Cc: Mark Brown <broonie@kernel.org>
Cc: Kuninori Morimoto <kuninori.morimoto.gx@renesas.com>
Cc: Sameer Pujar <spujar@nvidia.com>
Cc: alsa-devel@alsa-project.org
Signed-off-by: Rob Herring <robh@kernel.org>
Link: https://lore.kernel.org/r/20201119161848.3379929-1-robh@kernel.org
Signed-off-by: Mark Brown <broonie@kernel.org>
3 years agoASoC: SOF: control: override volume info callback
Jaska Uimonen [Wed, 11 Nov 2020 17:31:05 +0000 (19:31 +0200)]
ASoC: SOF: control: override volume info callback

ASoC dapm controls currently don't support more than 2 channels. This is
a problem for SOF-based devices where individual volume control cannot
be provided on the 4 DMIC input path.

If we want to provide controls for more than 2 channels, this patch
suggests a simple solution based on an override of the info callback.
For example, in the case with 4 channel DMIC PGAs, a sof_info callback
would be used. Mono and stereo cases will keep using the existing dapm
info callback.

A longer-term solution would be to remove the limits to 2 channels in
ASoC/DAPM/topology. This is a topic Intel is currently looking into,
e.g. by removing the use of 'reg' and 'rreg' fields and use arrays
instead. Such changes will be rather intrusive and touch multiple codec
and platform drivers. Removing restrictions is the right thing to do,
but this will need to be done in steps with lots of validation.

Signed-off-by: Jaska Uimonen <jaska.uimonen@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/20201111173105.1927466-1-kai.vehmanen@linux.intel.com
Signed-off-by: Mark Brown <broonie@kernel.org>
3 years agoASoC: mt6359: remove unused property for mt6359
Jiaxin Yu [Fri, 20 Nov 2020 03:06:13 +0000 (11:06 +0800)]
ASoC: mt6359: remove unused property for mt6359

This reverts commit 08651373808e16b01d3b12207f52504c17b6774c.
("dt-bindings: mediatek: mt6359: Add new property for mt6359")

Remove unused property "LDO_VAUD18-supply" in mt6359codec.

Signed-off-by: Jiaxin Yu <jiaxin.yu@mediatek.com>
Link: https://lore.kernel.org/r/1605841573-1442-3-git-send-email-jiaxin.yu@mediatek.com
Signed-off-by: Mark Brown <broonie@kernel.org>
3 years agoASoC: mediatek: mt6359: Fix regulator_dev_lookup() fails for id "LDO_VAUD18"
Jiaxin Yu [Fri, 20 Nov 2020 03:06:12 +0000 (11:06 +0800)]
ASoC: mediatek: mt6359: Fix regulator_dev_lookup() fails for id "LDO_VAUD18"

Mt6359 platform device is instantiated by mfd_add_devices(). In the
case, dev->of_node is NULL so that always fails to get the regulator_dev.

Use regualator-name "vaud18" that in dts node instead of
"LDO_VAUD19-supply". So that we can get regulator_dev through
regulator_lookup_by_name() directly.

Fixes: 64a70744b778 ("ASoC: Fix vaud18 power leakage of mt6359")
Signed-off-by: Jiaxin Yu <jiaxin.yu@mediatek.com>
Link: https://lore.kernel.org/r/1605841573-1442-2-git-send-email-jiaxin.yu@mediatek.com
Signed-off-by: Mark Brown <broonie@kernel.org>
3 years agoASoC: SOF: Intel: allow for coexistence between SOF and catpt drivers
Pierre-Louis Bossart [Thu, 12 Nov 2020 22:38:24 +0000 (16:38 -0600)]
ASoC: SOF: Intel: allow for coexistence between SOF and catpt drivers

Now that we have all the support needed for coexistence between ACPI
drivers for Broadwell, remove mutual exclusion in the Kconfig
file. The selection is done by playing with the snd_intel_dspcfg
module 'dsp_driver' parameter.

Signed-off-by: Pierre-Louis Bossart <pierre-louis.bossart@linux.intel.com>
Reviewed-by: Ranjani Sridharan <ranjani.sridharan@linux.intel.com>
Reviewed-by: Rander Wang <rander.wang@linux.intel.com>
Reviewed-by: Guennadi Liakhovetski <guennadi.liakhovetski@linux.intel.com>
Link: https://lore.kernel.org/r/20201112223825.39765-14-pierre-louis.bossart@linux.intel.com
Signed-off-by: Mark Brown <broonie@kernel.org>
3 years agoALSA: hda: intel-dsp-config: ignore dsp_driver parameter for PCI legacy devices
Pierre-Louis Bossart [Thu, 12 Nov 2020 22:38:25 +0000 (16:38 -0600)]
ALSA: hda: intel-dsp-config: ignore dsp_driver parameter for PCI legacy devices

On Haswell/Broadwell/Baytrail/Braswell, the DSP is not used for the
HDMI/DP interface, and setting the dsp_driver parameter to a value > 1
has the side effect of preventing the HDaudio legacy driver from
probing.

The DSP driver selection should really only handle cases where a DSP
is actually used. This patch traps all known PCI devices and makes
sure the HDaudio driver can always be probed.

Signed-off-by: Pierre-Louis Bossart <pierre-louis.bossart@linux.intel.com>
Acked-by: Takashi Iwai <tiwai@suse.de>
Reviewed-by: Ranjani Sridharan <ranjani.sridharan@linux.intel.com>
Reviewed-by: Rander Wang <rander.wang@linux.intel.com>
Reviewed-by: Guennadi Liakhovetski <guennadi.liakhovetski@linux.intel.com>
Link: https://lore.kernel.org/r/20201112223825.39765-15-pierre-louis.bossart@linux.intel.com
Signed-off-by: Mark Brown <broonie@kernel.org>
3 years agoASoC: Intel: catpt: add dynamic selection of DSP driver
Pierre-Louis Bossart [Thu, 12 Nov 2020 22:38:23 +0000 (16:38 -0600)]
ASoC: Intel: catpt: add dynamic selection of DSP driver

Follow PCI example and stop the probe when another driver is desired
for the same ACPI HID.

Signed-off-by: Pierre-Louis Bossart <pierre-louis.bossart@linux.intel.com>
Reviewed-by: Ranjani Sridharan <ranjani.sridharan@linux.intel.com>
Reviewed-by: Rander Wang <rander.wang@linux.intel.com>
Reviewed-by: Guennadi Liakhovetski <guennadi.liakhovetski@linux.intel.com>
Link: https://lore.kernel.org/r/20201112223825.39765-13-pierre-louis.bossart@linux.intel.com
Signed-off-by: Mark Brown <broonie@kernel.org>
3 years agoASoC: Intel: broadwell: set card and driver name dynamically
Pierre-Louis Bossart [Thu, 12 Nov 2020 22:38:22 +0000 (16:38 -0600)]
ASoC: Intel: broadwell: set card and driver name dynamically

Remove last hard-coded build-time dependency

Signed-off-by: Pierre-Louis Bossart <pierre-louis.bossart@linux.intel.com>
Reviewed-by: Ranjani Sridharan <ranjani.sridharan@linux.intel.com>
Reviewed-by: Rander Wang <rander.wang@linux.intel.com>
Reviewed-by: Guennadi Liakhovetski <guennadi.liakhovetski@linux.intel.com>
Link: https://lore.kernel.org/r/20201112223825.39765-12-pierre-louis.bossart@linux.intel.com
Signed-off-by: Mark Brown <broonie@kernel.org>
3 years agoALSA: hda: intel-dsp-config: add Broadwell ACPI DSP driver selection
Pierre-Louis Bossart [Thu, 12 Nov 2020 22:38:21 +0000 (16:38 -0600)]
ALSA: hda: intel-dsp-config: add Broadwell ACPI DSP driver selection

Add ACPI IDs for Broadwell (and Haswell for consistency). This
addition is required for dynamic selection of drivers on those
devices.

Signed-off-by: Pierre-Louis Bossart <pierre-louis.bossart@linux.intel.com>
Acked-by: Takashi Iwai <tiwai@suse.de>
Reviewed-by: Ranjani Sridharan <ranjani.sridharan@linux.intel.com>
Reviewed-by: Rander Wang <rander.wang@linux.intel.com>
Reviewed-by: Guennadi Liakhovetski <guennadi.liakhovetski@linux.intel.com>
Link: https://lore.kernel.org/r/20201112223825.39765-11-pierre-louis.bossart@linux.intel.com
Signed-off-by: Mark Brown <broonie@kernel.org>