linux-2.6-microblaze.git
11 months agoASoC: stm: convert not to use asoc_xxx()
Kuninori Morimoto [Mon, 11 Sep 2023 23:48:27 +0000 (23:48 +0000)]
ASoC: stm: convert not to use asoc_xxx()

ASoC is now unified asoc_xxx() into snd_soc_xxx().
This patch convert asoc_xxx() to snd_soc_xxx().

Signed-off-by: Kuninori Morimoto <kuninori.morimoto.gx@renesas.com>
Link: https://lore.kernel.org/r/87y1hcqnjo.wl-kuninori.morimoto.gx@renesas.com
Signed-off-by: Mark Brown <broonie@kernel.org>
11 months agoASoC: pxa: convert not to use asoc_xxx()
Kuninori Morimoto [Mon, 11 Sep 2023 23:48:22 +0000 (23:48 +0000)]
ASoC: pxa: convert not to use asoc_xxx()

ASoC is now unified asoc_xxx() into snd_soc_xxx().
This patch convert asoc_xxx() to snd_soc_xxx().

Signed-off-by: Kuninori Morimoto <kuninori.morimoto.gx@renesas.com>
Link: https://lore.kernel.org/r/87zg1sqnjt.wl-kuninori.morimoto.gx@renesas.com
Signed-off-by: Mark Brown <broonie@kernel.org>
11 months agoASoC: mxs: convert not to use asoc_xxx()
Kuninori Morimoto [Mon, 11 Sep 2023 23:48:13 +0000 (23:48 +0000)]
ASoC: mxs: convert not to use asoc_xxx()

ASoC is now unified asoc_xxx() into snd_soc_xxx().
This patch convert asoc_xxx() to snd_soc_xxx().

Signed-off-by: Kuninori Morimoto <kuninori.morimoto.gx@renesas.com>
Link: https://lore.kernel.org/r/871qf4s24j.wl-kuninori.morimoto.gx@renesas.com
Signed-off-by: Mark Brown <broonie@kernel.org>
11 months agoASoC: img: convert not to use asoc_xxx()
Kuninori Morimoto [Mon, 11 Sep 2023 23:48:07 +0000 (23:48 +0000)]
ASoC: img: convert not to use asoc_xxx()

ASoC is now unified asoc_xxx() into snd_soc_xxx().
This patch convert asoc_xxx() to snd_soc_xxx().

Signed-off-by: Kuninori Morimoto <kuninori.morimoto.gx@renesas.com>
Link: https://lore.kernel.org/r/8734zks24o.wl-kuninori.morimoto.gx@renesas.com
Signed-off-by: Mark Brown <broonie@kernel.org>
11 months agoASoC: fsl: convert not to use asoc_xxx()
Kuninori Morimoto [Mon, 11 Sep 2023 23:48:02 +0000 (23:48 +0000)]
ASoC: fsl: convert not to use asoc_xxx()

ASoC is now unified asoc_xxx() into snd_soc_xxx().
This patch convert asoc_xxx() to snd_soc_xxx().

Signed-off-by: Kuninori Morimoto <kuninori.morimoto.gx@renesas.com>
Link: https://lore.kernel.org/r/874jk0s24t.wl-kuninori.morimoto.gx@renesas.com
Signed-off-by: Mark Brown <broonie@kernel.org>
11 months agoASoC: dwc: convert not to use asoc_xxx()
Kuninori Morimoto [Mon, 11 Sep 2023 23:47:56 +0000 (23:47 +0000)]
ASoC: dwc: convert not to use asoc_xxx()

ASoC is now unified asoc_xxx() into snd_soc_xxx().
This patch convert asoc_xxx() to snd_soc_xxx().

Signed-off-by: Kuninori Morimoto <kuninori.morimoto.gx@renesas.com>
Link: https://lore.kernel.org/r/875y4gs24z.wl-kuninori.morimoto.gx@renesas.com
Signed-off-by: Mark Brown <broonie@kernel.org>
11 months agoASoC: bcm: convert not to use asoc_xxx()
Kuninori Morimoto [Mon, 11 Sep 2023 23:47:51 +0000 (23:47 +0000)]
ASoC: bcm: convert not to use asoc_xxx()

ASoC is now unified asoc_xxx() into snd_soc_xxx().
This patch convert asoc_xxx() to snd_soc_xxx().

Signed-off-by: Kuninori Morimoto <kuninori.morimoto.gx@renesas.com>
Link: https://lore.kernel.org/r/877cows255.wl-kuninori.morimoto.gx@renesas.com
Signed-off-by: Mark Brown <broonie@kernel.org>
11 months agoASoC: amd: convert not to use asoc_xxx()
Kuninori Morimoto [Mon, 11 Sep 2023 23:47:45 +0000 (23:47 +0000)]
ASoC: amd: convert not to use asoc_xxx()

ASoC is now unified asoc_xxx() into snd_soc_xxx().
This patch convert asoc_xxx() to snd_soc_xxx().

Signed-off-by: Kuninori Morimoto <kuninori.morimoto.gx@renesas.com>
Link: https://lore.kernel.org/r/878r9cs25b.wl-kuninori.morimoto.gx@renesas.com
Signed-off-by: Mark Brown <broonie@kernel.org>
11 months agoASoC: arm: convert not to use asoc_xxx()
Kuninori Morimoto [Mon, 11 Sep 2023 23:47:39 +0000 (23:47 +0000)]
ASoC: arm: convert not to use asoc_xxx()

ASoC is now unified asoc_xxx() into snd_soc_xxx().
This patch convert asoc_xxx() to snd_soc_xxx().

Signed-off-by: Kuninori Morimoto <kuninori.morimoto.gx@renesas.com>
Link: https://lore.kernel.org/r/87a5tss25h.wl-kuninori.morimoto.gx@renesas.com
Signed-off-by: Mark Brown <broonie@kernel.org>
11 months agoASoC: ti: convert not to use asoc_xxx()
Kuninori Morimoto [Mon, 11 Sep 2023 23:47:29 +0000 (23:47 +0000)]
ASoC: ti: convert not to use asoc_xxx()

ASoC is now unified asoc_xxx() into snd_soc_xxx().
This patch convert asoc_xxx() to snd_soc_xxx().

Signed-off-by: Kuninori Morimoto <kuninori.morimoto.gx@renesas.com>
Link: https://lore.kernel.org/r/87bke8s25q.wl-kuninori.morimoto.gx@renesas.com
Signed-off-by: Mark Brown <broonie@kernel.org>
11 months agoASoC: sh: convert not to use asoc_xxx()
Kuninori Morimoto [Mon, 11 Sep 2023 23:47:22 +0000 (23:47 +0000)]
ASoC: sh: convert not to use asoc_xxx()

ASoC is now unified asoc_xxx() into snd_soc_xxx().
This patch convert asoc_xxx() to snd_soc_xxx().

Signed-off-by: Kuninori Morimoto <kuninori.morimoto.gx@renesas.com>
Link: https://lore.kernel.org/r/87cyyos25y.wl-kuninori.morimoto.gx@renesas.com
Signed-off-by: Mark Brown <broonie@kernel.org>
11 months agoASoC: simple_card_utils.h: convert not to use asoc_xxx()
Kuninori Morimoto [Mon, 11 Sep 2023 23:47:09 +0000 (23:47 +0000)]
ASoC: simple_card_utils.h: convert not to use asoc_xxx()

ASoC is using 2 type of prefix (asoc_xxx() vs snd_soc_xxx()),
but these are unified into snd_soc_xxx().

simple_card / audio_graph drivers are historically using
asoc_xxx() prefix too. simple_card / audio_graph are not
ASoC framework, so let's use simple_card_xxx_() / audio_graph_xxx()
for global function prefix.

This patch has asoc_xxx() as define to keep compatible.
It will be removed if all drivers were switched to new style.

Signed-off-by: Kuninori Morimoto <kuninori.morimoto.gx@renesas.com>
Link: https://lore.kernel.org/r/87edj4s26a.wl-kuninori.morimoto.gx@renesas.com
Signed-off-by: Mark Brown <broonie@kernel.org>
11 months agoASoC: soc.h: convert asoc_xxx() to snd_soc_xxx()
Kuninori Morimoto [Mon, 11 Sep 2023 23:47:02 +0000 (23:47 +0000)]
ASoC: soc.h: convert asoc_xxx() to snd_soc_xxx()

ASoC is using 2 type of prefix (asoc_xxx() vs snd_soc_xxx()), but there
is no particular reason about that [1].
To reduce confusing, standarding these to snd_soc_xxx() is sensible.

This patch adds asoc_xxx() macro to keep compatible for a while.
It will be removed if all drivers were switched to new style.

Link: https://lore.kernel.org/r/87h6td3hus.wl-kuninori.morimoto.gx@renesas.com
Signed-off-by: Kuninori Morimoto <kuninori.morimoto.gx@renesas.com>
Link: https://lore.kernel.org/r/87fs3ks26i.wl-kuninori.morimoto.gx@renesas.com
Signed-off-by: Mark Brown <broonie@kernel.org>
11 months agoASoC: dt-bindings: tfa9879: Convert to dtschema
Bragatheswaran Manickavel [Thu, 21 Sep 2023 18:33:13 +0000 (00:03 +0530)]
ASoC: dt-bindings: tfa9879: Convert to dtschema

Convert the tfa9879 audio CODEC bindings to DT schema
No error/warning seen when running make dt_binding_check

Signed-off-by: Bragatheswaran Manickavel <bragathemanick0908@gmail.com>
Reviewed-by: Conor Dooley <conor.dooley@microchip.com>
Link: https://lore.kernel.org/r/20230921183313.54112-1-bragathemanick0908@gmail.com
Signed-off-by: Mark Brown <broonie@kernel.org>
11 months agoASoC: Add rtq9128 audio amplifier
Mark Brown [Thu, 21 Sep 2023 16:45:30 +0000 (17:45 +0100)]
ASoC: Add rtq9128 audio amplifier

Merge series from cy_huang@richtek.com:

This patch series adds Richtek rtq9128 automotive audio amplifier
support. It can deliver up to 4x75W into 4Ohm speaker from a 25V
supply in automotive applications.

11 months agoASoC: hdac_hda: fix HDA patch loader support
Bard Liao [Thu, 21 Sep 2023 06:43:17 +0000 (14:43 +0800)]
ASoC: hdac_hda: fix HDA patch loader support

The array size is irrelevant with SNDRV_CARDS. dev_index is from
codec address and the available codec number is HDA_MAX_CODECS.
Also, hda_pvt->fw is for a temporary use, no need to add a new extra
field in hdac_hda_priv{}.

Fixes: 842a62a75e70 ("ASoC: hdac_hda: add HDA patch loader support")
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>
Reviewed-by: Takashi Iwai <tiwai@suse.de>
Link: https://lore.kernel.org/r/20230921064317.2120452-1-yung-chuan.liao@linux.intel.com
Signed-off-by: Mark Brown <broonie@kernel.org>
11 months agoASoC: codecs: Add Richtek rtq9128 audio amplifier support
ChiYuan Huang [Wed, 20 Sep 2023 03:50:34 +0000 (11:50 +0800)]
ASoC: codecs: Add Richtek rtq9128 audio amplifier support

Add Richtek rtq9128 automotive audio amplifier.

Signed-off-by: ChiYuan Huang <cy_huang@richtek.com>
Link: https://lore.kernel.org/r/1695181834-5809-3-git-send-email-cy_huang@richtek.com
Signed-off-by: Mark Brown <broonie@kernel.org>
11 months agoASoC: dt-bindings: Add Richtek rtq9128 audio amplifier
ChiYuan Huang [Wed, 20 Sep 2023 03:50:33 +0000 (11:50 +0800)]
ASoC: dt-bindings: Add Richtek rtq9128 audio amplifier

Create richtek,rtq9128.yaml for rtq9128 amplifier.

Signed-off-by: ChiYuan Huang <cy_huang@richtek.com>
Reviewed-by: Krzysztof Kozlowski <krzysztof.kozlowski@linaro.org>
Link: https://lore.kernel.org/r/1695181834-5809-2-git-send-email-cy_huang@richtek.com
Signed-off-by: Mark Brown <broonie@kernel.org>
12 months agoMinor default jack pop performance updates
Mark Brown [Tue, 19 Sep 2023 17:22:20 +0000 (18:22 +0100)]
Minor default jack pop performance updates

Merge series from Charles Keepax <ckeepax@opensource.cirrus.com>:

Some small updates to the driver defaults to ensure a good pop
performance on jack insert and removal.

12 months agoASoC: SOF: ipc4/Intel: Support for firmware exception
Mark Brown [Tue, 19 Sep 2023 17:22:11 +0000 (18:22 +0100)]
ASoC: SOF: ipc4/Intel: Support for firmware exception

Merge series from Peter Ujfalusi <peter.ujfalusi@linux.intel.com>:

When a firmware crashes it creats a panic information into a telemetry
slot.  The panic format is defined by Zephyr, includes stack and
additional information to help to identify the reason for the crash.
Part of the firmware exception handling the firmware also sends an
EXCEPTION_CAUGHT notification.

This series implements the kernel side handling of the exception: print
information into the kernel log export the whole telemetry slot to user
space for tools extract additional information from the panic dump.

12 months agoASoC: SOF: ipc4-control: Support for Switch and Enum
Mark Brown [Tue, 19 Sep 2023 17:11:02 +0000 (18:11 +0100)]
ASoC: SOF: ipc4-control: Support for Switch and Enum

Merge series from Peter Ujfalusi <peter.ujfalusi@linux.intel.com>:

Currently IPC4 has no notion of a switch or enum type of control which
is a generic concept in ALSA.

The generic support for these control types will be as follows:

- large config is used to send the channel-value par array
- param_id of a SWITCH type is 200
- param_id of an ENUM type is 201

Each module need to support a switch or/and enum must handle these
universal param_ids.  The message payload is described by struct
sof_ipc4_control_msg_payload.

12 months agoASoC: intel: Add CS42L43 sdw machine driver support
Mark Brown [Tue, 19 Sep 2023 16:59:40 +0000 (17:59 +0100)]
ASoC: intel: Add CS42L43 sdw machine driver support

Merge series from Bard Liao <yung-chuan.liao@linux.intel.com>:

Add cs42l43 codec support to sof_sdw machine driver.

12 months agoASoC: SOF: Use generic IPC type identifiers
Mark Brown [Tue, 19 Sep 2023 16:59:30 +0000 (17:59 +0100)]
ASoC: SOF: Use generic IPC type identifiers

Merge series from Peter Ujfalusi <peter.ujfalusi@linux.intel.com>:

Hi,

rename the IPC type defines to be more generic and intuitive:
SOF_IPC -> SOF_IPC_TYPE_3
SOF_INTEL_IPC4 -> SOF_IPC_TYPE_4

No functional change, just renaming all around.

Regards,
Peter
---
Peter Ujfalusi (9):
  ASoC: SOF: Introduce generic names for IPC types
  ASoC: SOF: sof-pci-dev: Update the ipc_type module parameter
    description
  ASoC: SOF: Kconfig: Rename SND_SOC_SOF_INTEL_IPC4 to SND_SOC_SOF_IPC4
  ASoC: SOF: Use generic names for IPC types
  ASoC: SOF: amd: Use generic names for IPC types
  ASoC: SOF: imx: Use generic names for IPC types
  ASoC: SOF: Intel: Use generic names for IPC types
  ASoC: SOF: mediatek: Use generic names for IPC types
  ASoC: SOF: Drop unused IPC type defines

 include/sound/sof.h                         |   4 +-
 sound/soc/sof/Kconfig                       |   2 +-
 sound/soc/sof/Makefile                      |   4 +-
 sound/soc/sof/amd/pci-rmb.c                 |  10 +-
 sound/soc/sof/amd/pci-rn.c                  |  10 +-
 sound/soc/sof/amd/pci-vangogh.c             |  10 +-
 sound/soc/sof/imx/imx8.c                    |  20 +--
 sound/soc/sof/imx/imx8m.c                   |  10 +-
 sound/soc/sof/imx/imx8ulp.c                 |  10 +-
 sound/soc/sof/intel/Kconfig                 |  14 +-
 sound/soc/sof/intel/apl.c                   |   4 +-
 sound/soc/sof/intel/bdw.c                   |  10 +-
 sound/soc/sof/intel/byt.c                   |  30 ++--
 sound/soc/sof/intel/cnl.c                   |   4 +-
 sound/soc/sof/intel/hda-dai-ops.c           |   4 +-
 sound/soc/sof/intel/hda-dai.c               |   4 +-
 sound/soc/sof/intel/hda-loader.c            |   2 +-
 sound/soc/sof/intel/hda.c                   |   2 +-
 sound/soc/sof/intel/icl.c                   |   4 +-
 sound/soc/sof/intel/pci-apl.c               |  36 ++---
 sound/soc/sof/intel/pci-cnl.c               |  54 ++++----
 sound/soc/sof/intel/pci-icl.c               |  36 ++---
 sound/soc/sof/intel/pci-lnl.c               |  10 +-
 sound/soc/sof/intel/pci-mtl.c               |  12 +-
 sound/soc/sof/intel/pci-skl.c               |  20 +--
 sound/soc/sof/intel/pci-tgl.c               | 144 ++++++++++----------
 sound/soc/sof/intel/pci-tng.c               |  10 +-
 sound/soc/sof/intel/tgl.c                   |   4 +-
 sound/soc/sof/ipc.c                         |   6 +-
 sound/soc/sof/ipc3-dtrace.c                 |   2 +-
 sound/soc/sof/mediatek/mt8186/mt8186.c      |  20 +--
 sound/soc/sof/mediatek/mt8195/mt8195.c      |  10 +-
 sound/soc/sof/sof-acpi-dev.c                |   8 +-
 sound/soc/sof/sof-client-ipc-msg-injector.c |   4 +-
 sound/soc/sof/sof-client-probes.c           |   6 +-
 sound/soc/sof/sof-client.c                  |  26 ++--
 sound/soc/sof/sof-of-dev.c                  |   6 +-
 sound/soc/sof/sof-pci-dev.c                 |   2 +-
 38 files changed, 286 insertions(+), 288 deletions(-)

--
2.42.0

12 months agoASoC: hdac_hda: add HDA patch loader support
Bard Liao [Tue, 19 Sep 2023 08:32:09 +0000 (16:32 +0800)]
ASoC: hdac_hda: add HDA patch loader support

HDA patch loader is supported by legacy HDA driver. Implement it on
ASoC HDA driver, too.

Signed-off-by: Bard Liao <yung-chuan.liao@linux.intel.com>
Reviewed-by: Kai Vehmanen <kai.vehmanen@linux.intel.com>
Reviewed-by: Pierre-Louis Bossart <pierre-louis.bossart@linux.intel.com>
Reviewed-by: Rander Wang <rander.wang@intel.com>
Link: https://lore.kernel.org/r/20230919083209.1919921-1-yung-chuan.liao@linux.intel.com
Signed-off-by: Mark Brown <broonie@kernel.org>
12 months agoASoC: SOF: Drop unused IPC type defines
Peter Ujfalusi [Tue, 19 Sep 2023 10:42:26 +0000 (13:42 +0300)]
ASoC: SOF: Drop unused IPC type defines

The SOF stack now uses the generic names for the IPC type, the defines can
be dropped.

Signed-off-by: Peter Ujfalusi <peter.ujfalusi@linux.intel.com>
Reviewed-by: Daniel Baluta <daniel.baluta@nxp.com>
Reviewed-by: Rander Wang <rander.wang@intel.com>
Reviewed-by: Ranjani Sridharan <ranjani.sridharan@linux.intel.com>
Reviewed-by: Pierre-Louis Bossart <pierre-louis.bossart@linux.intel.com>
Link: https://lore.kernel.org/r/20230919104226.32239-10-peter.ujfalusi@linux.intel.com
Signed-off-by: Mark Brown <broonie@kernel.org>
12 months agoASoC: SOF: mediatek: Use generic names for IPC types
Peter Ujfalusi [Tue, 19 Sep 2023 10:42:25 +0000 (13:42 +0300)]
ASoC: SOF: mediatek: Use generic names for IPC types

Use the new SOF_IPC_TYPE_3 in core code.

No functional changes, just renaming.

Signed-off-by: Peter Ujfalusi <peter.ujfalusi@linux.intel.com>
Reviewed-by: Daniel Baluta <daniel.baluta@nxp.com>
Reviewed-by: Rander Wang <rander.wang@intel.com>
Reviewed-by: Ranjani Sridharan <ranjani.sridharan@linux.intel.com>
Reviewed-by: Pierre-Louis Bossart <pierre-louis.bossart@linux.intel.com>
Link: https://lore.kernel.org/r/20230919104226.32239-9-peter.ujfalusi@linux.intel.com
Signed-off-by: Mark Brown <broonie@kernel.org>
12 months agoASoC: SOF: Intel: Use generic names for IPC types
Peter Ujfalusi [Tue, 19 Sep 2023 10:42:24 +0000 (13:42 +0300)]
ASoC: SOF: Intel: Use generic names for IPC types

Use the new SOF_IPC_TYPE_3, SOF_IPC_TYPE_4 in core code.

No functional changes, just renaming.

Signed-off-by: Peter Ujfalusi <peter.ujfalusi@linux.intel.com>
Reviewed-by: Daniel Baluta <daniel.baluta@nxp.com>
Reviewed-by: Rander Wang <rander.wang@intel.com>
Reviewed-by: Ranjani Sridharan <ranjani.sridharan@linux.intel.com>
Reviewed-by: Pierre-Louis Bossart <pierre-louis.bossart@linux.intel.com>
Link: https://lore.kernel.org/r/20230919104226.32239-8-peter.ujfalusi@linux.intel.com
Signed-off-by: Mark Brown <broonie@kernel.org>
12 months agoASoC: SOF: imx: Use generic names for IPC types
Peter Ujfalusi [Tue, 19 Sep 2023 10:42:23 +0000 (13:42 +0300)]
ASoC: SOF: imx: Use generic names for IPC types

Use the new SOF_IPC_TYPE_3 in core code.

No functional changes, just renaming.

Signed-off-by: Peter Ujfalusi <peter.ujfalusi@linux.intel.com>
Reviewed-by: Daniel Baluta <daniel.baluta@nxp.com>
Reviewed-by: Rander Wang <rander.wang@intel.com>
Reviewed-by: Ranjani Sridharan <ranjani.sridharan@linux.intel.com>
Reviewed-by: Pierre-Louis Bossart <pierre-louis.bossart@linux.intel.com>
Link: https://lore.kernel.org/r/20230919104226.32239-7-peter.ujfalusi@linux.intel.com
Signed-off-by: Mark Brown <broonie@kernel.org>
12 months agoASoC: SOF: amd: Use generic names for IPC types
Peter Ujfalusi [Tue, 19 Sep 2023 10:42:22 +0000 (13:42 +0300)]
ASoC: SOF: amd: Use generic names for IPC types

Use the new SOF_IPC_TYPE_3 in core code.

No functional changes, just renaming.

Signed-off-by: Peter Ujfalusi <peter.ujfalusi@linux.intel.com>
Reviewed-by: Daniel Baluta <daniel.baluta@nxp.com>
Reviewed-by: Rander Wang <rander.wang@intel.com>
Reviewed-by: Ranjani Sridharan <ranjani.sridharan@linux.intel.com>
Reviewed-by: Pierre-Louis Bossart <pierre-louis.bossart@linux.intel.com>
Link: https://lore.kernel.org/r/20230919104226.32239-6-peter.ujfalusi@linux.intel.com
Signed-off-by: Mark Brown <broonie@kernel.org>
12 months agoASoC: SOF: Use generic names for IPC types
Peter Ujfalusi [Tue, 19 Sep 2023 10:42:21 +0000 (13:42 +0300)]
ASoC: SOF: Use generic names for IPC types

Use the new SOF_IPC_TYPE_3, SOF_IPC_TYPE_4 in core code.

No functional changes, just renaming.

Signed-off-by: Peter Ujfalusi <peter.ujfalusi@linux.intel.com>
Reviewed-by: Daniel Baluta <daniel.baluta@nxp.com>
Reviewed-by: Rander Wang <rander.wang@intel.com>
Reviewed-by: Ranjani Sridharan <ranjani.sridharan@linux.intel.com>
Reviewed-by: Pierre-Louis Bossart <pierre-louis.bossart@linux.intel.com>
Link: https://lore.kernel.org/r/20230919104226.32239-5-peter.ujfalusi@linux.intel.com
Signed-off-by: Mark Brown <broonie@kernel.org>
12 months agoASoC: SOF: Kconfig: Rename SND_SOC_SOF_INTEL_IPC4 to SND_SOC_SOF_IPC4
Peter Ujfalusi [Tue, 19 Sep 2023 10:42:20 +0000 (13:42 +0300)]
ASoC: SOF: Kconfig: Rename SND_SOC_SOF_INTEL_IPC4 to SND_SOC_SOF_IPC4

Drop the Intel from the IPC type Kconfig option

Signed-off-by: Peter Ujfalusi <peter.ujfalusi@linux.intel.com>
Reviewed-by: Daniel Baluta <daniel.baluta@nxp.com>
Reviewed-by: Rander Wang <rander.wang@intel.com>
Reviewed-by: Ranjani Sridharan <ranjani.sridharan@linux.intel.com>
Reviewed-by: Pierre-Louis Bossart <pierre-louis.bossart@linux.intel.com>
Link: https://lore.kernel.org/r/20230919104226.32239-4-peter.ujfalusi@linux.intel.com
Signed-off-by: Mark Brown <broonie@kernel.org>
12 months agoASoC: SOF: sof-pci-dev: Update the ipc_type module parameter description
Peter Ujfalusi [Tue, 19 Sep 2023 10:42:19 +0000 (13:42 +0300)]
ASoC: SOF: sof-pci-dev: Update the ipc_type module parameter description

Clarify the description of the ipc_type module parameter and drop the Intel
CAVS in favor of IPC4.

Signed-off-by: Peter Ujfalusi <peter.ujfalusi@linux.intel.com>
Reviewed-by: Daniel Baluta <daniel.baluta@nxp.com>
Reviewed-by: Rander Wang <rander.wang@intel.com>
Reviewed-by: Ranjani Sridharan <ranjani.sridharan@linux.intel.com>
Reviewed-by: Pierre-Louis Bossart <pierre-louis.bossart@linux.intel.com>
Link: https://lore.kernel.org/r/20230919104226.32239-3-peter.ujfalusi@linux.intel.com
Signed-off-by: Mark Brown <broonie@kernel.org>
12 months agoASoC: SOF: Introduce generic names for IPC types
Peter Ujfalusi [Tue, 19 Sep 2023 10:42:18 +0000 (13:42 +0300)]
ASoC: SOF: Introduce generic names for IPC types

Change the enum names for the IPC types to be more descriptive and drop
tying the IPC4 to Intel SoCs.

Add defines to avoid build breakage while the related code is
modified to use the new enum names.

Signed-off-by: Peter Ujfalusi <peter.ujfalusi@linux.intel.com>
Reviewed-by: Daniel Baluta <daniel.baluta@nxp.com>
Reviewed-by: Rander Wang <rander.wang@intel.com>
Reviewed-by: Ranjani Sridharan <ranjani.sridharan@linux.intel.com>
Reviewed-by: Pierre-Louis Bossart <pierre-louis.bossart@linux.intel.com>
Link: https://lore.kernel.org/r/20230919104226.32239-2-peter.ujfalusi@linux.intel.com
Signed-off-by: Mark Brown <broonie@kernel.org>
12 months agoASoC: dt-bindings: ASoC: cirrus,cs42l43: Update a couple of default values
Charles Keepax [Tue, 19 Sep 2023 10:31:12 +0000 (11:31 +0100)]
ASoC: dt-bindings: ASoC: cirrus,cs42l43: Update a couple of default values

The bias sense is being enabled by default in the driver, and the
default detect time is being dropped slightly. Update the binding
document to match.

Signed-off-by: Charles Keepax <ckeepax@opensource.cirrus.com>
Link: https://lore.kernel.org/r/20230919103116.580305-2-ckeepax@opensource.cirrus.com
Signed-off-by: Mark Brown <broonie@kernel.org>
12 months agoASoC: cs42l43: Extend timeout on bias sense timeout
Charles Keepax [Tue, 19 Sep 2023 10:31:16 +0000 (11:31 +0100)]
ASoC: cs42l43: Extend timeout on bias sense timeout

For very slow removals the current bias sense timeout is sometimes too
short and unclamps the mic bias before the jack removal is properly
detected by the tip detect, causing a pop. As bias sense should be
tuned to deliver very few false positives, increase the timeout fairly
dramatically to cover all but the most exaggerated removals.

Signed-off-by: Charles Keepax <ckeepax@opensource.cirrus.com>
Link: https://lore.kernel.org/r/20230919103116.580305-6-ckeepax@opensource.cirrus.com
Signed-off-by: Mark Brown <broonie@kernel.org>
12 months agoASoC: cs42l43: Move headset bias sense enable earlier in process
Charles Keepax [Tue, 19 Sep 2023 10:31:15 +0000 (11:31 +0100)]
ASoC: cs42l43: Move headset bias sense enable earlier in process

Currently the bias sense is enabled along with the button detect, but
this has two problems. Firstly, the detections themselves arn't covered
by the bias sense, potentially resulting in pops and secondly, the
sequence of enabling/disabling looks like:

enable bias
enable bias sense
disable bias sense
disable bias

When the bias sense is disabled but the bias is still on the clamp is
removed and a pop results. Fix both of these issues by moving the bias
sense enable/disable to be along with the bias itself. With a resulting
sequence of:

enable bias sense
enable bias
disable bias
disable bias sense

Signed-off-by: Charles Keepax <ckeepax@opensource.cirrus.com>
Link: https://lore.kernel.org/r/20230919103116.580305-5-ckeepax@opensource.cirrus.com
Signed-off-by: Mark Brown <broonie@kernel.org>
12 months agoASoC: cs42l43: Enable bias sense by default
Charles Keepax [Tue, 19 Sep 2023 10:31:14 +0000 (11:31 +0100)]
ASoC: cs42l43: Enable bias sense by default

Improve the default pop performance on jack removal by enabling bias
sense on the least sensitive level by default.

Signed-off-by: Charles Keepax <ckeepax@opensource.cirrus.com>
Link: https://lore.kernel.org/r/20230919103116.580305-4-ckeepax@opensource.cirrus.com
Signed-off-by: Mark Brown <broonie@kernel.org>
12 months agoASoC: cs42l43: Lower default type detect time
Charles Keepax [Tue, 19 Sep 2023 10:31:13 +0000 (11:31 +0100)]
ASoC: cs42l43: Lower default type detect time

The current default is a little excessive, reduce the pop on insertion
by reducing the time a little. The new value of 1000uS is still pretty
conservative.

Signed-off-by: Charles Keepax <ckeepax@opensource.cirrus.com>
Link: https://lore.kernel.org/r/20230919103116.580305-3-ckeepax@opensource.cirrus.com
Signed-off-by: Mark Brown <broonie@kernel.org>
12 months agoASoC: SOF: ipc4-control: Add support for ALSA enum control
Peter Ujfalusi [Tue, 19 Sep 2023 10:31:15 +0000 (13:31 +0300)]
ASoC: SOF: ipc4-control: Add support for ALSA enum control

Enum controls use generic param_id and a generic struct where the data
is passed to the firmware.

Signed-off-by: Peter Ujfalusi <peter.ujfalusi@linux.intel.com>
Reviewed-by: Bard Liao <yung-chuan.liao@linux.intel.com>
Reviewed-by: Pierre-Louis Bossart <pierre-louis.bossart@linux.intel.com>
Link: https://lore.kernel.org/r/20230919103115.30783-4-peter.ujfalusi@linux.intel.com
Signed-off-by: Mark Brown <broonie@kernel.org>
12 months agoASoC: SOF: ipc4-control: Add support for ALSA switch control
Peter Ujfalusi [Tue, 19 Sep 2023 10:31:14 +0000 (13:31 +0300)]
ASoC: SOF: ipc4-control: Add support for ALSA switch control

Volume controls with a max value of 1 are switches.
Switch controls use generic param_id and a generic struct where the data
is passed to the firmware.

Signed-off-by: Peter Ujfalusi <peter.ujfalusi@linux.intel.com>
Reviewed-by: Bard Liao <yung-chuan.liao@linux.intel.com>
Reviewed-by: Pierre-Louis Bossart <pierre-louis.bossart@linux.intel.com>
Link: https://lore.kernel.org/r/20230919103115.30783-3-peter.ujfalusi@linux.intel.com
Signed-off-by: Mark Brown <broonie@kernel.org>
12 months agoASoC: SOF: ipc4-topology: Add definition for generic switch/enum control
Peter Ujfalusi [Tue, 19 Sep 2023 10:31:13 +0000 (13:31 +0300)]
ASoC: SOF: ipc4-topology: Add definition for generic switch/enum control

Currently IPC4 has no notion of a switch or enum type of control which is
a generic concept in ALSA.

The generic support for these control types will be as follows:
- large config is used to send the channel-value par array
- param_id of a SWITCH type is 200
- param_id of an ENUM type is 201

Each module need to support a switch or/and enum must handle these
universal param_ids.
The message payload is described by struct sof_ipc4_control_msg_payload.

Signed-off-by: Peter Ujfalusi <peter.ujfalusi@linux.intel.com>
Reviewed-by: Bard Liao <yung-chuan.liao@linux.intel.com>
Reviewed-by: Pierre-Louis Bossart <pierre-louis.bossart@linux.intel.com>
Link: https://lore.kernel.org/r/20230919103115.30783-2-peter.ujfalusi@linux.intel.com
Signed-off-by: Mark Brown <broonie@kernel.org>
12 months agoASoC: SOF: ipc4: handle EXCEPTION_CAUGHT notification from firmware
Rander Wang [Tue, 19 Sep 2023 09:24:16 +0000 (12:24 +0300)]
ASoC: SOF: ipc4: handle EXCEPTION_CAUGHT notification from firmware

Driver will receive exception IPC message and process it by
snd_sof_dsp_panic.

Signed-off-by: Rander Wang <rander.wang@intel.com>
Reviewed-by: Péter Ujfalusi <peter.ujfalusi@linux.intel.com>
Reviewed-by: Kai Vehmanen <kai.vehmanen@linux.intel.com>
Reviewed-by: Pierre-Louis Bossart <pierre-louis.bossart@linux.intel.com>
Reviewed-by: Guennadi Liakhovetski <guennadi.liakhovetski@linux.intel.com>
Signed-off-by: Peter Ujfalusi <peter.ujfalusi@linux.intel.com>
Link: https://lore.kernel.org/r/20230919092416.4137-10-peter.ujfalusi@linux.intel.com
Signed-off-by: Mark Brown <broonie@kernel.org>
12 months agoASoC: SOF: Intel: hda: add ipc4 FW panic support on CAVS 2.5+ platforms
Rander Wang [Tue, 19 Sep 2023 09:24:15 +0000 (12:24 +0300)]
ASoC: SOF: Intel: hda: add ipc4 FW panic support on CAVS 2.5+ platforms

Get the FW panic information from telemetry data in memory window and
dump it to kernel log. The old platforms before CAVS 2.5+ don't support
it since there is no support in FW for them.

Signed-off-by: Rander Wang <rander.wang@intel.com>
Reviewed-by: Péter Ujfalusi <peter.ujfalusi@linux.intel.com>
Reviewed-by: Kai Vehmanen <kai.vehmanen@linux.intel.com>
Reviewed-by: Pierre-Louis Bossart <pierre-louis.bossart@linux.intel.com>
Reviewed-by: Guennadi Liakhovetski <guennadi.liakhovetski@linux.intel.com>
Signed-off-by: Peter Ujfalusi <peter.ujfalusi@linux.intel.com>
Link: https://lore.kernel.org/r/20230919092416.4137-9-peter.ujfalusi@linux.intel.com
Signed-off-by: Mark Brown <broonie@kernel.org>
12 months agoASoC: SOF: Intel: mtl: dump dsp stack
Rander Wang [Tue, 19 Sep 2023 09:24:14 +0000 (12:24 +0300)]
ASoC: SOF: Intel: mtl: dump dsp stack

Dump dsp stack with sof_ipc4_intel_dump_telemetry_state since dsp stack
information is included by telemetry data. This also supports lnl since
the mtl code is reused.

Signed-off-by: Rander Wang <rander.wang@intel.com>
Reviewed-by: Péter Ujfalusi <peter.ujfalusi@linux.intel.com>
Reviewed-by: Kai Vehmanen <kai.vehmanen@linux.intel.com>
Reviewed-by: Pierre-Louis Bossart <pierre-louis.bossart@linux.intel.com>
Reviewed-by: Guennadi Liakhovetski <guennadi.liakhovetski@linux.intel.com>
Signed-off-by: Peter Ujfalusi <peter.ujfalusi@linux.intel.com>
Link: https://lore.kernel.org/r/20230919092416.4137-8-peter.ujfalusi@linux.intel.com
Signed-off-by: Mark Brown <broonie@kernel.org>
12 months agoASoC: SOF: Intel: add telemetry retrieval support on Intel platforms
Rander Wang [Tue, 19 Sep 2023 09:24:13 +0000 (12:24 +0300)]
ASoC: SOF: Intel: add telemetry retrieval support on Intel platforms

Telemetry data is decoded based on intel xtensa design and printed in
kernel log by sof debug framework.

Signed-off-by: Rander Wang <rander.wang@intel.com>
Reviewed-by: Péter Ujfalusi <peter.ujfalusi@linux.intel.com>
Reviewed-by: Kai Vehmanen <kai.vehmanen@linux.intel.com>
Reviewed-by: Pierre-Louis Bossart <pierre-louis.bossart@linux.intel.com>
Reviewed-by: Guennadi Liakhovetski <guennadi.liakhovetski@linux.intel.com>
Signed-off-by: Peter Ujfalusi <peter.ujfalusi@linux.intel.com>
Link: https://lore.kernel.org/r/20230919092416.4137-7-peter.ujfalusi@linux.intel.com
Signed-off-by: Mark Brown <broonie@kernel.org>
12 months agoASoC: SOF: ipc4: add exception node in sof debugfs directory
Rander Wang [Tue, 19 Sep 2023 09:24:12 +0000 (12:24 +0300)]
ASoC: SOF: ipc4: add exception node in sof debugfs directory

The exception node is created when FW is ready and clear to
zero when FW post boot.

Signed-off-by: Rander Wang <rander.wang@intel.com>
Reviewed-by: Péter Ujfalusi <peter.ujfalusi@linux.intel.com>
Reviewed-by: Kai Vehmanen <kai.vehmanen@linux.intel.com>
Reviewed-by: Pierre-Louis Bossart <pierre-louis.bossart@linux.intel.com>
Reviewed-by: Guennadi Liakhovetski <guennadi.liakhovetski@linux.intel.com>
Signed-off-by: Peter Ujfalusi <peter.ujfalusi@linux.intel.com>
Link: https://lore.kernel.org/r/20230919092416.4137-6-peter.ujfalusi@linux.intel.com
Signed-off-by: Mark Brown <broonie@kernel.org>
12 months agoASoC: SOF: ipc4: add definition of telemetry slot for exception handling
Rander Wang [Tue, 19 Sep 2023 09:24:11 +0000 (12:24 +0300)]
ASoC: SOF: ipc4: add definition of telemetry slot for exception handling

Core dump includes hardware platform information, cpu registers and
exception call stack. FW saves core dump to telemetry slot in shared
memory window for host in the event of FW exception. This patch creates
exception node in debugfs for user to dump telemetry data.

Signed-off-by: Rander Wang <rander.wang@intel.com>
Reviewed-by: Péter Ujfalusi <peter.ujfalusi@linux.intel.com>
Reviewed-by: Kai Vehmanen <kai.vehmanen@linux.intel.com>
Reviewed-by: Pierre-Louis Bossart <pierre-louis.bossart@linux.intel.com>
Reviewed-by: Guennadi Liakhovetski <guennadi.liakhovetski@linux.intel.com>
Signed-off-by: Peter Ujfalusi <peter.ujfalusi@linux.intel.com>
Link: https://lore.kernel.org/r/20230919092416.4137-5-peter.ujfalusi@linux.intel.com
Signed-off-by: Mark Brown <broonie@kernel.org>
12 months agoASoC: SOF: ipc4: add a helper function to search debug slot
Rander Wang [Tue, 19 Sep 2023 09:24:10 +0000 (12:24 +0300)]
ASoC: SOF: ipc4: add a helper function to search debug slot

Currently IPC4 supports GDB slot, telemetry slot and
debug slot. This helper function will be used to get
the slot offset in debug windows for further processing.

Signed-off-by: Rander Wang <rander.wang@intel.com>
Reviewed-by: Péter Ujfalusi <peter.ujfalusi@linux.intel.com>
Reviewed-by: Kai Vehmanen <kai.vehmanen@linux.intel.com>
Reviewed-by: Pierre-Louis Bossart <pierre-louis.bossart@linux.intel.com>
Reviewed-by: Guennadi Liakhovetski <guennadi.liakhovetski@linux.intel.com>
Signed-off-by: Peter Ujfalusi <peter.ujfalusi@linux.intel.com>
Link: https://lore.kernel.org/r/20230919092416.4137-4-peter.ujfalusi@linux.intel.com
Signed-off-by: Mark Brown <broonie@kernel.org>
12 months agoASoC: SOF: ipc4-mtrace: move debug slot related definitions to header.h
Rander Wang [Tue, 19 Sep 2023 09:24:09 +0000 (12:24 +0300)]
ASoC: SOF: ipc4-mtrace: move debug slot related definitions to header.h

The macro definitions of debug slot can be used by gdb, telemetry
and mtrace log, so move these definitions to header.h from mtrace.
Then these macro definitions can be shared

Signed-off-by: Rander Wang <rander.wang@intel.com>
Reviewed-by: Péter Ujfalusi <peter.ujfalusi@linux.intel.com>
Reviewed-by: Kai Vehmanen <kai.vehmanen@linux.intel.com>
Reviewed-by: Pierre-Louis Bossart <pierre-louis.bossart@linux.intel.com>
Reviewed-by: Guennadi Liakhovetski <guennadi.liakhovetski@linux.intel.com>
Signed-off-by: Peter Ujfalusi <peter.ujfalusi@linux.intel.com>
Link: https://lore.kernel.org/r/20230919092416.4137-3-peter.ujfalusi@linux.intel.com
Signed-off-by: Mark Brown <broonie@kernel.org>
12 months agoASoC: SOF: Xtensa: dump ar registers to restore call stack
Rander Wang [Tue, 19 Sep 2023 09:24:08 +0000 (12:24 +0300)]
ASoC: SOF: Xtensa: dump ar registers to restore call stack

On Xtensa platform ar0 is for caller address and ar1 is for stack
address. The ar register dump can be used to rebuild call stack with
FW elf file by debug tools.

Signed-off-by: Rander Wang <rander.wang@intel.com>
Reviewed-by: Péter Ujfalusi <peter.ujfalusi@linux.intel.com>
Reviewed-by: Kai Vehmanen <kai.vehmanen@linux.intel.com>
Reviewed-by: Pierre-Louis Bossart <pierre-louis.bossart@linux.intel.com>
Reviewed-by: Guennadi Liakhovetski <guennadi.liakhovetski@linux.intel.com>
Signed-off-by: Peter Ujfalusi <peter.ujfalusi@linux.intel.com>
Link: https://lore.kernel.org/r/20230919092416.4137-2-peter.ujfalusi@linux.intel.com
Signed-off-by: Mark Brown <broonie@kernel.org>
12 months agoASoC: Intel: soc-acpi-intel-mtl-match: add acpi match table for cdb35l56-eight-c
Chao Song [Tue, 19 Sep 2023 02:00:11 +0000 (10:00 +0800)]
ASoC: Intel: soc-acpi-intel-mtl-match: add acpi match table for cdb35l56-eight-c

This patch adds acpi match table for cdb35l56-eight-c
AIC board from Cirrus Logic.

The codec layout is configured as:
    - Link0: CS42L43 Jack
    - Link1: 2x CS35L56 Speaker
    - Link2: 2x CS35L56 Speaker

Signed-off-by: Chao Song <chao.song@linux.intel.com>
Reviewed-by: Pierre-Louis Bossart <pierre-louis.bossart@linux.intel.com>
Signed-off-by: Bard Liao <yung-chuan.liao@linux.intel.com>
Link: https://lore.kernel.org/r/20230919020011.1896041-3-yung-chuan.liao@linux.intel.com
Signed-off-by: Mark Brown <broonie@kernel.org>
12 months agoASoC: intel: sof_sdw: Add CS42L43 CODEC support
Bard Liao [Tue, 19 Sep 2023 02:00:10 +0000 (10:00 +0800)]
ASoC: intel: sof_sdw: Add CS42L43 CODEC support

Add support for the Cirrus Logic CS42L43 using SoundWire.

Signed-off-by: Lucas Tanure <tanureal@opensource.cirrus.com>
Signed-off-by: Charles Keepax <ckeepax@opensource.cirrus.com>
Signed-off-by: Bard Liao <yung-chuan.liao@linux.intel.com>
Reviewed-by: Pierre-Louis Bossart <pierre-louis.bossart@linux.intel.com>
Link: https://lore.kernel.org/r/20230919020011.1896041-2-yung-chuan.liao@linux.intel.com
Signed-off-by: Mark Brown <broonie@kernel.org>
12 months agoASoC: da7213: add .auto_selectable_formats support
Mark Brown [Mon, 18 Sep 2023 16:36:29 +0000 (17:36 +0100)]
ASoC: da7213: add .auto_selectable_formats support

Merge series from Kuninori Morimoto <kuninori.morimoto.gx@renesas.com>:

da7213 is still using M/S instead of P/C for SND_SOC_DAIFMT_CBx_CFx.
[PATCH 1/2] will update it.
[PATCH 2/2] will enable DAI format automatic select.

12 months agoASoC: da7213: add .auto_selectable_formats support
Kuninori Morimoto [Mon, 11 Sep 2023 01:41:55 +0000 (01:41 +0000)]
ASoC: da7213: add .auto_selectable_formats support

By this patch, DAI format might be automatically selected
(Depends on paired DAI, and/or Sound Card).

Signed-off-by: Kuninori Morimoto <kuninori.morimoto.gx@renesas.com>
Cc: Linh Phung <linh.phung.jy@renesas.com>
Tested-by: Khanh Le <khanh.le.xr@renesas.com>
Link: https://lore.kernel.org/r/87y1hdh4f1.wl-kuninori.morimoto.gx@renesas.com
Signed-off-by: Mark Brown <broonie@kernel.org>
12 months agoASoC: da7213: tidyup SND_SOC_DAIFMT_xxx
Kuninori Morimoto [Mon, 11 Sep 2023 01:41:48 +0000 (01:41 +0000)]
ASoC: da7213: tidyup SND_SOC_DAIFMT_xxx

We should use P/C instead of M/S for SND_SOC_DAIFMT_CBx_CFx.
We should use SND_SOC_DAIFMT_xxx instead of SND_SOC_DAI_FORMAT_xxx
This patch tidyup these.

Signed-off-by: Kuninori Morimoto <kuninori.morimoto.gx@renesas.com>
Link: https://lore.kernel.org/r/87zg1th4f8.wl-kuninori.morimoto.gx@renesas.com
Signed-off-by: Mark Brown <broonie@kernel.org>
12 months agoASoC: dt-bindings: wlf,wm8782: Add wlf,fsampen property
John Watts [Mon, 18 Sep 2023 13:15:32 +0000 (23:15 +1000)]
ASoC: dt-bindings: wlf,wm8782: Add wlf,fsampen property

The WM8782 can safely support rates higher than 48kHz by changing the
value of the FSAMPEN pin.

Allow specifying the FSAMPEN pin value in the device tree.

Signed-off-by: John Watts <contact@jookia.org>
Acked-by: Charles Keepax <ckeepax@opensource.cirrus.com>
Link: https://lore.kernel.org/r/20230918131532.2257615-4-contact@jookia.org
Signed-off-by: Mark Brown <broonie@kernel.org>
12 months agoASoC: wm8782: Use wlf,fsampen device tree property
John Watts [Mon, 18 Sep 2023 13:15:31 +0000 (23:15 +1000)]
ASoC: wm8782: Use wlf,fsampen device tree property

The wm8782 supports rates 96kHz and 192kHz as long as the hardware
is configured properly. Allow this to be specified in the device tree.

Signed-off-by: John Watts <contact@jookia.org>
Acked-by: Charles Keepax <ckeepax@opensource.cirrus.com>
Link: https://lore.kernel.org/r/20230918131532.2257615-3-contact@jookia.org
Signed-off-by: Mark Brown <broonie@kernel.org>
12 months agoASoC: wm8782: Constrain maximum audio rate at runtime
John Watts [Mon, 18 Sep 2023 13:15:30 +0000 (23:15 +1000)]
ASoC: wm8782: Constrain maximum audio rate at runtime

The wm8782 supports up to 192kHz audio when pins are set correctly.
Instead of hardcoding which rates are supported constrain them at
runtime based on a max_rate variable.

Signed-off-by: John Watts <contact@jookia.org>
Acked-by: Charles Keepax <ckeepax@opensource.cirrus.com>
Link: https://lore.kernel.org/r/20230918131532.2257615-2-contact@jookia.org
Signed-off-by: Mark Brown <broonie@kernel.org>
12 months agoASoC: cs42l43: make const array controls static
Colin Ian King [Fri, 15 Sep 2023 09:26:39 +0000 (10:26 +0100)]
ASoC: cs42l43: make const array controls static

Don't populate the const array controls on the stack, instead make it
static.

Signed-off-by: Colin Ian King <colin.i.king@gmail.com>
Acked-by: Charles Keepax <ckeepax@opensource.cirrus.com>
Link: https://lore.kernel.org/r/20230915092639.31074-1-colin.i.king@gmail.com
Signed-off-by: Mark Brown <broonie@kernel.org>
12 months agoASoC: Intel: common: add ACPI matching tables for Arrow Lake
Arun T [Fri, 15 Sep 2023 08:06:35 +0000 (16:06 +0800)]
ASoC: Intel: common: add ACPI matching tables for Arrow Lake

Initial support for ARL w/ RT711

Signed-off-by: Arun T <arun.t@intel.com>
Reviewed-by: Kai Vehmanen <kai.vehmanen@linux.intel.com>
Reviewed-by: Pierre-Louis Bossart <pierre-louis.bossart@linux.intel.com>
Reviewed-by: Ranjani Sridharan <ranjani.sridharan@linux.intel.com>
Signed-off-by: Bard Liao <yung-chuan.liao@linux.intel.com>
Link: https://lore.kernel.org/r/20230915080635.1619942-1-yung-chuan.liao@linux.intel.com
Signed-off-by: Mark Brown <broonie@kernel.org>
12 months agoASoC: SOF: ipc4: Fixup dailink format based on copier
Mark Brown [Fri, 15 Sep 2023 20:16:37 +0000 (21:16 +0100)]
ASoC: SOF: ipc4: Fixup dailink format based on copier

Merge series from Peter Ujfalusi <peter.ujfalusi@linux.intel.com>:

If the copier supports a single format on the DAI side we should fixup the BE
dailink to use this single format.

12 months agoASoC: intel: sof_sdw: Remove large global CPUs array
Mark Brown [Fri, 15 Sep 2023 18:03:43 +0000 (19:03 +0100)]
ASoC: intel: sof_sdw: Remove large global CPUs array

Merge series from Bard Liao <yung-chuan.liao@linux.intel.com>:

Rather than keeping a single array of CPU dai link components allocate a
smaller one for each DAI link, this reduces the amount of state that
needs to be passed back and forth in the driver.

12 months agoASoC: SOF: ipc4/Intel: Implement split fw library
Mark Brown [Fri, 15 Sep 2023 18:03:35 +0000 (19:03 +0100)]
ASoC: SOF: ipc4/Intel: Implement split fw library

Merge series from Peter Ujfalusi <peter.ujfalusi@linux.intel.com>:

This series implements support for split library loading to comply with the HDA
DMA programming sequence recommendation, which is:
1. DSP side DMA programming and GEN bit set to 1
2. host side DMA programming and RUN bit set to 1

The SOF support for library loading is based on this sequence, backwards
compatibility with older reference firmware is supported (where only the
LOAD_LIBRARY message is supported).

12 months agoASoC: cs35l56: Define and export I2C/SPI pm_ops only
Mark Brown [Fri, 15 Sep 2023 18:03:27 +0000 (19:03 +0100)]
ASoC: cs35l56: Define and export I2C/SPI pm_ops only

Merge series from Richard Fitzgerald <rf@opensource.cirrus.com>:

These 3 patches update the pm_ops for I2C/SPI so that they are only built
and exported if they are needed.

12 months agoASoC: Intel: machine driver update
Mark Brown [Fri, 15 Sep 2023 18:03:19 +0000 (19:03 +0100)]
ASoC: Intel: machine driver update

Merge series from Bard Liao <yung-chuan.liao@linux.intel.com>:

Some cleanups from Brent Lu for I2S platforms. And minor additions for
RVPs and Chromebooks.

12 months agoASoC: Intel: sof_da7219: use ssp-common module to detect codec
Brent Lu [Fri, 15 Sep 2023 12:48:52 +0000 (20:48 +0800)]
ASoC: Intel: sof_da7219: use ssp-common module to detect codec

Use ssp-common module to detect codec and amplifier type in driver
probe function and remove all quirks about amplifier type.

Signed-off-by: Brent Lu <brent.lu@intel.com>
Reviewed-by: Pierre-Louis Bossart <pierre-louis.bossart@linux.intel.com>
Signed-off-by: Bard Liao <yung-chuan.liao@linux.intel.com>
Link: https://lore.kernel.org/r/20230915124852.1696857-20-yung-chuan.liao@linux.intel.com
Signed-off-by: Mark Brown <broonie@kernel.org>
12 months agoASoC: Intel: sof_da7219: add adl_mx98360_da7219 board config
Brent Lu [Fri, 15 Sep 2023 12:48:51 +0000 (20:48 +0800)]
ASoC: Intel: sof_da7219: add adl_mx98360_da7219 board config

This configuration supports ADL boards which implement DA7219 on SSP0
and MAX98360A on SSP1. DA7219 uses PLL bypass mode to avoid WCLK
locking problem. To use this mode, MCLK frequency must be 12.288 or
24.576MHz.

Signed-off-by: Brent Lu <brent.lu@intel.com>
Reviewed-by: Pierre-Louis Bossart <pierre-louis.bossart@linux.intel.com>
Signed-off-by: Bard Liao <yung-chuan.liao@linux.intel.com>
Link: https://lore.kernel.org/r/20230915124852.1696857-19-yung-chuan.liao@linux.intel.com
Signed-off-by: Mark Brown <broonie@kernel.org>
12 months agoASoC: Intel: sof_da7219: use maxim-common module
Brent Lu [Fri, 15 Sep 2023 12:48:50 +0000 (20:48 +0800)]
ASoC: Intel: sof_da7219: use maxim-common module

Use maxim-common module to handle speaker amp DAI link registration.
No functional change in this commit.

Signed-off-by: Brent Lu <brent.lu@intel.com>
Reviewed-by: Pierre-Louis Bossart <pierre-louis.bossart@linux.intel.com>
Signed-off-by: Bard Liao <yung-chuan.liao@linux.intel.com>
Link: https://lore.kernel.org/r/20230915124852.1696857-18-yung-chuan.liao@linux.intel.com
Signed-off-by: Mark Brown <broonie@kernel.org>
12 months agoASoC: Intel: sof_da7219: rename driver file and kernel option
Brent Lu [Fri, 15 Sep 2023 12:48:49 +0000 (20:48 +0800)]
ASoC: Intel: sof_da7219: rename driver file and kernel option

Rename the driver file and kernel option to be consistent with other
SOF machine drivers.

Signed-off-by: Brent Lu <brent.lu@intel.com>
Reviewed-by: Pierre-Louis Bossart <pierre-louis.bossart@linux.intel.com>
Signed-off-by: Bard Liao <yung-chuan.liao@linux.intel.com>
Link: https://lore.kernel.org/r/20230915124852.1696857-17-yung-chuan.liao@linux.intel.com
Signed-off-by: Mark Brown <broonie@kernel.org>
12 months agoASoC: Intel: sof_nau8825: use realtek-common module
Brent Lu [Fri, 15 Sep 2023 12:48:48 +0000 (20:48 +0800)]
ASoC: Intel: sof_nau8825: use realtek-common module

Use realtek-common module to support rt1019p speaker amplifier.

Signed-off-by: Brent Lu <brent.lu@intel.com>
Reviewed-by: Pierre-Louis Bossart <pierre-louis.bossart@linux.intel.com>
Signed-off-by: Bard Liao <yung-chuan.liao@linux.intel.com>
Link: https://lore.kernel.org/r/20230915124852.1696857-16-yung-chuan.liao@linux.intel.com
Signed-off-by: Mark Brown <broonie@kernel.org>
12 months agoASoC: Intel: sof_nau8825: use nuvoton-common module
Brent Lu [Fri, 15 Sep 2023 12:48:47 +0000 (20:48 +0800)]
ASoC: Intel: sof_nau8825: use nuvoton-common module

Use nuvoton-common module to support nau8318 speaker amplifier.

Signed-off-by: Brent Lu <brent.lu@intel.com>
Reviewed-by: Pierre-Louis Bossart <pierre-louis.bossart@linux.intel.com>
Signed-off-by: Bard Liao <yung-chuan.liao@linux.intel.com>
Link: https://lore.kernel.org/r/20230915124852.1696857-15-yung-chuan.liao@linux.intel.com
Signed-off-by: Mark Brown <broonie@kernel.org>
12 months agoASoC: Intel: nuvoton-common: support nau8318 amplifier
Brent Lu [Fri, 15 Sep 2023 12:48:46 +0000 (20:48 +0800)]
ASoC: Intel: nuvoton-common: support nau8318 amplifier

Implement nau8318 support code in this common module so it could be
shared between multiple SOF machine drivers.

Signed-off-by: Brent Lu <brent.lu@intel.com>
Reviewed-by: Pierre-Louis Bossart <pierre-louis.bossart@linux.intel.com>
Signed-off-by: Bard Liao <yung-chuan.liao@linux.intel.com>
Link: https://lore.kernel.org/r/20230915124852.1696857-14-yung-chuan.liao@linux.intel.com
Signed-off-by: Mark Brown <broonie@kernel.org>
12 months agoASoC: Intel: sof_ssp_amp: do not create amp link for nocodec board
Brent Lu [Fri, 15 Sep 2023 12:48:45 +0000 (20:48 +0800)]
ASoC: Intel: sof_ssp_amp: do not create amp link for nocodec board

A BE DAI link for speaker amplifier is always created even a board
quirk specifies there is no amplifier. Modify the driver to check
amplifier type before creating corresponding DAI link.

The topology (sof-tgl-rt1308-hdmi-ssp.m4) which supports HDMI-IN is
using fixed BE ID for each DAI link. Therefore we also uses fixed ID
in machine driver side.

Signed-off-by: Brent Lu <brent.lu@intel.com>
Reviewed-by: Pierre-Louis Bossart <pierre-louis.bossart@linux.intel.com>
Reviewed-by: Balamurugan C <balamurugan.c@intel.com>
Signed-off-by: Bard Liao <yung-chuan.liao@linux.intel.com>
Link: https://lore.kernel.org/r/20230915124852.1696857-13-yung-chuan.liao@linux.intel.com
Signed-off-by: Mark Brown <broonie@kernel.org>
12 months agoASoC: Intel: sof_rt5682: add HDMI_In capture feature support for RPL.
Balamurugan C [Fri, 15 Sep 2023 12:48:44 +0000 (20:48 +0800)]
ASoC: Intel: sof_rt5682: add HDMI_In capture feature support for RPL.

Added HDMI-in capture support for RPL boards. previously it used adl
machines and now its moved into separate match entry.

Signed-off-by: Balamurugan C <balamurugan.c@intel.com>
Reviewed-by: Pierre-Louis Bossart <pierre-louis.bossart@linux.intel.com>
Signed-off-by: Bard Liao <yung-chuan.liao@linux.intel.com>
Link: https://lore.kernel.org/r/20230915124852.1696857-12-yung-chuan.liao@linux.intel.com
Signed-off-by: Mark Brown <broonie@kernel.org>
12 months agoASoC: Intel: sof_rt5682: add adl_rt5650 board config
Brent Lu [Fri, 15 Sep 2023 12:48:43 +0000 (20:48 +0800)]
ASoC: Intel: sof_rt5682: add adl_rt5650 board config

This configuration supports ADL boards which implement ALC5650 dual
I2S interface codec. Two DAI links are added: AIF1 (on codec side) for
headphone and AIF2 for speakers.

Signed-off-by: Brent Lu <brent.lu@intel.com>
Reviewed-by: Pierre-Louis Bossart <pierre-louis.bossart@linux.intel.com>
Signed-off-by: Bard Liao <yung-chuan.liao@linux.intel.com>
Link: https://lore.kernel.org/r/20230915124852.1696857-11-yung-chuan.liao@linux.intel.com
Signed-off-by: Mark Brown <broonie@kernel.org>
12 months agoASoC: Intel: sof_rt5682: Modify number of HDMI to 3 for MTL/Rex devices
Uday M Bhat [Fri, 15 Sep 2023 12:48:42 +0000 (20:48 +0800)]
ASoC: Intel: sof_rt5682: Modify number of HDMI to 3 for MTL/Rex devices

For all MTL/Rex devices, number of HDMI supported is 3.

Signed-off-by: Yong Zhi <yong.zhi@intel.com>
Signed-off-by: Uday M Bhat <uday.m.bhat@intel.com>
Reviewed-by: Pierre-Louis Bossart <pierre-louis.bossart@linux.intel.com>
Signed-off-by: Bard Liao <yung-chuan.liao@linux.intel.com>
Link: https://lore.kernel.org/r/20230915124852.1696857-10-yung-chuan.liao@linux.intel.com
Signed-off-by: Mark Brown <broonie@kernel.org>
12 months agoASoC: Intel: sof_rt5682: Add support for Rex with discrete BT offload.
Uday M Bhat [Fri, 15 Sep 2023 12:48:41 +0000 (20:48 +0800)]
ASoC: Intel: sof_rt5682: Add support for Rex with discrete BT offload.

System firmware has included additional audio DMI string
MAX98360_ALC5682I_DISCRETE_I2S_BT for discrete BT offload
supporting devices. Same DMI string match is introduced
in sof_rt5682_quirk_table.

Signed-off-by: Uday M Bhat <uday.m.bhat@intel.com>
Reviewed-by: Pierre-Louis Bossart <pierre-louis.bossart@linux.intel.com>
Signed-off-by: Bard Liao <yung-chuan.liao@linux.intel.com>
Link: https://lore.kernel.org/r/20230915124852.1696857-9-yung-chuan.liao@linux.intel.com
Signed-off-by: Mark Brown <broonie@kernel.org>
12 months agoASoC: Intel: sof_nau8825: use ssp-common module to detect codec
Brent Lu [Fri, 15 Sep 2023 12:48:40 +0000 (20:48 +0800)]
ASoC: Intel: sof_nau8825: use ssp-common module to detect codec

Use ssp-common module to detect codec and amplifier type in driver
probe function and remove all quirks about codec and amplifier type.

Signed-off-by: Brent Lu <brent.lu@intel.com>
Reviewed-by: Rander Wang <rander.wang@intel.com>
Reviewed-by: Pierre-Louis Bossart <pierre-louis.bossart@linux.intel.com>
Signed-off-by: Bard Liao <yung-chuan.liao@linux.intel.com>
Link: https://lore.kernel.org/r/20230915124852.1696857-8-yung-chuan.liao@linux.intel.com
Signed-off-by: Mark Brown <broonie@kernel.org>
12 months agoASoC: Intel: sof_ssp_amp: use ssp-common module to detect codec
Brent Lu [Fri, 15 Sep 2023 12:48:39 +0000 (20:48 +0800)]
ASoC: Intel: sof_ssp_amp: use ssp-common module to detect codec

Use ssp-common module to detect codec and amplifier type in driver
probe function and remove all quirks about codec and amplifier type.

Signed-off-by: Brent Lu <brent.lu@intel.com>
Reviewed-by: Rander Wang <rander.wang@intel.com>
Reviewed-by: Pierre-Louis Bossart <pierre-louis.bossart@linux.intel.com>
Signed-off-by: Bard Liao <yung-chuan.liao@linux.intel.com>
Link: https://lore.kernel.org/r/20230915124852.1696857-7-yung-chuan.liao@linux.intel.com
Signed-off-by: Mark Brown <broonie@kernel.org>
12 months agoASoC: Intel: sof_cs42l42: use ssp-common module to detect codec
Brent Lu [Fri, 15 Sep 2023 12:48:38 +0000 (20:48 +0800)]
ASoC: Intel: sof_cs42l42: use ssp-common module to detect codec

Use ssp-common module to detect codec and amplifier type in driver
probe function and remove all quirks about codec and amplifier type.

Signed-off-by: Brent Lu <brent.lu@intel.com>
Reviewed-by: Rander Wang <rander.wang@intel.com>
Reviewed-by: Pierre-Louis Bossart <pierre-louis.bossart@linux.intel.com>
Signed-off-by: Bard Liao <yung-chuan.liao@linux.intel.com>
Link: https://lore.kernel.org/r/20230915124852.1696857-6-yung-chuan.liao@linux.intel.com
Signed-off-by: Mark Brown <broonie@kernel.org>
12 months agoASoC: Intel: sof_rt5682: use ssp-common module to detect codec
Brent Lu [Fri, 15 Sep 2023 12:48:37 +0000 (20:48 +0800)]
ASoC: Intel: sof_rt5682: use ssp-common module to detect codec

Use ssp-common module to detect codec and amplifier type in driver
probe function and remove all quirks about codec and amplifier type.
Due to codec detection feature, we could remove HP Dooly's DMI quirk
safely.

Signed-off-by: Brent Lu <brent.lu@intel.com>
Reviewed-by: Rander Wang <rander.wang@intel.com>
Reviewed-by: Pierre-Louis Bossart <pierre-louis.bossart@linux.intel.com>
Signed-off-by: Bard Liao <yung-chuan.liao@linux.intel.com>
Link: https://lore.kernel.org/r/20230915124852.1696857-5-yung-chuan.liao@linux.intel.com
Signed-off-by: Mark Brown <broonie@kernel.org>
12 months agoASoC: Intel: use ACPI HID definition in ssp-common
Brent Lu [Fri, 15 Sep 2023 12:48:36 +0000 (20:48 +0800)]
ASoC: Intel: use ACPI HID definition in ssp-common

Use ACPI HID definition in ssp-common header for device name macros.
No functional change here.

Signed-off-by: Brent Lu <brent.lu@intel.com>
Reviewed-by: Rander Wang <rander.wang@intel.com>
Reviewed-by: Pierre-Louis Bossart <pierre-louis.bossart@linux.intel.com>
Signed-off-by: Bard Liao <yung-chuan.liao@linux.intel.com>
Link: https://lore.kernel.org/r/20230915124852.1696857-4-yung-chuan.liao@linux.intel.com
Signed-off-by: Mark Brown <broonie@kernel.org>
12 months agoASoC: Intel: ssp-common: support codec detection
Brent Lu [Fri, 15 Sep 2023 12:48:35 +0000 (20:48 +0800)]
ASoC: Intel: ssp-common: support codec detection

Create a new common module to host functions which could be shared
among SSP machine drivers. Add functions to detect headphone codec and
speaker amplifier via ACPI system at runtime in order to remove codec
type quirks in machine drivers.

Signed-off-by: Brent Lu <brent.lu@intel.com>
Reviewed-by: Rander Wang <rander.wang@intel.com>
Reviewed-by: Pierre-Louis Bossart <pierre-louis.bossart@linux.intel.com>
Signed-off-by: Bard Liao <yung-chuan.liao@linux.intel.com>
Link: https://lore.kernel.org/r/20230915124852.1696857-3-yung-chuan.liao@linux.intel.com
Signed-off-by: Mark Brown <broonie@kernel.org>
12 months agoASoC: Intel: sof_rt5682: cleanup unnecessary quirk flag
Brent Lu [Fri, 15 Sep 2023 12:48:34 +0000 (20:48 +0800)]
ASoC: Intel: sof_rt5682: cleanup unnecessary quirk flag

Remove SOF_RT5682_MCLK_24MHZ flag from JSL and CML/WHL board configs
since the information could be retrieved from SOF API. The macro
itself is removed as well.

Signed-off-by: Brent Lu <brent.lu@intel.com>
Reviewed-by: Pierre-Louis Bossart <pierre-louis.bossart@linux.intel.com>
Signed-off-by: Bard Liao <yung-chuan.liao@linux.intel.com>
Link: https://lore.kernel.org/r/20230915124852.1696857-2-yung-chuan.liao@linux.intel.com
Signed-off-by: Mark Brown <broonie@kernel.org>
12 months agoASoC: intel: sof_sdw: Increment be_id in init_dai_link
Charles Keepax [Fri, 15 Sep 2023 07:56:11 +0000 (15:56 +0800)]
ASoC: intel: sof_sdw: Increment be_id in init_dai_link

Rather than incrementing the ID for the dai_links in many places
throughout the code, just increment it each time we initialise a new DAI
link.

Signed-off-by: Charles Keepax <ckeepax@opensource.cirrus.com>
Reviewed-by: Pierre-Louis Bossart <pierre-louis.bossart@linux.intel.com>
Signed-off-by: Bard Liao <yung-chuan.liao@linux.intel.com>
Link: https://lore.kernel.org/r/20230915075611.1619548-5-yung-chuan.liao@linux.intel.com
Signed-off-by: Mark Brown <broonie@kernel.org>
12 months agoASoC: intel: sof_sdw: Make create_sdw_dailink allocate link components
Charles Keepax [Fri, 15 Sep 2023 07:56:10 +0000 (15:56 +0800)]
ASoC: intel: sof_sdw: Make create_sdw_dailink allocate link components

Now only the SoundWire part of the code uses the global cpus array,
remove it and have create_sdw_dailink allocate its own link components.
This removes a lot of state being passed around in the driver, which
simplifies things a fair bit.

Signed-off-by: Charles Keepax <ckeepax@opensource.cirrus.com>
Reviewed-by: Pierre-Louis Bossart <pierre-louis.bossart@linux.intel.com>
Signed-off-by: Bard Liao <yung-chuan.liao@linux.intel.com>
Link: https://lore.kernel.org/r/20230915075611.1619548-4-yung-chuan.liao@linux.intel.com
Signed-off-by: Mark Brown <broonie@kernel.org>
12 months agoASoC: intel: sof_sdw: Add simple DAI link creation helper
Charles Keepax [Fri, 15 Sep 2023 07:56:09 +0000 (15:56 +0800)]
ASoC: intel: sof_sdw: Add simple DAI link creation helper

The code contains a fair amount of state tracking and one part of that
is keeping track of which entry in the large global cpus
snd_soc_dai_link_component array is currently in use. Add a helper
function to allocate a simple DAI link, this simplifies the
code slightly and moves us in the direction of eliminating the need for
the large global cpus array. This does slightly increase the number of
allocations done, but this is probe time and the code already does a
large number of allocations so this increase is small over all.

Signed-off-by: Charles Keepax <ckeepax@opensource.cirrus.com>
Reviewed-by: Pierre-Louis Bossart <pierre-louis.bossart@linux.intel.com>
Signed-off-by: Bard Liao <yung-chuan.liao@linux.intel.com>
Link: https://lore.kernel.org/r/20230915075611.1619548-3-yung-chuan.liao@linux.intel.com
Signed-off-by: Mark Brown <broonie@kernel.org>
12 months agoASoC: intel: sof_sdw: Move sdw_pin_index into private struct
Charles Keepax [Fri, 15 Sep 2023 07:56:08 +0000 (15:56 +0800)]
ASoC: intel: sof_sdw: Move sdw_pin_index into private struct

Whilst it should not cause any issues as only a single instance of the
machine will be instantiated, it is still slightly better practice to
keep working data in the private data structure, rather than a global
variable. Move sdw_pin_index into the mc_private structure.

Signed-off-by: Charles Keepax <ckeepax@opensource.cirrus.com>
Reviewed-by: Pierre-Louis Bossart <pierre-louis.bossart@linux.intel.com>
Signed-off-by: Bard Liao <yung-chuan.liao@linux.intel.com>
Link: https://lore.kernel.org/r/20230915075611.1619548-2-yung-chuan.liao@linux.intel.com
Signed-off-by: Mark Brown <broonie@kernel.org>
12 months agoASoC: amd: ps: Fix -Wformat-truncation warning
Takashi Iwai [Fri, 15 Sep 2023 08:22:07 +0000 (10:22 +0200)]
ASoC: amd: ps: Fix -Wformat-truncation warning

The compile warning with -Wformat-truncation at
sdw_amd_scan_controller() is false-positive; the max loop size is
AMD_SDW_MAX_MANAGERS (= 2), hence it fits with the given size.

For suppressing the warning, replace snprintf() with scnprintf().
As stated in the above, truncation doesn't matter.

Signed-off-by: Takashi Iwai <tiwai@suse.de>
Link: https://lore.kernel.org/r/20230915082207.26200-1-tiwai@suse.de
Signed-off-by: Mark Brown <broonie@kernel.org>
12 months agoASoC: rt1015: fix the first word being cut off
Shuming Fan [Fri, 15 Sep 2023 02:05:30 +0000 (10:05 +0800)]
ASoC: rt1015: fix the first word being cut off

This patch adds a control that there are four options to control the digital volume output.
The user could select "immediate" to make volume updates immediately.
In default, the driver selects the volume update with "zero detection + soft inc/dec change".

Signed-off-by: Shuming Fan <shumingf@realtek.com>
Link: https://lore.kernel.org/r/20230915020530.83452-1-shumingf@realtek.com
Signed-off-by: Mark Brown <broonie@kernel.org>
12 months agoASoC: SOF: Intel: hda-loader: Add support for split library loading
Peter Ujfalusi [Fri, 15 Sep 2023 11:40:18 +0000 (14:40 +0300)]
ASoC: SOF: Intel: hda-loader: Add support for split library loading

There is a certain sequence needs to be followed when configuring the HDA
DMA in host and DSP.
The firmware provides a way to handle this two stage sequencing by
splitting the library loading into two stage:
1st stage: LOAD_LIBRARY_PREPARE message
           the lib_id is 0, used to configure the DMA on DSP side
2nd stage: LOAD_LIBRARY message
           both dma_id and lib_id is valid, used for the actual transfer of
           the library

In case a firmware without support for this two stage loading is used then
the second stage message will trigger the loading and the first stage will
return with error, which is ignored by the kernel.

Signed-off-by: Peter Ujfalusi <peter.ujfalusi@linux.intel.com>
Reviewed-by: Pierre-Louis Bossart <pierre-louis.bossart@linux.intel.com>
Reviewed-by: Guennadi Liakhovetski <guennadi.liakhovetski@linux.intel.com>
Reviewed-by: Ranjani Sridharan <ranjani.sridharan@linux.intel.com>
Reviewed-by: Chao Song <chao.song@linux.intel.com>
Link: https://lore.kernel.org/r/20230915114018.1701-5-peter.ujfalusi@linux.intel.com
Signed-off-by: Mark Brown <broonie@kernel.org>
12 months agoASoC: SOF: ipc4: Add new message type: SOF_IPC4_GLB_LOAD_LIBRARY_PREPARE
Peter Ujfalusi [Fri, 15 Sep 2023 11:40:17 +0000 (14:40 +0300)]
ASoC: SOF: ipc4: Add new message type: SOF_IPC4_GLB_LOAD_LIBRARY_PREPARE

On Intel platforms there is a strict order requirement for the DMA
programming:
DSP side configures the buffer and sets the GEN bit
Host side sets the RUN bit.

In order to follow this flow, a new global message type has been added to
prepare the DSP side of the DMA:

host sends LOAD_LIBRARY_PREPARE with the dma_id
DSP side sets its buffer and sets the GEN bit
Host sets the RUN bit
Host sends LOAD_LIBRARY with dma_id and lib_id
DSP receives the library data.

It is up to the platform code to use the new prepare stage message and how
to handle the reply to it from the firmware, which can indicate that the
message type is not supported/handled.
In this case the kernel should proceed to the LOAD_LIBRARY stage assuming
a single stage library loading:

host sends LOAD_LIBRARY_PREPARE with the dma_id
DSP replies that the message type is not supported/handled
Host acknowledges the return code and sets the RUN bit
Host sends LOAD_LIBRARY with dma_id and lib_id
DSP receives the library data.

Signed-off-by: Peter Ujfalusi <peter.ujfalusi@linux.intel.com>
Reviewed-by: Pierre-Louis Bossart <pierre-louis.bossart@linux.intel.com>
Reviewed-by: Guennadi Liakhovetski <guennadi.liakhovetski@linux.intel.com>
Reviewed-by: Ranjani Sridharan <ranjani.sridharan@linux.intel.com>
Reviewed-by: Chao Song <chao.song@linux.intel.com>
Link: https://lore.kernel.org/r/20230915114018.1701-4-peter.ujfalusi@linux.intel.com
Signed-off-by: Mark Brown <broonie@kernel.org>
12 months agoASoC: SOF: Intel: hda: Add definition for SDxFIFOS.FIFOS mask
Peter Ujfalusi [Fri, 15 Sep 2023 11:40:16 +0000 (14:40 +0300)]
ASoC: SOF: Intel: hda: Add definition for SDxFIFOS.FIFOS mask

The FIFOS (FIFO Size) field is in bit 0-15 of the register.
Use the defined mask instead of a magic number for the FIFOS value
masking in hda_dsp_stream_hw_params().

Signed-off-by: Peter Ujfalusi <peter.ujfalusi@linux.intel.com>
Reviewed-by: Pierre-Louis Bossart <pierre-louis.bossart@linux.intel.com>
Reviewed-by: Guennadi Liakhovetski <guennadi.liakhovetski@linux.intel.com>
Reviewed-by: Ranjani Sridharan <ranjani.sridharan@linux.intel.com>
Reviewed-by: Chao Song <chao.song@linux.intel.com>
Link: https://lore.kernel.org/r/20230915114018.1701-3-peter.ujfalusi@linux.intel.com
Signed-off-by: Mark Brown <broonie@kernel.org>
12 months agoASoC: SOF: ipc4: Convert status code 2 and 15 to -EOPNOTSUPP
Peter Ujfalusi [Fri, 15 Sep 2023 11:40:15 +0000 (14:40 +0300)]
ASoC: SOF: ipc4: Convert status code 2 and 15 to -EOPNOTSUPP

The status code 2 and 15 can be translated to -EOPNOTSUPP, so convert them
to a meaningful error number.

Signed-off-by: Peter Ujfalusi <peter.ujfalusi@linux.intel.com>
Reviewed-by: Pierre-Louis Bossart <pierre-louis.bossart@linux.intel.com>
Reviewed-by: Guennadi Liakhovetski <guennadi.liakhovetski@linux.intel.com>
Reviewed-by: Ranjani Sridharan <ranjani.sridharan@linux.intel.com>
Reviewed-by: Chao Song <chao.song@linux.intel.com>
Link: https://lore.kernel.org/r/20230915114018.1701-2-peter.ujfalusi@linux.intel.com
Signed-off-by: Mark Brown <broonie@kernel.org>
12 months agoASoC: SOF: ipc4-pcm: fixup dailink based on copier format
Bard Liao [Fri, 15 Sep 2023 09:35:07 +0000 (12:35 +0300)]
ASoC: SOF: ipc4-pcm: fixup dailink based on copier format

When a copier exposes a single format, we can fixup the BE dailink with
that format. This is helpful when some codec have format restrictions and
e.g. don't support a 32-bit format. In that case, the copier output
formats mirror that restriction in the topology file.

An alternate solution was suggested earlier using a dedicated topology
token. When specified, the token would be used to fix-up the dailink. The
main reason why this solution was chosen is that there is a risk of a
disconnect between token definition and copier format. With a single piece
of information as suggested in this patch, there are fewer risks of a bad
configuration.

Signed-off-by: Bard Liao <yung-chuan.liao@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: Peter Ujfalusi <peter.ujfalusi@linux.intel.com>
Link: https://lore.kernel.org/r/20230915093507.7242-3-peter.ujfalusi@linux.intel.com
Signed-off-by: Mark Brown <broonie@kernel.org>
12 months agoASoC: SOF: ipc4-topology: export sof_ipc4_copier_is_single_format
Bard Liao [Fri, 15 Sep 2023 09:35:06 +0000 (12:35 +0300)]
ASoC: SOF: ipc4-topology: export sof_ipc4_copier_is_single_format

We will use the sof_ipc4_copier_is_single_format() function to check if a
ipc4 copier has single format available in ipc4-pcm.c in the next patch.

Signed-off-by: Bard Liao <yung-chuan.liao@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: Peter Ujfalusi <peter.ujfalusi@linux.intel.com>
Link: https://lore.kernel.org/r/20230915093507.7242-2-peter.ujfalusi@linux.intel.com
Signed-off-by: Mark Brown <broonie@kernel.org>
12 months agoASoC: cs35l56: Omit cs35l56_pm_ops_i2c_spi if I2C/SPI not enabled
Richard Fitzgerald [Thu, 14 Sep 2023 15:09:18 +0000 (16:09 +0100)]
ASoC: cs35l56: Omit cs35l56_pm_ops_i2c_spi if I2C/SPI not enabled

The cs35l56_pm_ops_i2c_spi struct is only needed if either the
I2C or SPI modules are selected for building. Otherwise it would
be unused bytes, so in that case omit it.

Signed-off-by: Richard Fitzgerald <rf@opensource.cirrus.com>
Link: https://lore.kernel.org/r/20230914150918.14505-4-rf@opensource.cirrus.com
Signed-off-by: Mark Brown <broonie@kernel.org>
12 months agoASoC: cs35l56: Use new export macro for dev_pm_ops
Richard Fitzgerald [Thu, 14 Sep 2023 15:09:17 +0000 (16:09 +0100)]
ASoC: cs35l56: Use new export macro for dev_pm_ops

pm.h now has macros to create and export the dev_pm_ops struct
only if CONFIG_PM is enabled.

Signed-off-by: Richard Fitzgerald <rf@opensource.cirrus.com>
Link: https://lore.kernel.org/r/20230914150918.14505-3-rf@opensource.cirrus.com
Signed-off-by: Mark Brown <broonie@kernel.org>
12 months agoASoC: cs35l56: Use pm_ptr()
Richard Fitzgerald [Thu, 14 Sep 2023 15:09:16 +0000 (16:09 +0100)]
ASoC: cs35l56: Use pm_ptr()

Use pm_ptr() when setting the pointer to the dev_pm_ops so that it
will be NULL if CONFIG_PM is disabled. This allows the dev_pm_ops to be
compiled out in that case.

Signed-off-by: Richard Fitzgerald <rf@opensource.cirrus.com>
Link: https://lore.kernel.org/r/20230914150918.14505-2-rf@opensource.cirrus.com
Signed-off-by: Mark Brown <broonie@kernel.org>
12 months agoASoC: SOF: ipc4-topology: Add deep buffer size to debug prints
Yong Zhi [Thu, 14 Sep 2023 13:03:03 +0000 (16:03 +0300)]
ASoC: SOF: ipc4-topology: Add deep buffer size to debug prints

Print deep_buffer_dma_ms and dma_buffer_size for debug purpose.

Signed-off-by: Yong Zhi <yong.zhi@intel.com>
Reviewed-by: Pierre-Louis Bossart <pierre-louis.bossart@linux.intel.com>
Reviewed-by: Péter Ujfalusi <peter.ujfalusi@linux.intel.com>
Reviewed-by: Bard Liao <yung-chuan.liao@linux.intel.com>
Signed-off-by: Peter Ujfalusi <peter.ujfalusi@linux.intel.com>
Link: https://lore.kernel.org/r/20230914130303.13636-1-peter.ujfalusi@linux.intel.com
Signed-off-by: Mark Brown <broonie@kernel.org>