Message ID | 20240227120939.290143-5-angelogioacchino.delregno@collabora.com (mailing list archive) |
---|---|
State | New, archived |
Headers | show
Return-Path: <linux-arm-kernel-bounces+linux-arm-kernel=archiver.kernel.org@lists.infradead.org> 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 019BBC54798 for <linux-arm-kernel@archiver.kernel.org>; Tue, 27 Feb 2024 12:13:40 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=lists.infradead.org; s=bombadil.20210309; h=Sender: Content-Transfer-Encoding:Content-Type:Cc:List-Subscribe:List-Help:List-Post: List-Archive:List-Unsubscribe:List-Id:MIME-Version:References:In-Reply-To: Message-ID:Date:Subject:To:From:Reply-To:Content-ID:Content-Description: Resent-Date:Resent-From:Resent-Sender:Resent-To:Resent-Cc:Resent-Message-ID: List-Owner; bh=FTfaBM0tasSTfRuJdPN1RzfENxmQftyhqK2FeMh2/QA=; b=K+meAftqMDDJZe 9p6seI5b210zzlAWZtYGa16SrTX/AIWEpjQ1s+463FpK+90rYv0RFBCNyU2EcUjdjEIYpSY7GjC/d e+YDEMyRnoL2cWX+R7VAKfuCM0TgETV3H+rEd7NXnPp5wOre6WFxIZG68xjUp5xJj8M1dPFHcMMpA XplYYp84RkZH7Pbqdp8wxdxZ29VMVf0AxAvmZYkuFAuj+oFU78T87T7PlkvtECHgUmUzpC3xJl68n xLtgwzhlR5ADcDP0K06eVTWmp0OR3VpS02l4tmq93G2E1sBzGG69IoHtXVTAk9kPTPZaC+qpUGvu4 DaCcm+fYQyX5TGc9EdZQ==; Received: from localhost ([::1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.97.1 #2 (Red Hat Linux)) id 1rewKx-000000056HH-1Dz8; Tue, 27 Feb 2024 12:13:31 +0000 Received: from madrid.collaboradmins.com ([2a00:1098:ed:100::25]) by bombadil.infradead.org with esmtps (Exim 4.97.1 #2 (Red Hat Linux)) id 1rewHu-000000054OO-1GiN; Tue, 27 Feb 2024 12:10:24 +0000 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=collabora.com; s=mail; t=1709035819; bh=/pS8nnncjy2TDDWZ2CUchnxDIc/k7Kdx/uqwdwe7Xs0=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=kcmZurdLnb4NEeZOVMoPq/n8gPZAqhxwuwBD8VPzFg0oWVwIufkSxFD6aQ0pyHAJd fj7YijGOi8P2qG+qlY9fyK94FRrqQFD0RPcuwlnLiSCrS66q/47ZUSwqNFeenUR5S7 I0KxZUODXTW7uGFiIbMBVF5Woz/A6rICBd8j0SFSccC0fbyNGOrRx5+Ooh9iMtYdjx QYP0SETzpxQ8ipsxKTutuSjHhtcGpiD9ts/N2Fo31fHlWAuYWa4GSoPF5jLBzZtcz4 TMWWK3d8pHRZKm8LrXg8A8R1fhU6VT7FXDXtd1RmQ01ft2/iXm3easJHEPZcl+VkAk lB6qzluGyiNpA== Received: from IcarusMOD.eternityproject.eu (cola.collaboradmins.com [195.201.22.229]) (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 madrid.collaboradmins.com (Postfix) with ESMTPSA id 00F2A37820D0; Tue, 27 Feb 2024 12:10:16 +0000 (UTC) From: AngeloGioacchino Del Regno <angelogioacchino.delregno@collabora.com> To: broonie@kernel.org Subject: [PATCH 04/22] ASoC: mediatek: Assign dummy when codec not specified for a DAI link Date: Tue, 27 Feb 2024 13:09:21 +0100 Message-ID: <20240227120939.290143-5-angelogioacchino.delregno@collabora.com> X-Mailer: git-send-email 2.44.0 In-Reply-To: <20240227120939.290143-1-angelogioacchino.delregno@collabora.com> References: <20240227120939.290143-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-20240227_041022_581728_C5763626 X-CRM114-Status: GOOD ( 11.36 ) X-BeenThere: linux-arm-kernel@lists.infradead.org X-Mailman-Version: 2.1.34 Precedence: list List-Id: <linux-arm-kernel.lists.infradead.org> List-Unsubscribe: <http://lists.infradead.org/mailman/options/linux-arm-kernel>, <mailto:linux-arm-kernel-request@lists.infradead.org?subject=unsubscribe> List-Archive: <http://lists.infradead.org/pipermail/linux-arm-kernel/> List-Post: <mailto:linux-arm-kernel@lists.infradead.org> List-Help: <mailto:linux-arm-kernel-request@lists.infradead.org?subject=help> List-Subscribe: <http://lists.infradead.org/mailman/listinfo/linux-arm-kernel>, <mailto:linux-arm-kernel-request@lists.infradead.org?subject=subscribe> Cc: shraash@google.com, alsa-devel@alsa-project.org, allen-kh.cheng@mediatek.com, kuninori.morimoto.gx@renesas.com, lgirdwood@gmail.com, tiwai@suse.com, shane.chien@mediatek.com, krzysztof.kozlowski+dt@linaro.org, claudiu.beznea@tuxon.dev, kernel@collabora.com, robh@kernel.org, nfraprado@collabora.com, amergnat@baylibre.com, zhourui@huaqin.corp-partner.google.com, jiaxin.yu@mediatek.com, trevor.wu@mediatek.com, wenst@chromium.org, devicetree@vger.kernel.org, conor+dt@kernel.org, ckeepax@opensource.cirrus.com, arnd@arndb.de, frank.li@vivo.com, maso.huang@mediatek.com, u.kleine-koenig@pengutronix.de, eugen.hristev@collabora.com, alpernebiyasak@gmail.com, linux-mediatek@lists.infradead.org, linux-sound@vger.kernel.org, matthias.bgg@gmail.com, perex@perex.cz, linux-arm-kernel@lists.infradead.org, AngeloGioacchino Del Regno <angelogioacchino.delregno@collabora.com>, xiazhengqiao@huaqin.corp-partner.google.com, dianders@chromium.org, linux-kernel@vger.kernel.org, jarkko.nikula@bitmer.com Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit Sender: "linux-arm-kernel" <linux-arm-kernel-bounces@lists.infradead.org> Errors-To: linux-arm-kernel-bounces+linux-arm-kernel=archiver.kernel.org@lists.infradead.org |
Series |
ASoC: Cleanup MediaTek soundcard machine drivers
|
expand
|
diff --git a/sound/soc/mediatek/common/mtk-soundcard-driver.c b/sound/soc/mediatek/common/mtk-soundcard-driver.c index a58e1e3674de..000a086a8cf4 100644 --- a/sound/soc/mediatek/common/mtk-soundcard-driver.c +++ b/sound/soc/mediatek/common/mtk-soundcard-driver.c @@ -22,7 +22,11 @@ static int set_card_codec_info(struct snd_soc_card *card, codec_node = of_get_child_by_name(sub_node, "codec"); if (!codec_node) { - dev_dbg(dev, "%s no specified codec\n", dai_link->name); + dev_dbg(dev, "%s no specified codec: setting dummy.\n", dai_link->name); + + dai_link->codecs = &snd_soc_dummy_dlc; + dai_link->num_codecs = 1; + dai_link->dynamic = 1; return 0; }
MediaTek sound card drivers are checking whether a DAI link is present and used on a board to assign the correct parameters and this is done by checking the codec DAI names at probe time. If no real codec is present, assign the dummy codec to the DAI link to avoid NULL pointer during string comparison. Fixes: 4302187d955f ("ASoC: mediatek: common: add soundcard driver common code") Signed-off-by: AngeloGioacchino Del Regno <angelogioacchino.delregno@collabora.com> --- sound/soc/mediatek/common/mtk-soundcard-driver.c | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-)