OSDN Git Service

tomoyo/tomoyo-test1.git
20 months agoASoC: mediatek: mt8192-mt6359: Register to module device table
Nícolas F. R. A. Prado [Mon, 7 Nov 2022 16:04:36 +0000 (11:04 -0500)]
ASoC: mediatek: mt8192-mt6359: Register to module device table

Register the compatibles for this module on the module device table so
it can be automatically loaded when a matching device is found on the
system.

Signed-off-by: Nícolas F. R. A. Prado <nfraprado@collabora.com>
Reviewed-by: AngeloGioacchino Del Regno <angelogioacchino.delregno@collabora.com>
Tested-by: Chen-Yu Tsai <wenst@chromium.org>
Reviewed-by: Chen-Yu Tsai <wenst@chromium.org>
Link: https://lore.kernel.org/r/20221107160437.740353-9-nfraprado@collabora.com
Signed-off-by: Mark Brown <broonie@kernel.org>
20 months agoASoC: mediatek: mt8186-rt5682: Register to module device table
Nícolas F. R. A. Prado [Mon, 7 Nov 2022 16:04:35 +0000 (11:04 -0500)]
ASoC: mediatek: mt8186-rt5682: Register to module device table

Register the compatibles for this module on the module device table so
it can be automatically loaded when a matching device is found on the
system.

Signed-off-by: Nícolas F. R. A. Prado <nfraprado@collabora.com>
Reviewed-by: AngeloGioacchino Del Regno <angelogioacchino.delregno@collabora.com>
Reviewed-by: Chen-Yu Tsai <wenst@chromium.org>
Link: https://lore.kernel.org/r/20221107160437.740353-8-nfraprado@collabora.com
Signed-off-by: Mark Brown <broonie@kernel.org>
20 months agoASoC: mediatek: mt8186-da7219: Register to module device table
Nícolas F. R. A. Prado [Mon, 7 Nov 2022 16:04:34 +0000 (11:04 -0500)]
ASoC: mediatek: mt8186-da7219: Register to module device table

Register the compatibles for this module on the module device table so
it can be automatically loaded when a matching device is found on the
system.

Signed-off-by: Nícolas F. R. A. Prado <nfraprado@collabora.com>
Reviewed-by: AngeloGioacchino Del Regno <angelogioacchino.delregno@collabora.com>
Reviewed-by: Chen-Yu Tsai <wenst@chromium.org>
Link: https://lore.kernel.org/r/20221107160437.740353-7-nfraprado@collabora.com
Signed-off-by: Mark Brown <broonie@kernel.org>
20 months agoASoC: mediatek: mt8183-mt6358: Register to module device table
Nícolas F. R. A. Prado [Mon, 7 Nov 2022 16:04:33 +0000 (11:04 -0500)]
ASoC: mediatek: mt8183-mt6358: Register to module device table

Register the compatibles for this module on the module device table so
it can be automatically loaded when a matching device is found on the
system.

Reviewed-by: AngeloGioacchino Del Regno <angelogioacchino.delregno@collabora.com>
Signed-off-by: Nícolas F. R. A. Prado <nfraprado@collabora.com>
Tested-by: Chen-Yu Tsai <wenst@chromium.org>
Reviewed-by: Chen-Yu Tsai <wenst@chromium.org>
Link: https://lore.kernel.org/r/20221107160437.740353-6-nfraprado@collabora.com
Signed-off-by: Mark Brown <broonie@kernel.org>
20 months agoASoC: mediatek: mt8183-da7219: Register to module device table
Nícolas F. R. A. Prado [Mon, 7 Nov 2022 16:04:32 +0000 (11:04 -0500)]
ASoC: mediatek: mt8183-da7219: Register to module device table

Register the compatibles for this module on the module device table so
it can be automatically loaded when a matching device is found on the
system.

Reviewed-by: AngeloGioacchino Del Regno <angelogioacchino.delregno@collabora.com>
Signed-off-by: Nícolas F. R. A. Prado <nfraprado@collabora.com>
Reviewed-by: Chen-Yu Tsai <wenst@chromium.org>
Link: https://lore.kernel.org/r/20221107160437.740353-5-nfraprado@collabora.com
Signed-off-by: Mark Brown <broonie@kernel.org>
20 months agoASoC: mediatek: mt6797-mt6351: Register to module device table
Nícolas F. R. A. Prado [Mon, 7 Nov 2022 16:04:31 +0000 (11:04 -0500)]
ASoC: mediatek: mt6797-mt6351: Register to module device table

Register the compatibles for this module on the module device table so
it can be automatically loaded when a matching device is found on the
system.

Signed-off-by: Nícolas F. R. A. Prado <nfraprado@collabora.com>
Reviewed-by: AngeloGioacchino Del Regno <angelogioacchino.delregno@collabora.com>
Reviewed-by: Chen-Yu Tsai <wenst@chromium.org>
Link: https://lore.kernel.org/r/20221107160437.740353-4-nfraprado@collabora.com
Signed-off-by: Mark Brown <broonie@kernel.org>
20 months agoASoC: mediatek: mt2701-wm8960: Register to module device table
Nícolas F. R. A. Prado [Mon, 7 Nov 2022 16:04:30 +0000 (11:04 -0500)]
ASoC: mediatek: mt2701-wm8960: Register to module device table

Register the compatibles for this module on the module device table so
it can be automatically loaded when a matching device is found on the
system.

Signed-off-by: Nícolas F. R. A. Prado <nfraprado@collabora.com>
Reviewed-by: AngeloGioacchino Del Regno <angelogioacchino.delregno@collabora.com>
Reviewed-by: Chen-Yu Tsai <wenst@chromium.org>
Link: https://lore.kernel.org/r/20221107160437.740353-3-nfraprado@collabora.com
Signed-off-by: Mark Brown <broonie@kernel.org>
20 months agoASoC: mediatek: mt2701-cs42448: Register to module device table
Nícolas F. R. A. Prado [Mon, 7 Nov 2022 16:04:29 +0000 (11:04 -0500)]
ASoC: mediatek: mt2701-cs42448: Register to module device table

Register the compatibles for this module on the module device table so
it can be automatically loaded when a matching device is found on the
system.

Signed-off-by: Nícolas F. R. A. Prado <nfraprado@collabora.com>
Reviewed-by: AngeloGioacchino Del Regno <angelogioacchino.delregno@collabora.com>
Reviewed-by: Chen-Yu Tsai <wenst@chromium.org>
Link: https://lore.kernel.org/r/20221107160437.740353-2-nfraprado@collabora.com
Signed-off-by: Mark Brown <broonie@kernel.org>
20 months agoASoC: amd: fix ACP version typo mistake
syed saba kareem [Fri, 4 Nov 2022 12:09:07 +0000 (17:39 +0530)]
ASoC: amd: fix ACP version typo mistake

Pink Sardine is based on ACP6.3 architecture.
This patch fixes the typo mistake acp6.2 -> acp6.3

Signed-off-by: syed saba kareem <syed.sabakareem@amd.com>
Link: https://lore.kernel.org/r/20221104121001.207992-1-Syed.SabaKareem@amd.com
Signed-off-by: Mark Brown <broonie@kernel.org>
20 months agoModify documentation and machine driver for mt8186_rt1019_rt5682s sound card
Mark Brown [Thu, 3 Nov 2022 16:23:39 +0000 (16:23 +0000)]
Modify documentation and machine driver for mt8186_rt1019_rt5682s sound card

Merge series from Ajye Huang <ajye_huang@compal.corp-partner.google.com>:

Support selecting between front and rear microphones on some of the
MediaTek platforms.

20 months agoASoC: Intel: cirrus-common: Make const array uid_strings static
Colin Ian King [Thu, 3 Nov 2022 12:06:24 +0000 (12:06 +0000)]
ASoC: Intel: cirrus-common: Make const array uid_strings static

Don't populate the read-only const array uid_strings on the stack but
instead make it static. Also makes the object code a little smaller.

Signed-off-by: Colin Ian King <colin.i.king@gmail.com>
Link: https://lore.kernel.org/r/20221103120624.72583-1-colin.i.king@gmail.com
Signed-off-by: Mark Brown <broonie@kernel.org>
20 months agoASoC: simple-mux: add read function
Maarten Zanders [Fri, 28 Oct 2022 19:13:01 +0000 (21:13 +0200)]
ASoC: simple-mux: add read function

During initialisation DAPM tries to read the state of the MUX
being connected, resulting in this error log:
input-mux: ASoC: error at soc_component_read_no_lock on input-mux: -5

Provide a read function which allows DAPM to read the state of the
MUX.

Signed-off-by: Maarten Zanders <maarten.zanders@mind.be>
Link: https://lore.kernel.org/r/20221028191303.166115-1-maarten.zanders@mind.be
Signed-off-by: Mark Brown <broonie@kernel.org>
20 months agoASoC: tlv320aic3x: switch to using gpiod API
Dmitry Torokhov [Wed, 2 Nov 2022 23:20:04 +0000 (16:20 -0700)]
ASoC: tlv320aic3x: switch to using gpiod API

Switch the driver from legacy gpio API that is deprecated to the newer
gpiod API that respects line polarities described in ACPI/DT.

The driver still tries to support shared reset lines, by first trying to
allocate the reset GPIO normally, and then non-exclusively, although the
utility of such support is questionable, toggling reset line from one
driver/instance will result in all chips being reset, potentially at an
inopportune moment.

Note that this change depends on commit fbbbcd177a27 ("gpiolib: of: add
quirk for locating reset lines with legacy bindings") to translate
request for "reset" GPIO to the legacy name "gpio-reset" in case when
proper name is not used.

Signed-off-by: Dmitry Torokhov <dmitry.torokhov@gmail.com>
Link: https://lore.kernel.org/r/20221102232004.1721864-3-dmitry.torokhov@gmail.com
Signed-off-by: Mark Brown <broonie@kernel.org>
20 months agoASoC: tlv320aic3x: remove support for platform data
Dmitry Torokhov [Wed, 2 Nov 2022 23:20:03 +0000 (16:20 -0700)]
ASoC: tlv320aic3x: remove support for platform data

Signed-off-by: Dmitry Torokhov <dmitry.torokhov@gmail.com>
Link: https://lore.kernel.org/r/20221102232004.1721864-2-dmitry.torokhov@gmail.com
Signed-off-by: Mark Brown <broonie@kernel.org>
20 months agoARM: omap2: n8x0: stop instantiating codec platform data
Dmitry Torokhov [Wed, 2 Nov 2022 23:20:02 +0000 (16:20 -0700)]
ARM: omap2: n8x0: stop instantiating codec platform data

As of 0426370b58b2 ("ARM: dts: omap2420-n810: Correct the audio codec
(tlv320aic33) node") the DTS properly specifies reset GPIO, and the
device name in auxdata lookup table does not even match the one in
device tree anymore, so stop instantiating it.

Signed-off-by: Dmitry Torokhov <dmitry.torokhov@gmail.com>
Acked-by: Tony Lindgren <tony@atomide.com>
Link: https://lore.kernel.org/r/20221102232004.1721864-1-dmitry.torokhov@gmail.com
Signed-off-by: Mark Brown <broonie@kernel.org>
20 months agoASoC: mediatek: mt8186-rt5682: Modify machine driver for two DMICs case
Ajye Huang [Wed, 2 Nov 2022 12:59:36 +0000 (20:59 +0800)]
ASoC: mediatek: mt8186-rt5682: Modify machine driver for two DMICs case

Having two DMICs, a front DMIC and a Rear DMIC,
but only host audio input AUX port0 is used for these two Dmics.
A "dmic-gpios" property is used for a mixer control to switch
the dmic signal source between the Front and Rear Dmic.

Refer to this one as an example,
commit 3cfbf07c6d27
("ASoC: qcom: sc7180: Modify machine driver for 2mic")

Signed-off-by: Ajye Huang <ajye_huang@compal.corp-partner.google.com>
Reviewed-by: AngeloGioacchino Del Regno <angelogioacchino.delregno@collabora.com>
Link: https://lore.kernel.org/r/20221102125936.2176748-3-ajye_huang@compal.corp-partner.google.com
Signed-off-by: Mark Brown <broonie@kernel.org>
20 months agoASoC: mediatek: dt-bindings: modify machine bindings for two MICs case
Ajye Huang [Wed, 2 Nov 2022 12:59:35 +0000 (20:59 +0800)]
ASoC: mediatek: dt-bindings: modify machine bindings for two MICs case

Add a property "dmic-gpios" for switching between two MICs.

Signed-off-by: Ajye Huang <ajye_huang@compal.corp-partner.google.com>
Reviewed-by: AngeloGioacchino Del Regno <angelogioacchino.delregno@collabora.com>
Link: https://lore.kernel.org/r/20221102125936.2176748-2-ajye_huang@compal.corp-partner.google.com
Signed-off-by: Mark Brown <broonie@kernel.org>
20 months agoASoC: SOF: Intel: hda-codec: fix possible memory leak in hda_codec_device_init()
Yang Yingliang [Fri, 21 Oct 2022 12:38:49 +0000 (20:38 +0800)]
ASoC: SOF: Intel: hda-codec: fix possible memory leak in hda_codec_device_init()

If snd_hdac_device_register() fails, 'codec' and name allocated in
dev_set_name() called in snd_hdac_device_init() are leaked. Fix this
by calling put_device(), so they can be freed in snd_hda_codec_dev_release()
and kobject_cleanup().

Fixes: 829c67319806 ("ASoC: SOF: Intel: Introduce HDA codec init and exit routines")
Fixes: dfe66a18780d ("ALSA: hdac_ext: add extended HDA bus")
Suggested-by: Cezary Rojewski <cezary.rojewski@intel.com>
Signed-off-by: Yang Yingliang <yangyingliang@huawei.com>
Reviewed-by: Kai Vehmanen <kai.vehmanen@linux.intel.com>
Link: https://lore.kernel.org/r/20221021123849.456857-2-yangyingliang@huawei.com
Signed-off-by: Mark Brown <broonie@kernel.org>
20 months agoASoC: Intel: Skylake: fix possible memory leak in skl_codec_device_init()
Yang Yingliang [Fri, 21 Oct 2022 12:38:48 +0000 (20:38 +0800)]
ASoC: Intel: Skylake: fix possible memory leak in skl_codec_device_init()

If snd_hdac_device_register() fails, 'codec' and name allocated in
dev_set_name() called in snd_hdac_device_init() are leaked. Fix this
by calling put_device(), so they can be freed in snd_hda_codec_dev_release()
and kobject_cleanup().

Fixes: e4746d94d00c ("ASoC: Intel: Skylake: Introduce HDA codec init and exit routines")
Fixes: dfe66a18780d ("ALSA: hdac_ext: add extended HDA bus")
Suggested-by: Cezary Rojewski <cezary.rojewski@intel.com>
Signed-off-by: Yang Yingliang <yangyingliang@huawei.com>
Reviewed-by: Cezary Rojewski <cezary.rojewski@intel.com>
Link: https://lore.kernel.org/r/20221021123849.456857-1-yangyingliang@huawei.com
Signed-off-by: Mark Brown <broonie@kernel.org>
20 months agoAdd support for MICFIL on i.MX93 platform
Mark Brown [Tue, 1 Nov 2022 14:33:10 +0000 (14:33 +0000)]
Add support for MICFIL on i.MX93 platform

Merge series from Chancel Liu <chancel.liu@nxp.com>:

This patchset supports MICFIL on i.MX93 platform.

20 months agoASoC: fsl_micfil: Add support when using eDMA
Chancel Liu [Fri, 28 Oct 2022 08:27:50 +0000 (16:27 +0800)]
ASoC: fsl_micfil: Add support when using eDMA

On i.MX93 platform MICFIL uses eDMA. The maxburst should be set to the
number of channels in eDMA multiple FIFO mode.

Signed-off-by: Chancel Liu <chancel.liu@nxp.com>
Acked-by: Shengjiu Wang <shengjiu.wang@gmail.com>
Link: https://lore.kernel.org/r/20221028082750.991822-4-chancel.liu@nxp.com
Signed-off-by: Mark Brown <broonie@kernel.org>
20 months agoASoC: fsl_micfil: Add support for i.MX93 platform
Chancel Liu [Fri, 28 Oct 2022 08:27:49 +0000 (16:27 +0800)]
ASoC: fsl_micfil: Add support for i.MX93 platform

Add compatible string and specific soc data to support MICFIL on i.MX93
platform.

Signed-off-by: Chancel Liu <chancel.liu@nxp.com>
Acked-by: Shengjiu Wang <shengjiu.wang@gmail.com>
Link: https://lore.kernel.org/r/20221028082750.991822-3-chancel.liu@nxp.com
Signed-off-by: Mark Brown <broonie@kernel.org>
20 months agoASoC: dt-bindings: fsl,micfil: Add compatible string for i.MX93 platform
Chancel Liu [Fri, 28 Oct 2022 08:27:48 +0000 (16:27 +0800)]
ASoC: dt-bindings: fsl,micfil: Add compatible string for i.MX93 platform

Add compatible string "fsl,imx93-micfil" for i.MX93 platform

Signed-off-by: Chancel Liu <chancel.liu@nxp.com>
Acked-by: Rob Herring <robh@kernel.org>
Link: https://lore.kernel.org/r/20221028082750.991822-2-chancel.liu@nxp.com
Signed-off-by: Mark Brown <broonie@kernel.org>
20 months agoASoC: cs42xx8-i2c.c: add module device table for of
Peter Bergin [Mon, 31 Oct 2022 20:37:23 +0000 (21:37 +0100)]
ASoC: cs42xx8-i2c.c: add module device table for of

When trying to connect the device with the driver through
device-tree it is not working. The of_device_id is defined in
cs42xx8.c but is not correctly included in cs42xx8-i2c.c.

Move of_device_id table to cs42xx8-i2c.c. Get cs42xx8_driver_data
in cs42xx8_i2c_probe() and pass as argument to cs42xx8_probe(). Move
error check if no driver data found to cs42xx8_i2c_probe().

Signed-off-by: Peter Bergin <peter@berginkonsult.se>
Acked-by: Charles Keepax <ckeepax@opensource.cirrus.com>
Link: https://lore.kernel.org/r/20221031203723.168177-1-peter@berginkonsult.se
Signed-off-by: Mark Brown <broonie@kernel.org>
20 months agoASoC: SOF: fix compilation issue with readb/writeb helpers
Pierre-Louis Bossart [Mon, 31 Oct 2022 19:53:40 +0000 (15:53 -0400)]
ASoC: SOF: fix compilation issue with readb/writeb helpers

Replace them with read8/write8 to avoid compilation issue on ARM. In
hindsight this is more consistent with the read64/write64 helpers
already used in SOF.

Reported-by: Nathan Chancellor <nathan@kernel.org>
Link: https://lore.kernel.org/alsa-devel/Y1rTFrohLqaiZAy%2F@dev-arch.thelio-3990X/
Signed-off-by: Pierre-Louis Bossart <pierre-louis.bossart@linux.intel.com>
Link: https://lore.kernel.org/r/20221031195340.249868-1-pierre-louis.bossart@linux.intel.com
Signed-off-by: Mark Brown <broonie@kernel.org>
20 months agoASoC: jz4740-i2s: Remove .set_sysclk() & friends
Mark Brown [Mon, 31 Oct 2022 18:48:38 +0000 (18:48 +0000)]
ASoC: jz4740-i2s: Remove .set_sysclk() & friends

Merge series from Aidan MacDonald <aidanmacdonald.0x0@gmail.com>:

A quick series to get rid of .set_sysclk() from jz4740-i2s.
It wasn't used in practice so this shouldn't be troublesome for anyone,
and fortunately there aren't any backward compatibility concerns.

The actual rationale for removing it, as opposed to fixing the
issues of the current DT bindings and implementation, is provided
in the dt-bindings patch.

20 months agoASoC: SOF: client-probes: Add support for IPC4
Mark Brown [Mon, 31 Oct 2022 18:48:31 +0000 (18:48 +0000)]
ASoC: SOF: client-probes: Add support for IPC4

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

The probes (the ability of probing the audio data from firmware processing
points or to receive stream of debug/trace information) is supported by IPC4
as well, but due to the differences between the two IPC version the low level
setup and information we need for probing is different.

This series will extend the existing probes support for IPC3 with IPC4 'backend'

20 months agoASoC: soc-utils: Remove __exit for snd_soc_util_exit()
Chen Zhongjin [Mon, 31 Oct 2022 13:40:31 +0000 (21:40 +0800)]
ASoC: soc-utils: Remove __exit for snd_soc_util_exit()

snd_soc_util_exit() is called in __init snd_soc_init() for cleanup.
Remove the __exit annotation for it to fix the build warning:

WARNING: modpost: sound/soc/snd-soc-core.o: section mismatch in reference: init_module (section: .init.text) -> snd_soc_util_exit (section: .exit.text)

Fixes: 6ec27c53886c ("ASoC: core: Fix use-after-free in snd_soc_exit()")
Signed-off-by: Chen Zhongjin <chenzhongjin@huawei.com>
Link: https://lore.kernel.org/r/20221031134031.256511-1-chenzhongjin@huawei.com
Signed-off-by: Mark Brown <broonie@kernel.org>
20 months agoASoC: SOF: IPC4: probes: Implement IPC4 ops for probes client device
Jyri Sarha [Mon, 31 Oct 2022 10:51:41 +0000 (12:51 +0200)]
ASoC: SOF: IPC4: probes: Implement IPC4 ops for probes client device

Implement IPC operations for IPC4 messaging and add doxygen
documentation for the functions.

Signed-off-by: Jyri Sarha <jyri.sarha@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: Ranjani Sridharan <ranjani.sridharan@linux.intel.com>
Signed-off-by: Péter Ujfalusi <peter.ujfalusi@linux.intel.com>
Link: https://lore.kernel.org/r/20221031105141.19037-6-peter.ujfalusi@linux.intel.com
Signed-off-by: Mark Brown <broonie@kernel.org>
20 months agoASoC: SOF: client: Add sof_client_ipc4_find_module() function
Jyri Sarha [Mon, 31 Oct 2022 10:51:40 +0000 (12:51 +0200)]
ASoC: SOF: client: Add sof_client_ipc4_find_module() function

Add sof_client_ipc4_find_module() for calling
sof_ipc4_find_module_by_uuid() in sof client code.

Signed-off-by: Jyri Sarha <jyri.sarha@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: Ranjani Sridharan <ranjani.sridharan@linux.intel.com>
Signed-off-by: Péter Ujfalusi <peter.ujfalusi@linux.intel.com>
Link: https://lore.kernel.org/r/20221031105141.19037-5-peter.ujfalusi@linux.intel.com
Signed-off-by: Mark Brown <broonie@kernel.org>
20 months agoASoC: SOF: client: Add sof_client_ipc_set_get_data()
Jyri Sarha [Mon, 31 Oct 2022 10:51:39 +0000 (12:51 +0200)]
ASoC: SOF: client: Add sof_client_ipc_set_get_data()

No need to duplicate set_get_data msg handling in clients.

Signed-off-by: Jyri Sarha <jyri.sarha@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: Ranjani Sridharan <ranjani.sridharan@linux.intel.com>
Signed-off-by: Péter Ujfalusi <peter.ujfalusi@linux.intel.com>
Link: https://lore.kernel.org/r/20221031105141.19037-4-peter.ujfalusi@linux.intel.com
Signed-off-by: Mark Brown <broonie@kernel.org>
20 months agoASoC: SOF: probes: Separate IPC3 operations to a separate file
Jyri Sarha [Mon, 31 Oct 2022 10:51:38 +0000 (12:51 +0200)]
ASoC: SOF: probes: Separate IPC3 operations to a separate file

Declare an IPC ops struct for probes client device and move IPC3
functions behind it.

Signed-off-by: Jyri Sarha <jyri.sarha@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: Ranjani Sridharan <ranjani.sridharan@linux.intel.com>
Signed-off-by: Péter Ujfalusi <peter.ujfalusi@linux.intel.com>
Link: https://lore.kernel.org/r/20221031105141.19037-3-peter.ujfalusi@linux.intel.com
Signed-off-by: Mark Brown <broonie@kernel.org>
20 months agoASoC: SOF: probes: Replace [0] union members with DECLARE_FLEX_ARRAY()
Jyri Sarha [Mon, 31 Oct 2022 10:51:37 +0000 (12:51 +0200)]
ASoC: SOF: probes: Replace [0] union members with DECLARE_FLEX_ARRAY()

Replace probes related [0] arrays, all found within unions, with
DECLARE_FLEX_ARRAY() declarations.

Signed-off-by: Jyri Sarha <jyri.sarha@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: Ranjani Sridharan <ranjani.sridharan@linux.intel.com>
Signed-off-by: Péter Ujfalusi <peter.ujfalusi@linux.intel.com>
Link: https://lore.kernel.org/r/20221031105141.19037-2-peter.ujfalusi@linux.intel.com
Signed-off-by: Mark Brown <broonie@kernel.org>
20 months agoASoC: ingenic: Remove unnecessary clocks from schema
Aidan MacDonald [Fri, 28 Oct 2022 10:34:16 +0000 (11:34 +0100)]
ASoC: ingenic: Remove unnecessary clocks from schema

The AIC needs only the first two clocks: "aic" is a gate that's used
for gating the I2S controller when it's suspended, and "i2s" is the
system clock, from which the bit and frame clocks are derived. Both
clocks are therefore reasonably part of the AIC and should be passed
to the OS.

But the "ext" and "pll half" clocks are a little more questionable.
It appears these bindings were introduced when the schema was first
converted to YAML, but weren't present in the original .txt binding.
They are intended to be the possible parent clocks of "i2s".

The JZ4770 actually has three parents for its "i2s" clock, named
"ext", "pll0", and "pll1" in the Linux driver. The JZ4780 has two
parents but it doesn't have a "pll half" clock, instead it has an
"i2s_pll" clock which behaves much differently to the actual
"pll half" clock found on the JZ4740 & JZ4760. And there are other
Ingenic SoCs that share the JZ4780's clock layout, eg, the X1000.

Therefore, the bindings aren't really adequate for the JZ4770 and
a bit misleading for the JZ4780. Either we should fix the bindings,
or remove them entirely.

This patch opts to remove the bindings. There is a good case to be
made that "ext" and "pll half" don't belong here because they aren't
directly used by the AIC. They are only used to set the parent of
the "i2s" clock; they have no other effect on the AIC.

A good way to think of it is in terms of how the AIC constrains
clocks. The AIC can only generate the bit & frame clocks from the
system clock in certain ratios. Setting the sample rate effectively
constrains the frame clock, which, because of the clock dividers
controlled by the AIC, translates to constraints on the "i2s" clock.
Nothing in the AIC imposes a direct constraint on the parents of
the "i2s" clock, and the AIC does not need to enable or disable
the parents directly, so in principle the AIC doesn't need to be
aware of the parent clocks at all.

The choice of parent clock is still important, but the AIC doesn't
have enough information to apply such constraints itself. The sound
card does have that information because it knows how the AIC is
connected to other components. We need to use other DT mechanisms
to communicate those constraints at the sound card level, instead
of passing the clocks through to the AIC, and inventing ad-hoc ways
to plumb the constraints around behind the scenes.

Signed-off-by: Aidan MacDonald <aidanmacdonald.0x0@gmail.com>
Acked-by: Paul Cercueil <paul@crapouillou.net>
Link: https://lore.kernel.org/r/20221028103418.17578-2-aidanmacdonald.0x0@gmail.com
Signed-off-by: Mark Brown <broonie@kernel.org>
20 months agoASoC: jz4740-i2s: Remove .set_sysclk()
Aidan MacDonald [Fri, 28 Oct 2022 10:34:18 +0000 (11:34 +0100)]
ASoC: jz4740-i2s: Remove .set_sysclk()

.set_sysclk() is effectively unused here. No machine drivers use
jz4740-i2s; and JZ4740_I2S_CLKSRC_EXT is the only selectable clock
source with simple-card, but that is also the default source and
has a fixed frequency, so configuring it would be redundant.

simple-card ignores -ENOTSUPP error codes when setting the sysclock,
so any device trees that do set the sysclock for some reason should
still work.

It's still possible to configure the clock parent manually in the
device tree and control frequency using other simple-card options,
so at the end of the day there's no real loss in functionality.

Signed-off-by: Aidan MacDonald <aidanmacdonald.0x0@gmail.com>
Reviewed-by: Paul Cercueil <paul@crapouillou.net>
Link: https://lore.kernel.org/r/20221028103418.17578-4-aidanmacdonald.0x0@gmail.com
Signed-off-by: Mark Brown <broonie@kernel.org>
20 months agoASoC: qdsp6: audioreach: add multi-port, SAL and MFC support
Mark Brown [Fri, 28 Oct 2022 19:23:31 +0000 (20:23 +0100)]
ASoC: qdsp6: audioreach: add multi-port, SAL and MFC support

Merge series from Srinivas Kandagatla <srinivas.kandagatla@linaro.org>:

This patchset adds support to multi-port connections between AudioReach Modules
which is required for sophisticated graphs like ECNS or Speaker Protection.
Also as part of ECNS testing new module support for SAL and MFC are added.

Tested on SM8450 with ECNS.

20 months agoASoC: SOF: Intel: HDA: refactor codec and multi-link suport
Mark Brown [Fri, 28 Oct 2022 18:52:20 +0000 (19:52 +0100)]
ASoC: SOF: Intel: HDA: refactor codec and multi-link suport

Merge series from Pierre-Louis Bossart <pierre-louis.bossart@linux.intel.com>:

Existing HDaudio controllers expose an HDAudio DMA which is used to
interface with HDaudio codecs. All other interfaces supported by Intel
(SoundWire, SSP, DMIC) rely for data transfers on another GP-DMA
managed by the DSP firmware - the HDaudio DMA is only used for
memory-to-DSP transfers.

New HDaudio extensions will enable the use of this HDaudio DMA for all
of SoundWire, SSP, DMIC. These extensions will be backwards-compatible
for HDaudio and iDISP codecs, but will require new programming
sequences and DAI callbacks for SoundWire, SSP and DMIC.

Before we add support for 'extended audio links' and the programming
sequences for the DMA, we need to refactor the code. All HDaudio codec
support needs to be well identified in a separate file, and likewise
all the 'multi-link' handling needs to be better split.

This patchset removes a number of 'old' Kconfig dependencies and
options, adds helpers with a fallback to remove IS_ENABLED checks in
the code and tries to simplify programming sequences when possible.

One indirect benefit from this refactoring is that developers can
switch with a kernel parameter from HDaudio support to a variant of
'nocodec' support. This proves extremely useful to test on existing
Intel RVPs and Up boards, where the same build can be used to check 3
interfaces (HDaudio, SSP, DMIC) by just removing modules, setting the
kernel parameter and reloading modules.

20 months agoASoC: Intel: avs: PCM power management
Mark Brown [Fri, 28 Oct 2022 16:40:22 +0000 (17:40 +0100)]
ASoC: Intel: avs: PCM power management

Merge series from Cezary Rojewski <cezary.rojewski@intel.com>:

Goal of the series is implementation of suspend/resume operations for a
PCM stream along with all the collaterals connected to the subject.

Start with splitting avs_dai_fe_hw_free() as ideally we would like to
reuse as much of existing code as possible but snd_pcm_lib_free_pages()
is not desired part of the function when speaking of suspend operation.

The actual implementation of suspend/resume() for component drivers
follows. For most scenarios, the PM flow is similar to standard
streaming one, except for the part where the position register are being
saved and the lack of PCM pages freeing. To reduce code duplication, all
avs_dai_suspend_XXX() and avs_dai_resume_XXX() functions reuse their
non-PM equivalents.
Order of operations is affected by the fact that path binding/unbinding
happens only in FE part of the stream.

Above essentially unlocks SX+streaming scenarios i.e.: power transitions
with an ongoing stream.

As some streams are allowed to run in low power state, support is
provided for S0iX state. The handlers check ACPI capabilities and the
number of active low-power paths before deciding between SX and S0iX
flows.

The last portion of the patchset is addition of power/clock gating
overrides. There is no single set of registers that ensures AudioDSP
firmware loads 100% of time on every single configuration. By having
them exposed, user can have the loading procedure behavior adjusted for
their configuration without having to recompile the kernel.

20 months agoASoC: qdsp6: audioreach: add support to enable module command
Srinivas Kandagatla [Thu, 27 Oct 2022 10:27:10 +0000 (11:27 +0100)]
ASoC: qdsp6: audioreach: add support to enable module command

Add support to enable Module command which is required for logging
module to be able to debug.

Signed-off-by: Srinivas Kandagatla <srinivas.kandagatla@linaro.org>
Link: https://lore.kernel.org/r/20221027102710.21407-10-srinivas.kandagatla@linaro.org
Signed-off-by: Mark Brown <broonie@kernel.org>
20 months agoASoC: qdsp6: audioreach: add support for MFC Module
Srinivas Kandagatla [Thu, 27 Oct 2022 10:27:09 +0000 (11:27 +0100)]
ASoC: qdsp6: audioreach: add support for MFC Module

Add support to enable and configure Media Format Converter (MFC) Module.

Signed-off-by: Srinivas Kandagatla <srinivas.kandagatla@linaro.org>
Link: https://lore.kernel.org/r/20221027102710.21407-9-srinivas.kandagatla@linaro.org
Signed-off-by: Mark Brown <broonie@kernel.org>
20 months agoASoC: qdsp6: audioreach: add support to enable SAL Module
Srinivas Kandagatla [Thu, 27 Oct 2022 10:27:08 +0000 (11:27 +0100)]
ASoC: qdsp6: audioreach: add support to enable SAL Module

Add support to Simple Accumulator-Limiter module.

Signed-off-by: Srinivas Kandagatla <srinivas.kandagatla@linaro.org>
Link: https://lore.kernel.org/r/20221027102710.21407-8-srinivas.kandagatla@linaro.org
Signed-off-by: Mark Brown <broonie@kernel.org>
20 months agoASoC: qdsp6: audioreach: add support for more port connections
Srinivas Kandagatla [Thu, 27 Oct 2022 10:27:07 +0000 (11:27 +0100)]
ASoC: qdsp6: audioreach: add support for more port connections

AudioReach Modules can connect to other modules using source and
destination port, and each module in theory can support up to 255 port
connections. But in practice this limit is at max 8 ports at a time.
So add support for allowing multiple port connections.

This support is needed for more detailed graphs like ECNS, speaker
protection and so.

Signed-off-by: Srinivas Kandagatla <srinivas.kandagatla@linaro.org>
Link: https://lore.kernel.org/r/20221027102710.21407-7-srinivas.kandagatla@linaro.org
Signed-off-by: Mark Brown <broonie@kernel.org>
20 months agoASoC: qdsp6: audioreach: simplify module_list sz calculation
Srinivas Kandagatla [Thu, 27 Oct 2022 10:27:06 +0000 (11:27 +0100)]
ASoC: qdsp6: audioreach: simplify module_list sz calculation

Simplify module_list size calculation by doing inside modules loop.

Signed-off-by: Srinivas Kandagatla <srinivas.kandagatla@linaro.org>
Link: https://lore.kernel.org/r/20221027102710.21407-6-srinivas.kandagatla@linaro.org
Signed-off-by: Mark Brown <broonie@kernel.org>
20 months agoASoC: qdsp6: audioreach: Simplify handing FE and BE graph connections
Srinivas Kandagatla [Thu, 27 Oct 2022 10:27:05 +0000 (11:27 +0100)]
ASoC: qdsp6: audioreach: Simplify handing FE and BE graph connections

Current AudioReach design of connecting FE and BE graph is very complicated
and not reliable. Instead used the virtual damp widgets private data to help
identify the modules that needs connection at runtime. Also maintain a
inter-graph connection info in the graph info, which can be used to both
determine if the graphs are connected and at graph build time.

Signed-off-by: Srinivas Kandagatla <srinivas.kandagatla@linaro.org>
Link: https://lore.kernel.org/r/20221027102710.21407-5-srinivas.kandagatla@linaro.org
Signed-off-by: Mark Brown <broonie@kernel.org>
20 months agoASoC: qdsp6: audioreach: update dapm kcontrol private data
Srinivas Kandagatla [Thu, 27 Oct 2022 10:27:04 +0000 (11:27 +0100)]
ASoC: qdsp6: audioreach: update dapm kcontrol private data

Update kcontrol private date to include more information like graph id
and module instance id which its connected to. Also maintain this virtual
dapm mixer widget in a list so that we could lookup while FE and BE connection
are added.

Signed-off-by: Srinivas Kandagatla <srinivas.kandagatla@linaro.org>
Link: https://lore.kernel.org/r/20221027102710.21407-4-srinivas.kandagatla@linaro.org
Signed-off-by: Mark Brown <broonie@kernel.org>
20 months agoASoC: qdsp6: audioreach: remove unused connection_list
Srinivas Kandagatla [Thu, 27 Oct 2022 10:27:03 +0000 (11:27 +0100)]
ASoC: qdsp6: audioreach: remove unused connection_list

Remove unused connection_list parameter.

Signed-off-by: Srinivas Kandagatla <srinivas.kandagatla@linaro.org>
Link: https://lore.kernel.org/r/20221027102710.21407-3-srinivas.kandagatla@linaro.org
Signed-off-by: Mark Brown <broonie@kernel.org>
20 months agoASoC: qdsp6: audioreach: topology use idr_alloc_u32
Srinivas Kandagatla [Thu, 27 Oct 2022 10:27:02 +0000 (11:27 +0100)]
ASoC: qdsp6: audioreach: topology use idr_alloc_u32

SubGraph and Module Instance ids take 32 bits, so use idr_alloc_u32
instead of idr_alloc to able to accommodate valid ranges.

Signed-off-by: Srinivas Kandagatla <srinivas.kandagatla@linaro.org>
Link: https://lore.kernel.org/r/20221027102710.21407-2-srinivas.kandagatla@linaro.org
Signed-off-by: Mark Brown <broonie@kernel.org>
20 months agoAdd support for SAI on i.MX93 platform
Mark Brown [Fri, 28 Oct 2022 15:50:34 +0000 (16:50 +0100)]
Add support for SAI on i.MX93 platform

Merge series from Chancel Liu <chancel.liu@nxp.com>:

This patchset supports SAI on i.MX93 platform.

20 months agoASoC: SOF: introduce new DEBUG_NOCODEC mode
Pierre-Louis Bossart [Thu, 27 Oct 2022 19:35:40 +0000 (15:35 -0400)]
ASoC: SOF: introduce new DEBUG_NOCODEC mode

The existing NOCODEC mode enforces a build-time mutual exclusion with
the HDaudio link support, mostly to avoid any dependency on the
snd_hdac library and references to HDAudio codec/i915 stuff.

This is very useful to track dependencies and test a minimal
configuration, but very painful for developers and CI: a recompilation
and reinstall of the kernel modules is required.

This patch suggests an alternate middle ground where the selection of
the machine driver and all codec-related actions are bypassed at
run-time, contingent on a kernel module parameter being set.

For example setting BIT(10) with
'options snd_sof sof_debug=0x401'
is enough to switch from an HDaudio card to a nocodec one.

This new DEBUG_NOCODEC mode is not suitable for distributions and
end-users. It's not even recommended on all platforms, i.e. the
NOCODEC mode is known not to work on specific devices where the BIOS
did not configure support for I2S/DMIC interfaces. The usual
development devices such as Chromebooks, Up boards and Intel RVP are
the only recommended platforms where this mode can be supported.

Note that the dynamic switch between HDaudio and nocodec may not
always possible depending on hardware layout, pin-mux options, and
BIOS settings. The audio subsustems on Intel platforms has to support
4 types of interfaces and pin-mux can be complicated.

Reviewers might ask: why didn't we do this earlier? The main reason is
that all the codec-related configurations were not cleanly separated
out in the sof/intel directory. With all the cleanups done recently,
adding this opt-in behavior is relatively straightforward.

Tested on UpExtreme (WHL) and UpExtreme i11 (TGL).

Signed-off-by: Pierre-Louis Bossart <pierre-louis.bossart@linux.intel.com>
Reviewed-by: Rander Wang <rander.wang@intel.com>
Reviewed-by: Bard Liao <yung-chuan.liao@linux.intel.com>
Reviewed-by: Péter Ujfalusi <peter.ujfalusi@linux.intel.com>
Reviewed-by: Ranjani Sridharan <ranjani.sridharan@linux.intel.com>
Link: https://lore.kernel.org/r/20221027193540.259520-22-pierre-louis.bossart@linux.intel.com
Signed-off-by: Mark Brown <broonie@kernel.org>
20 months agoASoC: SOF: Intel: hda-codec: use GPL-2.0-only license
Pierre-Louis Bossart [Thu, 27 Oct 2022 19:35:39 +0000 (15:35 -0400)]
ASoC: SOF: Intel: hda-codec: use GPL-2.0-only license

All the HDAudio codec handling is completely specific to Linux and
completely dependency on GPL2.0 code, specifically the snd_hdac_
library.

There was no intention to have a dual-license for this code, this was
an oversight that needs to be corrected. Update the SPDX and
EXPORT_SYMBOL information, no functionality change otherwise.

Signed-off-by: Pierre-Louis Bossart <pierre-louis.bossart@linux.intel.com>
Reviewed-by: Rander Wang <rander.wang@intel.com>
Reviewed-by: Bard Liao <yung-chuan.liao@linux.intel.com>
Reviewed-by: Péter Ujfalusi <peter.ujfalusi@linux.intel.com>
Reviewed-by: Ranjani Sridharan <ranjani.sridharan@linux.intel.com>
Link: https://lore.kernel.org/r/20221027193540.259520-21-pierre-louis.bossart@linux.intel.com
Signed-off-by: Mark Brown <broonie@kernel.org>
20 months agoASoC: SOF: Intel: hda: clarify Kconfig dependencies
Pierre-Louis Bossart [Thu, 27 Oct 2022 19:35:38 +0000 (15:35 -0400)]
ASoC: SOF: Intel: hda: clarify Kconfig dependencies

Since we've moved to the same flows for HDaudio and iDISP codecs, we
need to be more consistent about dependencies.

Signed-off-by: Pierre-Louis Bossart <pierre-louis.bossart@linux.intel.com>
Reviewed-by: Rander Wang <rander.wang@intel.com>
Reviewed-by: Bard Liao <yung-chuan.liao@linux.intel.com>
Reviewed-by: Péter Ujfalusi <peter.ujfalusi@linux.intel.com>
Reviewed-by: Ranjani Sridharan <ranjani.sridharan@linux.intel.com>
Link: https://lore.kernel.org/r/20221027193540.259520-20-pierre-louis.bossart@linux.intel.com
Signed-off-by: Mark Brown <broonie@kernel.org>
20 months agoASoC: SOF: Intel: add hda_bus_ml_free helper
Pierre-Louis Bossart [Thu, 27 Oct 2022 19:35:37 +0000 (15:35 -0400)]
ASoC: SOF: Intel: add hda_bus_ml_free helper

Add helper matching allocation done in hda_bus_ml_get_capabilities().

No functionality change, just clearer code partitioning.

Signed-off-by: Pierre-Louis Bossart <pierre-louis.bossart@linux.intel.com>
Reviewed-by: Rander Wang <rander.wang@intel.com>
Reviewed-by: Bard Liao <yung-chuan.liao@linux.intel.com>
Reviewed-by: Péter Ujfalusi <peter.ujfalusi@linux.intel.com>
Reviewed-by: Ranjani Sridharan <ranjani.sridharan@linux.intel.com>
Link: https://lore.kernel.org/r/20221027193540.259520-19-pierre-louis.bossart@linux.intel.com
Signed-off-by: Mark Brown <broonie@kernel.org>
20 months agoASoC: SOF: Intel: hda-mlink: add helpers to suspend/resume links
Pierre-Louis Bossart [Thu, 27 Oct 2022 19:35:36 +0000 (15:35 -0400)]
ASoC: SOF: Intel: hda-mlink: add helpers to suspend/resume links

No functionality change, just move the code in hda-mlink.

Signed-off-by: Pierre-Louis Bossart <pierre-louis.bossart@linux.intel.com>
Reviewed-by: Rander Wang <rander.wang@intel.com>
Reviewed-by: Bard Liao <yung-chuan.liao@linux.intel.com>
Reviewed-by: Péter Ujfalusi <peter.ujfalusi@linux.intel.com>
Reviewed-by: Ranjani Sridharan <ranjani.sridharan@linux.intel.com>
Link: https://lore.kernel.org/r/20221027193540.259520-18-pierre-louis.bossart@linux.intel.com
Signed-off-by: Mark Brown <broonie@kernel.org>
20 months agoASoC: SOF: Intel: clarify bus_init and bus_exit sequences
Pierre-Louis Bossart [Thu, 27 Oct 2022 19:35:35 +0000 (15:35 -0400)]
ASoC: SOF: Intel: clarify bus_init and bus_exit sequences

The dependencies are on SND_SOC_SOF_HDA_AUDIO_CODEC and the bus_exit
sequence should be well identified.

Signed-off-by: Pierre-Louis Bossart <pierre-louis.bossart@linux.intel.com>
Reviewed-by: Rander Wang <rander.wang@intel.com>
Reviewed-by: Bard Liao <yung-chuan.liao@linux.intel.com>
Reviewed-by: Péter Ujfalusi <peter.ujfalusi@linux.intel.com>
Reviewed-by: Ranjani Sridharan <ranjani.sridharan@linux.intel.com>
Link: https://lore.kernel.org/r/20221027193540.259520-17-pierre-louis.bossart@linux.intel.com
Signed-off-by: Mark Brown <broonie@kernel.org>
20 months agoASoC: SOF: Intel: hda-codec: add helpers to suspend and resume cmd_io
Pierre-Louis Bossart [Thu, 27 Oct 2022 19:35:34 +0000 (15:35 -0400)]
ASoC: SOF: Intel: hda-codec: add helpers to suspend and resume cmd_io

No functionality change, code move to have better split between
HDaudio codec management and core parts.

Signed-off-by: Pierre-Louis Bossart <pierre-louis.bossart@linux.intel.com>
Reviewed-by: Rander Wang <rander.wang@intel.com>
Reviewed-by: Bard Liao <yung-chuan.liao@linux.intel.com>
Reviewed-by: Péter Ujfalusi <peter.ujfalusi@linux.intel.com>
Reviewed-by: Ranjani Sridharan <ranjani.sridharan@linux.intel.com>
Link: https://lore.kernel.org/r/20221027193540.259520-16-pierre-louis.bossart@linux.intel.com
Signed-off-by: Mark Brown <broonie@kernel.org>
20 months agoASoC: SOF: Intel: hda-dsp: clarify dependencies on SND_SOC_SOF_HDA
Pierre-Louis Bossart [Thu, 27 Oct 2022 19:35:33 +0000 (15:35 -0400)]
ASoC: SOF: Intel: hda-dsp: clarify dependencies on SND_SOC_SOF_HDA

IS_ENABLED is not always in the right places, the codec parts depend
on SND_SOC_SOF_HDAUDIO_CODEC

Signed-off-by: Pierre-Louis Bossart <pierre-louis.bossart@linux.intel.com>
Reviewed-by: Rander Wang <rander.wang@intel.com>
Reviewed-by: Bard Liao <yung-chuan.liao@linux.intel.com>
Reviewed-by: Péter Ujfalusi <peter.ujfalusi@linux.intel.com>
Reviewed-by: Ranjani Sridharan <ranjani.sridharan@linux.intel.com>
Link: https://lore.kernel.org/r/20221027193540.259520-15-pierre-louis.bossart@linux.intel.com
Signed-off-by: Mark Brown <broonie@kernel.org>
20 months agoASoC: SOF: Intel: hda-ctrl: use helper to clear RIRB status
Pierre-Louis Bossart [Thu, 27 Oct 2022 19:35:32 +0000 (15:35 -0400)]
ASoC: SOF: Intel: hda-ctrl: use helper to clear RIRB status

Change to use helper and avoid conditional compilation.

Signed-off-by: Pierre-Louis Bossart <pierre-louis.bossart@linux.intel.com>
Reviewed-by: Rander Wang <rander.wang@intel.com>
Reviewed-by: Bard Liao <yung-chuan.liao@linux.intel.com>
Reviewed-by: Péter Ujfalusi <peter.ujfalusi@linux.intel.com>
Reviewed-by: Ranjani Sridharan <ranjani.sridharan@linux.intel.com>
Link: https://lore.kernel.org/r/20221027193540.259520-14-pierre-louis.bossart@linux.intel.com
Signed-off-by: Mark Brown <broonie@kernel.org>
20 months agoASoC: SOF: Intel: hda-codec: add hda_codec_check_rirb_status() helper
Pierre-Louis Bossart [Thu, 27 Oct 2022 19:35:31 +0000 (15:35 -0400)]
ASoC: SOF: Intel: hda-codec: add hda_codec_check_rirb_status() helper

move existing functionality to new helper.

Signed-off-by: Pierre-Louis Bossart <pierre-louis.bossart@linux.intel.com>
Reviewed-by: Rander Wang <rander.wang@intel.com>
Reviewed-by: Bard Liao <yung-chuan.liao@linux.intel.com>
Reviewed-by: Péter Ujfalusi <peter.ujfalusi@linux.intel.com>
Reviewed-by: Ranjani Sridharan <ranjani.sridharan@linux.intel.com>
Link: https://lore.kernel.org/r/20221027193540.259520-13-pierre-louis.bossart@linux.intel.com
Signed-off-by: Mark Brown <broonie@kernel.org>
20 months agoASoC: SOF: Intel: hda-stream: always allocate CORB/RIRB buffer
Pierre-Louis Bossart [Thu, 27 Oct 2022 19:35:30 +0000 (15:35 -0400)]
ASoC: SOF: Intel: hda-stream: always allocate CORB/RIRB buffer

There is no real reason to filter out this allocation at build
time. Let's allocate it always, so that we can have a more dynamic way
of disabling HDaudio codec support without having to recompile.

Signed-off-by: Pierre-Louis Bossart <pierre-louis.bossart@linux.intel.com>
Reviewed-by: Rander Wang <rander.wang@intel.com>
Reviewed-by: Bard Liao <yung-chuan.liao@linux.intel.com>
Reviewed-by: Péter Ujfalusi <peter.ujfalusi@linux.intel.com>
Reviewed-by: Ranjani Sridharan <ranjani.sridharan@linux.intel.com>
Link: https://lore.kernel.org/r/20221027193540.259520-12-pierre-louis.bossart@linux.intel.com
Signed-off-by: Mark Brown <broonie@kernel.org>
20 months agoASoC: SOF: Intel: hda-codec: add stop_cmd_io helper
Pierre-Louis Bossart [Thu, 27 Oct 2022 19:35:29 +0000 (15:35 -0400)]
ASoC: SOF: Intel: hda-codec: add stop_cmd_io helper

One more helper to split controller and codec

Signed-off-by: Pierre-Louis Bossart <pierre-louis.bossart@linux.intel.com>
Reviewed-by: Rander Wang <rander.wang@intel.com>
Reviewed-by: Bard Liao <yung-chuan.liao@linux.intel.com>
Reviewed-by: Péter Ujfalusi <peter.ujfalusi@linux.intel.com>
Reviewed-by: Ranjani Sridharan <ranjani.sridharan@linux.intel.com>
Link: https://lore.kernel.org/r/20221027193540.259520-11-pierre-louis.bossart@linux.intel.com
Signed-off-by: Mark Brown <broonie@kernel.org>
20 months agoASoC: SOF: Intel: hda-codec: add hda_codec_device_remove() helper
Pierre-Louis Bossart [Thu, 27 Oct 2022 19:35:28 +0000 (15:35 -0400)]
ASoC: SOF: Intel: hda-codec: add hda_codec_device_remove() helper

Continue split between controller and codec.

Signed-off-by: Pierre-Louis Bossart <pierre-louis.bossart@linux.intel.com>
Reviewed-by: Rander Wang <rander.wang@intel.com>
Reviewed-by: Bard Liao <yung-chuan.liao@linux.intel.com>
Reviewed-by: Péter Ujfalusi <peter.ujfalusi@linux.intel.com>
Reviewed-by: Ranjani Sridharan <ranjani.sridharan@linux.intel.com>
Link: https://lore.kernel.org/r/20221027193540.259520-10-pierre-louis.bossart@linux.intel.com
Signed-off-by: Mark Brown <broonie@kernel.org>
20 months agoASoC: SOF: Intel: hda-ctrl: add codec wakeup helper
Pierre-Louis Bossart [Thu, 27 Oct 2022 19:35:27 +0000 (15:35 -0400)]
ASoC: SOF: Intel: hda-ctrl: add codec wakeup helper

Add new helper in hda-codec.c for a clean split between controller and
codec.

Signed-off-by: Pierre-Louis Bossart <pierre-louis.bossart@linux.intel.com>
Reviewed-by: Rander Wang <rander.wang@intel.com>
Reviewed-by: Bard Liao <yung-chuan.liao@linux.intel.com>
Reviewed-by: Péter Ujfalusi <peter.ujfalusi@linux.intel.com>
Reviewed-by: Ranjani Sridharan <ranjani.sridharan@linux.intel.com>
Link: https://lore.kernel.org/r/20221027193540.259520-9-pierre-louis.bossart@linux.intel.com
Signed-off-by: Mark Brown <broonie@kernel.org>
20 months agoASoC: SOF: Intel: move all RIRB/CMD_IO helpers to hda-codec.c
Pierre-Louis Bossart [Thu, 27 Oct 2022 19:35:26 +0000 (15:35 -0400)]
ASoC: SOF: Intel: move all RIRB/CMD_IO helpers to hda-codec.c

We need to split basic stream functionality from RIRB/CORB, which are
completely codec-related.

Signed-off-by: Pierre-Louis Bossart <pierre-louis.bossart@linux.intel.com>
Reviewed-by: Rander Wang <rander.wang@intel.com>
Reviewed-by: Bard Liao <yung-chuan.liao@linux.intel.com>
Reviewed-by: Péter Ujfalusi <peter.ujfalusi@linux.intel.com>
Reviewed-by: Ranjani Sridharan <ranjani.sridharan@linux.intel.com>
Link: https://lore.kernel.org/r/20221027193540.259520-8-pierre-louis.bossart@linux.intel.com
Signed-off-by: Mark Brown <broonie@kernel.org>
20 months agoASoC: SOF: Intel: hda: add multi-link helper for LOSVID
Pierre-Louis Bossart [Thu, 27 Oct 2022 19:35:25 +0000 (15:35 -0400)]
ASoC: SOF: Intel: hda: add multi-link helper for LOSVID

Add new helper to deal with LOSVID.

Signed-off-by: Pierre-Louis Bossart <pierre-louis.bossart@linux.intel.com>
Reviewed-by: Rander Wang <rander.wang@intel.com>
Reviewed-by: Bard Liao <yung-chuan.liao@linux.intel.com>
Reviewed-by: Péter Ujfalusi <peter.ujfalusi@linux.intel.com>
Reviewed-by: Ranjani Sridharan <ranjani.sridharan@linux.intel.com>
Link: https://lore.kernel.org/r/20221027193540.259520-7-pierre-louis.bossart@linux.intel.com
Signed-off-by: Mark Brown <broonie@kernel.org>
20 months agoASoC: SOF: Intel: start moving multi-link handling in dedicated file
Pierre-Louis Bossart [Thu, 27 Oct 2022 19:35:24 +0000 (15:35 -0400)]
ASoC: SOF: Intel: start moving multi-link handling in dedicated file

The multi-link handling needs to be handled with dedicated helpers
before cleanups and extensions.

Signed-off-by: Pierre-Louis Bossart <pierre-louis.bossart@linux.intel.com>
Reviewed-by: Rander Wang <rander.wang@intel.com>
Reviewed-by: Bard Liao <yung-chuan.liao@linux.intel.com>
Reviewed-by: Péter Ujfalusi <peter.ujfalusi@linux.intel.com>
Reviewed-by: Ranjani Sridharan <ranjani.sridharan@linux.intel.com>
Link: https://lore.kernel.org/r/20221027193540.259520-6-pierre-louis.bossart@linux.intel.com
Signed-off-by: Mark Brown <broonie@kernel.org>
20 months agoASoC: SOF: Intel: move codec state change to hda-codec.c
Pierre-Louis Bossart [Thu, 27 Oct 2022 19:35:23 +0000 (15:35 -0400)]
ASoC: SOF: Intel: move codec state change to hda-codec.c

The codec_mask and codec-related handling should depend on
SOF_HDA_AUDIO_CODEC, not SOF_HDA.

Signed-off-by: Pierre-Louis Bossart <pierre-louis.bossart@linux.intel.com>
Reviewed-by: Rander Wang <rander.wang@intel.com>
Reviewed-by: Bard Liao <yung-chuan.liao@linux.intel.com>
Reviewed-by: Péter Ujfalusi <peter.ujfalusi@linux.intel.com>
Reviewed-by: Ranjani Sridharan <ranjani.sridharan@linux.intel.com>
Link: https://lore.kernel.org/r/20221027193540.259520-5-pierre-louis.bossart@linux.intel.com
Signed-off-by: Mark Brown <broonie@kernel.org>
20 months agoASoC: SOF: Intel: hda-codec: simplify SND_SOC_SOF_HDA_AUDIO_CODEC handling
Pierre-Louis Bossart [Thu, 27 Oct 2022 19:35:22 +0000 (15:35 -0400)]
ASoC: SOF: Intel: hda-codec: simplify SND_SOC_SOF_HDA_AUDIO_CODEC handling

Now that we have removed the dependency on SND_SOC_HDAC_HDMI, we can
simplify the code and make the code conditional on a single #ifdef.

Signed-off-by: Pierre-Louis Bossart <pierre-louis.bossart@linux.intel.com>
Reviewed-by: Rander Wang <rander.wang@intel.com>
Reviewed-by: Bard Liao <yung-chuan.liao@linux.intel.com>
Reviewed-by: Péter Ujfalusi <peter.ujfalusi@linux.intel.com>
Reviewed-by: Ranjani Sridharan <ranjani.sridharan@linux.intel.com>
Link: https://lore.kernel.org/r/20221027193540.259520-4-pierre-louis.bossart@linux.intel.com
Signed-off-by: Mark Brown <broonie@kernel.org>
20 months agoASoC: SOF: Intel: remove all dependencies on SND_SOC_HDAC_HDMI
Pierre-Louis Bossart [Thu, 27 Oct 2022 19:35:21 +0000 (15:35 -0400)]
ASoC: SOF: Intel: remove all dependencies on SND_SOC_HDAC_HDMI

remove all dependencies on SND_SOC_HDAC_HDMI and
clean-up ifdefs. The machine driver still supports this configuration
used by the Skylake driver.

Signed-off-by: Pierre-Louis Bossart <pierre-louis.bossart@linux.intel.com>
Reviewed-by: Rander Wang <rander.wang@intel.com>
Reviewed-by: Bard Liao <yung-chuan.liao@linux.intel.com>
Reviewed-by: Péter Ujfalusi <peter.ujfalusi@linux.intel.com>
Reviewed-by: Ranjani Sridharan <ranjani.sridharan@linux.intel.com>
Link: https://lore.kernel.org/r/20221027193540.259520-3-pierre-louis.bossart@linux.intel.com
Signed-off-by: Mark Brown <broonie@kernel.org>
20 months agoASoC: SOF: Intel: remove option to disable the common_hdmi handling
Pierre-Louis Bossart [Thu, 27 Oct 2022 19:35:20 +0000 (15:35 -0400)]
ASoC: SOF: Intel: remove option to disable the common_hdmi handling

We've been using the same option for quite some time now, it's time to
remove the kernel parameter to disable the common HDaudio codec
handling.

Signed-off-by: Pierre-Louis Bossart <pierre-louis.bossart@linux.intel.com>
Reviewed-by: Rander Wang <rander.wang@intel.com>
Reviewed-by: Bard Liao <yung-chuan.liao@linux.intel.com>
Reviewed-by: Péter Ujfalusi <peter.ujfalusi@linux.intel.com>
Reviewed-by: Ranjani Sridharan <ranjani.sridharan@linux.intel.com>
Link: https://lore.kernel.org/r/20221027193540.259520-2-pierre-louis.bossart@linux.intel.com
Signed-off-by: Mark Brown <broonie@kernel.org>
20 months agoASoC: Intel: avs: Enact power gating policy
Cezary Rojewski [Thu, 27 Oct 2022 12:47:02 +0000 (14:47 +0200)]
ASoC: Intel: avs: Enact power gating policy

Update all firmware loading functions to also account for the power
gating policy. As module loading routine is missing the chicken bits
manipulation entirely, add the entire set there.

Signed-off-by: Cezary Rojewski <cezary.rojewski@intel.com>
Link: https://lore.kernel.org/r/20221027124702.1761002-10-cezary.rojewski@intel.com
Signed-off-by: Mark Brown <broonie@kernel.org>
20 months agoASoC: Intel: avs: Power and clock gating policy overriding
Cezary Rojewski [Thu, 27 Oct 2022 12:47:01 +0000 (14:47 +0200)]
ASoC: Intel: avs: Power and clock gating policy overriding

Provide pgctl/cgctl_mask module parameters for overriding power and
clock gating policies respectively. These help deal with rare firmware
loading failures on some configurations. There're no golden masks that
cover all known problems so leave the defaults as is.

While at it, update avs_hda_l1sen_enable()'s definition so it aligns
with its power/clock friends.

Signed-off-by: Cezary Rojewski <cezary.rojewski@intel.com>
Link: https://lore.kernel.org/r/20221027124702.1761002-9-cezary.rojewski@intel.com
Signed-off-by: Mark Brown <broonie@kernel.org>
20 months agoASoC: Intel: avs: Standby power-state support
Piotr Maziarz [Thu, 27 Oct 2022 12:47:00 +0000 (14:47 +0200)]
ASoC: Intel: avs: Standby power-state support

Introduce avs_suspend_standby() and avs_resume_standby() to support S0IX
streaming. The AudioDSP is not shutdown during such scenario and the PCI
device is armed for possible wake operation through an audio event.

As capability for a stream to be active during low power S0 is based off
of ->ignore_suspend, adjust the field's value according to platform
capabilities if needed.

Signed-off-by: Piotr Maziarz <piotrx.maziarz@linux.intel.com>
Signed-off-by: Cezary Rojewski <cezary.rojewski@intel.com>
Link: https://lore.kernel.org/r/20221027124702.1761002-8-cezary.rojewski@intel.com
Signed-off-by: Mark Brown <broonie@kernel.org>
20 months agoASoC: Intel: avs: Count low power streams
Cezary Rojewski [Thu, 27 Oct 2022 12:46:59 +0000 (14:46 +0200)]
ASoC: Intel: avs: Count low power streams

Streaming in S0iX differs from SX scenarios. Store the number of
so-called low-power streams to be able to differentiate between the two.

Signed-off-by: Cezary Rojewski <cezary.rojewski@intel.com>
Link: https://lore.kernel.org/r/20221027124702.1761002-7-cezary.rojewski@intel.com
Signed-off-by: Mark Brown <broonie@kernel.org>
20 months agoASoC: Intel: avs: Restart instead of resuming HDA capture streams
Cezary Rojewski [Thu, 27 Oct 2022 12:46:58 +0000 (14:46 +0200)]
ASoC: Intel: avs: Restart instead of resuming HDA capture streams

Resuming of capture streams for HD-Audio is unsupported so remove the
relevant flag from the hardware params when assigning them during
avs_component_hda_open().

Signed-off-by: Cezary Rojewski <cezary.rojewski@intel.com>
Link: https://lore.kernel.org/r/20221027124702.1761002-6-cezary.rojewski@intel.com
Signed-off-by: Mark Brown <broonie@kernel.org>
20 months agoASoC: Intel: avs: Handle SUSPEND and RESUME triggers
Amadeusz Sławiński [Thu, 27 Oct 2022 12:46:57 +0000 (14:46 +0200)]
ASoC: Intel: avs: Handle SUSPEND and RESUME triggers

With power management operations added, service SUSPEND and RESUME
trigger commands for running streams.

Signed-off-by: Amadeusz Sławiński <amadeuszx.slawinski@linux.intel.com>
Signed-off-by: Cezary Rojewski <cezary.rojewski@intel.com>
Link: https://lore.kernel.org/r/20221027124702.1761002-5-cezary.rojewski@intel.com
Signed-off-by: Mark Brown <broonie@kernel.org>
20 months agoALSA: hda: Introduce snd_hdac_stream_wait_drsm()
Cezary Rojewski [Thu, 27 Oct 2022 12:46:56 +0000 (14:46 +0200)]
ALSA: hda: Introduce snd_hdac_stream_wait_drsm()

Allow for waiting for DRSM bit for specified stream to be cleared from
HDAudio library level. Drivers may utilize this optional step during the
stream resume procedure.

Suggested-by: Pierre-Louis Bossart <pierre-louis.bossart@linux.intel.com>
Signed-off-by: Cezary Rojewski <cezary.rojewski@intel.com>
Reviewed-by: Takashi Iwai <tiwai@suse.de>
Link: https://lore.kernel.org/r/20221027124702.1761002-4-cezary.rojewski@intel.com
Signed-off-by: Mark Brown <broonie@kernel.org>
20 months agoASoC: Intel: avs: Introduce PCM power management routines
Cezary Rojewski [Thu, 27 Oct 2022 12:46:55 +0000 (14:46 +0200)]
ASoC: Intel: avs: Introduce PCM power management routines

Implement suspend/resume() operations for component drivers. For most
scenarios, the PM flow is similar to standard streaming one, except for
the part where the position register are being saved and the lack of PCM
pages freeing. To reduce code duplication, all avs_dai_suspend_XXX() and
avs_dai_resume_XXX() functions reuse their non-PM equivalents.

Given that path binding/unbinding happens only in FE part of the stream,
the order of suspend() goes:

1. hw_free() all FE DAIs, paths are unbound here
2. hw_free() all BE DAIs

Consequently, for resume() its:

1. hw_params() all BE DAIs
2. hw_params() all FE DAIs, paths are bound here
3. prepare() all BE DAIs
4. prepare() all FE DAIs

As component->suspend/resume() do not provide substream pointer, store
it ourselves so that the PM flow has all the necessary information to
proceed.

Signed-off-by: Cezary Rojewski <cezary.rojewski@intel.com>
Link: https://lore.kernel.org/r/20221027124702.1761002-3-cezary.rojewski@intel.com
Signed-off-by: Mark Brown <broonie@kernel.org>
20 months agoASoC: Intel: avs: Split pcm pages freeing operation from hw_free()
Cezary Rojewski [Thu, 27 Oct 2022 12:46:54 +0000 (14:46 +0200)]
ASoC: Intel: avs: Split pcm pages freeing operation from hw_free()

Prepare for introduction of PCM power management support. As freeing
pages during the suspend operation is not desired, separate
snd_pcm_lib_free_pages() from existing avs_dai_fe_hw_free() so that
majority of the code found within it can be reused for standard and PM
flows both.

Signed-off-by: Cezary Rojewski <cezary.rojewski@intel.com>
Link: https://lore.kernel.org/r/20221027124702.1761002-2-cezary.rojewski@intel.com
Signed-off-by: Mark Brown <broonie@kernel.org>
20 months agoASoC: fsl_xcvr: Add Counter registers
Shengjiu Wang [Fri, 28 Oct 2022 07:03:47 +0000 (15:03 +0800)]
ASoC: fsl_xcvr: Add Counter registers

These counter registers are part of register list,
add them to complete the register map

- DMAC counter control registers
- Data path Timestamp counter register
- Data path bit counter register
- Data path bit count timestamp register
- Data path bit read timestamp register

Signed-off-by: Shengjiu Wang <shengjiu.wang@nxp.com>
Link: https://lore.kernel.org/r/1666940627-7611-1-git-send-email-shengjiu.wang@nxp.com
Signed-off-by: Mark Brown <broonie@kernel.org>
20 months agoASoC: fsl_sai: Specify the maxburst to 8 on i.MX93 platform
Chancel Liu [Thu, 27 Oct 2022 06:03:11 +0000 (14:03 +0800)]
ASoC: fsl_sai: Specify the maxburst to 8 on i.MX93 platform

There is a limit to eDMA AXI on i.MX93. Only TCD that has NBYTES in a
multiple of 8bytes can enable scatter-gather. NBYTES is calculated by
bus width times maxburst. On i.MX93 platform the value of maxburst is
specified to 8. It makes sure that NBYTES is a multiple of 8bytes.

Signed-off-by: Chancel Liu <chancel.liu@nxp.com>
Acked-by: Shengjiu Wang <shengjiu.wang@gmail.com>
Reviewed-by: Daniel Baluta <daniel.baluta@nxp.com>
Link: https://lore.kernel.org/r/20221027060311.2549711-4-chancel.liu@nxp.com
Signed-off-by: Mark Brown <broonie@kernel.org>
20 months agoASoC: fsl_sai: Add support for i.MX93 platform
Chancel Liu [Thu, 27 Oct 2022 06:03:10 +0000 (14:03 +0800)]
ASoC: fsl_sai: Add support for i.MX93 platform

Add compatible string and specific soc data to support SAI on i.MX93
platform.

Signed-off-by: Chancel Liu <chancel.liu@nxp.com>
Acked-by: Shengjiu Wang <shengjiu.wang@gmail.com>
Reviewed-by: Daniel Baluta <daniel.baluta@nxp.com>
Link: https://lore.kernel.org/r/20221027060311.2549711-3-chancel.liu@nxp.com
Signed-off-by: Mark Brown <broonie@kernel.org>
20 months agoASoC: dt-bindings: fsl,sai: Add compatible string for i.MX93 platform
Chancel Liu [Thu, 27 Oct 2022 06:03:09 +0000 (14:03 +0800)]
ASoC: dt-bindings: fsl,sai: Add compatible string for i.MX93 platform

Add compatible string "fsl,imx93-sai" for i.MX93 platform

Signed-off-by: Chancel Liu <chancel.liu@nxp.com>
Acked-by: Krzysztof Kozlowski <krzysztof.kozlowski@linaro.org>
Reviewed-by: Daniel Baluta <daniel.baluta@nxp.com>
Link: https://lore.kernel.org/r/20221027060311.2549711-2-chancel.liu@nxp.com
Signed-off-by: Mark Brown <broonie@kernel.org>
20 months agoASoC: Intel: Fix typo in comments
Mark Brown [Wed, 26 Oct 2022 18:53:21 +0000 (19:53 +0100)]
ASoC: Intel: Fix typo in comments

Merge series from Amadeusz Sławiński <amadeuszx.slawinski@linux.intel.com>:

There is a typo which keeps propagating through existing Intel machine
boards fix it with hope that fix stops it from appearing in new boards.

20 months agoASoC: SOF: Intel: HDaudio cleanups
Mark Brown [Wed, 26 Oct 2022 18:53:14 +0000 (19:53 +0100)]
ASoC: SOF: Intel: HDaudio cleanups

Merge series from Pierre-Louis Bossart <pierre-louis.bossart@linux.intel.com>:

This is the part1 of my HDaudio cleanups, before the addition of
to-be-announced HDaudio extensions.

The patchset includes more consistent use of read/write/update
helpers, removal of useless waits, structure members and programming
sequences, removal of confusing sharing of private_data between FE and
BE.

Additional patches are coming to split the controller, codec and
multi-link management functionality in well-identified files.

Pierre-Louis Bossart (16):
  ASoC: SOF: ops: fallback to mmio in helpers
  ASoC: SOF: Intel: use mmio fallback for all platforms
  ASoC: SOF: ops: add readb/writeb helpers
  ASoC: SOF: ops: add snd_sof_dsp_updateb() helper
  ASoC: SOF: Intel: hda-dsp: use SOF helpers for consistency
  ASoC: SOF: Intel: hda-dai: start removing the use of
    runtime->private_data in BE
  ASoC: SOF: Intel: hda-dai: use component_get_drvdata to find hdac_bus
  ASoC: SOF: Intel: hda-dai: remove useless members in hda_pipe_params
  ASoC: SOF: Intel: hda-ctrl: remove useless sleep
  ASoC: SOF: Intel: hda: always do a full reset
  ASoC: SOF: Intel: hda: remove useless check on GCTL
  ASoC: SOF: Intel: hda-stream: use SOF helpers for consistency
  ASoC: SOF: Intel: hda-stream: rename CL_SD_CTL registers as SD_CTL
  ASoC: SOF: Intel: hda: use SOF helper for consistency
  ASoC: SOF: Intel: hda-stream: use snd_sof_dsp_updateb() helper
  ASoC: SOF: Intel: hda-stream: use readb/writeb for stream registers

 sound/soc/sof/intel/bdw.c            |  6 +---
 sound/soc/sof/intel/byt.c            | 12 ++-----
 sound/soc/sof/intel/hda-common-ops.c |  6 +---
 sound/soc/sof/intel/hda-ctrl.c       | 41 ++++++++--------------
 sound/soc/sof/intel/hda-dai.c        | 31 +++++++----------
 sound/soc/sof/intel/hda-dsp.c        | 12 ++++---
 sound/soc/sof/intel/hda-loader-skl.c | 30 ++++++++--------
 sound/soc/sof/intel/hda-loader.c     |  4 +--
 sound/soc/sof/intel/hda-stream.c     | 47 ++++++++++++-------------
 sound/soc/sof/intel/hda.c            |  5 ++-
 sound/soc/sof/intel/hda.h            | 25 +++++++-------
 sound/soc/sof/intel/pci-tng.c        |  6 +---
 sound/soc/sof/ops.h                  | 51 ++++++++++++++++++++--------
 sound/soc/sof/sof-priv.h             |  4 +++
 14 files changed, 136 insertions(+), 144 deletions(-)

--
2.34.1

20 months agoASoC: cleanups and improvements for jz4740-i2s
Mark Brown [Wed, 26 Oct 2022 18:29:28 +0000 (19:29 +0100)]
ASoC: cleanups and improvements for jz4740-i2s

Merge series from Aidan MacDonald <aidanmacdonald.0x0@gmail.com>:

This series is a preparatory cleanup of the jz4740-i2s driver before
adding support for a new SoC. The two improvements are lifting
unnecessary restrictions on sample rates and formats -- the existing
ones appear to be derived from the limitations of the JZ4740's internal
codec and don't reflect the actual capabilities of the I2S controller.

I'm unable to test the series on any JZ47xx SoCs, but I have tested
on an X1000 (which is the SoC I'll be adding in a followup series).

20 months agoASoC: dt-bindings: rt5682: Set sound-dai-cells to 1
Nícolas F. R. A. Prado [Mon, 24 Oct 2022 22:00:14 +0000 (18:00 -0400)]
ASoC: dt-bindings: rt5682: Set sound-dai-cells to 1

Commit 0adccaf1eac9 ("ASoC: dt-bindings: rt5682: Add #sound-dai-cells")
defined the sound-dai-cells property as 0. However, rt5682 has two DAIs,
AIF1 and AIF2, and therefore should have sound-dai-cells set to 1. Fix
it.

Fixes: 0adccaf1eac9 ("ASoC: dt-bindings: rt5682: Add #sound-dai-cells")
Signed-off-by: Nícolas F. R. A. Prado <nfraprado@collabora.com>
Reviewed-by: Chen-Yu Tsai <wenst@chromium.org>
Acked-by: Krzysztof Kozlowski <krzysztof.kozlowski@linaro.org>
Reviewed-by: AngeloGioacchino Del Regno <angelogioacchino.delregno@collabora.com>
Link: https://lore.kernel.org/r/20221024220015.1759428-4-nfraprado@collabora.com
Signed-off-by: Mark Brown <broonie@kernel.org>
20 months agoASoC: dt-bindings: realtek,rt5682s: Add #sound-dai-cells
Nícolas F. R. A. Prado [Mon, 24 Oct 2022 22:00:12 +0000 (18:00 -0400)]
ASoC: dt-bindings: realtek,rt5682s: Add #sound-dai-cells

The rt5682s codec is a DAI provider with two interfaces - AIF1 and AIF2
- and therefore should have a #sound-dai-cells property that is equal to
1. Add it.

Acked-by: Krzysztof Kozlowski <krzysztof.kozlowski@linaro.org>
Signed-off-by: Nícolas F. R. A. Prado <nfraprado@collabora.com>
Reviewed-by: Chen-Yu Tsai <wenst@chromium.org>
Reviewed-by: AngeloGioacchino Del Regno <angelogioacchino.delregno@collabora.com>
Link: https://lore.kernel.org/r/20221024220015.1759428-2-nfraprado@collabora.com
Signed-off-by: Mark Brown <broonie@kernel.org>
20 months agoASoC: SOF: ipc4-loader: Return ssize_t from sof_ipc4_fw_parse_ext_man()
Peter Ujfalusi [Tue, 25 Oct 2022 13:27:06 +0000 (16:27 +0300)]
ASoC: SOF: ipc4-loader: Return ssize_t from sof_ipc4_fw_parse_ext_man()

sof_ipc4_fw_parse_ext_man() can return negative error numbers which is not
correct for the used size_t type.

Change the return value to ssize_t and use the same type where the function
is called.

Reported-by: Dan Carpenter <dan.carpenter@oracle.com>
Fixes: 73c091a2fe96 ("ASoC: SOF: ipc4-loader: Support for loading external libraries")
Signed-off-by: Peter Ujfalusi <peter.ujfalusi@linux.intel.com>
Link: https://lore.kernel.org/r/20221025132706.30356-1-peter.ujfalusi@linux.intel.com
Signed-off-by: Mark Brown <broonie@kernel.org>
20 months agoASoC: SOF: Intel: MTL: fix comment error
Yong Zhi [Mon, 24 Oct 2022 16:43:50 +0000 (11:43 -0500)]
ASoC: SOF: Intel: MTL: fix comment error

Fix small cut-and-paste error in comment.

Reviewed-by: Bard Liao <yung-chuan.liao@linux.intel.com>
Reviewed-by: Péter Ujfalusi <peter.ujfalusi@linux.intel.com>
Signed-off-by: Yong Zhi <yong.zhi@intel.com>
Signed-off-by: Pierre-Louis Bossart <pierre-louis.bossart@linux.intel.com>
Link: https://lore.kernel.org/r/20221024164350.234830-1-pierre-louis.bossart@linux.intel.com
Signed-off-by: Mark Brown <broonie@kernel.org>
20 months agoASoC: dt-bindings: mt8192-mt6359: Set maxItems, not type, for sound-dai
Nícolas F. R. A. Prado [Mon, 24 Oct 2022 23:06:57 +0000 (19:06 -0400)]
ASoC: dt-bindings: mt8192-mt6359: Set maxItems, not type, for sound-dai

sound-dai is a standard property whose type is already set to
phandle-array by sound-dai.yaml, so there's no need to set it (and
wrongly so for headset-codec) in this binding. What should be set
however is the maximum number of items, which for headset-codec should
be 1.

Signed-off-by: Nícolas F. R. A. Prado <nfraprado@collabora.com>
Acked-by: Rob Herring <robh@kernel.org>
Link: https://lore.kernel.org/r/20221024230658.1772907-1-nfraprado@collabora.com
Signed-off-by: Mark Brown <broonie@kernel.org>
20 months agoASoC: Intel: avs: boards: Fix typo in comments
Amadeusz Sławiński [Mon, 24 Oct 2022 19:08:41 +0000 (21:08 +0200)]
ASoC: Intel: avs: boards: Fix typo in comments

It keeps propagating through machine boards, fix it once and for all.

Reviewed-by: Cezary Rojewski <cezary.rojewski@intel.com>
Signed-off-by: Amadeusz Sławiński <amadeuszx.slawinski@linux.intel.com>
Link: https://lore.kernel.org/r/20221024190841.31572-3-amadeuszx.slawinski@linux.intel.com
Signed-off-by: Mark Brown <broonie@kernel.org>
20 months agoASoC: Intel: boards: Fix typo in comments
Amadeusz Sławiński [Mon, 24 Oct 2022 19:08:40 +0000 (21:08 +0200)]
ASoC: Intel: boards: Fix typo in comments

It keeps propagating through machine boards, fix it once and for all.

Reviewed-by: Cezary Rojewski <cezary.rojewski@intel.com>
Signed-off-by: Amadeusz Sławiński <amadeuszx.slawinski@linux.intel.com>
Reviewed-by: Pierre-Louis Bossart <pierre-louis.bossart@linux.intel.com>
Link: https://lore.kernel.org/r/20221024190841.31572-2-amadeuszx.slawinski@linux.intel.com
Signed-off-by: Mark Brown <broonie@kernel.org>
20 months agoASoC: jz4740-i2s: Refactor DAI probe/remove ops as component ops
Aidan MacDonald [Sun, 23 Oct 2022 14:33:28 +0000 (15:33 +0100)]
ASoC: jz4740-i2s: Refactor DAI probe/remove ops as component ops

Move most of the DAI probe/remove logic into component ops.
This makes things more consistent because the AIC clock is
now managed solely from the component side. And it makes it
easier to add codec switching support later on.

Reviewed-by: Paul Cercueil <paul@crapouillou.net>
Signed-off-by: Aidan MacDonald <aidanmacdonald.0x0@gmail.com>
Link: https://lore.kernel.org/r/20221023143328.160866-10-aidanmacdonald.0x0@gmail.com
Signed-off-by: Mark Brown <broonie@kernel.org>
20 months agoASoC: jz4740-i2s: Move component functions near the component driver
Aidan MacDonald [Sun, 23 Oct 2022 14:33:27 +0000 (15:33 +0100)]
ASoC: jz4740-i2s: Move component functions near the component driver

Move the component suspend/resume functions near the definition
of the component driver to emphasize that they're unrelated to
the DAI functions.

Acked-by: Paul Cercueil <paul@crapouillou.net>
Signed-off-by: Aidan MacDonald <aidanmacdonald.0x0@gmail.com>
Link: https://lore.kernel.org/r/20221023143328.160866-9-aidanmacdonald.0x0@gmail.com
Signed-off-by: Mark Brown <broonie@kernel.org>
20 months agoASoC: jz4740-i2s: Support continuous sample rate
Aidan MacDonald [Sun, 23 Oct 2022 14:33:26 +0000 (15:33 +0100)]
ASoC: jz4740-i2s: Support continuous sample rate

The I2S controller on JZ47xx SoCs doesn't impose restrictions on
sample rate and the driver doesn't make any assumptions about it,
so the DAI should advertise a continuous sample rate range.

Acked-by: Paul Cercueil <paul@crapouillou.net>
Signed-off-by: Aidan MacDonald <aidanmacdonald.0x0@gmail.com>
Link: https://lore.kernel.org/r/20221023143328.160866-8-aidanmacdonald.0x0@gmail.com
Signed-off-by: Mark Brown <broonie@kernel.org>
20 months agoASoC: jz4740-i2s: Support S20_LE and S24_LE sample formats
Aidan MacDonald [Sun, 23 Oct 2022 14:33:25 +0000 (15:33 +0100)]
ASoC: jz4740-i2s: Support S20_LE and S24_LE sample formats

The audio controller on JZ47xx SoCs can transfer 20- and 24-bit
samples in the FIFO, so allow those formats to be used with the
I2S driver. Although the FIFO doesn't care about the in-memory
sample format, we only support 4-byte format variants because the
DMA controller on these SoCs cannot transfer in 3-byte multiples.

Reviewed-by: Paul Cercueil <paul@crapouillou.net>
Signed-off-by: Aidan MacDonald <aidanmacdonald.0x0@gmail.com>
Link: https://lore.kernel.org/r/20221023143328.160866-7-aidanmacdonald.0x0@gmail.com
Signed-off-by: Mark Brown <broonie@kernel.org>
20 months agoASoC: jz4740-i2s: Align macro values and sort includes
Aidan MacDonald [Sun, 23 Oct 2022 14:33:24 +0000 (15:33 +0100)]
ASoC: jz4740-i2s: Align macro values and sort includes

Some purely cosmetic changes: line up all the macro values to
make things easier to read and sort the includes alphabetically.

Acked-by: Paul Cercueil <paul@crapouillou.net>
Signed-off-by: Aidan MacDonald <aidanmacdonald.0x0@gmail.com>
Link: https://lore.kernel.org/r/20221023143328.160866-6-aidanmacdonald.0x0@gmail.com
Signed-off-by: Mark Brown <broonie@kernel.org>
20 months agoASoC: jz4740-i2s: Use FIELD_PREP() macros in hw_params callback
Aidan MacDonald [Sun, 23 Oct 2022 14:33:23 +0000 (15:33 +0100)]
ASoC: jz4740-i2s: Use FIELD_PREP() macros in hw_params callback

Get rid of a couple of macros and improve readability by using
FIELD_PREP() and GENMASK() for the sample size setting.

Acked-by: Paul Cercueil <paul@crapouillou.net>
Reviewed-by: Paul Cercueil <paul@crapouillou.net>
Signed-off-by: Aidan MacDonald <aidanmacdonald.0x0@gmail.com>
Link: https://lore.kernel.org/r/20221023143328.160866-5-aidanmacdonald.0x0@gmail.com
Signed-off-by: Mark Brown <broonie@kernel.org>
20 months agoASoC: jz4740-i2s: Simplify using regmap fields
Aidan MacDonald [Sun, 23 Oct 2022 14:33:22 +0000 (15:33 +0100)]
ASoC: jz4740-i2s: Simplify using regmap fields

The differences between register fields on different SoC versions
can be abstracted away using the regmap field API. This is easier
to understand and extend than comparisons based on the version ID.
Since the version IDs are unused after this change, remove them at
the same time, and remove unused macros.

Reviewed-by: Paul Cercueil <paul@crapouillou.net>
Signed-off-by: Aidan MacDonald <aidanmacdonald.0x0@gmail.com>
Link: https://lore.kernel.org/r/20221023143328.160866-4-aidanmacdonald.0x0@gmail.com
Signed-off-by: Mark Brown <broonie@kernel.org>
20 months agoASoC: jz4740-i2s: Convert to regmap API
Aidan MacDonald [Sun, 23 Oct 2022 14:33:21 +0000 (15:33 +0100)]
ASoC: jz4740-i2s: Convert to regmap API

Using regmap for accessing the AIC registers makes the driver a
little easier to read, and later refactors can take advantage of
regmap APIs to further simplify the driver.

Reviewed-by: Paul Cercueil <paul@crapouillou.net>
Signed-off-by: Aidan MacDonald <aidanmacdonald.0x0@gmail.com>
Link: https://lore.kernel.org/r/20221023143328.160866-3-aidanmacdonald.0x0@gmail.com
Signed-off-by: Mark Brown <broonie@kernel.org>