Received: by 2002:ab2:788f:0:b0:1ee:8f2e:70ae with SMTP id b15csp499743lqi; Thu, 7 Mar 2024 03:46:30 -0800 (PST) X-Forwarded-Encrypted: i=3; AJvYcCUSO7ATZbI9DTF/gvsBtTwtQMOy6oP3M/Rz6gNzlHOpCpL24Q3qVtrtm2WQ/ueJmQTnIHOBET95eaHJ0pvPeTyWegowgCB3mA2V2D0JIw== X-Google-Smtp-Source: AGHT+IG5/9Mm0hqRIBFtJwGuZWJfX0xh7rnqlD08vwVOYaGJrYgoAc/ns2BUyCuNYHnGkunHMNzB X-Received: by 2002:a17:90a:af85:b0:299:f750:9670 with SMTP id w5-20020a17090aaf8500b00299f7509670mr14248803pjq.7.1709811990325; Thu, 07 Mar 2024 03:46:30 -0800 (PST) ARC-Seal: i=2; a=rsa-sha256; t=1709811990; cv=pass; d=google.com; s=arc-20160816; b=MHDw1MsxqQaE02Up+qrixfySvhEqyX+bWdnbY9+JTsOqbVJJxHC5MzIX39p+NkxQvV 7xJmxVizJH3EWXbkwQFLdj/GRp+bEhFFQFkQqDUFjd1rtSvfXKrYcPU36AdQ41BKd2lx dWJZMG8wxxpTXNHTtOYrAXvcvsI1JK0b6S9TXqS3k+4cSmMMITZGbGoa4Nr+pQWAjk6X JpxE+j/XeZ8jiXIkrzcA3x1b48qCsvYotLRYTWWkhosWsTf0iFfqfiXHufVltur/oQTT 0d+wX98R0BjiiuLWJ3vhbwD+JvrFnio0AqCEd9TUcKzC9rLIqkv2AdAw7sJ8I4rhWLXe GdfA== ARC-Message-Signature: i=2; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=content-transfer-encoding:mime-version:list-unsubscribe :list-subscribe:list-id:precedence:references:in-reply-to:message-id :date:subject:cc:to:from:dkim-signature; bh=G0PGcRwlZmfr0MWHcozlQ+u0gJ6SnQtl/al+rHBE6m0=; fh=9iEt4iCRn9CzCxci4w2sdEG90CBf9Xi5ef9RsAZByLs=; b=05l1F5Nu6OUMihl0oAC3+q3UHDjhmLW62aD3ImPyZy0UJYBsd8nvrlpfSueuZ4TMqX hKF3rzUNDyetAarOoTkNQr9c6yr1CZdrg0MEGre9xUni93W8xoQrR3SdoQx64OtlDszn WeVVMyYvhLZdM7TgjBs6g1oU0KL8cazHl2Bd0Fvp2T3odN9deUMAzElAN/98N7ObflU0 wGV1eIX5Y9HbHM5tuf8/IY0mhzvtDi0uDWSi+IMDecYPYrCLyhnAnBDsVZLmcDlgqINo U5rx3tSYObhwqypEdupKpLSuvu8tW9LLtOMbRb6vuaOq3pnysEAiKp8xCPXk9nrG1JP1 xUbQ==; dara=google.com ARC-Authentication-Results: i=2; mx.google.com; dkim=pass header.i=@collabora.com header.s=mail header.b=SFka2ONl; arc=pass (i=1 spf=pass spfdomain=collabora.com dkim=pass dkdomain=collabora.com dmarc=pass fromdomain=collabora.com); spf=pass (google.com: domain of linux-kernel+bounces-95464-linux.lists.archive=gmail.com@vger.kernel.org designates 139.178.88.99 as permitted sender) smtp.mailfrom="linux-kernel+bounces-95464-linux.lists.archive=gmail.com@vger.kernel.org"; dmarc=pass (p=QUARANTINE sp=QUARANTINE dis=NONE) header.from=collabora.com Return-Path: Received: from sv.mirrors.kernel.org (sv.mirrors.kernel.org. [139.178.88.99]) by mx.google.com with ESMTPS id t3-20020a17090aba8300b0029b730c9423si1515092pjr.124.2024.03.07.03.46.30 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Thu, 07 Mar 2024 03:46:30 -0800 (PST) Received-SPF: pass (google.com: domain of linux-kernel+bounces-95464-linux.lists.archive=gmail.com@vger.kernel.org designates 139.178.88.99 as permitted sender) client-ip=139.178.88.99; Authentication-Results: mx.google.com; dkim=pass header.i=@collabora.com header.s=mail header.b=SFka2ONl; arc=pass (i=1 spf=pass spfdomain=collabora.com dkim=pass dkdomain=collabora.com dmarc=pass fromdomain=collabora.com); spf=pass (google.com: domain of linux-kernel+bounces-95464-linux.lists.archive=gmail.com@vger.kernel.org designates 139.178.88.99 as permitted sender) smtp.mailfrom="linux-kernel+bounces-95464-linux.lists.archive=gmail.com@vger.kernel.org"; dmarc=pass (p=QUARANTINE sp=QUARANTINE dis=NONE) header.from=collabora.com Received: from smtp.subspace.kernel.org (wormhole.subspace.kernel.org [52.25.139.140]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by sv.mirrors.kernel.org (Postfix) with ESMTPS id 050F2284812 for ; Thu, 7 Mar 2024 11:46:30 +0000 (UTC) Received: from localhost.localdomain (localhost.localdomain [127.0.0.1]) by smtp.subspace.kernel.org (Postfix) with ESMTP id E2B7412BF36; Thu, 7 Mar 2024 11:45:06 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=collabora.com header.i=@collabora.com header.b="SFka2ONl" Received: from madrid.collaboradmins.com (madrid.collaboradmins.com [46.235.227.194]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id 5837C12BF02; Thu, 7 Mar 2024 11:45:04 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=46.235.227.194 ARC-Seal:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1709811906; cv=none; b=XVYGkQtGBYoP222jNBYX+bd2MAPviOm9nYgKlGOTIVg27k7CWwG8odCAK43EgmwdrO/8jx2tjNzb5XWJ5CzIhUXjWY6QkoSYLBoEMStnE+d/UkWABFL1cKIT1RBeQhyXFsp3xBcxHg9YLAfLnCpZ8E0NuNIMP5QPZ8+trkptlIs= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1709811906; c=relaxed/simple; bh=/pS8nnncjy2TDDWZ2CUchnxDIc/k7Kdx/uqwdwe7Xs0=; h=From:To:Cc:Subject:Date:Message-ID:In-Reply-To:References: MIME-Version; b=EY+mqFc3GeoamCFSqDyFADv0ugedkc2To+721B2NiY71T/VzmPmVTxdgSTeJP05ke75dKlRfBG6Ss7jFTMCPQiG/k1yn+E5Xv9XGwflSofwPHS+vBILogXLX4PU/+ZuDZohZFFIK0ShEUSWM2z0VC/U/AeAmZS35BbO0gJo1VJU= ARC-Authentication-Results:i=1; smtp.subspace.kernel.org; dmarc=pass (p=quarantine dis=none) header.from=collabora.com; spf=pass smtp.mailfrom=collabora.com; dkim=pass (2048-bit key) header.d=collabora.com header.i=@collabora.com header.b=SFka2ONl; arc=none smtp.client-ip=46.235.227.194 Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=quarantine dis=none) header.from=collabora.com Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=collabora.com DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=collabora.com; s=mail; t=1709811902; bh=/pS8nnncjy2TDDWZ2CUchnxDIc/k7Kdx/uqwdwe7Xs0=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=SFka2ONl+IW1KD+u2U5you9zacfumzJ0PTggp7r10/VXjdt/m6dS9N6ShYk6Nyh55 M1lQcQwPyAswbBsyhozWMpKjf0OQ+0F5YUR2TXgdJGkuqxgivzxXxN8rXojVhTV8Vc bew0iaiL5+jBDdbDdNoXDVwkp08EQBSqmSC3VVQBN3dDpTFmopQtB0pKvC814O8pEr 1DtWA+9cdNU6B5wyEC8RT+tBlXXcHK1vB0qQ0G+OyCyJn9NCyNrwBaAFdI7Le5Bj// 9/MTe/uk1uYMSZ7BqyprEHrk2Lq7m0dggzVB/qd/2wZqzjUzn2uDjiNJN0kOWMlEsD 7ZJGp3+p6kosQ== 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 7279C37820ED; Thu, 7 Mar 2024 11:45:00 +0000 (UTC) From: AngeloGioacchino Del Regno To: broonie@kernel.org Cc: wenst@chromium.org, lgirdwood@gmail.com, robh@kernel.org, krzysztof.kozlowski+dt@linaro.org, conor+dt@kernel.org, matthias.bgg@gmail.com, perex@perex.cz, tiwai@suse.com, trevor.wu@mediatek.com, maso.huang@mediatek.com, xiazhengqiao@huaqin.corp-partner.google.com, arnd@arndb.de, kuninori.morimoto.gx@renesas.com, shraash@google.com, amergnat@baylibre.com, nicolas.ferre@microchip.com, u.kleine-koenig@pengutronix.de, dianders@chromium.org, frank.li@vivo.com, allen-kh.cheng@mediatek.com, eugen.hristev@collabora.com, claudiu.beznea@tuxon.dev, jarkko.nikula@bitmer.com, jiaxin.yu@mediatek.com, alpernebiyasak@gmail.com, ckeepax@opensource.cirrus.com, zhourui@huaqin.corp-partner.google.com, nfraprado@collabora.com, alsa-devel@alsa-project.org, shane.chien@mediatek.com, linux-sound@vger.kernel.org, devicetree@vger.kernel.org, linux-kernel@vger.kernel.org, linux-arm-kernel@lists.infradead.org, linux-mediatek@lists.infradead.org, kernel@collabora.com, AngeloGioacchino Del Regno Subject: [PATCH v2 04/22] ASoC: mediatek: Assign dummy when codec not specified for a DAI link Date: Thu, 7 Mar 2024 12:44:27 +0100 Message-ID: <20240307114445.196981-5-angelogioacchino.delregno@collabora.com> X-Mailer: git-send-email 2.44.0 In-Reply-To: <20240307114445.196981-1-angelogioacchino.delregno@collabora.com> References: <20240307114445.196981-1-angelogioacchino.delregno@collabora.com> Precedence: bulk X-Mailing-List: linux-kernel@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Content-Transfer-Encoding: 8bit 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 --- sound/soc/mediatek/common/mtk-soundcard-driver.c | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) 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; } -- 2.44.0