Message ID | 20240313110147.1267793-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 5A404C54E58 for <linux-arm-kernel@archiver.kernel.org>; Wed, 13 Mar 2024 11:02:44 +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=LiFnlhdSMpmTDA oL9zeLkp3DIqSCjOmfv8pHdgQFAfBY//NSVKJtcR6mW38m0FJrJZYrBivkD8ufjZkk1x+3HGVKIN/ B6VAgbGnJ7yQwyXb4vQU4of1vefL9MPipHZtFbA8cGKklO25P7dsI1JIEPUNAlVdoaXbCOMXTnfRQ n+HBU6OI4pU4I/265QeG3CmdOp79hwnyL/bUE0XHcR8HE5vo7Edjvs1dZuQiFg9qHqK+2DcNEo/pi YNBvIxfHptZ0tmniXuoJmuf8qbNSxqHrKmIlOe6Wt9aZvSdNlVCAHIieHeIlw+fAdt8MOm8oBNSBQ Kt1FethWj/uJpdRlsDyQ==; Received: from localhost ([::1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.97.1 #2 (Red Hat Linux)) id 1rkMNR-00000009mVr-14pJ; Wed, 13 Mar 2024 11:02:29 +0000 Received: from madrid.collaboradmins.com ([46.235.227.194]) by bombadil.infradead.org with esmtps (Exim 4.97.1 #2 (Red Hat Linux)) id 1rkMN6-00000009mGd-1FZO; Wed, 13 Mar 2024 11:02:10 +0000 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=collabora.com; s=mail; t=1710327727; bh=/pS8nnncjy2TDDWZ2CUchnxDIc/k7Kdx/uqwdwe7Xs0=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=rj8Hxc8+GoI4e+bW7whogaTkZXlNQ7quB4QXRcMvEziDmhPSnyNQhmjVWgRXTTaxH GvfZmEl6rd7FKeiBZ1JEGSCmDHWns/Rb8ztacEeB1hX60r9bbTLV1cw7CcmPQwERo7 2oywITki6/3NS/Xb8RZ6XJfGYWTB3KU56CAx1qaOW/u+MDaVICjPa/kq5zwXGF2S3f XOz5xWYc6CMGUbEg7Sk07EAZve3tb05In9KLyxITCh1chjrsPVHddD7BXyWeEiC0qK udyqkx1NVrWKFAMD0b6E28v7n228i3x+NaBj6GdwPsQs+mAexoXitUSGmAJM5wsYkj 5w/NR2jne/45w== 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 DAF1937820D4; Wed, 13 Mar 2024 11:02:04 +0000 (UTC) From: AngeloGioacchino Del Regno <angelogioacchino.delregno@collabora.com> To: broonie@kernel.org Subject: [PATCH v3 04/22] ASoC: mediatek: Assign dummy when codec not specified for a DAI link Date: Wed, 13 Mar 2024 12:01:29 +0100 Message-ID: <20240313110147.1267793-5-angelogioacchino.delregno@collabora.com> X-Mailer: git-send-email 2.44.0 In-Reply-To: <20240313110147.1267793-1-angelogioacchino.delregno@collabora.com> References: <20240313110147.1267793-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-20240313_040208_601448_470AC4BD X-CRM114-Status: GOOD ( 11.01 ) 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 |
SoC: 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(-)