From patchwork Tue Sep 6 09:27:23 2022 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: AngeloGioacchino Del Regno X-Patchwork-Id: 12967165 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from bombadil.infradead.org (bombadil.infradead.org [198.137.202.133]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.lore.kernel.org (Postfix) with ESMTPS id 05059ECAAA1 for ; Tue, 6 Sep 2022 09:29:31 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=lists.infradead.org; s=bombadil.20210309; h=Sender:List-Subscribe:List-Help :List-Post:List-Archive:List-Unsubscribe:List-Id:Content-Transfer-Encoding: MIME-Version:References:In-Reply-To:Message-Id:Date:Subject:Cc:To:From: Reply-To:Content-Type:Content-ID:Content-Description:Resent-Date:Resent-From: Resent-Sender:Resent-To:Resent-Cc:Resent-Message-ID:List-Owner; bh=s5OOEavJtBEdFOqg8D6i8GqslHFVjSAfhBqPtr4c504=; b=HfZOUqr6goY4KogZl4WwIPE0hx anMCHfVciWz/oB1u3bjgWJl9YyCvMWTjZ4qukO3KNmqZ6ktm+grqhmNVhOtVYFWvSWP08LJhGmYmm 49h8EsrtyqGRp8Stcx+SvoSqSzAyptWpYuGXuN7z5eXs0IZC9ZBDZFOTsPp3Ahk70pPK8uIl+642S 1Kl3D8w3GpQHUOlA0L9FCOTXjXNFBpbEisk1HK+tsMf8ONpRlZg6VjFjEUkVUoLQJZyFk43Qaqgmb P+dMbj+p4m68VJvI4MYnwf/g/soH/Ix+Ba4Zzthk5i+v815ZNmMXnbZX9ULwLtaW1/BFRaf/mRg9y AhpjZL8g==; Received: from localhost ([::1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.94.2 #2 (Red Hat Linux)) id 1oVUtY-00BolH-87; Tue, 06 Sep 2022 09:29:24 +0000 Received: from madras.collabora.co.uk ([46.235.227.172]) by bombadil.infradead.org with esmtps (Exim 4.94.2 #2 (Red Hat Linux)) id 1oVUru-00BntB-Pp; Tue, 06 Sep 2022 09:27:44 +0000 Received: from IcarusMOD.eternityproject.eu (2-237-20-237.ip236.fastwebnet.it [2.237.20.237]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (No client certificate requested) (Authenticated sender: kholk11) by madras.collabora.co.uk (Postfix) with ESMTPSA id 68B55660037F; Tue, 6 Sep 2022 10:27:36 +0100 (BST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=collabora.com; s=mail; t=1662456458; bh=vXQl6sWYH3s9nZcdEQtm9bzb3mf6vHvob18mX522u5Q=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=gaP7CzHIWz3oofHqZpF1nJ/2SBzJ0tEF/o0JbZuWbZzz0jtYTgk1OjQ9MhHoPbYte +InfDwR1jByO1iziZY8SbfOS2imRGasoF9EQVvm5lxVaaVdciPurOQ9vV7njksGjgZ Ms628sECmg3Lk39rxRRyEMz98uT8B/xAtkNukUqWKmCOhFn6HaqVmmlfIfOr6zmUBa y9BZ6HipY9RZyh1ADzEmgq5bFBl0Q/ZD1EwwkufgDQV0JtHsAGDu3OfBVC1/0PkChw VjXWrMQauz4mC7iw6B+VCQUvq9nSWNNrJz5SGheCGz0if30q5Fj6NrbRTWIf28rLmK Jhcg30Re66o5g== From: AngeloGioacchino Del Regno To: broonie@kernel.org Cc: lgirdwood@gmail.com, perex@perex.cz, tiwai@suse.com, matthias.bgg@gmail.com, wenst@chromium.org, pierre-louis.bossart@linux.intel.com, peter.ujfalusi@linux.intel.com, yung-chuan.liao@linux.intel.com, ranjani.sridharan@linux.intel.com, kai.vehmanen@linux.intel.com, daniel.baluta@nxp.com, trevor.wu@mediatek.com, tzungbi@google.com, angelogioacchino.delregno@collabora.com, yc.hung@mediatek.com, Allen-KH.Cheng@mediatek.com, geert@linux-m68k.org, chunxu.li@mediatek.com, alsa-devel@alsa-project.org, linux-arm-kernel@lists.infradead.org, linux-mediatek@lists.infradead.org, linux-kernel@vger.kernel.org, sound-open-firmware@alsa-project.org, kernel@collabora.com Subject: [PATCH 1/5] ASoC: mediatek: mt8195-mt6359: Properly register sound card for SOF Date: Tue, 6 Sep 2022 11:27:23 +0200 Message-Id: <20220906092727.37324-2-angelogioacchino.delregno@collabora.com> X-Mailer: git-send-email 2.37.2 In-Reply-To: <20220906092727.37324-1-angelogioacchino.delregno@collabora.com> References: <20220906092727.37324-1-angelogioacchino.delregno@collabora.com> MIME-Version: 1.0 X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20220906_022743_009167_048197E7 X-CRM114-Status: UNSURE ( 9.88 ) X-CRM114-Notice: Please train this message. X-BeenThere: linux-mediatek@lists.infradead.org X-Mailman-Version: 2.1.34 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: "Linux-mediatek" Errors-To: linux-mediatek-bounces+linux-mediatek=archiver.kernel.org@lists.infradead.org Adding a probe callback on this snd_soc_card is required when Sound Open Firmware support is desired, as we need to appropriately populate the stream_name for SOF to be able to bind widgets. Failing to do so will produce errors when applying the SOF topology leading to card registration failure (so, no sound). While at it, also make sure to fill the topology_shortname as required. Fixes: 0caf1120c583 ("ASoC: mediatek: mt8195: extract SOF common code") Signed-off-by: AngeloGioacchino Del Regno --- sound/soc/mediatek/mt8195/mt8195-mt6359.c | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/sound/soc/mediatek/mt8195/mt8195-mt6359.c b/sound/soc/mediatek/mt8195/mt8195-mt6359.c index c530e3fc27e4..961e769602d6 100644 --- a/sound/soc/mediatek/mt8195/mt8195-mt6359.c +++ b/sound/soc/mediatek/mt8195/mt8195-mt6359.c @@ -1383,7 +1383,13 @@ static int mt8195_mt6359_dev_probe(struct platform_device *pdev) sof_priv->num_streams = ARRAY_SIZE(g_sof_conn_streams); sof_priv->sof_dai_link_fixup = mt8195_dai_link_fixup; soc_card_data->sof_priv = sof_priv; + card->probe = mtk_sof_card_probe; card->late_probe = mtk_sof_card_late_probe; + if (!card->topology_shortname_created) { + snprintf(card->topology_shortname, 32, "sof-%s", card->name); + card->topology_shortname_created = true; + } + card->name = card->topology_shortname; sof_on = 1; } From patchwork Tue Sep 6 09:27:24 2022 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: AngeloGioacchino Del Regno X-Patchwork-Id: 12967163 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from bombadil.infradead.org (bombadil.infradead.org [198.137.202.133]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.lore.kernel.org (Postfix) with ESMTPS id B6FCFC38145 for ; Tue, 6 Sep 2022 09:28:19 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=lists.infradead.org; s=bombadil.20210309; h=Sender:List-Subscribe:List-Help :List-Post:List-Archive:List-Unsubscribe:List-Id:Content-Transfer-Encoding: MIME-Version:References:In-Reply-To:Message-Id:Date:Subject:Cc:To:From: Reply-To:Content-Type:Content-ID:Content-Description:Resent-Date:Resent-From: Resent-Sender:Resent-To:Resent-Cc:Resent-Message-ID:List-Owner; bh=TxPJNmG21p1gXv0GZjFyhUcLypkkAiQmx9BXfnoODlQ=; b=BTOiH/sZKpRLyrV6FmyCYHx5Rz fBwZVaQaEsZ/Xbz6FVQZ/QXNhkf2R8hWoB0QX82GzumCa7F5kvBpMBW8GHQbyILujfxPjITppznZG dJz3cSIfTrr/euONEuRK6a7NR3oW37rdU9BV8Fqb2kV4oq6VzL1rOZgjITLc2GEtj1BimnRQj237b VlSX+rCSJWnB4fMpUEanu7PZ0c1iv8/uS+dnngR9uWJTGjsgKGFAQxpKaUCT/yjK3Qpwv9FJUHoMh YZ/E5zkvyeCBcxEtCTBZHnGFqafwncSLV2gzsDZmzd+zOuy02jNbgGj6M292+R1je1TDEbpP05myV Y+D1UmdQ==; Received: from localhost ([::1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.94.2 #2 (Red Hat Linux)) id 1oVUsP-00Bo78-4m; Tue, 06 Sep 2022 09:28:13 +0000 Received: from madras.collabora.co.uk ([2a00:1098:0:82:1000:25:2eeb:e5ab]) by bombadil.infradead.org with esmtps (Exim 4.94.2 #2 (Red Hat Linux)) id 1oVUru-00BnuB-3j; Tue, 06 Sep 2022 09:27:43 +0000 Received: from IcarusMOD.eternityproject.eu (2-237-20-237.ip236.fastwebnet.it [2.237.20.237]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (No client certificate requested) (Authenticated sender: kholk11) by madras.collabora.co.uk (Postfix) with ESMTPSA id 363D46601EB2; Tue, 6 Sep 2022 10:27:38 +0100 (BST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=collabora.com; s=mail; t=1662456459; bh=WyVYZj+c9maI28dTmRLQ5XLV8nr4NB4/PmV9sY12Gmk=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=YvL7hcmYNk/2CwJ3pZ9ZoLT98cjdp69vFL19MlIdv+b7lziyVountzzH4vlXnc+OW ZTh6WDE0KOWl2orEeVlPnAn/FoTp89rCJcgn2Vpe/cDljqQ1xRznKoc7ZYK8cniwN0 oJHCPQFf/HvsWwA8hz7UHDIyTlINe1FLJIbh3GOKC5BODT2+k0UE27D5qFz2nsXsBb HjWhFFGg4O4ItFmN6/wKmHnXBw10ndrFevUobUu9h7fUP4TFpVz2mWYvfXa6e/ey2g J7Ef/JeNGkzLlWg2byJkSY0xCD5IQRHpbQPRs7/ogKE7A7NCgHzZASY5PMPtOxELof zDGl05rTg4iwQ== From: AngeloGioacchino Del Regno To: broonie@kernel.org Cc: lgirdwood@gmail.com, perex@perex.cz, tiwai@suse.com, matthias.bgg@gmail.com, wenst@chromium.org, pierre-louis.bossart@linux.intel.com, peter.ujfalusi@linux.intel.com, yung-chuan.liao@linux.intel.com, ranjani.sridharan@linux.intel.com, kai.vehmanen@linux.intel.com, daniel.baluta@nxp.com, trevor.wu@mediatek.com, tzungbi@google.com, angelogioacchino.delregno@collabora.com, yc.hung@mediatek.com, Allen-KH.Cheng@mediatek.com, geert@linux-m68k.org, chunxu.li@mediatek.com, alsa-devel@alsa-project.org, linux-arm-kernel@lists.infradead.org, linux-mediatek@lists.infradead.org, linux-kernel@vger.kernel.org, sound-open-firmware@alsa-project.org, kernel@collabora.com Subject: [PATCH 2/5] ASoC: SOF: mediatek: mt8195: Import namespace SND_SOC_SOF_MTK_COMMON Date: Tue, 6 Sep 2022 11:27:24 +0200 Message-Id: <20220906092727.37324-3-angelogioacchino.delregno@collabora.com> X-Mailer: git-send-email 2.37.2 In-Reply-To: <20220906092727.37324-1-angelogioacchino.delregno@collabora.com> References: <20220906092727.37324-1-angelogioacchino.delregno@collabora.com> MIME-Version: 1.0 X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20220906_022742_317904_0ADDC09F X-CRM114-Status: UNSURE ( 8.08 ) X-CRM114-Notice: Please train this message. X-BeenThere: linux-mediatek@lists.infradead.org X-Mailman-Version: 2.1.34 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: "Linux-mediatek" Errors-To: linux-mediatek-bounces+linux-mediatek=archiver.kernel.org@lists.infradead.org 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") Signed-off-by: AngeloGioacchino Del Regno --- sound/soc/sof/mediatek/mt8195/mt8195.c | 1 + 1 file changed, 1 insertion(+) diff --git a/sound/soc/sof/mediatek/mt8195/mt8195.c b/sound/soc/sof/mediatek/mt8195/mt8195.c index 9c146015cd1b..ff575de7e46a 100644 --- a/sound/soc/sof/mediatek/mt8195/mt8195.c +++ b/sound/soc/sof/mediatek/mt8195/mt8195.c @@ -652,4 +652,5 @@ static struct platform_driver snd_sof_of_mt8195_driver = { module_platform_driver(snd_sof_of_mt8195_driver); MODULE_IMPORT_NS(SND_SOC_SOF_XTENSA); +MODULE_IMPORT_NS(SND_SOC_SOF_MTK_COMMON); MODULE_LICENSE("Dual BSD/GPL"); From patchwork Tue Sep 6 09:27:25 2022 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: AngeloGioacchino Del Regno X-Patchwork-Id: 12967166 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from bombadil.infradead.org (bombadil.infradead.org [198.137.202.133]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.lore.kernel.org (Postfix) with ESMTPS id 5124AC54EE9 for ; Tue, 6 Sep 2022 09:29:36 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=lists.infradead.org; s=bombadil.20210309; h=Sender:List-Subscribe:List-Help :List-Post:List-Archive:List-Unsubscribe:List-Id:Content-Transfer-Encoding: MIME-Version:References:In-Reply-To:Message-Id:Date:Subject:Cc:To:From: Reply-To:Content-Type:Content-ID:Content-Description:Resent-Date:Resent-From: Resent-Sender:Resent-To:Resent-Cc:Resent-Message-ID:List-Owner; bh=uqVCEFxgZT3Yk8JbHPpz4KOOZa7ZmxAOLFYT1AqjaAA=; b=plY/mhKH3xpdBtF3adeNhOpqz7 zJbq1Db0aXYJhbNyqXgLQWHWUOjTb6/EHX8YDbXsRRCrxy5sUwYAMcrEesS2XVWxwqREeS3xsQAi1 UxF62Q7AwqzGwfR+W5NXWGPrmCIHri+fjhGmaIn9r1Phx4/tAgODvg/YHtR7Uf1Z6iX9HJdW+esWo 6Dl+JPPaBYuYAosX32N6beCC2DynSerZkpYuPQUvm175EPsVND+2FANhpzwlGn3TDgSXIAuzIo7eO 1jqDSGBfFDdmXYXOW/vU77R4nWduHXxMWvYdPhqcZjPzNNj0TmH31QNqTgR89cv2WTk8n16enlHF0 bxLnP3zQ==; Received: from localhost ([::1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.94.2 #2 (Red Hat Linux)) id 1oVUtd-00Bops-UK; Tue, 06 Sep 2022 09:29:29 +0000 Received: from madras.collabora.co.uk ([2a00:1098:0:82:1000:25:2eeb:e5ab]) by bombadil.infradead.org with esmtps (Exim 4.94.2 #2 (Red Hat Linux)) id 1oVUrv-00BnuV-Bp; Tue, 06 Sep 2022 09:27:45 +0000 Received: from IcarusMOD.eternityproject.eu (2-237-20-237.ip236.fastwebnet.it [2.237.20.237]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (No client certificate requested) (Authenticated sender: kholk11) by madras.collabora.co.uk (Postfix) with ESMTPSA id 821FE660038D; Tue, 6 Sep 2022 10:27:39 +0100 (BST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=collabora.com; s=mail; t=1662456460; bh=yV6nCsjeOdwaKJwa/v3ztHbWo4/fPObpHuPkgeFvzgA=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=kCCCdAdPwuWWeMFa2+5PwAQeF3I4MKfZVzXHZNN8nHmFiSVVBsmDlgUxsLjsyP9xR IG7ng+Ts5OLLA0ENa5tu0bVSpEDNDDO+9dYz6DJGGuQvT3ETw3fg5Ex9W+VROmO1wC Jvgq8XmCrR4QLTvQLvGbaGoG4f3hZiBpJB0fAJoM/sNqiN+0ygNgmwexBb0oy+SUWj 7idoqXQjmJ1znaMpkR+dak5n9t2yN2r1o/7PTgUmR1UwvD4yzSSGWEgoEPjIqLPgiB gVKCwTylk+bgKHgvg0MabafFdICAlHcMgT9VXmoGU7SHBVrcyoymzJBiVG1ksEeaRv ij7DtFUjRljcA== From: AngeloGioacchino Del Regno To: broonie@kernel.org Cc: lgirdwood@gmail.com, perex@perex.cz, tiwai@suse.com, matthias.bgg@gmail.com, wenst@chromium.org, pierre-louis.bossart@linux.intel.com, peter.ujfalusi@linux.intel.com, yung-chuan.liao@linux.intel.com, ranjani.sridharan@linux.intel.com, kai.vehmanen@linux.intel.com, daniel.baluta@nxp.com, trevor.wu@mediatek.com, tzungbi@google.com, angelogioacchino.delregno@collabora.com, yc.hung@mediatek.com, Allen-KH.Cheng@mediatek.com, geert@linux-m68k.org, chunxu.li@mediatek.com, alsa-devel@alsa-project.org, linux-arm-kernel@lists.infradead.org, linux-mediatek@lists.infradead.org, linux-kernel@vger.kernel.org, sound-open-firmware@alsa-project.org, kernel@collabora.com Subject: [PATCH 3/5] ASoC: SOF: mediatek: mt8195: Add mailbox generic callbacks for IPC Date: Tue, 6 Sep 2022 11:27:25 +0200 Message-Id: <20220906092727.37324-4-angelogioacchino.delregno@collabora.com> X-Mailer: git-send-email 2.37.2 In-Reply-To: <20220906092727.37324-1-angelogioacchino.delregno@collabora.com> References: <20220906092727.37324-1-angelogioacchino.delregno@collabora.com> MIME-Version: 1.0 X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20220906_022743_594719_54231E17 X-CRM114-Status: GOOD ( 10.64 ) X-BeenThere: linux-mediatek@lists.infradead.org X-Mailman-Version: 2.1.34 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: "Linux-mediatek" Errors-To: linux-mediatek-bounces+linux-mediatek=archiver.kernel.org@lists.infradead.org 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(). Signed-off-by: AngeloGioacchino Del Regno --- sound/soc/sof/mediatek/mt8195/mt8195.c | 14 +++++--------- 1 file changed, 5 insertions(+), 9 deletions(-) diff --git a/sound/soc/sof/mediatek/mt8195/mt8195.c b/sound/soc/sof/mediatek/mt8195/mt8195.c index ff575de7e46a..68747ee21c6f 100644 --- a/sound/soc/sof/mediatek/mt8195/mt8195.c +++ b/sound/soc/sof/mediatek/mt8195/mt8195.c @@ -496,14 +496,6 @@ static int mt8195_get_bar_index(struct snd_sof_dev *sdev, u32 type) return type; } -static int mt8195_ipc_msg_data(struct snd_sof_dev *sdev, - struct snd_pcm_substream *substream, - void *p, size_t sz) -{ - sof_mailbox_read(sdev, sdev->dsp_box.offset, p, sz); - return 0; -} - static void mt8195_adsp_dump(struct snd_sof_dev *sdev, u32 flags) { u32 dbg_pc, dbg_data, dbg_bus0, dbg_bus1, dbg_inst; @@ -574,6 +566,10 @@ static struct snd_sof_dsp_ops sof_mt8195_ops = { .block_read = sof_block_read, .block_write = sof_block_write, + /* Mailbox IO */ + .mailbox_read = sof_mailbox_read, + .mailbox_write = sof_mailbox_write, + /* Register IO */ .write = sof_io_write, .read = sof_io_read, @@ -584,7 +580,7 @@ static struct snd_sof_dsp_ops sof_mt8195_ops = { .send_msg = mt8195_send_msg, .get_mailbox_offset = mt8195_get_mailbox_offset, .get_window_offset = mt8195_get_window_offset, - .ipc_msg_data = mt8195_ipc_msg_data, + .ipc_msg_data = sof_ipc_msg_data, .set_stream_data_offset = sof_set_stream_data_offset, /* misc */ From patchwork Tue Sep 6 09:27:26 2022 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: AngeloGioacchino Del Regno X-Patchwork-Id: 12967167 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from bombadil.infradead.org (bombadil.infradead.org [198.137.202.133]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.lore.kernel.org (Postfix) with ESMTPS id 7F213C6FA8B for ; Tue, 6 Sep 2022 09:29:37 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=lists.infradead.org; s=bombadil.20210309; h=Sender:List-Subscribe:List-Help :List-Post:List-Archive:List-Unsubscribe:List-Id:Content-Transfer-Encoding: MIME-Version:References:In-Reply-To:Message-Id:Date:Subject:Cc:To:From: Reply-To:Content-Type:Content-ID:Content-Description:Resent-Date:Resent-From: Resent-Sender:Resent-To:Resent-Cc:Resent-Message-ID:List-Owner; bh=zkT8et/+9fsHR4OfMLHSHSPmyTJmgtocBkTQJHJ6YHA=; b=jp8maXT8RyViOWOZayIylm9Wrs DqvT1f898Pkys6mcK1nj7qgPqqx0AnEUPF64sLvdDugnk7kGeG9CjYEQ2Ya2TH67AkRlN6RuuL6Dw sAaYTNMM096LDFgxQlT/ABfuv9Bd+NcvLg5qbt8k8MoGnp9t2gnpR4WsH/ym9N/nVkVC0pX3JGIV2 VJfcDYnQ7dB2F2sXBS2oHYla198DV/nu0RisO/EkMvnBSCh8vV0/M9OQoFwqLCOIhPxWwdrEiC5Jd gBxgcI6DFh7Y6POoziKtqQ/KRi6AK3Kq+3roFJPlFWq8A99S2ZZ1OwjbVhdHUw68kbTR3oKrinVpO UqUgMGPg==; Received: from localhost ([::1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.94.2 #2 (Red Hat Linux)) id 1oVUtf-00Boqt-2d; Tue, 06 Sep 2022 09:29:31 +0000 Received: from madras.collabora.co.uk ([46.235.227.172]) by bombadil.infradead.org with esmtps (Exim 4.94.2 #2 (Red Hat Linux)) id 1oVUrv-00Bnuf-3W; Tue, 06 Sep 2022 09:27:45 +0000 Received: from IcarusMOD.eternityproject.eu (2-237-20-237.ip236.fastwebnet.it [2.237.20.237]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (No client certificate requested) (Authenticated sender: kholk11) by madras.collabora.co.uk (Postfix) with ESMTPSA id C3A6F6601E73; Tue, 6 Sep 2022 10:27:40 +0100 (BST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=collabora.com; s=mail; t=1662456461; bh=YDlQ+YNdqI/5kTvHBiM/B/3jPqKXRqtJVv0TyDN9v4s=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=jUe01iz99vjxX5T1OZqszuO5NuLhZ7HOJybhSE3NubRqkA7xOh107oJhxrBscabsA U/0eCBPs483WDAw8bfelr0xm1W6crl/U+jz4c6NYA7JiZv2y++LJPmvnfc+Shzchjy j5TLzLqoMHNKJpogWol7MEwV0SbiTnxlUTTwxlta6zOYWt0fjo0mVB6eY4PIMvB1gL s+6Fpqa2s/QpoVVZJGxXkq1VQzYQuL+IkhYQBwq/XQ7B9vPpBcAmtjjI1RPciSsDFQ 74JhAc0TlmV//EpD6Kfxgd5Gk29MGhfj9lqnJfz2MbF7oShABq3XHf3f0eMtVkeeN6 IFPussD/yOgTA== From: AngeloGioacchino Del Regno To: broonie@kernel.org Cc: lgirdwood@gmail.com, perex@perex.cz, tiwai@suse.com, matthias.bgg@gmail.com, wenst@chromium.org, pierre-louis.bossart@linux.intel.com, peter.ujfalusi@linux.intel.com, yung-chuan.liao@linux.intel.com, ranjani.sridharan@linux.intel.com, kai.vehmanen@linux.intel.com, daniel.baluta@nxp.com, trevor.wu@mediatek.com, tzungbi@google.com, angelogioacchino.delregno@collabora.com, yc.hung@mediatek.com, Allen-KH.Cheng@mediatek.com, geert@linux-m68k.org, chunxu.li@mediatek.com, alsa-devel@alsa-project.org, linux-arm-kernel@lists.infradead.org, linux-mediatek@lists.infradead.org, linux-kernel@vger.kernel.org, sound-open-firmware@alsa-project.org, kernel@collabora.com Subject: [PATCH 4/5] ASoC: SOF: mediatek: mt8195: Add generic pcm_{open,close} callbacks Date: Tue, 6 Sep 2022 11:27:26 +0200 Message-Id: <20220906092727.37324-5-angelogioacchino.delregno@collabora.com> X-Mailer: git-send-email 2.37.2 In-Reply-To: <20220906092727.37324-1-angelogioacchino.delregno@collabora.com> References: <20220906092727.37324-1-angelogioacchino.delregno@collabora.com> MIME-Version: 1.0 X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20220906_022743_303951_01E2C601 X-CRM114-Status: UNSURE ( 9.05 ) X-CRM114-Notice: Please train this message. X-BeenThere: linux-mediatek@lists.infradead.org X-Mailman-Version: 2.1.34 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: "Linux-mediatek" Errors-To: linux-mediatek-bounces+linux-mediatek=archiver.kernel.org@lists.infradead.org Use the generic sof_stream_pcm_{open,close}() functions for the pcm_{open,close} callbacks. Signed-off-by: AngeloGioacchino Del Regno --- sound/soc/sof/mediatek/mt8195/mt8195.c | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/sound/soc/sof/mediatek/mt8195/mt8195.c b/sound/soc/sof/mediatek/mt8195/mt8195.c index 68747ee21c6f..c1590e78edd4 100644 --- a/sound/soc/sof/mediatek/mt8195/mt8195.c +++ b/sound/soc/sof/mediatek/mt8195/mt8195.c @@ -586,6 +586,10 @@ static struct snd_sof_dsp_ops sof_mt8195_ops = { /* misc */ .get_bar_index = mt8195_get_bar_index, + /* stream callbacks */ + .pcm_open = sof_stream_pcm_open, + .pcm_close = sof_stream_pcm_close, + /* firmware loading */ .load_firmware = snd_sof_load_firmware_memcpy, From patchwork Tue Sep 6 09:27:27 2022 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: AngeloGioacchino Del Regno X-Patchwork-Id: 12967168 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from bombadil.infradead.org (bombadil.infradead.org [198.137.202.133]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.lore.kernel.org (Postfix) with ESMTPS id 14FFDC38145 for ; Tue, 6 Sep 2022 09:30:06 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=lists.infradead.org; s=bombadil.20210309; h=Sender:List-Subscribe:List-Help :List-Post:List-Archive:List-Unsubscribe:List-Id:Content-Transfer-Encoding: MIME-Version:References:In-Reply-To:Message-Id:Date:Subject:Cc:To:From: Reply-To:Content-Type:Content-ID:Content-Description:Resent-Date:Resent-From: Resent-Sender:Resent-To:Resent-Cc:Resent-Message-ID:List-Owner; bh=jvGbJ+KC1RP80Rzn1mqrYiL/R0gbW0BhvVQJYjHpVCU=; b=exAQx84I7mmkP5Qkh6Yksqn3Uq wAQ8sZNqbwBNYFGl4oqV7QNzzBzzHfnty8V8tQwfgXzsiJC6cSM7ZxTK0erSQPFkiwvprQd9Se0O2 uel/F4V4Co011sgPUbzRCm0av9+A/4QWlneld7M+qAGIcNvzAyC7mdlJcegA25mA+uVnPlsx+zD2s bGcgqQh0WWp+TlbJZYVmLXGtKYOYHZ0pD4YgcUcmZEnuZOwFH0yiJjAoCZ47WFJxFod8i0u7ECwVc YX7KM2q/yUuord2kEwV/wiP7RrWQl38ntOklNYUC69n+JkGSI0dQJozZutcADrV8A9u49tc1Xmhd1 v0P553UA==; Received: from localhost ([::1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.94.2 #2 (Red Hat Linux)) id 1oVUu7-00BpG8-A3; Tue, 06 Sep 2022 09:29:59 +0000 Received: from madras.collabora.co.uk ([46.235.227.172]) by bombadil.infradead.org with esmtps (Exim 4.94.2 #2 (Red Hat Linux)) id 1oVUrw-00BnwF-Kw; Tue, 06 Sep 2022 09:27:46 +0000 Received: from IcarusMOD.eternityproject.eu (2-237-20-237.ip236.fastwebnet.it [2.237.20.237]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (No client certificate requested) (Authenticated sender: kholk11) by madras.collabora.co.uk (Postfix) with ESMTPSA id 1A36D6601F39; Tue, 6 Sep 2022 10:27:42 +0100 (BST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=collabora.com; s=mail; t=1662456463; bh=q/pjRlc+P1EXAov84vHYYZkyXsNxDJtdjpHTIHnbw+w=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=X7j7JJNoV/4qGA8hHzxbjp29Roe1pEwLywRePOz7quQpuSF3ELkhNFcFELz4usSLR ma9qGN9glh2aoynYH44mhPSEr5MX4SB38P5Dzu2KhkvV3PP1Sled5nHEjvl3+4dkAN S9d7FBvig4OAydOT3pxG5AipzTqt471gt8hspnXlkaKtFjh3mjSZIpKfU8/Q1XMiLJ BNs79djZuVQXHT1FJUSqlU6zKaC9YGJqfwc3pQzc68D7EMRIpjOsLPm+zp3vXLg2LE ZublxmPgPhgumD9twr6pXezF0Albz7sAyU/WPAmyuNYyuck3VVOfxwZ7L/O3c5gJ52 SU+2RwqRrJA7w== From: AngeloGioacchino Del Regno To: broonie@kernel.org Cc: lgirdwood@gmail.com, perex@perex.cz, tiwai@suse.com, matthias.bgg@gmail.com, wenst@chromium.org, pierre-louis.bossart@linux.intel.com, peter.ujfalusi@linux.intel.com, yung-chuan.liao@linux.intel.com, ranjani.sridharan@linux.intel.com, kai.vehmanen@linux.intel.com, daniel.baluta@nxp.com, trevor.wu@mediatek.com, tzungbi@google.com, angelogioacchino.delregno@collabora.com, yc.hung@mediatek.com, Allen-KH.Cheng@mediatek.com, geert@linux-m68k.org, chunxu.li@mediatek.com, alsa-devel@alsa-project.org, linux-arm-kernel@lists.infradead.org, linux-mediatek@lists.infradead.org, linux-kernel@vger.kernel.org, sound-open-firmware@alsa-project.org, kernel@collabora.com Subject: [PATCH 5/5] ASoC: SOF: mediatek: mt8195: Add devicetree support to select topologies Date: Tue, 6 Sep 2022 11:27:27 +0200 Message-Id: <20220906092727.37324-6-angelogioacchino.delregno@collabora.com> X-Mailer: git-send-email 2.37.2 In-Reply-To: <20220906092727.37324-1-angelogioacchino.delregno@collabora.com> References: <20220906092727.37324-1-angelogioacchino.delregno@collabora.com> MIME-Version: 1.0 X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20220906_022744_863460_AEF564BF X-CRM114-Status: GOOD ( 10.32 ) X-BeenThere: linux-mediatek@lists.infradead.org X-Mailman-Version: 2.1.34 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: "Linux-mediatek" Errors-To: linux-mediatek-bounces+linux-mediatek=archiver.kernel.org@lists.infradead.org Support devicetree by adding a snd_soc_of_mach array, specifying SOF topologies for a generic MT8195 machine and for Google Tomato Chromebooks. Signed-off-by: AngeloGioacchino Del Regno --- sound/soc/sof/mediatek/mt8195/mt8195.c | 13 +++++++++++++ 1 file changed, 13 insertions(+) diff --git a/sound/soc/sof/mediatek/mt8195/mt8195.c b/sound/soc/sof/mediatek/mt8195/mt8195.c index c1590e78edd4..8e359c296308 100644 --- a/sound/soc/sof/mediatek/mt8195/mt8195.c +++ b/sound/soc/sof/mediatek/mt8195/mt8195.c @@ -615,7 +615,20 @@ static struct snd_sof_dsp_ops sof_mt8195_ops = { SNDRV_PCM_INFO_NO_PERIOD_WAKEUP, }; +static struct snd_sof_of_mach sof_mt8195_machs[] = { + { + .compatible = "google,tomato", + .sof_tplg_filename = "sof-mt8195-mt6359-rt1019-rt5682-dts.tplg" + }, { + .compatible = "mediatek,mt8195", + .sof_tplg_filename = "sof-mt8195.tplg" + }, { + /* sentinel */ + } +}; + static const struct sof_dev_desc sof_of_mt8195_desc = { + .of_machines = sof_mt8195_machs, .ipc_supported_mask = BIT(SOF_IPC), .ipc_default = SOF_IPC, .default_fw_path = {