From patchwork Wed Mar 1 11:01:59 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Trevor Wu X-Patchwork-Id: 657834 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 alsa0.perex.cz (alsa0.perex.cz [77.48.224.243]) (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 4ADB0C64ED6 for ; Wed, 1 Mar 2023 11:04:20 +0000 (UTC) Received: from alsa1.perex.cz (alsa1.perex.cz [207.180.221.201]) (using TLSv1.2 with cipher ADH-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by alsa0.perex.cz (Postfix) with ESMTPS id 00C6382A; Wed, 1 Mar 2023 12:03:27 +0100 (CET) DKIM-Filter: OpenDKIM Filter v2.11.0 alsa0.perex.cz 00C6382A DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=alsa-project.org; s=default; t=1677668658; bh=76cTnZOkmTnVo6ZgT3QbJHdvYyASZhEdqg9knV3/6y4=; h=From:To:Subject:Date:In-Reply-To:References:CC:List-Id: List-Archive:List-Help:List-Owner:List-Post:List-Subscribe: List-Unsubscribe:From; b=hh6RGH7CZBwE6ImrH0vw39RpAH85kEJrBKGFd38mpCrytebmnGIsQjoWDMvnz2d+F vsnLZr5RPL8Zgs5RhLStFCPcz+OJX1TeNYQDTKR+ajgn+eF27CNPgI8Mz6WzMFXPcW HG4SIoKqEsEvsXGRG8Uzay0j3CWFHVy7X+ijaNgE= Received: from mailman-core.alsa-project.org (mailman-core.alsa-project.org [10.254.200.10]) by alsa1.perex.cz (Postfix) with ESMTP id 4715EF8052E; Wed, 1 Mar 2023 12:02:38 +0100 (CET) Received: by alsa1.perex.cz (Postfix, from userid 50401) id 4F247F8049C; Wed, 1 Mar 2023 12:02:25 +0100 (CET) Received: from mailgw01.mediatek.com (unknown [60.244.123.138]) (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) by alsa1.perex.cz (Postfix) with ESMTPS id B7521F80310 for ; Wed, 1 Mar 2023 12:02:12 +0100 (CET) DKIM-Filter: OpenDKIM Filter v2.11.0 alsa1.perex.cz B7521F80310 Authentication-Results: alsa1.perex.cz; dkim=pass (1024-bit key, unprotected) header.d=mediatek.com header.i=@mediatek.com header.a=rsa-sha256 header.s=dk header.b=DBURAp35 X-UUID: 7fec8596b82011eda06fc9ecc4dadd91-20230301 DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=mediatek.com; s=dk; h=Content-Type:MIME-Version:References:In-Reply-To:Message-ID:Date:Subject:CC:To:From; bh=EX/FhLHpO7zphWbyD2A6bG1X9xJvIJg8CPj756Q4Cag=; b=DBURAp35WcAum1F9ZbR46oMZBhQFiED9f8ABDYeCD0PLrQ9SNreM06EyiDHcW1wyi8vSsrVTiXf3LE3y9dU5Az27tdYARM8xueNUNqGwi9Jrq0lhBY/Qsfz4MO6BRu8XWFNqzcXHujjP69+SsP+qCFSku9y6lp/MhklvhW5caaw=; X-CID-P-RULE: Release_Ham X-CID-O-INFO: VERSION:1.1.20, REQID:4fac1e71-67fa-43c1-9c05-fe2b9ed57154, IP:0, U RL:0,TC:0,Content:0,EDM:0,RT:0,SF:0,FILE:0,BULK:0,RULE:Release_Ham,ACTION: release,TS:0 X-CID-META: VersionHash:25b5999, CLOUDID:d565fd26-564d-42d9-9875-7c868ee415ec, B ulkID:nil,BulkQuantity:0,Recheck:0,SF:102,TC:nil,Content:0,EDM:-3,IP:nil,U RL:0,File:nil,Bulk:nil,QS:nil,BEC:nil,COL:0,OSI:0,OSA:0,AV:0 X-CID-BVR: 0 X-UUID: 7fec8596b82011eda06fc9ecc4dadd91-20230301 Received: from mtkmbs11n1.mediatek.inc [(172.21.101.185)] by mailgw01.mediatek.com (envelope-from ) (Generic MTA with TLSv1.2 ECDHE-RSA-AES256-GCM-SHA384 256/256) with ESMTP id 1458818991; Wed, 01 Mar 2023 19:02:04 +0800 Received: from mtkmbs11n2.mediatek.inc (172.21.101.187) by mtkmbs13n2.mediatek.inc (172.21.101.108) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.2.1118.25; Wed, 1 Mar 2023 19:02:03 +0800 Received: from mtksdccf07.mediatek.inc (172.21.84.99) by mtkmbs11n2.mediatek.inc (172.21.101.73) with Microsoft SMTP Server id 15.2.1118.25 via Frontend Transport; Wed, 1 Mar 2023 19:02:03 +0800 From: Trevor Wu To: , , , , Subject: [PATCH v2 1/2] ASoC: mediatek: mt8188: add missing initialization Date: Wed, 1 Mar 2023 19:01:59 +0800 Message-ID: <20230301110200.26177-2-trevor.wu@mediatek.com> X-Mailer: git-send-email 2.18.0 In-Reply-To: <20230301110200.26177-1-trevor.wu@mediatek.com> References: <20230301110200.26177-1-trevor.wu@mediatek.com> MIME-Version: 1.0 X-MTK: N Message-ID-Hash: WQZTJH34ZECHPMB2BYJEGS2LH3EXK5WW X-Message-ID-Hash: WQZTJH34ZECHPMB2BYJEGS2LH3EXK5WW X-MailFrom: trevor.wu@mediatek.com X-Mailman-Rule-Misses: dmarc-mitigation; no-senders; approved; emergency; loop; banned-address; member-moderation; header-match-alsa-devel.alsa-project.org-0; header-match-alsa-devel.alsa-project.org-1; nonmember-moderation; administrivia; implicit-dest; max-recipients; max-size; news-moderation; no-subject; digests; suspicious-header CC: trevor.wu@mediatek.com, angelogioacchino.delregno@collabora.com, alsa-devel@alsa-project.org, linux-mediatek@lists.infradead.org, linux-arm-kernel@lists.infradead.org, linux-kernel@vger.kernel.org X-Mailman-Version: 3.3.8 Precedence: list List-Id: "Alsa-devel mailing list for ALSA developers - http://www.alsa-project.org" Archived-At: List-Archive: List-Help: List-Owner: List-Post: List-Subscribe: List-Unsubscribe: In etdm dai driver, dai_etdm_parse_of() function is used to parse dts properties to get parameters. There are two for-loops which are sepearately for all etdm and etdm input only cases. In etdm in only loop, dai_id is not initialized, so it keeps the value intiliazed in another loop. In the patch, add the missing initialization to fix the unexpected parsing problem. Fixes: 2babb4777489 ("ASoC: mediatek: mt8188: support etdm in platform driver") Signed-off-by: Trevor Wu Reviewed-by: AngeloGioacchino Del Regno --- sound/soc/mediatek/mt8188/mt8188-dai-etdm.c | 3 +++ 1 file changed, 3 insertions(+) diff --git a/sound/soc/mediatek/mt8188/mt8188-dai-etdm.c b/sound/soc/mediatek/mt8188/mt8188-dai-etdm.c index 1c53d4cb19bb..7a37752d4244 100644 --- a/sound/soc/mediatek/mt8188/mt8188-dai-etdm.c +++ b/sound/soc/mediatek/mt8188/mt8188-dai-etdm.c @@ -2498,6 +2498,9 @@ static void mt8188_dai_etdm_parse_of(struct mtk_base_afe *afe) /* etdm in only */ for (i = 0; i < 2; i++) { + dai_id = ETDM_TO_DAI_ID(i); + etdm_data = afe_priv->dai_priv[dai_id]; + snprintf(prop, sizeof(prop), "mediatek,%s-chn-disabled", of_afe_etdms[i].name);