Received: by 2002:ab2:710b:0:b0:1ef:a325:1205 with SMTP id z11csp1631713lql; Wed, 13 Mar 2024 04:03:06 -0700 (PDT) X-Forwarded-Encrypted: i=3; AJvYcCWapcvByk4rqZCLOegGO4+h/KMNRS7iO7DzRJxprhh6VmQ7ExmRLvvLAq+0+wh93jerypX8Q0ZmgeF1nmsUU4kcN5XYp0ZHecg3Ir0ckw== X-Google-Smtp-Source: AGHT+IF/A0SFQa7rzlaPHGpc+z2w9ORvs1+4nPEvyyBPVjrFTKRww6VZpEpgFLqprxhG8pdh/MOR X-Received: by 2002:a2e:8ed3:0:b0:2d2:5668:3a40 with SMTP id e19-20020a2e8ed3000000b002d256683a40mr8798525ljl.4.1710327786366; Wed, 13 Mar 2024 04:03:06 -0700 (PDT) ARC-Seal: i=2; a=rsa-sha256; t=1710327786; cv=pass; d=google.com; s=arc-20160816; b=kJJzP7mjNkUjlWGGULoiKFCWymR7EanObSet6RqGJOLiQWLBpvBBg+QGFwi4TbYQQc taNcGjtNMhQP2MmMeZlEsb4Gr5tyNCPaqqD7nXEa2JjXq6P1ZIMK5wA2XHSJ5I44Ijq8 52bZfr/hSIb3jSbVQXF35yEd9OouLWfWz487ljY7YU29YkVpSBJZ0gzHGmcpVLZ2yKV0 fIxSepcdTGxTtNYxSzs5mPkjqC7XDFE+qA4pJX1KVCeMyc7uu6FBbs7BL5fsRhRmylK0 opeTzK18WRrtludxAhMDirChy9hVivrXm+F3AOHxZ5lMxcvrFvlYXJHu0NZ+Fd0x+L2I QQbg== 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=gHDLvv80a0KaKDnqXm76Zkx6vxzedoamVIqdv1HUfck6e+ke1HCmuAZSoiA7vy2CfF 4jL0NBJdFVIpJMxTLcO7G6m8BLkzYyM2pdsfu8a967RK4F1RaK2maTyu8+T8KV4eJ1qy Nsyy7PBUmQAoIim3BYWoeM+5O8o8LggdN0VewbfgHJg8pDdCgIU8nuA96B7d2gGB2NSk cD9PgP2Z8EwmnVthtwUS6JTQMx4jGM34rkq9IbyPCGVeIMrqGKYOV7wTmVnsUTiTMSkq nmqXCqkr89hA+CJlXacy11sYwA67kBBV0fd58sUb/IRYZ6NRDMg2UGtIyGSV65balkzK uasA==; dara=google.com ARC-Authentication-Results: i=2; mx.google.com; dkim=pass header.i=@collabora.com header.s=mail header.b=rj8Hxc8+; 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-101384-linux.lists.archive=gmail.com@vger.kernel.org designates 147.75.80.249 as permitted sender) smtp.mailfrom="linux-kernel+bounces-101384-linux.lists.archive=gmail.com@vger.kernel.org"; dmarc=pass (p=QUARANTINE sp=QUARANTINE dis=NONE) header.from=collabora.com Return-Path: Received: from am.mirrors.kernel.org (am.mirrors.kernel.org. [147.75.80.249]) by mx.google.com with ESMTPS id eb9-20020a0564020d0900b005664895cd8fsi4410423edb.53.2024.03.13.04.03.06 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Wed, 13 Mar 2024 04:03:06 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel+bounces-101384-linux.lists.archive=gmail.com@vger.kernel.org designates 147.75.80.249 as permitted sender) client-ip=147.75.80.249; Authentication-Results: mx.google.com; dkim=pass header.i=@collabora.com header.s=mail header.b=rj8Hxc8+; 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-101384-linux.lists.archive=gmail.com@vger.kernel.org designates 147.75.80.249 as permitted sender) smtp.mailfrom="linux-kernel+bounces-101384-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 am.mirrors.kernel.org (Postfix) with ESMTPS id 16E9D1F22637 for ; Wed, 13 Mar 2024 11:03:06 +0000 (UTC) Received: from localhost.localdomain (localhost.localdomain [127.0.0.1]) by smtp.subspace.kernel.org (Postfix) with ESMTP id EC14F3FB31; Wed, 13 Mar 2024 11:02:10 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=collabora.com header.i=@collabora.com header.b="rj8Hxc8+" 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 A1A673F9FD; Wed, 13 Mar 2024 11:02:08 +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=1710327730; cv=none; b=oba+OSI9JQAqzXaJydHmai+kaN7kHWUndT2sskvVLaZTYO85jfK9iC3hGe7Ju2Q5ba5LBo8CScpeIDZJI+EpPdrPn6uvAqBEKgpi17p8i1Cem+E3n9/s/Eywj7YjzYjRFgjPguD67qeuReFv/oORw+9O0uuD2uOZc5aGabUccRQ= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1710327730; c=relaxed/simple; bh=/pS8nnncjy2TDDWZ2CUchnxDIc/k7Kdx/uqwdwe7Xs0=; h=From:To:Cc:Subject:Date:Message-ID:In-Reply-To:References: MIME-Version; b=tQeDDh4TN/5YODLvicJHBA5MlLugprJwy1cTRvn6+St+ziZt9NW8Kw065an2zFlelHjqEdP9EHsSDx7Cmdr0HLfF72VgtifS7JcPDmT6LZoBfw4TcijENqi7PtUbYov92TPew444xmrYXb+u1mp1UdJa6oia6Oua+6CtG9FvheY= 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=rj8Hxc8+; 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=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 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 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> 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