Skip to content

Integrate linux-seco-mtk/oleksii/upstream-asoc-sof

GitBot requested to merge linux-seco-mtk/oleksii/upstream-asoc-sof into kirkstone

Commit: https://git.seco.com/clea-os/bsp/mediatek/linux-seco-mtk/-/commit/05640359b4d727b1c33f4afd0f9a3835ba7a7980

GENIO: ASoC: mediatek: mt8395-evk: Log with dev_err_probe when waiting for codec

set_card_codec_info() can fail with EPROBE_DEFER if not all codecs have probed yet, so use dev_err_probe() to avoid logging as an error in that case. Also drop the return value from the message since it's already printed by dev_err_probe().

Change-Id: I5f0550aaecdaedb793cff69fd6e0c64e6d89acc8 Signed-off-by: Suhrid Subramaniam suhrid.subramaniam@mediatek.com

--

Commit: https://git.seco.com/clea-os/bsp/mediatek/linux-seco-mtk/-/commit/d9d4f04765690ff3eebcbebea37ca4688e0ac7ad

GENIO: arm64: dts: mediatek: genio-510-evk: add reserved memory for adsp

Add reserved memory for ADSP use. Based on commit 5d4bb8c6a9d6 ("GENIO: arm64: dts: mediatek: genio-700-evk: add reserved memory for adsp")

Change-Id: If5cbb1b05dc380fa5957fde902184d824e3ca545 Signed-off-by: Suhrid Subramaniam suhrid.subramaniam@mediatek.com Signed-off-by: Aary Patil aary.patil@mediatek.com

--

Commit: https://git.seco.com/clea-os/bsp/mediatek/linux-seco-mtk/-/commit/432a71816384b9dc2fc634bbe002d4e527915ced

GENIO: arm64: dts: mediatek: mt8370: add adsp node

Add nodes for adsp, adsp_mailbox0, adsp_mailbox1 required by Sound Open Firmware. Based on commit 73177a5b8184 ("BACKPORT: CHROMIUM: arm64: dts: mediatek: mt8188-geralt: add adsp node")

Change-Id: Ifa9fa6ad33dc74f63d9a0f614552947ebd5c67f5 Signed-off-by: Suhrid Subramaniam suhrid.subramaniam@mediatek.com Signed-off-by: Aary Patil aary.patil@mediatek.com

--

Commit: https://git.seco.com/clea-os/bsp/mediatek/linux-seco-mtk/-/commit/cf68d7a0ace354ab317c057185ad297b752140e5

GENIO: ASoC: mediatek: mt8390-evk: add SOF support

SOF is enabled when adsp phandle is assigned to "mediatek,adsp". The required callback will be assigned when SOF is enabled.

Additionally, "mediatek,dai-link" is introduced to decide the supported dai links for a project, so user can reuse the machine driver regardless of dai link combination.

Change-Id: Ie841d7e046ba3d6974966104ddce40bcaf925c90 Signed-off-by: Aary Patil aary.patil@mediatek.com

--

Commit: https://git.seco.com/clea-os/bsp/mediatek/linux-seco-mtk/-/commit/7c448f47a2cc6a952f1bc8a16c83a6214322630a

GENIO: arm64: dts: mediatek: genio-700-evk: add reserved memory for adsp

Add reserved memory for ADSP use.

Change-Id: I64a55067d10c7ae0eefaff62f1376a3914724905 Signed-off-by: Aary Patil aary.patil@mediatek.com

--

Commit: https://git.seco.com/clea-os/bsp/mediatek/linux-seco-mtk/-/commit/d4188b66469d1a23e2df041ffec8fbb3a795a771

BACKPORT: CHROMIUM: arm64: dts: mediatek: mt8188-geralt: add adsp node

BUG=b:311139883 TEST=Boot Geralt UPSTREAM-TASK=b:244281402

Change-Id: Ia8f5a73790f1dd7298c5336628b41a3dcfb08b49 Signed-off-by: Trevor Wu trevor.wu@mediatek.com Reviewed-on: https://chromium-review.googlesource.com/c/chromiumos/third_party/kernel/+/4472696 Reviewed-by: Fei Shao fshao@chromium.org Tested-by: Fei Shao fshao@chromium.org Commit-Queue: Yu-Che Cheng giver@chromium.org

(am from https://chromium-review.googlesource.com/c/chromiumos/third_party/kernel/+/4472696)

Remove mt8188-geralt.dtsi and remove clock remove clock related changes.

Change-Id: Ic9671c181cd40fa8e818629367eccb1f65b6501d Signed-off-by: Aary Patil aary.patil@mediatek.com

--

Commit: https://git.seco.com/clea-os/bsp/mediatek/linux-seco-mtk/-/commit/ad490bd853fe417739d7b804f4c54e234d0c3627

GENIO: ASoC: mediatek: mt8195: add sof support on mt8395-evk

In the patch, widgets, routes and dai-link required by SOF are included, and late_probe is introduced for SOF route connection.

Only when adsp phandle could be retrieved from DTS, the SOF related part of machine driver is executed.

Additionally, supported dai-links could be specified from DTS, so that we can disable AP side hardware controls when DSP SOF controls the same audio FE.

Change-Id: If3ffd955baffb9d69e9cafec1683a43f19d9a97f Signed-off-by: Aary Patil aary.patil@mediatek.com (Refer to commit 3d00d2c07f04f47aa4228700b440ac47abf13853)

--

Commit: https://git.seco.com/clea-os/bsp/mediatek/linux-seco-mtk/-/commit/b0deb931024d4f428b1dd01adb54e08d3e09ebe4

GENIO: arm64: dts: mediatek: genio-1200-evk: add reserved memory for adsp

Add reserved memory for ADSP use. Update reserved memory address for snd_dma_mem_reserved to avoid overlap.

Change-Id: I18c0e1ceb96f88a7439c21e34a8ab297f8d9c220 Signed-off-by: Aary Patil aary.patil@mediatek.com

--

Commit: https://git.seco.com/clea-os/bsp/mediatek/linux-seco-mtk/-/commit/9548f1a883cdc7aa5e8542c2ccd66a5983017f51

BACKPORT: arm64: dts: mt8195: Add adsp node and adsp mailbox nodes

Add adsp node and adsp mailbox nodes for mt8195.

Change-Id: I803761a2edbdd9722b03e6a83b7df9f328dd621a Signed-off-by: YC Hung yc.hung@mediatek.corp-partner.google.com Signed-off-by: Allen-KH Cheng allen-kh.cheng@mediatek.corp-partner.google.com Signed-off-by: Tinghan Shen tinghan.shen@mediatek.com Reviewed-by: AngeloGioacchino Del Regno angelogioacchino.delregno@collabora.com Link: https://lore.kernel.org/r/20220811025813.21492-17-tinghan.shen@mediatek.com Signed-off-by: Matthias Brugger matthias.bgg@gmail.com

--

Commit: https://git.seco.com/clea-os/bsp/mediatek/linux-seco-mtk/-/commit/19b4c47b9d067a27b1fa5b5f163fe0768da200b7

UPSTREAM: ASoC: mediatek: sof-common: Add NULL check for normal_link string

It's not granted that all entries of struct sof_conn_stream declare a normal_link (a non-SOF, direct link) string, and this is the case for SoCs that support only SOF paths (hence do not support both direct and SOF usecases).

For example, in the case of MT8188 there is no normal_link string in any of the sof_conn_stream entries and there will be more drivers doing that in the future.

To avoid possible NULL pointer KPs, add a NULL check for normal_link.

Fixes: 0caf1120c583 ("ASoC: mediatek: mt8195: extract SOF common code") Change-Id: Icd20f32dab4feaa07fe2e67909e6875e7f490966 Signed-off-by: AngeloGioacchino Del Regno angelogioacchino.delregno@collabora.com Link: https://msgid.link/r/20240111105226.117603-1-angelogioacchino.delregno@collabora.com Signed-off-by: Mark Brown broonie@kernel.org

--

Commit: https://git.seco.com/clea-os/bsp/mediatek/linux-seco-mtk/-/commit/af2ce598e424f938f779eecd40f608111b2cd4b3

UPSTREAM: ASoC: mediatek: common: revise SOF common code

Originally, normal dai link fixup callback is overwritten by sof fixup callback on mtk_sof_card_late_probe and it relies on the mapping defined on struct sof_conn_stream.

It's not flexible. When a new hardware connection is adopted, user needs to update struct sof_conn_stream defined in machine driver which is used to specify the mapping relationship of normal BE and SOF BE.

In the patch, mtk_sof_check_tplg_be_dai_link_fixup() is introduced for all normal BEs. In mtk_sof_late_probe, back up normal BE fixup if it exists and then overwrite be_hw_params_fixup by the new callback.

There are two cases for FE and BE connection.

case 1: SOF FE -> normal BE -> SOF_BE

case 2: normal FE -> normal BE

In the new fixup callback, it tries to find SOF_BE which connects to the same FE, and then reuses the fixup of SOF_BE. If no SOF_BE exists, it must be case 2, so rollback to the original fixup if it exists.

As a result, the predefined relation is not needed anymore. Hardware connection can be controlled by the mixer control for AFE interconn. Then, DPCM finds the BE mapping at runtime.

Change-Id: I03b58285523ffb0424f80fa5cfb16c62533a0a19 Signed-off-by: Trevor Wu trevor.wu@mediatek.com Reviewed-by: AngeloGioacchino Del Regno angelogioacchino.delregno@collabora.com Link: https://lore.kernel.org/r/20230825024935.10878-3-trevor.wu@mediatek.com Signed-off-by: Mark Brown broonie@kernel.org

--

Commit: https://git.seco.com/clea-os/bsp/mediatek/linux-seco-mtk/-/commit/1e665626bd9bec140e66d0718a358241c22ee877

UPSTREAM: ASoC: SOF: core: Only call sof_ops_free() on remove if the probe was successful

All the fail paths during probe will free up the ops, on remove we should only free it if the probe was successful.

Fixes: bc433fd76fae ("ASoC: SOF: Add ops_free") Change-Id: I17d140c638146d8cff0ddf00e4a3615c5525dd06 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 Reviewed-by: Ranjani Sridharan ranjani.sridharan@linux.intel.com Reviewed-by: Rander Wang rander.wang@intel.com Link: https://lore.kernel.org/r/20230915124015.19637-1-peter.ujfalusi@linux.intel.com Signed-off-by: Mark Brown broonie@kernel.org

--

Commit: https://git.seco.com/clea-os/bsp/mediatek/linux-seco-mtk/-/commit/db9884ddd8d5a6166839d4cea06ead8f74405e85

UPSTREAM: ASoC: SOF: sof-audio: Fix DSP core put imbalance on widget setup failure

In case the widget setup fails we should only decrement the core usage count if the sof_widget_free_unlocked() has not been called as part of the error handling. sof_widget_free_unlocked() calls snd_sof_dsp_core_put() and the additional core_put will cause imbalance in core usage count. Use the existing use_count_decremented to handle this issue.

Change-Id: Ic83948a71af4f444985cecdd7f55ba6dc45eb60f Signed-off-by: Peter Ujfalusi peter.ujfalusi@linux.intel.com Reviewed-by: Ranjani Sridharan ranjani.sridharan@linux.intel.com Reviewed-by: Bard Liao yung-chuan.liao@linux.intel.com Reviewed-by: Pierre-Louis Bossart pierre-louis.bossart@linux.intel.com Link: https://lore.kernel.org/r/20230914124725.17397-1-peter.ujfalusi@linux.intel.com Signed-off-by: Mark Brown broonie@kernel.org

--

Commit: https://git.seco.com/clea-os/bsp/mediatek/linux-seco-mtk/-/commit/6efa0d652166968e80a27401f55c826f508c6400

UPSTREAM: ASoC: SOF: ipc3: Use devm_kmemdup to replace devm_kmalloc + memcpy

Use the helper function devm_kmemdup() rather than duplicating its implementation, which helps to enhance code readability.

Change-Id: I2f98fd0693b1a134f1a24abad818e06906c26f9c Signed-off-by: Li Zetao lizetao1@huawei.com Reviewed-by: Luca Ceresoli luca.ceresoli@bootlin.com Link: https://lore.kernel.org/r/20230810114738.2103792-3-lizetao1@huawei.com Signed-off-by: Mark Brown broonie@kernel.org

--

Commit: https://git.seco.com/clea-os/bsp/mediatek/linux-seco-mtk/-/commit/fc032b4cca372e780057aa2c07daf9ff2f31a85a

UPSTREAM: ASoC: sof: merge DAI call back functions into ops

ALSA SoC merges DAI call backs into .ops. This patch merge these into one.

Change-Id: I8856c3aab09a6bc5b331b99e4fb7c514a64e7ae9 Signed-off-by: Kuninori Morimoto kuninori.morimoto.gx@renesas.com Link: https://lore.kernel.org/r/87h6p9b0u2.wl-kuninori.morimoto.gx@renesas.com Signed-off-by: Mark Brown broonie@kernel.org

--

Commit: https://git.seco.com/clea-os/bsp/mediatek/linux-seco-mtk/-/commit/c7b74fd23a4d8a82d8d8baac40d8db5b867d85a8

UPSTREAM: ASoC: SOF: ipc3-dtrace: Switch to memdup_user_nul() helper

Use memdup_user_nul() helper instead of open-coding to simplify the code.

Change-Id: Ie5721a4513b9fe399cbe943d50a68e073eb2846c Signed-off-by: Yang Yingliang yangyingliang@huawei.com Link: https://lore.kernel.org/r/20230725120247.509422-1-yangyingliang@huawei.com Signed-off-by: Mark Brown broonie@kernel.org

--

Commit: https://git.seco.com/clea-os/bsp/mediatek/linux-seco-mtk/-/commit/5a4e5215eec1da205d205395f46fa42ffb2f8a0a

UPSTREAM: ASoC: SOF: Fix incorrect use of sizeof in sof_ipc3_do_rx_work()

Here hdr is a pointer, and we should measure the size of struct sof_ipc_cmd_hdr.

Fixes: 12c41c779fad ("ASoC: SOF: Refactor rx function for fuzzing") Change-Id: I2f59796908100e9f1b0e4e0680cbbb5fb61d101c Signed-off-by: Xia Fukun xiafukun@huawei.com Reviewed-by: Curtis Malainey cujomalainey@chromium.org Link: https://lore.kernel.org/r/20230807075118.128122-1-xiafukun@huawei.com Signed-off-by: Mark Brown broonie@kernel.org

--

Commit: https://git.seco.com/clea-os/bsp/mediatek/linux-seco-mtk/-/commit/0cd56da2ca7a05a9c2c3587378271a991d4a83bf

UPSTREAM: ASoC: SOF: mediatek: mt8186 modify dram type as non-cache

To prevent incorrect access between the host and DSP sides, we need to modify DRAM as a non-cache memory type. Additionally, we can retrieve the size of shared DMA from the device tree.

Change-Id: I719a887d8335db1f5e3b3f26bc60a7b602da5847 Signed-off-by: Trevor Wu trevor.wu@mediatek.com Reviewed-by: Yaochun Hung yc.hung@mediatek.com Reviewed-by: Kuan-Hsun Cheng Allen-KH.Cheng@mediatek.com Link: https://lore.kernel.org/r/20230803075028.32170-1-trevor.wu@mediatek.com Signed-off-by: Mark Brown broonie@kernel.org

--

Commit: https://git.seco.com/clea-os/bsp/mediatek/linux-seco-mtk/-/commit/64020de0a4bf0886474996f79e7722ece5d44048

UPSTREAM: ASoC: SOF: Deprecate invalid enums in IPC3

The switch component was never completed and sat half empty for over 3 years. It was recently deleted. For modern components this would require not change in the kernel but since this was a legacy allocation from the enum days of IPC3 we should mark the respective enum as deprecated.

The splitter component was never even got a source file in the firmware. Therefore also delete it since this is not needed.

Reviewed-by: Bard Liao yung-chuan.liao@linux.intel.com Change-Id: I275fb348183d543d4dd8b45d60e3b2e16fb2ce57 Signed-off-by: Curtis Malainey cujomalainey@chromium.org Signed-off-by: Pierre-Louis Bossart pierre-louis.bossart@linux.intel.com Link: https://lore.kernel.org/r/20230731213242.434594-6-pierre-louis.bossart@linux.intel.com Signed-off-by: Mark Brown broonie@kernel.org

--

Commit: https://git.seco.com/clea-os/bsp/mediatek/linux-seco-mtk/-/commit/1ed60427d148a35ac11b5ee4d1107143fb65bae4

UPSTREAM: ASoC: SOF: ipc3: update dai_link_fixup for SOF_DAI_MEDIATEK_AFE

For MediaTek AFE, DAI DMA can support different bitwidths compared to the BE DAI. Therefore, it is preferable to obtain the BE frame format from the DAI_CONFIG.

Reviewed-by: Yaochun Hung yc.hung@mediatek.com Reviewed-by: Daniel Baluta daniel.baluta@nxp.com Change-Id: Iaddd1210da1e131c794dfbaecf211164c0d317c1 Signed-off-by: Trevor Wu trevor.wu@mediatek.com Signed-off-by: Pierre-Louis Bossart pierre-louis.bossart@linux.intel.com Link: https://lore.kernel.org/r/20230731213242.434594-5-pierre-louis.bossart@linux.intel.com Signed-off-by: Mark Brown broonie@kernel.org

--

Commit: https://git.seco.com/clea-os/bsp/mediatek/linux-seco-mtk/-/commit/0440bb038bcae06b261bc151c977a60618221064

UPSTREAM: ASoC: SOF: topology: simplify code to prevent static analysis warnings

make KCFLAGS='-fanalyzer' sound/soc/sof/intel/ reports a possible NULL pointer dereference.

sound/soc/sof/topology.c:1136:21: error: dereference of NULL ‘w’ [CWE-476] [-Werror=analyzer-null-dereference]

1136 | strcmp(w->sname, rtd->dai_link->stream_name))

The code is rather confusing and can be simplified to make static analysis happy. No functionality change.

Change-Id: I98832f0b108a7424bfdc11ad564f99349fae1e6f Signed-off-by: Pierre-Louis Bossart pierre-louis.bossart@linux.intel.com Reviewed-by: Rander Wang rander.wang@intel.com Reviewed-by: Daniel Baluta daniel.baluta@nxp.com Reviewed-by: Yaochun Hung yc.hung@mediatek.com Link: https://lore.kernel.org/r/20230731213748.440285-4-pierre-louis.bossart@linux.intel.com Signed-off-by: Mark Brown broonie@kernel.org

--

Commit: https://git.seco.com/clea-os/bsp/mediatek/linux-seco-mtk/-/commit/a37e9368390719b96e9d05701bf42adaddf1222e

UPSTREAM: ASoC: SOF: ipc3: add checks to prevent static analysis warnings

make KCFLAGS='-fanalyzer' sound/soc/sof/ reports an issue with memcpy:

sound/soc/sof/ipc3.c: In function ‘ipc3_wait_tx_done’: sound/soc/sof/ipc3.c:309:33: error: use of NULL ‘reply_data’ where non-null expected [CWE-476] [-Werror=analyzer-null-argument]

309 | memcpy(reply_data, msg->reply_data, | ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ 310 | msg->reply_size);

The finding is legit with this call: return sof_ipc3_tx_msg(sdev, &pm_ctx, sizeof(pm_ctx), NULL, 0, false);

Static analysis has no way of knowing that the reply will be zero-sized.

Add a check to only do the memcpy if the reply size is not zero and the destination pointer is not NULL.

Change-Id: I59df04cf8c958e6c353d9de3b0c94aabf9f73a84 Signed-off-by: Pierre-Louis Bossart pierre-louis.bossart@linux.intel.com Reviewed-by: Rander Wang rander.wang@intel.com Reviewed-by: Daniel Baluta daniel.baluta@nxp.com Reviewed-by: Yaochun Hung yc.hung@mediatek.com Link: https://lore.kernel.org/r/20230731213748.440285-3-pierre-louis.bossart@linux.intel.com Signed-off-by: Mark Brown broonie@kernel.org

--

Commit: https://git.seco.com/clea-os/bsp/mediatek/linux-seco-mtk/-/commit/44232882b9962a15ec51541c58c0a31567283fba

UPSTREAM: ASoC: SOF: Add acp-probe id to sof probe client driver for registration.

This patch adds acp-probe id as a match id to support probe functionality for amd platforms.

Change-Id: Ie18e88b8dc5553342181691d724a9bea7d441469 Signed-off-by: V sujith kumar Reddy Vsujithkumar.Reddy@amd.com Link: https://lore.kernel.org/r/20230713125709.418851-3-vsujithkumar.reddy@amd.corp-partner.google.com Signed-off-by: Mark Brown broonie@kernel.org

--

Commit: https://git.seco.com/clea-os/bsp/mediatek/linux-seco-mtk/-/commit/8131f74b9ed735477f024ec99130135cc2da6791

UPSTREAM: ASoC: SOF: ipc3-dtrace: uninitialized data in dfsentry_trace_filter_write()

This doesn't check how many bytes the simple_write_to_buffer() writes to the buffer. The only thing that we know is that the first byte is initialized and the last byte of the buffer is set to NUL. However the middle bytes could be uninitialized.

There is no need to use simple_write_to_buffer(). This code does not support partial writes but instead passes "pos = 0" as the starting offset regardless of what the user passed as "*ppos". Just use the copy_from_user() function and initialize the whole buffer.

Fixes: 671e0b90051e ("ASoC: SOF: Clone the trace code to ipc3-dtrace as fw_tracing implementation") Change-Id: Icc9d69a477505f15a193b7a9bed61b987de490e1 Signed-off-by: Dan Carpenter dan.carpenter@linaro.org Link: https://lore.kernel.org/r/74148292-ce4d-4e01-a1a7-921e6767da14@moroto.mountain Signed-off-by: Mark Brown broonie@kernel.org

--

Commit: https://git.seco.com/clea-os/bsp/mediatek/linux-seco-mtk/-/commit/f33d93dbb28a12b2c8c055b0feb5ef4e6dc7916b

UPSTREAM: ASoC: SOF: pm: Remove duplicated code in sof_suspend

Over time the function has changed and now there is no need to have the duplicated sof_fw_trace_suspend() and sof_suspend_clients() in the if (target_state == SOF_DSP_PM_D0) branch.

Remove it and add a simple check with a single goto statement.

Reviewed-by: Daniel Baluta daniel.baluta@nxp.com Reviewed-by: Paul Olaru olarupaulstelian97@gmail.com Reviewed-by: Ranjani Sridharan ranjani.sridharan@linux.intel.com Change-Id: If6ade3230fe211ed3ec95772d92dd8a4c3052a9e Signed-off-by: Peter Ujfalusi peter.ujfalusi@linux.intel.com Signed-off-by: Pierre-Louis Bossart pierre-louis.bossart@linux.intel.com Link: https://lore.kernel.org/r/20230616100039.378150-8-pierre-louis.bossart@linux.intel.com Signed-off-by: Mark Brown broonie@kernel.org

--

Commit: https://git.seco.com/clea-os/bsp/mediatek/linux-seco-mtk/-/commit/dd5f77260125ef02f6be59fe6d9d75288ce50e95

UPSTREAM: ASoC: SOF: ipc3: Dump IPC message payload

Dump the IPC message payload if BIT(11) of sof_debug is set and the message contains more data than just a header.

The header size differs between TX and RX and in case of set_get_data, the header is always the reply header for the message regardless if it is TX or RX.

The use of printk(KERN_DEBUG "..."); is on purpose to keep the dmesg output tidy.

Reviewed-by: Bard Liao yung-chuan.liao@linux.intel.com Change-Id: Id82815349ec2b0ab03bf48c24adb445014976941 Signed-off-by: Peter Ujfalusi peter.ujfalusi@linux.intel.com Signed-off-by: Pierre-Louis Bossart pierre-louis.bossart@linux.intel.com Link: https://lore.kernel.org/r/20230616100039.378150-6-pierre-louis.bossart@linux.intel.com Signed-off-by: Mark Brown broonie@kernel.org

--

Commit: https://git.seco.com/clea-os/bsp/mediatek/linux-seco-mtk/-/commit/c57d5a8f8f42dab43826e9db5d9c02e50f61370a

UPSTREAM: ASoC: SOF: Add new sof_debug flag to request message payload dump

We only print out the header information of an IPC message in debug level, either in verbose or non verbose way (Kconfig option).

On top of the header information the message itself can help reproducing and identifying issues.

BIT(11) can be used to request a message payload dump if it is supported by the IPC implementation.

Since IPC message payload printing is only implemented for IPC4, the flag will not have any effect to IPC3 for now.

Reviewed-by: Kai Vehmanen kai.vehmanen@linux.intel.com Reviewed-by: Ranjani Sridharan ranjani.sridharan@linux.intel.com Reviewed-by: Bard Liao yung-chuan.liao@linux.intel.com Change-Id: I6dec15cc4f4bd43cda41095f1a1d7c6b849409a8 Signed-off-by: Peter Ujfalusi peter.ujfalusi@linux.intel.com Signed-off-by: Pierre-Louis Bossart pierre-louis.bossart@linux.intel.com Link: https://lore.kernel.org/r/20230616100039.378150-5-pierre-louis.bossart@linux.intel.com Signed-off-by: Mark Brown broonie@kernel.org

--

Commit: https://git.seco.com/clea-os/bsp/mediatek/linux-seco-mtk/-/commit/64061e71075f241bdb0ab008d89701f165d0a94f

UPSTREAM: ASoC: SOF: core: Free the firmware trace before calling snd_sof_shutdown()

The shutdown is called on reboot/shutdown of the machine. At this point the firmware tracing cannot be used anymore but in case of IPC3 it is using and keeping a DMA channel active (dtrace).

For Tiger Lake platforms we have a quirk in place to fix rare reboot issues when a DMA was active before rebooting the system. If the tracing is enabled this quirk will be always used and a print appears on the kernel log which might be misleading or not even correct.

Release the fw tracing before executing the shutdown to make sure that this known DMA user is cleared away.

Reviewed-by: Kai Vehmanen kai.vehmanen@linux.intel.com Reviewed-by: Daniel Baluta daniel.baluta@nxp.com Reviewed-by: Ranjani Sridharan ranjani.sridharan@linux.intel.com Reviewed-by: Rander Wang rander.wang@intel.com Reviewed-by: Bard Liao yung-chuan.liao@linux.intel.com Change-Id: I54fc7c94c3f85c54dee0eb686ffe20f4a750af6d Signed-off-by: Peter Ujfalusi peter.ujfalusi@linux.intel.com Signed-off-by: Pierre-Louis Bossart pierre-louis.bossart@linux.intel.com Link: https://lore.kernel.org/r/20230616100039.378150-4-pierre-louis.bossart@linux.intel.com Signed-off-by: Mark Brown broonie@kernel.org

--

Commit: https://git.seco.com/clea-os/bsp/mediatek/linux-seco-mtk/-/commit/b83af37da94564041dc4e3455ec6f3fc538a50f5

UPSTREAM: ASoC: SOF: sof-audio: test virtual widget in sof_walk_widgets_in_order

Virtual widgets are added for the purpose of showing connections between aggregated DAIs in SDW topologies. However, we shouldn't touch them in SOF.

Reviewed-by: Ranjani Sridharan ranjani.sridharan@linux.intel.com Change-Id: If520574cc22f162e24bdda57518d01ca212b08bf Signed-off-by: Bard Liao yung-chuan.liao@linux.intel.com Signed-off-by: Pierre-Louis Bossart pierre-louis.bossart@linux.intel.com Link: https://lore.kernel.org/r/20230616100039.378150-3-pierre-louis.bossart@linux.intel.com Signed-off-by: Mark Brown broonie@kernel.org

--

Commit: https://git.seco.com/clea-os/bsp/mediatek/linux-seco-mtk/-/commit/be44eb63fa58215d9540337d88480086af6e7005

UPSTREAM: ASoC: SOF: sof-audio: add is_virtual_widget helper

Testing virtual widget is required in many functions. No function changed in this commit.

Reviewed-by: Ranjani Sridharan ranjani.sridharan@linux.intel.com Change-Id: Icb22935cc3e53ef90c15f4495fcaecc3fd9340ff Signed-off-by: Bard Liao yung-chuan.liao@linux.intel.com Signed-off-by: Pierre-Louis Bossart pierre-louis.bossart@linux.intel.com Link: https://lore.kernel.org/r/20230616100039.378150-2-pierre-louis.bossart@linux.intel.com Signed-off-by: Mark Brown broonie@kernel.org

--

Commit: https://git.seco.com/clea-os/bsp/mediatek/linux-seco-mtk/-/commit/7c62e5de1fe54cd0351053410f9ff89579259e8d

BACKPORT: ASoC: SOF: Add IPC3 Kernel Injector

Add debugfs path to fake a malicious firmware message for fuzzing purposes.

Skip IPC4 for initial integration

Change-Id: I7074b4e70d426405f4686dba4529f9c2c2a27b39 Signed-off-by: Curtis Malainey cujomalainey@chromium.org Reviewed-by: Ranjani Sridharan ranjani.sridharan@linux.intel.com Reviewed-by: Pierre-Louis Bossart pierre-louis.bossart@linux.intel.com Reviewed-by: Péter Ujfalusi peter.ujfalusi@linux.intel.com Link: https://lore.kernel.org/r/20230608221822.2825786-2-cujomalainey@chromium.org Signed-off-by: Mark Brown broonie@kernel.org

--

Commit: https://git.seco.com/clea-os/bsp/mediatek/linux-seco-mtk/-/commit/bba3d2385c81208d2c1c0af4dcd86218eea8055c

UPSTREAM: ASoC: SOF: Refactor rx function for fuzzing

Refactor the function so reading the data is done outside the work function so fuzzing can pass data directly into the work callbacks.

Also expose the inner function outside the module so we can call it from the injector.

Change-Id: Ie15666b76f976e29d7a8047770c2269c72ef1cbd Signed-off-by: Curtis Malainey cujomalainey@chromium.org Reviewed-by: Ranjani Sridharan ranjani.sridharan@linux.intel.com Reviewed-by: Pierre-Louis Bossart pierre-louis.bossart@linux.intel.com Reviewed-by: Péter Ujfalusi peter.ujfalusi@linux.intel.com Link: https://lore.kernel.org/r/20230608221822.2825786-1-cujomalainey@chromium.org Signed-off-by: Mark Brown broonie@kernel.org

--

Commit: https://git.seco.com/clea-os/bsp/mediatek/linux-seco-mtk/-/commit/dd2e0050359074a0884318cf68482522d8b3484e

UPSTREAM: ASoC: SOF: mediatek: add adsp debug dump

Add mt8188 and mt8186 .dbg_dump callback to print some information when DSP panic occurs.

Change-Id: I72453c1f557afc9de42c51de8ccc0673aba29fa2 Signed-off-by: Trevor Wu trevor.wu@mediatek.com Reviewed-by: Pierre-Louis Bossart pierre-louis.bossart@linux.intel.com Reviewed-by: Yaochun Hung yc.hung@mediatek.com Reviewed-by: Péter Ujfalusi peter.ujfalusi@linux.intel.com Reviewed-by: AngeloGioacchino Del Regno angelogioacchino.delregno@collabora.com Link: https://lore.kernel.org/r/20230601034939.15802-2-trevor.wu@mediatek.com Signed-off-by: Mark Brown broonie@kernel.org

--

Commit: https://git.seco.com/clea-os/bsp/mediatek/linux-seco-mtk/-/commit/cbf08a83faac886f462afd0fd73af607fd622a9f

UPSTREAM: ASoC: SOF: topology: Use partial match for connecting DAI link and DAI widget

This allows setting shorter names for the widget stream names in topology. For example, in the case of HDA Analog DAI link, the stream name is "Analog Playback and Capture". But it is enough to match "Analog" in the DAI link stream name with a widget's stream name. This is needed to set more meaningful names for the DAI widgets using the stream name in topology.

Change-Id: Idbacf66520743e511283483cc830e08c76002eea Signed-off-by: Ranjani Sridharan ranjani.sridharan@linux.intel.com Signed-off-by: Pierre-Louis Bossart pierre-louis.bossart@linux.intel.com Reviewed-by: Bard Liao yung-chuan.liao@linux.intel.com Link: https://lore.kernel.org/r/20230526204149.456068-3-pierre-louis.bossart@linux.intel.com Signed-off-by: Mark Brown broonie@kernel.org

--

Commit: https://git.seco.com/clea-os/bsp/mediatek/linux-seco-mtk/-/commit/73c1d9ddc826dd699285b0a6f6a50bfcb85930e9

UPSTREAM: ASoC: SOF: mediatek: add mt8188 audio support

Add mt8188 dai driver and specify of_machine to support mt8188 audio.

Change-Id: I5d0823ff5265b095be1dd2b51e96be434f94d2f6 Signed-off-by: Trevor Wu trevor.wu@mediatek.com Reviewed-by: Pierre-Louis Bossart pierre-louis.bossart@linux.intel.com Reviewed-by: Yaochun Hung yc.hung@mediatek.com Reviewed-by: Péter Ujfalusi peter.ujfalusi@linux.intel.com Link: https://lore.kernel.org/r/20230523025933.30494-2-trevor.wu@mediatek.com Signed-off-by: Mark Brown broonie@kernel.org

--

Commit: https://git.seco.com/clea-os/bsp/mediatek/linux-seco-mtk/-/commit/97ee9ab39bed03c476060e120a346eb51a7d32f6

UPSTREAM: ASoC: sof: Improve sof_ipc3_bytes_ext_put function

The function is improved in the way that if the firmware returns a validation error on the newly sent bytes, then the kernel will automatically restore to the old bytes value for a given kcontrol.

This way, if the firmware rejects a data blob then the kernel will also reject it, instead of saving it for the next suspend/resume cycle. The old behaviour is that the kernel would save it anyway and on next firmware boot it would apply the previously-rejected configuration, leading to errors during playback.

Additionally, the function also saves previously validated configurations, so that if the firmware does end up rejecting a new bytes value the kernel can send an old, previously-valid configuration.

Reviewed-by: Daniel Baluta daniel.baluta@nxp.com Reviewed-by: Péter Ujfalusi peter.ujfalusi@linux.intel.com Change-Id: I46f192570b8532dad10c8cf5b647abfee45ea51a Signed-off-by: Paul Olaru paul.olaru@nxp.com Signed-off-by: Daniel Baluta daniel.baluta@nxp.com Link: https://lore.kernel.org/r/20230503081049.73847-2-daniel.baluta@oss.nxp.com Signed-off-by: Mark Brown broonie@kernel.org

--

Commit: https://git.seco.com/clea-os/bsp/mediatek/linux-seco-mtk/-/commit/07739dbfce170958f95739e31b9cc65e8cb3556d

UPSTREAM: ASoC: SOF: Simplify the calculation of variables

./sound/soc/sof/pcm.c:372:27-29: WARNING !A || A && B is equivalent to !A || B.

Reported-by: Abaci Robot <abaci@linux.alibaba.com Link: https://bugzilla.openanolis.cn/show_bug.cgi?id=4938 Change-Id: I2a2238149bed1f51766f0add6edc0d318ccb840e Signed-off-by: Jiapeng Chong <jiapeng.chong@linux.alibaba.com Reviewed-by: Peter Ujfalusi <peter.ujfalusi@linux.intel.com Link: https://lore.kernel.org/r/20230512064225.75358-1-jiapeng.chong@linux.alibaba.com Signed-off-by: Mark Brown <broonie@kernel.org

--

Commit: https://git.seco.com/clea-os/bsp/mediatek/linux-seco-mtk/-/commit/98aa2a9500efa31bc97a02d2eaf7c01dc2c7e85b

UPSTREAM: ASoC: SOF: topology: Fix logic for copying tuples

Topology could have more instances of the tokens being searched for than the number of sets that need to be copied. Stop copying token after the limit of number of token instances has been reached. This worked before only by chance as we had allocated more size for the tuples array than the number of actual tokens being parsed.

Fixes: 7006d20e5e9d ("ASoC: SOF: Introduce IPC3 ops") Change-Id: I2f111797c50cdd805b101f5e4a7e14cdf425fa90 Signed-off-by: Ranjani Sridharan <ranjani.sridharan@linux.intel.com Reviewed-by: Péter 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 Signed-off-by: Peter Ujfalusi <peter.ujfalusi@linux.intel.com Link: https://lore.kernel.org/r/20230512114630.24439-1-peter.ujfalusi@linux.intel.com Signed-off-by: Mark Brown <broonie@kernel.org

--

Commit: https://git.seco.com/clea-os/bsp/mediatek/linux-seco-mtk/-/commit/dc73635d79f6afe0085ebf81611da5ff3498fcfe

UPSTREAM: ASoC: SOF: pm: save io region state in case of errors in resume

If there are failures in DSP runtime resume, the device state will not reach active and this makes it impossible e.g. to retrieve a possible DSP panic dump via "exception" debugfs node. If CONFIG_SND_SOC_SOF_DEBUG_ENABLE_DEBUGFS_CACHE=y is set, the data in cache is stale. If debugfs cache is not used, the region simply cannot be read.

To allow debugging these scenarios, update the debugfs cache contents in resume error handler. User-space can then later retrieve DSP panic and other state via debugfs (requires SOF debugfs cache to be enabled in build).

Reported-by: Curtis Malainey <cujomalainey@chromium.org Link: https://github.com/thesofproject/linux/issues/4274 Change-Id: Ib4a2f900642766f25c95642c62a926145390ca1b Signed-off-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 Reviewed-by: Curtis Malainey <cujomalainey@chromium.org Reviewed-by: Péter Ujfalusi <peter.ujfalusi@linux.intel.com Signed-off-by: Peter Ujfalusi <peter.ujfalusi@linux.intel.com Link: https://lore.kernel.org/r/20230512104638.21376-1-peter.ujfalusi@linux.intel.com Signed-off-by: Mark Brown <broonie@kernel.org

--

Commit: https://git.seco.com/clea-os/bsp/mediatek/linux-seco-mtk/-/commit/d6203e01f89b04b9d5080fc79c5dd500f70d10c2

UPSTREAM: ASoC: SOF: ipc3-topology: Make sure that only one cmd is sent in dai_config

The commands in sof_ipc_dai_config.flags are encoded as bits: 1 (bit0) - hw_params 2 (bit1) - hw_free 4 (bit2) - pause

These are commands, they cannot be combined as one would assume, for example 3 (bit0 | bit1) is invalid.

This can happen right at the second start of a stream as at the end of the first stream we set the hw_free command (bit1) and on the second start we would OR on top of it the hw_params (bit0).

Fixes: b66bfc3a9810 ("ASoC: SOF: sof-audio: Fix broken early bclk feature for SSP") Change-Id: Ie8c71419f4d0a9e77ff968aae29106886edcbf69 Signed-off-by: Peter Ujfalusi <peter.ujfalusi@linux.intel.com Reviewed-by: Daniel Baluta <daniel.baluta@nxp.com Reviewed-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 Link: https://lore.kernel.org/r/20230512110317.5180-1-peter.ujfalusi@linux.intel.com Signed-off-by: Mark Brown <broonie@kernel.org

--

Commit: https://git.seco.com/clea-os/bsp/mediatek/linux-seco-mtk/-/commit/668d6fc080decdb7e4948767c3303c3f27e7bb8e

UPSTREAM: ASoC: SOF: sof-client-probes: fix pm_runtime imbalance in error handling

When an error occurs, we need to make sure the device can pm_runtime suspend instead of keeping it active.

Change-Id: Ifb74a0c27fe08cc4407e33d8de14806b80054c55 Signed-off-by: Pierre-Louis Bossart <pierre-louis.bossart@linux.intel.com Reviewed-by: Daniel Baluta <daniel.baluta@nxp.com Reviewed-by: Ranjani Sridharan <ranjani.sridharan@linux.intel.com Signed-off-by: Peter Ujfalusi <peter.ujfalusi@linux.intel.com Link: https://lore.kernel.org/r/20230512103315.8921-4-peter.ujfalusi@linux.intel.com Signed-off-by: Mark Brown <broonie@kernel.org

--

Commit: https://git.seco.com/clea-os/bsp/mediatek/linux-seco-mtk/-/commit/8c42945aa70324db1b621d3ac40e34f6f5e68428

UPSTREAM: ASoC: SOF: pcm: fix pm_runtime imbalance in error handling

When an error occurs, we need to make sure the device can pm_runtime suspend instead of keeping it active.

Change-Id: Iad36e7e4fb7c8df0488e4f74881d6b211d1e9769 Signed-off-by: Pierre-Louis Bossart <pierre-louis.bossart@linux.intel.com Reviewed-by: Daniel Baluta <daniel.baluta@nxp.com Reviewed-by: Ranjani Sridharan <ranjani.sridharan@linux.intel.com Signed-off-by: Peter Ujfalusi <peter.ujfalusi@linux.intel.com Link: https://lore.kernel.org/r/20230512103315.8921-3-peter.ujfalusi@linux.intel.com Signed-off-by: Mark Brown <broonie@kernel.org

--

Commit: https://git.seco.com/clea-os/bsp/mediatek/linux-seco-mtk/-/commit/04ffc2a48ce155a6721425ef41ec41d0a4c9177a

UPSTREAM: ASoC: SOF: debug: conditionally bump runtime_pm counter on exceptions

When a firmware IPC error happens during a pm_runtime suspend, we ignore the error and suspend anyways. However, the code unconditionally increases the runtime_pm counter. This results in a confusing configuration where the code will suspend, resume but never suspend again due to the use of pm_runtime_get_noresume().

The intent of the counter increase was to prevent entry in D3, but if that transition to D3 is already started it cannot be stopped. In addition, there's no point in that case in trying to prevent anything, the firmware error is handled and the next resume will re-initialize the firmware completely.

This patch changes the logic to prevent suspend when the device is pm_runtime active and has a use_count > 0.

Change-Id: Id084ce818dcade344a15dfeaeaac399f1eed22d2 Signed-off-by: Pierre-Louis Bossart <pierre-louis.bossart@linux.intel.com Reviewed-by: Daniel Baluta <daniel.baluta@nxp.com Reviewed-by: Ranjani Sridharan <ranjani.sridharan@linux.intel.com Signed-off-by: Peter Ujfalusi <peter.ujfalusi@linux.intel.com Link: https://lore.kernel.org/r/20230512103315.8921-2-peter.ujfalusi@linux.intel.com Signed-off-by: Mark Brown <broonie@kernel.org

--

Commit: https://git.seco.com/clea-os/bsp/mediatek/linux-seco-mtk/-/commit/cddf48a6b3cb253e0b7b2bfbd2ee6b6f3a279fa4

UPSTREAM: ASoC: SOF: mediatek: mt8186: Use snd_sof_ipc_process_reply() helper

Function mt8186_get_reply() performs practically the same operation as the common snd_sof_ipc_get_reply() helper: removing the custom function allows us to simply perform a call to the sof-priv helper snd_sof_ipc_process_reply(), simplifying and shortening this driver and getting all the benefits of using a common API.

Change-Id: I9f500bc482f3903cede147fbb54f156a63843e73 Signed-off-by: AngeloGioacchino Del Regno <angelogioacchino.delregno@collabora.com Link: https://lore.kernel.org/r/20230503113413.149235-3-angelogioacchino.delregno@collabora.com Signed-off-by: Mark Brown <broonie@kernel.org

--

Commit: https://git.seco.com/clea-os/bsp/mediatek/linux-seco-mtk/-/commit/e3ca2f1c9a9d3a01b849a5d078a3e4785637b8e3

UPSTREAM: ASoC: SOF: mediatek: mt8195: Use snd_sof_ipc_process_reply() helper

Function mt8195_get_reply() performs practically the same operation as the common snd_sof_ipc_get_reply() helper: removing the custom function allows us to simply perform a call to the sof-priv helper snd_sof_ipc_process_reply(), simplifying and shortening this driver and getting all the benefits of using a common API.

Change-Id: I1c56dd940a8653bdc097001fe7baab513266efc8 Signed-off-by: AngeloGioacchino Del Regno <angelogioacchino.delregno@collabora.com Link: https://lore.kernel.org/r/20230503113413.149235-2-angelogioacchino.delregno@collabora.com Signed-off-by: Mark Brown <broonie@kernel.org

--

Commit: https://git.seco.com/clea-os/bsp/mediatek/linux-seco-mtk/-/commit/c0af846d3a93144f476e4c72246602cd60be249b

BACKPORT: ASoC: SOF: pcm: Add an option to skip platform trigger during stop

In the case of IPC4, a pipeline is only paused during STOP/PAUSE/SUSPEND triggers and the FW keeps the host DMA running when a pipeline is paused. The start/stop tests iterate through STOP/START triggers without involving a hw_free. This means that the pipeline state will only toggle between PAUSED (during the STOP trigger) and RUNNING (during the START trigger). So this test should be treated in the same way as a PAUSE_PUSH/PAUSE_RELEASE test and the DMA should be kept running when toggling the pipeline states between PAUSED and RUNNING.

Since there is no way to tell if a STOP trigger will be followed by hw_free or not, this patch proposes to always skip DMA stop during the STOP trigger and handle it later during hw_free. Introduce a new flag in struct sof_ipc_pcm_ops, delayed_platform_trigger, that will be used to ensure that the host DMA will not be stopped during the STOP/PAUSE/RELEASE triggers and set it for IPC4. The platform_trigger call to stop the DMA will be invoked during PCM hw_free instead when the pipeline is reset.

Change-Id: I1253ba24c23349449bfd7e88bc32547c7903fc0c Signed-off-by: Ranjani Sridharan ranjani.sridharan@linux.intel.com Reviewed-by: Pierre-Louis Bossart pierre-louis.bossart@linux.intel.com Reviewed-by: Péter Ujfalusi peter.ujfalusi@linux.intel.com Signed-off-by: Peter Ujfalusi peter.ujfalusi@linux.intel.com Link: https://lore.kernel.org/r/20230420114137.27613-3-peter.ujfalusi@linux.intel.com Signed-off-by: Mark Brown broonie@kernel.org

--

Commit: https://git.seco.com/clea-os/bsp/mediatek/linux-seco-mtk/-/commit/430779ed3792c0998c60a259d65a3933c0075dfd

BACKPORT: ASoC: SOF: Use no_reply calls for TX

Convert all existing calls that pass "NULL, 0" for reply data to the new no_reply calls. Also convert any calls that pass in data but don't actually parse the result.

Change-Id: I70063a497797d3abd159cb2e1e967a6b4838840c Signed-off-by: Curtis Malainey cujomalainey@chromium.org Signed-off-by: Pierre-Louis Bossart pierre-louis.bossart@linux.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/20230419194057.42205-3-pierre-louis.bossart@linux.intel.com Signed-off-by: Mark Brown broonie@kernel.org

--

Commit: https://git.seco.com/clea-os/bsp/mediatek/linux-seco-mtk/-/commit/03a04941cbefd1ef6ed89e3fe4350d44d2fda061

UPSTREAM: ASoC: SOF: ipc: Add no reply inline calls

95% of the calls inside SOF to TX an IPC don't care about a reply. Yet the previous commit cleaned up a bunch of replies that were being populated and then thrown away. This adds some functions so users who do not need replies don't feel obligated to provide the space to the API.

Change-Id: I30b88bb03e0d5b2edeed4686607e270d571c6325 Signed-off-by: Curtis Malainey cujomalainey@chromium.org Signed-off-by: Pierre-Louis Bossart pierre-louis.bossart@linux.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/20230419194057.42205-2-pierre-louis.bossart@linux.intel.com Signed-off-by: Mark Brown broonie@kernel.org

--

Commit: https://git.seco.com/clea-os/bsp/mediatek/linux-seco-mtk/-/commit/182024803ba0e663ea5ddb51361f6603d96304d1

UPSTREAM: ASoC: SOF: pm: Tear down pipelines only if DSP was active

With PCI if the device was suspended it is brought back to full power and then suspended again.

This doesn't happen when device is described via DT.

We need to make sure that we tear down pipelines only if the device was previously active (thus the pipelines were setup).

Otherwise, we can break the use_count:

[ 219.009743] sof-audio-of-imx8m 3b6e8000.dsp: sof_ipc3_tear_down_all_pipelines: widget PIPELINE.2.SAI3.IN is still in use: count -1

and after this everything stops working.

Fixes: d185e0689abc ("ASoC: SOF: pm: Always tear down pipelines before DSP suspend") Reviewed-by: Pierre-Louis Bossart pierre-louis.bossart@linux.intel.com Reviewed-by: Ranjani Sridharan ranjani.sridharan@linux.intel.com Change-Id: Ice1cc2ce9825a3f4d2ed71562d24ed392bf981af Signed-off-by: Daniel Baluta daniel.baluta@nxp.com Link: https://lore.kernel.org/r/20230405092655.19587-1-daniel.baluta@oss.nxp.com Signed-off-by: Mark Brown broonie@kernel.org

--

Commit: https://git.seco.com/clea-os/bsp/mediatek/linux-seco-mtk/-/commit/3f5976d6252a64b91968d82eefe0da3c8125aef1

BACKPORT: ASoC: SOF: Add support for DSPless mode

Via the SOF_DBG_DSPLESS_MODE sof_debug flag the SOF stack can be asked to not use the DSP for audio.

The core's support for DSPless mode is only going to be enabled if the platform reports that it can be used without DSP.

Change-Id: I0536e3e7b122e5ba3a2bd44d22a81ecc0d7f120d Signed-off-by: Peter Ujfalusi peter.ujfalusi@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: Rander Wang rander.wang@intel.com Link: https://lore.kernel.org/r/20230404092115.27949-4-peter.ujfalusi@linux.intel.com Signed-off-by: Mark Brown broonie@kernel.org

--

Commit: https://git.seco.com/clea-os/bsp/mediatek/linux-seco-mtk/-/commit/3dafb91175d59db3ee617aa47badf2e81f039fe9

UPSTREAM: ASoC: SOF: Add flag and state which will be used for DSP-less mode

The DSPless mode of the ASoC/SOF driver can be used for hardware verification and debug on platforms with HDaudio codecs. The DSP mode is still needed on existing platforms for SSP, DMIC, SoundWire interfaces managed by the GP-DMA.

This mode is also helpful to compare the legacy HDaudio driver with the ASoC/SOF driver wrt. codec management and handling. In theory we use the same code but differences are sometimes seen on jack detection and event handling.

Change-Id: I4bef05f3ec81936182ffffb4e8d3cecc430b5d6a Signed-off-by: Peter Ujfalusi peter.ujfalusi@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: Rander Wang rander.wang@intel.com Link: https://lore.kernel.org/r/20230404092115.27949-3-peter.ujfalusi@linux.intel.com Signed-off-by: Mark Brown broonie@kernel.org

--

Commit: https://git.seco.com/clea-os/bsp/mediatek/linux-seco-mtk/-/commit/330bf029ad45e1b2b434a48de5120273d9e184ac

BACKPORT: ASoC: SOF: pcm: Improve the pcm trigger sequence

The recommended sequence for triggering the host DMA is to first program the DMA in the FW before setting the RUN bit to start the stream in the host. With IPC3, this sequence is honored because the FW programs the DMA when the HW_PARAMS IPC is sent during PCM hw_params and then the host sets the RUN bit during sof_pcm_trigger(). But with IPC4, sof_pcm_trigger() sends the SET_PIPELINE_STATE IPC to program the DMA in the FW after the DMA RUN bit is set.

In order to minimize the impact for IPC3, introduce a new flag as part of struct sof_ipc_pcm_ops, ipc_first_on_start, which will be set for IPC4 only. With this flag set, the SET_PIPELINE_STATE IPC will be sent before the DMA RUN bit is set by the host during the START/PAUSE_RELEASE triggers.

Change-Id: I16e2a471cc25ee1d9907c37dfff9af6b82eb35bd Signed-off-by: Ranjani Sridharan ranjani.sridharan@linux.intel.com Reviewed-by: Péter Ujfalusi peter.ujfalusi@linux.intel.com Reviewed-by: Pierre-Louis Bossart pierre-louis.bossart@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/20230322094346.6019-4-peter.ujfalusi@linux.intel.com Signed-off-by: Mark Brown broonie@kernel.org

--

Commit: https://git.seco.com/clea-os/bsp/mediatek/linux-seco-mtk/-/commit/c7df538c3da613b479e2933326cb9861b082949b

UPSTREAM: ASoC: SOF: pcm: Make hw_params reset conditional for IPC3

In the case of IPC4, since there is no PCM_PARAMS IPC to send the new stream tag when restarting a stream without a hw_free, the original stream tag needs to be preserved. So, add new a flag as part of struct sof_ipc_pcm_ops, reset_hw_params_during_stop and set it only for IPC3. This will ensure that the host DMA stream tag will not be given up during the STOP trigger for IPC4.

Change-Id: I294a7ba6ba4283a8267eb47008d094bbfd696c59 Signed-off-by: Ranjani Sridharan ranjani.sridharan@linux.intel.com Reviewed-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 Signed-off-by: Peter Ujfalusi peter.ujfalusi@linux.intel.com Link: https://lore.kernel.org/r/20230322094346.6019-3-peter.ujfalusi@linux.intel.com Signed-off-by: Mark Brown broonie@kernel.org

--

Commit: https://git.seco.com/clea-os/bsp/mediatek/linux-seco-mtk/-/commit/67e8abed2f386db6e344d841ca14f50b31893c11

UPSTREAM: ASoC: SOF: topology: Set pipeline widget before updating IPC structures

Set up the IPC structure for scheduler widgets and set the pipeline widget before updating the IPC structures for all widgets. This will be needed to look up pipeline information during IPC structure set up.

Change-Id: I7e259a6c93f4ab9f0b86921b947465149259bd51 Signed-off-by: Ranjani Sridharan ranjani.sridharan@linux.intel.com Signed-off-by: Jyri Sarha jyri.sarha@intel.com Reviewed-by: Rander Wang rander.wang@intel.com Signed-off-by: Peter Ujfalusi peter.ujfalusi@linux.intel.com Link: https://lore.kernel.org/r/20230321092654.7292-2-peter.ujfalusi@linux.intel.com Signed-off-by: Mark Brown broonie@kernel.org

--

Commit: https://git.seco.com/clea-os/bsp/mediatek/linux-seco-mtk/-/commit/6bf711bd6fff1a5ba36d110727e10b5be2373866

UPSTREAM: ASoC: SOF: sof-audio: add support for setting up loopback routes

During route setup, playback stream routes are setup by going through sink path, capture stream routes are set up by going through source path. This is not sufficient to handle loopback cases between pipelines configured with different directions, e.g. a sidetone or an amplifier feedback connected to a speaker protection module. So, add the logic to handle such routes between widgets that aren't in the list of DAPM widgets associated with the same PCM.

Link: https://github.com/thesofproject/linux/issues/4042

Suggested-by: Bard Liao yung-chuan.liao@linux.intel.com Change-Id: I584172a658be137048f4c4d30535794d6f7bf40a Signed-off-by: Chao Song chao.song@linux.intel.com Signed-off-by: Ranjani Sridharan ranjani.sridharan@linux.intel.com Reviewed-by: Bard Liao yung-chuan.liao@linux.intel.com Reviewed-by: Péter Ujfalusi peter.ujfalusi@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/20230313101302.20950-1-peter.ujfalusi@linux.intel.com Signed-off-by: Mark Brown broonie@kernel.org

--

Commit: https://git.seco.com/clea-os/bsp/mediatek/linux-seco-mtk/-/commit/9d121e65d388ebc368cc25568eb5bdc600fa20ae

BACKPORT: ASoC: SOF: Use input/output pin consistently

Currently we use input/output and sink/source pins interchangeably. Remove the references to sink/source pins and replace with input/output pins everywhere for consistency and clarity.

Change-Id: I24ee876491c78916e176557bb569925303cda302 Signed-off-by: Ranjani Sridharan ranjani.sridharan@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: 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/20230313124856.8140-3-peter.ujfalusi@linux.intel.com Signed-off-by: Mark Brown broonie@kernel.org

--

Commit: https://git.seco.com/clea-os/bsp/mediatek/linux-seco-mtk/-/commit/04934e85851167cc5228e83e70796382db976650

UPSTREAM: ASoC: SOF: ipc3-control: Merge functions to handle bytes_ext get variants

The code for bytes_ext_get and bytes_ext_volatile_get is identical with the only difference is that in case of volatile_get we refresh the data from the DSP before returning it to user space.

Convert the callbacks to a simple wrapper for the same function.

Change-Id: I80e56569aed3d0bfe9e2922afc7d0c681ceda715 Signed-off-by: Peter Ujfalusi peter.ujfalusi@linux.intel.com Reviewed-by: Pierre-Louis Bossart pierre-louis.bossart@linux.intel.com Reviewed-by: Ranjani Sridharan ranjani.sridharan@linux.intel.com Link: https://lore.kernel.org/r/20230313110344.16644-3-peter.ujfalusi@linux.intel.com Signed-off-by: Mark Brown broonie@kernel.org

--

Commit: https://git.seco.com/clea-os/bsp/mediatek/linux-seco-mtk/-/commit/10145b39c162ee89733219ee54cc72cd41e27b73

UPSTREAM: ASoC: SOF: ipc3-control: Rename snd_sof_refresh_control()

Rename the snd_sof_refresh_control() to sof_ipc3_refresh_control() to follow the function naming convention for IPC specific code.

Change-Id: I4e305dd3ffe2fa6ab97d5bdd161e722f9730c00e Signed-off-by: Peter Ujfalusi peter.ujfalusi@linux.intel.com Reviewed-by: Pierre-Louis Bossart pierre-louis.bossart@linux.intel.com Reviewed-by: Ranjani Sridharan ranjani.sridharan@linux.intel.com Link: https://lore.kernel.org/r/20230313110344.16644-2-peter.ujfalusi@linux.intel.com Signed-off-by: Mark Brown broonie@kernel.org

--

Commit: https://git.seco.com/clea-os/bsp/mediatek/linux-seco-mtk/-/commit/19d6ba67c912b8d9db29e3ce5f6f883bada8f559

UPSTREAM: ASoC: SOF: loader: Remove log prefixes for snd_sof_run_firmware

Prefixs are unneeded since log level explains the same information

Change-Id: I738527e37b4c2ee0d210e043a7d1092aa913b7d9 Signed-off-by: Curtis Malainey cujomalainey@chromium.org Reviewed-by: Ranjani Sridharan ranjani.sridharan@linux.intel.com Reviewed-by: Pierre-Louis Bossart pierre-louis.bossart@linux.intel.com Reviewed-by: Péter Ujfalusi peter.ujfalusi@linux.intel.com Signed-off-by: Peter Ujfalusi peter.ujfalusi@linux.intel.com Link: https://lore.kernel.org/r/20230307115018.5588-1-peter.ujfalusi@linux.intel.com Signed-off-by: Mark Brown broonie@kernel.org

--

Commit: https://git.seco.com/clea-os/bsp/mediatek/linux-seco-mtk/-/commit/a06a50a38edbce521755a2bc362fcc5a153a97f4

UPSTREAM: ASoC: SOF: sof-audio: don't squelch errors in WIDGET_SETUP phase

When an IPC error happens while setting-up a widget during the FE hw_params phase, the existing logic will unwind all previous configurations but will overwrite the return status. The ALSA/ASoC logic will then proceed with the prepare and trigger phases, even though the firmware resources are not available.

Fix by returning the initial error code and ignoring the code returned in the UNPREPARE phase.

Change-Id: I7dca01e58a34be78908f7b02162b817a640a1787 Signed-off-by: Pierre-Louis Bossart pierre-louis.bossart@linux.intel.com Reviewed-by: Ranjani Sridharan ranjani.sridharan@linux.intel.com Reviewed-by: Chao Song chao.song@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/20230307114659.4614-1-peter.ujfalusi@linux.intel.com Signed-off-by: Mark Brown broonie@kernel.org

--

Commit: https://git.seco.com/clea-os/bsp/mediatek/linux-seco-mtk/-/commit/a67102027e69de3443aec6c4e2b4bbe2361827a9

BACKPORT: ASoC: SOF: sof-audio: Fix broken early bclk feature for SSP

With the removal of widget setup during BE hw_params, the DAI config IPC is never sent with the SOF_DAI_CONFIG_FLAGS_HW_PARAMS. This means that the early bit clock feature required for certain codecs will be broken.

Fix this by saving the config flags sent during BE DAI hw_params and reusing it when the DAI_CONFIG IPC is sent after the DAI widget is set up. Also, free the DAI config before the widget is freed.

The DAI_CONFIG IPC sent during the sof_widget_free() does not have the DAI index information. So, save the dai_index in the config during hw_params and reuse it during hw_free.

For IPC4, do not clear the node ID during hw_free. It will be needed for freeing the group_ida during unprepare.

Change-Id: I050e6546c4ebcf27c492a18cc634dec47b9451ed Signed-off-by: Ranjani Sridharan ranjani.sridharan@linux.intel.com Reviewed-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 Signed-off-by: Peter Ujfalusi peter.ujfalusi@linux.intel.com Link: https://lore.kernel.org/r/20230307114639.4553-1-peter.ujfalusi@linux.intel.com Signed-off-by: Mark Brown broonie@kernel.org

--

Commit: https://git.seco.com/clea-os/bsp/mediatek/linux-seco-mtk/-/commit/0349980a95b0864232fc706e91adbb82a7668b7f

UPSTREAM: ASoC: SOF: topology: Fix error handling in sof_widget_ready()

Fix the error paths in sof_widget_ready() to free all allocated memory and prevent memory leaks.

Change-Id: Ib5ea98c155074e1ec5cf781db31b9e2397b484aa Signed-off-by: Ranjani Sridharan ranjani.sridharan@linux.intel.com Reviewed-by: Péter 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 Signed-off-by: Peter Ujfalusi peter.ujfalusi@linux.intel.com Link: https://lore.kernel.org/r/20230307114815.4909-1-peter.ujfalusi@linux.intel.com Signed-off-by: Mark Brown broonie@kernel.org

--

Commit: https://git.seco.com/clea-os/bsp/mediatek/linux-seco-mtk/-/commit/b612061132492217d3fe56fcf0c9598d558eddc3

UPSTREAM: ASoC: SOF: ipc3: Check for upper size limit for the received message

The sof_ipc3_rx_msg() checks for minimum size of a new rx message but it is missing the check for upper limit. Corrupted or compromised firmware might be able to take advantage of this to cause out of bounds reads outside of the message area.

Reported-by: Curtis Malainey cujomalainey@chromium.org Change-Id: I4bee5a7e995d0c849105de3c8b5b3b6b34ef0a9a Signed-off-by: Peter Ujfalusi peter.ujfalusi@linux.intel.com Reviewed-by: Pierre-Louis Bossart pierre-louis.bossart@linux.intel.com Reviewed-by: Curtis Malainey curtis@malainey.com Signed-off-by: Peter Ujfalusi peter.ujfalusi@linux.intel.com Link: https://lore.kernel.org/r/20230307114917.5124-1-peter.ujfalusi@linux.intel.com Signed-off-by: Mark Brown broonie@kernel.org

--

Commit: https://git.seco.com/clea-os/bsp/mediatek/linux-seco-mtk/-/commit/9fddddcf95bf3c79f5ff7586571ab35587174df7

BACKPORT: ASoC: SOF: Introduce a new set_pm_gate() IPC PM op

Set_pm_gate depends on ipc version. This patch defines the ops for both IPC3 and IPC4.

Change-Id: Iebebf313416451a51923d44ac7cb2b3d991b5378 Signed-off-by: Rander Wang rander.wang@intel.com Reviewed-by: Pierre-Louis Bossart pierre-louis.bossart@linux.intel.com Reviewed-by: Ranjani Sridharan ranjani.sridharan@linux.intel.com Reviewed-by: Péter Ujfalusi peter.ujfalusi@linux.intel.com Signed-off-by: Peter Ujfalusi peter.ujfalusi@linux.intel.com Link: https://lore.kernel.org/r/20230214103345.30669-2-peter.ujfalusi@linux.intel.com Signed-off-by: Mark Brown broonie@kernel.org

--

Commit: https://git.seco.com/clea-os/bsp/mediatek/linux-seco-mtk/-/commit/0b21095a44b0e89d4bc90e3c58ce20ce82bf24f6

UPSTREAM: ASoC: SOF: ops: refine parameters order in function snd_sof_dsp_update8

SOF driver calls snd_sof_dsp_update8 with parameters mask and value but the snd_sof_dsp_update8 declares these two parameters in reverse order. This causes some issues such as d0i3 register can't be set correctly Now change function definition according to common SOF usage.

Fixes: c28a36b012f1 ("ASoC: SOF: ops: add snd_sof_dsp_updateb() helper") Change-Id: I30f3738ef697f7b7f4cf2d9321242f167783473d Signed-off-by: Rander Wang rander.wang@intel.com Reviewed-by: Bard Liao yung-chuan.liao@linux.intel.com Reviewed-by: Ranjani Sridharan ranjani.sridharan@linux.intel.com Reviewed-by: Chao Song chao.song@linux.intel.com Reviewed-by: Péter Ujfalusi peter.ujfalusi@linux.intel.com Reviewed-by: Liam Girdwood liam.r.girdwood@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/20230208104404.20554-1-peter.ujfalusi@linux.intel.com Signed-off-by: Mark Brown broonie@kernel.org

--

Commit: https://git.seco.com/clea-os/bsp/mediatek/linux-seco-mtk/-/commit/5a3cf0a131a5484383bae8cc8aeab176a11f9664

UPSTREAM: ASoC: SOF: add get_stream_position ops for pcm delay

PCM delay depends on stream position based on hardware counter to calculate stream delay so add this ops to get stream position according to hardware counter.

Change-Id: I99a228031f58ff909d0fabcb03c0b5bd66d25ce3 Signed-off-by: Rander Wang rander.wang@intel.com Reviewed-by: Pierre-Louis Bossart pierre-louis.bossart@linux.intel.com Reviewed-by: Ranjani Sridharan ranjani.sridharan@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/20230202132954.26773-8-peter.ujfalusi@linux.intel.com Signed-off-by: Mark Brown broonie@kernel.org

--

Commit: https://git.seco.com/clea-os/bsp/mediatek/linux-seco-mtk/-/commit/89e0fc9e5e4fc619751344b3ce31981757b6c0dc

UPSTREAM: ASoC: SOF: add delay function support in sof framework

Sof framework will call specific delay function for different IPC version.

Change-Id: Ie1a87c7fd8d8564a6bdefdbda4994d5d580fd00b Signed-off-by: Rander Wang rander.wang@intel.com Reviewed-by: Pierre-Louis Bossart pierre-louis.bossart@linux.intel.com Reviewed-by: Ranjani Sridharan ranjani.sridharan@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/20230202132954.26773-7-peter.ujfalusi@linux.intel.com Signed-off-by: Mark Brown broonie@kernel.org

--

Commit: https://git.seco.com/clea-os/bsp/mediatek/linux-seco-mtk/-/commit/290d1cf86472b04cb3027b9b8e8be6e402e7ebf6

BACKPORT: ASoC: SOF: add fw_info_box support

FW can share some information with host driver, .e.g fw status, pipeline status and volume status. On ipc4 platform it is located in memory windows 0 with size of struct sof_ipc4_fw_reg.

With this patch, ipc4 driver can find fw information in fw_info_box

Change-Id: I0cb1cbd31c11a40b6834e0b6dfbbad779beb57fe Signed-off-by: Rander Wang rander.wang@intel.com Reviewed-by: Pierre-Louis Bossart pierre-louis.bossart@linux.intel.com Reviewed-by: Ranjani Sridharan ranjani.sridharan@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/20230202132954.26773-3-peter.ujfalusi@linux.intel.com Signed-off-by: Mark Brown broonie@kernel.org

--

Commit: https://git.seco.com/clea-os/bsp/mediatek/linux-seco-mtk/-/commit/5f594f5e13a9583c13782fb1f4b4e723747287d9

UPSTREAM: ASoC: SOF: topology: Add missed "else" in sof_connect_dai_widget

The conversion to use generic helpers missed the else for the dai direction check which leads to failure when loading playback widgets

Fixes: 323f09a61d43 ("ASoC: sof: use helper function") Change-Id: I48e587b7bc7e6f2b221e75c1c3ecf4906c5cb8e1 Signed-off-by: Peter Ujfalusi peter.ujfalusi@linux.intel.com Acked-by: Kuninori Morimoto kuninori.morimoto.gx@renesas.com Link: https://lore.kernel.org/r/20230201112846.27707-2-peter.ujfalusi@linux.intel.com Signed-off-by: Mark Brown broonie@kernel.org

--

Commit: https://git.seco.com/clea-os/bsp/mediatek/linux-seco-mtk/-/commit/a6a161141f2b0426b07b27eb02aa7affca3c9ff0

UPSTREAM: ASoC: sof: use helper function

Current ASoC has many helper function. This patch use it.

Change-Id: Ifa5e04a1c9c3afaba428d0ed0f1d064da323bc9b Signed-off-by: Kuninori Morimoto kuninori.morimoto.gx@renesas.com Link: https://lore.kernel.org/r/87o7qfea3f.wl-kuninori.morimoto.gx@renesas.com Signed-off-by: Mark Brown broonie@kernel.org

--

Commit: https://git.seco.com/clea-os/bsp/mediatek/linux-seco-mtk/-/commit/dc60c90f8005152819075876aacd56ceb290f76b

UPSTREAM: ASoC: soc-dai.h: add missing snd_soc_dai_set_widget()

Current ASoC has snd_soc_dai_get_widget() (= get) but doesn't have set function. This patch adds it.

This patch also cleanup unnecessary line break for get function.

Change-Id: I27d5c729a83947ad8db9c100219c49ee51c4d7c0 Signed-off-by: Kuninori Morimoto kuninori.morimoto.gx@renesas.com Reviewed-by: Charles Keepax ckeepax@opensource.cirrus.com Link: https://lore.kernel.org/r/87bkmfforp.wl-kuninori.morimoto.gx@renesas.com Signed-off-by: Mark Brown broonie@kernel.org

--

Commit: https://git.seco.com/clea-os/bsp/mediatek/linux-seco-mtk/-/commit/9e656b8cb5a8521c968258dc215bcda6803e34aa

BACKPORT: ASoC: SOF: Protect swidget->use_count with mutex for kcontrol access race

The use_count of the swidget is protect by ALSA core PCM locking with the exception when an associated kcontrol is changed.

It has been observed that a rightly timed kcontrol access during stream stop can result of an attempt to send a control update to a widget which has been freed up between the check of the use_count and the message sending.

We need to protect the entire sof_widget_setup() and sof_widget_free() execution to make it safe to rely on the use_count. Move the code under an _unlocked() function and use a mutex to protect the execution of the functions for concurrency. On the control path we need to use the lock only for the kcontrol access, the widget_kcontrol_setup() op is called with the lock already held.

Reported-by: Guennadi Liakhovetski guennadi.liakhovetski@linux.intel.com Change-Id: I63cd6e5c346372c2c2dff5172ae77bf03ae6ba20 Signed-off-by: Peter Ujfalusi peter.ujfalusi@linux.intel.com Reviewed-by: Pierre-Louis Bossart pierre-louis.bossart@linux.intel.com Reviewed-by: Ranjani Sridharan ranjani.sridharan@linux.intel.com Link: https://lore.kernel.org/r/20230127120031.10709-18-peter.ujfalusi@linux.intel.com Signed-off-by: Mark Brown broonie@kernel.org

--

Commit: https://git.seco.com/clea-os/bsp/mediatek/linux-seco-mtk/-/commit/ab81ea1c1fbf57794b7ecf8547e25b84aba51620

UPSTREAM: ASoC: SOF: Avoid double decrementing use_count in sof_widget_setup on error

The sof_widget_free() on the error path will decrement the use count and if we jump to widget_free: then the use_count will be decremented by two, which is not correct as we only incremented once with 1.

Change-Id: I995efe44f833293396ca6b8035390850ccd57d15 Signed-off-by: Peter Ujfalusi peter.ujfalusi@linux.intel.com Reviewed-by: Pierre-Louis Bossart pierre-louis.bossart@linux.intel.com Reviewed-by: Ranjani Sridharan ranjani.sridharan@linux.intel.com Link: https://lore.kernel.org/r/20230127120031.10709-17-peter.ujfalusi@linux.intel.com Signed-off-by: Mark Brown broonie@kernel.org

--

Commit: https://git.seco.com/clea-os/bsp/mediatek/linux-seco-mtk/-/commit/2b32c7724ffc0181181683dab1bfbc1dd104af6d

BACKPORT: ASoC: SOF: Introduce struct snd_sof_pipeline

Introduce struct snd_sof_pipeline to save the information about pipelines including the pipeline widget, their status wrt how many PCM's are using them and whether they are complete or not.

In struct snd_sof_widget, replace pipe_widget with spipe and remove complete. In struct snd_sof_pcm_stream_pipeline_list, replace pipe_widgets with pipelines.

Update all users accordingly.

Change-Id: Iffbae6e419927c67d02a170ad77fee484df3738a Signed-off-by: Ranjani Sridharan ranjani.sridharan@linux.intel.com Reviewed-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 Signed-off-by: Peter Ujfalusi peter.ujfalusi@linux.intel.com Link: https://lore.kernel.org/r/20230127120031.10709-13-peter.ujfalusi@linux.intel.com Signed-off-by: Mark Brown broonie@kernel.org

--

Commit: https://git.seco.com/clea-os/bsp/mediatek/linux-seco-mtk/-/commit/9fa8c3fe34e8f9ce426a8ddee232785a11d7144d

UPSTREAM: ASoC: SOF: sof-audio: Populate the PCM stream pipeline_info

Populate the pipeline_info for the PCM stream with the list of pipeline widgets that need to be handled during the PCM trigger. This will be used in the IPC-specific PCM trigger op to trigger the pipelines.

Change-Id: I668edf06e438b93453bbcd869cd4d46c7aead2fd Signed-off-by: Ranjani Sridharan ranjani.sridharan@linux.intel.com Reviewed-by: Libin Yang libin.yang@intel.com Reviewed-by: Pierre-Louis Bossart pierre-louis.bossart@linux.intel.com Reviewed-by: Péter Ujfalusi peter.ujfalusi@linux.intel.com Signed-off-by: Peter Ujfalusi peter.ujfalusi@linux.intel.com Link: https://lore.kernel.org/r/20230127120031.10709-11-peter.ujfalusi@linux.intel.com Signed-off-by: Mark Brown broonie@kernel.org

--

Commit: https://git.seco.com/clea-os/bsp/mediatek/linux-seco-mtk/-/commit/fdd34b9a6c37238c08a4e7ea8eb731075ac24a54

BACKPORT: ASoC: SOF: ipc4-pcm: Define pcm_setup/free ops

Define the pcm_setup/pcm_free ops for IPC4. Define a new struct snd_sof_pcm_stream_trigger_info and add a new field trigger_info of this type to struct snd_sof_pcm_stream. This will be used to save the list of pipelines that need to be triggered.

Change-Id: I25afbea8b45397893e529d538907967df8c4e6ac Signed-off-by: Ranjani Sridharan ranjani.sridharan@linux.intel.com Reviewed-by: Libin Yang libin.yang@intel.com Reviewed-by: Pierre-Louis Bossart pierre-louis.bossart@linux.intel.com Reviewed-by: Péter Ujfalusi peter.ujfalusi@linux.intel.com Signed-off-by: Peter Ujfalusi peter.ujfalusi@linux.intel.com Link: https://lore.kernel.org/r/20230127120031.10709-9-peter.ujfalusi@linux.intel.com Signed-off-by: Mark Brown broonie@kernel.org

--

Commit: https://git.seco.com/clea-os/bsp/mediatek/linux-seco-mtk/-/commit/596fdb7503072fcaca1ee0145cc7681d2a41e8a0

UPSTREAM: ASoC: SOF: Introduce PCM setup/free PCM IPC ops

These will be used to perform IPC-specific PCM setup/free.

Change-Id: I44777d6308935a92a5bde8e11cffc3f6ee6790f7 Signed-off-by: Ranjani Sridharan ranjani.sridharan@linux.intel.com Reviewed-by: Libin Yang libin.yang@intel.com Reviewed-by: Pierre-Louis Bossart pierre-louis.bossart@linux.intel.com Reviewed-by: Péter Ujfalusi peter.ujfalusi@linux.intel.com Signed-off-by: Peter Ujfalusi peter.ujfalusi@linux.intel.com Link: https://lore.kernel.org/r/20230127120031.10709-8-peter.ujfalusi@linux.intel.com Signed-off-by: Mark Brown broonie@kernel.org

--

Commit: https://git.seco.com/clea-os/bsp/mediatek/linux-seco-mtk/-/commit/ec3bb3c72be6fe9ac4f324a220ef64de68fcb455

BACKPORT: ASoC: SOF: topology: Set IPC-specific trigger order for DAI links

Add a new topology IPC op to set up DAI links and set the link trigger order to match the expectation based on the IPC type. Note that the link_setup op implementations for IPC3 and IPC4 are not identical and have contrasting trigger orders for playback and capture.

Change-Id: Iaa67375acdbf0ae1d21514c6ab84974b4fd446e2 Signed-off-by: Ranjani Sridharan ranjani.sridharan@linux.intel.com Reviewed-by: Pierre-Louis Bossart pierre-louis.bossart@linux.intel.com Reviewed-by: Bard Liao yung-chuan.liao@linux.intel.com Reviewed-by: Péter Ujfalusi peter.ujfalusi@linux.intel.com Signed-off-by: Peter Ujfalusi peter.ujfalusi@linux.intel.com Link: https://lore.kernel.org/r/20230127120031.10709-7-peter.ujfalusi@linux.intel.com Signed-off-by: Mark Brown broonie@kernel.org

--

Commit: https://git.seco.com/clea-os/bsp/mediatek/linux-seco-mtk/-/commit/abe0a5525b9ab5a1279b575986fcb3b7aca4989a

BACKPORT: ASoC: SOF: pcm: do not free widgets during suspend trigger

IPC3 and IPC4 have different requirements for the order in which the FE CPU and BE CPU DAI trigger callbacks must be invoked. With a regular PCM start/stop, pipeline widgets are set up during hw_params and freed during hw_free.

But when the system is suspended when a PCM is running, pipeline widgets are freed during the SUSPEND trigger callback for the FE CPU DAI. In order to avoid freeing the pipeline widgets before the BE CPU DAI trigger is executed, the trigger order was modified in previous contributions in the PCM dai_link_fixup callback to make sure that the BE CPU DAI trigger stop/suspend is always invoked before the FE CPU DAI trigger. But this contradicts the firmware requirement for IPC4 w.r.t. ordering of pipeline triggers.

So, remove the freeing of pipeline widgets during FE CPU DAI suspend trigger and handle it during system suspend when the tear_down_all_pipelines() IPC op is invoked. This will be followed up with a patch to fix the trigger order for IPC4.

Change-Id: I2cac9bfa1387fd6f022b889b2e912eaae83d7391 Signed-off-by: Ranjani Sridharan ranjani.sridharan@linux.intel.com Reviewed-by: Pierre-Louis Bossart pierre-louis.bossart@linux.intel.com Reviewed-by: Bard Liao yung-chuan.liao@linux.intel.com Reviewed-by: Péter Ujfalusi peter.ujfalusi@linux.intel.com Signed-off-by: Peter Ujfalusi peter.ujfalusi@linux.intel.com Link: https://lore.kernel.org/r/20230127120031.10709-6-peter.ujfalusi@linux.intel.com Signed-off-by: Mark Brown broonie@kernel.org

--

Commit: https://git.seco.com/clea-os/bsp/mediatek/linux-seco-mtk/-/commit/4da6b34218a804283f5cc89a69073db71da821ac

UPSTREAM: ASoC: SOF: sof-audio: Only process widgets in the connected widget list

When walking the list of the widgets from the source to the sink, we accidentally also end up preparing/setting up the widgets that are not in the list of connected DAPM widgets associated with the PCM. Avoid this by checking if a widget is part of the connected DAPM widget list during widget prepare, unprepare, setup or free.

Change-Id: Icbf7b373b3b9e25cd11ee3e4a91ca05e4e997151 Signed-off-by: Ranjani Sridharan ranjani.sridharan@linux.intel.com Reviewed-by: Bard Liao yung-chuan.liao@linux.intel.com Reviewed-by: Pierre-Louis Bossart pierre-louis.bossart@linux.intel.com Reviewed-by: Péter Ujfalusi peter.ujfalusi@linux.intel.com Signed-off-by: Peter Ujfalusi peter.ujfalusi@linux.intel.com Link: https://lore.kernel.org/r/20230127120031.10709-5-peter.ujfalusi@linux.intel.com Signed-off-by: Mark Brown broonie@kernel.org

--

Commit: https://git.seco.com/clea-os/bsp/mediatek/linux-seco-mtk/-/commit/211c537e4ef405800b17f2b8232ddd0370547058

UPSTREAM: ASoC: SOF: sof-audio: Set up/free DAI/AIF widgets only once

Calling the sof_widget_setup/free() for the DAI/AIF widgets inside the snd_soc_dapm_widget_for_each_sink_path() loop will end up setting up or freeing the widget multiple times if there are multiple paths leaving the widget. Fix this by moving the widget setup/free for the starting widget in each path outside the loop.

Change-Id: Iee39c618ed3b188ac424c040f0290c67e3329451 Signed-off-by: Ranjani Sridharan ranjani.sridharan@linux.intel.com Reviewed-by: Bard Liao yung-chuan.liao@linux.intel.com Reviewed-by: Pierre-Louis Bossart pierre-louis.bossart@linux.intel.com Reviewed-by: Péter Ujfalusi peter.ujfalusi@linux.intel.com Signed-off-by: Peter Ujfalusi peter.ujfalusi@linux.intel.com Link: https://lore.kernel.org/r/20230127120031.10709-4-peter.ujfalusi@linux.intel.com Signed-off-by: Mark Brown broonie@kernel.org

--

Commit: https://git.seco.com/clea-os/bsp/mediatek/linux-seco-mtk/-/commit/fd1c973633109fc8c069693f5802a79811eb37b8

UPSTREAM: ASoC: soc-pcm: Export widget_in_list()

Export the widget_in_list() function to be used by other modules.

Change-Id: I863c74e09e6fb80662197c755d1415725d17c9f3 Signed-off-by: Ranjani Sridharan ranjani.sridharan@linux.intel.com Reviewed-by: Bard Liao yung-chuan.liao@linux.intel.com Reviewed-by: Pierre-Louis Bossart pierre-louis.bossart@linux.intel.com Reviewed-by: Péter Ujfalusi peter.ujfalusi@linux.intel.com Signed-off-by: Peter Ujfalusi peter.ujfalusi@linux.intel.com Link: https://lore.kernel.org/r/20230127120031.10709-3-peter.ujfalusi@linux.intel.com Signed-off-by: Mark Brown broonie@kernel.org

--

Commit: https://git.seco.com/clea-os/bsp/mediatek/linux-seco-mtk/-/commit/e28d08416eba182717e6937b42b789ce82c1bd31

UPSTREAM: ASoC: SOF: sof-audio: prepare_widgets: Check swidget for NULL on sink failure

If the swidget is NULL we skip the preparing of the widget and jump to handle the sink path of the widget. If the prepare fails in this case we would undo the prepare but the swidget is NULL (we skipped the prepare for the widget).

To avoid NULL pointer dereference in this case we must check swidget against NULL pointer once again.

Fixes: 0ad84b11f2f8 ("ASoC: SOF: sof-audio: skip prepare/unprepare if swidget is NULL") Reported-by: kernel test robot lkp@intel.com Reported-by: Dan Carpenter error27@gmail.com Change-Id: I659620059b0b4490714d15c2a57d4217d3b8bbab Signed-off-by: Peter Ujfalusi peter.ujfalusi@linux.intel.com Reviewed-by: AngeloGioacchino Del Regno angelogioacchino.delregno@collabora.com Link: https://lore.kernel.org/r/20230120102125.30653-1-peter.ujfalusi@linux.intel.com Signed-off-by: Mark Brown broonie@kernel.org

--

Commit: https://git.seco.com/clea-os/bsp/mediatek/linux-seco-mtk/-/commit/40df93275de9a15e47995af52b90802df9fd82cc

UPSTREAM: ASoC: SOF: sof-audio: Extend the optionality of IPC ops to IPC as well

The IPC ops are optional, but they require that the ops struct is to be allocated with all callbacks set to NULL.

Update the code to extend the optionality to: sdev->ipc == NULL sdev->ipc->ops == NULL sdev->ipc->ops->[ops_group] == NULL sdev->ipc->ops->[pcmops_group]->ops == NULL (treated optional currently)

Change-Id: I55198c5dae62fee4e5711d1bde4b684c92362834 Signed-off-by: Peter Ujfalusi peter.ujfalusi@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: Bard Liao yung-chuan.liao@linux.intel.com Reviewed-by: Rander Wang rander.wang@intel.com Link: https://lore.kernel.org/r/20221221102328.9635-7-peter.ujfalusi@linux.intel.com Signed-off-by: Mark Brown broonie@kernel.org

--

Commit: https://git.seco.com/clea-os/bsp/mediatek/linux-seco-mtk/-/commit/581ba7530cc85580027c3fd89a933ade8224a698

UPSTREAM: ASoC: SOF: keep prepare/unprepare widgets in sink path

The existing code return when a widget doesn't need to prepare/unprepare. This will prevent widgets in the sink path from being prepared/unprepared.

Cc: stable@vger.kernel.org # 6.1 Link: https://github.com/thesofproject/linux/issues/4021 Change-Id: I87003a5e302f631fec2c0d22e5a42201f63a7f69 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 Reviewed-by: Rander Wang rander.wang@intel.com Signed-off-by: Peter Ujfalusi peter.ujfalusi@linux.intel.com Link: https://lore.kernel.org/r/20230118101255.29139-4-peter.ujfalusi@linux.intel.com Signed-off-by: Mark Brown broonie@kernel.org

--

Commit: https://git.seco.com/clea-os/bsp/mediatek/linux-seco-mtk/-/commit/6fe16c4d39d2244008d1b636549fdd01375b308e

UPSTREAM: ASoC: SOF: sof-audio: skip prepare/unprepare if swidget is NULL

Skip preparing/unpreparing widgets if the swidget pointer is NULL. This will be true in the case of virtual widgets in topology that were added for reusing the legacy HDA machine driver with SOF.

Fixes: 9862dcf70245 ("ASoC: SOF: don't unprepare widget used other pipelines") Cc: stable@vger.kernel.org # 6.1 Change-Id: I91d353662c980c92f66f421024452282df88ef3b Signed-off-by: Ranjani Sridharan ranjani.sridharan@linux.intel.com Signed-off-by: Peter Ujfalusi peter.ujfalusi@linux.intel.com Reviewed-by: Rander Wang rander.wang@intel.com Reviewed-by: AngeloGioacchino Del Regno angelogioacchino.delregno@collabora.com Tested-by: AngeloGioacchino Del Regno angelogioacchino.delregno@collabora.com Signed-off-by: Peter Ujfalusi peter.ujfalusi@linux.intel.com Link: https://lore.kernel.org/r/20230118101255.29139-3-peter.ujfalusi@linux.intel.com Signed-off-by: Mark Brown broonie@kernel.org

--

Commit: https://git.seco.com/clea-os/bsp/mediatek/linux-seco-mtk/-/commit/96644722bd801d73737b89728200456045cb683c

UPSTREAM: ASoC: SOF: sof-audio: unprepare when swidget->use_count > 0

We should unprepare the widget if its use_count = 1.

Fixes: 9862dcf70245 ("ASoC: SOF: don't unprepare widget used other pipelines") Cc: stable@vger.kernel.org # 6.1 Change-Id: I0d6f2d43af21b94f02073648b02e6ef17f745fa8 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 Reviewed-by: Rander Wang rander.wang@intel.com Signed-off-by: Peter Ujfalusi peter.ujfalusi@linux.intel.com Link: https://lore.kernel.org/r/20230118101255.29139-2-peter.ujfalusi@linux.intel.com Signed-off-by: Mark Brown broonie@kernel.org

--

Commit: https://git.seco.com/clea-os/bsp/mediatek/linux-seco-mtk/-/commit/b2b2eaca4678c133b7d5be18ec373a519ac31dc9

UPSTREAM: ASoC: SOF: sof-audio: start with the right widget type

If there is a connection between a playback stream and a capture stream, all widgets that are connected to the playback stream and the capture stream will be in the list. So, we have to start with the exactly right widget type. snd_soc_dapm_aif_out is for capture stream and a playback stream should start with a snd_soc_dapm_aif_in widget. Contrarily, snd_soc_dapm_dai_in is for playback stream, and a capture stream should start with a snd_soc_dapm_dai_out widget.

Change-Id: If8b0e4e2984b60d911581b8470a7a6660ba42557 Signed-off-by: Bard Liao yung-chuan.liao@linux.intel.com Reviewed-by: Ranjani Sridharan ranjani.sridharan@linux.intel.com Reviewed-by: Kai Vehmanen kai.vehmanen@linux.intel.com Reviewed-by: Péter Ujfalusi peter.ujfalusi@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/20230117123534.2075-1-peter.ujfalusi@linux.intel.com Signed-off-by: Mark Brown broonie@kernel.org

--

Commit: https://git.seco.com/clea-os/bsp/mediatek/linux-seco-mtk/-/commit/a784670265b0dce701a1565eda11edb1ae14d7df

UPSTREAM: ASoC: SOF: compress: Set compress data offset

Because now snd_sof_set_stream_data_offset has compress support we use it to set posn_offset for compress stream.

Reviewed-by: Paul Olaru paul.olaru@nxp.com Reviewed-by: Iuliana Prodan iuliana.prodan@nxp.com Reviewed-by: Ranjani Sridharan ranjani.sridharan@linux.intel.com Reviewed-by: Peter Ujfalusi peter.ujfalusi@linux.intel.com Change-Id: I5264767434d3da13d64d82fcae2b2758e9bc4c06 Signed-off-by: Daniel Baluta daniel.baluta@nxp.com Link: https://lore.kernel.org/r/20230117122533.201708-5-daniel.baluta@oss.nxp.com Signed-off-by: Mark Brown broonie@kernel.org

--

Commit: https://git.seco.com/clea-os/bsp/mediatek/linux-seco-mtk/-/commit/c4dad10407fff6d19c057207f176742a193dda84

UPSTREAM: ASoC: SOF: Add support for compress API for stream data/offset

snd_sof_pcm_stream keeps information about both PCM (snd_pcm_substream) and Compress (snd_compr_stream) streams.

When PCM substream pointer is NULL this means we are dealing with a compress stream.

Reviewed-by: Paul Olaru paul.olaru@nxp.com Reviewed-by: Iuliana Prodan iuliana.prodan@nxp.com Reviewed-by: Ranjani Sridharan ranjani.sridharan@linux.intel.com Reviewed-by: Peter Ujfalusi peter.ujfalusi@linux.intel.com Change-Id: I30aab34d3ef615e890072ff2b8f24076b68ad674 Signed-off-by: Daniel Baluta daniel.baluta@nxp.com Link: https://lore.kernel.org/r/20230117122533.201708-4-daniel.baluta@oss.nxp.com Signed-off-by: Mark Brown broonie@kernel.org

--

Commit: https://git.seco.com/clea-os/bsp/mediatek/linux-seco-mtk/-/commit/549610745e31dabf82eb1c2bb4d82ac9c77d0c92

BACKPORT: ASoC: SOF: Prepare set_stream_data_offset for compress API

Make second parameter of set_stream_data_offset generic in order to be used for both PCM and compress streams.

Current patch doesn't introduce any functional change, just prepare the code for compress support.

Reviewed-by: Paul Olaru paul.olaru@nxp.com Reviewed-by: Iuliana Prodan iuliana.prodan@nxp.com Reviewed-by: Ranjani Sridharan ranjani.sridharan@linux.intel.com Reviewed-by: Peter Ujfalusi peter.ujfalusi@linux.intel.com Change-Id: I96359134a8cee3bec22a819fd668f3feb3e7dc50 Signed-off-by: Daniel Baluta daniel.baluta@nxp.com Link: https://lore.kernel.org/r/20230117122533.201708-3-daniel.baluta@oss.nxp.com Signed-off-by: Mark Brown broonie@kernel.org

--

Commit: https://git.seco.com/clea-os/bsp/mediatek/linux-seco-mtk/-/commit/dfe9715d76f3b3cdea2477f1145dc72adc2d250b

BACKPORT: ASoC: SOF: Prepare ipc_msg_data to be used with compress API

Make second parameter of ipc_msg_data generic in order to be able to support compressed streams.

This patch doesn't hold any functional change.

With this case we can use ipc_msg_data, to retrieve information from DSP for both PCM/Compress API.

Reviewed-by: Paul Olaru paul.olaru@nxp.com Reviewed-by: Iuliana Prodan iuliana.prodan@nxp.com Reviewed-by: Ranjani Sridharan ranjani.sridharan@linux.intel.com Reviewed-by: Peter Ujfalusi peter.ujfalusi@linux.intel.com Change-Id: Id1a22651a7dc5c935aa17531d01013f486d21c70 Signed-off-by: Daniel Baluta daniel.baluta@nxp.com Link: https://lore.kernel.org/r/20230117122533.201708-2-daniel.baluta@oss.nxp.com Signed-off-by: Mark Brown broonie@kernel.org

--

Commit: https://git.seco.com/clea-os/bsp/mediatek/linux-seco-mtk/-/commit/ad40bc8fece8ec0cb0a6142b3811546ed32d2968

UPSTREAM: ASoC: SOF: mediatek: Provide debugfs_add_region_item ops for core

Set the generic iomem callback for debugfs_add_region_item to support sof-logger.

Change-Id: Ia15b39321a26294be27e9013c092f11bf756c4e9 Signed-off-by: Tinghan Shen tinghan.shen@mediatek.com Reviewed-by: Péter Ujfalusi peter.ujfalusi@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: AngeloGioacchino Del Regno angelogioacchino.delregno@collabora.com Link: https://lore.kernel.org/r/20230110084312.12953-4-tinghan.shen@mediatek.com Signed-off-by: Mark Brown broonie@kernel.org

--

Commit: https://git.seco.com/clea-os/bsp/mediatek/linux-seco-mtk/-/commit/f4fb54064252e99f4bf8239d72508c5e42235f87

UPSTREAM: ASoC: SOF: mediatek: Support mt8188 platform

Add support of SOF on MediaTek MT8188 SoC. MT8188 ADSP integrates with a single core Cadence HiFi-5 DSP. The IPC communication between AP and DSP is based on shared DRAM and mailbox interrupt.

The change in the mt8186.h is compatible on both mt8186 and mt8188. The register controls booting the DSP core with the default address or the user specified address. Both mt8186 and mt8188 should boot with the user specified boot in the driver. The usage of the register is the same on both SoC, but the control bit is different on mt8186 and mt8188, which is bit 1 on mt8186 and bit 0 on mt8188. Configure the redundant bit has noside effect on both SoCs.

Change-Id: I72c55aeb4eb88d6e6228846cd95ab00272d68511 Signed-off-by: Tinghan Shen tinghan.shen@mediatek.com Reviewed-by: Péter Ujfalusi peter.ujfalusi@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: AngeloGioacchino Del Regno angelogioacchino.delregno@collabora.com Link: https://lore.kernel.org/r/20230110084312.12953-3-tinghan.shen@mediatek.com Signed-off-by: Mark Brown broonie@kernel.org

--

Commit: https://git.seco.com/clea-os/bsp/mediatek/linux-seco-mtk/-/commit/48dc555e3de62db2b4e22c3ab428db18903a176c

UPSTREAM: dt-bindings: dsp: mediatek: Add mt8188 dsp compatible

Add support of the single-core HiFi5 audio DSP on MediaTek MT8188 SoC for pre- and post- audio processing.

Change-Id: I5c9f7d9fb451e1a951a798c9b4dd69905f98fdfd Signed-off-by: Tinghan Shen tinghan.shen@mediatek.com Reviewed-by: AngeloGioacchino Del Regno angelogioacchino.delregno@collabora.com Acked-by: Krzysztof Kozlowski krzysztof.kozlowski@linaro.org Link: https://lore.kernel.org/r/20230110084312.12953-2-tinghan.shen@mediatek.com Signed-off-by: Mark Brown broonie@kernel.org

--

Commit: https://git.seco.com/clea-os/bsp/mediatek/linux-seco-mtk/-/commit/d7ce457b5a8503e058a2df6c4c34e343d0239abd

UPSTREAM: ASoC: SOF: mediatek: mt8195: remove a redundant comparison of sram

DSP SRAM is not used for audio shared buffer between host and DSP so TOTAL_SIZE_SHARED_SRAM_FROM_TAIL is zero. Remove the definition and redundant comparison to fix coverity "unsigned compared against 0".

Change-Id: I53f21cc6041c4ef2854f78dd71cc0201f6193556 Signed-off-by: YC Hung yc.hung@mediatek.com Reviewed-by: AngeloGioacchino Del Regno angeloigoacchino.delregno@collabora.com Link: https://lore.kernel.org/r/20221215061046.16934-1-yc.hung@mediatek.com Signed-off-by: Mark Brown broonie@kernel.org

--

Commit: https://git.seco.com/clea-os/bsp/mediatek/linux-seco-mtk/-/commit/3c03b0fe5aa104cd7c62ad1e5ef18ac7ecc1ef2a

UPSTREAM: ASoC: SOF: IPC3 topology: Print the conflicting bytes sizes

The error "Conflict in bytes vs. priv size." is too brief. With the printed sizes it's a lot easier to find the size issue in for binary control if such happens.

Change-Id: I1e42c07a296860dec32473cc5e2b0168f65d465d Signed-off-by: Seppo Ingalsuo seppo.ingalsuo@linux.intel.com Reviewed-by: Daniel Baluta daniel.baluta@nxp.com Reviewed-by: Pierre-Louis Bossart pierre-louis.bossart@linux.intel.com Reviewed-by: Ranjani Sridharan ranjani.sridharan@linux.intel.com Reviewed-by: Péter Ujfalusi peter.ujfalusi@linux.intel.com Signed-off-by: Peter Ujfalusi peter.ujfalusi@linux.intel.com Link: https://lore.kernel.org/r/20221216115350.28260-1-peter.ujfalusi@linux.intel.com Signed-off-by: Mark Brown broonie@kernel.org

--

Commit: https://git.seco.com/clea-os/bsp/mediatek/linux-seco-mtk/-/commit/16b212aff1a3e4d39f59bcf3c1fd62caa3b69470

UPSTREAM: ASoC: SOF: core: Print out the value of sof_debug if it is set

The sof_debug value is set by the user, developer intentionally. To save time on figuring out what value has been passed to the kernel by the user, developer, print it out if it is not 0.

Change-Id: I49b25da52419eae16c94d3a4e78506166a936e39 Signed-off-by: Peter Ujfalusi peter.ujfalusi@linux.intel.com Reviewed-by: Pierre-Louis Bossart pierre-louis.bossart@linux.intel.com Reviewed-by: Kai Vehmanen kai.vehmanen@linux.intel.com Reviewed-by: Daniel Baluta daniel.baluta@nxp.com Link: https://lore.kernel.org/r/20221216115435.28427-1-peter.ujfalusi@linux.intel.com Signed-off-by: Mark Brown broonie@kernel.org

--

Commit: https://git.seco.com/clea-os/bsp/mediatek/linux-seco-mtk/-/commit/a7608d6aa27d09cc214ec1be3a100ba3df1673c5

UPSTREAM: ASoC: SOF: sof-priv: Mark fw_tracing ops optional in documentation

The code treats the fw_tracing as optional feature but the documentation was not reflecting this. Correct it by explicitly stating that the fw_tracing is optional.

Change-Id: I5063e3fa57ca3986c4b6b564a349ae52ffac598b Signed-off-by: Peter Ujfalusi peter.ujfalusi@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: Bard Liao yung-chuan.liao@linux.intel.com Reviewed-by: Rander Wang rander.wang@intel.com Link: https://lore.kernel.org/r/20221221102328.9635-10-peter.ujfalusi@linux.intel.com Signed-off-by: Mark Brown broonie@kernel.org

--

Commit: https://git.seco.com/clea-os/bsp/mediatek/linux-seco-mtk/-/commit/25cadacddf82392031605650e981ef1541c31023

UPSTREAM: ASoC: SOF: pm: Extend the optionality of IPC ops to IPC as well

The IPC ops are optional, but they require that the ops struct is to be allocated with all callbacks set to NULL.

Update the code to extend the optionality to: sdev->ipc == NULL sdev->ipc->ops == NULL sdev->ipc->ops->[pm/tplg] == NULL (treated optional for pm currently) sdev->ipc->ops->[pm/tplg]->ops == NULL (treated optional currently)

Change-Id: If1e7fbfe42212f861768f899bbc78083a9d3e490 Signed-off-by: Peter Ujfalusi peter.ujfalusi@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: Bard Liao yung-chuan.liao@linux.intel.com Reviewed-by: Rander Wang rander.wang@intel.com Link: https://lore.kernel.org/r/20221221102328.9635-9-peter.ujfalusi@linux.intel.com Signed-off-by: Mark Brown broonie@kernel.org

--

Commit: https://git.seco.com/clea-os/bsp/mediatek/linux-seco-mtk/-/commit/57f1f69ca74e7f4a67a9691ca574404bddd5dc14

UPSTREAM: ASoC: SOF: topology: Extend the optionality of IPC ops to IPC as well

The IPC ops are optional, but they require that the ops struct is to be allocated with all callbacks set to NULL.

Update the code to extend the optionality to: sdev->ipc == NULL sdev->ipc->ops == NULL sdev->ipc->ops->[tplg] == NULL sdev->ipc->ops->[tplg]->ops == NULL (treated optional currently)

At the same time standardize the naming of the ops pointer to tplg_ops

Change-Id: Iee78b8107a37920cb3027cd2464b71167ba44888 Signed-off-by: Peter Ujfalusi peter.ujfalusi@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: Bard Liao yung-chuan.liao@linux.intel.com Reviewed-by: Rander Wang rander.wang@intel.com Link: https://lore.kernel.org/r/20221221102328.9635-8-peter.ujfalusi@linux.intel.com Signed-off-by: Mark Brown broonie@kernel.org

--

Commit: https://git.seco.com/clea-os/bsp/mediatek/linux-seco-mtk/-/commit/6c57885cb5ecc3cfe48965265eed5ed695ff9e10

UPSTREAM: ASoC: SOF: pcm: Extend the optionality of IPC ops to IPC as well

The IPC ops are optional, but they require that the ops struct is to be allocated with all callbacks set to NULL.

Update the code to extend the optionality to: sdev->ipc == NULL sdev->ipc->ops == NULL sdev->ipc->ops->[pcm] == NULL sdev->ipc->ops->[pcm]->ops == NULL (treated optional currently)

Change-Id: I9e96d258fc1aca9a1d0216861f6a562998e6145f Signed-off-by: Peter Ujfalusi peter.ujfalusi@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: Bard Liao yung-chuan.liao@linux.intel.com Reviewed-by: Rander Wang rander.wang@intel.com Link: https://lore.kernel.org/r/20221221102328.9635-5-peter.ujfalusi@linux.intel.com Signed-off-by: Mark Brown broonie@kernel.org

--

Commit: https://git.seco.com/clea-os/bsp/mediatek/linux-seco-mtk/-/commit/9759014cc2322baf4cc49c278c02811420248d39

UPSTREAM: ASoC: SOF: Add helper macro to be used to get an IPC ops

In preparation to a case when the DSP is not used. In this case the IPC communication itself has no meaning and we might not even have sdev->ipc allocated at all.

The sof_ipc_get_ops() macro can be used to get a named IPC ops struct or return NULL if the sdev->ipc is not allocated.

Change-Id: Ie8f8b844c496158d6cf608d316c1678eade01972 Signed-off-by: Peter Ujfalusi peter.ujfalusi@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: Bard Liao yung-chuan.liao@linux.intel.com Reviewed-by: Rander Wang rander.wang@intel.com Link: https://lore.kernel.org/r/20221221102328.9635-4-peter.ujfalusi@linux.intel.com Signed-off-by: Mark Brown broonie@kernel.org

--

Commit: https://git.seco.com/clea-os/bsp/mediatek/linux-seco-mtk/-/commit/8608f33c54ceac82131576c893cd0589cf2df06b

UPSTREAM: ASoC: SOF: sof-audio: Update documentation for sof_ipc_tplg_ops

The core treats all function pointer in sof_ipc_tplg_ops as optional. Update the documentation to reflect this.

Change-Id: I3b78b60d30bef630e9707fa4aa4698c86d9175a8 Signed-off-by: Peter Ujfalusi peter.ujfalusi@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: Bard Liao yung-chuan.liao@linux.intel.com Reviewed-by: Rander Wang rander.wang@intel.com Link: https://lore.kernel.org/r/20221221102328.9635-3-peter.ujfalusi@linux.intel.com Signed-off-by: Mark Brown broonie@kernel.org

--

Commit: https://git.seco.com/clea-os/bsp/mediatek/linux-seco-mtk/-/commit/c2fb3b83fd3d0478ddee651617c2c4e2b5a40cf8

UPSTREAM: ASoC: SOF: sof-audio: Treat tplg_ops->route_setup() as optional

Other topology ops have been treated as optional, including the route_free.

Handle the route_setup in a conforming way as optional callback. Note: we do not have checks for the callbacks itself which makes them all optional in practice.

Change-Id: I5f2fac9e8ab1296029c4d1b2dbbcb40fcaaa6ba8 Signed-off-by: Peter Ujfalusi peter.ujfalusi@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: Bard Liao yung-chuan.liao@linux.intel.com Reviewed-by: Rander Wang rander.wang@intel.com Link: https://lore.kernel.org/r/20221221102328.9635-2-peter.ujfalusi@linux.intel.com Signed-off-by: Mark Brown broonie@kernel.org

--

Commit: https://git.seco.com/clea-os/bsp/mediatek/linux-seco-mtk/-/commit/9a4fe5f0bda2b07ec04ed385ca9c72ca7dfb336e

UPSTREAM: ASoC: SOF: Add FW state to debugfs

Allow system health detection mechanisms to check the FW state, this will allow them to check if the FW is in its "crashed" state going forward to help automatically diagnose driver state.

Change-Id: I38868b84ac9c0b30c75bcad6afa6a2e5161f6684 Signed-off-by: Curtis Malainey cujomalainey@chromium.org Reviewed-by: Ranjani Sridharan ranjani.sridharan@linux.intel.com Reviewed-by: Pierre-Louis Bossart pierre-louis.bossart@linux.intel.com Reviewed-by: Péter Ujfalusi peter.ujfalusi@linux.intel.com Signed-off-by: Peter Ujfalusi peter.ujfalusi@linux.intel.com Link: https://lore.kernel.org/r/20221220125629.8469-4-peter.ujfalusi@linux.intel.com Signed-off-by: Mark Brown broonie@kernel.org

--

Commit: https://git.seco.com/clea-os/bsp/mediatek/linux-seco-mtk/-/commit/2f3cc52664070b503d783a5eba358808b7e77c09

UPSTREAM: ASoC: SOF: pm: Always tear down pipelines before DSP suspend

When the DSP is suspended while the firmware is in the crashed state, we skip tearing down the pipelines. This means that the widget reference counts will not get to reset to 0 before suspend. This will lead to errors with resuming audio after system resume. To fix this, invoke the tear_down_all_pipelines op before skipping to DSP suspend.

Change-Id: I15fb8c42493cca4dd30222b52d5e73dceed1b733 Signed-off-by: Ranjani Sridharan ranjani.sridharan@linux.intel.com Reviewed-by: Curtis Malainey cujomalainey@chromium.org Reviewed-by: Pierre-Louis Bossart pierre-louis.bossart@linux.intel.com Reviewed-by: Bard Liao yung-chuan.liao@linux.intel.com Reviewed-by: Péter Ujfalusi peter.ujfalusi@linux.intel.com Signed-off-by: Peter Ujfalusi peter.ujfalusi@linux.intel.com Link: https://lore.kernel.org/r/20221220125629.8469-3-peter.ujfalusi@linux.intel.com Signed-off-by: Mark Brown broonie@kernel.org

--

Commit: https://git.seco.com/clea-os/bsp/mediatek/linux-seco-mtk/-/commit/7ad69bc2a623d6a18bb12eac6e584798417331fc

UPSTREAM: ASoC: SOF: pm: Set target state earlier

If the DSP crashes before the system suspends, the setting of target state will be skipped because the firmware state will no longer be SOF_FW_BOOT_COMPLETE. This leads to the incorrect assumption that the DSP should suspend to D0I3 instead of suspending to D3. To fix this, set the target_state before we skip to DSP suspend even when the DSP has crashed.

Change-Id: I1424a432ada4a79b2326eada2743e38ea8f810f0 Signed-off-by: Ranjani Sridharan ranjani.sridharan@linux.intel.com Reviewed-by: Curtis Malainey cujomalainey@chromium.org Reviewed-by: Pierre-Louis Bossart pierre-louis.bossart@linux.intel.com Reviewed-by: Bard Liao yung-chuan.liao@linux.intel.com Reviewed-by: Péter Ujfalusi peter.ujfalusi@linux.intel.com Signed-off-by: Peter Ujfalusi peter.ujfalusi@linux.intel.com Link: https://lore.kernel.org/r/20221220125629.8469-2-peter.ujfalusi@linux.intel.com Signed-off-by: Mark Brown broonie@kernel.org

--

Commit: https://git.seco.com/clea-os/bsp/mediatek/linux-seco-mtk/-/commit/a4a75512c51a04c52ec85d043611e8c215340d41

UPSTREAM: ASoC: SOF: mediatek: initialize panic_info to zero

Coverity spotted that panic_info is not initialized to zero in mtk_adsp_dump. Using uninitialized value panic_info.linenum when calling snd_sof_get_status. Fix this coverity by initializing panic_info struct as zero.

Change-Id: Ib039ed4f1172ed570fbbf92ba6c4998a992d73f8 Signed-off-by: YC Hung yc.hung@mediatek.com Reviewed-by: Curtis Malainey cujomalainey@chromium.org Link: https://lore.kernel.org/r/20221213115617.25086-1-yc.hung@mediatek.com Signed-off-by: Mark Brown broonie@kernel.org

--

Commit: https://git.seco.com/clea-os/bsp/mediatek/linux-seco-mtk/-/commit/ba2d18fecadfebe81c3b3aa2c2cd1ee396bd5b35

UPSTREAM: ASoC: SOF: mediatek: add shutdown callback

If we do not shutdown the peripheral properly at shutdown, the whole system crashes after kexec() on the first io access.

Let's implement the appropriate callback.

Change-Id: I2ab5cef08850e823b9d1e950c8fe89c518c3bf59 Signed-off-by: Ricardo Ribalda ribalda@chromium.org Reviewed-by: AngeloGioacchino Del Regno angelogioacchino.delregno@collabora.com Link: https://lore.kernel.org/r/20221127-mtk-snd-v1-0-b7886faa612b@chromium.org Signed-off-by: Mark Brown broonie@kernel.org

--

Commit: https://git.seco.com/clea-os/bsp/mediatek/linux-seco-mtk/-/commit/de889fdf430285acf2625c87b1aa9491fb99f0f0

UPSTREAM: ASoC: SOF: Drop obsolete dependency on COMPILE_TEST

Since commit 0166dc11be91 ("of: make CONFIG_OF user selectable"), it is possible to test-build any driver which depends on OF on any architecture by explicitly selecting OF. Therefore depending on COMPILE_TEST as an alternative is no longer needed.

Change-Id: I9319aaefb4dc559eb330995d915354b08b1e70b6 Signed-off-by: Jean Delvare jdelvare@suse.de Link: https://lore.kernel.org/r/20221127193549.211bf8f7@endymion.delvare Signed-off-by: Mark Brown broonie@kernel.org

--

Commit: https://git.seco.com/clea-os/bsp/mediatek/linux-seco-mtk/-/commit/17d8f1c665b640dd0e390a45ed09e995a6bfcd89

UPSTREAM: ASoC: SOF: probes: Check ops before memory allocation

We may check ops before spending resources on memory allocation. While at it, utilize dev_get_platdata() helper.

Change-Id: Ib29e364679c8c58f6ed87f7d0671e6013352d920 Signed-off-by: Andy Shevchenko andriy.shevchenko@linux.intel.com Acked-by: Peter Ujfalusi peter.ujfalusi@linux.intel.com Link: https://lore.kernel.org/r/20221117103223.74425-1-andriy.shevchenko@linux.intel.com Signed-off-by: Mark Brown broonie@kernel.org

--

Commit: https://git.seco.com/clea-os/bsp/mediatek/linux-seco-mtk/-/commit/b363fe44058fa931818ec7a74022983f50c62649

BACKPORT: ASoC: SOF: topology: Add helper to get/put widget queue id

Add get/put queue id helper to manage queue id in route setup and route free.

The queue allocation rules are:

  • If widget only has one sink/source pin, zero will be returned as the queue ID directly.

  • If widget has more than one sink/source pins, and pin binding array is defined in topology, queue ID will be allocated according to the pin binding array.

  • If widget has more than one sink/sink pins, and pin binding array is not defined, Linux ID allocation will be used to allocate queue ID dynamically.

Change-Id: I94739b72be62243485e6408c0972c2d3fb6027a7 Signed-off-by: Chao Song chao.song@linux.intel.com Signed-off-by: Bard Liao yung-chuan.liao@linux.intel.com Suggested-by: Ranjani Sridharan ranjani.sridharan@linux.intel.com Reviewed-by: Pierre-Louis Bossart pierre-louis.bossart@linux.intel.com Reviewed-by: Rander Wang rander.wang@intel.com Reviewed-by: Péter Ujfalusi peter.ujfalusi@linux.intel.com Signed-off-by: Peter Ujfalusi peter.ujfalusi@linux.intel.com Link: https://lore.kernel.org/r/20221107085706.2550-4-peter.ujfalusi@linux.intel.com Signed-off-by: Mark Brown broonie@kernel.org

--

Commit: https://git.seco.com/clea-os/bsp/mediatek/linux-seco-mtk/-/commit/757d15203732508e9bcfe8acd6008970060c28c1

UPSTREAM: ASoC: SOF: Add support to parse pin binding array from topology

Add support for parsing sink/source pin binding array per widget from topology. The pin binding arrays will be used to determine the source and sink queue IDs during widget binding for widget that requires special pin binding.

An example of widget that requires special pin binding is the smart amplifier widget, its feedback sink pin has to be connected to a capture DAI copier for codec feedback, while the other sink pin has to be connected to a host DAI copier. Pin ID is required during widget binding for correct route setup.

Conversely, the pin ID for 'generic' pins is not defined in the topology and will be allocated by the kernel dynamically. When only one pin is supported, the pin ID shall always be zero. When more than one pin is supported, the pin ID is determined with the ID allocation mechanism in the kernel.

Change-Id: Ib5c32348972bd19a05e904f778bd64f6b1644548 Signed-off-by: Chao Song chao.song@linux.intel.com Signed-off-by: Bard Liao yung-chuan.liao@linux.intel.com Suggested-by: Ranjani Sridharan ranjani.sridharan@linux.intel.com Reviewed-by: Pierre-Louis Bossart pierre-louis.bossart@linux.intel.com Reviewed-by: Rander Wang rander.wang@intel.com Reviewed-by: Péter Ujfalusi peter.ujfalusi@linux.intel.com Signed-off-by: Peter Ujfalusi peter.ujfalusi@linux.intel.com Link: https://lore.kernel.org/r/20221107085706.2550-3-peter.ujfalusi@linux.intel.com Signed-off-by: Mark Brown broonie@kernel.org

--

Commit: https://git.seco.com/clea-os/bsp/mediatek/linux-seco-mtk/-/commit/6f5ea033cfcabee9ce64b12f3ca547d6390086fe

UPSTREAM: ASoC: SOF: Add support for parsing the number of sink/source pins

Add support for parsing the number of sink/source pins per widget from topology. They will be used to determine the sink/source queue IDs during widget binding.

Change-Id: Iece424d75ec595b1532f522e2582736062349ba2 Signed-off-by: Bard Liao yung-chuan.liao@linux.intel.com Signed-off-by: Chao Song chao.song@linux.intel.com Suggested-by: Ranjani Sridharan ranjani.sridharan@linux.intel.com Reviewed-by: Pierre-Louis Bossart pierre-louis.bossart@linux.intel.com Reviewed-by: Rander Wang rander.wang@intel.com Reviewed-by: Péter Ujfalusi peter.ujfalusi@linux.intel.com Signed-off-by: Peter Ujfalusi peter.ujfalusi@linux.intel.com Link: https://lore.kernel.org/r/20221107085706.2550-2-peter.ujfalusi@linux.intel.com Signed-off-by: Mark Brown broonie@kernel.org

--

Commit: https://git.seco.com/clea-os/bsp/mediatek/linux-seco-mtk/-/commit/3dae70fb9ba75cc2241de8cf26bf12d1bf10d716

UPSTREAM: ASoC: SOF: topology: No need to assign core ID if token parsing failed

Move the return value check before attempting to assign the core ID to the swidget since we are going to fail the sof_widget_ready() and free up swidget anyways.

Fixes: 909dadf21aae ("ASoC: SOF: topology: Make DAI widget parsing IPC agnostic")

Change-Id: Icc3402fb2d48e852089ac2e4bcf0597d4ef74584 Signed-off-by: Peter Ujfalusi peter.ujfalusi@linux.intel.com Reviewed-by: Pierre-Louis Bossart pierre-louis.bossart@linux.intel.com Reviewed-by: Ranjani Sridharan ranjani.sridharan@linux.intel.com Link: https://lore.kernel.org/r/20221107090433.5146-1-peter.ujfalusi@linux.intel.com Signed-off-by: Mark Brown broonie@kernel.org

--

Commit: https://git.seco.com/clea-os/bsp/mediatek/linux-seco-mtk/-/commit/1e494b499510102df2edf37c9463bdfac0430bee

UPSTREAM: ASoC: SOF: ipc3-topology: use old pipeline teardown flow with SOF2.1 and older

Originally in commit b2ebcf42a48f ("ASoC: SOF: free widgets in sof_tear_down_pipelines() for static pipelines"), freeing of pipeline components at suspend was only done with recent FW as there were known limitations in older firmware versions.

Tests show that if static pipelines are used, i.e. all pipelines are setup whenever firmware is powered up, the reverse action of freeing all components at power down, leads to firmware failures with also SOF2.0 and SOF2.1 based firmware.

The problems can be specific to certain topologies with e.g. components not prepared to be freed at suspend (as this did not happen with older SOF kernels).

To avoid hitting these problems when kernel is upgraded and used with an older firmware, bump the firmware requirement to SOF2.2 or newer. If an older firmware is used, and pipeline is a static one, do not free the components at suspend. This ensures the suspend flow remains backwards compatible with older firmware versions. This limitation does not apply if the product configuration is updated to dynamic pipelines.

The limitation is not linked to firmware ABI, as the interface to free pipeline components has been available already before ABI3.19. The problem is in the implementation, so firmware version should be used to decide whether it is safe to use the newer flow or not. This patch adds a new SOF_FW_VER() macro to compare SOF firmware release versions.

Link: https://github.com/thesofproject/sof/issues/6475 Change-Id: I4c227929657195926115468c23a147d93f4f5370 Signed-off-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 Reviewed-by: Péter Ujfalusi peter.ujfalusi@linux.intel.com Link: https://lore.kernel.org/r/20221101114913.1292671-1-kai.vehmanen@linux.intel.com Signed-off-by: Mark Brown broonie@kernel.org

--

Commit: https://git.seco.com/clea-os/bsp/mediatek/linux-seco-mtk/-/commit/295786ae307b74126461465af4ff24c334e837c5

BACKPORT: 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/ Change-Id: Id73c9c6807641c637d4cac20ff63e499f308608e 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

--

Commit: https://git.seco.com/clea-os/bsp/mediatek/linux-seco-mtk/-/commit/b84da85781d9576d5bbe7a862276d1958940517c

BACKPORT: 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

Do not add changes related to CONFIG_SND_SOC_SOF_INTEL_IPC4 and sof-client-probes-ipc4.c. Change-Id: I3931d9831cd94c61331cc59b52da059ac2ec6696 Signed-off-by: Suhrid Subramaniam suhrid.subramaniam@mediatek.com

--

Commit: https://git.seco.com/clea-os/bsp/mediatek/linux-seco-mtk/-/commit/98220f0d56896372c7b6bd9ea8a6fcbb40c462b7

UPSTREAM: ASoC: SOF: client: Add sof_client_ipc_set_get_data()

No need to duplicate set_get_data msg handling in clients.

Change-Id: Ib9496c12391b141eb3f63b18e72b1326f5c9ee25 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

--

Commit: https://git.seco.com/clea-os/bsp/mediatek/linux-seco-mtk/-/commit/ff22303350b3ae4e919ceca68485b83874038a67

UPSTREAM: 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.

Change-Id: I7f9035eb26e6aa86352e2a386cb53555a4c377e5 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

--

Commit: https://git.seco.com/clea-os/bsp/mediatek/linux-seco-mtk/-/commit/d7974226e011c32aef0191eb7c2ed3d8cbadb218

UPSTREAM: 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.

Change-Id: Ifdf5f4841619fec99a72ca59fe34c198d5fa196e 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

--

Commit: https://git.seco.com/clea-os/bsp/mediatek/linux-seco-mtk/-/commit/9a97de62465acad2621d2f0fbcae16845acc7df4

BACKPORT: 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).

Change-Id: Id323c8d1aa072f0a26af1fac5bf68a857b6749b3 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

--

Commit: https://git.seco.com/clea-os/bsp/mediatek/linux-seco-mtk/-/commit/c36ce822481a5f9b48320f70f88b212ec8c39727

UPSTREAM: ASoC: SOF: ops: add snd_sof_dsp_updateb() helper

Add missing helper in SOF toolbox.

Change-Id: I0b4525a89913412ec4cda54b9454bdf9e3617685 Signed-off-by: Pierre-Louis Bossart pierre-louis.bossart@linux.intel.com Reviewed-by: Ranjani Sridharan ranjani.sridharan@linux.intel.com Reviewed-by: Rander Wang rander.wang@intel.com Reviewed-by: Péter Ujfalusi peter.ujfalusi@linux.intel.com Link: https://lore.kernel.org/r/20221024165310.246183-5-pierre-louis.bossart@linux.intel.com Signed-off-by: Mark Brown broonie@kernel.org

--

Commit: https://git.seco.com/clea-os/bsp/mediatek/linux-seco-mtk/-/commit/278537ec3d71d87f927187c6e87aeabb10402389

UPSTREAM: ASoC: SOF: ops: add readb/writeb helpers

These will be used to add more consistency in the SOF core and drivers.

Change-Id: I87f4613195fab1b2e9d23f738081349a1cf08251 Signed-off-by: Pierre-Louis Bossart pierre-louis.bossart@linux.intel.com Reviewed-by: Ranjani Sridharan ranjani.sridharan@linux.intel.com Reviewed-by: Rander Wang rander.wang@intel.com Reviewed-by: Péter Ujfalusi peter.ujfalusi@linux.intel.com Link: https://lore.kernel.org/r/20221024165310.246183-4-pierre-louis.bossart@linux.intel.com Signed-off-by: Mark Brown broonie@kernel.org

--

Commit: https://git.seco.com/clea-os/bsp/mediatek/linux-seco-mtk/-/commit/852f70ef97d56b03cbd16760b4bddcf43ed708e6

UPSTREAM: ASoC: SOF: ops: fallback to mmio in helpers

Returning an error when a read/write is not implemented makes no sense, especially on read where no return value makes sense.

Change the logic to directly fallback to mmio. If a platform truly wants other read/writes that are not plain vanilla mmio, it needs to implement its own routines.

Change-Id: I1712f5194ac66a74160c0b463212493a5dc8c850 Signed-off-by: Pierre-Louis Bossart pierre-louis.bossart@linux.intel.com Reviewed-by: Ranjani Sridharan ranjani.sridharan@linux.intel.com Reviewed-by: Rander Wang rander.wang@intel.com Reviewed-by: Péter Ujfalusi peter.ujfalusi@linux.intel.com Link: https://lore.kernel.org/r/20221024165310.246183-2-pierre-louis.bossart@linux.intel.com Signed-off-by: Mark Brown broonie@kernel.org

--

Commit: https://git.seco.com/clea-os/bsp/mediatek/linux-seco-mtk/-/commit/563658877b86ef6e54612c69c5d2a4c50689762a

UPSTREAM: ASoC: SOF: loader: Remove the query_fw_configuration ops

The query_fw_configuration callback is redundant and the only user of it was converted to use the generic post_fw_boot ops.

Change-Id: I312953c46b3105199d98ddb0c2617ffc8f214751 Signed-off-by: Peter Ujfalusi peter.ujfalusi@linux.intel.com Reviewed-by: Ranjani Sridharan ranjani.sridharan@linux.intel.com Reviewed-by: Pierre-Louis Bossart pierre-louis.bossart@linux.intel.com Reviewed-by: Chao Song chao.song@intel.com Reviewed-by: Kai Vehmanen kai.vehmanen@linux.intel.com Link: https://lore.kernel.org/r/20221020121238.18339-19-peter.ujfalusi@linux.intel.com Signed-off-by: Mark Brown broonie@kernel.org

--

Commit: https://git.seco.com/clea-os/bsp/mediatek/linux-seco-mtk/-/commit/32ad8c9de2a5885b1f395fedd1a8e699bd645ac6

UPSTREAM: ASoC: SOF: loader: Add support for IPC dependent post firmware boot ops

Add support for executing IPC dependent tasks after a successful firmware boot.

The new post_fw_boot ops can make the fw_loader query_fw_configuration callback redundant as IPC code can handle the first boot internally.

Change-Id: I3bc2bfa132ccc7558aa41e2c795e98d50842440e Signed-off-by: Peter Ujfalusi peter.ujfalusi@linux.intel.com Reviewed-by: Ranjani Sridharan ranjani.sridharan@linux.intel.com Reviewed-by: Pierre-Louis Bossart pierre-louis.bossart@linux.intel.com Reviewed-by: Chao Song chao.song@intel.com Reviewed-by: Kai Vehmanen kai.vehmanen@linux.intel.com Link: https://lore.kernel.org/r/20221020121238.18339-17-peter.ujfalusi@linux.intel.com Signed-off-by: Mark Brown broonie@kernel.org

--

Commit: https://git.seco.com/clea-os/bsp/mediatek/linux-seco-mtk/-/commit/45a48d1dea14aebced1ae2be3b2b9bd641e002ae

BACKPORT: ASoC: SOF: Add path definition for external firmware libraries

IPC4 based firmware supports dynamically loaded external libraries. The libraries will be not stored alongside of the firmware or tplg files.

For intel platforms the default path will be: intel/avs-lib|sof-ipc4-lib// if a community key is used on the given machine then the libraries will be under 'community' directory, like it is done for the firmware itself.

Change-Id: I84ffd2643196af78851aebf238a67857b169719b Signed-off-by: Peter Ujfalusi peter.ujfalusi@linux.intel.com Reviewed-by: Ranjani Sridharan ranjani.sridharan@linux.intel.com Reviewed-by: Pierre-Louis Bossart pierre-louis.bossart@linux.intel.com Reviewed-by: Chao Song chao.song@intel.com Reviewed-by: Kai Vehmanen kai.vehmanen@linux.intel.com Link: https://lore.kernel.org/r/20221020121238.18339-12-peter.ujfalusi@linux.intel.com Signed-off-by: Mark Brown broonie@kernel.org

--

Commit: https://git.seco.com/clea-os/bsp/mediatek/linux-seco-mtk/-/commit/f6dd35f6a911501628c6610e200206f38fe518f2

UPSTREAM: ASoC: SOF: ipc: ops: Add support for optional init and exit callbacks

Add support for IPC specific initialization (init) and cleanup (exit) callback.

These callbacks can be used by IPC implementation to do basic initialization and cleanup.

Change-Id: Ifdd04c9ef7217c352ce6719b94985c1b998d843c Signed-off-by: Peter Ujfalusi peter.ujfalusi@linux.intel.com Reviewed-by: Ranjani Sridharan ranjani.sridharan@linux.intel.com Reviewed-by: Pierre-Louis Bossart pierre-louis.bossart@linux.intel.com Reviewed-by: Chao Song chao.song@intel.com Reviewed-by: Kai Vehmanen kai.vehmanen@linux.intel.com Link: https://lore.kernel.org/r/20221020121238.18339-8-peter.ujfalusi@linux.intel.com Signed-off-by: Mark Brown broonie@kernel.org

--

Commit: https://git.seco.com/clea-os/bsp/mediatek/linux-seco-mtk/-/commit/1b327c4f32bf29bcbb58b23f1f6c040a50a050d8

UPSTREAM: ASoC: SOF: Drop the firmware and fw_offset from snd_sof_pdata

The SOF stack now uses the sdev->basefw to work with the SOF firmware, the information from plat_data can be dropped.

Change-Id: I1eb7debc35c9b8181cecc1f3a0ca40de1a00bf34 Signed-off-by: Peter Ujfalusi peter.ujfalusi@linux.intel.com Reviewed-by: Ranjani Sridharan ranjani.sridharan@linux.intel.com Reviewed-by: Pierre-Louis Bossart pierre-louis.bossart@linux.intel.com Reviewed-by: Chao Song chao.song@intel.com Reviewed-by: Kai Vehmanen kai.vehmanen@linux.intel.com Link: https://lore.kernel.org/r/20221020121238.18339-7-peter.ujfalusi@linux.intel.com Signed-off-by: Mark Brown broonie@kernel.org

--

Commit: https://git.seco.com/clea-os/bsp/mediatek/linux-seco-mtk/-/commit/ee649d0ac7d9dfce9e66d293e8b36621f15c029b

BACKPORT: ASoC: SOF: Introduce container struct for SOF firmware

Move the firmware related information under a new struct (sof_firmware) and add it to the high level snd_sof_dev struct.

Convert the generic code to use this new container when working with the basefw and for compatibility reasons set the old plat_data members used by the platforms.

Change-Id: I6a73e609802a37f67eb5b14b79edd538709f022d Signed-off-by: Peter Ujfalusi peter.ujfalusi@linux.intel.com Reviewed-by: Ranjani Sridharan ranjani.sridharan@linux.intel.com Reviewed-by: Pierre-Louis Bossart pierre-louis.bossart@linux.intel.com Reviewed-by: Chao Song chao.song@intel.com Reviewed-by: Kai Vehmanen kai.vehmanen@linux.intel.com Link: https://lore.kernel.org/r/20221020121238.18339-3-peter.ujfalusi@linux.intel.com Signed-off-by: Mark Brown broonie@kernel.org

--

Commit: https://git.seco.com/clea-os/bsp/mediatek/linux-seco-mtk/-/commit/30710ae5e979eaa9f7fffc30c16d501cb2eb4fc4

UPSTREAM: ASoC: SOF: loader: Set complete state before post_fw_run op

Set the FW state to complete right after boot is complete. This enables sending IPC's in the post_fw_run op. This will be needed to support reloading 3rd party module libraries after firmware boot.

Change-Id: Ibc59e5a10590959db8baad0f80f6cebf6d3b27c2 Signed-off-by: Ranjani Sridharan ranjani.sridharan@linux.intel.com Signed-off-by: Peter Ujfalusi peter.ujfalusi@linux.intel.com Reviewed-by: Ranjani Sridharan ranjani.sridharan@linux.intel.com Reviewed-by: Pierre-Louis Bossart pierre-louis.bossart@linux.intel.com Reviewed-by: Chao Song chao.song@intel.com Reviewed-by: Kai Vehmanen kai.vehmanen@linux.intel.com Link: https://lore.kernel.org/r/20221020121238.18339-2-peter.ujfalusi@linux.intel.com Signed-off-by: Mark Brown broonie@kernel.org

--

Commit: https://git.seco.com/clea-os/bsp/mediatek/linux-seco-mtk/-/commit/71468ebec7f42e35b38412b8e8c580d9b45da359

UPSTREAM: ASoC: soc-dapm.c: replace snd_soc_dapm_wcache to snd_soc_dapm_widget

Current ASoC has snd_soc_dapm_wcache, but its member is only snd_soc_dapm_widget.

struct snd_soc_dapm_wcache {
	struct snd_soc_dapm_widget *widget;
};

It is no meaning for now, and makes code unreadable. This patch replace snd_soc_dapm_wcache to snd_soc_dapm_widget directly.

Change-Id: I40dc9824aa91e437cce989b42ea4080d65833463 Signed-off-by: Kuninori Morimoto kuninori.morimoto.gx@renesas.com Reviewed-by: Amadeusz Sławiński amadeuszx.slawinski@linux.intel.com Link: https://lore.kernel.org/r/87a65stztf.wl-kuninori.morimoto.gx@renesas.com Signed-off-by: Mark Brown broonie@kernel.org

--

Commit: https://git.seco.com/clea-os/bsp/mediatek/linux-seco-mtk/-/commit/7733c2f163b2b69d90934c23f6b24dc412802b89

UPSTREAM: ASoC: SOF: ipc3: Log the tx message before sending it

It makes more sense to log the message before it is sent to the DSP.

Change-Id: I10df2bafc8d064e07688b00d2f2b2ac1e3742709 Signed-off-by: Peter Ujfalusi peter.ujfalusi@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: Bard Liao yung-chuan.liao@linux.intel.com Link: https://lore.kernel.org/r/20221018133843.16958-1-peter.ujfalusi@linux.intel.com Signed-off-by: Mark Brown broonie@kernel.org

--

Commit: https://git.seco.com/clea-os/bsp/mediatek/linux-seco-mtk/-/commit/76ddf3d50955f80ad8288b3e17884a4149870f86

UPSTREAM: ASoC: SOF: mediatek: mt8195: Add pcm_pointer callback

Add pcm_pointer callback for mt8195 to support read host position from DSP

Change-Id: Ic0643d171ec1698433d8a521724f351d60f8c77f Signed-off-by: Chunxu Li chunxu.li@mediatek.com Reviewed-by: AngeloGioacchino Del Regno angelogioacchino.delregno@collabora.com Link: https://lore.kernel.org/r/20220924033559.26599-3-chunxu.li@mediatek.com Signed-off-by: Mark Brown broonie@kernel.org

--

Commit: https://git.seco.com/clea-os/bsp/mediatek/linux-seco-mtk/-/commit/340e74fc6c6a8c1f03854d3a6d22a44bc336b334

UPSTREAM: ASoC: SOF: mediatek: mt8195: Add pcm_hw_params callback

Add pcm_hw_params callback for mt8195 to support continue update dma host position

Change-Id: I7aad406525a81d47058291e808b713497a9f6f39 Signed-off-by: Chunxu Li chunxu.li@mediatek.com Reviewed-by: AngeloGioacchino Del Regno angelogioacchino.delregno@collabora.com Link: https://lore.kernel.org/r/20220924033559.26599-2-chunxu.li@mediatek.com Signed-off-by: Mark Brown broonie@kernel.org

--

Commit: https://git.seco.com/clea-os/bsp/mediatek/linux-seco-mtk/-/commit/32de751804474c16cd7d1a6034c591a438f3fcfe

UPSTREAM: ASoC: SOF: mediatek: add pcm_pointer callback for mt8186

add pcm_pointer callback for mt8186 to support read host position from DSP

Change-Id: I3caec4c29f9f313e313a5b6495bcf86713a66a47 Signed-off-by: Chunxu Li chunxu.li@mediatek.com Reviewed-by: AngeloGioacchino Del Regno angelogioacchino.delregno@collabora.com Link: https://lore.kernel.org/r/20220921120239.31934-1-chunxu.li@mediatek.com Signed-off-by: Mark Brown broonie@kernel.org

--

Commit: https://git.seco.com/clea-os/bsp/mediatek/linux-seco-mtk/-/commit/b7c55d8fa5752df512c9c214e2af51f631d28d66

UPSTREAM: ASoC: SOF: don't unprepare widget used other pipelines

If multiple pipeline are mixed into one, we can't unprepare the widget used by other pipelines. This patch checks use_count to address this case.

Reviewed-by: Bard Liao yung-chuan.liao@linux.intel.com Reviewed-by: Ranjani Sridharan ranjani.sridharan@linux.intel.com Change-Id: Ic85f9507f2261e498f3ba832729fe3cdd915e7d0 Signed-off-by: Rander Wang rander.wang@intel.com Signed-off-by: Pierre-Louis Bossart pierre-louis.bossart@linux.intel.com Link: https://lore.kernel.org/r/20220920150107.2090695-3-pierre-louis.bossart@linux.intel.com Signed-off-by: Mark Brown broonie@kernel.org

--

Commit: https://git.seco.com/clea-os/bsp/mediatek/linux-seco-mtk/-/commit/4578e34ee45304e82181081d4038e6851efbda1c

UPSTREAM: ASoC: SOF: clear prepare state when widget is unprepared

Playback can't work after the first try sometimes. The reason is that some widgets don't have ipc_unprepare ops and driver will jump to sink_prepare so miss to set prepare state to false. Next time these widgets will not be prepared and it will result to error with different format of audio file since the last setting is not applicable.

This patch makes sure that widget prepare state will be cleared to false when it is unprepared.

Reviewed-by: Bard Liao yung-chuan.liao@linux.intel.com Reviewed-by: Ranjani Sridharan ranjani.sridharan@linux.intel.com Change-Id: If4f6ac34283a2536c4d62e521a52db81612a08af Signed-off-by: Rander Wang rander.wang@intel.com Signed-off-by: Pierre-Louis Bossart pierre-louis.bossart@linux.intel.com Link: https://lore.kernel.org/r/20220920150107.2090695-2-pierre-louis.bossart@linux.intel.com Signed-off-by: Mark Brown broonie@kernel.org

--

Commit: https://git.seco.com/clea-os/bsp/mediatek/linux-seco-mtk/-/commit/7920f48adb648fdcfd1c02eb642aba08e2afa54b

BACKPORT: ASoC: soc.h: remove num_cpus/codecs

Current rtd has both dai_link pointer (A) and num_cpus/codecs (B).

(A) rtd->dai_link = dai_link; (B) rtd->num_cpus = dai_link->num_cpus; (B) rtd->num_codecs = dai_link->num_codecs;

But, we can get num_cpus/codecs (B) via dai_link (A). This means we don't need to keep num_cpus/codecs on rtd. This patch removes these.

Change-Id: I3ac372c6373d7758a0e38b4792b4325b6c1cf51b Signed-off-by: Kuninori Morimoto kuninori.morimoto.gx@renesas.com Link: https://lore.kernel.org/r/87sfkmv9n3.wl-kuninori.morimoto.gx@renesas.com Signed-off-by: Mark Brown broonie@kernel.org

--

Commit: https://git.seco.com/clea-os/bsp/mediatek/linux-seco-mtk/-/commit/288ea19e3354a5e7a8893e1887651665a6029a9a

UPSTREAM: ASoC: SOF: mediatek: add pcm_hw_params callback for mt8186

add pcm_hw_params callback for mt8186 to support continue update dma host position

Change-Id: Ib071b9565144c782b8e69842e1e8c47070c2c91a Signed-off-by: Chunxu Li chunxu.li@mediatek.com Link: https://lore.kernel.org/r/20220917022610.594-1-chunxu.li@mediatek.com Signed-off-by: Mark Brown broonie@kernel.org

--

Commit: https://git.seco.com/clea-os/bsp/mediatek/linux-seco-mtk/-/commit/63423382f2b4ec9728b4053f3149dada4edb289c

BACKPORT: ASoC: SOF: add quirk to override topology mclk_id

Some Intel-based platforms rely on a topology file that hard-codes the use of MCLK0. This is incorrect in 10% of the cases. Rather than generating yet another set of topology files, this patch adds a kernel module parameter to override the topology value.

In hindsight, we should never have allowed mclks to be specified in topology, this is a hardware-level information that should not have been visible in the topology.

Future patches will try to set this value automagically, e.g. by parsing the NHLT content.

Change-Id: I87a18a700108cc21fd47f9506cb3c1be8006a313 Signed-off-by: Pierre-Louis Bossart pierre-louis.bossart@linux.intel.com Reviewed-by: Kai Vehmanen kai.vehmanen@linux.intel.com Reviewed-by: Bard Liao yung-chuan.liao@linux.intel.com Link: https://lore.kernel.org/r/20220919115350.43104-3-pierre-louis.bossart@linux.intel.com Signed-off-by: Mark Brown broonie@kernel.org

--

Commit: https://git.seco.com/clea-os/bsp/mediatek/linux-seco-mtk/-/commit/5542bcd6aadbe1edbf732ce9aabc0d5f09910224

UPSTREAM: ASoC: SOF: pci: Change DMI match info to support all Chrome platforms

In some Chrome platforms if OEM's use their own string as SYS_VENDOR than "Google", it leads to firmware load failure from intel/sof/community path.

Hence, changing SYS_VENDOR to PRODUCT_FAMILY in which "Google" is used as common prefix and is supported in all Chrome platforms.

Reviewed-by: Ranjani Sridharan ranjani.sridharan@linux.intel.com Reviewed-by: Chao Song chao.song@intel.com Reviewed-by: Curtis Malainey curtis@malainey.com Change-Id: If03d06cd6d45da619953f87354540d780432bb87 Signed-off-by: Jairaj Arava jairaj.arava@intel.com Signed-off-by: Curtis Malainey cujomalainey@chromium.org Signed-off-by: Sathyanarayana Nujella sathyanarayana.nujella@intel.com Signed-off-by: Pierre-Louis Bossart pierre-louis.bossart@linux.intel.com Link: https://lore.kernel.org/r/20220919114429.42700-1-pierre-louis.bossart@linux.intel.com Signed-off-by: Mark Brown broonie@kernel.org

--

Commit: https://git.seco.com/clea-os/bsp/mediatek/linux-seco-mtk/-/commit/1f96b9e9a50bd43dc763ab73333707f0719b9510

UPSTREAM: ASoC: SOF: replace dev_vdbg with tracepoints

This patch removes unneeded dev_vdbg calls and replaces remaining ones with tracepoints to reduce overhead and enable use of trace collection and analysis tools.

Change-Id: I5f8c1c1bba933d5ee8bc0c92c055acfed89e5f9f Signed-off-by: Noah Klayman noah.klayman@intel.com Reviewed-by: Pierre-Louis Bossart pierre-louis.bossart@linux.intel.com Reviewed-by: Bard Liao yung-chuan.liao@linux.intel.com Reviewed-by: Péter Ujfalusi peter.ujfalusi@linux.intel.com Link: https://lore.kernel.org/r/20220919122108.43764-7-pierre-louis.bossart@linux.intel.com Signed-off-by: Mark Brown broonie@kernel.org

--

Commit: https://git.seco.com/clea-os/bsp/mediatek/linux-seco-mtk/-/commit/fdc7665205ca50a2e01565f543adffb3ef14d44e

UPSTREAM: ASoC: SOF: remove unneeded dev_vdbg

This patch removes some unneeded dev_vdbg calls.

Reviewed-by: Bard Liao yung-chuan.liao@linux.intel.com Reviewed-by: Péter Ujfalusi peter.ujfalusi@linux.intel.com Change-Id: Ia26be8728726bdcb00bfc9db6516ac2a104ccc2a Signed-off-by: Noah Klayman noah.klayman@intel.com Signed-off-by: Pierre-Louis Bossart pierre-louis.bossart@linux.intel.com Link: https://lore.kernel.org/r/20220919122108.43764-5-pierre-louis.bossart@linux.intel.com Signed-off-by: Mark Brown broonie@kernel.org

--

Commit: https://git.seco.com/clea-os/bsp/mediatek/linux-seco-mtk/-/commit/7c004f76be7e772f6844ca1556a6c95217140d4e

UPSTREAM: ASoC: SOF: add widget setup/free tracing

Enables tracking of use_count during widget setup and free routines. Useful for debugging unbalanced use_counts during suspend/resume.

Reviewed-by: Péter Ujfalusi peter.ujfalusi@linux.intel.com Change-Id: I07db5fe460b0b45c33a1be9a65a296f9dff6a8e4 Signed-off-by: Noah Klayman noah.klayman@intel.com Signed-off-by: Bard Liao yung-chuan.liao@linux.intel.com Signed-off-by: Pierre-Louis Bossart pierre-louis.bossart@linux.intel.com Link: https://lore.kernel.org/r/20220919122108.43764-2-pierre-louis.bossart@linux.intel.com Signed-off-by: Mark Brown broonie@kernel.org

--

Commit: https://git.seco.com/clea-os/bsp/mediatek/linux-seco-mtk/-/commit/d3b43ad14ea10a12c52dfa1d71987a62aad4ccb4

UPSTREAM: ASoC: SOF: mediatek: mt8195: Add devicetree support to select topologies

Support devicetree by adding a snd_soc_of_mach array, specifying SOF topologies for a generic MT8195 machine and for Google Tomato Chromebooks.

Change-Id: I1f4b1e32837705b5102af50d65d507774ac5c0dc Signed-off-by: AngeloGioacchino Del Regno angelogioacchino.delregno@collabora.com Link: https://lore.kernel.org/r/20220906092727.37324-6-angelogioacchino.delregno@collabora.com Signed-off-by: Mark Brown broonie@kernel.org

--

Commit: https://git.seco.com/clea-os/bsp/mediatek/linux-seco-mtk/-/commit/e712a0c93beda73e5cc8b5520f072aef47d44ec0

UPSTREAM: ASoC: SOF: mediatek: mt8195: Add generic pcm_{open,close} callbacks

Use the generic sof_stream_pcm_{open,close}() functions for the pcm_{open,close} callbacks.

Change-Id: Ia044f34dd67869491641024997f74c4cbbf4ff79 Signed-off-by: AngeloGioacchino Del Regno angelogioacchino.delregno@collabora.com Link: https://lore.kernel.org/r/20220906092727.37324-5-angelogioacchino.delregno@collabora.com Signed-off-by: Mark Brown broonie@kernel.org

--

Commit: https://git.seco.com/clea-os/bsp/mediatek/linux-seco-mtk/-/commit/3ffe8ef21911addeb76acba16cad7458adbc2f9c

UPSTREAM: ASoC: SOF: mediatek: mt8195: Add mailbox generic callbacks for IPC

Add the .mailbox_{read,write} generic callbacks for SOF IPC and, while at it, also change the ipc_msg_data callback to use the SOF API sof_ipc_msg_data() instead of the custom function mt8195_ipc_msg_data().

Change-Id: Iff188e54997332ae586b14eb907e12d98ecdf3b9 Signed-off-by: AngeloGioacchino Del Regno angelogioacchino.delregno@collabora.com Link: https://lore.kernel.org/r/20220906092727.37324-4-angelogioacchino.delregno@collabora.com Signed-off-by: Mark Brown broonie@kernel.org

--

Commit: https://git.seco.com/clea-os/bsp/mediatek/linux-seco-mtk/-/commit/4907c29f813751e31788f39ba0bb70fcf16b6d15

UPSTREAM: ASoC: SOF: mediatek: mt8195: Import namespace SND_SOC_SOF_MTK_COMMON

Here we're using function mtk_adsp_dump() from mtk-adsp-common: explicitly import its namespace.

Fixes: 3a054f90e955 ("ASoC: SOF: mediatek: Add mt8195 debug dump") Change-Id: I3043c77f95561f9b0d14bf683d7d7a24fbe97d9c Signed-off-by: AngeloGioacchino Del Regno angelogioacchino.delregno@collabora.com Link: https://lore.kernel.org/r/20220906092727.37324-3-angelogioacchino.delregno@collabora.com Signed-off-by: Mark Brown broonie@kernel.org

--

Commit: https://git.seco.com/clea-os/bsp/mediatek/linux-seco-mtk/-/commit/9fca3d87f3a6d1771719e27f72f34782bc00ced4

UPSTREAM: ASoC: SOF: Remove strsplit_u32() and tokenize_input()

Make use of global integer-array parsing helper instead of the internal one as both serve same purpose. With that, both strsplit_u32() and tokenize_input() become unused so remove them.

Reviewed-by: Andy Shevchenko andy.shevchenko@gmail.com Change-Id: Ic2006512c995d6d25b01c162620a35bd29c97dba Signed-off-by: Cezary Rojewski cezary.rojewski@intel.com Link: https://lore.kernel.org/r/20220904102840.862395-3-cezary.rojewski@intel.com Signed-off-by: Mark Brown broonie@kernel.org

--

Commit: https://git.seco.com/clea-os/bsp/mediatek/linux-seco-mtk/-/commit/e8be1269b198deffc1decf879caa9e9a82b30d2a

UPSTREAM: ASoC: SOF: Introduce function sof_of_machine_select

From current design in sof_machine_check the SOF can only support ACPI type machine.

In sof_machine_check if there is no ACPI machine exist, the function will return -ENODEV directly, that's we don't expected if we do not base on ACPI machine.

So we add a new function named sof_of_machine_select that we can pass sof_machine_check and obtain info required by snd_sof_new_platform_drv.

Change-Id: I86a41dc55a3fe8eb6df09dc705e2a0f5b284df0b Signed-off-by: Chunxu Li chunxu.li@mediatek.com Reviewed-by: AngeloGioacchino Del Regno angelogioacchino.delregno@collabora.com Link: https://lore.kernel.org/r/20220903032151.13664-1-chunxu.li@mediatek.com Signed-off-by: Mark Brown broonie@kernel.org

--

Commit: https://git.seco.com/clea-os/bsp/mediatek/linux-seco-mtk/-/commit/1f175f3cdd43bb3d93efc20958913504fdadfec6

UPSTREAM: ASoC: SOF: Introduce function sof_of_machine_select

From current design in sof_machine_check and snd_sof_new_platform_drv, the SOF can only support ACPI type machine.

  1. In sof_machine_check if there is no ACPI machine exist, the function will return -ENODEV directly, that's we don't expected if we do not base on ACPI machine.

  2. In snd_sof_new_platform_drv the component driver need a driver name to do ignore_machine, currently the driver name is obtained from machine->drv_name, and the type of machine is snd_soc_acpi_mach.

So we add a new function named sof_of_machine_select that we can pass sof_machine_check and obtain info required by snd_sof_new_platform_drv.

Change-Id: Ia6db429f98aea64b503f2fac9bf5acc00b7e9b55 Signed-off-by: Chunxu Li chunxu.li@mediatek.com Link: https://lore.kernel.org/r/20220805070449.6611-2-chunxu.li@mediatek.com Signed-off-by: Mark Brown broonie@kernel.org

--

Commit: https://git.seco.com/clea-os/bsp/mediatek/linux-seco-mtk/-/commit/9b380dc6a83710669ecc42eb30c42496799a5909

UPSTREAM: ASoC: SOF: compress: Add copy function for capture case

Added a new copy function used to copy data to user buffer in the case of compress capture.

Reviewed-by: Paul Olaru paul.olaru@nxp.com Reviewed-by: Daniel Baluta daniel.baluta@nxp.com Change-Id: I581aaba89d0bc13ed691b6bb3af3c01ff59e0f15 Signed-off-by: Laurentiu Mihalcea laurentiu.mihalcea@nxp.com Link: https://lore.kernel.org/r/20220822101502.17644-3-laurentiu.mihalcea@nxp.com Signed-off-by: Mark Brown broonie@kernel.org

--

Commit: https://git.seco.com/clea-os/bsp/mediatek/linux-seco-mtk/-/commit/2e7c3daf678079f38d8a159fd086581139637875

UPSTREAM: ASoC: SOF: compress: Move sof_compr_copy functionality

Since we're preparing to add support for compress capture, we need to move the content of sof_compr_copy into a separate function which handles the playback direction just like the initial sof_compr_copy.

Reviewed-by: Paul Olaru paul.olaru@nxp.com Reviewed-by: Daniel Baluta daniel.baluta@nxp.com Change-Id: Ic3418f268161a8a10cd60e3617c46dcfaf6a080d Signed-off-by: Laurentiu Mihalcea laurentiu.mihalcea@nxp.com Link: https://lore.kernel.org/r/20220822101502.17644-2-laurentiu.mihalcea@nxp.com Signed-off-by: Mark Brown broonie@kernel.org

--

Commit: https://git.seco.com/clea-os/bsp/mediatek/linux-seco-mtk/-/commit/e0835e339695974429e2ab2eb57376b7345da305

UPSTREAM: ASoC: SOF: mediatek: Use generic implementation for .ipc_msg_data field

Use generic sof_ipc_msg_data instead of specific implementation as they do the same things

Change-Id: I6a0d7b29e21496204370a99c225dfb1ccb765a0f Signed-off-by: Chunxu Li chunxu.li@mediatek.com Link: https://lore.kernel.org/r/20220825065411.31279-4-chunxu.li@mediatek.com Signed-off-by: Mark Brown broonie@kernel.org

--

Commit: https://git.seco.com/clea-os/bsp/mediatek/linux-seco-mtk/-/commit/da9f84274111c690f7d345b47daec1beb23dd49e

UPSTREAM: ASoC: SOF: mediatek: add snd_sof_dsp_ops callbacks for pcm and mail box

Use generic IPC stream and mailbox ops for mt8186

Change-Id: If47b41e905f7ff5e864c28ca0be48d722429ab20 Signed-off-by: Chunxu Li chunxu.li@mediatek.com Link: https://lore.kernel.org/r/20220825065411.31279-3-chunxu.li@mediatek.com Signed-off-by: Mark Brown broonie@kernel.org

--

Commit: https://git.seco.com/clea-os/bsp/mediatek/linux-seco-mtk/-/commit/a94a826f5a3073f100bd260a2391d3e358a6a632

UPSTREAM: ASoC: SOF: mediatek: Add dai driver for mt8186

Add dsp ops callback to register AFE DL1/DL2/UL1/UL2 SOF dai's with ALSA

Change-Id: I855a36215e528ba2d9d8c209958e551cebbc09fe Signed-off-by: Chunxu Li chunxu.li@mediatek.com Link: https://lore.kernel.org/r/20220825065411.31279-2-chunxu.li@mediatek.com Signed-off-by: Mark Brown broonie@kernel.org

--

Commit: https://git.seco.com/clea-os/bsp/mediatek/linux-seco-mtk/-/commit/e1428b51eafb81bc9c223da8eea3dddb6676d07b

UPSTREAM: ASoC: SOF: mediatek: Add sof_mt8186_machs for mt8186

Add .of_machines field sof_mt8186_machs for mt8186

Change-Id: Iab803bcf9c371889206c9853d57ab3d936beb7b8 Signed-off-by: Chunxu Li chunxu.li@mediatek.com Link: https://lore.kernel.org/r/20220805070449.6611-3-chunxu.li@mediatek.com Signed-off-by: Mark Brown broonie@kernel.org

--

Commit: https://git.seco.com/clea-os/bsp/mediatek/linux-seco-mtk/-/commit/09f729e24e5a60323af8d272cc6974912457a731

UPSTREAM: ASoC: SOF: Kconfig: Make IPC_MESSAGE_INJECTOR depend on SND_SOC_SOF

Make sure that the IPC_MESSAGE_INJECTOR client can not be built in when SND_SOC_SOF is built as module.

Fixes: cac0b0887e530 ("ASoC: SOF: Convert the generic IPC message injector into SOF client") Reported-by: kernel test robot lkp@intel.com Change-Id: I6296f4bcfe76a81fcf753a1a2ffcc0c030ef3900 Signed-off-by: Peter Ujfalusi peter.ujfalusi@linux.intel.com Reviewed-by: Pierre-Louis Bossart pierre-louis.bossart@linux.intel.com Link: https://lore.kernel.org/r/20220823121554.4255-3-peter.ujfalusi@linux.intel.com Signed-off-by: Mark Brown broonie@kernel.org

--

Commit: https://git.seco.com/clea-os/bsp/mediatek/linux-seco-mtk/-/commit/1e2e4a9949665814d01d52f9c2d06709bfd03205

UPSTREAM: ASoC: SOF: Kconfig: Make IPC_FLOOD_TEST depend on SND_SOC_SOF

Make sure that the IPC_FLOOD client can not be built in when SND_SOC_SOF is built as module.

Fixes: 6e9548cdb30e5 ("ASoC: SOF: Convert the generic IPC flood test into SOF client") Reported-by: kernel test robot lkp@intel.com Change-Id: I4c06b3f5d21fc2c51e42133aa04f919bf52c57ae Signed-off-by: Peter Ujfalusi peter.ujfalusi@linux.intel.com Reviewed-by: Pierre-Louis Bossart pierre-louis.bossart@linux.intel.com Link: https://lore.kernel.org/r/20220823121554.4255-2-peter.ujfalusi@linux.intel.com Signed-off-by: Mark Brown broonie@kernel.org

--

Commit: https://git.seco.com/clea-os/bsp/mediatek/linux-seco-mtk/-/commit/35f8bd7013e61a0c91f7504d2588416b0ed33025

UPSTREAM: ASoC: SOF: compress: Remove dai_posn variable

dai_posn is set but never used. Initial intention was to use dai_posn to shorthen one code line but it looks fine without it too.

Fixes: c1a731c71359 ("ASoC: SOF: compress: Add support for computing timestamps") Reported-by: kernel test robot lkp@intel.com Change-Id: Ifca9fbb92ab59aa8726258a72dd1c5b4fa1869c3 Signed-off-by: Daniel Baluta daniel.baluta@nxp.com Link: https://lore.kernel.org/r/20220822174937.254873-1-daniel.baluta@oss.nxp.com Signed-off-by: Mark Brown broonie@kernel.org

--

Commit: https://git.seco.com/clea-os/bsp/mediatek/linux-seco-mtk/-/commit/99dbbb34f68f935bf1c7853780eacd474d0260db

UPSTREAM: ASoC: SOF: compress: Add support for computing timestamps

We compute the number of pcm_io_frames by dividing the dai position to size of a frame (channels * sample size).

Reviewed-by: Paul Olaru paul.olaru@oss.nxp.com Reviewed-by: Pierre-Louis Bossart pierre-louis.bossart@linux.intel.com Change-Id: I6410711f77f0864b62495a3ee0ad7ae039eb4292 Signed-off-by: Laurentiu Mihalcea laurentiu.mihalcea@nxp.com Signed-off-by: Daniel Baluta daniel.baluta@nxp.com Link: https://lore.kernel.org/r/20220817080529.10864-5-daniel.baluta@oss.nxp.com Signed-off-by: Mark Brown broonie@kernel.org

--

Commit: https://git.seco.com/clea-os/bsp/mediatek/linux-seco-mtk/-/commit/61539222b1d4576f4e19732cd239b074b74a5bd5

UPSTREAM: ASoC: SOF: compress: Save channel count and sample bytes

The purpose of this change is to enable the saving of the channel count and sample container bytes format parameters for later use to compute the timestamps.

This is done when setting the compress stream parameters (in sof_compr_set_params).

Reviewed-by: Paul Olaru paul.olaru@oss.nxp.com Reviewed-by: Pierre-Louis Bossart pierre-louis.bossart@linux.intel.com Change-Id: Ib6b32b2ab2a745bb56e30a0376faa3a1b1d32fd6 Signed-off-by: Laurentiu Mihalcea laurentiu.mihalcea@nxp.com Signed-off-by: Daniel Baluta daniel.baluta@nxp.com Link: https://lore.kernel.org/r/20220817080529.10864-4-daniel.baluta@oss.nxp.com Signed-off-by: Mark Brown broonie@kernel.org

--

Commit: https://git.seco.com/clea-os/bsp/mediatek/linux-seco-mtk/-/commit/7930fa349459271b66ae883bd41a4f284d874a0e

UPSTREAM: ASoC: SOF: compress: Introduce sof_compr_stream

This will keep SOF compress stream private data. So far we used snd_compr_tstamp to hold the private data but this is no longer enough as we need to hold other info like number of channels or sample bytes.

Reviewed-by: Paul Olaru paul.olaru@oss.nxp.com Reviewed-by: Pierre-Louis Bossart pierre-louis.bossart@linux.intel.com Change-Id: I6841040ad2e180b6cbfc26fc1fc130a3d21f297a Signed-off-by: Daniel Baluta daniel.baluta@nxp.com Link: https://lore.kernel.org/r/20220817080529.10864-3-daniel.baluta@oss.nxp.com Signed-off-by: Mark Brown broonie@kernel.org

--

Commit: https://git.seco.com/clea-os/bsp/mediatek/linux-seco-mtk/-/commit/d73d171ce76074f60979c007621fd995437ceb24

UPSTREAM: ASoC: SOF: compress: Remove byte offset computation

Byte offset is the offset in the ring buffer to the DSP while posn_offset is an offset inside the stream_box where we keep position information.

Reviewed-by: Paul Olaru paul.olaru@oss.nxp.com Reviewed-by: Pierre-Louis Bossart pierre-louis.bossart@linux.intel.com Change-Id: I9042f38dc3d5716e5020d587e811d0c8dd63652d Signed-off-by: Daniel Baluta daniel.baluta@nxp.com Link: https://lore.kernel.org/r/20220817080529.10864-2-daniel.baluta@oss.nxp.com Signed-off-by: Mark Brown broonie@kernel.org

--

Commit: https://git.seco.com/clea-os/bsp/mediatek/linux-seco-mtk/-/commit/589d4d93bf385d8a6279db55f720ca64d4a76462

UPSTREAM: ASoC: SOF: ipc3-topology: Fix clang -Wformat warning

When building with Clang we encounter these warnings: | sound/soc/sof/ipc3-topology.c:2343:4: error: format specifies type | 'unsigned char' but the argument has type 'int' [-Werror,-Wformat] | SOF_ABI_MAJOR, SOF_ABI_MINOR, SOF_ABI_PATCH); | ^~~~~~~~~~~~~~~^~~~~~~~~~~~~~~^~~~~~~~~~~~~

Use correct format specifier %d since args are of type int.

Link: https://github.com/ClangBuiltLinux/linux/issues/378 Reported-by: Nathan Chancellor nathan@kernel.org Suggested-by: Nathan Chancellor nathan@kernel.org Change-Id: I6e49bd8ca75dcf9966b4340f35f6d57563e262f6 Signed-off-by: Justin Stitt justinstitt@google.com Reviewed-by: Nathan Chancellor nathan@kernel.org Acked-by: Pierre-Louis Bossart pierre-louis.bossart@linux.intel.com Link: https://lore.kernel.org/r/20220803204442.2996580-1-justinstitt@google.com Signed-off-by: Mark Brown broonie@kernel.org

--

Commit: https://git.seco.com/clea-os/bsp/mediatek/linux-seco-mtk/-/commit/ad8182e7a816ad96fee43e82a33390cc83996a96

UPSTREAM: ASoC: SOF: debug: Fix potential buffer overflow by snprintf()

snprintf() returns the would-be-filled size when the string overflows the given buffer size, hence using this value may result in the buffer overflow (although it's unrealistic).

This patch replaces with a safer version, scnprintf() for papering over such a potential issue.

Fixes: 5b10b6298921 ("ASoC: SOF: Add memory_info file to debugfs") Change-Id: I2763b38f55453b2a2828217cf0c20574bc6dab94 Signed-off-by: Takashi Iwai tiwai@suse.de Link: https://lore.kernel.org/r/20220801165420.25978-3-tiwai@suse.de Signed-off-by: Mark Brown broonie@kernel.org

--

Commit: https://git.seco.com/clea-os/bsp/mediatek/linux-seco-mtk/-/commit/88423e6a793e2afc3a6960a6ce1744573c142cb1

UPSTREAM: ASoC: SOF: Add cont_update_posn to platform parameters

Add cont_update_posn to platform parameters to support continue update position for platform.

Reviewed-by: Péter Ujfalusi peter.ujfalusi@linux.intel.com Reviewed-by: Ranjani Sridharan ranjani.sridharan@linux.intel.com Reviewed-by: Chao Song chao.song@intel.com Reviewed-by: Daniel Baluta daniel.baluta@nxp.com Change-Id: I8ad60a6657b36e175606f201ace9178f7be5ad0d Signed-off-by: YC Hung yc.hung@mediatek.com Signed-off-by: Pierre-Louis Bossart pierre-louis.bossart@linux.intel.com Link: https://lore.kernel.org/r/20220725195343.145603-3-pierre-louis.bossart@linux.intel.com Signed-off-by: Mark Brown broonie@kernel.org

--

Commit: https://git.seco.com/clea-os/bsp/mediatek/linux-seco-mtk/-/commit/341d2a0d09817212216d4c91f4d8d63fb8ebc0c3

BACKPORT: ASoC: mediatek: mt8195: extract SOF common code

The functions related to SOF can be reused in different machine drivers, such as mt8195 or mt8186, so extract the common code to avoid duplication.

Set mtk_soc_card_data which include machine private data and SOF private data as card drvdata, then the difference between machine private can be ignored such as mt8195_mt6359_priv or mt8186_mt6366_priv, at the same time the SOF related code can be reused in different machine drivers.

Change-Id: Id4a0957cc8b11d32cfcc8d93a8a8074083ac03f0 Signed-off-by: Chunxu Li chunxu.li@mediatek.com Link: https://lore.kernel.org/r/20220715085903.7796-1-chunxu.li@mediatek.com Signed-off-by: Mark Brown broonie@kernel.org

--

Commit: https://git.seco.com/clea-os/bsp/mediatek/linux-seco-mtk/-/commit/071d7daa2ca3815b82c2b2f64adc19e59e5061dd

BACKPORT: ASoC: SOF: probes: rename assign/free callbacks as startup/shutdown

assign/free are not well aligned to usual conventions and specifically not to the compressed ops that make use of the probe callbacks.

Use the more common startup/shutdown. No functional change beyond renaming.

Change-Id: I7a8769400c87f4357a74ba2508cac4597291d642 Signed-off-by: Pierre-Louis Bossart pierre-louis.bossart@linux.intel.com Reviewed-by: Ranjani Sridharan ranjani.sridharan@linux.intel.com Reviewed-by: Péter Ujfalusi peter.ujfalusi@linux.intel.com Reviewed-by: Bard Liao yung-chuan.liao@linux.intel.com Link: https://lore.kernel.org/r/20220715145216.277003-11-pierre-louis.bossart@linux.intel.com Signed-off-by: Mark Brown broonie@kernel.org

--

Commit: https://git.seco.com/clea-os/bsp/mediatek/linux-seco-mtk/-/commit/5fdaac3b2c591599c0cee1abb8d9e45b57071aec

UPSTREAM: ASoC: SOF: ipc3-loader: Print out the non matching ext_man magic number

Print out the found extended manifest magic number in case it is not matching with the expected one (0x6e614d58) in debug level. It is fairly unlikely that the firmware does not have ext_man section and the found value in place of the magic number can help rootcausing boot related issues.

Reviewed-by: Ranjani Sridharan ranjani.sridharan@linux.intel.com Change-Id: I9a66d45650557e22b03a65f3590dc052073f9ce5 Signed-off-by: Peter Ujfalusi peter.ujfalusi@linux.intel.com Signed-off-by: Pierre-Louis Bossart pierre-louis.bossart@linux.intel.com Link: https://lore.kernel.org/r/20220715145216.277003-7-pierre-louis.bossart@linux.intel.com Signed-off-by: Mark Brown broonie@kernel.org

--

Commit: https://git.seco.com/clea-os/bsp/mediatek/linux-seco-mtk/-/commit/bfdcf7bddd231d34da64e69406e86f7b17c3d0a3

UPSTREAM: ASoC: SOF: ipc3-topology: Prevent double freeing of ipc_control_data via load_bytes

We have sanity checks for byte controls and if any of the fail the locally allocated scontrol->ipc_control_data is freed up, but not set to NULL.

On a rollback path of the error the higher level code will also try to free the scontrol->ipc_control_data which will eventually going to lead to memory corruption as double freeing memory is not a good thing.

Fixes: b5cee8feb1d4 ("ASoC: SOF: topology: Make control parsing IPC agnostic") Reported-by: Seppo Ingalsuo seppo.ingalsuo@linux.intel.com Change-Id: I83211359bb304fcf4d7b1dd85ab71dedd0002abe Signed-off-by: Peter Ujfalusi peter.ujfalusi@linux.intel.com Reviewed-by: Seppo Ingalsuo seppo.ingalsuo@linux.intel.com Reviewed-by: Ranjani Sridharan ranjani.sridharan@linux.intel.com Reviewed-by: Pierre-Louis Bossart pierre-louis.bossart@linux.intel.com Link: https://lore.kernel.org/r/20220712130103.31514-1-peter.ujfalusi@linux.intel.com Signed-off-by: Mark Brown broonie@kernel.org

--

Commit: https://git.seco.com/clea-os/bsp/mediatek/linux-seco-mtk/-/commit/705db440a52e32938b5faf9b64e74d6f01ec1a44

UPSTREAM: ASoC: SOF: sof-client-probes: Only load the driver if IPC3 is used

The current implementation of probes only supports IPC3 and should not be loaded for other IPC implementation.

Change-Id: I58b58cdc23a69544ec096a30427d8c032992d6c3 Signed-off-by: Peter Ujfalusi peter.ujfalusi@linux.intel.com Reviewed-by: Pierre-Louis Bossart pierre-louis.bossart@linux.intel.com Reviewed-by: Ranjani Sridharan ranjani.sridharan@linux.intel.com Link: https://lore.kernel.org/r/20220712131022.1124-1-peter.ujfalusi@linux.intel.com Signed-off-by: Mark Brown broonie@kernel.org

--

Commit: https://git.seco.com/clea-os/bsp/mediatek/linux-seco-mtk/-/commit/b0238b37e13136a5f251f4e67f44f55a2e0c7135

UPSTREAM: ASoC: SOF: compress: Prevent current kernel running with older FW

After introducing extended parameters we need to forbid older firmware versions to run with the current and future kernel versions.

Although in theory the communication protocol will still work the semantics at application level are undefined. So, prevent this by disallowing older firmwares to run with newer kernels.

Change-Id: I9040a1226ff956bb271fce7babb8f9434faa9388 Signed-off-by: Daniel Baluta daniel.baluta@nxp.com Reviewed-by: Pierre-Louis Bossart pierre-louis.bossart@linux.intel.com Reviewed-by: Ranjani Sridharan ranjani.sridharan@linux.intel.com Reviewed-by: Péter Ujfalusi peter.ujfalusi@linux.intel.com Link: https://lore.kernel.org/r/20220712141531.14599-4-daniel.baluta@oss.nxp.com Signed-off-by: Mark Brown broonie@kernel.org

--

Commit: https://git.seco.com/clea-os/bsp/mediatek/linux-seco-mtk/-/commit/2a6baa6e769172b60b5192c93e16616145017073

UPSTREAM: ASoC: SOF: Copy compress parameters into extended data

Allocate memory at the end of sof_ipc_stream_params to store snd_compr_params in order to be sent them to SOF firmware.

This will help firmware correctly configure codecs parameters.

Notice, that we use 2 bytes from the reserved pool in order to store the extended data length. This is compatible with older FWs where there was no extended data.

Change-Id: I137fffc414d8095a9ec7e8d051d7d4cd7a44f0c6 Signed-off-by: Daniel Baluta daniel.baluta@nxp.com Reviewed-by: Pierre-Louis Bossart pierre-louis.bossart@linux.intel.com Reviewed-by: Ranjani Sridharan ranjani.sridharan@linux.intel.com Reviewed-by: Péter Ujfalusi peter.ujfalusi@linux.intel.com Link: https://lore.kernel.org/r/20220712141531.14599-3-daniel.baluta@oss.nxp.com Signed-off-by: Mark Brown broonie@kernel.org

--

Commit: https://git.seco.com/clea-os/bsp/mediatek/linux-seco-mtk/-/commit/cf9bb89463fe853a88c579dbed1141dd88aacefe

UPSTREAM: ASoC: SOF: compress: Dynamically allocate pcm params struct

We need to extend sof_ipc_pcm_parmas with additional data in order to send compress_params to SOF FW.

The extensions will be done at runtime so we need to dynamically allocate pcm object of type struct sof_ipc_pcm_params.

Change-Id: Id1ad79824e66b372efe9072a0b82a05f44c32424 Signed-off-by: Daniel Baluta daniel.baluta@nxp.com Reviewed-by: Pierre-Louis Bossart pierre-louis.bossart@linux.intel.com Reviewed-by: Ranjani Sridharan ranjani.sridharan@linux.intel.com Reviewed-by: Péter Ujfalusi peter.ujfalusi@linux.intel.com Link: https://lore.kernel.org/r/20220712141531.14599-2-daniel.baluta@oss.nxp.com Signed-off-by: Mark Brown broonie@kernel.org

--

Commit: https://git.seco.com/clea-os/bsp/mediatek/linux-seco-mtk/-/commit/e40d099be16b05424f5d42d96304f0ce2bb0299d

UPSTREAM: ASoC: SOF: topology: remove unused variable

'ret' is never used. Remove it and return 0 instead.

Change-Id: I431f2c0b0b03cb155fdc7e5ae764c83d5bbffcb2 Signed-off-by: Ranjani Sridharan ranjani.sridharan@linux.intel.com Reviewed-by: Bard Liao yung-chuan.liao@linux.intel.com Reviewed-by: Pierre-Louis Bossart pierre-louis.bossart@linux.intel.com Signed-off-by: Peter Ujfalusi peter.ujfalusi@linux.intel.com Link: https://lore.kernel.org/r/20220712123902.14696-1-peter.ujfalusi@linux.intel.com Signed-off-by: Mark Brown broonie@kernel.org

--

Commit: https://git.seco.com/clea-os/bsp/mediatek/linux-seco-mtk/-/commit/effb67ffe422a14e7753ad9092bbf6798b9a3a61

UPSTREAM: ASoC: SOF: remove warning on ABI checks

We should only have an error when enforcing strict mapping between kernel and firmware versions. In all other cases, there is no reason to throw a warning.

Change-Id: Ib56c9297ddd36c5faf7dca7be2f2be99427b7704 Signed-off-by: Pierre-Louis Bossart pierre-louis.bossart@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/20220708200719.26961-1-pierre-louis.bossart@linux.intel.com Signed-off-by: Mark Brown broonie@kernel.org

--

Commit: https://git.seco.com/clea-os/bsp/mediatek/linux-seco-mtk/-/commit/852fc1cfa59d986defb59a4a68506758c7649909

UPSTREAM: ASoC: SOF: mediatek: fix mt8195 StatvectorSel wrong setting

Fix StatVectorSel wrong setting.

Fixes: b7f6503830 ("ASoC: SOF: mediatek: Add fw loader and mt8195 dsp ops to load firmware") Change-Id: I0b092ae2e948a84d42562ef9cf3daa074a05d052 Signed-off-by: Pierre-Louis Bossart pierre-louis.bossart@linux.intel.com Signed-off-by: YC Hung yc.hung@mediatek.com Reviewed-by: Li-Yu Yu afg984@gmail.com Reviewed-by: Ranjani Sridharan ranjani.sridharan@linux.intel.com Reviewed-by: KuanHsun Cheng Allen-KH.Cheng@mediatek.com Reviewed-by: Péter Ujfalusi peter.ujfalusi@linux.intel.com Link: https://lore.kernel.org/r/20220708203904.29214-3-pierre-louis.bossart@linux.intel.com Signed-off-by: Mark Brown broonie@kernel.org

--

Commit: https://git.seco.com/clea-os/bsp/mediatek/linux-seco-mtk/-/commit/f5240843049c226ae0c0deffc1cf3504d24d8a99

UPSTREAM: ASoC: SOF: mediatek: Revise mt8195 boot flow

  1. Revise hifixdsp shutdown flow to pull runstall high then reset high.
  2. Add 1 us delay between D/BRESET high and low for 10 DSP cycles(26M) based on IP vendor's suggestion.

Change-Id: Idf48ada8324fa5f4e80ed8111130e1f4fe3c07ec Signed-off-by: YC Hung yc.hung@mediatek.com Signed-off-by: Pierre-Louis Bossart pierre-louis.bossart@linux.intel.com Reviewed-by: Li-Yu Yu afg984@gmail.com Reviewed-by: Ranjani Sridharan ranjani.sridharan@linux.intel.com Reviewed-by: KuanHsun Cheng Allen-KH.Cheng@mediatek.com Reviewed-by: Péter Ujfalusi peter.ujfalusi@linux.intel.com Link: https://lore.kernel.org/r/20220708203904.29214-2-pierre-louis.bossart@linux.intel.com Signed-off-by: Mark Brown broonie@kernel.org

--

Commit: https://git.seco.com/clea-os/bsp/mediatek/linux-seco-mtk/-/commit/ec470dba3843c2c6b0e142fd374c0e241672719c

UPSTREAM: ASoC: SOF: pm: add definitions for S4 and S5 states

We currently don't have a means to differentiate between S3, S4 and S5. Add definitions so that we have select different code paths depending on the target state in follow-up patches.

Change-Id: Ifc282be12900ae37b8ec6b7ac1b1e4f0ac016af1 Signed-off-by: Pierre-Louis Bossart pierre-louis.bossart@linux.intel.com Reviewed-by: Ranjani Sridharan ranjani.sridharan@linux.intel.com Reviewed-by: Péter Ujfalusi peter.ujfalusi@linux.intel.com Link: https://lore.kernel.org/r/20220616201818.130802-3-pierre-louis.bossart@linux.intel.com Signed-off-by: Mark Brown broonie@kernel.org

--

Commit: https://git.seco.com/clea-os/bsp/mediatek/linux-seco-mtk/-/commit/3e8bfdabc37663c060deafc458417c46a8f611d2

UPSTREAM: ASoC: SOF: pm: add explicit behavior for ACPI S1 and S2

The existing code only deals with S0 and S3, let's start adding S1 and S2.

No functional change.

Change-Id: Ia0bad395a3f2a221a82faeda43e2c115edc3f694 Signed-off-by: Pierre-Louis Bossart pierre-louis.bossart@linux.intel.com Reviewed-by: Ranjani Sridharan ranjani.sridharan@linux.intel.com Reviewed-by: Péter Ujfalusi peter.ujfalusi@linux.intel.com Link: https://lore.kernel.org/r/20220616201818.130802-2-pierre-louis.bossart@linux.intel.com Signed-off-by: Mark Brown broonie@kernel.org

--

Commit: https://git.seco.com/clea-os/bsp/mediatek/linux-seco-mtk/-/commit/2dfa56dc71a901bb04498617640fddf5af5e1ea0

UPSTREAM: ASoC: SOF: mediatek: Fix error code in probe

This should return PTR_ERR() instead of IS_ERR().

Fixes: e0100bfd383c ("ASoC: SOF: mediatek: Add mt8186 ipc support") Change-Id: Ic78d70f4e18716b386f744ca214814e1c50ae42b Signed-off-by: Dan Carpenter dan.carpenter@oracle.com Acked-by: Pierre-Louis Bossart pierre-louis.bossart@linux.intel.com Link: https://lore.kernel.org/r/YqmWIK8sTj578OJP@kili Signed-off-by: Mark Brown broonie@kernel.org

--

Commit: https://git.seco.com/clea-os/bsp/mediatek/linux-seco-mtk/-/commit/3dfeae9f78fe2fd4dea51570a393aa105baa77b3

UPSTREAM: ASoC: SOF: ipc3-topology: Move and correct size checks in sof_ipc3_control_load_bytes()

Move the size checks prior to allocating memory as these checks do not need the data to be allocated and in case of an error we would not need to free the allocation.

The max size must not be less than the size of struct sof_ipc_ctrl_data + struct sof_abi_hdr as the ABI header needs to be present under all circumstances. The check was incorrectly used or between the two size checks.

Fixes: b5cee8feb1d4 ("ASoC: SOF: topology: Make control parsing IPC agnostic") Change-Id: I05f02c4ef31876b479b133468ca060b2bd6ea967 Signed-off-by: Peter Ujfalusi peter.ujfalusi@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: Bard Liao yung-chuan.liao@linux.intel.com Link: https://lore.kernel.org/r/20220610084735.19397-1-peter.ujfalusi@linux.intel.com Signed-off-by: Mark Brown broonie@kernel.org

--

Commit: https://git.seco.com/clea-os/bsp/mediatek/linux-seco-mtk/-/commit/56e9ee16adddad8e199bf2ad4c6407364a2e9773

UPSTREAM: ASoC: SOF: mediatek: Align mt8186 clock names with dt-bindings

Align clock names in mt8186 dsp driver with dt-bindings.

Change-Id: Ibc0043be6672f0ff0a4df043d812a2614b7b392f Signed-off-by: Tinghan Shen tinghan.shen@mediatek.com Link: https://lore.kernel.org/r/20220622062245.21021-5-tinghan.shen@mediatek.com Signed-off-by: Mark Brown broonie@kernel.org

--

Commit: https://git.seco.com/clea-os/bsp/mediatek/linux-seco-mtk/-/commit/b77b8360e66e0f55f0d2c13f75efd6a580781189

UPSTREAM: firmware: mediatek: Use meaningful names for mbox

Rename mbox according to actions instead of 'mbox0' and 'mbox1'

Change-Id: I3b8c2347339b3318b83f68d678c1a1be308e27f1 Signed-off-by: Tinghan Shen tinghan.shen@mediatek.com Link: https://lore.kernel.org/r/20220622062245.21021-3-tinghan.shen@mediatek.com Signed-off-by: Mark Brown broonie@kernel.org

--

Commit: https://git.seco.com/clea-os/bsp/mediatek/linux-seco-mtk/-/commit/98e33b839691ff2df5d0d02cc0b1343dbf3f2fdd

UPSTREAM: dt-bindings: dsp: mediatek: Add mt8186 dsp document

This patch adds mt8186 dsp document. The dsp is used for Sound Open Firmware driver node. It includes registers, clocks, memory regions, and mailbox for dsp.

Change-Id: I51638980f2d241a95cf6814a7cc1202de568240a Signed-off-by: Tinghan Shen tinghan.shen@mediatek.com Reviewed-by: Krzysztof Kozlowski krzysztof.kozlowski@linaro.org Link: https://lore.kernel.org/r/20220622062245.21021-4-tinghan.shen@mediatek.com Signed-off-by: Mark Brown broonie@kernel.org

--

Commit: https://git.seco.com/clea-os/bsp/mediatek/linux-seco-mtk/-/commit/785673e9d1af646deb1834337774cec4596e9ab0

UPSTREAM: dt-bindings: dsp: mediatek: Use meaningful names for mbox

Rename mbox according to actions instead of 'mbox0' and 'mbox1'. The 8195 dsp node, which uses this binding, has not yet been added to the 8195 devicetree.

Change-Id: I2216ee7c0a9778d0d6970d92641c06da767d3626 Signed-off-by: Tinghan Shen tinghan.shen@mediatek.com Reviewed-by: Krzysztof Kozlowski krzysztof.kozlowski@linaro.org Link: https://lore.kernel.org/r/20220622062245.21021-2-tinghan.shen@mediatek.com Signed-off-by: Mark Brown broonie@kernel.org

--

Commit: https://git.seco.com/clea-os/bsp/mediatek/linux-seco-mtk/-/commit/b3f5529a2bd24c040bbe6138e5b722d4aa5f6201

UPSTREAM: ASoC: SOF: pcm: use pm_resume_and_get() on component probe

Before initiating IPC and/or bus transactions when loading the topology during a component probe, which happens on card registration/creation, make sure the device for the SOF driver is pm_runtime active.

The SOF probe is not necessarily followed by the component probe, such a timing assumption can be broken in driver bind/unbind tests. This can be artifially shown if the module for the machine driver is 'blacklisted' and the SOF device becomes pm_runtime_suspended before manually calling modprobe to register the card.

In an initial experiment, pm_resume_and_get() was called from soc-component.c, since the current ASoC component model is arguably missing dependencies between component status and device status. However this approach proved too invasive and breaks all existing HDMI playback solutions on Intel platforms.

While this will result in duplication of code, generating pm_runtime transitions only if strictly required for a given component makes more sense overall. This patch adds the pm_runtime resume transition for SOF only.

BugLink: https://github.com/thesofproject/linux/issues/3651 Change-Id: If8a3f9589154b5e5c6ca3ec3c6c11c972e26604f Signed-off-by: Pierre-Louis Bossart pierre-louis.bossart@linux.intel.com Reviewed-by: Rander Wang rander.wang@intel.com Reviewed-by: Ranjani Sridharan ranjani.sridharan@linux.intel.com Reviewed-by: Bard Liao yung-chuan.liao@linux.intel.com Reviewed-by: Péter Ujfalusi peter.ujfalusi@linux.intel.com Link: https://lore.kernel.org/r/20220616210825.132093-2-pierre-louis.bossart@linux.intel.com Signed-off-by: Mark Brown broonie@kernel.org

--

Commit: https://git.seco.com/clea-os/bsp/mediatek/linux-seco-mtk/-/commit/29f2b27db21b6439ccd35f6373852d02f4444648

UPSTREAM: ASoC: SOF: sof-client: remove use of func in dev_dbg

The module and function information can be added with 'modprobe foo dyndbg=+pmf'

Suggested-by: Greg KH gregkh@linuxfoundation.org Change-Id: Ief9ddd6a2df4787b1d678c900b4ba176c2efe744 Signed-off-by: Pierre-Louis Bossart pierre-louis.bossart@linux.intel.com Reviewed-by: Ranjani Sridharan ranjani.sridharan@linux.intel.com Reviewed-by: Péter Ujfalusi peter.ujfalusi@linux.intel.com Reviewed-by: Bard Liao yung-chuan.liao@linux.intel.com Link: https://lore.kernel.org/r/20220616215351.135643-11-pierre-louis.bossart@linux.intel.com Signed-off-by: Mark Brown broonie@kernel.org

--

Commit: https://git.seco.com/clea-os/bsp/mediatek/linux-seco-mtk/-/commit/9d6b5f0409e2deaaca3cf5723ef09a06f5220a4d

UPSTREAM: ASoC: SOF: ipc3-topology: remove use of func in dev_dbg

The module and function information can be added with 'modprobe foo dyndbg=+pmf'

Suggested-by: Greg KH gregkh@linuxfoundation.org Change-Id: I6d59a7bced8fc88dace20e77bb2ab3480c0dd70e Signed-off-by: Pierre-Louis Bossart pierre-louis.bossart@linux.intel.com Reviewed-by: Ranjani Sridharan ranjani.sridharan@linux.intel.com Reviewed-by: Péter Ujfalusi peter.ujfalusi@linux.intel.com Reviewed-by: Bard Liao yung-chuan.liao@linux.intel.com Link: https://lore.kernel.org/r/20220616215351.135643-9-pierre-louis.bossart@linux.intel.com Signed-off-by: Mark Brown broonie@kernel.org

--

Commit: https://git.seco.com/clea-os/bsp/mediatek/linux-seco-mtk/-/commit/6405378aaf3166fab61f12e47a5c5a3f5efd249f

UPSTREAM: ASoC: SOF: ipc3-loader: remove use of func in dev_dbg

The module and function information can be added with 'modprobe foo dyndbg=+pmf'

Suggested-by: Greg KH gregkh@linuxfoundation.org Change-Id: I4ef8d20cf707a66d72ab3cfcb861a8dd86c2b4ef Signed-off-by: Pierre-Louis Bossart pierre-louis.bossart@linux.intel.com Reviewed-by: Ranjani Sridharan ranjani.sridharan@linux.intel.com Reviewed-by: Péter Ujfalusi peter.ujfalusi@linux.intel.com Reviewed-by: Bard Liao yung-chuan.liao@linux.intel.com Link: https://lore.kernel.org/r/20220616215351.135643-8-pierre-louis.bossart@linux.intel.com Signed-off-by: Mark Brown broonie@kernel.org

--

Commit: https://git.seco.com/clea-os/bsp/mediatek/linux-seco-mtk/-/commit/7eaf17a0cf188fc2a6b835cfcc066206794d5b74

UPSTREAM: ASoC: SOF: ipc3-dtrace: remove use of func in dev_dbg

The module and function information can be added with 'modprobe foo dyndbg=+pmf'

Suggested-by: Greg KH gregkh@linuxfoundation.org Change-Id: I257cf6ee036543fd74af7c1d4e6a19bc2b521d86 Signed-off-by: Pierre-Louis Bossart pierre-louis.bossart@linux.intel.com Reviewed-by: Ranjani Sridharan ranjani.sridharan@linux.intel.com Reviewed-by: Péter Ujfalusi peter.ujfalusi@linux.intel.com Reviewed-by: Bard Liao yung-chuan.liao@linux.intel.com Link: https://lore.kernel.org/r/20220616215351.135643-7-pierre-louis.bossart@linux.intel.com Signed-off-by: Mark Brown broonie@kernel.org

--

Commit: https://git.seco.com/clea-os/bsp/mediatek/linux-seco-mtk/-/commit/853995eda6d1f4e1181e0638bda151f90e0478db

BACKPORT: ASoC: SOF: Compile and runtime IPC version selection

The new IPC4 version is only supported by Intel platforms, iMX, AMD and MediaTek only uses the standard SOF IPC. There is no need for these platforms to build kernel support for IPC4 as it is just dead code for them.

SND_SOC_SOF_IPC3 and SND_SOC_SOF_INTEL_IPC4 is introduced to allow compile time selection and exclusion of IPC implementations.

To avoid randconfig failures add also support for runtime selection of the IPC ops in ipc.c based on sdev->pdata->ipc_type

Change-Id: I6173a9a29887c337c38f839367ac4fbefeb961f4 Signed-off-by: Peter Ujfalusi peter.ujfalusi@linux.intel.com Reviewed-by: Bard Liao yung-chuan.liao@linux.intel.com Reviewed-by: Ranjani Sridharan ranjani.sridharan@linux.intel.com Link: https://lore.kernel.org/r/20220614075618.28605-1-peter.ujfalusi@linux.intel.com Signed-off-by: Mark Brown broonie@kernel.org

--

Commit: https://git.seco.com/clea-os/bsp/mediatek/linux-seco-mtk/-/commit/623b12277085462b25910ee8e166b18dd2b53fa6

UPSTREAM: ASoC: SOF: topology: add code to parse config params for ACPDMIC dai

Add sof_ipc_dai_acpdmic_params and tokens to parse dmic channels and rate params from topology file

Change-Id: I81bd6616d99cf3d674bec830e05371cfd4e8adfb Signed-off-by: Ajit Kumar Pandey AjitKumar.Pandey@amd.com Reviewed-by: Ranjani Sridharan ranjani.sridharan@linux.intel.com Reviewed-by: Péter Ujfalusi peter.ujfalusi@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/20220614075251.21499-1-peter.ujfalusi@linux.intel.com Signed-off-by: Mark Brown broonie@kernel.org

--

Commit: https://git.seco.com/clea-os/bsp/mediatek/linux-seco-mtk/-/commit/8e49b23a00f1b9890573950deeed64fa806b7732

UPSTREAM: ASoC: SOF: reduce default verbosity of IPC logs

We currently log the initiation of an IPC as well at its success.

[ 3906.106987] kernel: sof-audio-pci-intel-tgl 0000:00:1f.3: ipc tx: 0x80010000: GLB_DAI_MSG: CONFIG [ 3906.107189] kernel: sof-audio-pci-intel-tgl 0000:00:1f.3: ipc tx succeeded: 0x80010000: GLB_DAI_MSG: CONFIG

This is overkill in most cases, we already have a message thrown in case of errors and have tracepoints enabled to check for IPC duration. The only case where this might be useful is to check if there is an interleaved IPC RX. Add a flag and only print those logs if enabled.

In addition, the DMA_POSITION_UPDATE for traces brings limited information in most cases and pollutes the logs for no good reason.

[ 3906.322256] kernel: sof-audio-pci-intel-tgl 0000:00:1f.3: ipc rx: 0x90020000: GLB_TRACE_MSG: DMA_POSITION [ 3906.322308] kernel: sof-audio-pci-intel-tgl 0000:00:1f.3: ipc rx done: 0x90020000: GLB_TRACE_MSG: DMA_POSITION [ 3906.822261] kernel: sof-audio-pci-intel-tgl 0000:00:1f.3: ipc rx: 0x90020000: GLB_TRACE_MSG: DMA_POSITION [ 3906.822319] kernel: sof-audio-pci-intel-tgl 0000:00:1f.3: ipc rx done: 0x90020000: GLB_TRACE_MSG: DMA_POSITION [ 3907.822261] kernel: sof-audio-pci-intel-tgl 0000:00:1f.3: ipc rx: 0x90020000: GLB_TRACE_MSG: DMA_POSITION [ 3907.822319] kernel: sof-audio-pci-intel-tgl 0000:00:1f.3: ipc rx done: 0x90020000: GLB_TRACE_MSG: DMA_POSITION [ 3908.822251] kernel: sof-audio-pci-intel-tgl 0000:00:1f.3: ipc rx: 0x90020000: GLB_TRACE_MSG: DMA_POSITION [ 3908.822309] kernel: sof-audio-pci-intel-tgl 0000:00:1f.3: ipc rx done: 0x90020000: GLB_TRACE_MSG: DMA_POSITION

This information is only helpful when debugging the trace support, not when using the trace. Add a flag to only print DMA position update logs if enabled.

Change-Id: I1b4c2c70bd67ba337c98e0d45fb18058251f122e Signed-off-by: Pierre-Louis Bossart pierre-louis.bossart@linux.intel.com Reviewed-by: Ranjani Sridharan ranjani.sridharan@linux.intel.com Reviewed-by: Péter Ujfalusi peter.ujfalusi@linux.intel.com Link: https://lore.kernel.org/r/20220610214601.43005-1-pierre-louis.bossart@linux.intel.com Signed-off-by: Mark Brown broonie@kernel.org

--

Commit: https://git.seco.com/clea-os/bsp/mediatek/linux-seco-mtk/-/commit/00cb19b296882d28048be8e1b1429f8f087f51f9

UPSTREAM: ASoC: SOF: ipc3-dtrace: use pm_runtime_resume_and_get()

Use pm_runtime_resume_and_get() to replace the pm_runtime_get_sync() and pm_runtime_put_noidle() pattern.

No functional changes.

Change-Id: I0cf12917725561c0ab8342993da08fc068d44700 Signed-off-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/20220610071245.26576-1-peter.ujfalusi@linux.intel.com Signed-off-by: Mark Brown broonie@kernel.org

--

Commit: https://git.seco.com/clea-os/bsp/mediatek/linux-seco-mtk/-/commit/8b9ba8697cd30a090cc00aa95f07533cd0d27623

UPSTREAM: ASoC: SOF: debug: Clarify the IPC timeout handling path

The dmesg log message of "Firmware exception" causes lots of confusion as the snd_sof_handle_fw_exception() is only called in case of an IPC tx timeout, where such a message does not make much sense.

To not limit the snd_sof_handle_fw_exception() handler to just one error case, add a parameter to allow the caller to specify a meaningful message to be printed.

Change-Id: Ie1d6af9a86ff6db0ee087d280c2921e40880363c Signed-off-by: Peter Ujfalusi peter.ujfalusi@linux.intel.com Reviewed-by: Ranjani Sridharan ranjani.sridharan@linux.intel.com Reviewed-by: Pierre-Louis Bossart pierre-louis.bossart@linux.intel.com Reviewed-by: Yaochun Hung yc.hung@mediatek.com Link: https://lore.kernel.org/r/20220610080421.31453-1-peter.ujfalusi@linux.intel.com Signed-off-by: Mark Brown broonie@kernel.org

--

Commit: https://git.seco.com/clea-os/bsp/mediatek/linux-seco-mtk/-/commit/3f787fcd4ba7a3025f438b31871728767eacc826

BACKPORT: ASoC: SOF: Add a new IPC op for parsing topology manifest

Add a new topology IPC op, parse_manifest. Define and set the op for IPC4 and IPC4.

Co-developed-by: Jaska Uimonen jaska.uimonen@linux.intel.com Change-Id: I5579274b0bb4cc7bc9bedab6010bbdfe52156565 Signed-off-by: Jaska Uimonen jaska.uimonen@linux.intel.com Signed-off-by: Ranjani Sridharan ranjani.sridharan@linux.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 Link: https://lore.kernel.org/r/20220609032643.916882-21-ranjani.sridharan@linux.intel.com Signed-off-by: Mark Brown broonie@kernel.org

--

Commit: https://git.seco.com/clea-os/bsp/mediatek/linux-seco-mtk/-/commit/034dae1a19a2194265d3bb8eb81e9b180472fd81

UPSTREAM: ASoC: SOF: Add ops_free

Add the ops_free callback in struct sof_dev_desc.

Change-Id: I99f0a3a3837ce947d5d7bcec53f2b488140c1c84 Signed-off-by: Ranjani Sridharan ranjani.sridharan@linux.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 Link: https://lore.kernel.org/r/20220609032643.916882-18-ranjani.sridharan@linux.intel.com Signed-off-by: Mark Brown broonie@kernel.org

--

Commit: https://git.seco.com/clea-os/bsp/mediatek/linux-seco-mtk/-/commit/e5e1a281067fc171ac73dd9628a68240bf87b141

BACKPORT: ASoC: SOF: ipc4-topology: Add support for parsing AIF_IN/AIF_OUT widgets

Add support for parsing AIF_IN/AIF_OUT type widgets in IPC4. Add all the new required token ID's for parsing these widgets to the list of tokens in enum sof_tokens and the definitions of the token arrays corresponding to each of the token ID's.

Also, upgrade the sof_widget_parse_tokens() function in the common topology parser to be able to parse multiple sets of tokens for the audio format and copier gateway config tokens.

Co-developed-by: Rander Wang rander.wang@linux.intel.com Change-Id: I659fc1e7a320dddae9d85ed6fb99ad2e2ed1d32a Signed-off-by: Rander Wang rander.wang@linux.intel.com Co-developed-by: Bard Liao yung-chuan.liao@linux.intel.com Signed-off-by: Bard Liao yung-chuan.liao@linux.intel.com Signed-off-by: Ranjani Sridharan ranjani.sridharan@linux.intel.com Reviewed-by: Péter Ujfalusi peter.ujfalusi@linux.intel.com Reviewed-by: Pierre-Louis Bossart pierre-louis.bossart@linux.intel.com Reviewed-by: Paul Olaru paul.olaru@oss.nxp.com Link: https://lore.kernel.org/r/20220609032643.916882-4-ranjani.sridharan@linux.intel.com Signed-off-by: Mark Brown broonie@kernel.org

--

Commit: https://git.seco.com/clea-os/bsp/mediatek/linux-seco-mtk/-/commit/4bc7818338a8e00a152b7e0f173da9a004f4f8fd

UPSTREAM: ASoC: SOF: Add topology tokens for IPC4

Add the required tokens for parsing the topology for IPC4.

Co-developed-by: Rander Wang rander.wang@linux.intel.com Change-Id: I445e3b04326618cb3486a0455fdf3d911f7c4f92 Signed-off-by: Rander Wang rander.wang@linux.intel.com Co-developed-by: Bard Liao yung-chuan.liao@linux.intel.com Signed-off-by: Bard Liao yung-chuan.liao@linux.intel.com Signed-off-by: Ranjani Sridharan ranjani.sridharan@linux.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: Ranjani Sridharan ranjani.sridharan@linux.intel.com Link: https://lore.kernel.org/r/20220609032643.916882-2-ranjani.sridharan@linux.intel.com Signed-off-by: Mark Brown broonie@kernel.org

--

Commit: https://git.seco.com/clea-os/bsp/mediatek/linux-seco-mtk/-/commit/720561bc83b15fc39ca2c0506dbc04007aacd491

UPSTREAM: ASoC: SOF: ipc3-dtrace: Return from dtrace_read if there is no new data available

If no new trace data is available then return immediately, there is no need to continue with the execution of the trace_read() function.

Change-Id: Ib8e189481c2bbcbac443c2f7ce2758652363bf5f Signed-off-by: Peter Ujfalusi peter.ujfalusi@linux.intel.com Reviewed-by: Pierre-Louis Bossart pierre-louis.bossart@linux.intel.com Reviewed-by: Bard Liao yung-chuan.liao@linux.intel.com Link: https://lore.kernel.org/r/20220610080119.30880-4-peter.ujfalusi@linux.intel.com Signed-off-by: Mark Brown broonie@kernel.org

--

Commit: https://git.seco.com/clea-os/bsp/mediatek/linux-seco-mtk/-/commit/93512060f7407b0d53cd8b887b212e2e0d39478a

UPSTREAM: ASoC: SOF: ipc3-dtrace: Add helper function to update the sdev->host_offset

We are using the READ_ONCE() on the debugfs read path for accessing sdev->host_offset, but the set is not atomic or protected in any way.

Add a small helper to do the host_offset update and be really paranoid about the a possible race in update

Change-Id: Iea4a084bc986567fb62476b650e118bbfdd14c7b Signed-off-by: Peter Ujfalusi peter.ujfalusi@linux.intel.com Reviewed-by: Pierre-Louis Bossart pierre-louis.bossart@linux.intel.com Reviewed-by: Bard Liao yung-chuan.liao@linux.intel.com Link: https://lore.kernel.org/r/20220610080119.30880-3-peter.ujfalusi@linux.intel.com Signed-off-by: Mark Brown broonie@kernel.org

--

Commit: https://git.seco.com/clea-os/bsp/mediatek/linux-seco-mtk/-/commit/b5e74d07acc30ac2e7f91e5a7b6e313f1f3f519c

UPSTREAM: ASoC: SOF: ipc3-dtrace: Introduce SOF_DTRACE_INITIALIZING state

With the new state we can make sure we are not missing the first host_offset update.

In case the dtrace is small, the DMA copy will be fast and depending on the moonphase it might be done before we set the sdev->dtrace_state to SOF_DTRACE_ENABLED.

The DMA will start the copy as soon as the host starts the DMA. Set the dtrace to enabled before we let the DMA to run in order to avoid missing the position update.

The new state is needed to cover architectures where the host side snd_sof_dma_trace_trigger() is a NOP and the dtrace in the firmware is ready as soon as the IPC message has been processed.

Change-Id: I20c9c5bebe3f4c62db6eab87646f165d225de6b6 Signed-off-by: Peter Ujfalusi peter.ujfalusi@linux.intel.com Reviewed-by: Pierre-Louis Bossart pierre-louis.bossart@linux.intel.com Reviewed-by: Bard Liao yung-chuan.liao@linux.intel.com Link: https://lore.kernel.org/r/20220610080119.30880-2-peter.ujfalusi@linux.intel.com Signed-off-by: Mark Brown broonie@kernel.org

--

Commit: https://git.seco.com/clea-os/bsp/mediatek/linux-seco-mtk/-/commit/1a2a465c6afdd45f3320a1edfc6db954c0c73b28

UPSTREAM: ASoC: SOF: ipc3: Add set_core_state pm_ops implementation

IPC3 uses sof_ipc_pm_core_config message (SOF_IPC_GLB_PM_MSG | SOF_IPC_PM_CORE_ENABLE) to enable/disable cores managed by the DSP. The core state is set via a single bitfield, if the bit is 1 the core should be on, if it is 0 then it is off.

Change-Id: I84bf843ce8f4cb18b755a94edf6c35e9d98a8172 Signed-off-by: Peter Ujfalusi peter.ujfalusi@linux.intel.com Reviewed-by: Ranjani Sridharan ranjani.sridharan@linux.intel.com Reviewed-by: Bard Liao yung-chuan.liao@linux.intel.com Reviewed-by: Pierre-Louis Bossart pierre-louis.bossart@linux.intel.com Link: https://lore.kernel.org/r/20220610083549.16773-4-peter.ujfalusi@linux.intel.com Signed-off-by: Mark Brown broonie@kernel.org

--

Commit: https://git.seco.com/clea-os/bsp/mediatek/linux-seco-mtk/-/commit/fe82dc1aa8be8363a225074974f193cfd5b5c015

UPSTREAM: ASoC: SOF: sof_ipc_pm_ops: Add support for DSP core power management

Add a new ops for handling DSP core power state which can be used to tell the DSP to turn on/off a core (or to inform it that a core is going to be turned on/off if the core is host managed).

Change-Id: I7b54e8c1d8ecb60f43d0b89a34c57b3933d5b314 Signed-off-by: Peter Ujfalusi peter.ujfalusi@linux.intel.com Reviewed-by: Ranjani Sridharan ranjani.sridharan@linux.intel.com Reviewed-by: Bard Liao yung-chuan.liao@linux.intel.com Reviewed-by: Pierre-Louis Bossart pierre-louis.bossart@linux.intel.com Link: https://lore.kernel.org/r/20220610083549.16773-3-peter.ujfalusi@linux.intel.com Signed-off-by: Mark Brown broonie@kernel.org

--

Commit: https://git.seco.com/clea-os/bsp/mediatek/linux-seco-mtk/-/commit/0aa19651f1d6631eeb6c9b0c70b1ea76997e7215

UPSTREAM: ASoC: SOF: make ctx_store and ctx_restore as optional

Commit 657774acd00f ("ASoC: SOF: Make sof_suspend/resume IPC agnostic") did not marked ctx_store and ctx_restore as Optional.

Fixes: 657774acd00f ("ASoC: SOF: Make sof_suspend/resume IPC agnostic") Change-Id: I9778e4988f6593c54b447a13f82f90379d8372d5 Signed-off-by: Peter Ujfalusi peter.ujfalusi@linux.intel.com Reviewed-by: Ranjani Sridharan ranjani.sridharan@linux.intel.com Reviewed-by: Bard Liao yung-chuan.liao@linux.intel.com Reviewed-by: Pierre-Louis Bossart pierre-louis.bossart@linux.intel.com Link: https://lore.kernel.org/r/20220610083549.16773-2-peter.ujfalusi@linux.intel.com Signed-off-by: Mark Brown broonie@kernel.org

--

Commit: https://git.seco.com/clea-os/bsp/mediatek/linux-seco-mtk/-/commit/7970120443c57cc6ef458a079991e92b87fc4119

UPSTREAM: ASoC: SOF: mediatek: mt8195 suspend check dsp idle

During suspend flow, sof_suspend will be called and the pm_ops->ctx_save callback notifies DSP of the upcoming power down.

Upon receipt of the ctx_save IPC, the DSP will start the D3 transition. Before the DSP enter idle, an interrupt is generated to notify the host of the power state change.

Since the host and DSP are two different processors, there could be a race condition, which can be avoided by polling with 1s timeout and 500us intervals

Reviewed-by: Péter Ujfalusi peter.ujfalusi@linux.intel.com Change-Id: I7731c7321c45100c91baf9e74468293749acb558 Signed-off-by: YC Hung yc.hung@mediatek.com Signed-off-by: Pierre-Louis Bossart pierre-louis.bossart@linux.intel.com Link: https://lore.kernel.org/r/20220606210212.146626-6-pierre-louis.bossart@linux.intel.com Signed-off-by: Mark Brown broonie@kernel.org

--

Commit: https://git.seco.com/clea-os/bsp/mediatek/linux-seco-mtk/-/commit/4b91279cf3f263eb3fcbb9e940149d0af89ebc82

UPSTREAM: ASoC: SOF: mediatek: mt8195 modify dram type as non-cache

Modify dram as non-cache memory type to avoid wrong access between host and dsp side and get the size of shared dma from device tree.

Reviewed-by: Curtis Malainey cujomalainey@chromium.org Reviewed-by: Ranjani Sridharan ranjani.sridharan@linux.intel.com Change-Id: Ibdb0a2864e901877df9b0b17f7e347294159c8b5 Signed-off-by: YC Hung yc.hung@mediatek.com Signed-off-by: Pierre-Louis Bossart pierre-louis.bossart@linux.intel.com Link: https://lore.kernel.org/r/20220606210212.146626-5-pierre-louis.bossart@linux.intel.com Signed-off-by: Mark Brown broonie@kernel.org

--

Commit: https://git.seco.com/clea-os/bsp/mediatek/linux-seco-mtk/-/commit/5fdc8dd59a5ad0ce796f5b56d7d959d748fe564a

UPSTREAM: ASoC: SOF: mediatek: Add shared_size for mediatek common chip information

Add shared_size for mediatek common chip information which is used for audio and trace dma.

Reviewed-by: Curtis Malainey cujomalainey@chromium.org Reviewed-by: Ranjani Sridharan ranjani.sridharan@linux.intel.com Change-Id: I107a29274abfb28e914a55feb1db3bf1cd3b1bd8 Signed-off-by: YC Hung yc.hung@mediatek.com Signed-off-by: Pierre-Louis Bossart pierre-louis.bossart@linux.intel.com Link: https://lore.kernel.org/r/20220606210212.146626-4-pierre-louis.bossart@linux.intel.com Signed-off-by: Mark Brown broonie@kernel.org

--

Commit: https://git.seco.com/clea-os/bsp/mediatek/linux-seco-mtk/-/commit/b38a6790cda2100055cab854b26b2deccef64678

UPSTREAM: ASoC: SOF: mediatek: revise mt8195 clock sequence

clock enable : enable and set audio_h selection as 26M.

Reviewed-by: Bard Liao yung-chuan.liao@linux.intel.com Reviewed-by: Péter Ujfalusi peter.ujfalusi@linux.intel.com Change-Id: I1deeefdd616eb6b90ba20df97da7ae5ef86dc04d Signed-off-by: YC Hung yc.hung@mediatek.com Signed-off-by: Pierre-Louis Bossart pierre-louis.bossart@linux.intel.com Link: https://lore.kernel.org/r/20220606210212.146626-3-pierre-louis.bossart@linux.intel.com Signed-off-by: Mark Brown broonie@kernel.org

--

Commit: https://git.seco.com/clea-os/bsp/mediatek/linux-seco-mtk/-/commit/c8678d37584f75f42f9d112b4ef56da85500ed77

BACKPORT: ASoC: SOF: ipc-msg-injector: Propagate write errors correctly

This code is supposed to propagate errors from simple_write_to_buffer() or return -EFAULT if "size != count". However "size" needs to be signed for the code to work correctly and the case where "size == 0" is not handled correctly.

Fixes: 066c67624d8c ("ASoC: SOF: ipc-msg-injector: Add support for IPC4 messages") Fixes: 2f0b1b013bbc ("ASoC: SOF: debug: Add support for IPC message injection") Change-Id: Ib317b9f2c1eeda9f80e984e8077fefcbda38c6ee Signed-off-by: Dan Carpenter dan.carpenter@oracle.com Acked-by: Peter Ujfalusi peter.ujfalusi@linux.intel.com Link: https://lore.kernel.org/r/Yph+Cd+JrfOH0i7z@kili Signed-off-by: Mark Brown broonie@kernel.org

--

Commit: https://git.seco.com/clea-os/bsp/mediatek/linux-seco-mtk/-/commit/b15c7db856219b4b252407ac81a67df81e52fb4d

UPSTREAM: ASoC: SOF: Fix potential NULL pointer dereference

Cleanup path for sof_prepare_widgets_in_path() should check if unprepare callback exists before calling it, instead it checks if it does not exist. Fix the check.

Change-Id: Ic7cdbb3739a782505be791bb18bf28d9ae5a8a2c Signed-off-by: Amadeusz Sławiński amadeuszx.slawinski@linux.intel.com Reviewed-by: Ranjani Sridharan ranjani.sridharan@linux.intel.com Link: https://lore.kernel.org/r/20220602135757.3335351-1-amadeuszx.slawinski@linux.intel.com Signed-off-by: Mark Brown broonie@kernel.org

--

Commit: https://git.seco.com/clea-os/bsp/mediatek/linux-seco-mtk/-/commit/be37e77d6c0be4b419b02800fd1727c07c0eb434

UPSTREAM: dt-bindings: mailbox: mtk,adsp-mbox: add mt8186 compatible name

Add compatible name for MediaTek MT8186 SoC ADSP mailbox.

Change-Id: I1118ea7ba9576d75884769cc1ae8c055930e6432 Signed-off-by: Tinghan Shen tinghan.shen@mediatek.com Acked-by: Rob Herring robh@kernel.org Signed-off-by: Jassi Brar jaswinder.singh@linaro.org

--

Commit: https://git.seco.com/clea-os/bsp/mediatek/linux-seco-mtk/-/commit/850529798d15110d313e60ab00119160d79a505e

UPSTREAM: mailbox: mediatek: support mt8186 adsp mailbox

Add support of mt8186 adsp mailbox.

Change-Id: Ic2cb1fead4766a52ba28cd13147f278ca97e0623 Signed-off-by: Tinghan Shen tinghan.shen@mediatek.com Signed-off-by: Jassi Brar jaswinder.singh@linaro.org

--

Commit: https://git.seco.com/clea-os/bsp/mediatek/linux-seco-mtk/-/commit/48fb75c248e0a6a22683db20c473d445d7ba74fd

UPSTREAM: ASoC: SOF: mediatek: remove duplicate include in mt8195.c

Fix following checkincludes.pl warning: sound/soc/sof/mediatek/mt8195/mt8195.c: linux/of_platform.h is included more than once.

Change-Id: I492c384d45e64803f090f569de8184c0c77291d5 Signed-off-by: Wan Jiabing wanjiabing@vivo.com Link: https://lore.kernel.org/r/20220518125902.13407-1-wanjiabing@vivo.com Signed-off-by: Mark Brown broonie@kernel.org

--

Commit: https://git.seco.com/clea-os/bsp/mediatek/linux-seco-mtk/-/commit/37c7182716577eb7a99cfb122ad77e51db41ac36

UPSTREAM: ASoC: SOF: mediatek: Add mt8195 debug dump

Add mt8195_adsp_dump in mt8195.c for debug_dump callback to dump mt8195 debug registers and call mtk_adsp_dump.

Reviewed-by: Ranjani Sridharan ranjani.sridharan@linux.intel.com Change-Id: I32db4593c76815adcbd9f0f9051358628152fbd3 Signed-off-by: YC Hung yc.hung@mediatek.com Signed-off-by: Pierre-Louis Bossart pierre-louis.bossart@linux.intel.com Link: https://lore.kernel.org/r/20220517173109.468568-3-pierre-louis.bossart@linux.intel.com Signed-off-by: Mark Brown broonie@kernel.org

--

Commit: https://git.seco.com/clea-os/bsp/mediatek/linux-seco-mtk/-/commit/17a6e6550186759af093013c98636ea5ca4b0484

UPSTREAM: ASoC: SOF: mediatek: Add mediatek common debug dump

1.Add mtk-adsp-common.c file for mediatek platforms common usage. 2.Add mtk_adsp_dump implementation in mtk-adsp-common.c for general debug dump.

Reviewed-by: Ranjani Sridharan ranjani.sridharan@linux.intel.com Change-Id: I4d682fe6c006417d690fea83918ccf1a5076e8ab Signed-off-by: YC Hung yc.hung@mediatek.com Signed-off-by: Pierre-Louis Bossart pierre-louis.bossart@linux.intel.com Link: https://lore.kernel.org/r/20220517173109.468568-2-pierre-louis.bossart@linux.intel.com Signed-off-by: Mark Brown broonie@kernel.org

--

Commit: https://git.seco.com/clea-os/bsp/mediatek/linux-seco-mtk/-/commit/b58340de75ba5b23d3afab14cfcfe709808b8f31

UPSTREAM: ASoC: SOF: ipc3-dtrace: Move dtrace related variables local from sof_dev

The variables and structs for DMA trace can be moved local to ipc3-dtrace.c and the storage can be allocated dynamically, stored behind the fw_trace_data pointer.

Change-Id: Ic0bb6503b4d5cc4f2e39c8d0b3e945db587938eb Signed-off-by: Peter Ujfalusi peter.ujfalusi@linux.intel.com Reviewed-by: Paul Olaru paul.olaru@oss.nxp.com Reviewed-by: Pierre-Louis Bossart pierre-louis.bossart@linux.intel.com Reviewed-by: Bard Liao yung-chuan.liao@linux.intel.com Reviewed-by: Ranjani Sridharan ranjani.sridharan@linux.intel.com Link: https://lore.kernel.org/r/20220516104711.26115-9-peter.ujfalusi@linux.intel.com Signed-off-by: Mark Brown broonie@kernel.org

--

Commit: https://git.seco.com/clea-os/bsp/mediatek/linux-seco-mtk/-/commit/b22cace2417b7dbbd20c3aa44535e72186c0249d

UPSTREAM: ASoC: SOF: Introduce opaque storage of private data for firmware tracing

Firmware tracing implementations can allocate and store their privately used data behind the fw_trace_pdata pointer instead of adding more members to struct snd_sof_dev.

Change-Id: Ia3998f264d0b7fbd76708cb44726b316e5023710 Signed-off-by: Peter Ujfalusi peter.ujfalusi@linux.intel.com Reviewed-by: Paul Olaru paul.olaru@oss.nxp.com Reviewed-by: Pierre-Louis Bossart pierre-louis.bossart@linux.intel.com Reviewed-by: Bard Liao yung-chuan.liao@linux.intel.com Reviewed-by: Ranjani Sridharan ranjani.sridharan@linux.intel.com Link: https://lore.kernel.org/r/20220516104711.26115-8-peter.ujfalusi@linux.intel.com Signed-off-by: Mark Brown broonie@kernel.org

--

Commit: https://git.seco.com/clea-os/bsp/mediatek/linux-seco-mtk/-/commit/b0b39dbd94165dfcb074c73f9aa73a7a5a540d81

BACKPORT: ASoC: SOF: Modify the host trace_init parameter list to include dmab

Stop host code (AMD, Intel) to access sdev->dmatb directly. Modify the trace_init prototype to include the pointer to a struct snd_dma_buffer. The ipc3-dtrace passes for now the pointer to sdev->dmatb, but the aim is to move all tracing related runtime information local to a trace implementation.

Change-Id: Id3c91b42be41a52b539ff6bc62dc1000003d94a7 Signed-off-by: Peter Ujfalusi peter.ujfalusi@linux.intel.com Reviewed-by: Paul Olaru paul.olaru@oss.nxp.com Reviewed-by: Pierre-Louis Bossart pierre-louis.bossart@linux.intel.com Reviewed-by: Bard Liao yung-chuan.liao@linux.intel.com Reviewed-by: Ranjani Sridharan ranjani.sridharan@linux.intel.com Link: https://lore.kernel.org/r/20220516104711.26115-7-peter.ujfalusi@linux.intel.com Signed-off-by: Mark Brown broonie@kernel.org

--

Commit: https://git.seco.com/clea-os/bsp/mediatek/linux-seco-mtk/-/commit/bd1ec2f1c2bca50008aa02e9eb3d325dcd94a47e

UPSTREAM: ASoC: SOF: ipc3-dtrace: Move host ops wrappers from generic header to private

Move the snd_sof_dma_trace_* ops wrappers from ops.h to ipc3-priv.h since they are not used outside of IPC3 code. While moving, rename them to sof_dtrace_host_*

Change-Id: I6830e9659aac67f1cc60564e0df910486d66b06c Signed-off-by: Peter Ujfalusi peter.ujfalusi@linux.intel.com Reviewed-by: Paul Olaru paul.olaru@oss.nxp.com Reviewed-by: Pierre-Louis Bossart pierre-louis.bossart@linux.intel.com Reviewed-by: Bard Liao yung-chuan.liao@linux.intel.com Reviewed-by: Ranjani Sridharan ranjani.sridharan@linux.intel.com Link: https://lore.kernel.org/r/20220516104711.26115-6-peter.ujfalusi@linux.intel.com Signed-off-by: Mark Brown broonie@kernel.org

--

Commit: https://git.seco.com/clea-os/bsp/mediatek/linux-seco-mtk/-/commit/273d6d8eaadad02a16d45347d85fd8402c160e70

UPSTREAM: ASoC: SOF: Switch to IPC generic firmware tracing

Introduce new, generic API for firmware tracing with sof_fw_trace_ prefix and switch to use it. At the same time the old IPC3 code can be dropped from trace.c, which is now a generic wrapper for the firmware tracing ops.

Change-Id: Id58fbf9825e51e14d04e3075d87587ff297e537c Signed-off-by: Peter Ujfalusi peter.ujfalusi@linux.intel.com Reviewed-by: Ranjani Sridharan ranjani.sridharan@linux.intel.com Reviewed-by: Bard Liao yung-chuan.liao@linux.intel.com Reviewed-by: Pierre-Louis Bossart pierre-louis.bossart@linux.intel.com Link: https://lore.kernel.org/r/20220516104711.26115-5-peter.ujfalusi@linux.intel.com Signed-off-by: Mark Brown broonie@kernel.org

--

Commit: https://git.seco.com/clea-os/bsp/mediatek/linux-seco-mtk/-/commit/61d002fd60227485a7f3dfbe31bdea77e20011a0

BACKPORT: ASoC: SOF: Clone the trace code to ipc3-dtrace as fw_tracing implementation

The existing trace.c file is implementing the IPC3 dma-trace support.

Clone the existing code with prefix fixes as ipc3 fw_tracing implementation to be used when the core is converted to use generic ops for firmware tracing.

Drop the dual licensing of the content as the implementation is based on debugfs.

Change-Id: Ibfe23f7f904b20920ed60e284a7ae55038eaab44 Signed-off-by: Peter Ujfalusi peter.ujfalusi@linux.intel.com Reviewed-by: Ranjani Sridharan ranjani.sridharan@linux.intel.com Reviewed-by: Bard Liao yung-chuan.liao@linux.intel.com Reviewed-by: Pierre-Louis Bossart pierre-louis.bossart@linux.intel.com Link: https://lore.kernel.org/r/20220516104711.26115-4-peter.ujfalusi@linux.intel.com Signed-off-by: Mark Brown broonie@kernel.org

--

Commit: https://git.seco.com/clea-os/bsp/mediatek/linux-seco-mtk/-/commit/8a365bbd04a872e34bb82f568b501be6944b1948

UPSTREAM: ASoC: SOF: Rename dtrace_is_supported flag to fw_trace_is_supported

Rename the internal flag to not limit it's use for dma-trace, but to be used for generic firmware tracing functionality.

Change-Id: I58eccdb18023e404503ae06e25bb578ed31b8086 Signed-off-by: Peter Ujfalusi peter.ujfalusi@linux.intel.com Reviewed-by: Ranjani Sridharan ranjani.sridharan@linux.intel.com Reviewed-by: Bard Liao yung-chuan.liao@linux.intel.com Reviewed-by: Pierre-Louis Bossart pierre-louis.bossart@linux.intel.com Link: https://lore.kernel.org/r/20220516104711.26115-3-peter.ujfalusi@linux.intel.com Signed-off-by: Mark Brown broonie@kernel.org

--

Commit: https://git.seco.com/clea-os/bsp/mediatek/linux-seco-mtk/-/commit/312981e1f940210124823791001262f8cf773bb9

UPSTREAM: ASoC: SOF: Introduce IPC independent ops for firmware tracing support

The current (dma-)trace is only supported with IPC3, it is not available when IPC4 is used.

Change-Id: Ib07c5675d480e0a26044f925780f23579cfe65ec Signed-off-by: Peter Ujfalusi peter.ujfalusi@linux.intel.com Reviewed-by: Ranjani Sridharan ranjani.sridharan@linux.intel.com Reviewed-by: Bard Liao yung-chuan.liao@linux.intel.com Reviewed-by: Pierre-Louis Bossart pierre-louis.bossart@linux.intel.com Link: https://lore.kernel.org/r/20220516104711.26115-2-peter.ujfalusi@linux.intel.com Signed-off-by: Mark Brown broonie@kernel.org

--

Commit: https://git.seco.com/clea-os/bsp/mediatek/linux-seco-mtk/-/commit/4a8590fe40b72aa622b4bf5a4f8762fad891341f

UPSTREAM: ASoC: SOF: mediatek: Add mt8186 ipc support

mt8186 DSP uses two hardware mailbox IP to communicate with AP. One mailbox is used for requests coming from AP, and the other one is for requests from DSP.

Change-Id: Ie08663711a7e839af4444a4ee30f143d5aad9cbe Signed-off-by: Allen-KH Cheng Allen-KH.Cheng@mediatek.com Signed-off-by: Tinghan Shen tinghan.shen@mediatek.com Link: https://lore.kernel.org/r/20220512082215.3018-4-tinghan.shen@mediatek.com Signed-off-by: Mark Brown broonie@kernel.org

--

Commit: https://git.seco.com/clea-os/bsp/mediatek/linux-seco-mtk/-/commit/9768cee2ed3adde837bbccada3ddc4f1c08ca393

UPSTREAM: ASoC: SOF: mediatek: Add ipc support for mt8195

This patch adds mt8195 IPC support by using mailbox.

On mt8195 resource, there are two mboxes used to handle ipc request and reply. We create a mtk-adsp-ipc client device to request mbox controllers.

Change-Id: Ib8bcd036172d47fe62042fb6b45c9a772501cc93 Signed-off-by: Allen-KH Cheng Allen-KH.Cheng@mediatek.com Reported-by: kernel test robot lkp@intel.com Link: https://lore.kernel.org/r/20220512082215.3018-3-tinghan.shen@mediatek.com Signed-off-by: Mark Brown broonie@kernel.org

--

Commit: https://git.seco.com/clea-os/bsp/mediatek/linux-seco-mtk/-/commit/50b6ceeaf67409f6b818e7ab032aae174c6d8c21

UPSTREAM: firmware: mediatek: Add adsp ipc protocol interface

Some of mediatek processors contain the Tensilica HiFix DSP for audio processing.

The communication between Host CPU and DSP firmware is taking place using a shared memory area for message passing.

ADSP IPC protocol offers (send/recv) interfaces using mediatek-mailbox APIs.

We use two mbox channels to implement a request-reply protocol.

Change-Id: Ib7c05f263189332506da3f00d10901b585d2a7f2 Signed-off-by: Allen-KH Cheng allen-kh.cheng@mediatek.com Signed-off-by: TingHan Shen tinghan.shen@mediatek.com Reviewed-by: Pierre-Louis Bossart pierre-louis.bossart@linux.intel.com Reviewed-by: Curtis Malainey cujomalainey@chromium.org Reviewed-by: Tzung-Bi Shih tzungbi@google.com Reviewed-by: YC Hung yc.hung@mediatek.com Reviewed-by: AngeloGioacchino Del Regno angelogioacchino.delregno@collabora.com Link: https://lore.kernel.org/r/20220512082215.3018-2-tinghan.shen@mediatek.com Signed-off-by: Mark Brown broonie@kernel.org

--

Commit: https://git.seco.com/clea-os/bsp/mediatek/linux-seco-mtk/-/commit/9f8f6b04c8a29d078673e417811745c016db3271

BACKPORT: ASoC: SOF: ipc: introduce cont_update_posn in sof_ipc_stream_params struct

The host stream position is updated when no_stream_position is set as 0. However current implementation updates host stream position only when report data is larger than or equal to host period size which is decided by the period size of host side. It maybe cause host stream position update not in time. Therefore this patch introduces another field "cont_update_posn", a boolean value aimed to update host stream position continuously and based on period size of pipeline. It can get better precise when need to update host stream position from firmware.

Reviewed-by: Daniel Baluta daniel.baluta@nxp.com Reviewed-by: Ranjani Sridharan ranjani.sridharan@linux.intel.com Reviewed-by: Kai Vehmanen kai.vehmanen@linux.intel.com Signed-off-by: YC Hung yc.hung@mediatek.com Signed-off-by: Pierre-Louis Bossart pierre-louis.bossart@linux.intel.com Link: https://lore.kernel.org/r/20220509170425.54640-1-pierre-louis.bossart@linux.intel.com Signed-off-by: Mark Brown broonie@kernel.org

This commit directly bumps the SOF ABI version to 21.0 and skips commit afe57ecab58b976c54fcbc31d718f936a0cc98cc.

Change-Id: I62ae0f151102da97ca101a5ae8decb46242aa4e7 Signed-off-by: Suhrid Subramaniam suhrid.subramaniam@mediatek.com

--

Commit: https://git.seco.com/clea-os/bsp/mediatek/linux-seco-mtk/-/commit/a1ccd529d9986139a487c3e1f51759d09c56861c

UPSTREAM: ASoC: SOF: trace: The dtrace is only available with SOF_IPC

Currently the dtrace only supported with SOF_IPC.

Change-Id: Ia2edbe7efed53c615e9fd6f59936b71397e0a96a Signed-off-by: Peter Ujfalusi peter.ujfalusi@linux.intel.com Reviewed-by: Bard Liao yung-chuan.liao@linux.intel.com Reviewed-by: Rander Wang rander.wang@intel.com Reviewed-by: Pierre-Louis Bossart pierre-louis.bossart@linux.intel.com Reviewed-by: Ranjani Sridharan ranjani.sridharan@linux.intel.com Link: https://lore.kernel.org/r/20220506130229.23354-1-peter.ujfalusi@linux.intel.com Signed-off-by: Mark Brown broonie@kernel.org

--

Commit: https://git.seco.com/clea-os/bsp/mediatek/linux-seco-mtk/-/commit/3c3d6c012dd40e7608df691d06ff8dedca5b51a1

UPSTREAM: ASoC: SOF: sof-client: IPC flood test can only work with SOF_IPC

Currently the ipc flood test is only supported with SOF_IPC.

Change-Id: Ibbe860e6a045d9e8548e26790ef11b3d761214ba Signed-off-by: Peter Ujfalusi peter.ujfalusi@linux.intel.com Reviewed-by: Bard Liao yung-chuan.liao@linux.intel.com Reviewed-by: Rander Wang rander.wang@intel.com Reviewed-by: Pierre-Louis Bossart pierre-louis.bossart@linux.intel.com Reviewed-by: Ranjani Sridharan ranjani.sridharan@linux.intel.com Link: https://lore.kernel.org/r/20220506132647.18690-9-peter.ujfalusi@linux.intel.com Signed-off-by: Mark Brown broonie@kernel.org

--

Commit: https://git.seco.com/clea-os/bsp/mediatek/linux-seco-mtk/-/commit/0852f6b4e2c15e6c470576aef2f5c5a96f68ef39

UPSTREAM: ASoC: SOF: ipc-msg-injector: Separate the message sending

Move out the code for sending the IPC message into a separate helper function in preparation for support for handling IPC4 communication.

Change-Id: I3394ac8fd823a342a3e53755cb9dc006991ac13d Signed-off-by: Peter Ujfalusi peter.ujfalusi@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: Bard Liao yung-chuan.liao@linux.intel.com Link: https://lore.kernel.org/r/20220506132647.18690-7-peter.ujfalusi@linux.intel.com Signed-off-by: Mark Brown broonie@kernel.org

--

Commit: https://git.seco.com/clea-os/bsp/mediatek/linux-seco-mtk/-/commit/c56cb1f71cb07a5531f2b3d1676ebd9b2c6d630c

BACKPORT: ASoC: SOF: sof-client: Add support IPC4 message sending

In order to be able to send an IPC4 message, the sof_client_ipc_tx_message() needs to parse the tx message differently to extract the size.

The IPC notification registration is done by providing the notification type and the whole message is passed to the client when a match is found.

Change-Id: Ic4c1c4de03b333a7c4bbdaa890d2ad82d675ad2a Signed-off-by: Peter Ujfalusi peter.ujfalusi@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: Bard Liao yung-chuan.liao@linux.intel.com Link: https://lore.kernel.org/r/20220506132647.18690-6-peter.ujfalusi@linux.intel.com Signed-off-by: Mark Brown broonie@kernel.org

--

Commit: https://git.seco.com/clea-os/bsp/mediatek/linux-seco-mtk/-/commit/8873e17fcd6940852d5148fed11dfb8c4d29b366

UPSTREAM: ASoC: SOF: sof-client: Add API to get the ipc_type

Provide a way for the client drivers to query the ipc_type used by the firmware.

Change-Id: I6096057a7d3f7dcb422ca332b9ea3e4113d5b65f Signed-off-by: Peter Ujfalusi peter.ujfalusi@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: Bard Liao yung-chuan.liao@linux.intel.com Link: https://lore.kernel.org/r/20220506132647.18690-5-peter.ujfalusi@linux.intel.com Signed-off-by: Mark Brown broonie@kernel.org

--

Commit: https://git.seco.com/clea-os/bsp/mediatek/linux-seco-mtk/-/commit/02f3c5d26fa3685c647c9e7dfa1cc4cb9e01c0d9

UPSTREAM: ASoC: SOF: sof-client-probes: Query the maximum IPC payload size

Instead of using the SOF_IPC_MSG_MAX_SIZE as the maximum payload size for and IPC message, use the provided API to query it.

Change-Id: I7e9366570428eb2f800e008cfb0051a3623bf518 Signed-off-by: Peter Ujfalusi peter.ujfalusi@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: Bard Liao yung-chuan.liao@linux.intel.com Link: https://lore.kernel.org/r/20220506132647.18690-4-peter.ujfalusi@linux.intel.com Signed-off-by: Mark Brown broonie@kernel.org

--

Commit: https://git.seco.com/clea-os/bsp/mediatek/linux-seco-mtk/-/commit/283e2dd9a15dae8a8dd76a15b718909d04edfef7

UPSTREAM: ASoC: SOF: ipc-msg-injector: Query the maximum IPC payload size

Instead of using the SOF_IPC_MSG_MAX_SIZE as the maximum payload size for and IPC message, use the provided API to query it.

Change-Id: Idd3354a5e802f959f5d5580aec35d2aaddd3be8e Signed-off-by: Peter Ujfalusi peter.ujfalusi@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: Bard Liao yung-chuan.liao@linux.intel.com Link: https://lore.kernel.org/r/20220506132647.18690-3-peter.ujfalusi@linux.intel.com Signed-off-by: Mark Brown broonie@kernel.org

--

Commit: https://git.seco.com/clea-os/bsp/mediatek/linux-seco-mtk/-/commit/10acb92bc1a81c1d88fd305d63a0b40675f70393

UPSTREAM: ASoC: SOF: sof-client: Add API to get the maximum IPC payload size

Provide a way for the client drivers to query the maximum payload size of an IPC message. Currently clients do not have access to this information and they can only use the SOF_IPC_MSG_MAX_SIZE defined value.

Change-Id: Id248fc6b772ebdaa8176d2cc3d77889f1799553e Signed-off-by: Peter Ujfalusi peter.ujfalusi@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: Bard Liao yung-chuan.liao@linux.intel.com Link: https://lore.kernel.org/r/20220506132647.18690-2-peter.ujfalusi@linux.intel.com Signed-off-by: Mark Brown broonie@kernel.org

--

Commit: https://git.seco.com/clea-os/bsp/mediatek/linux-seco-mtk/-/commit/08a848bf34445af90010e710daff842be87de2a5

UPSTREAM: ASoC: SOF: Add rx_data pointer to snd_sof_ipc_msg struct

The rx_data pointer can be used by IPC implementations to pass the received message (or part of the message, like the header) from platform code to generic, high level IPC code.

IPC4 is going to be the first user of this as its implementation on Intel platforms detaches the header and payload and the rx cannot be handled in a similar way as it is implemented for ipc3.

If the rx_data is dynamically allocated, it is up to the platform code to free it up. After the message reception handling (rx_msg ops) returned, the pointer via the msg->rx_data should be considered as invalid.

Change-Id: I5308a67bd34a2c5639d5736849ca59851cb90266 Signed-off-by: Peter Ujfalusi peter.ujfalusi@linux.intel.com Reviewed-by: Bard Liao yung-chuan.liao@linux.intel.com Reviewed-by: Rander Wang rander.wang@intel.com Reviewed-by: Pierre-Louis Bossart pierre-louis.bossart@linux.intel.com Reviewed-by: Ranjani Sridharan ranjani.sridharan@linux.intel.com Link: https://lore.kernel.org/r/20220505094818.10346-2-peter.ujfalusi@linux.intel.com Signed-off-by: Mark Brown broonie@kernel.org

--

Commit: https://git.seco.com/clea-os/bsp/mediatek/linux-seco-mtk/-/commit/c05fdf04fa7ed9c9bc217496a9541c28f3170e67

UPSTREAM: ASoC: SOF: ipc3: Remove the ipc3-ops.h header file

Only the main IPC ops struct should be visible outside of IPC3 code to make sure that the code is correctly abstracted.

Instead of keeping the ipc3-ops.h with only the high level ops struct declaration, put the ipc3_ops to sof-priv.h and move all other ops struct declaration into ipc3-priv.h

New IPC implementation should follow this route: the main IPC ops should be declared in sof-priv.h and no other IPC version related header be used for generic code.

Change-Id: I35d03a89533ad3a0466a90a89b51cffbceec3ccc Signed-off-by: Peter Ujfalusi peter.ujfalusi@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: Bard Liao yung-chuan.liao@linux.intel.com Link: https://lore.kernel.org/r/20220504102831.10071-1-peter.ujfalusi@linux.intel.com Signed-off-by: Mark Brown broonie@kernel.org

--

Commit: https://git.seco.com/clea-os/bsp/mediatek/linux-seco-mtk/-/commit/1f5bf8e767107c4d56a59801bf613b10bf3788c1

UPSTREAM: ASoC: SOF: ipc3-topology: Correct get_control_data for non bytes payload

It is possible to craft a topology where sof_get_control_data() would do out of bounds access because it expects that it is only called when the payload is bytes type. Confusingly it also handles other types of controls, but the payload parsing implementation is only valid for bytes.

Fix the code to count the non bytes controls and instead of storing a pointer to sof_abi_hdr in sof_widget_data (which is only valid for bytes), store the pointer to the data itself and add a new member to save the size of the data.

In case of non bytes controls we store the pointer to the chanv itself, which is just an array of values at the end.

In case of bytes control, drop the wrong cdata->data (wdata[i].pdata) check against NULL since it is incorrect and invalid in this context. The data is pointing to the end of cdata struct, so it should never be null.

Reported-by: Sergey Senozhatsky senozhatsky@chromium.org Change-Id: Ie0d807f0f60390302da71e2800ea439b15cbdf48 Signed-off-by: Peter Ujfalusi peter.ujfalusi@linux.intel.com Reviewed-by: Sergey Senozhatsky senozhatsky@chromium.org Tested-by: Sergey Senozhatsky senozhatsky@chromium.org Link: https://lore.kernel.org/r/20220427185221.28928-1-peter.ujfalusi@linux.intel.com Signed-off-by: Mark Brown broonie@kernel.org

--

Commit: https://git.seco.com/clea-os/bsp/mediatek/linux-seco-mtk/-/commit/e925b10b25287717145344689f782cfdab927380

UPSTREAM: ASoC: dsp: mediatek: add mt8195 dsp document

This patch adds mt8195 dsp document. The dsp is used for Sound Open Firmware driver node. It includes registers, clocks, memory regions, and mailbox for dsp.

Change-Id: I8d06e3215b69e8d31dcc9e2e9eeeccbf8828c70e Signed-off-by: yc.hung yc.hung@mediatek.com Reviewed-by: Rob Herring robh@kernel.org Link: https://lore.kernel.org/r/20220106064847.15588-1-yc.hung@mediatek.com Signed-off-by: Mark Brown broonie@kernel.org

--

Commit: https://git.seco.com/clea-os/bsp/mediatek/linux-seco-mtk/-/commit/d104b0f412b88a8c493b67956fef7cbb83042c43

UPSTREAM: ASoC: SOF: sof-pci-dev: fix missing pci_release_regions() on error in sof_pci_probe()

Fix the missing pci_release_regions() before return from sof_pci_probe() in the error handling case.

Fixes: 4bfbbb76e82e ("ASOC: SOF: pci: add ipc_type override for Intel IPC4 tests") Reported-by: Hulk Robot hulkci@huawei.com Change-Id: I83b393d9f32229b347413dd35e9dcd82a4c1217f Signed-off-by: Yang Yingliang yangyingliang@huawei.com Link: https://lore.kernel.org/r/20220426132539.416676-1-yangyingliang@huawei.com Signed-off-by: Mark Brown broonie@kernel.org

--

Commit: https://git.seco.com/clea-os/bsp/mediatek/linux-seco-mtk/-/commit/b64cf5b061e339e56dbad12eab3935d6269c7405

UPSTREAM: ASoC: SOF: loader: Call optional query_fw_configuration on first boot

Execute the firmware information query on the first boot if it is available.

Change-Id: I305456b94fe3e0a60b8a8a96c2f938b74af00bd2 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 Reviewed-by: Rander Wang rander.wang@intel.com Signed-off-by: Ranjani Sridharan ranjani.sridharan@linux.intel.com Link: https://lore.kernel.org/r/20220425221129.124615-11-ranjani.sridharan@linux.intel.com Signed-off-by: Mark Brown broonie@kernel.org

--

Commit: https://git.seco.com/clea-os/bsp/mediatek/linux-seco-mtk/-/commit/df510c0f08a5ba6765026552b2aca786e00305cd

UPSTREAM: ASoC: SOF: loader: Remove snd_sof_parse_module_memcpy() as it is not used

The snd_sof_parse_module_memcpy() is no longer used and we have the implementation of it in ipc3-loader.c which is a default mode to load module(s) with IPC3 if the snd_sof_load_firmware_memcpy() is used for loading the firmware.

Change-Id: I2156f1da2d7b8ad42fc4f27c1652f96438e084c8 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 Reviewed-by: Rander Wang rander.wang@intel.com Signed-off-by: Ranjani Sridharan ranjani.sridharan@linux.intel.com Link: https://lore.kernel.org/r/20220425221129.124615-10-ranjani.sridharan@linux.intel.com Signed-off-by: Mark Brown broonie@kernel.org

--

Commit: https://git.seco.com/clea-os/bsp/mediatek/linux-seco-mtk/-/commit/913a5484e4bf5c86d617bcedfbd3e80943bd1c98

UPSTREAM: ASoC: SOF: mediatek: mt8195: Do not set the load_module ops

The used firmware loader (snd_sof_load_firmware_memcpy) can use the generic module loading, which is by default uses the same implementation as the snd_sof_parse_module_memcpy.

No need to set the callback for this platform.

Change-Id: I011a97469ac95faeb77096684063af57d38772f8 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 Reviewed-by: Rander Wang rander.wang@intel.com Signed-off-by: Ranjani Sridharan ranjani.sridharan@linux.intel.com Link: https://lore.kernel.org/r/20220425221129.124615-9-ranjani.sridharan@linux.intel.com Signed-off-by: Mark Brown broonie@kernel.org

--

Commit: https://git.seco.com/clea-os/bsp/mediatek/linux-seco-mtk/-/commit/a12e5665ccfdfac6740355d4a2cbaf80de407892

UPSTREAM: ASoC: SOF: loader: Switch to use the fw_loader ops

Since we have the fw_loader ops implementation for IPC3, we can start using it and remove most of the IPC dependent code from the file.

Change-Id: I98692aee56ad23a98b3ff176d467b4ee25cadbec 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 Reviewed-by: Rander Wang rander.wang@intel.com Signed-off-by: Ranjani Sridharan ranjani.sridharan@linux.intel.com Link: https://lore.kernel.org/r/20220425221129.124615-5-ranjani.sridharan@linux.intel.com Signed-off-by: Mark Brown broonie@kernel.org

--

Commit: https://git.seco.com/clea-os/bsp/mediatek/linux-seco-mtk/-/commit/c5ae2d084705252db842fdfdc4c4b2c90e3d66d4

UPSTREAM: ASoC: SOF: ipc: Add check for fw_loader ops

Add checks for the mandatory fw_loader ops.

Change-Id: If04fb5eb15b5b3c9b1418772103a8e3e79106993 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 Reviewed-by: Rander Wang rander.wang@intel.com Signed-off-by: Ranjani Sridharan ranjani.sridharan@linux.intel.com Link: https://lore.kernel.org/r/20220425221129.124615-4-ranjani.sridharan@linux.intel.com Signed-off-by: Mark Brown broonie@kernel.org

--

Commit: https://git.seco.com/clea-os/bsp/mediatek/linux-seco-mtk/-/commit/33d794d1c198cfc50a522bb1f7dd5baf14000b48

UPSTREAM: ASoC: SOF: ipc3-loader: Implement firmware parsing and loading

Add the IPC3 dependent implementation of validating the firmware image, parsing the ext manifest and to load modules via memcpy.

The code introduced by this commit is the IPC dependent code from the loader.c, which is going to be removed later.

Change-Id: I63006d3307efb40c6e47036cfcbfb349d585e486 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 Reviewed-by: Rander Wang rander.wang@intel.com Signed-off-by: Ranjani Sridharan ranjani.sridharan@linux.intel.com Link: https://lore.kernel.org/r/20220425221129.124615-3-ranjani.sridharan@linux.intel.com Signed-off-by: Mark Brown broonie@kernel.org

--

Commit: https://git.seco.com/clea-os/bsp/mediatek/linux-seco-mtk/-/commit/0527459c35017946ce32a1123c93c0c8de3217e1

UPSTREAM: ASoC: SOF: Introduce IPC dependent ops for firmware handling, loading

The parsing and loading of firmware modules/components are IPC dependent operations as the organization of the firmware depends on the IPC it is supporting.

Change-Id: I372263c4614091c520231fbd276f0d81542337ff 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 Reviewed-by: Rander Wang rander.wang@intel.com Signed-off-by: Ranjani Sridharan ranjani.sridharan@linux.intel.com Link: https://lore.kernel.org/r/20220425221129.124615-2-ranjani.sridharan@linux.intel.com Signed-off-by: Mark Brown broonie@kernel.org

--

Commit: https://git.seco.com/clea-os/bsp/mediatek/linux-seco-mtk/-/commit/351e8c34f6c9d18d95545eafda913a01c1280750

UPSTREAM: ASoC: SOF: Add a prepare op to IPC topology widget ops

In order to set up a pipeline with IPC4, the total memory usage for the pipeline needs to be calculated based on the list of connected widgets. Add a new ipc_prepare() op to struct sof_ipc_tplg_widget_ops that will be used to calculate the memory usage for each widget in the pipelines associated with a PCM and prepare the widget for getting set up in the DSP. The prepare step will be used to allocate memory for the IPC payload, assign instance ID and update the config data for the widget based on the runtime PCM params. Once prepared, the setup step is used to send the IPC to create the widget in the DSP.

Add an ipc_unprepare() op to unprepare the widget i.e free the memory allocated during prepare, free the instance ID etc. This should be invoked after the widget is freed.

A new flag "prepared" is added to struct snd_sof_widget to track the prepared status of widgets.

Also, IPC4 requires the platform_params and the runtime PCM params in order to prepare a widget for set up. So modify the signature of sof_pcm_setup_connected_widgets() and sof_widget_list_setup() to accept these as arguments.

Change-Id: Ib26e4dda12c1a65f4c64aa7a522c77d6e34a058e Signed-off-by: Ranjani Sridharan ranjani.sridharan@linux.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 Link: https://lore.kernel.org/r/20220426171743.171061-12-ranjani.sridharan@linux.intel.com Signed-off-by: Mark Brown broonie@kernel.org

--

Commit: https://git.seco.com/clea-os/bsp/mediatek/linux-seco-mtk/-/commit/9fbfca5edc55c10a5ebd667e70ba345cb94230b8

UPSTREAM: ASoC: SOF: clarify use of widget complete flag

Currently, the complete flag is used only for the snd_soc_dapm_scheduler type widgets to indicate that the pipeline has been set up. All other widgets do not need it. Add a comment to clarify its usage and set the complete flag to false only for the scheduler widget in sof_widget_free().

Change-Id: Ic75018d4ffe7dbe9a5867a21df15664a6ca8b196 Signed-off-by: Ranjani Sridharan ranjani.sridharan@linux.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 Link: https://lore.kernel.org/r/20220426171743.171061-11-ranjani.sridharan@linux.intel.com Signed-off-by: Mark Brown broonie@kernel.org

--

Commit: https://git.seco.com/clea-os/bsp/mediatek/linux-seco-mtk/-/commit/2d508de715d7338b3f6313fc3cc0ad9d346cfb60

UPSTREAM: ASoC: SOF: topology: Skip parsing DAI link tokens if not needed

Do not parse these tokens if they are not defined in the IPC version specific token list. In the case of IPC4 with HDA topologies for example, no DAI link specific tokens need to be added in topology.

Change-Id: I2f7f6205b984beaddd929e5c0aa880cc09d7b7c0 Signed-off-by: Ranjani Sridharan ranjani.sridharan@linux.intel.com Reviewed-by: Pierre-Louis Bossart pierre-louis.bossart@linux.intel.com Reviewed-by: Bard Liao yung-chuan.liao@linux.intel.com Reviewed-by: Péter Ujfalusi peter.ujfalusi@linux.intel.com Link: https://lore.kernel.org/r/20220426171743.171061-10-ranjani.sridharan@linux.intel.com Signed-off-by: Mark Brown broonie@kernel.org

--

Commit: https://git.seco.com/clea-os/bsp/mediatek/linux-seco-mtk/-/commit/245c753a0940916a52a1924f9271d04883788716

UPSTREAM: ASoC: SOF: pcm: remove unnecessary function declaration

sof_pcm_setup_connected_widgets() can be a static function in pcm.c. No need to declare it in the header.

Change-Id: I280ce8f97a19ddae2fad8d998e888852a92d619f Signed-off-by: Ranjani Sridharan ranjani.sridharan@linux.intel.com Reviewed-by: Pierre-Louis Bossart pierre-louis.bossart@linux.intel.com Reviewed-by: Bard Liao yung-chuan.liao@linux.intel.com Reviewed-by: Péter Ujfalusi peter.ujfalusi@linux.intel.com Link: https://lore.kernel.org/r/20220426171743.171061-9-ranjani.sridharan@linux.intel.com Signed-off-by: Mark Brown broonie@kernel.org

--

Commit: https://git.seco.com/clea-os/bsp/mediatek/linux-seco-mtk/-/commit/05b42ab7ddc7496cc0effdada3ce28e136673e91

UPSTREAM: ASoC: SOF: Add two new fields to struct snd_sof_widget

Add two new fields, instance_id and module_info to struct snd_sof_widget. instance_id for widgets will be assigned when they are set up in the DSP and reset when the widgets are freed. module_info is used to save information the firmware provides about each module in its manifest.

Change-Id: I6614a006ea4e456f29d38ef93fe11af29ca293be Signed-off-by: Ranjani Sridharan ranjani.sridharan@linux.intel.com Reviewed-by: Pierre-Louis Bossart pierre-louis.bossart@linux.intel.com Reviewed-by: Bard Liao yung-chuan.liao@linux.intel.com Reviewed-by: Péter Ujfalusi peter.ujfalusi@linux.intel.com Link: https://lore.kernel.org/r/20220426171743.171061-8-ranjani.sridharan@linux.intel.com Signed-off-by: Mark Brown broonie@kernel.org

--

Commit: https://git.seco.com/clea-os/bsp/mediatek/linux-seco-mtk/-/commit/f551ae0af3159c3a9526c2c791b1d9b688063774

UPSTREAM: ASoC: SOF: Add a route_free op in struct sof_ipc_tplg_ops

IPC4 requires that the widgets be unbound in the firmware before they are freed. So add a new op in struct sof_ipc_tplg_ops that will be used to send the IPC to the firmware to unbind widgets.

Change-Id: I6ea46634c9044b0dc9cebc05d7861b2b4888289d Signed-off-by: Ranjani Sridharan ranjani.sridharan@linux.intel.com Reviewed-by: Pierre-Louis Bossart pierre-louis.bossart@linux.intel.com Reviewed-by: Bard Liao yung-chuan.liao@linux.intel.com Reviewed-by: Péter Ujfalusi peter.ujfalusi@linux.intel.com Link: https://lore.kernel.org/r/20220426171743.171061-7-ranjani.sridharan@linux.intel.com Signed-off-by: Mark Brown broonie@kernel.org

--

Commit: https://git.seco.com/clea-os/bsp/mediatek/linux-seco-mtk/-/commit/466b0867e4c5a0acd0ad9027ead0fa7ad4111371

UPSTREAM: ASoC: SOF: expose a couple of functions

Expose the mixer_to_ipc() and ipc_to_mixer() functions for reuse in IPC4.

Change-Id: I4e3334037694352a5f9e35a2acf944883eeec0c9 Signed-off-by: Ranjani Sridharan ranjani.sridharan@linux.intel.com Reviewed-by: Pierre-Louis Bossart pierre-louis.bossart@linux.intel.com Reviewed-by: Bard Liao yung-chuan.liao@linux.intel.com Reviewed-by: Péter Ujfalusi peter.ujfalusi@linux.intel.com Link: https://lore.kernel.org/r/20220426171743.171061-6-ranjani.sridharan@linux.intel.com Signed-off-by: Mark Brown broonie@kernel.org

--

Commit: https://git.seco.com/clea-os/bsp/mediatek/linux-seco-mtk/-/commit/3b119dc55f9ee5609c166a000b57e7c62c15a1fd

UPSTREAM: ASoC: SOF: pcm: Move the call to snd_sof_pcm_platform_hw_params()

IPC4 requires the platform_params be passed when invoking sof_pcm_setup_connected_widgets(). So move the call to snd_sof_pcm_platform_hw_params() before calling sof_pcm_setup_connected_widgets(). This has no functional impact.

sof_pcm_setup_connected_widgets will be modified in the follow up patches to accept the platform params as an argument.

Change-Id: If92d8a428aec3bb038493efbb3f36afbca25bd3e Signed-off-by: Ranjani Sridharan ranjani.sridharan@linux.intel.com Reviewed-by: Pierre-Louis Bossart pierre-louis.bossart@linux.intel.com Reviewed-by: Bard Liao yung-chuan.liao@linux.intel.com Reviewed-by: Péter Ujfalusi peter.ujfalusi@linux.intel.com Link: https://lore.kernel.org/r/20220426171743.171061-5-ranjani.sridharan@linux.intel.com Signed-off-by: Mark Brown broonie@kernel.org

--

Commit: https://git.seco.com/clea-os/bsp/mediatek/linux-seco-mtk/-/commit/ab47b60b78abfa1ea1b874beba8d39750eb827e8

UPSTREAM: ASoC: SOF: sof-audio: Set up widgets from source to sink

For IPC3, the order of setting up the widgets associated with a PCM doesn't matter. But for IPC4, widgets must be set up from the source to the sink in order. In order to accommodate this, change the sof_widget_list_setup/free() functions to set up/free widgets starting with the source widget all the way to the sink widget for all pipelines.

Change-Id: Id6d2e5d870abd92b914e68f293166bfcdbf6f37b Signed-off-by: Ranjani Sridharan ranjani.sridharan@linux.intel.com Reviewed-by: Bard Liao yung-chuan.liao@linux.intel.com Reviewed-by: Péter Ujfalusi peter.ujfalusi@linux.intel.com Reviewed-by: Pierre-Louis Bossart pierre-louis.bossart@linux.intel.com Reviewed-by: Kai Vehmanen kai.vehmanen@linux.intel.com Link: https://lore.kernel.org/r/20220426171743.171061-4-ranjani.sridharan@linux.intel.com Signed-off-by: Mark Brown broonie@kernel.org

--

Commit: https://git.seco.com/clea-os/bsp/mediatek/linux-seco-mtk/-/commit/49d03feb14d587d2e1241baebf40d4a15942d342

UPSTREAM: ASoC: SOF: sof-audio: reset route status before freeing widget

This is in preparation for IPC4 which requires that the route be reset before the widget is freed. For IPC3, there is nothing more to be done other than setting the route status. So it is OK to be moved before the widget is freed.

Change-Id: I3ad58d63befb209ec53e3ca0a5ebc836432ab8b3 Signed-off-by: Ranjani Sridharan ranjani.sridharan@linux.intel.com Reviewed-by: Péter 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/20220426171743.171061-3-ranjani.sridharan@linux.intel.com Signed-off-by: Mark Brown broonie@kernel.org

--

Commit: https://git.seco.com/clea-os/bsp/mediatek/linux-seco-mtk/-/commit/1cc18a47268246fdc9192718d23ffe62f28a35dd

UPSTREAM: ASoC: SOF: Add a new op to set up volume table

Add a new op set_up_volume_table for control IPC ops. Define and set the op for IPC3.

Change-Id: Ic0209d20391d4ae8b401af3cbf825d75cc223f97 Signed-off-by: Ranjani Sridharan ranjani.sridharan@linux.intel.com Reviewed-by: Pierre-Louis Bossart pierre-louis.bossart@linux.intel.com Reviewed-by: Bard Liao yung-chuan.liao@linux.intel.com Reviewed-by: Péter Ujfalusi peter.ujfalusi@linux.intel.com Link: https://lore.kernel.org/r/20220426171743.171061-2-ranjani.sridharan@linux.intel.com Signed-off-by: Mark Brown broonie@kernel.org

--

Commit: https://git.seco.com/clea-os/bsp/mediatek/linux-seco-mtk/-/commit/3d230827dbb31ab2ce5b9f0cb49e599d414c67e0

UPSTREAM: ASoC: SOF: mediatek: Fix allyesconfig build error

ld: sound/soc/sof/mediatek/mt8186/mt8186-clk.o:(.opd+0x18): multiple definition of adsp_clock_on'; sound/soc/sof/mediatek/mt8195/mt8195-clk.o:(.opd+0x60): first defined here ld: sound/soc/sof/mediatek/mt8186/mt8186-clk.o: in function .adsp_clock_on':

ld: sound/soc/sof/mediatek/mt8186/mt8186-clk.o:(.opd+0x30): multiple definition of adsp_clock_off'; sound/soc/sof/mediatek/mt8195/mt8195-clk.o:(.opd+0x78): first defined here ld: sound/soc/sof/mediatek/mt8186/mt8186-clk.o: in function .adsp_clock_off':

ld: sound/soc/sof/mediatek/mt8186/mt8186-loader.o:(.opd+0x0): multiple definition of sof_hifixdsp_boot_sequence'; sound/soc/sof/mediatek/mt8195/mt8195-loader.o:(.opd+0x0): first defined here ld: sound/soc/sof/mediatek/mt8186/mt8186-loader.o: in function .sof_hifixdsp_boot_sequence':

ld: sound/soc/sof/mediatek/mt8186/mt8186-loader.o:(.opd+0x18): multiple definition of sof_hifixdsp_shutdown'; sound/soc/sof/mediatek/mt8195/mt8195-loader.o:(.opd+0x18): first defined here ld: sound/soc/sof/mediatek/mt8186/mt8186-loader.o: in function .sof_hifixdsp_shutdown':

Fixes: 570c14dc92d5 ("ASoC: SOF: mediatek: Add mt8186 sof fw loader and dsp ops") Fixes: 210b3ab932f7 ("ASoC: SOF: mediatek: Add mt8186 dsp clock support")

Change-Id: I20aae011fe57b570efbe02ba5093b04d87a3eca3 Signed-off-by: Tinghan Shen tinghan.shen@mediatek.com Link: https://lore.kernel.org/r/20220427071030.10172-1-tinghan.shen@mediatek.com Signed-off-by: Mark Brown broonie@kernel.org

--

Commit: https://git.seco.com/clea-os/bsp/mediatek/linux-seco-mtk/-/commit/bf4f00064e9c2d947d61b44c76b7016b92110c68

UPSTREAM: ASoC: SOF: mediatek: mt8195 change ipc timeout as 1 second

The IPC message sending can take longer than the default 500ms during system boot up due to the concurrent loading of different drivers. Increase the IPC timeout to 1 second to avoid timeout errors due to Linux load and scheduling.

Reviewed-by: Curtis Malainey cujomalainey@chromium.org Reviewed-by: Ranjani Sridharan ranjani.sridharan@linux.intel.com Reviewed-by: Péter Ujfalusi peter.ujfalusi@linux.intel.com Change-Id: I63d214a00fe88ce92b2004084592f3db07391366 Signed-off-by: YC Hung yc.hung@mediatek.com Signed-off-by: Pierre-Louis Bossart pierre-louis.bossart@linux.intel.com Link: https://lore.kernel.org/r/20220426183459.102251-1-pierre-louis.bossart@linux.intel.com Signed-off-by: Mark Brown broonie@kernel.org

--

Commit: https://git.seco.com/clea-os/bsp/mediatek/linux-seco-mtk/-/commit/2d06e0deb3e13e98e2eb0b1c0cc583fcfa874d87

UPSTREAM: ASoC: SOF: sof-client-ipc-msg-injector: use pm_runtime_resume_and_get()

Use pm_runtime_resume_and_get() to replace the pm_runtime_get_sync() and pm_runtime_put_noidle() pattern.

No functional changes.

Change-Id: I5c1a869c54c79d5fe9868982892dd5dcfe4849bf Signed-off-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 Link: https://lore.kernel.org/r/20220426184106.102636-5-pierre-louis.bossart@linux.intel.com Signed-off-by: Mark Brown broonie@kernel.org

--

Commit: https://git.seco.com/clea-os/bsp/mediatek/linux-seco-mtk/-/commit/20005110ad2f23109ec71a02d8e42201f6c08f9f

UPSTREAM: ASoC: SOF: debug: use pm_runtime_resume_and_get()

Use pm_runtime_resume_and_get() to replace the pm_runtime_get_sync() and pm_runtime_put_noidle() pattern.

No functional changes.

Change-Id: I79169744c1113d2ea19f812120963e94876a5302 Signed-off-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 Link: https://lore.kernel.org/r/20220426184106.102636-3-pierre-louis.bossart@linux.intel.com Signed-off-by: Mark Brown broonie@kernel.org

--

Commit: https://git.seco.com/clea-os/bsp/mediatek/linux-seco-mtk/-/commit/94f02ba7161161d96a1077cfdae4334a8b683e79

UPSTREAM: ASoC: SOF: control: use pm_runtime_resume_and_get()

Use pm_runtime_resume_and_get() to replace the pm_runtime_get_sync() and pm_runtime_put_noidle() pattern.

No functional changes.

Change-Id: I14b432b52f57495404a42b4f9c3ed0c6ce9c9054 Signed-off-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 Link: https://lore.kernel.org/r/20220426184106.102636-2-pierre-louis.bossart@linux.intel.com Signed-off-by: Mark Brown broonie@kernel.org

--

Commit: https://git.seco.com/clea-os/bsp/mediatek/linux-seco-mtk/-/commit/8dddc682fb1d884ed6418a0136bd3e6ce03b94df

UPSTREAM: ASoC: SOF: mediatek: Add DSP system PM callback for mt8186

Add DSP system PM callback for suspend and resume

Change-Id: I7c91be5940e6d112de39c0384d833de29fe506b7 Signed-off-by: Allen-KH Cheng allen-kh.cheng@mediatek.com Signed-off-by: Tinghan Shen tinghan.shen@mediatek.com Reviewed-by: Ranjani Sridharan ranjani.sridharan@linux.intel.com Reviewed-by: Yaochun Hung yc.hung@mediatek.com Reviewed-by: Pierre-Louis Bossart pierre-louis.bossart@linux.intel.com Link: https://lore.kernel.org/r/20220422055659.8738-5-tinghan.shen@mediatek.com Signed-off-by: Mark Brown broonie@kernel.org

--

Commit: https://git.seco.com/clea-os/bsp/mediatek/linux-seco-mtk/-/commit/35a3a94abe0ff817f15029beb53d1523fffffbb2

UPSTREAM: ASoC: SOF: mediatek: Add mt8186 dsp clock support

Add adsp clock on/off support on mt8186 SoC.

Change-Id: I734b70c145a4426c3ccbfa17123c9ce0769afd37 Signed-off-by: Allen-KH Cheng allen-kh.cheng@mediatek.com Signed-off-by: Tinghan Shen tinghan.shen@mediatek.com Reviewed-by: Ranjani Sridharan ranjani.sridharan@linux.intel.com Reviewed-by: Yaochun Hung yc.hung@mediatek.com Reviewed-by: Pierre-Louis Bossart pierre-louis.bossart@linux.intel.com Link: https://lore.kernel.org/r/20220422055659.8738-4-tinghan.shen@mediatek.com Signed-off-by: Mark Brown broonie@kernel.org

--

Commit: https://git.seco.com/clea-os/bsp/mediatek/linux-seco-mtk/-/commit/d300f9a77b7cdf595cae7470892a3e1dc1f496ab

UPSTREAM: ASoC: SOF: mediatek: Add mt8186 sof fw loader and dsp ops

Add mt8186-loader module with ops callback to load and run firmware on mt8186 SoC.

Change-Id: I31be94c559b9e5a462531be38636c55795ae9f63 Signed-off-by: Allen-KH Cheng allen-kh.cheng@mediatek.com Signed-off-by: Tinghan Shen tinghan.shen@mediatek.com Reviewed-by: Ranjani Sridharan ranjani.sridharan@linux.intel.com Reviewed-by: Yaochun Hung yc.hung@mediatek.com Reviewed-by: Pierre-Louis Bossart pierre-louis.bossart@linux.intel.com Link: https://lore.kernel.org/r/20220422055659.8738-3-tinghan.shen@mediatek.com Signed-off-by: Mark Brown broonie@kernel.org

--

Commit: https://git.seco.com/clea-os/bsp/mediatek/linux-seco-mtk/-/commit/a1e80bd5cf92b3ad6b807c038aee807cb552c5aa

UPSTREAM: ASoC: SOF: mediatek: Add mt8186 hardware support

Add support of SOF on Mediatek mt8186 SoC. MT8186 has 2 Cortex A76 cores paired with 6 Cortex A55 cores. It also has Cadence HiFi-5 DSP single core. The IPC communication between AP and DSP is based on shared DRAM and mailbox interrupt.

Change-Id: I5149fb1524343d71b26a9c46f9307228d08d206e Signed-off-by: Allen-KH Cheng allen-kh.cheng@mediatek.com Signed-off-by: Tinghan Shen tinghan.shen@mediatek.com Reviewed-by: Ranjani Sridharan ranjani.sridharan@linux.intel.com Reviewed-by: Yaochun Hung yc.hung@mediatek.com Reviewed-by: Pierre-Louis Bossart pierre-louis.bossart@linux.intel.com Link: https://lore.kernel.org/r/20220422055659.8738-2-tinghan.shen@mediatek.com Signed-off-by: Mark Brown broonie@kernel.org

--

Commit: https://git.seco.com/clea-os/bsp/mediatek/linux-seco-mtk/-/commit/0b3a1c8830b73e47be7094450535c31b52384ed4

UPSTREAM: ASoC: SOF: loader: Remove the old fw_ready related code

The fw_ready is handled internally to ipc3, we can remove the old code from the loader.c along with the functions only used by the fw_ready()

Change-Id: I26aa4080528b7586d92bd37aa82753c6d1a6cd5a Signed-off-by: Peter Ujfalusi peter.ujfalusi@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: Ajit Pandey ajitkumar.pandey@amd.com Reviewed-by: Daniel Baluta daniel.baluta@nxp.com Link: https://lore.kernel.org/r/20220421080735.31698-7-peter.ujfalusi@linux.intel.com Signed-off-by: Mark Brown broonie@kernel.org

--

Commit: https://git.seco.com/clea-os/bsp/mediatek/linux-seco-mtk/-/commit/09f583cab03e453c3a69c6c94094e449b0a4c2a8

UPSTREAM: ASoC: SOF: Do not check for the fw_ready callback

The fw_ready is handled internally to ipc3, the callback no longer in use and it is going to be removed.

Change-Id: I95b29a0c92df5b5a501748c2cfe3ccba9b1cd6d1 Signed-off-by: Peter Ujfalusi peter.ujfalusi@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: Ajit Pandey ajitkumar.pandey@amd.com Reviewed-by: Daniel Baluta daniel.baluta@nxp.com Link: https://lore.kernel.org/r/20220421080735.31698-3-peter.ujfalusi@linux.intel.com Signed-off-by: Mark Brown broonie@kernel.org

--

Commit: https://git.seco.com/clea-os/bsp/mediatek/linux-seco-mtk/-/commit/28503bb29a8467b61e0a491b2b10d586c322bd9a

UPSTREAM: ASoC: SOF: ipc3: Add local implementation for handling fw_ready message

The handling of fw_ready is IPC3 specific, move the needed code from the loader.c to ipc3.c and stop using the sof_ops(sdev)->fw_ready() callback.

Change-Id: Id7107f0d4882a73e71ef8c5563784adabd408fce Signed-off-by: Peter Ujfalusi peter.ujfalusi@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: Ajit Pandey ajitkumar.pandey@amd.com Reviewed-by: Daniel Baluta daniel.baluta@nxp.com Link: https://lore.kernel.org/r/20220421080735.31698-2-peter.ujfalusi@linux.intel.com Signed-off-by: Mark Brown broonie@kernel.org

--

Commit: https://git.seco.com/clea-os/bsp/mediatek/linux-seco-mtk/-/commit/d4232bb7573a3307d6a19753e1375eb20d29016d

UPSTREAM: ASoC: SOF: sof-audio: flag errors on pipeline teardown

Before suspending, walk through all the widgets to make sure all refcounts are zero. If not, the resume will not work and random errors will be reported. Adding this paranoia check will help identify leaks and broken sequences.

Change-Id: I59e5aab6d350d219ba5d146cece105063e71f698 Signed-off-by: Pierre-Louis Bossart pierre-louis.bossart@linux.intel.com Reviewed-by: Rander Wang rander.wang@intel.com Reviewed-by: Ranjani Sridharan ranjani.sridharan@linux.intel.com Reviewed-by: Péter Ujfalusi peter.ujfalusi@linux.intel.com Reviewed-by: Bard Liao yung-chuan.liao@linux.intel.com Link: https://lore.kernel.org/r/20220421203201.1550328-9-pierre-louis.bossart@linux.intel.com Signed-off-by: Mark Brown broonie@kernel.org

--

Commit: https://git.seco.com/clea-os/bsp/mediatek/linux-seco-mtk/-/commit/02d6a9d7fe5b160ff0c0ba965a7c5385d1479b4c

UPSTREAM: ASoC: SOF: remove incorrect clearing of prepared flag

When the system is suspended while a PCM is paused, it doesn't receive the SUSPEND trigger. So, the SOF driver has to ensure that the PCM and the widgets associated with the paused PCM are freed in the firmware during suspend. This is handled in the sof_tear_down_left_over_pipelines() call. But since the state of this PCM is SUSPENDED, we end up clearing the prepared flag for the PCM before freeing it. This results in IPC errors while freeing the widgets. But because the widget use_counts are reset to 0 even though the IPC fails, releasing the paused stream after resuming from suspend proceeds normally.

Fix the IPC errors by removing the clearing of the prepared flag in sof_set_hw_params_upon_resume(). In fact, we can remove the sof_set_hw_params_upon_resume() and call snd_sof_dsp_hw_params_upon_resume() directly. This will ensure that the PCM is freed in the firmware before the IPC's for freeing the widgets are sent.

BugLink: https://github.com/thesofproject/linux/issues/3543 Reviewed-by: Bard Liao yung-chuan.liao@linux.intel.com Reviewed-by: Péter Ujfalusi peter.ujfalusi@linux.intel.com Change-Id: I67c855b5bcc6534855f4925ed259cba4e0a98835 Signed-off-by: Ranjani Sridharan ranjani.sridharan@linux.intel.com Signed-off-by: Pierre-Louis Bossart pierre-louis.bossart@linux.intel.com Link: https://lore.kernel.org/r/20220421203201.1550328-2-pierre-louis.bossart@linux.intel.com Signed-off-by: Mark Brown broonie@kernel.org

--

Commit: https://git.seco.com/clea-os/bsp/mediatek/linux-seco-mtk/-/commit/35a0ff83841eb8e1b95ce2bbfb7a236ce7a3b17f

UPSTREAM: ASoC: SOF: topology: Check w->sname validity once in sof_connect_dai_widget()

The 'w' (struct snd_soc_dapm_widget) is not changing within the function, there is no reason to check the w->sname more than once as it is not going to change.

Reviewed-by: Bard Liao yung-chuan.liao@linux.intel.com Change-Id: Ifa72904e93d19449a7caff2f3ccd0ca04251a77a Signed-off-by: Peter Ujfalusi peter.ujfalusi@linux.intel.com Signed-off-by: Pierre-Louis Bossart pierre-louis.bossart@linux.intel.com Link: https://lore.kernel.org/r/20220421201847.1545686-1-pierre-louis.bossart@linux.intel.com Signed-off-by: Mark Brown broonie@kernel.org

--

Commit: https://git.seco.com/clea-os/bsp/mediatek/linux-seco-mtk/-/commit/5e8f2e4678406311fb8b85c8f36e1b6f8b0f114c

UPSTREAM: ASoC: SOF: sof-audio: remove useless assignment

There is no need to assign spcm to NULL. Removing this assignment also removes a false alarm reported by cppcheck.

Change-Id: I7ecc6a587749f1fb4a0edf14f557564da8118b38 Signed-off-by: Pierre-Louis Bossart pierre-louis.bossart@linux.intel.com Reviewed-by: Bard Liao yung-chuan.liao@linux.intel.com Reviewed-by: Rander Wang rander.wang@intel.com Reviewed-by: Péter Ujfalusi peter.ujfalusi@linux.intel.com Link: https://lore.kernel.org/r/20220421162600.302230-1-pierre-louis.bossart@linux.intel.com Signed-off-by: Mark Brown broonie@kernel.org

--

Commit: https://git.seco.com/clea-os/bsp/mediatek/linux-seco-mtk/-/commit/ffd36fe3b1f549a7117ae207d16779a9cea399b1

UPSTREAM: ASOC: SOF: pci: add ipc_type override for Intel IPC4 tests

Add a kernel module parameter for select the non-default IPC type.

This should only be used by developers with access to firmware and topology files, typically Intel and partners.

Change-Id: Iaa5310e1c7f687c0cf00db074c786dbaa3b84a9c Signed-off-by: Rander Wang rander.wang@intel.com Signed-off-by: Pierre-Louis Bossart pierre-louis.bossart@linux.intel.com Signed-off-by: Ranjani Sridharan ranjani.sridharan@linux.intel.com Reviewed-by: Péter Ujfalusi peter.ujfalusi@linux.intel.com Reviewed-by: Bard Liao yung-chuan.liao@linux.intel.com Link: https://lore.kernel.org/r/20220421163358.319489-3-pierre-louis.bossart@linux.intel.com Signed-off-by: Mark Brown broonie@kernel.org

--

Commit: https://git.seco.com/clea-os/bsp/mediatek/linux-seco-mtk/-/commit/a1a15f7583d2b6a3ea14699e4d5e8360ac697930

UPSTREAM: ASoC: SOF: using pm_runtime_resume_and_get to simplify the code

Using pm_runtime_resume_and_get() to replace pm_runtime_get_sync and pm_runtime_put_noidle. This change is just to simplify the code, no actual functional changes.

Reported-by: Zeal Robot zealci@zte.com.cn Change-Id: Ib25c477cb3af4714e4795c7080bd4c0cd3815a51 Signed-off-by: Minghao Chi chi.minghao@zte.com.cn Acked-by: Pierre-Louis Bossart pierre-louis.bossart@linux.intel.com Link: https://lore.kernel.org/r/20220420030315.2575691-1-chi.minghao@zte.com.cn Signed-off-by: Mark Brown broonie@kernel.org

--

Commit: https://git.seco.com/clea-os/bsp/mediatek/linux-seco-mtk/-/commit/32fabdd5cc2f79d5113dfb27288a7662d8842ba3

BACKPORT: ASoC: SOF: Intel: hda: use common ops across platforms

The dsp_ops are mostly common between platforms. Introduce a common structure and an init function to set platform-specific values.

Change-Id: I2818e7dac6e75a6d94b6787adadf229f68d37704 Signed-off-by: Pierre-Louis Bossart pierre-louis.bossart@linux.intel.com Reviewed-by: Ranjani Sridharan ranjani.sridharan@linux.intel.com Reviewed-by: Péter Ujfalusi peter.ujfalusi@linux.intel.com Reviewed-by: Kai Vehmanen kai.vehmanen@linux.intel.com Reviewed-by: Rander Wang rander.wang@intel.com Reviewed-by: Bard Liao yung-chuan.liao@linux.intel.com Link: https://lore.kernel.org/r/20220414184817.362215-10-pierre-louis.bossart@linux.intel.com Signed-off-by: Mark Brown broonie@kernel.org

--

Commit: https://git.seco.com/clea-os/bsp/mediatek/linux-seco-mtk/-/commit/6c7ecd476ff489df4b24fa5b3402f30f66b8f05c

BACKPORT: ASoC: SOF: remove const qualifier for 'struct snd_sof_dsp_ops'

Now that we start having multiple platforms with minor variants, the use of the const qualifier for 'dsp_ops' is starting to be sub-optimal: the structures are copied across platforms, with only a couple of members that differ.

This patch removes the const qualifier without any functionality changes, and adds an optional initialization callback. In follow-up patches, the dsp_ops will revisited for Intel HDaudio platforms, with the differences added programmatically over a common baseline.

Change-Id: I1a8f315269f1bc3498070fdeddcb09ed2c14b14a Signed-off-by: Pierre-Louis Bossart pierre-louis.bossart@linux.intel.com Reviewed-by: Ranjani Sridharan ranjani.sridharan@linux.intel.com Reviewed-by: Péter Ujfalusi peter.ujfalusi@linux.intel.com Reviewed-by: Kai Vehmanen kai.vehmanen@linux.intel.com Reviewed-by: Rander Wang rander.wang@intel.com Reviewed-by: Bard Liao yung-chuan.liao@linux.intel.com Link: https://lore.kernel.org/r/20220414184817.362215-9-pierre-louis.bossart@linux.intel.com Signed-off-by: Mark Brown broonie@kernel.org

--

Commit: https://git.seco.com/clea-os/bsp/mediatek/linux-seco-mtk/-/commit/3827857efe84bb52188f73ce4423c65632139c11

UPSTREAM: ASoC: SOF: sof-audio: preserve topology filename override in nocodec mode

If the topology filename is modified at a higher level, be it with a DMI quirk or a kernel module parameter, we don't want to use the default 'nocodec' topology name extracted from descriptors.

Change-Id: I1c0ef8db8be9064947077406917713fab5e15cc2 Signed-off-by: Pierre-Louis Bossart pierre-louis.bossart@linux.intel.com Reviewed-by: Ranjani Sridharan ranjani.sridharan@linux.intel.com Reviewed-by: Daniel Baluta daniel.baluta@nxp.com Reviewed-by: Paul Olaru paul.olaru@oss.nxp.com Reviewed-by: Péter Ujfalusi peter.ujfalusi@linux.intel.com Link: https://lore.kernel.org/r/20220414184817.362215-8-pierre-louis.bossart@linux.intel.com Signed-off-by: Mark Brown broonie@kernel.org

--

Commit: https://git.seco.com/clea-os/bsp/mediatek/linux-seco-mtk/-/commit/8d66cc7d5c8896f04d36d20a962bc9e9048bbaf3

UPSTREAM: ASoC: SOF: sof-pci-dev: add parameter to override topology filename

The existing 'tplg_path' module parameter can be used to load alternate firmware files, be it for development or to handle OEM-specific or board-specific releases. However the topology filename is either hard-coded in machine descriptors or modified by specific DMI-quirks.

For additional flexibility, this patch adds the 'tplg_filename' module parameter to override topology names.

To avoid any confusion between DMI- and parameter-override, a variable rename is added.

Change-Id: Ia93c13d20cdea108e061155046ad8afdc5b88c73 Signed-off-by: Pierre-Louis Bossart pierre-louis.bossart@linux.intel.com Reviewed-by: Ranjani Sridharan ranjani.sridharan@linux.intel.com Reviewed-by: Daniel Baluta daniel.baluta@nxp.com Reviewed-by: Paul Olaru paul.olaru@oss.nxp.com Reviewed-by: Péter Ujfalusi peter.ujfalusi@linux.intel.com Link: https://lore.kernel.org/r/20220414184817.362215-7-pierre-louis.bossart@linux.intel.com Signed-off-by: Mark Brown broonie@kernel.org

--

Commit: https://git.seco.com/clea-os/bsp/mediatek/linux-seco-mtk/-/commit/54ec83a9fa4871226d751eeaeb2bd928aedc631f

UPSTREAM: ASoC: SOF: sof-pci-dev: add parameter to override firmware filename

The existing 'fw_path' module parameter can be used to load alternate firmware files, be it for development or to handle OEM-specific or board-specific releases. The firmware name is however non-modifiable and defined by platform-specific descriptors.

For additional flexibility during development or enable quirks, this patch adds the 'fw_filename' module parameter to override default firmware names.

Change-Id: I001720be95fed653d2d693d73114d47c382c7882 Signed-off-by: Pierre-Louis Bossart pierre-louis.bossart@linux.intel.com Reviewed-by: Ranjani Sridharan ranjani.sridharan@linux.intel.com Reviewed-by: Daniel Baluta daniel.baluta@nxp.com Reviewed-by: Paul Olaru paul.olaru@oss.nxp.com Reviewed-by: Péter Ujfalusi peter.ujfalusi@linux.intel.com Link: https://lore.kernel.org/r/20220414184817.362215-6-pierre-louis.bossart@linux.intel.com Signed-off-by: Mark Brown broonie@kernel.org

--

Commit: https://git.seco.com/clea-os/bsp/mediatek/linux-seco-mtk/-/commit/f6d23303ff541162e0a42524cb08075bb21c7227

BACKPORT: ASoC: SOF: add IPC-dependent file names

To avoid misleading file names, use different names for INTEL_IPC4 firmware files.

Change-Id: I151c20ce5b30c16b3494dcfaa5da3aee0ac4c43d Signed-off-by: Pierre-Louis Bossart pierre-louis.bossart@linux.intel.com Reviewed-by: Bard Liao yung-chuan.liao@linux.intel.com Reviewed-by: Rander Wang rander.wang@intel.com Reviewed-by: Péter Ujfalusi peter.ujfalusi@linux.intel.com Reviewed-by: Chao Song chao.song@intel.com Link: https://lore.kernel.org/r/20220414184817.362215-5-pierre-louis.bossart@linux.intel.com Signed-off-by: Mark Brown broonie@kernel.org

--

Commit: https://git.seco.com/clea-os/bsp/mediatek/linux-seco-mtk/-/commit/612337d94cbe5ca212ee7ca894fbe23bd0a51120

BACKPORT: ASoC: SOF: add default IPC capability and file paths

This patch adds a default IPC type for each platform, along with file paths to be used for each IPC type. To make reviews simpler, we only modify platform descriptors in this table, the information will be used in the next patch.

The Intel IPCv4 is only supported on Intel platforms after APL, and not by default. In follow-up patches, support for SKL and KBL will be added, and in those two cases the IPCv4 will be the default (and only supported mode).

Change-Id: Ic19974f4796fecde2c46060cc6e6e205cb6111d6 Signed-off-by: Pierre-Louis Bossart pierre-louis.bossart@linux.intel.com Reviewed-by: Bard Liao yung-chuan.liao@linux.intel.com Reviewed-by: Rander Wang rander.wang@intel.com Reviewed-by: Péter Ujfalusi peter.ujfalusi@linux.intel.com Link: https://lore.kernel.org/r/20220414184817.362215-4-pierre-louis.bossart@linux.intel.com Signed-off-by: Mark Brown broonie@kernel.org

--

Commit: https://git.seco.com/clea-os/bsp/mediatek/linux-seco-mtk/-/commit/8e265e7b86afe3180de4a19e37ab4751914bddf0

BACKPORT: ASoC: SOF: add path indirection to each IPC type

With the addition of the IPCv4, we need the ability to select different paths for firmware and topologies.

First add an indirection. Follow-up patches will add mechanisms to select a default IPC or override it.

No functionality change in this patch.

Change-Id: I90f06211a09505e3bc3452026f3104c0f3e236c0 Signed-off-by: Pierre-Louis Bossart pierre-louis.bossart@linux.intel.com Reviewed-by: Bard Liao yung-chuan.liao@linux.intel.com Reviewed-by: Rander Wang rander.wang@intel.com Reviewed-by: Péter Ujfalusi peter.ujfalusi@linux.intel.com Link: https://lore.kernel.org/r/20220414184817.362215-3-pierre-louis.bossart@linux.intel.com Signed-off-by: Mark Brown broonie@kernel.org

--

Commit: https://git.seco.com/clea-os/bsp/mediatek/linux-seco-mtk/-/commit/a54702685ac74a1dfeb924e393f45b0ca4e60b35

UPSTREAM: ASoC: SOF: add definitions for different IPC types

Add enum type to allow for different types of IPCs. The IPCv4 is intended for Intel only as a convergence path with firmware used in Windows. Follow-up patches will introduce different abstractions with .ops and different search paths for firmware and topology files.

Change-Id: I78df4a3052030e686cc08975d21d2498dddb320f Signed-off-by: Pierre-Louis Bossart pierre-louis.bossart@linux.intel.com Reviewed-by: Bard Liao yung-chuan.liao@linux.intel.com Reviewed-by: Rander Wang rander.wang@intel.com Reviewed-by: Péter Ujfalusi peter.ujfalusi@linux.intel.com Link: https://lore.kernel.org/r/20220414184817.362215-2-pierre-louis.bossart@linux.intel.com Signed-off-by: Mark Brown broonie@kernel.org

--

Commit: https://git.seco.com/clea-os/bsp/mediatek/linux-seco-mtk/-/commit/76029a6fc6fa256a3ae1cf22bf443b80ddd9689d

UPSTREAM: ASoC: SOF: ipc: Move the ipc_set_get_comp_data() local to ipc3-control

The snd_sof_ipc_set_get_comp_data() only used for kcontrol data update and it is an IPC3 message parsing function.

Move it out from the generic ipc.c to ipc3-control.c and rename it to better describe it's function.

Change-Id: Ie39808a038019044c31ed2b3aabeac1881822eac Signed-off-by: Peter Ujfalusi peter.ujfalusi@linux.intel.com Reviewed-by: Daniel Baluta daniel.baluta@nxp.com Reviewed-by: Pierre-Louis Bossart pierre-louis.bossart@linux.intel.com Signed-off-by: Ranjani Sridharan ranjani.sridharan@linux.intel.com Link: https://lore.kernel.org/r/20220405172708.122168-16-ranjani.sridharan@linux.intel.com Signed-off-by: Mark Brown broonie@kernel.org

--

Commit: https://git.seco.com/clea-os/bsp/mediatek/linux-seco-mtk/-/commit/68f321abe4f18827cb36f72ca4a9b8a0244b28f6

UPSTREAM: ASoC: SOF: sof-audio: Use the widget_kcontrol_setup ops for kcontrol set up

Remove the local implementation and switch to the IPC neutral ops to set up the kcontrols associated with the swidget.

The set up call uses snd_sof_ipc_set_get_comp_data() which is largely an IPC3 parsing function.

Change-Id: I6e7c8615a5f12fbf6bea99c814b1c8896a1e363c Signed-off-by: Peter Ujfalusi peter.ujfalusi@linux.intel.com Reviewed-by: Daniel Baluta daniel.baluta@nxp.com Reviewed-by: Pierre-Louis Bossart pierre-louis.bossart@linux.intel.com Signed-off-by: Ranjani Sridharan ranjani.sridharan@linux.intel.com Link: https://lore.kernel.org/r/20220405172708.122168-15-ranjani.sridharan@linux.intel.com Signed-off-by: Mark Brown broonie@kernel.org

--

Commit: https://git.seco.com/clea-os/bsp/mediatek/linux-seco-mtk/-/commit/44a71c35c43caac1761e8f6db224a1219232ad42

UPSTREAM: ASoC: SOF: Add widget_kcontrol_setup control ops for IPC3

Define and set the widget_kcontrol_setup control IPC ops for IPC3.

The widget_kcontrol_setup callback can be used to set up all kcontrols associated with the swidget.

Change-Id: I2a2ba5df7ecc7d39307b8b77e04c5f1e03071375 Signed-off-by: Peter Ujfalusi peter.ujfalusi@linux.intel.com Reviewed-by: Daniel Baluta daniel.baluta@nxp.com Reviewed-by: Pierre-Louis Bossart pierre-louis.bossart@linux.intel.com Signed-off-by: Ranjani Sridharan ranjani.sridharan@linux.intel.com Link: https://lore.kernel.org/r/20220405172708.122168-14-ranjani.sridharan@linux.intel.com Signed-off-by: Mark Brown broonie@kernel.org

--

Commit: https://git.seco.com/clea-os/bsp/mediatek/linux-seco-mtk/-/commit/9164182e9de3dd9b2e959a53628389fbbf428ee7

UPSTREAM: ASoC: SOF: ipc: Switch over to use the rx_msg ops

Use the new ops for handling message reception.

Change-Id: I6fa17c284408bce15659496deb0624633976a254 Signed-off-by: Peter Ujfalusi peter.ujfalusi@linux.intel.com Reviewed-by: Daniel Baluta daniel.baluta@nxp.com Reviewed-by: Pierre-Louis Bossart pierre-louis.bossart@linux.intel.com Signed-off-by: Ranjani Sridharan ranjani.sridharan@linux.intel.com Link: https://lore.kernel.org/r/20220405172708.122168-13-ranjani.sridharan@linux.intel.com Signed-off-by: Mark Brown broonie@kernel.org

--

Commit: https://git.seco.com/clea-os/bsp/mediatek/linux-seco-mtk/-/commit/e7f22359a1ee75119c4d2cf60e96ce55e2eab85f

UPSTREAM: ASoC: SOF: ipc: Switch over to use the tx_msg and set_get_data ops

Use the new ops for sending messages and to handle large component data set get operation.

Change-Id: I0d824ec0b20dc231c9df6044b77504b2f9324762 Signed-off-by: Peter Ujfalusi peter.ujfalusi@linux.intel.com Reviewed-by: Daniel Baluta daniel.baluta@nxp.com Reviewed-by: Pierre-Louis Bossart pierre-louis.bossart@linux.intel.com Signed-off-by: Ranjani Sridharan ranjani.sridharan@linux.intel.com Link: https://lore.kernel.org/r/20220405172708.122168-12-ranjani.sridharan@linux.intel.com Signed-off-by: Mark Brown broonie@kernel.org

--

Commit: https://git.seco.com/clea-os/bsp/mediatek/linux-seco-mtk/-/commit/77d0ad43fdb7cdf93e36c40c1b8038b21558aa78

UPSTREAM: ASoC: SOF: ipc: Use the get_reply ops in snd_sof_ipc_get_reply()

Use the get_reply ops to allow IPC dependent handling of the reply message.

Change-Id: Iae08ca50353056131416148a34f998558ab06d6d Signed-off-by: Peter Ujfalusi peter.ujfalusi@linux.intel.com Reviewed-by: Daniel Baluta daniel.baluta@nxp.com Reviewed-by: Pierre-Louis Bossart pierre-louis.bossart@linux.intel.com Signed-off-by: Ranjani Sridharan ranjani.sridharan@linux.intel.com Link: https://lore.kernel.org/r/20220405172708.122168-11-ranjani.sridharan@linux.intel.com Signed-off-by: Mark Brown broonie@kernel.org

--

Commit: https://git.seco.com/clea-os/bsp/mediatek/linux-seco-mtk/-/commit/4c17829b43e3dc296552dc77c3c51d5c106e231a

UPSTREAM: ASoC: SOF: ipc: Add check for mandatory IPC message handling ops

Make sure that the mandatory IPC message handling ops are provided by the IPC implementation.

Change-Id: I47ada56b4834e3f538381f89570382783cd12c53 Signed-off-by: Peter Ujfalusi peter.ujfalusi@linux.intel.com Reviewed-by: Daniel Baluta daniel.baluta@nxp.com Reviewed-by: Pierre-Louis Bossart pierre-louis.bossart@linux.intel.com Signed-off-by: Ranjani Sridharan ranjani.sridharan@linux.intel.com Link: https://lore.kernel.org/r/20220405172708.122168-10-ranjani.sridharan@linux.intel.com Signed-off-by: Mark Brown broonie@kernel.org

--

Commit: https://git.seco.com/clea-os/bsp/mediatek/linux-seco-mtk/-/commit/e489e7e62fb8612458bb62a2262101f25178e5a5

UPSTREAM: ASoC: SOF: ipc: Separate the ops checks by functions/topics

Separate the mandatory ops checks by topics (pcm and topology for now) to be able to provide intuitive feedback on the possible missing ops and to make it easier to add new mandatory ops checks in the future.

Change-Id: I63eba91fd6e71e287bbd2525c868e8d32cf2f9a5 Signed-off-by: Peter Ujfalusi peter.ujfalusi@linux.intel.com Reviewed-by: Daniel Baluta daniel.baluta@nxp.com Reviewed-by: Pierre-Louis Bossart pierre-louis.bossart@linux.intel.com Signed-off-by: Ranjani Sridharan ranjani.sridharan@linux.intel.com Link: https://lore.kernel.org/r/20220405172708.122168-9-ranjani.sridharan@linux.intel.com Signed-off-by: Mark Brown broonie@kernel.org

--

Commit: https://git.seco.com/clea-os/bsp/mediatek/linux-seco-mtk/-/commit/9f1b38b010ea2148db62e9227ac4a3f90c9dd852

UPSTREAM: ASoC: SOF: ipc3: Implement rx_msg IPC ops

Add the implementation for the rx_msg callback to handle message reception for IPC3.

The implementation is equivalent to the currently used code in ipc.c

Change-Id: I40bd92a43ba8ddb56693de9cb93da4a431a86b43 Signed-off-by: Peter Ujfalusi peter.ujfalusi@linux.intel.com Reviewed-by: Daniel Baluta daniel.baluta@nxp.com Reviewed-by: Pierre-Louis Bossart pierre-louis.bossart@linux.intel.com Signed-off-by: Ranjani Sridharan ranjani.sridharan@linux.intel.com Link: https://lore.kernel.org/r/20220405172708.122168-8-ranjani.sridharan@linux.intel.com Signed-off-by: Mark Brown broonie@kernel.org

--

Commit: https://git.seco.com/clea-os/bsp/mediatek/linux-seco-mtk/-/commit/7fdcde266a9fad20256f74dfbf3531516fffff14

UPSTREAM: ASoC: SOF: ipc3: Implement the get_reply IPC ops

Add the implementation for the get_reply callback to copy the reply message from mailbox to msg->reply_data buffer.

The implementation is equivalent to the currently used code in ipc.c

Change-Id: I5f899bc20040a4546f030a9e78c90e91192fefae Signed-off-by: Peter Ujfalusi peter.ujfalusi@linux.intel.com Reviewed-by: Daniel Baluta daniel.baluta@nxp.com Reviewed-by: Pierre-Louis Bossart pierre-louis.bossart@linux.intel.com Signed-off-by: Ranjani Sridharan ranjani.sridharan@linux.intel.com Link: https://lore.kernel.org/r/20220405172708.122168-7-ranjani.sridharan@linux.intel.com Signed-off-by: Mark Brown broonie@kernel.org

--

Commit: https://git.seco.com/clea-os/bsp/mediatek/linux-seco-mtk/-/commit/80b664670b0a3534f907b627d2a7a34098c7d6d7

UPSTREAM: ASoC: SOF: ipc3: Implement the set_get_data IPC ops

Add the implementation for the set_get_data callback for handling large data set and get.

The set_get_data() in IPC3 can be used only for component messages. The function expects the caller to prepare the message behind the data pointer for sending/receiving data. The callback only implements the needed code to be able to split up a message if needed for transfer.

The set_get_data ops is based on the existing snd_sof_ipc_set_get_comp_data() and sof_set_get_large_ctrl_data() but made it generic entry point.

Change-Id: I375dafe760df79d66b4407079b2600a53b2587fd Signed-off-by: Peter Ujfalusi peter.ujfalusi@linux.intel.com Reviewed-by: Daniel Baluta daniel.baluta@nxp.com Reviewed-by: Pierre-Louis Bossart pierre-louis.bossart@linux.intel.com Reviewed-by: Bard Liao yung-chuan.liao@linux.intel.com Signed-off-by: Ranjani Sridharan ranjani.sridharan@linux.intel.com Link: https://lore.kernel.org/r/20220405172708.122168-6-ranjani.sridharan@linux.intel.com Signed-off-by: Mark Brown broonie@kernel.org

--

Commit: https://git.seco.com/clea-os/bsp/mediatek/linux-seco-mtk/-/commit/1f9f8c2ae9a68497710a9a9b4401dc3d825fc723

UPSTREAM: ASoC: SOF: ipc3: Use sof_ipc3_tx_msg() internally for message sending

Instead of using sof_ipc_tx_message() for sending message, use the sof_ipc3_tx_msg() directly within ipc3.c

Change-Id: I8caa00850245b46492c4bc4258a5c4e67fa44d60 Signed-off-by: Peter Ujfalusi peter.ujfalusi@linux.intel.com Reviewed-by: Daniel Baluta daniel.baluta@nxp.com Reviewed-by: Pierre-Louis Bossart pierre-louis.bossart@linux.intel.com Signed-off-by: Ranjani Sridharan ranjani.sridharan@linux.intel.com Link: https://lore.kernel.org/r/20220405172708.122168-5-ranjani.sridharan@linux.intel.com Signed-off-by: Mark Brown broonie@kernel.org

--

Commit: https://git.seco.com/clea-os/bsp/mediatek/linux-seco-mtk/-/commit/aed289e4924fcbcaa0c14674e5329b0e49c0a85d

UPSTREAM: ASoC: SOF: ipc3: Implement the tx_msg IPC ops

Add the implementation for the IPC3 tx_msg callback for sending a single IPC message.

The implementation is equivalent to the currently used code in ipc.c

Change-Id: I8a6d2e622ce6be002a906aceecf5d168dddbb500 Signed-off-by: Peter Ujfalusi peter.ujfalusi@linux.intel.com Reviewed-by: Daniel Baluta daniel.baluta@nxp.com Reviewed-by: Pierre-Louis Bossart pierre-louis.bossart@linux.intel.com Signed-off-by: Ranjani Sridharan ranjani.sridharan@linux.intel.com Link: https://lore.kernel.org/r/20220405172708.122168-4-ranjani.sridharan@linux.intel.com Signed-off-by: Mark Brown broonie@kernel.org

--

Commit: https://git.seco.com/clea-os/bsp/mediatek/linux-seco-mtk/-/commit/80b17d24416a7f9a080e45a17a4b655bfdfe09e9

UPSTREAM: ASoC: SOF: Add high level IPC IO callback definitions to ipc_ops

Add tx_msg(), rx_msg(), set_get_data() and get_reply() ops, which can be used as a generic API for sending, receiving single messages and to write and read large data.

Change-Id: Ie58d1afd4cf930aed0071896182da82b68db1dd5 Signed-off-by: Peter Ujfalusi peter.ujfalusi@linux.intel.com Reviewed-by: Daniel Baluta daniel.baluta@nxp.com Reviewed-by: Pierre-Louis Bossart <pierre-louis.bossart@linux.intel.com Signed-off-by: Ranjani Sridharan ranjani.sridharan@linux.intel.com Link: https://lore.kernel.org/r/20220405172708.122168-3-ranjani.sridharan@linux.intel.com Signed-off-by: Mark Brown broonie@kernel.org

--

Commit: https://git.seco.com/clea-os/bsp/mediatek/linux-seco-mtk/-/commit/ee1d181d51501685ec176855f0e92e3b15c52ca8

UPSTREAM: ASoC: SOF: Add helper function to prepare and send an IPC message

The new sof_ipc_send_msg() can be used by IPC dependent code to prepare the ipc->msg for a new message transmission and then call in to platform code to send the message.

Higher level code should be handling the completion and reply.

Change-Id: I43aab3f6e3320df869a0f4d9efef48c3f7c35e32 Signed-off-by: Peter Ujfalusi peter.ujfalusi@linux.intel.com Reviewed-by: Daniel Baluta daniel.baluta@nxp.com Reviewed-by: Pierre-Louis Bossart pierre-louis.bossart@linux.intel.com Signed-off-by: Ranjani Sridharan ranjani.sridharan@linux.intel.com Link: https://lore.kernel.org/r/20220405172708.122168-2-ranjani.sridharan@linux.intel.com Signed-off-by: Mark Brown broonie@kernel.org

--

Commit: https://git.seco.com/clea-os/bsp/mediatek/linux-seco-mtk/-/commit/7b6d3af68b03257a8b9ee7f204d8dfed0ef5df97

UPSTREAM: ASoC: SOF: mediatek: mt8195 add shutdown callback

Add mt8195 shutdown callback function implementation to ensure that shutdown flow is called to shutdown dsp core, disable adsp clock, and power off dsp sram correctly during reboot flow.

Change-Id: I95dd0a8cb360e1f164e1892fa95b7b0d0c2d01b9 Signed-off-by: YC Hung yc.hung@mediatek.com Signed-off-by: Pierre-Louis Bossart pierre-louis.bossart@linux.intel.com Reviewed-by: Ranjani Sridharan ranjani.sridharan@linux.intel.com Reviewed-by: Péter Ujfalusi peter.ujfalusi@linux.intel.com Link: https://lore.kernel.org/r/20220406194048.289787-3-pierre-louis.bossart@linux.intel.com Signed-off-by: Mark Brown broonie@kernel.org

--

Commit: https://git.seco.com/clea-os/bsp/mediatek/linux-seco-mtk/-/commit/4f4dcd01fc1cf69c05ab7e2b01a9cd27e16195fa

UPSTREAM: ASoC: SOF: OF: Add shutdown callback for SOF OF device

Add shutdown callback function for SOF OF device and call snd_sof_device_shutdown in sof_of_shutdown callback for DSP shutdown sequence.

Change-Id: I5c24c70e5aad904dfcdba2f32e98ebe3e48f5d1d Signed-off-by: YC Hung yc.hung@mediatek.com Signed-off-by: Pierre-Louis Bossart pierre-louis.bossart@linux.intel.com Reviewed-by: Ranjani Sridharan ranjani.sridharan@linux.intel.com Reviewed-by: Péter Ujfalusi peter.ujfalusi@linux.intel.com Link: https://lore.kernel.org/r/20220406194048.289787-2-pierre-louis.bossart@linux.intel.com Signed-off-by: Mark Brown broonie@kernel.org

--

Commit: https://git.seco.com/clea-os/bsp/mediatek/linux-seco-mtk/-/commit/2388679d2fc27501d8420d3d85ff62f5baf828e6

UPSTREAM: ASoC: SOF: topology: Fix memory leak in sof_control_load()

scontrol doesn't get freed when kstrdup returns NULL. Fix by free iscontrol in that case.

 scontrol = kzalloc(sizeof(*scontrol), GFP_KERNEL);
 if (!scontrol)
     return -ENOMEM;

 scontrol->name = kstrdup(hdr->name, GFP_KERNEL);
 if (!scontrol->name)
     return -ENOMEM;

Change-Id: I7ddb51891343fe990cf32cb143ee7315a32566d5 Signed-off-by: Yu Liao liaoyu15@huawei.com Link: https://lore.kernel.org/r/20220318021616.2599630-1-liaoyu15@huawei.com Signed-off-by: Mark Brown broonie@kernel.org

--

Commit: https://git.seco.com/clea-os/bsp/mediatek/linux-seco-mtk/-/commit/420706b8e1c798f202fe61633eb1fea94654eadf

UPSTREAM: ASoC: SOF: topology: cleanup dailinks on widget unload

We set the cpu_dai capture_ or playback_widget on widget_ready but never clear them, which leads to failures when unloading/reloading a topology in modprobe/rmmod tests

BugLink: https://github.com/thesofproject/linux/issues/3535 Fixes: 311ce4fe7637 ("ASoC: SOF: Add support for loading topologies") Change-Id: Iec7a92e0d1d3ea95efbe989570245756a65ecf59 Signed-off-by: Pierre-Louis Bossart pierre-louis.bossart@linux.intel.com Reviewed-by: Ranjani Sridharan ranjani.sridharan@linux.intel.com Reviewed-by: Péter Ujfalusi peter.ujfalusi@linux.intel.com Reviewed-by: Bard Liao yung-chuan.liao@linux.intel.com Link: https://lore.kernel.org/r/20220406191606.254576-1-pierre-louis.bossart@linux.intel.com Signed-off-by: Mark Brown broonie@kernel.org

--

Commit: https://git.seco.com/clea-os/bsp/mediatek/linux-seco-mtk/-/commit/a8fe990fd9a9795bdef1e84d1b78c20f912bfb0a

UPSTREAM: ASoC: SOF: topology: Avoid open coded arithmetic in memory allocation

Use kcalloc() instead of kzalloc()+open coded multiplication. This is safer and saves a few lines of code.

Change-Id: I17d19d720a83975f52682ab0860bc63a54015935 Signed-off-by: Christophe JAILLET christophe.jaillet@wanadoo.fr Link: https://lore.kernel.org/r/3bbf03cfd1966bc6fb6dd0939e039fc161078a61.1647757329.git.christophe.jaillet@wanadoo.fr Signed-off-by: Mark Brown broonie@kernel.org

--

Commit: https://git.seco.com/clea-os/bsp/mediatek/linux-seco-mtk/-/commit/d70859b5a231fc7b8fdf0cf64a346959fd27812e

UPSTREAM: ASoC: SOF: ipc3-topology: Set scontrol->priv to NULL after freeing it

Since the scontrol->priv is freed up during load operation it should be set to NULL to be safe against double freeing attempt.

Fixes: b5cee8feb1d48 ("ASoC: SOF: topology: Make control parsing IPC agnostic") Change-Id: I684b39d5101178b5c8a238e35257c5269a68c228 Signed-off-by: Peter Ujfalusi peter.ujfalusi@linux.intel.com Reviewed-by: Ranjani Sridharan ranjani.sridharan@linux.intel.com Reviewed-by: Pierre-Louis Bossart pierre-louis.bossart@linux.intel.com Link: https://lore.kernel.org/r/20220331114757.32551-1-peter.ujfalusi@linux.intel.com Signed-off-by: Mark Brown broonie@kernel.org

--

Commit: https://git.seco.com/clea-os/bsp/mediatek/linux-seco-mtk/-/commit/9dd550fc2877339d86e6f6cfa060cfab1b625939

UPSTREAM: ASoC: SOF: topology: use new sound control LED layer

Use the new sound control LED layer instead the direct ledtrig_audio_set() call - see 22d8de62f11b ("ALSA: control - add generic LED trigger module as the new control layer").

Change-Id: Iad93e71a956348b58499efc75399424b35688ad7 Signed-off-by: Jaroslav Kysela perex@perex.cz Cc: Bard Liao yung-chuan.liao@linux.intel.com Cc: Pierre-Louis Bossart pierre-louis.bossart@linux.intel.com Reviewed-by: Peter Ujfalusi peter.ujfalusi@linux.intel.com Reviewed-by: Ranjani Sridharan ranjani.sridharan@linux.intel.com Link: https://lore.kernel.org/r/20220329120039.2394138-1-perex@perex.cz Signed-off-by: Mark Brown broonie@kernel.org

--

Commit: https://git.seco.com/clea-os/bsp/mediatek/linux-seco-mtk/-/commit/d450eee290b6afda8ea98584e2c0c3c67c591bf9

UPSTREAM: ASoC: SOF: topology: Fix memory leak of scontrol->name

The scontrol->name is allocated with kstrdup, it must be freed before the scontrol is freed to avoid leaking memory.

The constant leaking happens via sof_widget_unload() path on every module removal.

Fixes: b5cee8feb1d48 ("ASoC: SOF: topology: Make control parsing IPC agnostic") Change-Id: I32e4fe2543dd2ec20d91e7e9b3ecb9ebd8dce4bc Signed-off-by: Peter Ujfalusi peter.ujfalusi@linux.intel.com Reviewed-by: Pierre-Louis Bossart pierre-louis.bossart@linux.intel.com Reviewed-by: Ranjani Sridharan ranjani.sridharan@linux.intel.com Link: https://lore.kernel.org/r/20220331114845.32747-1-peter.ujfalusi@linux.intel.com Signed-off-by: Mark Brown broonie@kernel.org

--

Commit: https://git.seco.com/clea-os/bsp/mediatek/linux-seco-mtk/-/commit/1dd1c3cb95f5e5f004dd4c2f283a3c9f619e6fbd

UPSTREAM: ASoC: SOF: Remove redundant return statements

After the free PCM action is executed, no matter what the return result is, it will return directly in sof_pcm_trigger. So the return statement here is redundant.

Change-Id: Ic4f708690c70407b1955c5a969fad085167e0db6 Signed-off-by: tangmeng tangmeng@uniontech.com Reviewed-by: Pierre-Louis Bossart pierre-louis.bossart@linux.intel.com Reviewed-by: Daniel Baluta daniel.baluta@nxp.com Reviewed-by: Péter Ujfalusi peter.ujfalusi@linux.intel.com Signed-off-by: Ranjani Sridharan ranjani.sridharan@linux.intel.com Link: https://lore.kernel.org/r/20220330201926.1330402-12-ranjani.sridharan@linux.intel.com Signed-off-by: Mark Brown broonie@kernel.org

--

Commit: https://git.seco.com/clea-os/bsp/mediatek/linux-seco-mtk/-/commit/9ab5ed7e74aa9d85cc1650490a1efa26bd2598b5

UPSTREAM: ASoC: SOF: Remove header from struct snd_sof_ipc_msg

The header field is no longer used by the underlying code and can be dropped from the snd_sof_ipc_msg struct.

Change-Id: I73a6371a739a1f905d09241bf30724ab89cd13b7 Signed-off-by: Peter Ujfalusi peter.ujfalusi@linux.intel.com Reviewed-by: Rander Wang rander.wang@intel.com Reviewed-by: Pierre-Louis Bossart pierre-louis.bossart@linux.intel.com Signed-off-by: Ranjani Sridharan ranjani.sridharan@linux.intel.com Link: https://lore.kernel.org/r/20220330201926.1330402-11-ranjani.sridharan@linux.intel.com Signed-off-by: Mark Brown broonie@kernel.org

--

Commit: https://git.seco.com/clea-os/bsp/mediatek/linux-seco-mtk/-/commit/ea4907e328622f6777846e14fcde6aa99901c350

BACKPORT: ASoC: SOF: Drop 'header' parameter from tx_message() API

The header parameter is not used anymore and now it can be dropped from the parameter list of tx_message().

Change-Id: Icd8bc2ccd93900ebc4fc82f6576f58e9bc5d0f4c Signed-off-by: Peter Ujfalusi peter.ujfalusi@linux.intel.com Reviewed-by: Rander Wang rander.wang@intel.com Reviewed-by: Pierre-Louis Bossart pierre-louis.bossart@linux.intel.com Signed-off-by: Ranjani Sridharan ranjani.sridharan@linux.intel.com Link: https://lore.kernel.org/r/20220330201926.1330402-10-ranjani.sridharan@linux.intel.com Signed-off-by: Mark Brown broonie@kernel.org

--

Commit: https://git.seco.com/clea-os/bsp/mediatek/linux-seco-mtk/-/commit/4ba7b220f18c9cdcc6e18230883e550ee783b2b6

UPSTREAM: ASoC: SOF: ipc: Use msg->reply_data directly in snd_sof_ipc_get_reply()

Instead of using a local reply to first read out the header from the mailbox then memcpy it or read it again to msg->reply_data, read it directly to it's final place from the start.

If we received an error we do not need to do a memcpy anymore. If the reply is reporting a success then we don not need to read the reply again from the mailbox if the reply_size equals to the already read header size.

Change-Id: I8c070c0986ae3ad12d3ee076fad25eb8e10c1754 Signed-off-by: Peter Ujfalusi peter.ujfalusi@linux.intel.com Reviewed-by: Daniel Baluta daniel.baluta@nxp.com Reviewed-by: Bard Liao yung-chuan.liao@linux.intel.com Signed-off-by: Ranjani Sridharan ranjani.sridharan@linux.intel.com Link: https://lore.kernel.org/r/20220330201926.1330402-9-ranjani.sridharan@linux.intel.com Signed-off-by: Mark Brown broonie@kernel.org

--

Commit: https://git.seco.com/clea-os/bsp/mediatek/linux-seco-mtk/-/commit/607c1c4fafc0903c87ebf62d8e9a29699c74ec5e

UPSTREAM: ASoC: SOF: disable dma trace in s0ix

When system enters s0ix, the dma trace won't be used. Otherwise, the DMA will access the host memory, which will prevent entering S0ix. Driver has notified firmware not to send message through dma trace. Let's also trigger stop dma trace in driver side.

Change-Id: I238e53d6e6ebc0b3325ba0f4702c417b093e86f2 Signed-off-by: Libin Yang libin.yang@intel.com Reviewed-by: Kai Vehmanen kai.vehmanen@intel.com Reviewed-by: Péter Ujfalusi peter.ujfalusi@linux.intel.com Signed-off-by: Ranjani Sridharan ranjani.sridharan@linux.intel.com Link: https://lore.kernel.org/r/20220330201926.1330402-8-ranjani.sridharan@linux.intel.com Signed-off-by: Mark Brown broonie@kernel.org

--

Commit: https://git.seco.com/clea-os/bsp/mediatek/linux-seco-mtk/-/commit/1538cdc77a6274bcdaf79e3b815fa757743f7a39

UPSTREAM: ASoC: SOF: extend the interface to stop DMA trace

Change the interface to stop the DMA trace for suspend. Replace the snd_sof_init_trace_ipc() and snd_sof_release_trace() calls with more explicit interface for PM (the sole user for this interface).

The new snd_sof_trace_suspend() call takes the target PM state as argument, allowing the trace implementation to decide how to handle the transition. Use this information to release DMA resources only if DSP is suspended and will not remain in D0.

Change-Id: I8e10e56a4c88409cfcf0f5836235229e82e8de51 Signed-off-by: Peter Ujfalusi peter.ujfalusi@linux.intel.com Signed-off-by: Libin Yang libin.yang@intel.com Reviewed-by: Kai Vehmanen kai.vehmanen@intel.com Reviewed-by: Péter Ujfalusi peter.ujfalusi@linux.intel.com Signed-off-by: Ranjani Sridharan ranjani.sridharan@linux.intel.com Link: https://lore.kernel.org/r/20220330201926.1330402-7-ranjani.sridharan@linux.intel.com Signed-off-by: Mark Brown broonie@kernel.org

--

Commit: https://git.seco.com/clea-os/bsp/mediatek/linux-seco-mtk/-/commit/7084d6693ef7e2e971c7aad0c6dfcebf17feb742

UPSTREAM: ASoC: SOF: Drop support for mapped control data

Access through mmapped memory is not supported and it is explicitly disabled with scontrol->readback_offset = 0; when a control is created.

Remove the dead code and the confusion around this feature.

Change-Id: I1592e7c20c9ede97e06a9dc9f2a03e99648e448b Signed-off-by: Peter Ujfalusi peter.ujfalusi@linux.intel.com Reviewed-by: Pierre-Louis Bossart pierre-louis.bossart@linux.intel.com Reviewed-by: Kai Vehmanen kai.vehmanen@intel.com Signed-off-by: Ranjani Sridharan ranjani.sridharan@linux.intel.com Link: https://lore.kernel.org/r/20220330201926.1330402-6-ranjani.sridharan@linux.intel.com Signed-off-by: Mark Brown broonie@kernel.org

--

Commit: https://git.seco.com/clea-os/bsp/mediatek/linux-seco-mtk/-/commit/2ed16b11aeee5dc04c97d65a52016556ed5c0e38

UPSTREAM: ASoC: SOF: ipc: Use ipc->max_payload_size for message/reply size checking

Use the ipc->max_payload_size for validating that the message or reply size can be supported.

Change-Id: I3c018644a3a7f0c44151feb27383015baac2ca9b Signed-off-by: Peter Ujfalusi peter.ujfalusi@linux.intel.com Reviewed-by: Kai Vehmanen kai.vehmanen@linux.intel.com Reviewed-by: Bard Liao yung-chuan.liao@linux.intel.com Reviewed-by: Daniel Baluta daniel.baluta@nxp.com Reviewed-by: Rander Wang rander.wang@intel.com Reviewed-by: Pierre-Louis Bossart pierre-louis.bossart@linux.intel.com Signed-off-by: Ranjani Sridharan ranjani.sridharan@linux.intel.com Link: https://lore.kernel.org/r/20220330201926.1330402-5-ranjani.sridharan@linux.intel.com Signed-off-by: Mark Brown broonie@kernel.org

--

Commit: https://git.seco.com/clea-os/bsp/mediatek/linux-seco-mtk/-/commit/838c4496eabefe413c7b0c7ff21b228d3d46a71c

UPSTREAM: ASoC: SOF: ipc: Add max_payload_size field in struct snd_sof_ipc

The max_payload_size is an IPC level constraint. Add a new field, max_payload_size to struct snd_sof_ipc and set it during IPC init.

Change-Id: I14dfa2480f3a33a889f57ef427586598ed3d2c87 Signed-off-by: Peter Ujfalusi peter.ujfalusi@linux.intel.com Reviewed-by: Kai Vehmanen kai.vehmanen@linux.intel.com Reviewed-by: Bard Liao yung-chuan.liao@linux.intel.com Reviewed-by: Daniel Baluta daniel.baluta@nxp.com Reviewed-by: Rander Wang rander.wang@intel.com Reviewed-by: Pierre-Louis Bossart pierre-louis.bossart@linux.intel.com Signed-off-by: Ranjani Sridharan ranjani.sridharan@linux.intel.com Link: https://lore.kernel.org/r/20220330201926.1330402-4-ranjani.sridharan@linux.intel.com Signed-off-by: Mark Brown broonie@kernel.org

--

Commit: https://git.seco.com/clea-os/bsp/mediatek/linux-seco-mtk/-/commit/c130637e46194442b15d9fa38d77864f2dc8badf

UPSTREAM: ASoC: SOF: Remove dmab and dmab_bdl from snd_sof_dev struct

The dmab and dmab_bdl is not used by any platform, it can be removed from struct snd_sof_dev.

Change-Id: I44527806678d08d6f161d830c9714805666e2902 Signed-off-by: Peter Ujfalusi peter.ujfalusi@linux.intel.com Reviewed-by: Pierre-Louis Bossart pierre-louis.bossart@linux.intel.com Signed-off-by: Ranjani Sridharan ranjani.sridharan@linux.intel.com Link: https://lore.kernel.org/r/20220330201926.1330402-3-ranjani.sridharan@linux.intel.com Signed-off-by: Mark Brown broonie@kernel.org

--

Commit: https://git.seco.com/clea-os/bsp/mediatek/linux-seco-mtk/-/commit/586b5796bd01fdb7927b82b49569da3b5e189f64

UPSTREAM: ASoC: SOF: Add a new dai_get_clk topology IPC op

This will help make the code for getting the mclk and bclk IPC specific. Add the implementation for IPC3 as well.

Change-Id: I831d6b7a98e620f5b3b4b0684a24248db7c4bfa7 Signed-off-by: Ranjani Sridharan ranjani.sridharan@linux.intel.com Reviewed-by: Rander Wang rander.wang@intel.com Reviewed-by: Pierre-Louis Bossart pierre-louis.bossart@linux.intel.com Reviewed-by: Bard Liao yung-chuan.liao@linux.intel.com Link: https://lore.kernel.org/r/20220317175044.1752400-20-ranjani.sridharan@linux.intel.com Signed-off-by: Mark Brown broonie@kernel.org

--

Commit: https://git.seco.com/clea-os/bsp/mediatek/linux-seco-mtk/-/commit/674c57ee62f8b1fd7b4f05fcc530aa5aa0d361c6

UPSTREAM: ASoC: SOF: topology: Add ops for setting up and tearing down pipelines

Introduce two new ops, set_up_all_pipelines and tear_down_all_pipelines in struct ipc_tplg_ops and define these for IPC3.

Change-Id: Ic1715a94a69841e2e851ae22405a81b75331717b Signed-off-by: Ranjani Sridharan ranjani.sridharan@linux.intel.com Reviewed-by: Péter Ujfalusi peter.ujfalusi@linux.intel.com Reviewed-by: Pierre-Louis Bossart pierre-louis.bossart@linux.intel.com Reviewed-by: Bard Liao yung-chuan.liao@linux.intel.com Link: https://lore.kernel.org/r/20220317175044.1752400-19-ranjani.sridharan@linux.intel.com Signed-off-by: Mark Brown broonie@kernel.org

--

Commit: https://git.seco.com/clea-os/bsp/mediatek/linux-seco-mtk/-/commit/09acd615caffc8ee89e3fb7ac1a3e03e24671147

UPSTREAM: ASoC: SOF: expose sof_route_setup()

This will be used in IPC3-specific code.

Change-Id: I221a6e4b8038ee0b81f5d5033622a6d49c12b3de Signed-off-by: Ranjani Sridharan ranjani.sridharan@linux.intel.com Reviewed-by: Péter Ujfalusi peter.ujfalusi@linux.intel.com Reviewed-by: Pierre-Louis Bossart pierre-louis.bossart@linux.intel.com Link: https://lore.kernel.org/r/20220317175044.1752400-18-ranjani.sridharan@linux.intel.com Signed-off-by: Mark Brown broonie@kernel.org

--

Commit: https://git.seco.com/clea-os/bsp/mediatek/linux-seco-mtk/-/commit/d6616eb09c5d8b7604c73b2e01bfca9412487154

UPSTREAM: ASoC: SOF: Add dai_link_fixup PCM op for IPC3

Define the dai_link_fixup PCM op for IPC3 and use it

Change-Id: I8ed5d8528d7e9efe9cba05cfa552a556e5ede0a1 Signed-off-by: Ranjani Sridharan ranjani.sridharan@linux.intel.com Reviewed-by: Péter Ujfalusi peter.ujfalusi@linux.intel.com Reviewed-by: Pierre-Louis Bossart pierre-louis.bossart@linux.intel.com Reviewed-by: Bard Liao yung-chuan.liao@linux.intel.com Link: https://lore.kernel.org/r/20220317175044.1752400-17-ranjani.sridharan@linux.intel.com Signed-off-by: Mark Brown broonie@kernel.org

--

Commit: https://git.seco.com/clea-os/bsp/mediatek/linux-seco-mtk/-/commit/0a5cd0b35fed1694ba47d3ac5bb38d95c8ce88d4

UPSTREAM: ASoC: SOF: Add trigger PCM op for IPC3

Add the trigger PCM op for IPC3 and use it.

Change-Id: I262ddafbf88b739dce34074b119fa827a50a847c Signed-off-by: Ranjani Sridharan ranjani.sridharan@linux.intel.com Reviewed-by: Péter Ujfalusi peter.ujfalusi@linux.intel.com Reviewed-by: Pierre-Louis Bossart pierre-louis.bossart@linux.intel.com Link: https://lore.kernel.org/r/20220317175044.1752400-16-ranjani.sridharan@linux.intel.com Signed-off-by: Mark Brown broonie@kernel.org

--

Commit: https://git.seco.com/clea-os/bsp/mediatek/linux-seco-mtk/-/commit/c88f8011caeb32a3376527fcf5d612c15f1007aa

UPSTREAM: ASoC: SOF: Define hw_params PCM op for IPC3

Add the hw_params op for IPC3 and use it.

Change-Id: Ifbdc0f79ebda463305950673c8645f64e21f62fb Signed-off-by: Ranjani Sridharan ranjani.sridharan@linux.intel.com Reviewed-by: Péter Ujfalusi peter.ujfalusi@linux.intel.com Reviewed-by: Pierre-Louis Bossart pierre-louis.bossart@linux.intel.com Link: https://lore.kernel.org/r/20220317175044.1752400-15-ranjani.sridharan@linux.intel.com Signed-off-by: Mark Brown broonie@kernel.org

--

Commit: https://git.seco.com/clea-os/bsp/mediatek/linux-seco-mtk/-/commit/981472c4b31b1881043fed1234bdc234a0cdcfe1

UPSTREAM: ASoC: SOF: Introduce IPC3 PCM hw_free op

Add the IPC3 PCM ops, define the hw_free op and modify all users to use the op.

Change-Id: Ia4d96f61fd3fc9bf14ea37a249befbcc97d8fc2d Signed-off-by: Ranjani Sridharan ranjani.sridharan@linux.intel.com Reviewed-by: Péter Ujfalusi peter.ujfalusi@linux.intel.com Reviewed-by: Pierre-Louis Bossart pierre-louis.bossart@linux.intel.com Reviewed-by: Bard Liao yung-chuan.liao@linux.intel.com Link: https://lore.kernel.org/r/20220317175044.1752400-14-ranjani.sridharan@linux.intel.com Signed-off-by: Mark Brown broonie@kernel.org

--

Commit: https://git.seco.com/clea-os/bsp/mediatek/linux-seco-mtk/-/commit/4488ffec86a2880fc98cf4919dcfc3f4dd598731

UPSTREAM: ASoC: SOF: pcm: expose the sof_pcm_setup_connected_widgets() function

It will be used in IPC-specific code.

Change-Id: I9e36c13c1c781c1427b8dd35b9695edee4242e1f Signed-off-by: Ranjani Sridharan ranjani.sridharan@linux.intel.com Reviewed-by: Péter Ujfalusi peter.ujfalusi@linux.intel.com Reviewed-by: Pierre-Louis Bossart pierre-louis.bossart@linux.intel.com Link: https://lore.kernel.org/r/20220317175044.1752400-13-ranjani.sridharan@linux.intel.com Signed-off-by: Mark Brown broonie@kernel.org

--

Commit: https://git.seco.com/clea-os/bsp/mediatek/linux-seco-mtk/-/commit/200969ae445cd3438ec25f725988691d2607d3f0

UPSTREAM: ASoC: SOF: Introduce IPC-specific PCM ops

Introduce the IPC-specific PCM ops that will be used to abstract the PCM related IPC's.

Change-Id: I9b16a97eca12d2917343e350bdeee3e3c8b354f0 Signed-off-by: Ranjani Sridharan ranjani.sridharan@linux.intel.com Reviewed-by: Péter Ujfalusi peter.ujfalusi@linux.intel.com Reviewed-by: Pierre-Louis Bossart pierre-louis.bossart@linux.intel.com Link: https://lore.kernel.org/r/20220317175044.1752400-12-ranjani.sridharan@linux.intel.com Signed-off-by: Mark Brown broonie@kernel.org

--

Commit: https://git.seco.com/clea-os/bsp/mediatek/linux-seco-mtk/-/commit/d228679d0f8e2a6ab60c7421ae13f81cfcb63e97

UPSTREAM: ASoC: SOF: Add bytes_ext control IPC ops for IPC3

Define and set the get/put/volatile_get control IPC ops for byte controls for IPC3.

Change-Id: I0ba22e3a04fe922dcd3a89dbac98f78b698d294f Signed-off-by: Ranjani Sridharan ranjani.sridharan@linux.intel.com Reviewed-by: Péter Ujfalusi peter.ujfalusi@linux.intel.com Reviewed-by: Pierre-Louis Bossart pierre-louis.bossart@linux.intel.com Link: https://lore.kernel.org/r/20220317175044.1752400-11-ranjani.sridharan@linux.intel.com Signed-off-by: Mark Brown broonie@kernel.org

--

Commit: https://git.seco.com/clea-os/bsp/mediatek/linux-seco-mtk/-/commit/94b37b997d1f2a258dec1e11d65183b60c18de06

UPSTREAM: ASoC: SOF: Add bytes_get/put control IPC ops for IPC3

Define and set the bytes_get/put IPC control ops for IPC3.

Change-Id: I7c527abdc5d6994e36e792606759ce858f80ffca Signed-off-by: Ranjani Sridharan ranjani.sridharan@linux.intel.com Reviewed-by: Péter Ujfalusi peter.ujfalusi@linux.intel.com Reviewed-by: Pierre-Louis Bossart pierre-louis.bossart@linux.intel.com Link: https://lore.kernel.org/r/20220317175044.1752400-10-ranjani.sridharan@linux.intel.com Signed-off-by: Mark Brown broonie@kernel.org

--

Commit: https://git.seco.com/clea-os/bsp/mediatek/linux-seco-mtk/-/commit/20c12183761cd2c63ea053bdc0addca4929f261b

UPSTREAM: ASoC: SOF: Add enum_get/put control ops for IPC3

Define and set the enum_get/put control IPC ops for IPC3.

Change-Id: Ia006857c37cdd89b8e16cf3c4137a58f855247a0 Signed-off-by: Ranjani Sridharan ranjani.sridharan@linux.intel.com Reviewed-by: Péter Ujfalusi peter.ujfalusi@linux.intel.com Reviewed-by: Pierre-Louis Bossart pierre-louis.bossart@linux.intel.com Link: https://lore.kernel.org/r/20220317175044.1752400-9-ranjani.sridharan@linux.intel.com Signed-off-by: Mark Brown broonie@kernel.org

--

Commit: https://git.seco.com/clea-os/bsp/mediatek/linux-seco-mtk/-/commit/1a54643cf82d549117ebbb59dc3e95a59a78afcb

UPSTREAM: ASoC: SOF: Add switch get/put IPC3 ops

Add the switch_get/put control IPC ops for IPC3.

Change-Id: I3b010595ac64c0de052aa42e5a40fa6ff02cea3d Signed-off-by: Ranjani Sridharan ranjani.sridharan@linux.intel.com Reviewed-by: Péter Ujfalusi peter.ujfalusi@linux.intel.com Reviewed-by: Pierre-Louis Bossart pierre-louis.bossart@linux.intel.com Link: https://lore.kernel.org/r/20220317175044.1752400-8-ranjani.sridharan@linux.intel.com Signed-off-by: Mark Brown broonie@kernel.org

--

Commit: https://git.seco.com/clea-os/bsp/mediatek/linux-seco-mtk/-/commit/75a0a23faefba21746ef6a0cf323eb456a97b681

UPSTREAM: ASoC: SOF: Add volume_get/put IPC3 ops

Define and set the volume_get/put control IPC ops for IPC3.

Change-Id: I5e63764d5489a649bfa997eaecda6d253d6025fb Signed-off-by: Ranjani Sridharan ranjani.sridharan@linux.intel.com Reviewed-by: Péter Ujfalusi peter.ujfalusi@linux.intel.com Reviewed-by: Pierre-Louis Bossart pierre-louis.bossart@linux.intel.com Link: https://lore.kernel.org/r/20220317175044.1752400-7-ranjani.sridharan@linux.intel.com Signed-off-by: Mark Brown broonie@kernel.org

--

Commit: https://git.seco.com/clea-os/bsp/mediatek/linux-seco-mtk/-/commit/45507900994988ee5ca57831de82c0c4b7521bad

UPSTREAM: ASoC: SOF: Add IPC3 topology control ops

Define the topology control IPC ops for IPC3, implement the control_notify op and use it.

Change-Id: I3a159d301f1638bc062dd8581f94f6e9e028114c Signed-off-by: Ranjani Sridharan ranjani.sridharan@linux.intel.com Reviewed-by: Péter Ujfalusi peter.ujfalusi@linux.intel.com Reviewed-by: Pierre-Louis Bossart pierre-louis.bossart@linux.intel.com Link: https://lore.kernel.org/r/20220317175044.1752400-6-ranjani.sridharan@linux.intel.com Signed-off-by: Mark Brown broonie@kernel.org

--

Commit: https://git.seco.com/clea-os/bsp/mediatek/linux-seco-mtk/-/commit/f2ce03053021f1ab68a351be85c1a3d596f8ba1b

UPSTREAM: ASoC: SOF: Introduce IPC ops for kcontrol IO

Introduce IPC-specific ops for kcontrol IO in struct ipc_tplg_ops.

Change-Id: I5f80b53655c000da59a9bde479464783ea3d4e3d Signed-off-by: Ranjani Sridharan ranjani.sridharan@linux.intel.com Reviewed-by: Péter Ujfalusi peter.ujfalusi@linux.intel.com Reviewed-by: Pierre-Louis Bossart pierre-louis.bossart@linux.intel.com Link: https://lore.kernel.org/r/20220317175044.1752400-5-ranjani.sridharan@linux.intel.com Signed-off-by: Mark Brown broonie@kernel.org

--

Commit: https://git.seco.com/clea-os/bsp/mediatek/linux-seco-mtk/-/commit/1f647f737766d2bbac64d5efa09e83d3a1c6a913

UPSTREAM: ASoC: SOF: Make sof_suspend/resume IPC agnostic

Add a new set of IPC ops for PM with the ctx_save and ctx_restore ops for suspend/resume and implement the ops for IPC3.

Change-Id: Ia8b5099559f5e5546c465de329dc8fee078e74a4 Signed-off-by: Ranjani Sridharan ranjani.sridharan@linux.intel.com Reviewed-by: Péter Ujfalusi peter.ujfalusi@linux.intel.com Reviewed-by: Pierre-Louis Bossart pierre-louis.bossart@linux.intel.com Link: https://lore.kernel.org/r/20220317175044.1752400-4-ranjani.sridharan@linux.intel.com Signed-off-by: Mark Brown broonie@kernel.org

--

Commit: https://git.seco.com/clea-os/bsp/mediatek/linux-seco-mtk/-/commit/272ad106db2898be5499762a864df88a47908368

BACKPORT: ASoC: SOF: Make sof_widget_setup/free IPC agnostic

Add 3 new topology IPC ops for widget_setup, widget_free and dai_config in order to make the pipeline management code IPC agnostic and implement the ops for IPC3.

Use the newly introduced tplg dai_config op to configure the DAI during BE DAI hw_params and hw_free.

Also, in preparation for IPC4, modify BE hw_params callback to skip setting up the DAI widget. All widgets will be set up during FW hw_params and the DAI_CONFIG IPC should be sent only if the widget use_count is > 0. With setting up/freeing removed from the BE hw_params, remove the configured flag as it is no longer needed.

Change-Id: I2c3c30836ebff310ddc1e99d0516df94df392dbd Signed-off-by: Ranjani Sridharan ranjani.sridharan@linux.intel.com Reviewed-by: Péter Ujfalusi peter.ujfalusi@linux.intel.com Reviewed-by: Pierre-Louis Bossart pierre-louis.bossart@linux.intel.com Reviewed-by: Bard Liao yung-chuan.liao@linux.intel.com Link: https://lore.kernel.org/r/20220317175044.1752400-3-ranjani.sridharan@linux.intel.com Signed-off-by: Mark Brown broonie@kernel.org

--

Commit: https://git.seco.com/clea-os/bsp/mediatek/linux-seco-mtk/-/commit/abbafb5684cdc87c9afa6010aed4d0f5e1388f23

UPSTREAM: ASoC: SOF: set up scheduler widget before all other widgets in the pipeline

For dynamic pipelines, We set up the DAI widget during BE DAI hw_params and this results in it getting set up before the scheduler widget for the pipeline it belongs to is set up. Move the scheduler widget set up into sof_widget_setup() to ensure that the scheduler widget is always the first widget in a pipeline to be set up and the last one to get freed after all the other widgets have been freed.

Fixes: 5fcdbb2d45df ('ASoC: SOF: Add support for dynamic pipelines')

Change-Id: I4041be7275f6ac65b77089802f948f4aa1635df4 Signed-off-by: Ranjani Sridharan ranjani.sridharan@linux.intel.com Reviewed-by: Péter Ujfalusi peter.ujfalusi@linux.intel.com Reviewed-by: Pierre-Louis Bossart pierre-louis.bossart@linux.intel.com Link: https://lore.kernel.org/r/20220317175044.1752400-2-ranjani.sridharan@linux.intel.com Signed-off-by: Mark Brown broonie@kernel.org

--

Commit: https://git.seco.com/clea-os/bsp/mediatek/linux-seco-mtk/-/commit/78c999a13b285fd555543fdc2473c0c0f52c65f9

UPSTREAM: ASoC: SOF: topology: Use kmemdup() to replace kzalloc + memcpy

fix memdup.cocci warning: sound/soc/sof/topology.c:876:19-26: WARNING opportunity for kmemdup

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

Change-Id: I5c2f985a01ce409d0b0cb2e1aefce94651dd469c Signed-off-by: Yihao Han hanyihao@vivo.com Acked-by: Pierre-Louis Bossart pierre-louis.bossart@linux.intel.com Link: https://lore.kernel.org/r/20220317093841.3414-1-hanyihao@vivo.com Signed-off-by: Mark Brown broonie@kernel.org

--

Commit: https://git.seco.com/clea-os/bsp/mediatek/linux-seco-mtk/-/commit/92a2b72224af7770ed6287d9ac40717cbb39c9cb

UPSTREAM: ASoC: SOF: topology: remove snd_sof_complete_pipeline()

Add a new topology IPC op, pipeline_complete in struct ipc_tplg_ops and set the op for IPC3. Replace the calls to snd_sof_complete_pipeline() with the calls to the topology IPC pipeline_complete op.

Change-Id: I3380fd30feefb0f48729d3b56b2c84d7aa78c9ef Signed-off-by: Ranjani Sridharan ranjani.sridharan@linux.intel.com Reviewed-by: Bard Liao yung-chuan.liao@linux.intel.com Reviewed-by: Péter Ujfalusi peter.ujfalusi@linux.intel.com Reviewed-by: Pierre-Louis Bossart pierre-louis.bossart@linux.intel.com Link: https://lore.kernel.org/r/20220314200520.1233427-20-ranjani.sridharan@linux.intel.com Signed-off-by: Mark Brown broonie@kernel.org

--

Commit: https://git.seco.com/clea-os/bsp/mediatek/linux-seco-mtk/-/commit/31c9c981657066b62d371a43b6fc249dd4848b39

UPSTREAM: ASoC: SOF: topology: Make widget binding IPC agnostic

Make widget binding in the topology parser IPC agnostic by introducing a new op, bind_event, in struct ipc_tplg_widget_ops. Also set the op for all widget types in the IPC3 topology ops.

Change-Id: I04351fec257ddd4aaa4a5ef7e66d73b543489c8d Signed-off-by: Ranjani Sridharan ranjani.sridharan@linux.intel.com Reviewed-by: Bard Liao yung-chuan.liao@linux.intel.com Reviewed-by: Péter Ujfalusi peter.ujfalusi@linux.intel.com Reviewed-by: Pierre-Louis Bossart pierre-louis.bossart@linux.intel.com Link: https://lore.kernel.org/r/20220314200520.1233427-19-ranjani.sridharan@linux.intel.com Signed-off-by: Mark Brown broonie@kernel.org

--

Commit: https://git.seco.com/clea-os/bsp/mediatek/linux-seco-mtk/-/commit/861cf864d25135eb9873ac8f356168b07e6d73e2

UPSTREAM: ASoC: SOF: topology: Make control parsing IPC agnostic

Make the control parser in topology IPC agnostic by introducing 2 new topology IPC ops, control_setup and control_free. These ops handle setting up/freeing the control data in the IPC format based on the IPC version.

Along with this, modify the struct snd_sof_control to remove the IPC-specific field, control_data and replace it with the void pointer to ipc_control_data. Also, add a few new fields to store all the information parsed from topology.

Finally, define and set the control setup/free ops for IPC3.

Change-Id: Iffa82986b83a8ce97f5df0230a0a94bc9cbb5165 Signed-off-by: Ranjani Sridharan ranjani.sridharan@linux.intel.com Reviewed-by: Bard Liao yung-chuan.liao@linux.intel.com Reviewed-by: Péter Ujfalusi peter.ujfalusi@linux.intel.com Reviewed-by: Pierre-Louis Bossart pierre-louis.bossart@linux.intel.com Link: https://lore.kernel.org/r/20220314200520.1233427-18-ranjani.sridharan@linux.intel.com Signed-off-by: Mark Brown broonie@kernel.org

--

Commit: https://git.seco.com/clea-os/bsp/mediatek/linux-seco-mtk/-/commit/fce0b9cd4c65393650ee55e38224cfa51a39472c

UPSTREAM: ASoC: SOF: topology: Make route setup IPC agnostic

Define and set the route_setup op for IPC3 topology ops and use it for setting up routes.

Change-Id: I64bb9cf5692b16a2920b472a455f510402544d81 Signed-off-by: Ranjani Sridharan ranjani.sridharan@linux.intel.com Reviewed-by: Bard Liao yung-chuan.liao@linux.intel.com Reviewed-by: Péter Ujfalusi peter.ujfalusi@linux.intel.com Reviewed-by: Pierre-Louis Bossart pierre-louis.bossart@linux.intel.com Link: https://lore.kernel.org/r/20220314200520.1233427-16-ranjani.sridharan@linux.intel.com Signed-off-by: Mark Brown broonie@kernel.org

--

Commit: https://git.seco.com/clea-os/bsp/mediatek/linux-seco-mtk/-/commit/48f9817e79731e93721cfce15835792bf2a284fd

UPSTREAM: ASoC: SOF: topology: return error if sof_connect_dai_widget() fails

Return the error if sof_connect_dai_widget() fails to abort topology loading and prevent card registration.

Reviewed-by: Guennadi Liakhovetski guennadi.liakhovetski@linux.intel.com Change-Id: I53b7dfa4b79515237f4b979b1048d4cb35581dc3 Signed-off-by: Ranjani Sridharan ranjani.sridharan@linux.intel.com Signed-off-by: Pierre-Louis Bossart pierre-louis.bossart@linux.intel.com Link: https://lore.kernel.org/r/20211004212729.199550-4-pierre-louis.bossart@linux.intel.com Signed-off-by: Mark Brown broonie@kernel.org

--

Commit: https://git.seco.com/clea-os/bsp/mediatek/linux-seco-mtk/-/commit/0925cbcb463f5e5c866d8c8c23c86e9f3e0ad69f

UPSTREAM: ASoC: SOF: topology: Make route setup IPC agnostic

Define and set the route_setup op for IPC3 topology ops and use it for setting up routes.

Change-Id: I816794eadc33832d0fe81d43011f960159dbd5a6 Signed-off-by: Ranjani Sridharan ranjani.sridharan@linux.intel.com Reviewed-by: Bard Liao yung-chuan.liao@linux.intel.com Reviewed-by: Péter Ujfalusi peter.ujfalusi@linux.intel.com Reviewed-by: Pierre-Louis Bossart pierre-louis.bossart@linux.intel.com Link: https://lore.kernel.org/r/20220314200520.1233427-16-ranjani.sridharan@linux.intel.com Signed-off-by: Mark Brown broonie@kernel.org

--

Commit: https://git.seco.com/clea-os/bsp/mediatek/linux-seco-mtk/-/commit/54078b78698c11cdce59776bdacb77afdb83895d

UPSTREAM: ASoC: SOF: topology: Make effect widget parsing IPC agnostic

Define the list of tokens pertaining to effect type widgets, parse and save them as part of the swidget tuples array. Once topology parsing is complete, these tokens will be applied to create the IPC structure for the process component based on the topology widget_setup op in ipc3_tplg_ops.

Change-Id: I73989dc3397a9650c7979850288e7931e55acebb Signed-off-by: Ranjani Sridharan ranjani.sridharan@linux.intel.com Reviewed-by: Bard Liao yung-chuan.liao@linux.intel.com Reviewed-by: Péter Ujfalusi peter.ujfalusi@linux.intel.com Reviewed-by: Pierre-Louis Bossart pierre-louis.bossart@linux.intel.com Link: https://lore.kernel.org/r/20220314200520.1233427-15-ranjani.sridharan@linux.intel.com Signed-off-by: Mark Brown broonie@kernel.org

--

Commit: https://git.seco.com/clea-os/bsp/mediatek/linux-seco-mtk/-/commit/0ee8ed0345cc49e12c37862c3934ea04a1bcdb26

UPSTREAM: ASoC: SOF: topology: Make siggen widget parsing IPC agnostic

Define the list of tokens pertaining to the siggen widgets, parse and save them as part of the swidget tuples array. Once topology parsing is complete, these tokens will be applied to create the IPC structure for the tone component based on the topology widget_setup op in ipc3_tplg_ops.

Change-Id: Ie0ae47fe01698d6ea0044076dac9ddc3c84610c0 Signed-off-by: Ranjani Sridharan ranjani.sridharan@linux.intel.com Reviewed-by: Bard Liao yung-chuan.liao@linux.intel.com Reviewed-by: Péter Ujfalusi peter.ujfalusi@linux.intel.com Reviewed-by: Pierre-Louis Bossart pierre-louis.bossart@linux.intel.com Link: https://lore.kernel.org/r/20220314200520.1233427-14-ranjani.sridharan@linux.intel.com Signed-off-by: Mark Brown broonie@kernel.org

--

Commit: https://git.seco.com/clea-os/bsp/mediatek/linux-seco-mtk/-/commit/ea932bd8ba4eb74e6bf1436d0914105dc880ae61

UPSTREAM: ASoC: SOF: topology: Make asrc widget parsing IPC agnostic

Define the list of tokens pertaining to the asrc widgets, parse and save them as part of the swidget tuples array. Once topology parsing is complete, these tokens will be applied to create the IPC structure for the asrc component based on the topology widget_setup op in ipc3_tplg_ops.

Change-Id: I9c4cf57ed1f56237c07add9cf366195087e6ff16 Signed-off-by: Ranjani Sridharan ranjani.sridharan@linux.intel.com Reviewed-by: Bard Liao yung-chuan.liao@linux.intel.com Reviewed-by: Péter Ujfalusi peter.ujfalusi@linux.intel.com Reviewed-by: Pierre-Louis Bossart pierre-louis.bossart@linux.intel.com Link: https://lore.kernel.org/r/20220314200520.1233427-13-ranjani.sridharan@linux.intel.com Signed-off-by: Mark Brown broonie@kernel.org

--

Commit: https://git.seco.com/clea-os/bsp/mediatek/linux-seco-mtk/-/commit/7c4a87b448802da8b071d7bd1344cdf42dd8155a

UPSTREAM: ASoC: SOF: topology: Make src widget parsing IPC agnostic

Define the list of tokens pertaining to the src widgets, parse and save them as part of the swidget tuples array. Once topology parsing is complete, these tokens will be applied to create the IPC structure for the src component based on the topology widget_setup op in ipc3_tplg_ops.

Change-Id: I898549a839b19203f496e82ef2d675a34d11e0b7 Signed-off-by: Ranjani Sridharan ranjani.sridharan@linux.intel.com Reviewed-by: Bard Liao yung-chuan.liao@linux.intel.com Reviewed-by: Péter Ujfalusi peter.ujfalusi@linux.intel.com Reviewed-by: Pierre-Louis Bossart pierre-louis.bossart@linux.intel.com Link: https://lore.kernel.org/r/20220314200520.1233427-12-ranjani.sridharan@linux.intel.com Signed-off-by: Mark Brown broonie@kernel.org

--

Commit: https://git.seco.com/clea-os/bsp/mediatek/linux-seco-mtk/-/commit/a68a30ba65b38ecc63986b2f72964e17837a9a44

UPSTREAM: ASoC: SOF: topology: Make mux/demux widget parsing IPC agnostic

Define the list of tokens pertaining to the mux/demux widgets, parse and save them as part of the swidget tuples array. Once topology parsing is complete, these tokens will be applied to create the IPC structure for the mux/demux component based on the topology widget_setup op in ipc3_tplg_ops.

Change-Id: Ibe668b4c11abe727b4af262c59bde889afb62301 Signed-off-by: Ranjani Sridharan ranjani.sridharan@linux.intel.com Reviewed-by: Bard Liao yung-chuan.liao@linux.intel.com Reviewed-by: Péter Ujfalusi peter.ujfalusi@linux.intel.com Reviewed-by: Pierre-Louis Bossart pierre-louis.bossart@linux.intel.com Link: https://lore.kernel.org/r/20220314200520.1233427-11-ranjani.sridharan@linux.intel.com Signed-off-by: Mark Brown broonie@kernel.org

--

Commit: https://git.seco.com/clea-os/bsp/mediatek/linux-seco-mtk/-/commit/14404f12ce2093dade71ce767ad6e466427b3426

UPSTREAM: ASoC: SOF: topology: Make mixer widget parsing IPC agnostic

Define the list of tokens pertaining to the mixer widgets, parse and save them as part of the swidget tuples array. Once topology parsing is complete, these tokens will be applied to create the IPC structure for the mixer component based on the topology widget_setup op in ipc3_tplg_ops.

Change-Id: I3ab989d8cec61eea8eec1f0d62ec26664c82ba29 Signed-off-by: Ranjani Sridharan ranjani.sridharan@linux.intel.com Reviewed-by: Bard Liao yung-chuan.liao@linux.intel.com Reviewed-by: Péter Ujfalusi peter.ujfalusi@linux.intel.com Reviewed-by: Pierre-Louis Bossart pierre-louis.bossart@linux.intel.com Link: https://lore.kernel.org/r/20220314200520.1233427-10-ranjani.sridharan@linux.intel.com Signed-off-by: Mark Brown broonie@kernel.org

--

Commit: https://git.seco.com/clea-os/bsp/mediatek/linux-seco-mtk/-/commit/5c1b8619363f24b76a65f0046ae4480df75b6729

UPSTREAM: ASoC: SOF: topology: Make pga widget parsing IPC agnostic

Define the list of tokens pertaining to the pga type widgets, parse and save them as part of the swidget tuples array. Once topology parsing is complete, these tokens will be applied to create the IPC structure for the pga component based on the topology widget_setup op in ipc3_tplg_ops.

Change-Id: Ia4ee71bdf0521d9ec9802460bf2225e62dfc0bcf Signed-off-by: Ranjani Sridharan ranjani.sridharan@linux.intel.com Reviewed-by: Bard Liao yung-chuan.liao@linux.intel.com Reviewed-by: Péter Ujfalusi peter.ujfalusi@linux.intel.com Reviewed-by: Pierre-Louis Bossart pierre-louis.bossart@linux.intel.com Link: https://lore.kernel.org/r/20220314200520.1233427-9-ranjani.sridharan@linux.intel.com Signed-off-by: Mark Brown broonie@kernel.org

--

Commit: https://git.seco.com/clea-os/bsp/mediatek/linux-seco-mtk/-/commit/802466b577a79d74dd25f88d069ab8c575739258

UPSTREAM: ASoC: SOF: topology: Make buffer widget parsing IPC agnostic

Define the list of tokens pertaining to the buffer widgets, parse and save them as part of the swidget tuples array. Once topology parsing is complete, these tokens will be applied to create the IPC structure for the buffer component based on the topology widget_setup op in ipc3_tplg_ops.

Change-Id: Ia7408361c7a0cf8356f35c5449cd8ab105cfaaef Signed-off-by: Ranjani Sridharan ranjani.sridharan@linux.intel.com Reviewed-by: Bard Liao yung-chuan.liao@linux.intel.com Reviewed-by: Péter Ujfalusi peter.ujfalusi@linux.intel.com Reviewed-by: Pierre-Louis Bossart pierre-louis.bossart@linux.intel.com Link: https://lore.kernel.org/r/20220314200520.1233427-8-ranjani.sridharan@linux.intel.com Signed-off-by: Mark Brown broonie@kernel.org

--

Commit: https://git.seco.com/clea-os/bsp/mediatek/linux-seco-mtk/-/commit/5eb4a00fc3e9ecf5a2c9dda42856c91fcd1ce7e7

UPSTREAM: ASoC: SOF: topology: Make scheduler widget parsing IPC agnostic

Define the list of tokens pertaining to the scheduler widgets, parse and save them as part of the swidget tuples array. Once topology parsing is complete, these tokens will be applied to create the IPC structure for the pipeline component based on the topology widget_setup op in ipc3_tplg_ops.

Change-Id: If508bbb6d1fd31746d4702745680b57587e68745 Signed-off-by: Ranjani Sridharan ranjani.sridharan@linux.intel.com Reviewed-by: Bard Liao yung-chuan.liao@linux.intel.com Reviewed-by: Péter Ujfalusi peter.ujfalusi@linux.intel.com Reviewed-by: Pierre-Louis Bossart pierre-louis.bossart@linux.intel.com Link: https://lore.kernel.org/r/20220314200520.1233427-7-ranjani.sridharan@linux.intel.com Signed-off-by: Mark Brown broonie@kernel.org

--

Commit: https://git.seco.com/clea-os/bsp/mediatek/linux-seco-mtk/-/commit/0c4860308dd5b6636dc8093ba6fb5efda6e4f13d

UPSTREAM: ASoC: SOF: Introduce IPC3 ops

Add the IPC ops including the topology-related IPC ops for the current version (IPC3, named after the current SOF firmware ABI major version 3.0) of IPC supported by the SOF firmware and set it as default. The topology IPC ops and the widget ops within the topology IPC ops are both mandatory.

With the introduction of IPC3 ops, we define the list of tokens pertaining to the AIF_IN/AIF_OUT widgets. Then these tokens are parsed during topology parsing and saved as part of the swidget tuples array. Once topology parsing is complete, these tokens will be applied to create the IPC structure for the host component based on the topology widget_setup op in ipc3_tplg_ops.

Change-Id: Ib2277385380edf018ea53a116f5cb2aefc4cbdbc Signed-off-by: Ranjani Sridharan ranjani.sridharan@linux.intel.com Reviewed-by: Bard Liao yung-chuan.liao@linux.intel.com Reviewed-by: Péter Ujfalusi peter.ujfalusi@linux.intel.com Reviewed-by: Pierre-Louis Bossart pierre-louis.bossart@linux.intel.com Link: https://lore.kernel.org/r/20220314200520.1233427-6-ranjani.sridharan@linux.intel.com Signed-off-by: Mark Brown broonie@kernel.org

--

Commit: https://git.seco.com/clea-os/bsp/mediatek/linux-seco-mtk/-/commit/b7a5324b98caf577fe3830fb9e298416f834791d

UPSTREAM: ASoC: SOF: topology: Add helper function for processing tuple arrays

Add a helper function for processing tuple arrays and populating the IPC structure objects based on the token ID passed.

Introduce a new enum representing token ID for the tokens currently used in the topology parse and a new struct sof_token_info to store the information about a token set. Finally, expose the struct snd_sof_topology token as it will be used by IPC-specific code.

Change-Id: Ic39a0c9304f7565c69ee354a462ced8a42cf2b26 Signed-off-by: Ranjani Sridharan ranjani.sridharan@linux.intel.com Reviewed-by: Bard Liao yung-chuan.liao@linux.intel.com Reviewed-by: Péter Ujfalusi peter.ujfalusi@linux.intel.com Reviewed-by: Pierre-Louis Bossart pierre-louis.bossart@linux.intel.com Link: https://lore.kernel.org/r/20220314200520.1233427-5-ranjani.sridharan@linux.intel.com Signed-off-by: Mark Brown broonie@kernel.org

--

Commit: https://git.seco.com/clea-os/bsp/mediatek/linux-seco-mtk/-/commit/b0a8b5a3e071c39942d376255b455f9256f8b278

UPSTREAM: ASoC: SOF: IPC: Introduce IPC ops

In preparation for supporting a new IPC version that will be introduced in the SOF firmware, add a new set of ops that will be version specific.

For now, the IPC ops contain only the topology-related ops for setting up widgets and pipeline connections. It will be expanded later to also abstract the IPC-specific items in the component driver and DAI driver.

Change-Id: Id71f722d398d43712ace79ed90719689bede2527 Signed-off-by: Ranjani Sridharan ranjani.sridharan@linux.intel.com Reviewed-by: Bard Liao yung-chuan.liao@linux.intel.com Reviewed-by: Péter Ujfalusi peter.ujfalusi@linux.intel.com Reviewed-by: Pierre-Louis Bossart pierre-louis.bossart@linux.intel.com Link: https://lore.kernel.org/r/20220314200520.1233427-4-ranjani.sridharan@linux.intel.com Signed-off-by: Mark Brown broonie@kernel.org

--

Commit: https://git.seco.com/clea-os/bsp/mediatek/linux-seco-mtk/-/commit/0a0f854f29fca4756544a9460dec4b0145e5f6b7

UPSTREAM: ASoC: SOF: Introduce struct snd_sof_dai_link

Introduce a new struct for DAI links to save the DAI link information parsed from topology. Also add a list of dai_links to struct snd_sof_dev that will be populated during topology parsing.

Change-Id: I4212f839178ea9cf628b0a63a721152fe2c6eae3 Signed-off-by: Ranjani Sridharan ranjani.sridharan@linux.intel.com Reviewed-by: Bard Liao yung-chuan.liao@linux.intel.com Reviewed-by: Péter Ujfalusi peter.ujfalusi@linux.intel.com Reviewed-by: Pierre-Louis Bossart pierre-louis.bossart@linux.intel.com Link: https://lore.kernel.org/r/20220314200520.1233427-2-ranjani.sridharan@linux.intel.com Signed-off-by: Mark Brown broonie@kernel.org

--

Commit: https://git.seco.com/clea-os/bsp/mediatek/linux-seco-mtk/-/commit/152ae0b6d6256a90ec1e1db8bcd87885a71433bf

UPSTREAM: dt-bindings: mailbox: mtk,adsp-mbox: add mtk adsp-mbox document

This patch adds document for mediatek adsp mbox

Change-Id: I9d86abec091c648a205605f6fae1ea5f4438c134 Signed-off-by: Allen-KH Cheng allen-kh.cheng@mediatek.com Reviewed-by: AngeloGioacchino Del Regno angelogioacchino.delregno@collabora.com Reviewed-by: Rob Herring robh@kernel.org Signed-off-by: Jassi Brar jaswinder.singh@linaro.org

--

Commit: https://git.seco.com/clea-os/bsp/mediatek/linux-seco-mtk/-/commit/dadfd0f8e271066b6dcb60187063eba2207bc5a6

UPSTREAM: mailbox: mediatek: add support for adsp mailbox controller

This patch is to for MediaTek ADSP IPC mailbox controller driver It is used to send short messages between processors with adsp

Change-Id: If8a465cc80691d123c58ca75d53b8312aed711c6 Signed-off-by: Allen-KH Cheng allen-kh.cheng@mediatek.com Reviewed-by: Tzung-Bi Shih tzungbi@google.com Reviewed-by: YC Hung yc.hung@mediatek.com Reviewed-by: AngeloGioacchino Del Regno angelogioacchino.delregno@collabora.com Signed-off-by: Jassi Brar jaswinder.singh@linaro.org

--

Commit: https://git.seco.com/clea-os/bsp/mediatek/linux-seco-mtk/-/commit/613ee260563fbeedf1da13e77169abb956928233

UPSTREAM: ASoC: Export DAI register and widget ctor and dctor functions

To allow for more flexibility i.e. populating component DAIs dynamically during its initialization, without being limited to topology loading procedure, expose snd_soc_register(), snd_soc_dapm_new_dai_widgets() and snd_soc_dapm_free_widget() functions.

Allows users to first check available resources e.g. number of PCMs supported by HDAudio codec before allocating the number of DAPM widgets needed. This prevents superfluous objects from being created or allows driver to adjust to situation when resources are limited.

Change-Id: Ice7a3716afef5a4c3c426cfdc08c069736be40e3 Signed-off-by: Cezary Rojewski cezary.rojewski@intel.com Link: https://lore.kernel.org/r/20220311153544.136854-3-cezary.rojewski@intel.com Signed-off-by: Mark Brown broonie@kernel.org

--

Commit: https://git.seco.com/clea-os/bsp/mediatek/linux-seco-mtk/-/commit/cdb68cd21462aaed646b0e8c26cbb62de50fd2ce

UPSTREAM: ASoC: SOF: Remove ipc_pcm_params() ops

All users have been converted to use the IPC agnostic set_stream_data_offsett()

Remove all code related to the old API.

Change-Id: I1c6f4c52fd5d1671823f86bd16748fbdbee59a7b Signed-off-by: Peter Ujfalusi peter.ujfalusi@linux.intel.com Reviewed-by: Pierre-Louis Bossart pierre-louis.bossart@linux.intel.com Reviewed-by: Rander Wang rander.wang@intel.com Reviewed-by: Daniel Baluta daniel.baluta@nxp.com Signed-off-by: Ranjani Sridharan ranjani.sridharan@linux.intel.com Link: https://lore.kernel.org/r/20220310042720.976809-11-ranjani.sridharan@linux.intel.com Signed-off-by: Mark Brown broonie@kernel.org

--

Commit: https://git.seco.com/clea-os/bsp/mediatek/linux-seco-mtk/-/commit/c8d8cedbfb3e97a6fe9f8e25cf190ae7a5872cea

UPSTREAM: ASoC: SOF: stream-ipc: Add sof_set_stream_data_offset()

Add implementation for the generic set_stream_data_offset() callback in core to be used by platforms.

Convert the sof_ipc_pcm_params() to a wrapper for the new function.

Change-Id: I39a0e90ddea1728eb6c296626eb804f5807ad363 Signed-off-by: Peter Ujfalusi peter.ujfalusi@linux.intel.com Reviewed-by: Pierre-Louis Bossart pierre-louis.bossart@linux.intel.com Reviewed-by: Rander Wang rander.wang@intel.com Reviewed-by: Daniel Baluta daniel.baluta@nxp.com Signed-off-by: Ranjani Sridharan ranjani.sridharan@linux.intel.com Link: https://lore.kernel.org/r/20220310042720.976809-7-ranjani.sridharan@linux.intel.com Signed-off-by: Mark Brown broonie@kernel.org

--

Commit: https://git.seco.com/clea-os/bsp/mediatek/linux-seco-mtk/-/commit/a0bf195ddd03bed876f823a56fc7083613b9bb8c

UPSTREAM: ASoC: SOF: Mark snd_sof_dsp_ops.ipc_pcm_params() callback optional

AMD is only implementing an empty function to pass the required test and it is going to be deprecated in favor of the IPC agnostic set_stream_data_offset() callback.

Change-Id: I372246532f8a5013e62361c12afe3b90889ab208 Signed-off-by: Peter Ujfalusi peter.ujfalusi@linux.intel.com Reviewed-by: Pierre-Louis Bossart pierre-louis.bossart@linux.intel.com Reviewed-by: Rander Wang rander.wang@intel.com Reviewed-by: Daniel Baluta daniel.baluta@nxp.com Signed-off-by: Ranjani Sridharan ranjani.sridharan@linux.intel.com Link: https://lore.kernel.org/r/20220310042720.976809-6-ranjani.sridharan@linux.intel.com Signed-off-by: Mark Brown broonie@kernel.org

--

Commit: https://git.seco.com/clea-os/bsp/mediatek/linux-seco-mtk/-/commit/49b39f02bfce77aa1cb1275f98cac6f559f7bef3

UPSTREAM: ASoC: SOF: Introduce optional callback to configure stream data offset

Each running audio stream's data have distinct start offset within the stream mailbox area from/to where the host can read/write.

Instead of using the struct sof_ipc_pcm_params_reply to configure this offset, add an optional callback which is IPC agnostic.

Change-Id: I9f5ad2acc169a58cf7aec474c0875a3823c15874 Signed-off-by: Peter Ujfalusi peter.ujfalusi@linux.intel.com Reviewed-by: Pierre-Louis Bossart pierre-louis.bossart@linux.intel.com Reviewed-by: Rander Wang rander.wang@intel.com Reviewed-by: Daniel Baluta daniel.baluta@nxp.com Signed-off-by: Ranjani Sridharan ranjani.sridharan@linux.intel.com Link: https://lore.kernel.org/r/20220310042720.976809-5-ranjani.sridharan@linux.intel.com Signed-off-by: Mark Brown broonie@kernel.org

--

Commit: https://git.seco.com/clea-os/bsp/mediatek/linux-seco-mtk/-/commit/2c95de4acd60d47323e29b5c0432ea0d9af48bd8

UPSTREAM: ASoC: SOF: pcm: Remove sof_pcm_dsp_params() wrapper

Call directly for snd_sof_ipc_pcm_params() from sof_pcm_hw_params() and remove the wrapper for it.

Change-Id: I781239b6c1a74faf30582877af686324d4f7a72b Signed-off-by: Peter Ujfalusi peter.ujfalusi@linux.intel.com Reviewed-by: Pierre-Louis Bossart pierre-louis.bossart@linux.intel.com Reviewed-by: Rander Wang rander.wang@intel.com Reviewed-by: Daniel Baluta daniel.baluta@nxp.com Signed-off-by: Ranjani Sridharan ranjani.sridharan@linux.intel.com Link: https://lore.kernel.org/r/20220310042720.976809-4-ranjani.sridharan@linux.intel.com Signed-off-by: Mark Brown broonie@kernel.org

--

Commit: https://git.seco.com/clea-os/bsp/mediatek/linux-seco-mtk/-/commit/3980c9e412635390e83063a397a947a1f2e3fcfd

BACKPORT: ASoC: SOF: Make pcm_hw_params snd_sof_dsp_ops callback IPC neutral

Do not send IPC structure directly via pcm_hw_params to make it IPC agnostic.

A new struct is created to retrieve the needed platform parameters and if there is a need it can be extended with new options.

Change-Id: I339c21277f1c3e7edced75edb8660a334688db60 Signed-off-by: Peter Ujfalusi peter.ujfalusi@linux.intel.com Reviewed-by: Pierre-Louis Bossart pierre-louis.bossart@linux.intel.com Reviewed-by: Rander Wang rander.wang@intel.com Reviewed-by: Daniel Baluta daniel.baluta@nxp.com Signed-off-by: Ranjani Sridharan ranjani.sridharan@linux.intel.com Link: https://lore.kernel.org/r/20220310042720.976809-3-ranjani.sridharan@linux.intel.com Signed-off-by: Mark Brown broonie@kernel.org

--

Commit: https://git.seco.com/clea-os/bsp/mediatek/linux-seco-mtk/-/commit/c15d2087e54f186b08ea52463fb3b2ef253907af

UPSTREAM: ASoC: SOF: sof-priv: Remove stale snd_sof_ipc_stream_pcm_params() declaration

The implementation for snd_sof_ipc_stream_pcm_params() does not exist, remove it from the header file.

Change-Id: Ib2df5e4bd29406a7d727b655dbe7f1de10c22cd1 Signed-off-by: Peter Ujfalusi peter.ujfalusi@linux.intel.com Reviewed-by: Pierre-Louis Bossart pierre-louis.bossart@linux.intel.com Reviewed-by: Rander Wang rander.wang@intel.com Reviewed-by: Daniel Baluta daniel.baluta@nxp.com Signed-off-by: Ranjani Sridharan ranjani.sridharan@linux.intel.com Link: https://lore.kernel.org/r/20220310042720.976809-2-ranjani.sridharan@linux.intel.com Signed-off-by: Mark Brown broonie@kernel.org

--

Commit: https://git.seco.com/clea-os/bsp/mediatek/linux-seco-mtk/-/commit/bfebc092f79b050673f3a7e558869b43777a9e83

UPSTREAM: ASoC: SOF: trace: Use proper DMA direction for the trace data buffer

Buffers allocated with snd_dma_alloc_pages() will have DMA direction DMA_BIDIRECTIONAL. The trace data memory is only used for one DMA direction: DMA_FROM_DEVICE, DMA only writes there, never reads.

We also need to do a sync before accessing (reading with CPU) from the trace data buffer to copy it to user space.

Note: snd_dma_buffer_sync() is also used for normal playback and capture streams to make sure that the data is available for the DMA or CPU.

Reviewed-by: Ranjani Sridharan ranjani.sridharan@linux.intel.com Change-Id: I0bb166e2763cbf592f707988860ffc34eb8f12e9 Signed-off-by: Peter Ujfalusi peter.ujfalusi@linux.intel.com Signed-off-by: Pierre-Louis Bossart pierre-louis.bossart@linux.intel.com Link: https://lore.kernel.org/r/20220310171651.249385-4-pierre-louis.bossart@linux.intel.com Signed-off-by: Mark Brown broonie@kernel.org

--

Commit: https://git.seco.com/clea-os/bsp/mediatek/linux-seco-mtk/-/commit/affe05867ec435088e8de7e7997296856aef0caf

UPSTREAM: ASoC: SOF: compress: fix null check after dereference

"cstream" is dereferenced but null checked later. Swap their positions to avoid potential null dereference.

Reviewed-by: Ranjani Sridharan ranjani.sridharan@linux.intel.com Reviewed-by: Daniel Baluta daniel.baluta@nxp.com Reviewed-by: Péter Ujfalusi peter.ujfalusi@linux.intel.com Change-Id: I964977674dd4b0c1bea7357ffab62fe1bd2623d4 Signed-off-by: Weiguo Li liwg06@foxmail.com Signed-off-by: Pierre-Louis Bossart pierre-louis.bossart@linux.intel.com Link: https://lore.kernel.org/r/20220310171651.249385-3-pierre-louis.bossart@linux.intel.com Signed-off-by: Mark Brown broonie@kernel.org

--

Commit: https://git.seco.com/clea-os/bsp/mediatek/linux-seco-mtk/-/commit/8cc90f211ac06d2abd3cb9e6e92ca7e21c88cb49

UPSTREAM: ASoC: SOF: ipc-msg-injector: Use devm_kzalloc() for the rx_buffer

The rx_buffer is cleared before sending an IPC to make sure that when the /sys/kernel/debug/sof/ipc_msg_inject file is read we will have correct information in the buffer (no random or stale data).

But if the user reads the file before sending any message the buffer might contain garbage which should not be interpreted.

To prevent this, clear the rx_buffer on allocation.

Fixes: cac0b0887e53 ("ASoC: SOF: Convert the generic IPC message injector into SOF client") Change-Id: I700122385b17eefb9f4fec1d27b027828843facc Signed-off-by: Peter Ujfalusi peter.ujfalusi@linux.intel.com Reviewed-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 Link: https://lore.kernel.org/r/20220309110104.18370-1-peter.ujfalusi@linux.intel.com Signed-off-by: Mark Brown broonie@kernel.org

--

Commit: https://git.seco.com/clea-os/bsp/mediatek/linux-seco-mtk/-/commit/0a6097dee010bd60a60b9e2f394062c8cf535361

UPSTREAM: ASoC: SOF: move definition of snd_sof_ipc to header file

Move definition of struct snd_sof_ipc to the header file so it can be shared with new IPC versions.

Change-Id: I4f545913cd3dccc45f03f8445fde3d9474b1766b Signed-off-by: Rander Wang rander.wang@intel.com Reviewed-by: Péter Ujfalusi peter.ujfalusi@linux.intel.com Reviewed-by: Pierre-Louis Bossart pierre-louis.bossart@linux.intel.com Signed-off-by: Ranjani Sridharan ranjani.sridharan@linux.intel.com Link: https://lore.kernel.org/r/20220308164344.577647-19-ranjani.sridharan@linux.intel.com Signed-off-by: Mark Brown broonie@kernel.org

--

Commit: https://git.seco.com/clea-os/bsp/mediatek/linux-seco-mtk/-/commit/a9e4d07494a4a7b21b4057d4bce81992b5d2a649

BACKPORT: ASoC: SOF: make struct snd_sof_dai IPC agnostic

Remove the comp_dai and dai_config members of struct snd_sof_dai and replace it with a void *private field. Introduce a new struct sof_dai_private_data that will contain the pointer to these two fields. The topology parser will populate this structure and save it as part of the "private" member in snd_sof_dai. Change all users of these fields to use the private member instead.

Change-Id: Ib52f58aa9f4eedca39d1d0e7bf4648b17607f4fb Signed-off-by: Ranjani Sridharan ranjani.sridharan@linux.intel.com Reviewed-by: Bard Liao yung-chuan.liao@linux.intel.com Reviewed-by: Péter Ujfalusi peter.ujfalusi@linux.intel.com Reviewed-by: Pierre-Louis Bossart pierre-louis.bossart@linux.intel.com Link: https://lore.kernel.org/r/20220308164344.577647-18-ranjani.sridharan@linux.intel.com Signed-off-by: Mark Brown broonie@kernel.org

--

Commit: https://git.seco.com/clea-os/bsp/mediatek/linux-seco-mtk/-/commit/eb4cd5548062a1ff258bf0244d7b8e9d2b305dc4

UPSTREAM: ASoC: SOF: topology: Rename arguments in sof_parse_tokens()

Rename the count and priv_size arguments in sof_parse_tokens() and add comments to clarify the arguments.

Change-Id: I8cfc7dd6c77b7401baeb5646016f9bd510823e0b Signed-off-by: Ranjani Sridharan ranjani.sridharan@linux.intel.com Reviewed-by: Bard Liao yung-chuan.liao@linux.intel.com Reviewed-by: Péter Ujfalusi peter.ujfalusi@linux.intel.com Reviewed-by: Pierre-Louis Bossart pierre-louis.bossart@linux.intel.com Link: https://lore.kernel.org/r/20220308164344.577647-17-ranjani.sridharan@linux.intel.com Signed-off-by: Mark Brown broonie@kernel.org

--

Commit: https://git.seco.com/clea-os/bsp/mediatek/linux-seco-mtk/-/commit/766d84f8730ec72a9f261866e68f55b3a8f58714

UPSTREAM: ASoC: SOF: topology: Rename arguments in sof_parse_token_sets()

Rename the priv_size arg to array_size and clarify the arguments in the comments.

Change-Id: I67c1cb1d38c69fff553cd8edd98472ca168c680c Signed-off-by: Ranjani Sridharan ranjani.sridharan@linux.intel.com Reviewed-by: Bard Liao yung-chuan.liao@linux.intel.com Reviewed-by: Péter Ujfalusi peter.ujfalusi@linux.intel.com Reviewed-by: Pierre-Louis Bossart pierre-louis.bossart@linux.intel.com Link: https://lore.kernel.org/r/20220308164344.577647-16-ranjani.sridharan@linux.intel.com Signed-off-by: Mark Brown broonie@kernel.org

--

Commit: https://git.seco.com/clea-os/bsp/mediatek/linux-seco-mtk/-/commit/419a7a53187ff024984a6aab716a695c38900954

UPSTREAM: ASoC: SOF: topology: Modify signature for token parsing functions

Modify the signature for sof_parse_uuid_tokens(), sof_parse_word_tokens() and sof_parse_string_tokens() to reorder the arguments to be more intuitive and rename the count arg to num_tokens.

Change-Id: I1df870d982adbce8d2c958d0f2221a919c685f9c Signed-off-by: Ranjani Sridharan ranjani.sridharan@linux.intel.com Reviewed-by: Bard Liao yung-chuan.liao@linux.intel.com Reviewed-by: Péter Ujfalusi peter.ujfalusi@linux.intel.com Reviewed-by: Pierre-Louis Bossart pierre-louis.bossart@linux.intel.com Link: https://lore.kernel.org/r/20220308164344.577647-15-ranjani.sridharan@linux.intel.com Signed-off-by: Mark Brown broonie@kernel.org

--

Commit: https://git.seco.com/clea-os/bsp/mediatek/linux-seco-mtk/-/commit/18fea0400f1bb7aa00db3dad23a1f7c6dba66bed

UPSTREAM: ASoC: SOF: Add a tuples array to struct snd_sof_widget

Add 2 new fields to snd_sof_widget to store an array of tuples defined by struct snd_sof_tuple and the number of tuples. When the topology gets parsed, the tuples associated with a widget will be stored in this array and will be used to construct the IPC structure depending on the IPC version.

Change-Id: Ia836d74ce6f9cdd7c5481ff47b363020a083fd40 Signed-off-by: Ranjani Sridharan ranjani.sridharan@linux.intel.com Reviewed-by: Bard Liao yung-chuan.liao@linux.intel.com Reviewed-by: Péter Ujfalusi peter.ujfalusi@linux.intel.com Reviewed-by: Pierre-Louis Bossart pierre-louis.bossart@linux.intel.com Link: https://lore.kernel.org/r/20220308164344.577647-14-ranjani.sridharan@linux.intel.com Signed-off-by: Mark Brown broonie@kernel.org

--

Commit: https://git.seco.com/clea-os/bsp/mediatek/linux-seco-mtk/-/commit/a886f1b8a28603490ffb6fbc3b2134c445a72c3f

UPSTREAM: ASoC: SOF: topology: make sof_route_load() IPC agnostic

The IPC structure can be set up using the fields in struct snd_sof_route when the pipeline connections are established.

Change-Id: Ide9f543c01ba719b91cd86514e0d6a65145fe661 Signed-off-by: Ranjani Sridharan ranjani.sridharan@linux.intel.com Reviewed-by: Bard Liao yung-chuan.liao@linux.intel.com Reviewed-by: Péter Ujfalusi peter.ujfalusi@linux.intel.com Reviewed-by: Pierre-Louis Bossart pierre-louis.bossart@linux.intel.com Link: https://lore.kernel.org/r/20220308164344.577647-13-ranjani.sridharan@linux.intel.com Signed-off-by: Mark Brown broonie@kernel.org

--

Commit: https://git.seco.com/clea-os/bsp/mediatek/linux-seco-mtk/-/commit/13d8ed8c8161a0b3c1286e353145153536c8ed62

UPSTREAM: ASoC: SOF: make struct snd_sof_widget IPC agnostic

Parse the UUID token and save it in the new uuid field in struct snd_sof_widget. struct sof_ipc_comp_ext is no longer needed. So remove it too.

Change-Id: If0638b7930a21b7cbdf6b63c2413848e37be2338 Signed-off-by: Ranjani Sridharan ranjani.sridharan@linux.intel.com Reviewed-by: Bard Liao yung-chuan.liao@linux.intel.com Reviewed-by: Péter Ujfalusi peter.ujfalusi@linux.intel.com Reviewed-by: Pierre-Louis Bossart pierre-louis.bossart@linux.intel.com Link: https://lore.kernel.org/r/20220308164344.577647-12-ranjani.sridharan@linux.intel.com Signed-off-by: Mark Brown broonie@kernel.org

--

Commit: https://git.seco.com/clea-os/bsp/mediatek/linux-seco-mtk/-/commit/4c46f293f09c329a37ea97093e19cc2b904dc452

UPSTREAM: ASoC: SOF: change comp_dai to a pointer in struct snd_sof_dai

This will avoid having to add the extended data for DAI components during sof_widget_setup() as an extra step.

Change-Id: Id043bc713733afbf0f22e334bb1caddacd1effac Signed-off-by: Ranjani Sridharan ranjani.sridharan@linux.intel.com Reviewed-by: Bard Liao yung-chuan.liao@linux.intel.com Reviewed-by: Péter Ujfalusi peter.ujfalusi@linux.intel.com Reviewed-by: Pierre-Louis Bossart pierre-louis.bossart@linux.intel.com Link: https://lore.kernel.org/r/20220307181111.49392-11-ranjani.sridharan@linux.intel.com Signed-off-by: Mark Brown broonie@kernel.org

--

Commit: https://git.seco.com/clea-os/bsp/mediatek/linux-seco-mtk/-/commit/71f76bb6093feb1a9e9ae6b9689eb0477473ce21

UPSTREAM: ASoC: SOF: topology: expose some get_token ops

These will be used later on by IPC-specific code.

Change-Id: I2dabbb1eb0e4df8641e8d6142a51430e86a455df Signed-off-by: Ranjani Sridharan ranjani.sridharan@linux.intel.com Reviewed-by: Bard Liao yung-chuan.liao@linux.intel.com Reviewed-by: Péter Ujfalusi peter.ujfalusi@linux.intel.com Reviewed-by: Pierre-Louis Bossart pierre-louis.bossart@linux.intel.com Link: https://lore.kernel.org/r/20220307181111.49392-10-ranjani.sridharan@linux.intel.com Signed-off-by: Mark Brown broonie@kernel.org

--

Commit: https://git.seco.com/clea-os/bsp/mediatek/linux-seco-mtk/-/commit/af0c91ac899e815a2cfd13a0b25420d696223b7f

UPSTREAM: ASoC: SOF: topology: Modify the get_token op for string tokens

Modify the get_token op for string type tokens to pass the string as the argument instead of a pointer to struct snd_soc_tplg_vendor_string_elem.

Change-Id: Ica4143c9ec7f20610934901f3e1880bdffe87ad5 Signed-off-by: Ranjani Sridharan ranjani.sridharan@linux.intel.com Reviewed-by: Bard Liao yung-chuan.liao@linux.intel.com Reviewed-by: Péter Ujfalusi peter.ujfalusi@linux.intel.com Reviewed-by: Pierre-Louis Bossart pierre-louis.bossart@linux.intel.com Link: https://lore.kernel.org/r/20220307181111.49392-9-ranjani.sridharan@linux.intel.com Signed-off-by: Mark Brown broonie@kernel.org

--

Commit: https://git.seco.com/clea-os/bsp/mediatek/linux-seco-mtk/-/commit/e0161ad9b9319dba377868478ddbaf5c73044443

UPSTREAM: ASoC: SOF: topology: Drop the size parameter from struct sof_topology_token

It is always 0 and never used while parsing.

Change-Id: I3ca36df9f886dabe2262d7ba45cbe98d15bc8948 Signed-off-by: Ranjani Sridharan ranjani.sridharan@linux.intel.com Reviewed-by: Bard Liao yung-chuan.liao@linux.intel.com Reviewed-by: Péter Ujfalusi peter.ujfalusi@linux.intel.com Reviewed-by: Pierre-Louis Bossart pierre-louis.bossart@linux.intel.com Link: https://lore.kernel.org/r/20220307181111.49392-8-ranjani.sridharan@linux.intel.com Signed-off-by: Mark Brown broonie@kernel.org

--

Commit: https://git.seco.com/clea-os/bsp/mediatek/linux-seco-mtk/-/commit/7d7b08150e1bcf068c536a4cd6a6ce9ad7838d15

UPSTREAM: ASoC: SOF: topology: remove redundant code

With the change in the commit: "ASoC: SOF: Intel: hda: assign link DMA channel at run-time", there is no need to find the CPU DAI in sof_link_hda_load().

Fixes: bdf4ad3fd01f ('ASoC: SOF: Intel: hda: assign link DMA channel at run-time')

Change-Id: I53398ee0bfaf4129088b981a160eb222b31ba27a Signed-off-by: Ranjani Sridharan ranjani.sridharan@linux.intel.com Reviewed-by: Bard Liao yung-chuan.liao@linux.intel.com Reviewed-by: Péter Ujfalusi peter.ujfalusi@linux.intel.com Reviewed-by: Pierre-Louis Bossart pierre-louis.bossart@linux.intel.com Link: https://lore.kernel.org/r/20220307181111.49392-6-ranjani.sridharan@linux.intel.com Signed-off-by: Mark Brown broonie@kernel.org

--

Commit: https://git.seco.com/clea-os/bsp/mediatek/linux-seco-mtk/-/commit/2b3dda01c92c55c95629181d69c4f527d403a6c1

UPSTREAM: ASoC: SOF: topology: remove redundant code in sof_link_afe_load()

Looks like a copy-paste error. The CPU DAI is never used.

Change-Id: Ia6667429a576ed3117b1bd816c628b838199ef12 Signed-off-by: Ranjani Sridharan ranjani.sridharan@linux.intel.com Reviewed-by: Bard Liao yung-chuan.liao@linux.intel.com Reviewed-by: Péter Ujfalusi peter.ujfalusi@linux.intel.com Reviewed-by: Pierre-Louis Bossart pierre-louis.bossart@linux.intel.com Link: https://lore.kernel.org/r/20220307181111.49392-7-ranjani.sridharan@linux.intel.com Signed-off-by: Mark Brown broonie@kernel.org

--

Commit: https://git.seco.com/clea-os/bsp/mediatek/linux-seco-mtk/-/commit/ea3295763689b9fb93221491265a048643761dd4

UPSTREAM: ASoC: SOF: sof-audio: removed unused function

cppcheck warning:

sound/soc/sof/sof-audio.c:884:0: style: The function 'snd_sof_find_spcm_pcm_id' is never used. [unusedFunction]

Change-Id: I7e260fd400b1a76f3c1fc687370280d47bc0163d Signed-off-by: Pierre-Louis Bossart pierre-louis.bossart@linux.intel.com Reviewed-by: Ranjani Sridharan ranjani.sridharan@intel.com Reviewed-by: Péter Ujfalusi peter.ujfalusi@linux.intel.com Link: https://lore.kernel.org/r/20220307181111.49392-5-ranjani.sridharan@linux.intel.com Signed-off-by: Mark Brown broonie@kernel.org

--

Commit: https://git.seco.com/clea-os/bsp/mediatek/linux-seco-mtk/-/commit/1ac8b068377970445a37fada64a5751e65a3fee4

UPSTREAM: ASoC: SOF: set swidget's core for scheduler widget

Set the swidget's core for scheduler type widgets to match that of the pipeline core. This simplifies the flow for core get/put during widget setup/free.

Change-Id: I8108e733315043cfb38d507d83faff144e07c179 Signed-off-by: Ranjani Sridharan ranjani.sridharan@linux.intel.com Reviewed-by: Bard Liao yung-chuan.liao@linux.intel.com Reviewed-by: Pierre-Louis Bossart pierre-louis.bossart@linux.intel.com Link: https://lore.kernel.org/r/20220307181111.49392-4-ranjani.sridharan@linux.intel.com Signed-off-by: Mark Brown broonie@kernel.org

--

Commit: https://git.seco.com/clea-os/bsp/mediatek/linux-seco-mtk/-/commit/b693d4e34dfa9268b79fdffda45ce3e2c91b459d

UPSTREAM: ASoC: SOF: simplify snd_sof_device_remove()

The commit "ASoC: SOF: core: Unregister machine driver before IPC and debugfs" moved the call to unregister the machine driver to be done before freeing the IPC. With this change, we can safely move the call to snd_sof_remove() inside the same if() block just above.

Change-Id: I136a811a0381d58ef6e909f391f8b935415f69e6 Signed-off-by: Ranjani Sridharan ranjani.sridharan@linux.intel.com Reviewed-by: Bard Liao yung-chuan.liao@linux.intel.com Reviewed-by: Pierre-Louis Bossart pierre-louis.bossart@linux.intel.com Link: https://lore.kernel.org/r/20220307181111.49392-3-ranjani.sridharan@linux.intel.com Signed-off-by: Mark Brown broonie@kernel.org

--

Commit: https://git.seco.com/clea-os/bsp/mediatek/linux-seco-mtk/-/commit/0495e70b54b3b9836d2fc6651219027277271956

UPSTREAM: ASoC: SOF: remove snd_sof_pipeline_find()

It is not used.

Change-Id: I6a7a78a6b86dc1891a8ac5361e875f00c17fdbaf Signed-off-by: Ranjani Sridharan ranjani.sridharan@linux.intel.com Reviewed-by: Bard Liao yung-chuan.liao@linux.intel.com Reviewed-by: Pierre-Louis Bossart pierre-louis.bossart@linux.intel.com Link: https://lore.kernel.org/r/20220307181111.49392-2-ranjani.sridharan@linux.intel.com Signed-off-by: Mark Brown broonie@kernel.org

--

Commit: https://git.seco.com/clea-os/bsp/mediatek/linux-seco-mtk/-/commit/220c233d9792842a14225346906aee5e8bfb407a

UPSTREAM: ASoC: SOF: fix 32 signed bit overflow

Shifting in a signed 32bit container past the signed bit is technically undefined behaviour. Fix by using unsigned types. Found via cppcheck.

Reviewed-by: Ranjani Sridharan ranjani.sridharan@linux.intel.com Reviewed-by: Liam Girdwood liam.r.girdwood@intel.com Change-Id: I8d4a9e594070f6577c0bca6dea4a856808fe6084 Signed-off-by: Curtis Malainey cujomalainey@chromium.org Signed-off-by: Pierre-Louis Bossart pierre-louis.bossart@linux.intel.com Link: https://lore.kernel.org/r/20220304205733.62233-9-pierre-louis.bossart@linux.intel.com Signed-off-by: Mark Brown broonie@kernel.org

--

Commit: https://git.seco.com/clea-os/bsp/mediatek/linux-seco-mtk/-/commit/72ebbec787ac3736ec1febfa1300c1a66235f993

UPSTREAM: ASoC: SOF: sof-priv: Drop duplicate sof_compressed_ops declaration

Other commit added the declaration of the sof_compressed_ops, drop the instance which added it as Platform specific ops, which the sof_compressed_ops is not.

76cdd90b27b4e ("ASoC: SOF: pcm: Add compress_ops for SOF platform component driver")

Change-Id: I8c1fc0c2155126743c5be3adef96c3a2a6c85e3e Signed-off-by: Peter Ujfalusi peter.ujfalusi@linux.intel.com Link: https://lore.kernel.org/r/20220225120034.11028-1-peter.ujfalusi@linux.intel.com Signed-off-by: Mark Brown broonie@kernel.org

--

Commit: https://git.seco.com/clea-os/bsp/mediatek/linux-seco-mtk/-/commit/908f80c74dafd099ad1589c159aeaf0ea585125d

UPSTREAM: ASoC: SOF: Declare sof_compress_ops in sof-priv.h

Fix the following sparse error: sound/soc/sof/compress.c:310:25: error: symbol 'sof_compressed_ops' was not declared. Should it be static?

Do not enable set the pd->compress_ops yet as it is not a valid assumption that real compress support really works when CONFIG_SND_SOC_SOF_COMPRESS is set as the HDA Probes support also selects it, but compressed audio is not supported (yet) on Intel platforms.

Fixes: 6324cf901e14c ("ASoC: SOF: compr: Add compress ops implementation") Change-Id: Ic22112eb9ae1738bb70fd7dd86ccaaebd717aa9a Signed-off-by: Peter Ujfalusi peter.ujfalusi@linux.intel.com Link: https://lore.kernel.org/r/20220224172324.17976-1-peter.ujfalusi@linux.intel.com Signed-off-by: Mark Brown broonie@kernel.org

--

Commit: https://git.seco.com/clea-os/bsp/mediatek/linux-seco-mtk/-/commit/73bcae44857a0a61705d288cb06b064ad5044646

UPSTREAM: ASoC: SOF: pcm: Add compress_ops for SOF platform component driver

Now that sof_compressed_ops initial implementation was merged we can enable it in SOF platform component driver.

This partially reverts commit 8a720724589e ("ASoC: SOF: pcm: Remove non existent CONFIG_SND_SOC_SOF_COMPRESS reference")

Reported-by: Peter Ujfalusi peter.ujfalusi@linux.intel.com Change-Id: Ifa57cf82180cf7706bf416061b4e51cc10504a20 Signed-off-by: Daniel Baluta daniel.baluta@nxp.com Link: https://lore.kernel.org/r/20220223153849.84471-1-daniel.baluta@oss.nxp.com Signed-off-by: Mark Brown broonie@kernel.org

--

Commit: https://git.seco.com/clea-os/bsp/mediatek/linux-seco-mtk/-/commit/a675e459a56b4ddcc55d5c19b68c8277b59d5fac

UPSTREAM: ASoC: SOF: Replace zero-length array with flexible-array member

There is a regular need in the kernel to provide a way to declare having a dynamically sized set of trailing elements in a structure. Kernel code should always use "flexible array members"[1] for these cases. The older style of one-element or zero-length arrays should no longer be used[2].

This helps with the ongoing efforts to globally enable -Warray-bounds and get us closer to being able to tighten the FORTIFY_SOURCE routines on memcpy().

[1] https://en.wikipedia.org/wiki/Flexible_array_member [2] https://www.kernel.org/doc/html/latest/process/deprecated.html#zero-length-and-one-element-arrays

Link: https://github.com/KSPP/linux/issues/78 Link: https://github.com/KSPP/linux/issues/180 Suggested-by: Gustavo A. R. Silva gustavoars@kernel.org Change-Id: Ic4ae2789869931d7e75b952d260ea14b9d53db7f Signed-off-by: Stephen Kitt steve@sk2.org Acked-by: Pierre-Louis Bossart pierre-louis.bossart@linux.intel.com Reviewed-by: Gustavo A. R. Silva gustavoars@kernel.org Link: https://lore.kernel.org/r/20220217132755.1786130-1-steve@sk2.org Signed-off-by: Mark Brown broonie@kernel.org

--

Commit: https://git.seco.com/clea-os/bsp/mediatek/linux-seco-mtk/-/commit/3111c8cccb6f0e47d2e6e4877d7c4ca11745c64e

UPSTREAM: ASoC: SOF: Makefile: Fix randconfig sof-client build when SND_SOC_SOF=y

Intel's kernel test robot found the following randconfig combination: SND_SOC_SOF=y SND_SOC_SOF_CLIENT=m

In this the sof-client object is not going to be built into the snd-sof.o and we will have undefined references to the sof-client functions.

Fixes: 6955d9512d0e ("ASoC: SOF: Introduce IPC SOF client support") Reported-by: kernel test robot lkp@intel.com Change-Id: I795e2b3c2e1e25ed7c405759adc99acef0d8334a Signed-off-by: Peter Ujfalusi <Peter Ujfalusi peter.ujfalusi@linux.intel.com> Link: https://lore.kernel.org/r/20220214071330.22151-1-peter.ujfalusi@linux.intel.com Signed-off-by: Mark Brown broonie@kernel.org

--

Commit: https://git.seco.com/clea-os/bsp/mediatek/linux-seco-mtk/-/commit/fc0fdda4742aeec9f7165e8cf944245a87975dc4

UPSTREAM: ASoC: SOF: compr: Mark snd_compress_ops static

Functions won't be directly used outside of compress.c file so mark them as static.

This will also fix warnings reported by kernel test robot:

sound/soc/sof/compress.c:91:5: warning: no previous prototype for function 'sof_compr_open' [-Wmissing-prototypes] int sof_compr_open(struct snd_soc_component *component, ^ sound/soc/sof/compress.c:91:1: note: declare 'static' if the function is not intended to be used outside of this translation unit int sof_compr_open(struct snd_soc_component *component,

Fixes: 6324cf901e14 ("SoC: SOF: compr: Add compress ops implementation") Reported-by: kernel test robot lkp@intel.com Change-Id: I7d2bb1692a703b20942d105b7328255c751954a3 Signed-off-by: Daniel Baluta daniel.baluta@nxp.com Link: https://lore.kernel.org/r/20220211082631.179735-1-daniel.baluta@oss.nxp.com Signed-off-by: Mark Brown broonie@kernel.org

--

Commit: https://git.seco.com/clea-os/bsp/mediatek/linux-seco-mtk/-/commit/7d6f90cea25f734ab8ef06765b53fc0ad7044fe0

BACKPORT: ASoC: SOF: Convert the generic probe support to SOF client

Add a new client driver for probes support and move all the probes-related code from the core to the client driver.

The probes client driver registers a component driver with one CPU DAI driver for extraction and creates a new sound card with one DUMMY DAI link with a dummy codec that will be used for extracting audio data from specific points in the audio pipeline.

The probes debugfs ops are based on the initial implementation by Cezary Rojewski and have been moved out of the SOF core into the client driver making it easier to maintain. This change will make it easier for the probes functionality to be added for all platforms without having the need to modify the existing(15+) machine drivers.

Change-Id: Ic8411bcb7e7c9e6e31d257b3850f04937c02b9e0 Signed-off-by: Ranjani Sridharan ranjani.sridharan@linux.intel.com Signed-off-by: Peter 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 Link: https://lore.kernel.org/r/20220210150525.30756-10-peter.ujfalusi@linux.intel.com Signed-off-by: Mark Brown broonie@kernel.org

--

Commit: https://git.seco.com/clea-os/bsp/mediatek/linux-seco-mtk/-/commit/f43339c4c0b24b083d455815fb81d52b3037b394

UPSTREAM: ASoC: SOF: Convert the generic IPC message injector into SOF client

Move the IPC message injection code out from the debug file as separate SOF client driver.

Based on the kernel configuration, the device registration for the new IPC message injector is going to happen in the core.

Change-Id: I3317a765d13281051e06974551184f65645f49e3 Signed-off-by: Peter 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 Link: https://lore.kernel.org/r/20220210150525.30756-9-peter.ujfalusi@linux.intel.com Signed-off-by: Mark Brown broonie@kernel.org

--

Commit: https://git.seco.com/clea-os/bsp/mediatek/linux-seco-mtk/-/commit/6cd20f1f7e60f5f86d137bd53555286738ba9bfc

UPSTREAM: ASoC: SOF: Convert the generic IPC flood test into SOF client

Move the IPC flood test code out from the debug file as separate SOF client driver.

Based on the kernel configuration, the device registration for the new IPC flood test is going to happen in the core. With the separate client driver it is going to be possible to run multiple flood tests in parallel to increase the stress, the new Kconfig option can be used to select this (defaults to 1). In order to preserve backward compatibility with existing SW/scripts, the first IPC flood test's debugfs files have been linked to the old files.

Change-Id: Ie71a000235019344b012b5bcc3ac25d2794f6e0e Signed-off-by: Ranjani Sridharan ranjani.sridharan@linux.intel.com Co-developed-by: Fred Oh fred.oh@linux.intel.com Signed-off-by: Fred Oh fred.oh@linux.intel.com Signed-off-by: Peter 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 Link: https://lore.kernel.org/r/20220210150525.30756-8-peter.ujfalusi@linux.intel.com Signed-off-by: Mark Brown broonie@kernel.org

--

Commit: https://git.seco.com/clea-os/bsp/mediatek/linux-seco-mtk/-/commit/7daeec2c87bee2c253883e5b96ece65ecc18ca18

UPSTREAM: ASoC: SOF: sof-client: Add support for clients not managed by pm framework

Some SOF client can be of 'passive' type, meaning that they do not handle PM framework callbacks by themselves but rely on the auxiliary driver's suspend and resume callbacks to be notified about the core's suspend or resume event.

Change-Id: Idd49f6bc2eec95bc03b6d7d3afca452b5ccb1212 Signed-off-by: Peter 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 Link: https://lore.kernel.org/r/20220210150525.30756-7-peter.ujfalusi@linux.intel.com Signed-off-by: Mark Brown broonie@kernel.org

--

Commit: https://git.seco.com/clea-os/bsp/mediatek/linux-seco-mtk/-/commit/2dd572bf14e50830abffabb3df4d1dd1d70c495b

UPSTREAM: ASoC: SOF: Introduce IPC SOF client support

A client in the SOF (Sound Open Firmware) context is a driver that needs to communicate with the DSP via IPC messages. The SOF core is responsible for serializing the IPC messages to the DSP from the different clients.

One example of an SOF client would be an IPC test client that floods the DSP with test IPC messages to validate if the serialization works as expected.

Multi-client support will also add the ability to split the existing audio cards into multiple ones, so as to e.g. to deal with HDMI with a dedicated client instead of adding HDMI to all cards.

This patch introduces descriptors for SOF client driver and SOF client device along with APIs for registering and unregistering a SOF client driver, sending IPCs from a client device and accessing the SOF core debugfs root entry.

Along with this, add a couple of new members to struct snd_sof_dev that will be used for maintaining the list of clients.

Change-Id: Iba40afb315202dfe94b01cba36ddd8159a9156cb Signed-off-by: Ranjani Sridharan ranjani.sridharan@linux.intel.com Co-developed-by: Fred Oh fred.oh@linux.intel.com Signed-off-by: Fred Oh fred.oh@linux.intel.com Signed-off-by: Peter 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 Link: https://lore.kernel.org/r/20220210150525.30756-6-peter.ujfalusi@linux.intel.com Signed-off-by: Mark Brown broonie@kernel.org

--

Commit: https://git.seco.com/clea-os/bsp/mediatek/linux-seco-mtk/-/commit/f323b9b45910b1229ac7be756f940fb3d2c5ebfe

UPSTREAM: ASoC: SOF: Split up utils.c into sof-utils and iomem-utils

The utils.c contains wrappers and implementation for accessing iomem mapped regions and a single unrelated function to create a compressed page table from snd_dma_buffer for firmware use.

The latter is used by the PCM and the dma trace code and it needs to be moved to a generic source/header for the client conversion to be possible.

Change-Id: I62c801c087fba06cf4b42aeb3dd167bf285853c6 Signed-off-by: Peter 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 Link: https://lore.kernel.org/r/20220210150525.30756-5-peter.ujfalusi@linux.intel.com Signed-off-by: Mark Brown broonie@kernel.org

--

Commit: https://git.seco.com/clea-os/bsp/mediatek/linux-seco-mtk/-/commit/a28539ed6d694bb28f310883208a27e2e588ce34

UPSTREAM: ASoC: SOF: ipc: Read and pass the whole message to handlers for IPC events

Change the parameter list for the firmware initiated message (IPC event) handler functions to: handler(struct snd_sof_dev *sdev, void *full_msg);

Allocate memory and read the whole message in snd_sof_ipc_msgs_rx() then pass the pointer to the function handling the message. Do this only if we actually have a function which is tasked to process the given type.

Change-Id: I09bee69fe395019695c1a7265b8fac26118425ef Signed-off-by: Peter 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 Link: https://lore.kernel.org/r/20220210150525.30756-4-peter.ujfalusi@linux.intel.com Signed-off-by: Mark Brown broonie@kernel.org

--

Commit: https://git.seco.com/clea-os/bsp/mediatek/linux-seco-mtk/-/commit/3b97d8661a8c54d4fdf659a14a38876141027ac4

UPSTREAM: ASoC: SOF: Move the definition of enum sof_dsp_power_states to global header

Move the enum sof_dsp_power_states to include/sound/sof.h to be accessible outside of the core SOF stack.

Change-Id: I2c21af75bd6e3fb2f2ab4fce07fc5a6b00c4defb Signed-off-by: Peter 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 Link: https://lore.kernel.org/r/20220210150525.30756-3-peter.ujfalusi@linux.intel.com Signed-off-by: Mark Brown broonie@kernel.org

--

Commit: https://git.seco.com/clea-os/bsp/mediatek/linux-seco-mtk/-/commit/163f4a6c0970bb62f429d26e4ec15d99d670fe06

UPSTREAM: ASoC: SOF: Drop unused DSP power states: D3_HOT and D3_COLD

The only reference to D3_HOT and D3_COLD DSP power state is in intel/hda-dsp.c in form of a dev_dbg() print.

Remove them as they are not used and even if they are they could be re-added via the substate.

Change-Id: I2e6b003765fa66a5488bb5e82adba0d90414f76c Signed-off-by: Peter 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 Link: https://lore.kernel.org/r/20220210150525.30756-2-peter.ujfalusi@linux.intel.com Signed-off-by: Mark Brown broonie@kernel.org

--

Commit: https://git.seco.com/clea-os/bsp/mediatek/linux-seco-mtk/-/commit/19be25fbdbb52d4aec5705c235438d1ae4586920

UPSTREAM: ASoC: SOF: compr: Add compress ops implementation

Implement snd_compress_ops. There are a lot of similarities with PCM implementation.

For now we use sof_ipc_pcm_params to transfer compress parameters to SOF firmware.

This will be changed in the future once we either add new compress parameters to SOF or enhance existing sof_ipc_pcm_params structure to support all native compress params.

Note that get_caps and get_codec_caps are missing and will be added later. This is because we need to find a way to advertise DSP capabilities depending on supported platforms.

Change-Id: Ic47e0974bc63c43bdfc4616b78569681f6c3b512 Signed-off-by: Daniel Baluta daniel.baluta@nxp.com Link: https://lore.kernel.org/r/20220120143741.492634-1-daniel.baluta@oss.nxp.com Signed-off-by: Mark Brown broonie@kernel.org

--

Commit: https://git.seco.com/clea-os/bsp/mediatek/linux-seco-mtk/-/commit/aa9d30265030d14a86232142e5a39f66af671c6a

BACKPORT: ASoC: SOF: dma-trace: Pass pointer to params_ext struct in trace_init()

Instead of passing a pointer to the stream_tag within the struct sof_ipc_dma_trace_params_ext, pass the pointer to the containing struct.

AMD needs to update buffer.phy_addr (and don't really use the stream_tag) for the trace implementation.

Change-Id: Ib7b3e16c8f651ad243a0f036922c100b158ce15f Signed-off-by: Peter Ujfalusi peter.ujfalusi@linux.intel.com Reviewed-by: Pierre-Louis Bossart pierre-louis.bossart@linux.intel.com Reviewed-by: Ranjani Sridharan ranjani.sridharan@linux.intel.com Link: https://lore.kernel.org/r/20220128123623.23569-3-peter.ujfalusi@linux.intel.com Signed-off-by: Mark Brown broonie@kernel.org

--

Commit: https://git.seco.com/clea-os/bsp/mediatek/linux-seco-mtk/-/commit/291c5466c28e4bfe8342db1f21f4ca6bf8b921b9

UPSTREAM: ASoC: SOF: ipc: Do not allocate buffer for msg_data

The sof_ipc_tx_message does not have support for async operations. There is no need to allocate a buffer and copy each message to it to be sent to the DSP, we can use the passed message data pointer directly.

Change-Id: Ia8125e558457822cd3a7411852e4cf342826116d Signed-off-by: Peter Ujfalusi peter.ujfalusi@linux.intel.com Reviewed-by: Kai Vehmanen kai.vehmanen@linux.intel.com Reviewed-by: Bard Liao yung-chuan.liao@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/20220128133620.9411-4-peter.ujfalusi@linux.intel.com Signed-off-by: Mark Brown broonie@kernel.org

--

Commit: https://git.seco.com/clea-os/bsp/mediatek/linux-seco-mtk/-/commit/b71388ce80ef7705bb93fbf91bd41ef023570262

UPSTREAM: ASoC: SOF: ipc: Drop header parameter from sof_ipc_tx_message_unlocked()

The snd_sof_ipc_msg.header is not used by platform code, there is no need to update it and the 'header' parameter for sof_ipc_tx_message_unlocked() can be dropped at the same time.

Instead of using the header parameter passed by the caller (which does by setting it to the hdr->cmd) use the hdr->cmd directly when logging.

At the same time make sure that there is a message passed to the tx_message function. All instances of the tx_message passes an IPC message, this check is placed to make sure the future users can not introduce bugs.

Change-Id: I4f4ae865b6b5f906d53d484831575eb81579368f Signed-off-by: Peter Ujfalusi peter.ujfalusi@linux.intel.com Reviewed-by: Kai Vehmanen kai.vehmanen@linux.intel.com Reviewed-by: Bard Liao yung-chuan.liao@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/20220128133620.9411-3-peter.ujfalusi@linux.intel.com Signed-off-by: Mark Brown broonie@kernel.org

--

Commit: https://git.seco.com/clea-os/bsp/mediatek/linux-seco-mtk/-/commit/ea23aa8b8a7fb0e1544e95f6c31c58d592ca3103

UPSTREAM: ASoC: SOF: trace: Simplify count adjustment in trace_read

The first count check and fixup against "buffer - lpos" can be removed as we will do the adjustment later against the "avail" in sof_dfsentry_trace_read()

Change-Id: If8d305e9651f132f89212a8b7cfb947a452089d6 Signed-off-by: Peter Ujfalusi peter.ujfalusi@linux.intel.com Reviewed-by: Pierre-Louis Bossart pierre-louis.bossart@linux.intel.com Reviewed-by: Ranjani Sridharan ranjani.sridharan@linux.intel.com Link: https://lore.kernel.org/r/20220128120627.18443-1-peter.ujfalusi@linux.intel.com Signed-off-by: Mark Brown broonie@kernel.org

--

Commit: https://git.seco.com/clea-os/bsp/mediatek/linux-seco-mtk/-/commit/90699d28f7877432a200680c1a6d5983070f26c4

BACKPORT: ASoC: SOF: add flag to disable IMR restore to sof_debug

Add flag _IGNORE_D3_PERSISTENT to disable IMR restore feature to the sof_debug module parameter.

The IMR restore feature will be enabled for all Intel cAVS platforms by default, but setting the flag _IGNORE_D3_PERSISTENT can help to disable the feature for debug purpose, to rule out any possible regression introduced by the change of not re-downloading firmware to the DSP at resuming from suspended state.

Reviewed-by: Ranjani Sridharan ranjani.sridharan@linux.intel.com Reviewed-by: Péter Ujfalusi peter.ujfalusi@linux.intel.com Change-Id: I07fc66cad5a7df54df8b2cd40ecbf7fcb1268d95 Signed-off-by: Keyon Jie yang.jie@linux.intel.com Signed-off-by: Pierre-Louis Bossart pierre-louis.bossart@linux.intel.com Link: https://lore.kernel.org/r/20220120231532.196926-6-pierre-louis.bossart@linux.intel.com Signed-off-by: Mark Brown broonie@kernel.org

--

Commit: https://git.seco.com/clea-os/bsp/mediatek/linux-seco-mtk/-/commit/2eb5ac72cfebfea0467ea9adc0ad982842f8cf99

UPSTREAM: ASoC: SOF: add _D3_PERSISTENT flag to fw_ready message

Add a bit definition to the fw_ready message, to denote if the FW supports the IMR (Isolated Memory Region) restoring feature.

If the bit is set, the driver can skip downloading the firmware again during system resume or runtime resume.

Bump the ABI version to 3.19 to make it aligned with FW side.

Reviewed-by: Ranjani Sridharan ranjani.sridharan@linux.intel.com Reviewed-by: Péter Ujfalusi peter.ujfalusi@linux.intel.com Change-Id: Ia4976ff5deb3b2c208f2c7ff8ce238cad71a5734 Signed-off-by: Keyon Jie yang.jie@linux.intel.com Signed-off-by: Pierre-Louis Bossart pierre-louis.bossart@linux.intel.com Link: https://lore.kernel.org/r/20220120231532.196926-2-pierre-louis.bossart@linux.intel.com Signed-off-by: Mark Brown broonie@kernel.org

--

Commit: https://git.seco.com/clea-os/bsp/mediatek/linux-seco-mtk/-/commit/acc3e2edf0629129fb2761c568e17af0a798fa0f

UPSTREAM: ASoC: SOF: Add clarifying comments for sof_core_debug and DSP dump flags

Update the comment for the global SOF level debug flags and add one for the flags used to control the DSP dump functionality.

Document the expected behavior when the SOF_DBG_DUMP_OPTIONAL is passed for the DSP dump: Only print the dump if SOF_DBG_PRINT_ALL_DUMPS is set Print must use KERN_DEBUG log level

Change-Id: I887b4d61e66cc9ece64ae76ed3f819e60e09fc97 Signed-off-by: Peter Ujfalusi peter.ujfalusi@linux.intel.com Reviewed-by: Pierre-Louis Bossart pierre-louis.bossart@linux.intel.com Reviewed-by: Chao Song chao.song@intel.com Reviewed-by: Kai Vehmanen kai.vehmanen@linux.intel.com Reviewed-by: Ranjani Sridharan ranjani.sridharan@linux.intel.com Link: https://lore.kernel.org/r/20211223113628.18582-19-peter.ujfalusi@linux.intel.com Signed-off-by: Mark Brown broonie@kernel.org

--

Commit: https://git.seco.com/clea-os/bsp/mediatek/linux-seco-mtk/-/commit/85c0ed75221cd6085f9fe01ca37eec3998281e72

BACKPORT: ASoC: SOF: Rename snd_sof_get_status() and add kernel log level parameter

The snd_sof_get_status() is not the best name for a function which in fact is tasked to print out DSP oops and stack. Rename it to sof_print_oops_and_stack().

At the same time add a new parameter to specify the desired kernel log level to be used for the prints.

When updating the users of the function, pass KERN_ERR for now to make sure that there is no functional change happens.

Change-Id: I4c66305049f825c1849600ec0caca2ee4a371f71 Signed-off-by: Peter Ujfalusi peter.ujfalusi@linux.intel.com Reviewed-by: Pierre-Louis Bossart pierre-louis.bossart@linux.intel.com Reviewed-by: Chao Song chao.song@intel.com Reviewed-by: Kai Vehmanen kai.vehmanen@linux.intel.com Reviewed-by: Ranjani Sridharan ranjani.sridharan@linux.intel.com Link: https://lore.kernel.org/r/20211223113628.18582-18-peter.ujfalusi@linux.intel.com Signed-off-by: Mark Brown broonie@kernel.org

--

Commit: https://git.seco.com/clea-os/bsp/mediatek/linux-seco-mtk/-/commit/13fb593c25ca7f141babd69efe3c136eea8ab800

UPSTREAM: ASoC: SOF: dsp_arch_ops: add kernel log level parameter for oops and stack

To allow custom log level to be used for the DSP oops and stack print, add a kernel log level parameter to the two ops.

Modify the xtensa oops and stack functions tom use this new log level parameter.

Pass KER_ERR from snd_sof_get_status() to make sure that there is no functional change with this new parameter.

Change-Id: I74f91d4da8a23dd421174148704f94febf8825d1 Signed-off-by: Peter Ujfalusi peter.ujfalusi@linux.intel.com Reviewed-by: Pierre-Louis Bossart pierre-louis.bossart@linux.intel.com Reviewed-by: Chao Song chao.song@intel.com Reviewed-by: Kai Vehmanen kai.vehmanen@linux.intel.com Reviewed-by: Ranjani Sridharan ranjani.sridharan@linux.intel.com Link: https://lore.kernel.org/r/20211223113628.18582-17-peter.ujfalusi@linux.intel.com Signed-off-by: Mark Brown broonie@kernel.org

--

Commit: https://git.seco.com/clea-os/bsp/mediatek/linux-seco-mtk/-/commit/b6d9e8ac8912c0bfa0e7171f66699bd9d68a48f4

UPSTREAM: ASoC: SOF: ops: Always print DSP Panic message but use different message

Never suppress the DSP panic dump as it is always originates from an assert() or panic() call within the firmware.

Use different message for DSP panics when there will be recovery attempt going to be done compared to a definitive DSP panic.

Suggested-by: Chao Song chao.song@linux.intel.com Change-Id: Icf2ba0125fb8905c36c064faa782f421ea3a78b2 Signed-off-by: Peter Ujfalusi peter.ujfalusi@linux.intel.com Reviewed-by: Pierre-Louis Bossart pierre-louis.bossart@linux.intel.com Reviewed-by: Chao Song chao.song@intel.com Reviewed-by: Kai Vehmanen kai.vehmanen@linux.intel.com Reviewed-by: Ranjani Sridharan ranjani.sridharan@linux.intel.com Link: https://lore.kernel.org/r/20211223113628.18582-16-peter.ujfalusi@linux.intel.com Signed-off-by: Mark Brown broonie@kernel.org

--

Commit: https://git.seco.com/clea-os/bsp/mediatek/linux-seco-mtk/-/commit/343d5c4debfd70186d4308ae1555e508bb5908a8

UPSTREAM: ASoc: SOF: core: Update the FW boot state transition diagram

Update the state flow diagram to reflect the current implementation.

Change-Id: I8501c90e9c216e6f7e8c06ce655b623c2361436d Signed-off-by: Peter Ujfalusi peter.ujfalusi@linux.intel.com Reviewed-by: Pierre-Louis Bossart pierre-louis.bossart@linux.intel.com Reviewed-by: Bard Liao yung-chuan.liao@linux.intel.com Reviewed-by: Ranjani Sridharan ranjani.sridharan@linux.intel.com Link: https://lore.kernel.org/r/20211223113628.18582-15-peter.ujfalusi@linux.intel.com Signed-off-by: Mark Brown broonie@kernel.org

--

Commit: https://git.seco.com/clea-os/bsp/mediatek/linux-seco-mtk/-/commit/869569228008cbe26c420c9a96d6afc15e405543

UPSTREAM: ASoC: SOF: pm: Force DSP off on suspend in BOOT_FAILED state also

Try to force the DSP to be turned off next time if the fw_state is either CRASHED or BOOT_FAILED when a suspend happens in order to attempt a clean boot to recover.

Change-Id: I1bdf0ad4a10c8f2fd2c4a5ed764351d4e795b6fe Signed-off-by: Peter Ujfalusi peter.ujfalusi@linux.intel.com Reviewed-by: Pierre-Louis Bossart pierre-louis.bossart@linux.intel.com Reviewed-by: Bard Liao yung-chuan.liao@linux.intel.com Reviewed-by: Ranjani Sridharan ranjani.sridharan@linux.intel.com Link: https://lore.kernel.org/r/20211223113628.18582-14-peter.ujfalusi@linux.intel.com Signed-off-by: Mark Brown broonie@kernel.org

--

Commit: https://git.seco.com/clea-os/bsp/mediatek/linux-seco-mtk/-/commit/7f82c4800872af8b4002b356b8081d57f5f16877

UPSTREAM: ASoC: SOF: Set SOF_FW_BOOT_FAILED in case we have failure during boot

Change the fw_state to SOF_FW_BOOT_FAILED if we encountered an error during booting the firmware.

Change-Id: I3a4012b469c58c91f83c9a8ca2d3d710f74db6d6 Signed-off-by: Peter Ujfalusi peter.ujfalusi@linux.intel.com Reviewed-by: Pierre-Louis Bossart pierre-louis.bossart@linux.intel.com Reviewed-by: Bard Liao yung-chuan.liao@linux.intel.com Reviewed-by: Ranjani Sridharan ranjani.sridharan@linux.intel.com Link: https://lore.kernel.org/r/20211223113628.18582-13-peter.ujfalusi@linux.intel.com Signed-off-by: Mark Brown broonie@kernel.org

--

Commit: https://git.seco.com/clea-os/bsp/mediatek/linux-seco-mtk/-/commit/d4fb96e793fc41f8906eae9b78604618b0f704c3

UPSTREAM: ASoC: SOF: ipc: Only allow sending of an IPC in SOF_FW_BOOT_COMPLETE state

If the state of the firmware is not BOOT_COMPLETE, it means that the firmware is not functioning, thus it is not capable of handling IPC messages. Do not try to send IPC if the state is not BOOT_COMPLETE

Change-Id: Ie5cca2a9b901fe3a31728a72804d567a7db186b4 Signed-off-by: Peter Ujfalusi peter.ujfalusi@linux.intel.com Reviewed-by: Pierre-Louis Bossart pierre-louis.bossart@linux.intel.com Reviewed-by: Bard Liao yung-chuan.liao@linux.intel.com Reviewed-by: Ranjani Sridharan ranjani.sridharan@linux.intel.com Link: https://lore.kernel.org/r/20211223113628.18582-12-peter.ujfalusi@linux.intel.com Signed-off-by: Mark Brown broonie@kernel.org

--

Commit: https://git.seco.com/clea-os/bsp/mediatek/linux-seco-mtk/-/commit/dd79f546e4f0c1abf654740f376bf8090f9c074e

UPSTREAM: ASoC: SOF: Rename 'enum snd_sof_fw_state' to 'enum sof_fw_state'

Since there is nothing SND about the firmware state, rename the enum from snd_sof_fw_state to simply sof_fw_state

Change-Id: Ie8efa1b9b0158d6affc4dca45f29c93d09a846be Signed-off-by: Peter Ujfalusi peter.ujfalusi@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: Kai Vehmanen kai.vehmanen@linux.intel.com Reviewed-by: Paul Olaru paul.olaru@oss.nxp.com Link: https://lore.kernel.org/r/20211223113628.18582-11-peter.ujfalusi@linux.intel.com Signed-off-by: Mark Brown broonie@kernel.org

--

Commit: https://git.seco.com/clea-os/bsp/mediatek/linux-seco-mtk/-/commit/a6ee691e8f7cf3db2ceb24dac333370aa8d830a9

UPSTREAM: ASoC: SOF: Move the definition of enum snd_sof_fw_state to global header

Move the enum snd_sof_fw_state to include/sound/sof.h to be accessible outside of the core SOF stack.

Change-Id: I0da221087371c84554ab0cb1e92cd8143df7c961 Signed-off-by: Peter Ujfalusi peter.ujfalusi@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: Kai Vehmanen kai.vehmanen@linux.intel.com Reviewed-by: Paul Olaru paul.olaru@oss.nxp.com Link: https://lore.kernel.org/r/20211223113628.18582-10-peter.ujfalusi@linux.intel.com Signed-off-by: Mark Brown broonie@kernel.org

--

Commit: https://git.seco.com/clea-os/bsp/mediatek/linux-seco-mtk/-/commit/78d4e5a569cd62393ef736f170de290642721976

UPSTREAM: ASoC: SOF: Introduce new firmware state: SOF_FW_BOOT_READY_OK

The SOF_FW_BOOT_READY_OK fw_state indicates that the boot ready message has been received and there were no errors found.

The SOF_FW_BOOT_COMPLETE state will be reached after the snd_sof_dsp_post_fw_run() completes without error.

Change-Id: I3bce2d458db71c8986975de325ffdb938d387c1b Signed-off-by: Peter Ujfalusi peter.ujfalusi@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: Kai Vehmanen kai.vehmanen@linux.intel.com Reviewed-by: Paul Olaru paul.olaru@oss.nxp.com Link: https://lore.kernel.org/r/20211223113628.18582-9-peter.ujfalusi@linux.intel.com Signed-off-by: Mark Brown broonie@kernel.org

--

Commit: https://git.seco.com/clea-os/bsp/mediatek/linux-seco-mtk/-/commit/aae8f7f1ee0e93a5ed346053f480441af3a6e09f

UPSTREAM: ASoC: SOF: Introduce new firmware state: SOF_FW_CRASHED

The SOF_FW_CRASHED state is meant to indicate the unfortunate case when the firmware has crashed after a successful boot.

IPC tx timeout is not treated as indication of a firmware crash as it tends to happen regularly while the firmware is operational.

Change-Id: I2c7cdada7806728bbc21d096d0645e8fb1b2ce99 Signed-off-by: Peter Ujfalusi peter.ujfalusi@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: Kai Vehmanen kai.vehmanen@linux.intel.com Reviewed-by: Paul Olaru paul.olaru@oss.nxp.com Link: https://lore.kernel.org/r/20211223113628.18582-8-peter.ujfalusi@linux.intel.com Signed-off-by: Mark Brown broonie@kernel.org

--

Commit: https://git.seco.com/clea-os/bsp/mediatek/linux-seco-mtk/-/commit/0a0bd390803a04b2bfdf664dfc234140f4c1427b

BACKPORT: ASoC: SOF: Add a 'message' parameter to snd_sof_dsp_dbg_dump()

When snd_sof_dsp_dbg_dump() is called we have an explanatory message to give some hint on the reason why we have the dump on the caller level.

Pass this message to snd_sof_dsp_dbg_dump() and handle the print according to the dump rules.

This way we can finally print information on the HDA boot iteration if all dumps are enabled.

Change-Id: I16bc0b8f5270cde9da8e6cc2b09581cdcd2ad5d7 Signed-off-by: Peter Ujfalusi peter.ujfalusi@linux.intel.com Reviewed-by: Ranjani Sridharan ranjani.sridharan@linux.intel.com Reviewed-by: Pierre-Louis Bossart pierre-louis.bossart@linux.intel.com Reviewed-by: Kai Vehmanen kai.vehmanen@linux.intel.com Link: https://lore.kernel.org/r/20211223113628.18582-7-peter.ujfalusi@linux.intel.com Signed-off-by: Mark Brown broonie@kernel.org

--

Commit: https://git.seco.com/clea-os/bsp/mediatek/linux-seco-mtk/-/commit/b941972520ec02d5dbf29ca59ac9887089b54d79

BACKPORT: ASoC: SOF: Add 'non_recoverable' parameter to snd_sof_dsp_panic()

Some platforms use retries during firmware boot to overcome DSP startup issues. In these cases we might receive a DSP panic message which should not be treated as fatal if it happens during boot.

Pass this information to snd_sof_dsp_panic() and omit the panic print if it is not fatal or the user does not want to see all dumps.

Change-Id: I819bb14e2dd017072f2685b54ac79a31baa2e45d Signed-off-by: Peter Ujfalusi peter.ujfalusi@linux.intel.com Reviewed-by: Ranjani Sridharan ranjani.sridharan@linux.intel.com Reviewed-by: Pierre-Louis Bossart pierre-louis.bossart@linux.intel.com Reviewed-by: Kai Vehmanen kai.vehmanen@linux.intel.com Link: https://lore.kernel.org/r/20211223113628.18582-6-peter.ujfalusi@linux.intel.com Signed-off-by: Mark Brown broonie@kernel.org

--

Commit: https://git.seco.com/clea-os/bsp/mediatek/linux-seco-mtk/-/commit/771a71dcb528e5442bb237ec474f935231a84429

UPSTREAM: ASoC: SOF: Use sof_debug_check_flag() instead of sof_core_debug directly

The sof_debug_check_flag() is available for checking flags set in sof_core_debug.

sof_core_debug can be marked static in core.c

Change-Id: I9e6ab80f0c633b998961e26bcf447fdfd938a8d6 Signed-off-by: Peter Ujfalusi peter.ujfalusi@linux.intel.com Reviewed-by: Ranjani Sridharan ranjani.sridharan@linux.intel.com Reviewed-by: Pierre-Louis Bossart pierre-louis.bossart@linux.intel.com Reviewed-by: Kai Vehmanen kai.vehmanen@linux.intel.com Link: https://lore.kernel.org/r/20211223113628.18582-5-peter.ujfalusi@linux.intel.com Signed-off-by: Mark Brown broonie@kernel.org

--

Commit: https://git.seco.com/clea-os/bsp/mediatek/linux-seco-mtk/-/commit/f1d92ece9778adf1a55d2e8d354347dcd88dfb9a

UPSTREAM: ASoC: SOF: core: Add simple wrapper to check flags in sof_core_debug

The sof_debug_check_flag() can be used to check a flag or a combination of them in sof_core_debug.

Change-Id: I7c479ad0ec83b88a8a7ff5333122ef1d847a823b Signed-off-by: Peter Ujfalusi peter.ujfalusi@linux.intel.com Reviewed-by: Ranjani Sridharan ranjani.sridharan@linux.intel.com Reviewed-by: Pierre-Louis Bossart pierre-louis.bossart@linux.intel.com Reviewed-by: Kai Vehmanen kai.vehmanen@linux.intel.com Link: https://lore.kernel.org/r/20211223113628.18582-4-peter.ujfalusi@linux.intel.com Signed-off-by: Mark Brown broonie@kernel.org

--

Commit: https://git.seco.com/clea-os/bsp/mediatek/linux-seco-mtk/-/commit/0173d835766f66a7fdf411e1bb5e05a60300dbf6

UPSTREAM: ASoC: SOF: ops: Use dev_warn() if the panic offsets differ

Catch the cases when the stored sdev->dsp_oops_offset and the offset received via the panic message differs and print a warning, but keep using the dsp_oops_offset for the oops query.

Change-Id: Ifd51409fc9d074ec8c3c542dc541aa21957e402a Signed-off-by: Peter Ujfalusi peter.ujfalusi@linux.intel.com Reviewed-by: Ranjani Sridharan ranjani.sridharan@linux.intel.com Reviewed-by: Pierre-Louis Bossart pierre-louis.bossart@linux.intel.com Reviewed-by: Kai Vehmanen kai.vehmanen@linux.intel.com Link: https://lore.kernel.org/r/20211223113628.18582-2-peter.ujfalusi@linux.intel.com Signed-off-by: Mark Brown broonie@kernel.org

--

Commit: https://git.seco.com/clea-os/bsp/mediatek/linux-seco-mtk/-/commit/ca02000fe09e6c2644ca24a0c2cae644f38c7243

UPSTREAM: ASoC: SOF: Kconfig: Make the SOF_DEVELOPER_SUPPORT depend on SND_SOC_SOF

SND_SOC_SOF_DEVELOPER_SUPPORT contains options affecting how the built SOF driver stack will behave, enables debug options and other features.

These options have no meaning if the SND_SOC_SOF is not even enabled.

If we have SOF client options under developer_support and debug they can be selected to be built even without the core, but they do need symbols from the core (the sof-client API) which can result build failure.

In Kconfig we can have SND_SOC_SOF_TOPLEVEL=y SND_SOC_SOF_DEBUG_IPC_FLOOD_TEST=y

for example, which will make the flood client to be built, but the SOF core is not as SND_SOC_SOF is not selected.

Reviewed-by: Paul Olaru paul.olaru@oss.nxp.com Reviewed-by: Daniel Baluta daniel.baluta@nxp.com Reviewed-by: Ranjani Sridharan ranjani.sridharan@intel.com Change-Id: I1fa65b722cba3f392a3bfda662eed5fbc0dd0e81 Signed-off-by: Peter Ujfalusi peter.ujfalusi@linux.intel.com Signed-off-by: Pierre-Louis Bossart pierre-louis.bossart@linux.intel.com Link: https://lore.kernel.org/r/20211216230350.343857-1-pierre-louis.bossart@linux.intel.com Signed-off-by: Mark Brown broonie@kernel.org

--

Commit: https://git.seco.com/clea-os/bsp/mediatek/linux-seco-mtk/-/commit/7321d77736487ef5682fc70460bded689814fed8

UPSTREAM: ipc: debug: Add shared memory heap to memory scan

Newly added shared heap zones should be taken into account during memory usage scanning.

Reviewed-by: Kai Vehmanen kai.vehmanen@linux.intel.com Reviewed-by: Liam Girdwood liam.r.girdwood@intel.com Change-Id: I015a9aed1cb63825fc090c9f5217249e9d59e1d1 Signed-off-by: Karol Trzcinski karolx.trzcinski@linux.intel.com Signed-off-by: Pierre-Louis Bossart pierre-louis.bossart@linux.intel.com Link: https://lore.kernel.org/r/20211216232422.345164-4-pierre-louis.bossart@linux.intel.com Signed-off-by: Mark Brown broonie@kernel.org

--

Commit: https://git.seco.com/clea-os/bsp/mediatek/linux-seco-mtk/-/commit/1527c80d9a253e7410a727f1c2a9f8b573cf109c

UPSTREAM: ASoC: SOF: ipc: Add null pointer check for substream->runtime

When pcm stream is stopped "substream->runtime" pointer will be set to NULL by ALSA core. In case host received an ipc msg from firmware of type IPC_STREAM_POSITION after pcm stream is stopped, there will be kernel NULL pointer exception in ipc_period_elapsed(). This patch fixes it by adding NULL pointer check for "substream->runtime".

Reviewed-by: Ranjani Sridharan ranjani.sridharan@linux.intel.com Change-Id: I34be522b624ee740c616a2cd44be4f79499e9141 Signed-off-by: Ajit Kumar Pandey AjitKumar.Pandey@amd.com Signed-off-by: Pierre-Louis Bossart pierre-louis.bossart@linux.intel.com Link: https://lore.kernel.org/r/20211216232422.345164-3-pierre-louis.bossart@linux.intel.com Signed-off-by: Mark Brown broonie@kernel.org

--

Commit: https://git.seco.com/clea-os/bsp/mediatek/linux-seco-mtk/-/commit/c11f4e0b733797970221e7d1f5019c7d2714cfea

BACKPORT: ASoC: SOF: avoid casting "const" attribute away

Casting "const" attribute away is dangerous, obtain a writable pointer instead to avoid that.

Change-Id: If12e15b7f488e2042e6002d8f75cbcaa260cc926 Signed-off-by: Guennadi Liakhovetski guennadi.liakhovetski@linux.intel.com Signed-off-by: Pierre-Louis Bossart pierre-louis.bossart@linux.intel.com Link: https://lore.kernel.org/r/20211216232422.345164-2-pierre-louis.bossart@linux.intel.com Signed-off-by: Mark Brown broonie@kernel.org

--

Commit: https://git.seco.com/clea-os/bsp/mediatek/linux-seco-mtk/-/commit/14f311fd6ebbe7a11e10a8d28363e4f7d1d1e65a

UPSTREAM: ASoC: SOF: pcm: remove support for RESUME trigger

The SOF driver removed the support for INFO_RESUME in the commit "ASoC: SOF: pcm: do not add SNDRV_PCM_INFO_RESUME to runtime hw info". And resuming is handled by the ALSA core with the .prepare and .trigger_start stages. So, remove handling of RESUME trigger in the component driver trigger op.

Reviewed-by: Kai Vehmanen kai.vehmanen@intel.com Reviewed-by: Rander Wang rander.wang@intel.com Reviewed-by: Bard Liao yung-chuan.liao@linux.intel.com Change-Id: I62c52857102529397913090de4ece04040a9f50f Signed-off-by: Ranjani Sridharan ranjani.sridharan@linux.intel.com Signed-off-by: Pierre-Louis Bossart pierre-louis.bossart@linux.intel.com Link: https://lore.kernel.org/r/20211216231628.344687-2-pierre-louis.bossart@linux.intel.com Signed-off-by: Mark Brown broonie@kernel.org

--

Commit: https://git.seco.com/clea-os/bsp/mediatek/linux-seco-mtk/-/commit/89b9b42dd51a67b74fd1501ea896a90b40d356b5

UPSTREAM: ASoC: SOF: topology: read back control data from DSP

Read back the control data from the DSP to initialize the control data size to match that of the data in the DSP. This is particularly useful for volatile read-only kcontrols in static pipelines.

Change-Id: I2c8e09732cf6d454beb2cb63d6185fb08b2c82a9 Signed-off-by: Ranjani Sridharan ranjani.sridharan@linux.intel.com Reviewed-by: Pierre-Louis Bossart pierre-louis.bossart@linux.intel.com Reviewed-by: Péter Ujfalusi peter.ujfalusi@linux.intel.com Link: https://lore.kernel.org/r/20211215180404.53254-9-ranjani.sridharan@linux.intel.com Signed-off-by: Mark Brown broonie@kernel.org

--

Commit: https://git.seco.com/clea-os/bsp/mediatek/linux-seco-mtk/-/commit/f0361147d8a2d18165cb1960f707005549bb0ceb

UPSTREAM: ASoC: SOF: Drop ctrl_type parameter for snd_sof_ipc_set_get_comp_data()

The SOF_CTRL_TYPE_VALUE_COMP_* type is not used by the firmware nor in the kernel side. It is also not clear what action should be taken for such type.

With this in mind: The correct ipc_cmd can be selected based on the ctrl_cmd and the set parameters: if the ctrl_cmd is SOF_CTRL_CMD_BINARY then SOF_CTRL_TYPE_DATA_* otherwise SOF_CTRL_TYPE_VALUE_CHAN_*.

The SET or GET direction can be selected with the use of set parameter.

Change-Id: I5746a49c72cbe6e1e714e44e7f5028a2704536f9 Signed-off-by: Peter Ujfalusi peter.ujfalusi@linux.intel.com Reviewed-by: Pierre-Louis Bossart pierre-louis.bossart@linux.intel.com Reviewed-by: Bard Liao yung-chuan.liao@linux.intel.com Reviewed-by: Kai Vehmanen kai.vehmanen@linux.intel.com Signed-off-by: Ranjani Sridharan ranjani.sridharan@linux.intel.com Link: https://lore.kernel.org/r/20211215180404.53254-8-ranjani.sridharan@linux.intel.com Signed-off-by: Mark Brown broonie@kernel.org

--

Commit: https://git.seco.com/clea-os/bsp/mediatek/linux-seco-mtk/-/commit/209c95b6b524d4831d09da10e2a242162b0c86a5

UPSTREAM: ASoC: SOF: control: Do not handle control notification with component type

The component type is not used in firmware nor in the kernel currently and it is not even clear how it should be handled.

Do not even try to handle it to avoid errors.

Change-Id: I8ec73f5956f385bfb77472f0280e774e98429b70 Signed-off-by: Peter Ujfalusi peter.ujfalusi@linux.intel.com Reviewed-by: Pierre-Louis Bossart pierre-louis.bossart@linux.intel.com Reviewed-by: Bard Liao yung-chuan.liao@linux.intel.com Reviewed-by: Kai Vehmanen kai.vehmanen@linux.intel.com Signed-off-by: Ranjani Sridharan ranjani.sridharan@linux.intel.com Link: https://lore.kernel.org/r/20211215180404.53254-7-ranjani.sridharan@linux.intel.com Signed-off-by: Mark Brown broonie@kernel.org

--

Commit: https://git.seco.com/clea-os/bsp/mediatek/linux-seco-mtk/-/commit/a29bb95f689c301dcf3f0b58f228e4888f8c4b25

UPSTREAM: ASoC: SOF: sof-audio: Drop the cmd member from struct snd_sof_control

There is no need to use two variables to store and check the same information, the scontrol->cmd is the same as scontrol->control_data->cmd.

Drop the former one and when it is needed, access the cmd from the control_data.

Change-Id: Ifac6ecf3cda0197e1bb78afaf47f87a7bdf0cd47 Signed-off-by: Peter Ujfalusi peter.ujfalusi@linux.intel.com Reviewed-by: Pierre-Louis Bossart pierre-louis.bossart@linux.intel.com Reviewed-by: Bard Liao yung-chuan.liao@linux.intel.com Reviewed-by: Kai Vehmanen kai.vehmanen@linux.intel.com Signed-off-by: Ranjani Sridharan ranjani.sridharan@linux.intel.com Link: https://lore.kernel.org/r/20211215180404.53254-6-ranjani.sridharan@linux.intel.com Signed-off-by: Mark Brown broonie@kernel.org

--

Commit: https://git.seco.com/clea-os/bsp/mediatek/linux-seco-mtk/-/commit/6755c4692ee94602425b907d045d2dce3d6a59b4

UPSTREAM: ASoC: SOF: Drop ctrl_cmd parameter for snd_sof_ipc_set_get_comp_data()

The scontrol->control_data->cmd has been configured during initialization to the correct sof_ipc_ctrl_cmd.

No need to pass duplicated information, let's use the already available one via scontrol.

Change-Id: I312aed73292b1169f1497fbea6f563c8ee22059b Signed-off-by: Peter Ujfalusi peter.ujfalusi@linux.intel.com Reviewed-by: Pierre-Louis Bossart pierre-louis.bossart@linux.intel.com Reviewed-by: Bard Liao yung-chuan.liao@linux.intel.com Reviewed-by: Kai Vehmanen kai.vehmanen@linux.intel.com Signed-off-by: Ranjani Sridharan ranjani.sridharan@linux.intel.com Link: https://lore.kernel.org/r/20211215180404.53254-5-ranjani.sridharan@linux.intel.com Signed-off-by: Mark Brown broonie@kernel.org

--

Commit: https://git.seco.com/clea-os/bsp/mediatek/linux-seco-mtk/-/commit/a62feb2cc2b387c2ecae08aac346e4d64bb1ca3a

UPSTREAM: ASoC: SOF: topology: Set control_data->cmd alongside scontrol->cmd

Set the scontrol->control_data->cmd early to the same as scontrol->cmd.

This is a preparatory patch to remove the ctrl_cmd parameter for the snd_sof_ipc_set_get_comp_data() function.

Change-Id: I52eeeeab037fdfe368c9df298018c9244866d342 Signed-off-by: Peter Ujfalusi peter.ujfalusi@linux.intel.com Reviewed-by: Pierre-Louis Bossart pierre-louis.bossart@linux.intel.com Reviewed-by: Bard Liao yung-chuan.liao@linux.intel.com Reviewed-by: Kai Vehmanen kai.vehmanen@linux.intel.com Signed-off-by: Ranjani Sridharan ranjani.sridharan@linux.intel.com Link: https://lore.kernel.org/r/20211215180404.53254-4-ranjani.sridharan@linux.intel.com Signed-off-by: Mark Brown broonie@kernel.org

--

Commit: https://git.seco.com/clea-os/bsp/mediatek/linux-seco-mtk/-/commit/063a247c28469868fe2adae62271d3019e2a5805

UPSTREAM: ASoC: SOF: Drop ipc_cmd parameter for snd_sof_ipc_set_get_comp_data()

The correct ipc_cmd can be selected based on the ctrl_cmd and the set parameters: if the ctrl_cmd is SOF_CTRL_CMD_BINARY then SOF_IPC_COMP_DATA otherwise SOF_IPC_COMP_VALUE.

The SET or GET direction can be selected with the use of set parameter.

Change-Id: I29eeeafa20063a03f6b5d9e5abecb0b6d224f533 Signed-off-by: Peter Ujfalusi peter.ujfalusi@linux.intel.com Reviewed-by: Pierre-Louis Bossart pierre-louis.bossart@linux.intel.com Reviewed-by: Bard Liao yung-chuan.liao@linux.intel.com Reviewed-by: Kai Vehmanen kai.vehmanen@linux.intel.com Signed-off-by: Ranjani Sridharan ranjani.sridharan@linux.intel.com Link: https://lore.kernel.org/r/20211215180404.53254-3-ranjani.sridharan@linux.intel.com Signed-off-by: Mark Brown broonie@kernel.org

--

Commit: https://git.seco.com/clea-os/bsp/mediatek/linux-seco-mtk/-/commit/c629cdf9dfb2199f5c2f2dcdfe701310378f7539

UPSTREAM: ASoC: SOF: ipc: Rename send parameter in snd_sof_ipc_set_get_comp_data()

Rename the send parameter to set in snd_sof_ipc_set_get_comp_data() and sof_set_get_large_ctrl_data() to be more aligned with the function name.

No functional change.

Change-Id: I7d705338a57a8e92c44145bbb299ae3b11ac3da3 Signed-off-by: Peter Ujfalusi peter.ujfalusi@linux.intel.com Reviewed-by: Pierre-Louis Bossart pierre-louis.bossart@linux.intel.com Reviewed-by: Bard Liao yung-chuan.liao@linux.intel.com Reviewed-by: Kai Vehmanen kai.vehmanen@linux.intel.com Signed-off-by: Ranjani Sridharan ranjani.sridharan@linux.intel.com Link: https://lore.kernel.org/r/20211215180404.53254-2-ranjani.sridharan@linux.intel.com Signed-off-by: Mark Brown broonie@kernel.org

--

Commit: https://git.seco.com/clea-os/bsp/mediatek/linux-seco-mtk/-/commit/3d97ade102fa6d4292e00d3fc86c24c1d15971e4

BACKPORT: ASoC: SOF: OF: Avoid reverse module dependency

Similar with commit 8a49cd11e68ed0 ("ASoC: SOF: ACPI: avoid reverse module dependency") we will be having hardware specific drivers that link against a common "helper" framework.

sof-of-dev.c becomes a library with the interface defined in the newly created file sof-of-dev.h.

This is the final step started with Kconfig simplification in commit 7548a391c53ca ("ASoC: SOF: i.MX: simplify Kconfig")

Change-Id: I770ebb6d8759748509e865080625ba8ca4991763 Signed-off-by: Daniel Baluta daniel.baluta@nxp.com Reviewed-by: Paul Olaru paul.olaru@oss.nxp.com Reviewed-by: Péter Ujfalusi peter.ujfalusi@linux.intel.com Reviewed-by: Pierre-Louis Bossart pierre-louis.bossart@linux.intel.com Link: https://lore.kernel.org/r/20211215085703.137414-1-daniel.baluta@oss.nxp.com Signed-off-by: Mark Brown broonie@kernel.org

--

Commit: https://git.seco.com/clea-os/bsp/mediatek/linux-seco-mtk/-/commit/8a3f31650892bc5e8aecebc1946a57c7e11dbfd6

UPSTREAM: ASoC: SOF: Remove pm_runtime_put_autosuspend() for SOF OF device

In SOF OF device, pm_runtime_put_autosuspend() is not matching any pm_runtime_get_sync().

This is imbalanced for PM runtime.

Also, for consistency we call pm_runtime_mark_last_busy() before enabling PM runtime.

  1. Remove pm_runtime_put_autosuspend() in probe_complete
  2. Reorder PM runtime calls int probe_complete

Change-Id: If6bcee24d1016a8eb47d9e2a48709d2c16d2c60e Signed-off-by: Allen-KH Cheng Allen-KH.Cheng@mediatek.com Reviewed-by: Daniel Baluta daniel.baluta@nxp.com Reviewed-by: Paul Olaru paul.olaru@oss.nxp.com Reviewed-by: Pierre-Louis Bossart pierre-louis.bossart@linux.intel.com Signed-off-by: Daniel Baluta daniel.baluta@nxp.com Link: https://lore.kernel.org/r/20211209200830.145005-1-daniel.baluta@oss.nxp.com Signed-off-by: Mark Brown broonie@kernel.org

--

Commit: https://git.seco.com/clea-os/bsp/mediatek/linux-seco-mtk/-/commit/c5e85e1fd01e2c68209350fdc2615c9020700119

UPSTREAM: ASoC: soc-component: add snd_soc_pcm_component_delay()

Current soc-pcm.c :: soc_pcm_pointer() is assuming that component driver might update runtime->delay silently in snd_soc_pcm_component_pointer() (= A).

static snd_pcm_uframes_t soc_pcm_pointer(...)
{
	...

	/* clearing the previous total delay */

=> runtime->delay = 0;

(A) offset = snd_soc_pcm_component_pointer(substream);

	/* base delay if assigned in pointer callback */

=> delay = runtime->delay; ... }

  1. The behavior that ".pointer callback secretly updates runtime->delay" is strange and confusable.

  2. Current snd_soc_pcm_component_pointer() uses 1st found component's .pointer callback only, thus it is no problem for now. But runtime->delay might be overwrote if it adjusted to multiple components in the future.

  3. Component delay is updated at .pointer callback timing (secretly). But some components which doesn't have .pointer callback might want to increase runtime->delay for some reasons.

We already have .delay function for DAI, but not have for Component. This patch adds new snd_soc_pcm_component_delay() for it.

Change-Id: I45662174632b424766f70544eac7c878081df4db Signed-off-by: Kuninori Morimoto kuninori.morimoto.gx@renesas.com Link: https://lore.kernel.org/r/874k8cy25t.wl-kuninori.morimoto.gx@renesas.com Signed-off-by: Mark Brown broonie@kernel.org

--

Commit: https://git.seco.com/clea-os/bsp/mediatek/linux-seco-mtk/-/commit/668fa1b9a925e6c62a095df11630918bf097b21b

UPSTREAM: ASoC: soc-dai: update snd_soc_dai_delay() to snd_soc_pcm_dai_delay()

Current soc_pcm_pointer() is manually calculating both CPU-DAI's max delay (= A) and Codec-DAI's max delay (= B).

static snd_pcm_uframes_t soc_pcm_pointer(...)
{
	...

^ for_each_rtd_cpu_dais(rtd, i, cpu_dai) (A) cpu_delay = max(cpu_delay, ...); v delay += cpu_delay;

^ for_each_rtd_codec_dais(rtd, i, codec_dai) (B) codec_delay = max(codec_delay, ...); v delay += codec_delay;

	runtime->delay = delay;
	...
}

Current soc_pcm_pointer() and the total delay calculating is not readable / difficult to understand.

This patch update snd_soc_dai_delay() to snd_soc_pcm_dai_delay(), and calcule both CPU/Codec delay in one function.

Link: https://lore.kernel.org/r/87fszl4yrq.wl-kuninori.morimoto.gx@renesas.com Change-Id: I2a566df16f59a9ea591c27fe9dc24c568b607e32 Signed-off-by: Kuninori Morimoto kuninori.morimoto.gx@renesas.com Link: https://lore.kernel.org/r/875yssy25z.wl-kuninori.morimoto.gx@renesas.com Signed-off-by: Mark Brown broonie@kernel.org

--

Commit: https://git.seco.com/clea-os/bsp/mediatek/linux-seco-mtk/-/commit/85123747228cee6653fa8a34688d7d26ae9da816

UPSTREAM: ASoC: SOF: mediatek: Use %pR/%pa to print resources/physical addresses

On 32-bit with CONFIG_ARCH_DMA_ADDR_T_64BIT=n:

sound/soc/sof/mediatek/mt8195/mt8195.c: In function ‘platform_parse_resource’:
sound/soc/sof/mediatek/mt8195/mt8195.c:51:15: error: format ‘%llx’ expects argument of type ‘long long unsigned int’, but argument 4 has type ‘unsigned int’ [-Werror=format=]
   51 |  dev_dbg(dev, "DMA pbase=0x%llx, size=0x%llx\n",
  |               ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~

sound/soc/sof/mediatek/mt8195/mt8195.c: In function ‘adsp_memory_remap_init’:
sound/soc/sof/mediatek/mt8195/mt8195.c:167:15: error: format ‘%llx’ expects argument of type ‘long long unsigned int’, but argument 4 has type ‘phys_addr_t’ {aka ‘unsigned int’} [-Werror=format=]
  167 |  dev_dbg(dev, "adsp->pa_dram %llx, offset %#x\n", adsp->pa_dram, offset);
  |               ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~

sound/soc/sof/mediatek/mt8195/mt8195.c: In function ‘adsp_shared_base_ioremap’:
sound/soc/sof/mediatek/mt8195/mt8195.c:196:15: error: format ‘%llx’ expects argument of type ‘long long unsigned int’, but argument 5 has type ‘phys_addr_t’ {aka ‘unsigned int’} [-Werror=format=]
  196 |  dev_dbg(dev, "shared-dram vbase=%p, phy addr :%llx,  size=%#x\n",
  |               ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~

Fix the first cases by printing the full resource using %pR. Fix the other cases by printing the physical addresses using %pa.

Reported-by: noreply@ellerman.id.au Fixes: 32d7e03d26fd9318 ("ASoC: SOF: mediatek: Add mt8195 hardware support") Change-Id: Ibd8d8a9870f5340ea9ac83cb09a4d1a32394c982 Signed-off-by: Geert Uytterhoeven geert@linux-m68k.org Link: https://lore.kernel.org/r/20211123103013.73645-1-geert@linux-m68k.org Signed-off-by: Mark Brown broonie@kernel.org

--

Commit: https://git.seco.com/clea-os/bsp/mediatek/linux-seco-mtk/-/commit/918491a248427cad63919a50973d9b13295b442e

BACKPORT: ASoC: SOF: IPC: dai: Expand DAI_CONFIG IPC flags

Some DAI components, such as HDaudio, need to be stopped in two steps a) stop the DAI component b) stop the DAI DMA

This patch enables this two-step stop by expanding the DAI_CONFIG IPC flags and split them into 2 parts.

The 4 LSB bits indicate when the DAI_CONFIG IPC is sent, ex: hw_params, hw_free or pause. The 4 MSB bits are used as the quirk flags to be used along with the command flags. The quirk flag called SOF_DAI_CONFIG_FLAGS_2_STEP_STOP shall be set along with the HW_PARAMS command flag, i.e. before the pipeline is started so that the stop/pause trigger op in the FW can take the appropriate action to either perform/skip the DMA stop. If set, the DMA stop will be executed when the DAI_CONFIG IPC is sent during hw_free. In the case of pause, DMA pause will be handled when the DAI_CONFIG IPC is sent with the PAUSE command flag.

Along with this, modify the signature for the hda_ctrl_dai_widget_setup/ hda_ctrl_dai_widget_free() functions to take additional flags as an argument and modify all users to pass the appropriate quirk flags. Only the HDA DAI's need to pass the SOF_DAI_CONFIG_FLAGS_2_STEP_STOP quirk flag during hw_params to indicate that it supports two-step stop and pause.

Change-Id: Ia8756c566cd62dafa946742af81f0e2993ed64c5 Signed-off-by: Ranjani Sridharan ranjani.sridharan@linux.intel.com Reviewed-by: Pierre-Louis Bossart pierre-louis.bossart@linux.intel.com Signed-off-by: Kai Vehmanen kai.vehmanen@linux.intel.com Link: https://lore.kernel.org/r/20211125101520.291581-10-kai.vehmanen@linux.intel.com Signed-off-by: Mark Brown broonie@kernel.org

--

Commit: https://git.seco.com/clea-os/bsp/mediatek/linux-seco-mtk/-/commit/f986cd99cc103232ef403a86c01d8477a678c83a

UPSTREAM: ASoC: SOF: align the hw_free sequence with stop

Even though the order of stopping the DMA and freeing the widget list is not important, align the sequence to match with the stop trigger to avoid confusion.

Change-Id: I33853fb92fcdb244f3fd0b4f8ac8135e91644eb8 Signed-off-by: Ranjani Sridharan ranjani.sridharan@linux.intel.com Reviewed-by: Pierre-Louis Bossart pierre-louis.bossart@linux.intel.com Signed-off-by: Kai Vehmanen kai.vehmanen@linux.intel.com Link: https://lore.kernel.org/r/20211125101520.291581-9-kai.vehmanen@linux.intel.com Signed-off-by: Mark Brown broonie@kernel.org

--

Commit: https://git.seco.com/clea-os/bsp/mediatek/linux-seco-mtk/-/commit/a50c4fee50ae56db353f291f6aa584a0e344135f

UPSTREAM: ASoC: SOF: pcm: move the check for prepared flag

Move the check for the prepared flag inside snd_pcm_dsp_pcm_free() to avoid having to check it before every invocation of the function.

Change-Id: If7db51ed214fda95c263bcbe2af5a2ea395009c4 Signed-off-by: Ranjani Sridharan ranjani.sridharan@linux.intel.com Reviewed-by: Pierre-Louis Bossart pierre-louis.bossart@linux.intel.com Signed-off-by: Kai Vehmanen kai.vehmanen@linux.intel.com Link: https://lore.kernel.org/r/20211125101520.291581-8-kai.vehmanen@linux.intel.com Signed-off-by: Mark Brown broonie@kernel.org

--

Commit: https://git.seco.com/clea-os/bsp/mediatek/linux-seco-mtk/-/commit/04a678c129a70cf3fb0bcf97315618645ffac0b3

UPSTREAM: ASoC: SOF: Add a helper for freeing PCM stream

Add a helper function to free PCM in the FW, stop the DMA and free the widget list. These actions are performed both during PCM trigger STOP and when a paused stream is freed during system suspend.

Change-Id: Icb9f2af3fdc2b6e6f6a8bce10c3d966bd3d0bf8c Signed-off-by: Ranjani Sridharan ranjani.sridharan@linux.intel.com Reviewed-by: Pierre-Louis Bossart pierre-louis.bossart@linux.intel.com Signed-off-by: Kai Vehmanen kai.vehmanen@linux.intel.com Link: https://lore.kernel.org/r/20211125101520.291581-7-kai.vehmanen@linux.intel.com Signed-off-by: Mark Brown broonie@kernel.org

--

Commit: https://git.seco.com/clea-os/bsp/mediatek/linux-seco-mtk/-/commit/db45d197e078a29f426d10959bb402d6fb6f0100

UPSTREAM: ASoC: SOF: call platform hw_free for paused streams during suspend

Paused streams must be stopped and platform hw_free should be invoked during system suspend so they can be restarted properly after system resume.

Change-Id: Iee260228ab251e0c6c39a604918752c771ea2b07 Signed-off-by: Ranjani Sridharan ranjani.sridharan@linux.intel.com Reviewed-by: Pierre-Louis Bossart pierre-louis.bossart@linux.intel.com Signed-off-by: Kai Vehmanen kai.vehmanen@linux.intel.com Link: https://lore.kernel.org/r/20211125101520.291581-6-kai.vehmanen@linux.intel.com Signed-off-by: Mark Brown broonie@kernel.org

--

Commit: https://git.seco.com/clea-os/bsp/mediatek/linux-seco-mtk/-/commit/e6752961fb8764589f7ba184b57ba1f86ba9ea66

UPSTREAM: ASoC: SOF: pcm: invoke platform hw_free for STOP/SUSPEND triggers

snd_sof_pcm_platform_hw_params() will be called when the stream is restarted with a prepare ioctl. This happens in two cases i.e. when a suspended stream is resumed or when a stream is restarted without intermediate call to sof_pcm_hw_free(). Make sure to call snd_sof_pcm_platform_hw_free() in both these cases to keep it balanced.

Change-Id: I10b1c19d1a7469a3974dd5b23673157298b8a7fe Signed-off-by: Ranjani Sridharan ranjani.sridharan@linux.intel.com Reviewed-by: Pierre-Louis Bossart pierre-louis.bossart@linux.intel.com Signed-off-by: Kai Vehmanen kai.vehmanen@linux.intel.com Link: https://lore.kernel.org/r/20211125101520.291581-5-kai.vehmanen@linux.intel.com Signed-off-by: Mark Brown broonie@kernel.org

--

Commit: https://git.seco.com/clea-os/bsp/mediatek/linux-seco-mtk/-/commit/32ebe0324c6920ee62e63c2627cce502618dfd9b

UPSTREAM: ASoC: SOF: mediatek: Add missing of_node_put() in platform_parse_resource()

The node pointer is returned by of_parse_phandle() with refcount incremented in platform_parse_resource(). Calling of_node_put() to aovid the refcount leak.

Reported-by: Hulk Robot hulkci@huawei.com Change-Id: Icd525cf1970bd058d3acb0bc2d03ac698c3e8fb8 Signed-off-by: Yang Yingliang yangyingliang@huawei.com Link: https://lore.kernel.org/r/20211125071608.3056715-1-yangyingliang@huawei.com Signed-off-by: Mark Brown broonie@kernel.org

--

Commit: https://git.seco.com/clea-os/bsp/mediatek/linux-seco-mtk/-/commit/a312250ca67657dca69558495f9366b203562214

UPSTREAM: ASoC: SOF: handle paused streams during system suspend

During system suspend, paused streams do not get suspended. Therefore, we need to explicitly free these PCMs in the DSP and free the associated DAPM widgets so that they can be set up again during resume.

Fixes: 5fcdbb2d45df ("ASoC: SOF: Add support for dynamic pipelines") Change-Id: I1cf4d58586cc9adee09a2ab23e38e7b5d7171b99 Signed-off-by: Ranjani Sridharan ranjani.sridharan@linux.intel.com Reviewed-by: Paul Olaru paul.olaru@oss.nxp.com Reviewed-by: Bard Liao bard.liao@intel.com Reviewed-by: Pierre-Louis Bossart pierre-louis.bossart@linux.intel.com Signed-off-by: Kai Vehmanen kai.vehmanen@linux.intel.com Link: https://lore.kernel.org/r/20211123171606.129350-3-kai.vehmanen@linux.intel.com Signed-off-by: Mark Brown broonie@kernel.org

--

Commit: https://git.seco.com/clea-os/bsp/mediatek/linux-seco-mtk/-/commit/878fca2171ab4a577d2baeae4b3927be561ffe31

UPSTREAM: ASoC: SOF: topology: don't use list_for_each_entry_reverse()

It's not clear why we would walk the list backwards. That makes no difference.

Change-Id: I728eb34d089a1ddef1cc0e3d53591e9829d5d8ee Signed-off-by: Pierre-Louis Bossart pierre-louis.bossart@linux.intel.com Reviewed-by: Ranjani Sridharan ranjani.sridharan@linux.intel.com Signed-off-by: Kai Vehmanen kai.vehmanen@linux.intel.com Link: https://lore.kernel.org/r/20211123171606.129350-2-kai.vehmanen@linux.intel.com Signed-off-by: Mark Brown broonie@kernel.org

--

Commit: https://git.seco.com/clea-os/bsp/mediatek/linux-seco-mtk/-/commit/55435aa4d8da04f8fc525d26bb336a537099a52e

UPSTREAM: ASoC: SOF: sof-audio: setup sched widgets during pipeline complete step

Older firmware prior to ABI 3.19 has a dependency where the scheduler widgets need to be setup last. Moving the call to sof_widget_setup() before the pipeline_complete() call also helps remove the need for the 'reverse' direction when walking through the widget list - this was only working because of the topology macros but the topology does not require any order.

Fixes: 5fcdbb2d45df ("ASoC: SOF: Add support for dynamic pipelines") Change-Id: I74b11cda14180dfc7360ec16af77cc0348a861d4 Signed-off-by: Pierre-Louis Bossart pierre-louis.bossart@linux.intel.com Reviewed-by: Ranjani Sridharan ranjani.sridharan@linux.intel.com Signed-off-by: Kai Vehmanen kai.vehmanen@linux.intel.com Link: https://lore.kernel.org/r/20211123171606.129350-1-kai.vehmanen@linux.intel.com Signed-off-by: Mark Brown broonie@kernel.org

--

Commit: https://git.seco.com/clea-os/bsp/mediatek/linux-seco-mtk/-/commit/59d9ceba63e888a2d4a3bee936af73a7a3fddfb8

UPSTREAM: ASoC: SOF: pcm: add .ack callback support

Add the indirections required at the core level for platform-specific operations on ack.

Note that on errors in the .ack the ALSA core will restore the previous appl_ptr.

Reviewed-by: Péter Ujfalusi peter.ujfalusi@linux.intel.com Reviewed-by: Kai Vehmanen kai.vehmanen@linux.intel.com Change-Id: I378d8dba85c386dc71787421b3b54447be8567d6 Signed-off-by: Ranjani Sridharan ranjani.sridharan@linux.intel.com Signed-off-by: Pierre-Louis Bossart pierre-louis.bossart@linux.intel.com Link: https://lore.kernel.org/r/20211119230852.206310-4-pierre-louis.bossart@linux.intel.com Signed-off-by: Mark Brown broonie@kernel.org

--

Commit: https://git.seco.com/clea-os/bsp/mediatek/linux-seco-mtk/-/commit/e34225db6ef7517d2c9a866ef3674514076fecb4

UPSTREAM: ASoC: SOF: sof-pci-dev: use community key on all Up boards

There are already 3 versions of the Up boards with support for the SOF community key (ApolloLake, WhiskyLake, TigerLake). Rather than continue to add quirks for each version, let's add a wildcard.

For WHL and TGL, the authentication supports both the SOF community key and the firmware signed with the Intel production key. Given two choices, the community key is the preferred option to allow developers to sign their own firmware. The firmware signed with production key can still be selected if needed with a kernel module option (snd-sof-pci.fw_path="intel/sof")

Tested-by: Péter Ujfalusi peter.ujfalusi@linux.intel.com Change-Id: Id13c487097c909e90a676d9467a4d1ca8a5d2676 Signed-off-by: Pierre-Louis Bossart pierre-louis.bossart@linux.intel.com Reviewed-by: Bard Liao yung-chuan.liao@linux.intel.com Reviewed-by: Péter Ujfalusi peter.ujfalusi@linux.intel.com Link: https://lore.kernel.org/r/20211119231327.211946-1-pierre-louis.bossart@linux.intel.com Signed-off-by: Mark Brown broonie@kernel.org

--

Commit: https://git.seco.com/clea-os/bsp/mediatek/linux-seco-mtk/-/commit/d35472822da28e098da8c46d4ca92a0a864d851e

BACKPORT: ASoC: SOF: add support for dynamic pipelines with multi-core

This patch adds support for dynamic pipelines with multi-core by using the platform-specific core_get/put() ops to power up/down a core when a widget is set up/freed.

Along with this, a few redundant functions are removed:

  1. sof_pipeline_core_enable() is no longer needed as the pipeline core will be set up when the pipeline widget is set up
  2. sof_core_enable() is replaced with snd_sof_core_get()
  3. core_power_up/down() DSP ops are deprecated and replaced with core get/put ops.
  4. Core power down in sof_widget_unload() during topology removal is also removed as it is not really needed. For dynamic pipelines, the cores will be powered off when they are not used. For static pipelines, the cores will be powered off in the device remove callback.

Change-Id: Ice702261acec2851bebd5be1c60a50c881f83efb Signed-off-by: Ranjani Sridharan ranjani.sridharan@linux.intel.com Reviewed-by: Guennadi Liakhovetski guennadi.liakhovetski@linux.intel.com Reviewed-by: Pierre-Louis Bossart pierre-louis.bossart@linux.intel.com Signed-off-by: Kai Vehmanen kai.vehmanen@linux.intel.com Link: https://lore.kernel.org/r/20211119192621.4096077-10-kai.vehmanen@linux.intel.com Signed-off-by: Mark Brown broonie@kernel.org

--

Commit: https://git.seco.com/clea-os/bsp/mediatek/linux-seco-mtk/-/commit/f60af59df08282debbb1f4289564758520f66e74

UPSTREAM: ASoC: SOF: free widgets in sof_tear_down_pipelines() for static pipelines

Free widgets for static pipelines in sof_tear_down_pipelines(). But this feature is unavailable in older firmware with ABI < 3.19. Just reset widget use_count's for this case. This would ensure that the secondary cores enabled required for topology setup are powered down properly before the primary core is powered off during system suspend.

Change-Id: I44fbc993a778ece4e4c38dea4b6f0c73968f1833 Signed-off-by: Ranjani Sridharan ranjani.sridharan@linux.intel.com Reviewed-by: Guennadi Liakhovetski guennadi.liakhovetski@linux.intel.com Reviewed-by: Pierre-Louis Bossart pierre-louis.bossart@linux.intel.com Signed-off-by: Kai Vehmanen kai.vehmanen@linux.intel.com Link: https://lore.kernel.org/r/20211119192621.4096077-8-kai.vehmanen@linux.intel.com Signed-off-by: Mark Brown broonie@kernel.org

--

Commit: https://git.seco.com/clea-os/bsp/mediatek/linux-seco-mtk/-/commit/d03c2583dd21dcf2ea627b09196757b55c674924

UPSTREAM: ASoC: SOF: topology: remove sof_load_pipeline_ipc()

Remove the function sof_load_pipeline_ipc() and directly send the IPC instead. The pipeline core is already enabled with the call to sof_pipeline_core_enable() in sof_widget_setup().

Change-Id: Id7176a5d77f7c54ae82903680ae05c6eac419d94 Signed-off-by: Ranjani Sridharan ranjani.sridharan@linux.intel.com Reviewed-by: Guennadi Liakhovetski guennadi.liakhovetski@linux.intel.com Reviewed-by: Pierre-Louis Bossart pierre-louis.bossart@linux.intel.com Signed-off-by: Kai Vehmanen kai.vehmanen@linux.intel.com Link: https://lore.kernel.org/r/20211119192621.4096077-7-kai.vehmanen@linux.intel.com Signed-off-by: Mark Brown broonie@kernel.org

--

Commit: https://git.seco.com/clea-os/bsp/mediatek/linux-seco-mtk/-/commit/c9a0fb653b9e5a848b4a7cd45a7801473e1a3769

UPSTREAM: ASoC: SOF: Add ops for core_get and core_put

Add ops to get/put a core that will be used to power up/down a core along with incrementing/decrementing its ref_count.

Change-Id: Ia8e86cbc717cb4323c160f3f4e596669d0cb87de Signed-off-by: Ranjani Sridharan ranjani.sridharan@linux.intel.com Reviewed-by: Guennadi Liakhovetski guennadi.liakhovetski@linux.intel.com Reviewed-by: Pierre-Louis Bossart pierre-louis.bossart@linux.intel.com Signed-off-by: Kai Vehmanen kai.vehmanen@linux.intel.com Link: https://lore.kernel.org/r/20211119192621.4096077-4-kai.vehmanen@linux.intel.com Signed-off-by: Mark Brown broonie@kernel.org

--

Commit: https://git.seco.com/clea-os/bsp/mediatek/linux-seco-mtk/-/commit/9e9d8ea757560bd6cf1a0dd7fc119dd4172086e2

UPSTREAM: ASoC: SOF: Introduce num_cores and ref count per core

Add two fields num_cores and dsp_cores_ref_count to struct snd_sof_dev. These will be used to maintain the ref count for each core to determine when it should be powered up or down.

Change-Id: Iaddca7db229a285e6c81ee8aaafb3fbfb2106fe1 Signed-off-by: Ranjani Sridharan ranjani.sridharan@linux.intel.com Reviewed-by: Guennadi Liakhovetski guennadi.liakhovetski@linux.intel.com Reviewed-by: Pierre-Louis Bossart pierre-louis.bossart@linux.intel.com Signed-off-by: Kai Vehmanen kai.vehmanen@linux.intel.com Link: https://lore.kernel.org/r/20211119192621.4096077-3-kai.vehmanen@linux.intel.com Signed-off-by: Mark Brown broonie@kernel.org

--

Commit: https://git.seco.com/clea-os/bsp/mediatek/linux-seco-mtk/-/commit/831b363d07afbbacf265e8aee4f654b52b129375

UPSTREAM: ASoC: SOF: mediatek: Add DSP system PM callback for mt8195

Add DSP system PM callback for suspend and resume

Change-Id: Id3c83a237eb536626e73739df02a7865bb9f6e13 Signed-off-by: YC Hung yc.hung@mediatek.com Reviewed-by: Pierre-Louis Bossart pierre-louis.bossart@linux.intel.com Reviewed-by: Daniel Baluta daniel.baluta@nxp.com Signed-off-by: Daniel Baluta daniel.baluta@nxp.com Link: https://lore.kernel.org/r/20211118100749.54628-9-daniel.baluta@oss.nxp.com Signed-off-by: Mark Brown broonie@kernel.org

--

Commit: https://git.seco.com/clea-os/bsp/mediatek/linux-seco-mtk/-/commit/fc037fae8fbb3c63c3c393199a6ad4f3249bfdee

UPSTREAM: ASoC: SOF: mediatek: Add mt8195 dsp clock support

Add adsp clock on/off support on mt8195 platform.

Change-Id: I201cffeca95a8ca423965b4cc6a807f423aa7862 Signed-off-by: YC Hung yc.hung@mediatek.com Reviewed-by: Pierre-Louis Bossart pierre-louis.bossart@linux.intel.com Reviewed-by: Daniel Baluta daniel.baluta@nxp.com Signed-off-by: Daniel Baluta daniel.baluta@nxp.com Link: https://lore.kernel.org/r/20211118100749.54628-8-daniel.baluta@oss.nxp.com Signed-off-by: Mark Brown broonie@kernel.org

--

Commit: https://git.seco.com/clea-os/bsp/mediatek/linux-seco-mtk/-/commit/fd0df27bbe6a51311d97c6497b7d2e084a613bc1

UPSTREAM: ASoC: SOF: mediatek: Add dai driver dsp ops callback for mt8195

Add dsp ops callback to register AFE DL2/DL3/UL4/UL5 sof dai's with ALSA

Change-Id: I3b7a49ecffdb0e52b502886180108406812217fc Signed-off-by: YC Hung yc.hung@mediatek.com Reviewed-by: Péter Ujfalusi peter.ujfalusi@linux.intel.com Reviewed-by: Kai Vehmanen kai.vehmanen@linux.intel.com Reviewed-by: Daniel Baluta daniel.baluta@nxp.com Reviewed-by: Ranjani Sridharan ranjani.sridharan@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: Daniel Baluta daniel.baluta@nxp.com Link: https://lore.kernel.org/r/20211118100749.54628-7-daniel.baluta@oss.nxp.com Signed-off-by: Mark Brown broonie@kernel.org

--

Commit: https://git.seco.com/clea-os/bsp/mediatek/linux-seco-mtk/-/commit/b6ef8fe0f931546c31af484e3f12968fd4bde21c

UPSTREAM: ASoC: SOF: Add mt8195 device descriptor

Add SOF device and DT descriptor for Mediatek mt8195 platform.

Change-Id: If1d8c785336a4c23b105d76138b91c9fc02ae2c3 Signed-off-by: YC Hung yc.hung@mediatek.com Reviewed-by: Péter Ujfalusi peter.ujfalusi@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: Kai Vehmanen kai.vehmanen@linux.intel.com Reviewed-by: Guennadi Liakhovetski guennadi.liakhovetski@linux.intel.com Reviewed-by: Daniel Baluta daniel.baluta@nxp.com Signed-off-by: Daniel Baluta daniel.baluta@nxp.com Link: https://lore.kernel.org/r/20211118100749.54628-6-daniel.baluta@oss.nxp.com Signed-off-by: Mark Brown broonie@kernel.org

--

Commit: https://git.seco.com/clea-os/bsp/mediatek/linux-seco-mtk/-/commit/3445d0d4532f3b66252aaa007cb2f8194ddaec57

UPSTREAM: ASoC: SOF: mediatek: Add fw loader and mt8195 dsp ops to load firmware

Add mt8195-loader module with ops callback to load and run firmware on mt8195 platform.

Change-Id: Iec40b0a73a823d1e06081635df4cec40e9468d4c Signed-off-by: YC Hung yc.hung@mediatek.com Reviewed-by: Péter Ujfalusi peter.ujfalusi@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: Kai Vehmanen kai.vehmanen@linux.intel.com Reviewed-by: Guennadi Liakhovetski guennadi.liakhovetski@linux.intel.com Reviewed-by: Daniel Baluta daniel.baluta@nxp.com Signed-off-by: Daniel Baluta daniel.baluta@nxp.com Link: https://lore.kernel.org/r/20211118100749.54628-5-daniel.baluta@oss.nxp.com Signed-off-by: Mark Brown broonie@kernel.org

--

Commit: https://git.seco.com/clea-os/bsp/mediatek/linux-seco-mtk/-/commit/a2de97528233cb8b5094fbc6d9a456b68517af31

UPSTREAM: ASoC: SOF: topology: Add support for Mediatek AFE DAI

Add new sof dai and config to pass topology file configuration to SOF firmware running on Mediatek platform DSP core. Add mediatek audio front end(AFE) to the list of supported sof_dais

Change-Id: I1c0a23c698435cd884b1204fa8c608b25cb41287 Signed-off-by: YC Hung yc.hung@mediatek.com Reviewed-by: Péter Ujfalusi peter.ujfalusi@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: Kai Vehmanen kai.vehmanen@linux.intel.com Reviewed-by: Guennadi Liakhovetski guennadi.liakhovetski@linux.intel.com Reviewed-by: Daniel Baluta daniel.baluta@nxp.com Signed-off-by: Daniel Baluta daniel.baluta@nxp.com Link: https://lore.kernel.org/r/20211118100749.54628-4-daniel.baluta@oss.nxp.com Signed-off-by: Mark Brown broonie@kernel.org

--

Commit: https://git.seco.com/clea-os/bsp/mediatek/linux-seco-mtk/-/commit/163777c45b9c695f4ec226ee9a8d509a705fa7aa

UPSTREAM: ASoC: SOF: tokens: add token for Mediatek AFE

Add the definition for Mediatek audio front end(AFE) tokens,include AFE sampling rate, channels, and format.

Change-Id: Ife5d54aa4fc1d5cbd100d32f01adb1d68a69e47b Signed-off-by: YC Hung yc.hung@mediatek.com Reviewed-by: Péter Ujfalusi peter.ujfalusi@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: Kai Vehmanen kai.vehmanen@linux.intel.com Reviewed-by: Guennadi Liakhovetski guennadi.liakhovetski@linux.intel.com Reviewed-by: Daniel Baluta daniel.baluta@nxp.com Signed-off-by: Daniel Baluta daniel.baluta@nxp.com Link: https://lore.kernel.org/r/20211118100749.54628-3-daniel.baluta@oss.nxp.com Signed-off-by: Mark Brown broonie@kernel.org

--

Commit: https://git.seco.com/clea-os/bsp/mediatek/linux-seco-mtk/-/commit/1dd6749b6a4f8f787f25c71995a4c01434f048df

UPSTREAM: ASoC: SOF: mediatek: Add mt8195 hardware support

This patch initialize to support SOF on Mediatek mt8195 platform. MT8195 has four Cortex A78 cores paired with four Cortex A55 cores. It also has Cadence HiFi-4 DSP single core. There are shared DRAM and mailbox interrupt between AP and DSP to use for IPC communication.

Change-Id: I75e74240ab2520454d78e7084c61293641681566 Signed-off-by: YC Hung yc.hung@mediatek.com Reviewed-by: Péter Ujfalusi peter.ujfalusi@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: Kai Vehmanen kai.vehmanen@linux.intel.com Reviewed-by: Guennadi Liakhovetski guennadi.liakhovetski@linux.intel.com Reviewed-by: Daniel Baluta daniel.baluta@nxp.com Signed-off-by: Daniel Baluta daniel.baluta@nxp.com Link: https://lore.kernel.org/r/20211118100749.54628-2-daniel.baluta@oss.nxp.com Signed-off-by: Mark Brown broonie@kernel.org

--

Commit: https://git.seco.com/clea-os/bsp/mediatek/linux-seco-mtk/-/commit/ea590b5a6b82baf6a2855d36b3b4382a3a23b948

UPSTREAM: ASoC: SOF: topology: Add support for AMD ACP DAIs

Add new sof dais and config to pass topology file configuration to SOF firmware running on ACP's DSP core. ACP firmware support I2S_BT, I2S_SP and DMIC controller hence add three new dais to the list of supported sof_dais

Change-Id: I66308923de6d2d658510353a4f1375a4ed150af8 Signed-off-by: Ajit Kumar Pandey AjitKumar.Pandey@amd.com Reviewed-by: Bard Liao bard.liao@intel.com Reviewed-by: Kai Vehmanen kai.vehmanen@linux.intel.com Signed-off-by: Daniel Baluta daniel.baluta@nxp.com Link: https://lore.kernel.org/r/20211117093734.17407-12-daniel.baluta@oss.nxp.com Signed-off-by: Mark Brown broonie@kernel.org

--

Commit: https://git.seco.com/clea-os/bsp/mediatek/linux-seco-mtk/-/commit/895376e0e68bb08e6729547b971dd944b2314b70

UPSTREAM: ASoC: SOF: debug: Add support for IPC message injection

In order to stress test the firmware's ability to handle (mis)crafted IPC messages this patch adds a debugfs interface where a binary file (message) can be written and the message is sent to the firmware as it is.

Read on the same file will return the reply from the firmware if it is available as a binary.

Change-Id: I3661253afa25aa947c858a838d688692084f73ff Signed-off-by: Peter Ujfalusi peter.ujfalusi@linux.intel.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 Reviewed-by: Guennadi Liakhovetski guennadi.liakhovetski@linux.intel.com Signed-off-by: Daniel Baluta daniel.baluta@nxp.com Link: https://lore.kernel.org/r/20211116152137.52129-5-daniel.baluta@oss.nxp.com Signed-off-by: Mark Brown broonie@kernel.org

--

Commit: https://git.seco.com/clea-os/bsp/mediatek/linux-seco-mtk/-/commit/521083af62223bcf9069c8bfc5346f053459b492

UPSTREAM: ASoC: SOF: utils: Add generic function to get the reply for a tx message

The code to get the reply for a tx is identical in all but one place: imx8_get_reply(), imx8m_get_reply(), atom_get_reply(), bdw_get_reply().

hda_dsp_ipc_get_reply() have additional check in place for PROBES and special handling of PM messages.

Add a generic implementation to the core which can be used as drop in replacement.

The reply size check is changed to be able to handle cases when the reply size is not know beforehand (this is the case for PROBES and DEBUG_MEM_USAGE for example).

Change-Id: I5350ddee93c0eb0f1f20f7d0f78b9b30427f4d59 Signed-off-by: Peter Ujfalusi peter.ujfalusi@linux.intel.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 Reviewed-by: Guennadi Liakhovetski guennadi.liakhovetski@linux.intel.com Signed-off-by: Daniel Baluta daniel.baluta@nxp.com Link: https://lore.kernel.org/r/20211116152137.52129-2-daniel.baluta@oss.nxp.com Signed-off-by: Mark Brown broonie@kernel.org

--

Commit: https://git.seco.com/clea-os/bsp/mediatek/linux-seco-mtk/-/commit/958afc4982c592878fa7433e35f05258c008aa54

UPSTREAM: ASoC: SOF: i.MX: simplify Kconfig

Follow the Intel example and simplify the Kconfig a) start from the end-product for 'select' chains b) use 'depends on' to filter out configurations. c) use snd-sof-of as a common module without any 'select'

Change-Id: Ia716100630ff5a7178393b9b98aa61219143a25e Signed-off-by: Pierre-Louis Bossart pierre-louis.bossart@linux.intel.com Reviewed-by: Daniel Baluta daniel.baluta@nxp.com Signed-off-by: Daniel Baluta daniel.baluta@nxp.com Link: https://lore.kernel.org/r/20211116124131.46414-1-daniel.baluta@oss.nxp.com Signed-off-by: Mark Brown broonie@kernel.org

--

Commit: https://git.seco.com/clea-os/bsp/mediatek/linux-seco-mtk/-/commit/c2bd2e1883aab132a546c3d701a25808468461ce

UPSTREAM: ASoC: SOF: core: Unregister machine driver before IPC and debugfs

To ensure clean unload of the machine driver, components and topology, do the unregister before we free IPC and debugfs.

It is a possibility that part of the unregister we would have IPC communication with the firmware.

Suggested-by: Pierre-Louis Bossart pierre-louis.bossart@linux.intel.com Change-Id: Ie7c8811100d740748e3b4eaadf0806c1b066caba Signed-off-by: Peter Ujfalusi peter.ujfalusi@linux.intel.com Reviewed-by: Pierre-Louis Bossart pierre-louis.bossart@linux.intel.com Reviewed-by: Ranjani Sridharan ranjani.sridharan@linux.intel.com Link: https://lore.kernel.org/r/20211102094756.9317-1-peter.ujfalusi@linux.intel.com Signed-off-by: Mark Brown broonie@kernel.org

--

Commit: https://git.seco.com/clea-os/bsp/mediatek/linux-seco-mtk/-/commit/357e6034a75f009411f75b0728c22d7715c489cb

UPSTREAM: ASoC: SOF: trace: send DMA_TRACE_FREE IPC during release

Send the DMA_TRACE_FREE IPC during release to stop and free the trace DMA in the DSP.

Change-Id: Ib8dfe91c6e0fa3a18b94f8139ecc775421375566 Signed-off-by: Ranjani Sridharan ranjani.sridharan@linux.intel.com Reviewed-by: Kai Vehmanen kai.vehmanen@linux.intel.com Reviewed-by: Pierre-Louis Bossart pierre-louis.bossart@linux.intel.com Signed-off-by: Peter Ujfalusi peter.ujfalusi@linux.intel.com Link: https://lore.kernel.org/r/20211102101019.14037-4-peter.ujfalusi@linux.intel.com Signed-off-by: Mark Brown broonie@kernel.org

--

Commit: https://git.seco.com/clea-os/bsp/mediatek/linux-seco-mtk/-/commit/e99ad85db868d50f535ee458a5cca58110b59ec0

UPSTREAM: ASoC: SOF: IPC: update ipc_log_header()

Parse all the trace DMA IPC commands in ipc_log_header().

Change-Id: I5b29a4a9924382e2b75b5f0beb9c32f1333604c7 Signed-off-by: Ranjani Sridharan ranjani.sridharan@linux.intel.com Reviewed-by: Kai Vehmanen kai.vehmanen@linux.intel.com Reviewed-by: Pierre-Louis Bossart pierre-louis.bossart@linux.intel.com Signed-off-by: Peter Ujfalusi peter.ujfalusi@linux.intel.com Link: https://lore.kernel.org/r/20211102101019.14037-3-peter.ujfalusi@linux.intel.com Signed-off-by: Mark Brown broonie@kernel.org

--

Commit: https://git.seco.com/clea-os/bsp/mediatek/linux-seco-mtk/-/commit/efc83aa4abbf2586c8574123b00d90c97adb38b5

UPSTREAM: ASoC: SOF: IPC: Add new IPC command to free trace DMA

Add a new SOF_IPC_TRACE_DMA_FREE IPC command to stop and free trace DMA in the FW.

Change-Id: Iddcf1f04c4049263f816f09fc9b91a17e6b915dc Signed-off-by: Ranjani Sridharan ranjani.sridharan@linux.intel.com Reviewed-by: Kai Vehmanen kai.vehmanen@linux.intel.com Reviewed-by: Pierre-Louis Bossart pierre-louis.bossart@linux.intel.com Signed-off-by: Peter Ujfalusi peter.ujfalusi@linux.intel.com Link: https://lore.kernel.org/r/20211102101019.14037-2-peter.ujfalusi@linux.intel.com Signed-off-by: Mark Brown broonie@kernel.org

--

Commit: https://git.seco.com/clea-os/bsp/mediatek/linux-seco-mtk/-/commit/bfd5a69bd5e9031694da17c56ba1e82f1cd5d48d

UPSTREAM: ASoC: SOF: build compression interface into snd_sof.ko

With CONFIG_SND_SOC_SOF_COMPRESS=m, the compression code is not built into a the main SOF driver when that is built-in:

x86_64-linux-ld: sound/soc/sof/ipc.o: in function ipc_stream_message': ipc.c:(.text+0x5a2): undefined reference to snd_sof_compr_fragment_elapsed' x86_64-linux-ld: sound/soc/sof/topology.o: in function sof_dai_load': topology.c:(.text+0x32d1): undefined reference to snd_sof_compr_init_elapsed_work' x86_64-linux-ld: topology.c:(.text+0x32e1): undefined reference to `snd_sof_compr_init_elapsed_work'

Make this a 'bool' symbol so it just decides whether the code gets built at all.

Fixes: 858f7a5c45ca ("ASoC: SOF: Introduce fragment elapsed notification API") Change-Id: I94ce806fc94477d11e85fce559f8242c9ed8fe98 Signed-off-by: Arnd Bergmann arnd@arndb.de Tested-by: Pierre-Louis Bossart pierre-louis.bossart@linux.intel.com Link: https://lore.kernel.org/r/20211108111132.3800548-1-arnd@kernel.org Signed-off-by: Mark Brown broonie@kernel.org

--

Commit: https://git.seco.com/clea-os/bsp/mediatek/linux-seco-mtk/-/commit/e9c062787c29e01b09233a8465b46bdc6320d47f

UPSTREAM: ASoC: SOF:control: Fix variable type in snd_sof_refresh_control()

The second parameter for snd_sof_ipc_set_get_comp_data() is ipc_cmd, not ipc_ctrl_type and the type is u32.

Fixes: 756bbe4205bc6 ("ASoC: SOF: Handle control change notification from firmware") Change-Id: I78c90684b2750dd9d76974781618f797dbedb68c Signed-off-by: Peter Ujfalusi peter.ujfalusi@gmail.com Acked-by: Ranjani Sridharan ranjani.sridharan@linux.intel.com Link: https://lore.kernel.org/r/20211103082710.17165-1-peter.ujfalusi@linux.intel.com Signed-off-by: Mark Brown broonie@kernel.org

--

Commit: https://git.seco.com/clea-os/bsp/mediatek/linux-seco-mtk/-/commit/0bb57e7a86d84cd7cb3cd922eeb497b98b6ffa25

UPSTREAM: ASoC: soc-component: add snd_soc_component_is_codec()

Checking .non_legacy_dai_naming is not readable. Let's add new snd_soc_component_is_codec().

Change-Id: I7edff95a237b0010ac197f515b53fe63e0c97392 Signed-off-by: Kuninori Morimoto kuninori.morimoto.gx@renesas.com Link: https://lore.kernel.org/r/87h7dft7dn.wl-kuninori.morimoto.gx@renesas.com Signed-off-by: Mark Brown broonie@kernel.org

--

Commit: https://git.seco.com/clea-os/bsp/mediatek/linux-seco-mtk/-/commit/148fda6855d361db0641394479b55053dcd75a69

UPSTREAM: ASoC: soc-pcm: tidyup soc_pcm_hw_clean() - step2

DAI active count is not exchanged during for_each_rtd_dais() loops. We don't need to keep snd_soc_dai_stream_active() as "active" on soc_pcm_hw_clean(). This patch avoid verbose code.

Change-Id: I3b1024d1c80437079587d3fb3aad55602e208985 Signed-off-by: Kuninori Morimoto kuninori.morimoto.gx@renesas.com Link: https://lore.kernel.org/r/87ilxvt7e6.wl-kuninori.morimoto.gx@renesas.com Signed-off-by: Mark Brown broonie@kernel.org

--

Commit: https://git.seco.com/clea-os/bsp/mediatek/linux-seco-mtk/-/commit/40dddb0fde9df95d4c256c758c1160e8dd5479f9

UPSTREAM: ASoC: soc-pcm: tidyup soc_pcm_hw_clean() - step1

soc_pcm_hw_clean() is using "continue" during for_each_rtd_dais(), but it is very verbose. This patch cleanup it.

Change-Id: Ife95dcf51fc43fb2e8589126e0f4ace041737bb8 Signed-off-by: Kuninori Morimoto kuninori.morimoto.gx@renesas.com Link: https://lore.kernel.org/r/87k0ibt7ej.wl-kuninori.morimoto.gx@renesas.com Signed-off-by: Mark Brown broonie@kernel.org

--

Commit: https://git.seco.com/clea-os/bsp/mediatek/linux-seco-mtk/-/commit/e89ef07f782b4daf5994a0eda484b2e6404b68eb

UPSTREAM: ALSA: memalloc: Support for non-coherent page allocation

Following to the addition of non-contiguous pages, this patch adds the new contiguous non-coherent page allocation to the standard memalloc helper. Like the previous non-contig type, this non-coherent type is also directional and requires the explicit sync, too. Hence the driver using this type of buffer may need to set SNDRV_PCM_INFO_EXPLICIT_SYNC flag to the PCM hardware.info as well, unless it's set up in the managed mode.

Link: https://lore.kernel.org/r/20211017074859.24112-3-tiwai@suse.de Change-Id: If83909cf0454ba718497b364eecd81fef3cf054a Signed-off-by: Takashi Iwai tiwai@suse.de

--

Commit: https://git.seco.com/clea-os/bsp/mediatek/linux-seco-mtk/-/commit/af9d9e34d294281fdda75f8d227396ea8c2ab1c9

UPSTREAM: ALSA: memalloc: Support for non-contiguous page allocation

This patch adds the support for allocation of non-contiguous DMA pages in the common memalloc helper. It's another SG-buffer type, but unlike the existing one, this is directional and requires the explicit sync / invalidation of dirty pages on non-coherent architectures.

For this enhancement, the following points are changed:

  • snd_dma_device stores the DMA direction.
  • snd_dma_device stores need_sync flag indicating whether the explicit sync is required or not.
  • A new variant of helper functions, snd_dma_alloc_dir_pages() and *_all() are introduced; the old snd_dma_alloc_pages() and *_all() kept as just wrappers with DMA_BIDIRECTIONAL.
  • A new helper snd_dma_buffer_sync() is introduced; this gets called in the appropriate places.
  • A new allocation type, SNDRV_DMA_TYPE_NONCONTIG, is introduced.

When the driver allocates pages with this new type, and it may require the SNDRV_PCM_INFO_EXPLICIT_SYNC flag set to the PCM hardware.info for taking the full control of PCM applptr and hwptr changes (that implies disabling the mmap of control/status data). When the buffer allocation is managed by snd_pcm_set_managed_buffer(), this flag is automatically set depending on the result of dma_need_sync() internally. Otherwise, if the buffer is managed manually, the driver has to set the flag explicitly, too.

The explicit sync between CPU and device for non-coherent memory is performed at the points before and after read/write transfer as well as the applptr/hwptr syncptr ioctl. In the case of mmap mode, user-space is supposed to call the syncptr ioctl with the hwptr flag to update and fetch the status at first; this corresponds to CPU-sync. Then user-space advances the applptr via syncptr ioctl again with applptr flag, and this corresponds to the device sync with flushing.

Other than the DMA direction and the explicit sync, the usage of this new buffer type is almost equivalent with the existing SNDRV_DMA_TYPE_DEV_SG; you can get the page and the address via snd_sgbuf_get_page() and snd_sgbuf_get_addr(), also calculate the continuous pages via snd_sgbuf_get_chunk_size().

For those SG-page handling, the non-contig type shares the same ops with the vmalloc handler. As we do always vmap the SG pages at first, the actual address can be deduced from the vmapped address easily without iterating the SG-list.

Link: https://lore.kernel.org/r/20211017074859.24112-2-tiwai@suse.de Change-Id: I4d119b9edf3115f8a783fe9c6ed05aff98ee7185 Signed-off-by: Takashi Iwai tiwai@suse.de

--

Commit: https://git.seco.com/clea-os/bsp/mediatek/linux-seco-mtk/-/commit/46922912170e7d00327898a522d210f7b16e8b0e

UPSTREAM: ALSA: pcm: Unify snd_pcm_delay() and snd_pcm_hwsync()

Both snd_pcm_delay() and snd_pcm_hwsync() do the almost same thing. The only difference is that the former calculate the delay, so unify them as a code cleanup, and treat NULL delay argument only for hwsync operation.

Also, the patch does a slight code refactoring in snd_pcm_delay(). The initialization of the delay value is done in the caller side now.

Reviewed-by: Pierre-Louis Bossart pierre-louis.bossart@linux.intel.com Link: https://lore.kernel.org/r/20211014145323.26506-1-tiwai@suse.de Change-Id: Id6c9b6792881c49a902f2badf5c2eea73d694b75 Signed-off-by: Takashi Iwai tiwai@suse.de

--

Commit: https://git.seco.com/clea-os/bsp/mediatek/linux-seco-mtk/-/commit/e2a1dce8d951478a4278d52bc077fab44d595189

UPSTREAM: ASoC: SOF: prepare code to allocate IPC messages in fw_ready

The fixed maximum size of IPC message does not allow for large transfers, e.g. for filter data. Currently such messages will be divided into smaller pieces and sent to firmware in multiple chunks. For future IPC, this strategy is not suitable.

The maximum IPC message size is limited by host box size which can be known when firmware is ready, so the fw_ready callback can allocate IPC messages with platform-specific sizes instead of the current fixed-size.

To be compatible with released firmware, current platforms will still use SOF_IPC_MSG_MAX_SIZE. For future platforms, there will be a new fw_ready function and the platform-specific allocation will take place there.

Change-Id: I8d83c6bb03f8a3e893d31b1365164b2151d85089 Signed-off-by: Rander Wang rander.wang@intel.com Reviewed-by: Bard Liao bard.liao@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 Message-Id: 20211008093836.28210-1-peter.ujfalusi@linux.intel.com Signed-off-by: Mark Brown broonie@kernel.org

--

Commit: https://git.seco.com/clea-os/bsp/mediatek/linux-seco-mtk/-/commit/48863164929274fa2b908b9327d2b6970519ecfe

UPSTREAM: ASoC: soc-pcm: restore mixer functionality

Recent changes in soc-pcm completely broke basic support for mixers on Intel systems: the filters on BE states prevent the connection of a second mixer input while the back-end is already active.

Rather than reverting the changes, which would be problematic for Tegra systems, this patch suggests an additional filter which will only apply to Tegra systems. This is a temporary solution which will have to be revisited - additional issues have been reported with DPCM.

Fixes: 0c25db3f7621 ('ASoC: soc-pcm: Don't reconnect an already active BE') Suggested-by: Sameer Pujar spujar@nvidia.com Change-Id: I6024ecda3ead88efa9e3d084cbf13f90291b858c Signed-off-by: Pierre-Louis Bossart pierre-louis.bossart@linux.intel.com Reviewed-by: Ranjani Sridharan ranjani.sridharan@linux.intel.com Reviewed-by: Péter Ujfalusi peter.ujfalusi@linux.intel.com Link: https://lore.kernel.org/r/20211004212141.193136-1-pierre-louis.bossart@linux.intel.com Signed-off-by: Mark Brown broonie@kernel.org

--

Commit: https://git.seco.com/clea-os/bsp/mediatek/linux-seco-mtk/-/commit/ebd468cb9d56955d5e52f0e42395472985520f18

UPSTREAM: ASoC: SOF: Introduce fragment elapsed notification API

This patch prepares the introduction of the compress API with SOF.

After each fragment is accepted by the DSP we need to inform the userspace applications that they can send the next fragment. This is done via snd_compr_fragment_elapsed.

Similar with the PCM case, in order to avoid sending an IPC before the previous IPC is handled we need to schedule a delayed work to call snd_compr_fragment_elapsed().

See snd_sof_pcm_period_elapsed.

To sum up this patch offers the following API to SOF code: * snd_sof_compr_init_elapsed_work * snd_sof_compr_fragment_elapsed

Note that implementation for compressed function is in a new file selected via CONFIG_SND_SOC_SOF_COMPRESS invisible config option. This option is automatically selected for platforms that support the compress interface. For now only i.MX8 platforms support this.

For symmetry we introduce snd_sof_pcm_init_elapsed_work to setup the work struct for PCM case.

Change-Id: I99a2c2f1859d3855c0503fd22105eebc4f4406df Signed-off-by: Daniel Baluta daniel.baluta@nxp.com Signed-off-by: Bud Liviu-Alexandru budliviu@gmail.com Reviewed-by: Pierre-Louis Bossart pierre-louis.bossart@linux.intel.com Reviewed-by: Paul Olaru paul.olaru@oss.nxp.com Reviewed-by: Péter Ujfalusi peter.ujfalusi@linux.intel.com Link: https://lore.kernel.org/r/20211004152147.1268978-5-daniel.baluta@oss.nxp.com Signed-off-by: Mark Brown broonie@kernel.org

--

Commit: https://git.seco.com/clea-os/bsp/mediatek/linux-seco-mtk/-/commit/df4ca592fc1bec03699912d825c3c1a0ddd6a411

BACKPORT: ASoC: SOF: Make Intel IPC stream ops generic

This operations should be generic as there is nothing Intel specific. This works well for NXP i.MX8 stream IPC ops.

We start by moving sof/intel/intel-ipc.c into sof/stream-ipc.c and rename the functions to be generic.

Notice that we use newly introduced snd_sof_dsp_mailbox_read instead of sof_mailbox_read, to make sure that we are not bound to existing MMIO memory access, and we allow platform to implement their own memory access routines.

Change-Id: I0ea845d11668d04997e8500654072543c636cf14 Signed-off-by: Daniel Baluta daniel.baluta@nxp.com Signed-off-by: Bud Liviu-Alexandru budliviu@gmail.com Reviewed-by: Pierre-Louis Bossart pierre-louis.bossart@linux.intel.com Reviewed-by: Daniel Baluta daniel.baluta@gmail.com Reviewed-by: Péter Ujfalusi peter.ujfalusi@linux.intel.com Link: https://lore.kernel.org/r/20211004152147.1268978-3-daniel.baluta@oss.nxp.com Signed-off-by: Mark Brown broonie@kernel.org

--

Commit: https://git.seco.com/clea-os/bsp/mediatek/linux-seco-mtk/-/commit/d35f67ffeabd949f54eddf8780b6b0c2fd395156

BACKPORT: ASoC: SOF: Introduce snd_sof_mailbox_read / snd_sof_mailbox_write callbacks

We need to introduce snd_sof_mailbox_{read/write} in order to provide a generic way for mailbox access. These routines are optional, each platform can implement their own specific routines.

So far, all platforms use mmapped I/O thus they can use custom made routines sof_mailbox_read / sof_mailbox_write that use MMIO.

Change-Id: Ie0dc2b6cad452566f16ea61fda5dcbe663bc664f Signed-off-by: Daniel Baluta daniel.baluta@nxp.com Signed-off-by: Bud Liviu-Alexandru budliviu@gmail.com Reviewed-by: Pierre-Louis Bossart pierre-louis.bossart@linux.intel.com Reviewed-by: Péter Ujfalusi peter.ujfalusi@linux.intel.com Link: https://lore.kernel.org/r/20211004152147.1268978-2-daniel.baluta@oss.nxp.com Signed-off-by: Mark Brown broonie@kernel.org

--

Commit: https://git.seco.com/clea-os/bsp/mediatek/linux-seco-mtk/-/commit/90f9b6b54458f347d2e28ee931612f8686854d2a

UPSTREAM: ASoC: SOF: pipelines: Harmonize all functions to use struct snd_sof_dev

First thing the pipelines function which have "struct device *dev" as parameter do is: struct snd_sof_dev *sdev = dev_get_drvdata(dev);

and in all cases the passed dev is actually coming from sdev->dev.

Skip this steps and pass directly the sdev to all pipelines related functions as few of them already does this.

Change-Id: I4fdf9dfbd8fb6a49fdbd8c7eb5fa341efc64b7ee Signed-off-by: Peter Ujfalusi peter.ujfalusi@linux.intel.com Reviewed-by: Ranjani Sridharan ranjani.sridharan@linux.intel.com Reviewed-by: Kai Vehmanen kai.vehmanen@linux.intel.com Link: https://lore.kernel.org/r/20211006111651.10027-1-peter.ujfalusi@linux.intel.com Signed-off-by: Mark Brown broonie@kernel.org

--

Commit: https://git.seco.com/clea-os/bsp/mediatek/linux-seco-mtk/-/commit/b68e2fde48a61630f3daa138b9418c64fd2e5875

UPSTREAM: ASoC: SOF: loader: Drop SOF_DBG_DUMP_REGS flag when firmware start fails

snd_sof_dsp_run() failure indicates that the DSP did not even booted up, thus asking for dumping registers at this point is not valid.

Change-Id: Ib4643e74add3606dcccce3307513921f6623d1ac Signed-off-by: Peter Ujfalusi peter.ujfalusi@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: Kai Vehmanen kai.vehmanen@linux.intel.com Link: https://lore.kernel.org/r/20211006110645.26679-18-peter.ujfalusi@linux.intel.com Signed-off-by: Mark Brown broonie@kernel.org

--

Commit: https://git.seco.com/clea-os/bsp/mediatek/linux-seco-mtk/-/commit/cfa5a5d8848be6e0a940789b28426af39f5b9775

UPSTREAM: ASoC: SOF: core: Clean up snd_sof_get_status() prints

Clean up the error prints when decoding the status in snd_sof_get_status(): Drop the "error:" prefixes from the prints, Use %# to print hexadecimal numbers, Reword some of the messages to be more precise, For a known error print out the panic code as well, For unknown error print only the panic code without the magic

Change-Id: I335ee7eba77b92a969866a97908558bebb859a17 Signed-off-by: Peter Ujfalusi peter.ujfalusi@linux.intel.com Reviewed-by: Pierre-Louis Bossart pierre-louis.bossart@linux.intel.com Reviewed-by: Kai Vehmanen kai.vehmanen@linux.intel.com Link: https://lore.kernel.org/r/20211006110645.26679-17-peter.ujfalusi@linux.intel.com Signed-off-by: Mark Brown broonie@kernel.org

--

Commit: https://git.seco.com/clea-os/bsp/mediatek/linux-seco-mtk/-/commit/34d0878c6dce7bc02c72dd73ac60268cfad6fcf0

UPSTREAM: ASoC: SOF: Introduce macro to set the firmware state

Add sof_set_fw_state() macro to wrap the sdev->fw_state management to allow actions to be taken when certain state is set or when state is changing.

Change-Id: I6de952c4157737fc4adf7986bf5998d6cdc25861 Signed-off-by: Peter Ujfalusi peter.ujfalusi@linux.intel.com Reviewed-by: Pierre-Louis Bossart pierre-louis.bossart@linux.intel.com Reviewed-by: Kai Vehmanen kai.vehmanen@linux.intel.com Link: https://lore.kernel.org/r/20211006110645.26679-15-peter.ujfalusi@linux.intel.com Signed-off-by: Mark Brown broonie@kernel.org

--

Commit: https://git.seco.com/clea-os/bsp/mediatek/linux-seco-mtk/-/commit/76b9aca2ef46076b3f30563066e699e85f0d5b1c

UPSTREAM: ASoC: SOF: ops: Force DSP panic dumps to be printed

If a DSP panic happens we want to see the dumps.

Change-Id: I7865756e7fffc5709eaa59a8b5eff87524d9b072 Signed-off-by: Peter Ujfalusi peter.ujfalusi@linux.intel.com Reviewed-by: Pierre-Louis Bossart pierre-louis.bossart@linux.intel.com Reviewed-by: Kai Vehmanen kai.vehmanen@linux.intel.com Link: https://lore.kernel.org/r/20211006110645.26679-14-peter.ujfalusi@linux.intel.com Signed-off-by: Mark Brown broonie@kernel.org

--

Commit: https://git.seco.com/clea-os/bsp/mediatek/linux-seco-mtk/-/commit/d19e046b94e3c051d10099cfe54da3b2ce5b43ad

UPSTREAM: ASoC: SOF: ipc: Re-enable dumps after successful IPC tx

The dumps are silenced after an IPC tx timeout by default. The IPC timeout can indicate severe error (firmware crash) or in some cases it is less devastating and the firmware remains operational, the timeout was due to a scheduling spike or other anomaly.

In any case consequent IPC timeouts will not print dumps but if any IPC do succeed than we should re-enable the dumps to print dumps the next time a timeout might happen.

Change-Id: Ifa15301e2f920f8c3339e3c88cfac71d7ff9e5f3 Signed-off-by: Peter Ujfalusi peter.ujfalusi@linux.intel.com Reviewed-by: Pierre-Louis Bossart pierre-louis.bossart@linux.intel.com Reviewed-by: Kai Vehmanen kai.vehmanen@linux.intel.com Link: https://lore.kernel.org/r/20211006110645.26679-13-peter.ujfalusi@linux.intel.com Signed-off-by: Mark Brown broonie@kernel.org

--

Commit: https://git.seco.com/clea-os/bsp/mediatek/linux-seco-mtk/-/commit/9a312e5cb2f1a45dd361f5265ab45165d9c62953

UPSTREAM: ASoC: SOF: debug: Print out the fw_state along with the DSP dump

The fw state can be an important information along with the DSP dump. Print it out before the dump.

Change-Id: I17882337fd536a0b1dd60563dc0899510403ab46 Signed-off-by: Peter Ujfalusi peter.ujfalusi@linux.intel.com Reviewed-by: Pierre-Louis Bossart pierre-louis.bossart@linux.intel.com Reviewed-by: Kai Vehmanen kai.vehmanen@linux.intel.com Link: https://lore.kernel.org/r/20211006110645.26679-12-peter.ujfalusi@linux.intel.com Signed-off-by: Mark Brown broonie@kernel.org

--

Commit: https://git.seco.com/clea-os/bsp/mediatek/linux-seco-mtk/-/commit/23073e359cfb596aa66def91652ab83a18daee6b

BACKPORT: ASoC: SOF: Drop SOF_DBG_DUMP_FORCE_ERR_LEVEL and sof_dev_dbg_or_err

The sof_dev_dbg_or_err() is only used by intel/hda.c when dumping dsp debug information. It was used to print the extended rom status in either dev_dbg (during retries) and finally with dev_err, but other lines were printed with dev_err regardless.

Since we now only print the dump once, the flag and the macros is no longer needed.

Change-Id: Ie0f748115911ef70b040cabc7877c9840327da7d Signed-off-by: Peter Ujfalusi peter.ujfalusi@linux.intel.com Reviewed-by: Ranjani Sridharan ranjani.sridharan@linux.intel.com Reviewed-by: Pierre-Louis Bossart pierre-louis.bossart@linux.intel.com Link: https://lore.kernel.org/r/20211006110645.26679-11-peter.ujfalusi@linux.intel.com Signed-off-by: Mark Brown broonie@kernel.org

--

Commit: https://git.seco.com/clea-os/bsp/mediatek/linux-seco-mtk/-/commit/3d5df99aa0f733cf89a74a02b50a1383e8b4a556

UPSTREAM: ASoC: SOF: debug: Add SOF_DBG_DUMP_OPTIONAL flag for DSP dumping

The new SOF_DBG_DUMP_OPTIONAL flag can be used to mark a DSP dump that should only be printed when the SOF_DBG_PRINT_ALL_DUMPS sof_core_debug flag is set, otherwise it should be ignored and not printed.

Change-Id: Ie2529d9dd3a0cc2d39d88f41bdf6a678412ef682 Signed-off-by: Peter Ujfalusi peter.ujfalusi@linux.intel.com Reviewed-by: Ranjani Sridharan ranjani.sridharan@linux.intel.com Reviewed-by: Pierre-Louis Bossart pierre-louis.bossart@linux.intel.com Link: https://lore.kernel.org/r/20211006110645.26679-9-peter.ujfalusi@linux.intel.com Signed-off-by: Mark Brown broonie@kernel.org

--

Commit: https://git.seco.com/clea-os/bsp/mediatek/linux-seco-mtk/-/commit/8cd52c73a43e094fe929057cb52011928a8d947e

UPSTREAM: ASoC: SOF: debug/ops: Move the IPC and DSP dump functions out from the header

To be usable in platform code, move the IPC and DSP dump function to debug.c and export it in a similar way as the snd_sof_handle_fw_exception()

Make the snd_sof_ipc_dump() static as it is only used in debug.c

Change-Id: Idc2bc919c8aec69958395209eb29167e2086b076 Signed-off-by: Peter Ujfalusi peter.ujfalusi@linux.intel.com Reviewed-by: Ranjani Sridharan ranjani.sridharan@linux.intel.com Reviewed-by: Pierre-Louis Bossart pierre-louis.bossart@linux.intel.com Link: https://lore.kernel.org/r/20211006110645.26679-8-peter.ujfalusi@linux.intel.com Signed-off-by: Mark Brown broonie@kernel.org

--

Commit: https://git.seco.com/clea-os/bsp/mediatek/linux-seco-mtk/-/commit/06d6de32f7c8c5e0ea21a66bc0fd7a5471d9fba8

UPSTREAM: ASoC: SOF: loader: Print the DSP dump if boot fails

It can be useful to print the DSP dump from the core in case the DSP boot failed.

Change-Id: I3467e7d4f6a6bb0b3a3d996d3e16af7045e1d937 Signed-off-by: Peter Ujfalusi peter.ujfalusi@linux.intel.com Reviewed-by: Ranjani Sridharan ranjani.sridharan@linux.intel.com Reviewed-by: Pierre-Louis Bossart pierre-louis.bossart@linux.intel.com Link: https://lore.kernel.org/r/20211006110645.26679-6-peter.ujfalusi@linux.intel.com Signed-off-by: Mark Brown broonie@kernel.org

--

Commit: https://git.seco.com/clea-os/bsp/mediatek/linux-seco-mtk/-/commit/fe14e4b682d9801e15373e164e31d0bdfa09ff77

UPSTREAM: ASoC: SOF: Print the dbg_dump and ipc_dump once to reduce kernel log noise

Do not print the dump more than once to keep the kernel log cleaner in case of a firmware failure.

When the DSP is rebooted due to suspend or runtime_suspend reset the flags to re-enable the dump prints.

Add also a debug flag to print all dumps to get more coverage if needed.

Change-Id: I11713ecf067ff8319d0a00c547ca5cad3e9d2cef Signed-off-by: Peter Ujfalusi peter.ujfalusi@linux.intel.com Reviewed-by: Ranjani Sridharan ranjani.sridharan@linux.intel.com Reviewed-by: Pierre-Louis Bossart pierre-louis.bossart@linux.intel.com Link: https://lore.kernel.org/r/20211006110645.26679-5-peter.ujfalusi@linux.intel.com Signed-off-by: Mark Brown broonie@kernel.org

--

Commit: https://git.seco.com/clea-os/bsp/mediatek/linux-seco-mtk/-/commit/6371d74e765c7128aa67b7f2ba32f14de5412634

UPSTREAM: ASoC: SOF: ipc and dsp dump: Add markers for better visibility

Add markers to identify the start and end of the IPC and DSP dumps in the kernel log.

Change-Id: I173d6471d30dfdb89609b50d209793a9c14cfbad Signed-off-by: Peter Ujfalusi peter.ujfalusi@linux.intel.com Reviewed-by: Ranjani Sridharan ranjani.sridharan@linux.intel.com Reviewed-by: Pierre-Louis Bossart pierre-louis.bossart@linux.intel.com Link: https://lore.kernel.org/r/20211006110645.26679-4-peter.ujfalusi@linux.intel.com Signed-off-by: Mark Brown broonie@kernel.org

--

Commit: https://git.seco.com/clea-os/bsp/mediatek/linux-seco-mtk/-/commit/c53360915e94dffd40d04a6940fb568e0a029272

UPSTREAM: ASoC: SOF: debug: Swap the dsp_dump and ipc_dump sequence for fw_exception

snd_sof_dsp_panic() only prints dsp_dump followed by flushing the DMA trace buffer.

To retain similar 'sequence' first do an ipc_dump then the dsp_dump and finally flush the trace buffer in case of fw_exception.

Change-Id: Ifaeeba2e901994f77b0db953c2a96a05592a9db8 Signed-off-by: Peter Ujfalusi peter.ujfalusi@linux.intel.com Reviewed-by: Ranjani Sridharan ranjani.sridharan@linux.intel.com Reviewed-by: Pierre-Louis Bossart pierre-louis.bossart@linux.intel.com Link: https://lore.kernel.org/r/20211006110645.26679-3-peter.ujfalusi@linux.intel.com Signed-off-by: Mark Brown broonie@kernel.org

--

Commit: https://git.seco.com/clea-os/bsp/mediatek/linux-seco-mtk/-/commit/525b7f575c5aef1cd9f4524865001928e8d23cd2

UPSTREAM: ASoC: SOF: core: debug: force all processing on primary core

The topology file currently provides information on which pipeline/processing is to be scheduled on which DSP core.

To help diagnose potential issues, this patch provides an override of the 'core' tokens to use the primary core (typically core0). Of course this may result in a Core0 activity that exceeds hardware capabilities, so this should only be used when the total processing fits on DSP - possibly using firmware mockup processing and stubs.

No new dmesg log was added to avoid adding noise during topology parsing, but the existing logs will show the primary core being used.

This is strictly for validation/debug, products should NEVER use this override, the topology is assumed to be the description of the firmware graph.

Change-Id: I166bc43b4110da0f5f4533e9c08f178c3c34f326 Signed-off-by: Pierre-Louis Bossart pierre-louis.bossart@linux.intel.com Reviewed-by: Bard Liao bard.liao@intel.com Reviewed-by: Kai Vehmanen kai.vehmanen@linux.intel.com Signed-off-by: Peter Ujfalusi peter.ujfalusi@linux.intel.com Link: https://lore.kernel.org/r/20211006110645.26679-2-peter.ujfalusi@linux.intel.com Signed-off-by: Mark Brown broonie@kernel.org

--

Commit: https://git.seco.com/clea-os/bsp/mediatek/linux-seco-mtk/-/commit/f6094c507c6989f3fdb7050ddbcc1ccc2add9eb3

UPSTREAM: ASoC: SOF: OF: Add fw_path and tplg_path parameters

This allows specifying an alternate path for SOF firmware or SOF topology.

This is particularly useful for i.MX when running Linux vs Android.

Change-Id: Idfafa790e9cf34d43c41d5baace765425c6227d8 Signed-off-by: Daniel Baluta daniel.baluta@nxp.com Reviewed-by: Pierre-Louis Bossart pierre-louis.bossart@linux.intel.com Reviewed-by: Ranjani Sridharan ranjani.sridharan@linux.intel.com Link: https://lore.kernel.org/r/20211005071949.1277613-1-daniel.baluta@oss.nxp.com Signed-off-by: Mark Brown broonie@kernel.org

--

Commit: https://git.seco.com/clea-os/bsp/mediatek/linux-seco-mtk/-/commit/9e728811af2d5a7a0c67c168aeecd3d563d94c79

UPSTREAM: ASoC: SOF: topology: allow for dynamic pipelines override for debug

For debug and community support, it's useful to expose a kernel parameter to prevent the use of dynamic pipelines exposed in a topology file, or conversely to force an existing topology to use dynamic pipelines.

Add an override bit and an enable bit which is valid only when the override is set.

For products, the intent is that the topology file defines the behavior, these two bits are only intended for diagnosis and performance checks.

Change-Id: I7fe57fd93f72c4b6ea368327e16dee1a4f969561 Signed-off-by: Pierre-Louis Bossart pierre-louis.bossart@linux.intel.com Reviewed-by: Bard Liao bard.liao@intel.com Reviewed-by: Kai Vehmanen kai.vehmanen@linux.intel.com Reviewed-by: Ranjani Sridharan ranjani.sridharan@linux.intel.com Link: https://lore.kernel.org/r/20211004212729.199550-3-pierre-louis.bossart@linux.intel.com Signed-off-by: Mark Brown broonie@kernel.org

--

Commit: https://git.seco.com/clea-os/bsp/mediatek/linux-seco-mtk/-/commit/fe09f4c00128aa33f42ab3d1bf5e4e97f8f1ea28

BACKPORT: ASoC: SOF: Intel: hda: add new flags for DAI_CONFIG

The DAI_CONFIG is used for both hw_params and hw_free. Use flags to specify what stage the configuration applies to.

the DAI_CONFIG IPC may be sent also during the widget setup so each flag is cleared after the IPC to restore the state.

Change-Id: I36b0b897b662de28cd1f278e31157e2e22a2f9dd Signed-off-by: Pierre-Louis Bossart pierre-louis.bossart@linux.intel.com Reviewed-by: Bard Liao bard.liao@intel.com Reviewed-by: Guennadi Liakhovetski guennadi.liakhovetski@linux.intel.com Reviewed-by: Brent Lu brent.lu@intel.com Link: https://lore.kernel.org/r/20211004171430.103674-4-pierre-louis.bossart@linux.intel.com Signed-off-by: Mark Brown broonie@kernel.org

--

Commit: https://git.seco.com/clea-os/bsp/mediatek/linux-seco-mtk/-/commit/4109d78cbfd32704261e391be4e5f4cab86a7a17

UPSTREAM: ASoC: SOF: dai: include new flags for DAI_CONFIG

Mirror changes done in SOF tree. The changes do not rely on BIT/GENMASK on purpose to keep the structure and flags common with the firmware tree.

The DAI_CONFIG IPC is currently used in multiple ways. It is sent to the DSP firmware when enabling static or dynamic pipelines, in hw_params or prepare callbacks for Intel SSP, HDaudio and ALH, on trigger_stop and hw_free.

This IPC has been abused a bit in the past, i.e. the values used for some of the DAI-specific fields are used to either allocate or free resources. Two typical examples are Intel HDaudio and SoundWire/ALH DAIs, where using a zero DMA channel number or stream tag signals to the firmware the DMA channels or tags allocated earlier can be freed.

Rather than add a new IPC for 'hw_params' and 'hw_free', this patch suggests supporting a 2-bit value conveying the 'stage' information in an existing IPC structure. Only 3 possible values are used.

The mapping between HW_PARAMS and HW_FREE flags and ALSA definitions is not strictly 1:1, e.g. in some cases the HW_PARAM flag might be set during the .prepare callback, while the HW_FREE might be sent during the ALSA .trigger for stop/suspend.

The semantics of the flags is to reserve and start/stop all needed resources, typically hardware related such as DMAs or clocks, when the HW_PARAMS is set, while the HW_FREE flag allows the firmware to release the resources allocated. The data transfers are still controlled within the firmware through the propagation of the trigger command.

The driver can then pass information that the DAI_CONFIG was invoked in e.g. a pipeline/DAI setup, hw_params or hw_free stage without having to use a special DAI-specific encoding. Unfortunately we can't remove old encodings due to backwards-compatibility requirements but for new cases, such as the SSP in follow-up patches, we can make the IPC less cryptic.

This change is tagged as ABI 3.19 and is completely backwards compatible.

Change-Id: I02460732f8053f2df1b6faa356068cf591a16427 Signed-off-by: Pierre-Louis Bossart pierre-louis.bossart@linux.intel.com Reviewed-by: Bard Liao bard.liao@intel.com Reviewed-by: Guennadi Liakhovetski guennadi.liakhovetski@linux.intel.com Reviewed-by: Brent Lu brent.lu@intel.com Link: https://lore.kernel.org/r/20211004171430.103674-3-pierre-louis.bossart@linux.intel.com Signed-off-by: Mark Brown broonie@kernel.org

--

Commit: https://git.seco.com/clea-os/bsp/mediatek/linux-seco-mtk/-/commit/d3353ae671cc13056c8d7717088a581f74f2c6d0

UPSTREAM: ASoC: SOF: dai: mirror group_id definition added in firmware

This was added in ABI 3.17 but never added to the kernel tree. The group_id is not currently used but this patch is required before additional changes.

Change-Id: I7f5e7a3d2b00755a4d6baa8532b941f80301435d Signed-off-by: Pierre-Louis Bossart pierre-louis.bossart@linux.intel.com Reviewed-by: Bard Liao bard.liao@intel.com Reviewed-by: Guennadi Liakhovetski guennadi.liakhovetski@linux.intel.com Reviewed-by: Brent Lu brent.lu@intel.com Link: https://lore.kernel.org/r/20211004171430.103674-2-pierre-louis.bossart@linux.intel.com Signed-off-by: Mark Brown broonie@kernel.org

--

Commit: https://git.seco.com/clea-os/bsp/mediatek/linux-seco-mtk/-/commit/7835b222bfcaefc5fb1d98ac397259c5252114b7

UPSTREAM: ASoC: SOF: topology: Add kernel parameter for topology verification

Add a kernel debug flag to enable a one-shot topology verification for all pipelines including the dynamic ones. If the debug flag is set, all the topology component loading will be verified during the complete callback.

Change-Id: I4d837cb0532e2ce8a2eb6b4f5ad6199210e21542 Signed-off-by: Ranjani Sridharan ranjani.sridharan@linux.intel.com Reviewed-by: Guennadi Liakhovetski guennadi.liakhovetski@linux.intel.com Reviewed-by: Pierre-Louis Bossart pierre-louis.bossart@linux.intel.com Reviewed-by: Kai Vehmanen kai.vehmanen@linux.intel.com Signed-off-by: Daniel Baluta daniel.baluta@nxp.com Signed-off-by: Peter Ujfalusi peter.ujfalusi@linux.intel.com Link: https://lore.kernel.org/r/20210927120517.20505-13-peter.ujfalusi@linux.intel.com Signed-off-by: Mark Brown broonie@kernel.org

--

Commit: https://git.seco.com/clea-os/bsp/mediatek/linux-seco-mtk/-/commit/b60373f438e081627e94e55f9698dafa77eef135

BACKPORT: ASoC: SOF: Add support for dynamic pipelines

Add support for dynamic pipelines by modifying the PCM hw_params ioctl implementation to determine the widgets required for a PCM stream by querying the list of connected DAPM widgets. This list is saved as part of snd_sof_pcm_stream struct and will be used to setup the widgets.

The sof_widget_list_setup/free routines setup and free connected DAPM widgets when a PCM is opened/closed. These routines accept a list of connected DAPM widgets as input and determine the SOF widgets, their corresponding pipeline widgets and connections between them that need to be setup before the PCM is triggered.

Please note that the dynamic pipeline feature will only be enabled for those pipelines whose dynamic_pipeline_widget flag is set in topologies. Add a new token called SOF_TKN_SCHED_DYNAMIC_PIPELINE that when set in topology will be applied to the dynamic_pipeline_widget flag of the pipeline widget.

Change-Id: I856712ce49eceb5410843cb8f1caf1e288da5405 Signed-off-by: Ranjani Sridharan ranjani.sridharan@linux.intel.com Reviewed-by: Guennadi Liakhovetski guennadi.liakhovetski@linux.intel.com Reviewed-by: Pierre-Louis Bossart pierre-louis.bossart@linux.intel.com Reviewed-by: Kai Vehmanen kai.vehmanen@linux.intel.com Signed-off-by: Daniel Baluta daniel.baluta@nxp.com Signed-off-by: Peter Ujfalusi peter.ujfalusi@linux.intel.com Link: https://lore.kernel.org/r/20210927120517.20505-12-peter.ujfalusi@linux.intel.com Signed-off-by: Mark Brown broonie@kernel.org

--

Commit: https://git.seco.com/clea-os/bsp/mediatek/linux-seco-mtk/-/commit/80a4029a98fdbb9e0df5eabc7525bc75d7179000

BACKPORT: ASoC: SOF: Intel: hda: make sure DAI widget is set up before IPC

With the implementation of the dynamic pipeline feature, widgets will only be setup when a PCM is opened during the hw_params ioctl. The BE hw_params callback is responsible for sending the DAI_CONFIG for the DAI widgets in the DSP. With dynamic pipelines, the DAI widgets will need to set up first before sending the DAI_CONFIG IPC in the BE hw_params.

Update the BE hw_params/hw_free callbacks for all ALH, HDA and SSP DAIs to set up/free the DAI widget before/after DAI_CONFIG IPC.

Change-Id: I18d7e7f44700bc38eaef180523c847f9dbd84ec2 Signed-off-by: Ranjani Sridharan ranjani.sridharan@linux.intel.com Reviewed-by: Guennadi Liakhovetski guennadi.liakhovetski@linux.intel.com Reviewed-by: Pierre-Louis Bossart pierre-louis.bossart@linux.intel.com Reviewed-by: Kai Vehmanen kai.vehmanen@linux.intel.com Signed-off-by: Daniel Baluta daniel.baluta@nxp.com Signed-off-by: Peter Ujfalusi peter.ujfalusi@linux.intel.com Link: https://lore.kernel.org/r/20210927120517.20505-11-peter.ujfalusi@linux.intel.com Signed-off-by: Mark Brown broonie@kernel.org

--

Commit: https://git.seco.com/clea-os/bsp/mediatek/linux-seco-mtk/-/commit/b389e5371cea89fa0b18d7928a90e847e094a180

UPSTREAM: ASoC: SOF: Introduce widget use_count

Add a new field, use_count to struct snd_sof_widget to keep track of the usage count for each widget. Since widgets can belong to multiple pipelines, this field will ensure that the widget is setup only when the first pipeline that needs it is started and freed when the last pipeline that needs it is stopped. There is no need to protect the widget use_count access as the core already handles mutual exclusion at the PCM level. Add a new helper sof_widget_free() to handle freeing the SOF widgets and export the sof_widget_setup/free() functions.

Change-Id: I454ab794896550bb0e9cdf47fc115ae0f98ad17d Signed-off-by: Ranjani Sridharan ranjani.sridharan@linux.intel.com Reviewed-by: Guennadi Liakhovetski guennadi.liakhovetski@linux.intel.com Reviewed-by: Pierre-Louis Bossart pierre-louis.bossart@linux.intel.com Reviewed-by: Kai Vehmanen kai.vehmanen@linux.intel.com Signed-off-by: Daniel Baluta daniel.baluta@nxp.com Signed-off-by: Peter Ujfalusi peter.ujfalusi@linux.intel.com Link: https://lore.kernel.org/r/20210927120517.20505-10-peter.ujfalusi@linux.intel.com Signed-off-by: Mark Brown broonie@kernel.org

--

Commit: https://git.seco.com/clea-os/bsp/mediatek/linux-seco-mtk/-/commit/e3ee7f8b0108f336b5d03f672ecbe47643fc829f

UPSTREAM: ASoC: SOF: Don't set up widgets during topology parsing

In preparation for supporting dynamic pipelines, move the widget setup, DAI config IPCs to the complete callback during topology loading. For current topology where all the pipelines are static, all the pipelines will be set up during complete. For topologies with dynamic and static pipelines, this will enable setting up only the static ones during topology loading. Reuse the sof_restore_pipelines() function for this purpose and rename it to sof_set_up_pipelines().

Change-Id: Ia1cc39aaf2c217a317173dcbd6453785079ce026 Signed-off-by: Ranjani Sridharan ranjani.sridharan@linux.intel.com Reviewed-by: Guennadi Liakhovetski guennadi.liakhovetski@linux.intel.com Reviewed-by: Pierre-Louis Bossart pierre-louis.bossart@linux.intel.com Reviewed-by: Kai Vehmanen kai.vehmanen@linux.intel.com Signed-off-by: Daniel Baluta daniel.baluta@nxp.com Signed-off-by: Peter Ujfalusi peter.ujfalusi@linux.intel.com Link: https://lore.kernel.org/r/20210927120517.20505-9-peter.ujfalusi@linux.intel.com Signed-off-by: Mark Brown broonie@kernel.org

--

Commit: https://git.seco.com/clea-os/bsp/mediatek/linux-seco-mtk/-/commit/3502e0863d3e14eef3bf5b2e814f4628b57e2629

UPSTREAM: ASoC: SOF: restore kcontrols for widget during set up

Restore kcontrols for each widget after it has been set up successfully.

Change-Id: Ia2f31caf169b3143fb62a0cdee77b07f2265a81e Signed-off-by: Ranjani Sridharan ranjani.sridharan@linux.intel.com Signed-off-by: Kai Vehmanen kai.vehmanen@linux.intel.com Reviewed-by: Guennadi Liakhovetski guennadi.liakhovetski@linux.intel.com Reviewed-by: Pierre-Louis Bossart pierre-louis.bossart@linux.intel.com Reviewed-by: Seppo Ingalsuo seppo.ingalsuo@intel.com Signed-off-by: Daniel Baluta daniel.baluta@nxp.com Signed-off-by: Peter Ujfalusi peter.ujfalusi@linux.intel.com Link: https://lore.kernel.org/r/20210927120517.20505-8-peter.ujfalusi@linux.intel.com Signed-off-by: Mark Brown broonie@kernel.org

--

Commit: https://git.seco.com/clea-os/bsp/mediatek/linux-seco-mtk/-/commit/93a410848ab629a1e9e3346c12229b2d02999488

UPSTREAM: ASoC: SOF: Add new fields to snd_sof_route

Add two new fields to save the source widget and sink widget pointers in struct snd_sof_route to make it easier to look up routes by source/sink widget. Also, add a flag to indicate if the route has been set up in the DSP. These will be used when the dynamic pipeline feature is implemented and routes will have to be set up at run time.

Also, add a new sof_tear_down_pipelines() callback, that will used to reset the set up status for all routes during suspend.

Change-Id: If079f46a9d61ffbf70b4c631e3c5e49d0348ca30 Signed-off-by: Ranjani Sridharan ranjani.sridharan@linux.intel.com Reviewed-by: Guennadi Liakhovetski guennadi.liakhovetski@linux.intel.com Reviewed-by: Pierre-Louis Bossart pierre-louis.bossart@linux.intel.com Reviewed-by: Kai Vehmanen kai.vehmanen@linux.intel.com Signed-off-by: Daniel Baluta daniel.baluta@nxp.com Signed-off-by: Peter Ujfalusi peter.ujfalusi@linux.intel.com Link: https://lore.kernel.org/r/20210927120517.20505-7-peter.ujfalusi@linux.intel.com Signed-off-by: Mark Brown broonie@kernel.org

--

Commit: https://git.seco.com/clea-os/bsp/mediatek/linux-seco-mtk/-/commit/236cb8cb97395418033efa25018107e18fa663ab

UPSTREAM: AsoC: dapm: export a couple of functions

Export a couple of DAPM functions that can be used by ASoC drivers to determine connected widgets when a PCM is started.

Change-Id: I848e2f2fc372968221c80731e3409e5ab6a8977b Signed-off-by: Ranjani Sridharan ranjani.sridharan@linux.intel.com Reviewed-by: Guennadi Liakhovetski guennadi.liakhovetski@linux.intel.com Reviewed-by: Pierre-Louis Bossart pierre-louis.bossart@linux.intel.com Reviewed-by: Kai Vehmanen kai.vehmanen@linux.intel.com Signed-off-by: Daniel Baluta daniel.baluta@nxp.com Signed-off-by: Peter Ujfalusi peter.ujfalusi@linux.intel.com Link: https://lore.kernel.org/r/20210927120517.20505-6-peter.ujfalusi@linux.intel.com Signed-off-by: Mark Brown broonie@kernel.org

--

Commit: https://git.seco.com/clea-os/bsp/mediatek/linux-seco-mtk/-/commit/ed1c433e0c7fdfbe5db8476c557fe540334fc2b3

UPSTREAM: ASoC: SOF: sof-audio: add helpers for widgets, kcontrols and dai config set up

Refactor the existing code to use helper functions to set up/free widgets, send dai config and set up kcontrols for widgets. These will be reused later on for setting up widgets in the connected DAPM widgets list for a particular PCM when the dynamic pipeline feature is implemented.

Change-Id: Ica12d6b948f36232e16c6bea148f8696f7188e17 Signed-off-by: Ranjani Sridharan ranjani.sridharan@linux.intel.com Reviewed-by: Guennadi Liakhovetski guennadi.liakhovetski@linux.intel.com Reviewed-by: Pierre-Louis Bossart pierre-louis.bossart@linux.intel.com Reviewed-by: Kai Vehmanen kai.vehmanen@linux.intel.com Signed-off-by: Daniel Baluta daniel.baluta@nxp.com Signed-off-by: Peter Ujfalusi peter.ujfalusi@linux.intel.com Link: https://lore.kernel.org/r/20210927120517.20505-5-peter.ujfalusi@linux.intel.com Signed-off-by: Mark Brown broonie@kernel.org

--

Commit: https://git.seco.com/clea-os/bsp/mediatek/linux-seco-mtk/-/commit/d36f0f41540c688b6da40d6d1e643a1d1d27497b

UPSTREAM: ASoC: SOF: topology: Add new token for dynamic pipeline

Today, we set up all widgets required for all PCM streams at the time of topology parsing even if they are not used. An optimization would be to only set up the widgets required for currently active PCM streams. This would give the FW the opportunity to power gate unused memory blocks, thereby saving power.

For dynamic pipelines, the widgets in the connected DAPM path for each PCM will need to be set up at runtime. This patch introduces a new token, DYNAMIC_PIPELINE, for scheduler type widgets that indicate whether a pipeline should be set up statically during topology load or at runtime when the PCM is opened. Introduce a new field called dynamic_pipeline_widget in struct snd_sof_widget to save the value of the parsed token.

The token is set only for the pipeline (scheduler type) widget and must be propagated to all widgets in the same pipeline during topology load. Introduce another field called pipe_widget in struct snd_sof_widget that saves the pointer to the scheduler widget with the same pipeline ID as that of the widget. This field is populated when the pipeline completion callback is invoked during topology loading.

Change-Id: Iea8bd437fd78a73c854520a0512662cc5bd7c41a Signed-off-by: Ranjani Sridharan ranjani.sridharan@linux.intel.com Reviewed-by: Guennadi Liakhovetski guennadi.liakhovetski@linux.intel.com Reviewed-by: Pierre-Louis Bossart pierre-louis.bossart@linux.intel.com Reviewed-by: Kai Vehmanen kai.vehmanen@linux.intel.com Signed-off-by: Daniel Baluta daniel.baluta@nxp.com Signed-off-by: Peter Ujfalusi peter.ujfalusi@linux.intel.com Link: https://lore.kernel.org/r/20210927120517.20505-4-peter.ujfalusi@linux.intel.com Signed-off-by: Mark Brown broonie@kernel.org

--

Commit: https://git.seco.com/clea-os/bsp/mediatek/linux-seco-mtk/-/commit/cefa0c01e163ec618170f7fe3c073e744fd114d6

UPSTREAM: ASoC: SOF: control: Add access field in struct snd_sof_control

Add a new field to save the access setting for all controls in struct snd_sof_control. This will be used to ensure that only widgets belonging to static pipelines have volatile controls.

Change-Id: Ifa53d1ff64398df3260a66a698feacf2c0c2c7fc Signed-off-by: Ranjani Sridharan ranjani.sridharan@linux.intel.com Reviewed-by: Guennadi Liakhovetski guennadi.liakhovetski@linux.intel.com Reviewed-by: Pierre-Louis Bossart pierre-louis.bossart@linux.intel.com Reviewed-by: Kai Vehmanen kai.vehmanen@linux.intel.com Signed-off-by: Daniel Baluta daniel.baluta@nxp.com Signed-off-by: Peter Ujfalusi peter.ujfalusi@linux.intel.com Link: https://lore.kernel.org/r/20210927120517.20505-3-peter.ujfalusi@linux.intel.com Signed-off-by: Mark Brown broonie@kernel.org

--

Commit: https://git.seco.com/clea-os/bsp/mediatek/linux-seco-mtk/-/commit/9a0ead40e484b7a8c28f1f734d0f3b8ecc54d7c6

UPSTREAM: ASoC: topology: change the complete op in snd_soc_tplg_ops to return int

In the SOF driver, the operations performed in the complete callback can fail and therefore topology loading should return an error in such cases. So, change the signature of the complete op in struct snd_soc_tplg_ops to return an int to return the error.

Also, amend the complete callback functions in the SOF driver and the SKL driver to conform with the new signature.

Change-Id: I7cef8228c5ede6bfb64394e51629da6a13ccc914 Signed-off-by: Ranjani Sridharan ranjani.sridharan@linux.intel.com Reviewed-by: Guennadi Liakhovetski guennadi.liakhovetski@linux.intel.com Reviewed-by: Pierre-Louis Bossart pierre-louis.bossart@linux.intel.com Reviewed-by: Kai Vehmanen kai.vehmanen@linux.intel.com Signed-off-by: Daniel Baluta daniel.baluta@nxp.com Signed-off-by: Peter Ujfalusi peter.ujfalusi@linux.intel.com Link: https://lore.kernel.org/r/20210927120517.20505-2-peter.ujfalusi@linux.intel.com Signed-off-by: Mark Brown broonie@kernel.org

--

Commit: https://git.seco.com/clea-os/bsp/mediatek/linux-seco-mtk/-/commit/20fce27e0433bd163cddc59ac03540bb4492b4d3

UPSTREAM: ASoC: soc-component: Remove conditional definition of debugfs data members

This simplification allows the use of the standard kernel pattern of static inline dummy functions for debugfs code. Most systems will only have a small number of snd_soc_components so the memory impact is minimal.

Change-Id: Ieb330a1d203ff325e99bc4c96eb19c4ecd0293e6 Signed-off-by: Simon Trimmer simont@opensource.cirrus.com Suggested-by: Mark Brown broonie@kernel.org Link: https://lore.kernel.org/r/20210930142116.528878-1-simont@opensource.cirrus.com Signed-off-by: Mark Brown broonie@kernel.org

--

Commit: https://git.seco.com/clea-os/bsp/mediatek/linux-seco-mtk/-/commit/b6b6d0f775d9cb504e324f87c025cdc44a89b868

UPSTREAM: ASoC: SOF: Change SND_SOC_SOF_TOPLEVEL from config to menuconfig

We have growing number of options under SND_SOC_SOF_TOPLEVEL as SOF adaptation is growing (Intel, NXP, AMD and Mediatek) and new features are added. It will make the menuconfig user experience much cleaner if we move the SOF options under a separate page.

Change-Id: Ibbfb63f98c9fbdfdad4816603bcb203185097c24 Signed-off-by: Peter Ujfalusi peter.ujfalusi@linux.intel.com Reviewed-by: Bard Liao bard.liao@intel.com Reviewed-by: Daniel Baluta daniel.baluta@gmail.com Reviewed-by: Ranjani Sridharan ranjani.sridharan@linux.intel.com Link: https://lore.kernel.org/r/20210930070438.16846-1-peter.ujfalusi@linux.intel.com Signed-off-by: Mark Brown broonie@kernel.org

--

Commit: https://git.seco.com/clea-os/bsp/mediatek/linux-seco-mtk/-/commit/df408777fb844cdb6f21d38666c8470622fa9451

UPSTREAM: ASoC: SOF: ipc: Make the error prints consistent in tx_wait_done()

If we get an error on reply (msg->reply_error) then we should print the error value out.

At the same time extend the print to include the message size as well and do the same in case of a timeout.

Change-Id: I482a4426f904a864ae5eeb1d9588b0342ad019c0 Signed-off-by: Peter Ujfalusi peter.ujfalusi@linux.intel.com Reviewed-by: Daniel Baluta daniel.baluta@gmail.com Reviewed-by: Paul Olaru paul.olaru@oss.nxp.com Reviewed-by: Pierre-Louis Bossart pierre-louis.bossart@linux.intel.com Link: https://lore.kernel.org/r/20210928073615.29574-1-peter.ujfalusi@linux.intel.com Signed-off-by: Mark Brown broonie@kernel.org

--

Commit: https://git.seco.com/clea-os/bsp/mediatek/linux-seco-mtk/-/commit/f3be68afc59435d13103f3ea5d69a8da7b86a58e

UPSTREAM: ASoC: SOF: prefix some terse and cryptic dev_dbg() with func

These helped troubleshoot some DMA issue in SOF.

Change-Id: I889bb08bec405ac75d26b7a07ee264ecf7c9b6d1 Signed-off-by: Marc Herbert marc.herbert@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: Peter Ujfalusi peter.ujfalusi@linux.intel.com Link: https://lore.kernel.org/r/20210928102635.26227-1-peter.ujfalusi@linux.intel.com Signed-off-by: Mark Brown broonie@kernel.org

--

Commit: https://git.seco.com/clea-os/bsp/mediatek/linux-seco-mtk/-/commit/bfbdd1f4f7bbd5bae350cedf66b29bc51fa7061a

BACKPORT: ASoC: SOF: add error handling to snd_sof_ipc_msg_data()

If an invalid stream is passed to snd_sof_ipc_msg_data() it won't fill the provided object with data. The caller has to be able to recognise such cases to avoid handling invalid data. Make the function return an error when failing.

Change-Id: Id363669b2299948e2840c32f7b3b0dc9b4859331 Signed-off-by: Guennadi Liakhovetski guennadi.liakhovetski@linux.intel.com Reviewed-by: Peter Ujfalusi peter.ujfalusi@intel.com Reviewed-by: Kai Vehmanen kai.vehmanen@linux.intel.com Reviewed-by: Ranjani Sridharan ranjani.sridharan@linux.intel.com Signed-off-by: Peter Ujfalusi peter.ujfalusi@linux.intel.com Link: https://lore.kernel.org/r/20210928103516.8066-1-peter.ujfalusi@linux.intel.com Signed-off-by: Mark Brown broonie@kernel.org

--

Commit: https://git.seco.com/clea-os/bsp/mediatek/linux-seco-mtk/-/commit/8f4fd30aea6b585c7d174c704403103adc78b551

UPSTREAM: ASoC: SOF: pm: fix a stale comment

There is no restore_stream flag anymmore.

Change-Id: Ic44e58099d08be0a864079707db5029487ffc226 Signed-off-by: Ranjani Sridharan ranjani.sridharan@linux.intel.com Reviewed-by: Paul Olaru paul.olaru@oss.nxp.com Reviewed-by: Kai Vehmanen kai.vehmanen@linux.intel.com Reviewed-by: Bard Liao bard.liao@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/20210928074030.30553-1-peter.ujfalusi@linux.intel.com Signed-off-by: Mark Brown broonie@kernel.org

--

Commit: https://git.seco.com/clea-os/bsp/mediatek/linux-seco-mtk/-/commit/9c8723c7c96e564e5dcabab88230d3abfa932876

UPSTREAM: ASoC: SOF: Remove struct sof_ops_table and sof_get_ops() macro

sof_get_ops() is not used and the struct sof_ops_table is only used by that macro.

Change-Id: I89888ad1e6235a68af7f4534543585f780a29a0e Signed-off-by: Peter Ujfalusi peter.ujfalusi@linux.intel.com Reviewed-by: Guennadi Liakhovetski guennadi.liakhovetski@linux.intel.com Reviewed-by: Kai Vehmanen kai.vehmanen@linux.intel.com Reviewed-by: Pierre-Louis Bossart pierre-louis.bossart@linux.intel.com Link: https://lore.kernel.org/r/20210920064156.4763-1-peter.ujfalusi@linux.intel.com Signed-off-by: Mark Brown broonie@kernel.org

--

Commit: https://git.seco.com/clea-os/bsp/mediatek/linux-seco-mtk/-/commit/bbfb676d906696df519110d9a997eacdca16a692

UPSTREAM: ASoC: soc-pcm: Don't reconnect an already active BE

In some cases, multiple FE components have the same BE component in their respective DPCM paths. One such example would be a mixer component, which can receive two or more inputs and sends a mixed output. In such cases, to avoid reconfiguration of already active DAI (mixer output DAI in this case), check the BE stream state to filter out the redundancy.

In summary, allow connection of BE if the respective current stream state is either NEW or CLOSED.

Change-Id: I4c63d551c5438e839f271f2b60c36bed869c7698 Signed-off-by: Sameer Pujar spujar@nvidia.com Link: https://lore.kernel.org/r/1631551342-25469-2-git-send-email-spujar@nvidia.com Signed-off-by: Mark Brown broonie@kernel.org

--

Commit: https://git.seco.com/clea-os/bsp/mediatek/linux-seco-mtk/-/commit/c3c423be0e44626d8dac2a05f156fe9007e643c4

UPSTREAM: ASoC: compress/component: Use module_get_when_open/put_when_close for cstream

Currently the try_module_get() and module_put() is not possible for compressed streams if the module_get_upon_open is set to 1 which means that
the components are not protected in a same way as components when normal audio is used.

SOF is setting module_get_upon_open to 1 for component drivers which works correctly for audio stream but when compressed stream is used then the module is not protected.

Convert the compress open and free operation to mimic the steps of it's pcm counterpart to fix this issue.

Change-Id: Ie6d40668dca1020ea055f41d18f9ddc9d4226100 Signed-off-by: Peter Ujfalusi peter.ujfalusi@linux.intel.com Link: https://lore.kernel.org/r/20210901095255.3617-3-peter.ujfalusi@linux.intel.com Signed-off-by: Mark Brown broonie@kernel.org

--

Commit: https://git.seco.com/clea-os/bsp/mediatek/linux-seco-mtk/-/commit/e675322f29bfa40344b3ef7bd796a036c0a5dfec

UPSTREAM: ASoC: soc-component: Convert the mark_module to void*

The mark_module of the snd_soc_component is strict snd_pcm_substream type which prevents it to be used by compressed streams.

Change the type to void* along with the snd_soc_component_module_get() and snd_soc_component_module_put() to allow the same mark to be used by compressed when it's module_get_upon_open is set to 1.

Change-Id: I25fa59cd3058217c266d5fbb81f89eb0f84618d8 Signed-off-by: Peter Ujfalusi peter.ujfalusi@linux.intel.com Link: https://lore.kernel.org/r/20210901095255.3617-2-peter.ujfalusi@linux.intel.com Signed-off-by: Mark Brown broonie@kernel.org

--

Commit: https://git.seco.com/clea-os/bsp/mediatek/linux-seco-mtk/-/commit/f19f1b7f8a252d12b7fcc09b82ad56b75eb901c5

UPSTREAM: ASoC: SOF: Rename sof_arch_ops to dsp_arch_ops

From the name sof_arch_ops one can not decipher that these ops are DSP architecture ops. Rename it to dsp_arch_ops and change also the macro to retrieve the DSP architecture specific ops as well.

Change-Id: Ib7cba2f680e59a267225bdd23c5062a09cd190a8 Signed-off-by: Peter Ujfalusi peter.ujfalusi@linux.intel.com Reviewed-by: Guennadi Liakhovetski guennadi.liakhovetski@linux.intel.com Reviewed-by: Kai Vehmanen kai.vehmanen@linux.intel.com Reviewed-by: Pierre-Louis Bossart pierre-louis.bossart@linux.intel.com Link: https://lore.kernel.org/r/20210916130308.7969-1-peter.ujfalusi@linux.intel.com Signed-off-by: Mark Brown broonie@kernel.org

--

Commit: https://git.seco.com/clea-os/bsp/mediatek/linux-seco-mtk/-/commit/3ae70c15acb63498d6f47ab565b71e10ab05b83e

UPSTREAM: ASoC: SOF: ipc: Remove redundant error check from sof_ipc_tx_message_unlocked

If the snd_sof_dsp_send_msg() failed then we have already returned from sof_ipc_tx_message_unlocked() with the error message.

There is no need to check if ret is really 0 after this and we can return directly the return value from tx_wait_done()

At the same time make the remaining checks for error (ret) to match.

Change-Id: I287c8fb5324165124fdd30b8eb31fe2f4ec6a769 Signed-off-by: Peter Ujfalusi peter.ujfalusi@linux.intel.com Reviewed-by: Guennadi Liakhovetski guennadi.liakhovetski@linux.intel.com Reviewed-by: Kai Vehmanen kai.vehmanen@linux.intel.com Reviewed-by: Pierre-Louis Bossart pierre-louis.bossart@linux.intel.com Link: https://lore.kernel.org/r/20210916125725.25934-1-peter.ujfalusi@linux.intel.com Signed-off-by: Mark Brown broonie@kernel.org

--

Commit: https://git.seco.com/clea-os/bsp/mediatek/linux-seco-mtk/-/commit/9b1d1ba4ed6127f3c84987e83ffa2f0d271a5322

UPSTREAM: ASoC: SOF: ipc: Print 0x prefix for errors in ipc_trace/stream_message()

The dev_err() in ipc_trace_message() and ipc_stream_message() is missing the 0x prefix for the hexadecimal number when printed.

Change-Id: I6f1f453866b6ae7e8c75a44b5197dffc5e25a0d9 Signed-off-by: Peter 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 Link: https://lore.kernel.org/r/20210917085823.27222-3-peter.ujfalusi@linux.intel.com Signed-off-by: Mark Brown broonie@kernel.org

--

Commit: https://git.seco.com/clea-os/bsp/mediatek/linux-seco-mtk/-/commit/f7bf57f6e55b01535337d6ab8ac7fcd0364865ae

UPSTREAM: ASoC: SOF: ipc: Clarify the parameter name for ipc_trace_message()

ipc_trace_message() receives the type not the ID. Use the same naming as the ipc_stream_message() function: msg_type to help the reader to follow the code.

Change-Id: I66950587fbdc88ad9deaa5e50a0b8adf40238c19 Signed-off-by: Peter 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 Reviewed-by: Bard Liao bard.liao@intel.com Link: https://lore.kernel.org/r/20210917085823.27222-2-peter.ujfalusi@linux.intel.com Signed-off-by: Mark Brown broonie@kernel.org

--

Commit: https://git.seco.com/clea-os/bsp/mediatek/linux-seco-mtk/-/commit/9bb6354a02342d3fab7fe0997061de1298c855dd

UPSTREAM: ASoC: SOF: core: Move probe work related code under a single if () branch

Relocate the INIT_WORK() at the same place where we schedule the work to make the code simpler and easier to follow.

Change-Id: I50acd43c0180d2ca01aa28dd27db3af51e9e9962 Signed-off-by: Peter Ujfalusi peter.ujfalusi@linux.intel.com Reviewed-by: Guennadi Liakhovetski guennadi.liakhovetski@linux.intel.com Reviewed-by: Kai Vehmanen kai.vehmanen@linux.intel.com Reviewed-by: Pierre-Louis Bossart pierre-louis.bossart@linux.intel.com Link: https://lore.kernel.org/r/20210916124902.24248-1-peter.ujfalusi@linux.intel.com Signed-off-by: Mark Brown broonie@kernel.org

--

Commit: https://git.seco.com/clea-os/bsp/mediatek/linux-seco-mtk/-/commit/f946c5dd630df3d29ad3e2b63ccf7eab58d4496f

BACKPORT: ASoC: SOF: probe: Merge and clean up the probe and compress files

The probe debug functionality is implemented via compress support and it was spread across two set of files: probe.c/h compress.c/h

Merge the two files into sof-probes.s/h and clean them up by removing unused struct definitions, functions. We can also move most of the functions static as they are only used internally.

Change-Id: Ic1b2cd1fb64820da45ae6c5981c1151a199e5c3c Signed-off-by: Peter Ujfalusi peter.ujfalusi@linux.intel.com Reviewed-by: Pierre-Louis Bossart pierre-louis.bossart@linux.intel.com Reviewed-by: Kai Vehmanen kai.vehmanen@linux.intel.com Reviewed-by: Ranjani Sridharan ranjani.sridharan@linux.intel.com Link: https://lore.kernel.org/r/20210916103211.1573-5-peter.ujfalusi@linux.intel.com Signed-off-by: Mark Brown broonie@kernel.org

--

Commit: https://git.seco.com/clea-os/bsp/mediatek/linux-seco-mtk/-/commit/fbc4a61601b09d7e6251af27707e6f782ce65aed

BACKPORT: ASoC: SOF: compress: move and export sof_probe_compr_ops

sof_probe_compr_ops are not platform-specific. So move it to common compress code and export the symbol. The compilation of the common compress code is already dependent on the selection of CONFIG_SND_SOC_SOF_DEBUG_PROBES, so no need to check the Kconfig section for defining sof_probe_compr_ops again.

Change-Id: Ie8677bd7c73238b866a2ed103305cd947190c804 Signed-off-by: Ranjani Sridharan ranjani.sridharan@linux.intel.com Reviewed-by: Pierre-Louis Bossart pierre-louis.bossart@linux.intel.com Reviewed-by: Kai Vehmanen kai.vehmanen@linux.intel.com Signed-off-by: Peter Ujfalusi peter.ujfalusi@linux.intel.com Link: https://lore.kernel.org/r/20210916103211.1573-4-peter.ujfalusi@linux.intel.com Signed-off-by: Mark Brown broonie@kernel.org

--

Commit: https://git.seco.com/clea-os/bsp/mediatek/linux-seco-mtk/-/commit/b463b8b5ce6a4fcaccc12d90361337e9dec995c1

UPSTREAM: ASoC: SOF: pcm: Remove non existent CONFIG_SND_SOC_SOF_COMPRESS reference

The SND_SOC_SOF_COMPRESS is not valid Kconfig option, remove it.

At the same time remove the also the declaration of the non existent sof_compressed_ops.

Change-Id: I84b277b9e574a9b27026574905f2250bcbb39858 Signed-off-by: Peter Ujfalusi peter.ujfalusi@linux.intel.com Reviewed-by: Pierre-Louis Bossart pierre-louis.bossart@linux.intel.com Reviewed-by: Kai Vehmanen kai.vehmanen@linux.intel.com Reviewed-by: Ranjani Sridharan ranjani.sridharan@linux.intel.com Link: https://lore.kernel.org/r/20210916103211.1573-3-peter.ujfalusi@linux.intel.com Signed-off-by: Mark Brown broonie@kernel.org

--

Commit: https://git.seco.com/clea-os/bsp/mediatek/linux-seco-mtk/-/commit/53773759d2d9527f6e28934a8c0d7057ece3df29

UPSTREAM: ASoC: SOF: ipc: Add probe message logging to ipc_log_header()

Probe related messages are missing from the logging, for example the PROBE_INIT would show up as:

ipc tx: 0xc0010000: unknown GLB command ipc tx succeeded: 0xc0010000: unknown GLB command

Add code to handle the probe messages to have human readable output

Change-Id: I3435bc4c7af3f5afc6727d55bcd2f86477906c1b Signed-off-by: Peter Ujfalusi peter.ujfalusi@linux.intel.com Reviewed-by: Pierre-Louis Bossart pierre-louis.bossart@linux.intel.com Reviewed-by: Kai Vehmanen kai.vehmanen@linux.intel.com Reviewed-by: Ranjani Sridharan ranjani.sridharan@linux.intel.com Link: https://lore.kernel.org/r/20210916103211.1573-2-peter.ujfalusi@linux.intel.com Signed-off-by: Mark Brown broonie@kernel.org

--

Commit: https://git.seco.com/clea-os/bsp/mediatek/linux-seco-mtk/-/commit/f1cbadcce6aaad206cab8ed687fd876490ea0669

UPSTREAM: ASoC: SOF: debug: No need to export the snd_sof_debugfs_io_item()

The snd_sof_debugfs_io_item() only used within debug.c, no need to export it.

Change-Id: I68cf3ec8d237e3ba9040ee7fe56da3e991c53b4a Signed-off-by: Peter Ujfalusi peter.ujfalusi@linux.intel.com Reviewed-by: Daniel Baluta daniel.baluta@gmail.com Reviewed-by: Ranjani Sridharan ranjani.sridharan@linux.intel.com Reviewed-by: Guennadi Liakhovetski guennadi.liakhovetski@linux.intel.com Link: https://lore.kernel.org/r/20210915122116.18317-13-peter.ujfalusi@linux.intel.com Signed-off-by: Mark Brown broonie@kernel.org

--

Commit: https://git.seco.com/clea-os/bsp/mediatek/linux-seco-mtk/-/commit/4e5711a21375eb8e3d0cc5cc61238b63f83abd50

UPSTREAM: ASoC: SOF: loader: Use the generic ops for region debugfs handling

Do not access the sdev->bar[] directly to make the code generic, use the new generic ops for handing the regions for debugfs.

Change-Id: I7334c069185c0c51c35fa34ed6a5044c0939e539 Signed-off-by: Peter Ujfalusi peter.ujfalusi@linux.intel.com Reviewed-by: Daniel Baluta daniel.baluta@gmail.com Reviewed-by: Ranjani Sridharan ranjani.sridharan@linux.intel.com Reviewed-by: Guennadi Liakhovetski guennadi.liakhovetski@linux.intel.com Link: https://lore.kernel.org/r/20210915122116.18317-12-peter.ujfalusi@linux.intel.com Signed-off-by: Mark Brown broonie@kernel.org

--

Commit: https://git.seco.com/clea-os/bsp/mediatek/linux-seco-mtk/-/commit/9674a64ed0dbf64c21abeee58bc50940fdc67f64

UPSTREAM: ASoC: SOF: debug: Add generic API and ops for DSP regions

Add new debugfs_add_region_item along with a generic wrapper snd_sof_debugfs_add_region_item() to abstract away the DSP regions related debugfs support.

At the same commit add iomem based generic implementation for the new ops

Change-Id: I448e4ec49f860e1338c448f840e95b5663d14191 Signed-off-by: Peter Ujfalusi peter.ujfalusi@linux.intel.com Reviewed-by: Daniel Baluta daniel.baluta@gmail.com Reviewed-by: Ranjani Sridharan ranjani.sridharan@linux.intel.com Reviewed-by: Guennadi Liakhovetski guennadi.liakhovetski@linux.intel.com Link: https://lore.kernel.org/r/20210915122116.18317-9-peter.ujfalusi@linux.intel.com Signed-off-by: Mark Brown broonie@kernel.org

--

Commit: https://git.seco.com/clea-os/bsp/mediatek/linux-seco-mtk/-/commit/297ec9d40764ff1a00da264f3425550a4ac99655

UPSTREAM: ASoC: SOF: core: Do not use 'bar' as parameter for block_read/write

The use of bar in the core poses limits on the portability of the code to other, non iomapped platforms. To make the API more generic, remove the use of 'bar' as parameter for the block copy API.

Change-Id: Icf4ba087e5df84ea0ee5bb4ca73f78aa8c05ed9b Signed-off-by: Peter Ujfalusi peter.ujfalusi@linux.intel.com Reviewed-by: Daniel Baluta daniel.baluta@gmail.com Reviewed-by: Ranjani Sridharan ranjani.sridharan@linux.intel.com Reviewed-by: Guennadi Liakhovetski guennadi.liakhovetski@linux.intel.com Link: https://lore.kernel.org/r/20210915122116.18317-8-peter.ujfalusi@linux.intel.com Signed-off-by: Mark Brown broonie@kernel.org

--

Commit: https://git.seco.com/clea-os/bsp/mediatek/linux-seco-mtk/-/commit/d69e1782a1ce026e3e3c1efc8bc213e01cc7739a

UPSTREAM: ASoC: SOF: loader: No need to export snd_sof_fw_parse_ext_data()

snd_sof_fw_parse_ext_data() is used only internally within loader.c and there is no need to export it.

Change-Id: I826e94ec31575285a1da5201b80362dd795d502f Signed-off-by: Peter Ujfalusi peter.ujfalusi@linux.intel.com Reviewed-by: Daniel Baluta daniel.baluta@gmail.com Reviewed-by: Ranjani Sridharan ranjani.sridharan@linux.intel.com Reviewed-by: Guennadi Liakhovetski guennadi.liakhovetski@linux.intel.com Link: https://lore.kernel.org/r/20210915122116.18317-7-peter.ujfalusi@linux.intel.com Signed-off-by: Mark Brown broonie@kernel.org

--

Commit: https://git.seco.com/clea-os/bsp/mediatek/linux-seco-mtk/-/commit/56da6c3ff0e2f646cb2e97db9d3721267fa723da

UPSTREAM: ASoC: SOF: ipc: Remove snd_sof_dsp_mailbox_init()

The snd_sof_dsp_mailbox_init() is called only from sof_get_windows() to set the sdev->dsp_box.offset/size and sdev->host_box.offset/size

Instead of using a function, set the offsets and sizes like we do for the other boxes in sof_get_windows().

Change-Id: I0b23f61ea8bc7670fc8f792f1d7dd6d482de0f16 Signed-off-by: Peter Ujfalusi peter.ujfalusi@linux.intel.com Reviewed-by: Guennadi Liakhovetski guennadi.liakhovetski@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 Link: https://lore.kernel.org/r/20210915122116.18317-3-peter.ujfalusi@linux.intel.com Signed-off-by: Mark Brown broonie@kernel.org

--

Commit: https://git.seco.com/clea-os/bsp/mediatek/linux-seco-mtk/-/commit/c6eed236319fa50b37c3cdfb746fa5129332bb37

UPSTREAM: ASoC: SOF: loader: load_firmware callback is mandatory, treat it like that

Since the load_firmware callback in snd_sof_dsp_ops is mandatory and it is tested during probe.

Move the snd_sof_load_firmware() wrapper to ops.h as inline and drop the check of sof_ops(sdev)->load_firmware

Change-Id: I56ecf3500596d2b7cfb6f4f8cb70cd62a811b395 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: Kai Vehmanen kai.vehmanen@linux.intel.com Link: https://lore.kernel.org/r/20210914125356.19828-1-peter.ujfalusi@linux.intel.com Signed-off-by: Mark Brown broonie@kernel.org

--

Commit: https://git.seco.com/clea-os/bsp/mediatek/linux-seco-mtk/-/commit/5bf7fc217c0804738e40504c20d14c7f7801a9ac

UPSTREAM: ASoC: SOF: Drop resindex_dma_base, dma_engine, dma_size from sof_dev_desc

resindex_dma_base, dma_engine and dma_size is unused, remove them. There is no hint in the comments how this supposed to be used, when the need arises it can be added back.

Change-Id: I0313cf92e88651c5656be025edf231ddbe735904 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: Kai Vehmanen kai.vehmanen@linux.intel.com Link: https://lore.kernel.org/r/20210915065541.1178-3-peter.ujfalusi@linux.intel.com Signed-off-by: Mark Brown broonie@kernel.org

--

Commit: https://git.seco.com/clea-os/bsp/mediatek/linux-seco-mtk/-/commit/4991093cf884e5468270f77bba399b829f4cf49f

UPSTREAM: ASoC: SOF: Handle control change notification from firmware

If the value/data associated with a control changes in SOF it will send a notification (SOF_IPC_GLB_COMP_MSG with SOF_IPC_COMP_GET_VALUE/DATA).

We have support for binary volatile control type, but we might have features where enum/switch/volume changes. Re-implementing everything as volatile as well would be not much of a gain for several reasons:

  • volatile controls would do an IPC all the time, regardless if there is a need or not.
  • We still don't have notification which forces userspace to continuously poll.

When such notification arrives we use snd_ctl_notify_one() to signal userspace about the change.

The kernel is prepared for two types of notification:

  • the notification carries the new data for the control (num_elems != 0) The new value/data is copied to the control's local data

  • blank message about a change The new flag for the scontrol (comp_data_dirty) is set and when next time user space reads the value via the kcontrol's get callback we will refresh the control's local data from the firmware.

Change-Id: I52fcb41e7d0ae37849eb7b3f4e94b1e9c237b483 Signed-off-by: Peter 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 Tested-by: Seppo Ingalsuo seppo.ingalsuo@linux.intel.com Link: https://lore.kernel.org/r/20210903114018.2962-1-peter.ujfalusi@linux.intel.com Signed-off-by: Mark Brown broonie@kernel.org

--

Commit: https://git.seco.com/clea-os/bsp/mediatek/linux-seco-mtk/-/commit/397e2074e46ec9aba6bf23ba9260d53891444471

UPSTREAM: ASoC: SOF: control: fix a typo in put operations for kcontrol

SOF_CTRL_TYPE_VALUE_CHAN_SET should be used for put operations for consistency. The current use of _GET is obviously incorrect but _GET and _SET result in the same action so there is no functional change introduced by this patch.

Change-Id: Iaea9d05e39d160c1e2214f4d774119f6ed49adb4 Signed-off-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 Signed-off-by: Peter Ujfalusi peter.ujfalusi@linux.intel.com Link: https://lore.kernel.org/r/20210902114744.27237-1-peter.ujfalusi@linux.intel.com Signed-off-by: Mark Brown broonie@kernel.org

--

Commit: https://git.seco.com/clea-os/bsp/mediatek/linux-seco-mtk/-/commit/80d28814d45fbb1a4faae25741cbec3836962ddb

UPSTREAM: ASoC: SOF: core: allow module parameter to override dma trace Kconfig

Most distributions do not enable the SOF developer options and specifically the DMA trace. This is problematic for end-user/community support since the sof-logger tool cannot extract valuable information.

Conversely in rare cases the DMA trace can lead to Heisenbugs by creating more traffic to system memory and more interrupts.

This patch changes the logic so that the Kconfig value is used as a default value for a module parameter, but this value can be changed as needed. Users can override the distro DMA trace selection.

Change-Id: Ib7e4faa3c20d423d81a92f7a60f59be1e11dc19b Signed-off-by: Pierre-Louis Bossart pierre-louis.bossart@linux.intel.com Reviewed-by: Ranjani Sridharan ranjani.sridharan@linux.intel.com Reviewed-by: Daniel Baluta daniel.baluta@gmail.com Reviewed-by: Kai Vehmanen kai.vehmanen@linux.intel.com Link: https://lore.kernel.org/r/20210907184648.33306-1-pierre-louis.bossart@linux.intel.com Signed-off-by: Mark Brown broonie@kernel.org

Merge request reports

Loading