From patchwork Tue Oct 24 03:50:17 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: =?utf-8?b?TWFzbyBIdWFuZyAo6buD5Yqg56u5KQ==?= X-Patchwork-Id: 157238 Return-Path: Delivered-To: ouuuleilei@gmail.com Received: by 2002:a59:ce89:0:b0:403:3b70:6f57 with SMTP id p9csp1699722vqx; Mon, 23 Oct 2023 20:51:35 -0700 (PDT) X-Google-Smtp-Source: AGHT+IFrsUSKdty1W7GD1xaSSQhFMXy/6Eomvgcj9O++oNnxeD495o3SWNUzU80rBc5TbEZSVhJl X-Received: by 2002:a05:6a21:3b46:b0:16b:79c2:7d6e with SMTP id zy6-20020a056a213b4600b0016b79c27d6emr1383116pzb.30.1698119495279; Mon, 23 Oct 2023 20:51:35 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1698119495; cv=none; d=google.com; s=arc-20160816; b=Pne9Stn34jhst1vuFJjDYgGfkhTiX9rcSIGkMY6Xy379QRnowUCAUmUhX+1Jdv2Ml/ e+vBeQnxVBaDL0+QcGVhr+wrfteaNsmMaPBGzxku7LipAerukMyKPIUoareY2e1tF1Wt QmLLYOTS3BoKpTPc0GSmmy3D0BIEYSyQca6fxTeCixBqTJifKZK/pEPkVCXrPXLkKLPa tTF+NTf8mNQhb0Bxsez3e1blAi3l589D9KOEMpUkrmXXNd+USe2Co+RtLgpERod/Q2dX b3SJhUay1zbW8bOFtLWH7MQlm9nCoZUzkLW77KzNoRCrE5k9gbJZ+iC7EZ7Nbg+jJu30 wAoA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:mime-version:references:in-reply-to:message-id :date:subject:cc:to:from:dkim-signature; bh=QfVVtZBb9l5MkYex/BrRtzyJ2IeY7PLkE34QeN8pkSQ=; fh=JK4CFQ8GWUIPGXLDWWc8KlajGC5ELjySWqtosj4q5Ec=; b=FypQCXz6R9gnaGWF7XLH8NzYyiPXNuEUMpykEWCxJyxCio/ym8Bt7L2dyBd6rj0aYW G3OBj6qRXrPAMFasNi4fVlYrQr+PHbQRy04OxV4E4jcMhhjA4fAFJGGIK9eLY9sbCkBN XXaBL7P9Euue/U/3DwNXzmrSzuTUE0E4pHTulND/HzPJEMPqLAo3vXVzQMRjN2c0M+xE jhvbshKpSeajV0QtnHiZyvEeMv5lhPMZBSLHvBd7zbvmPJ2RBnrfsWbgqwPv4ZhETLR8 hP5EUTxHl/JQzxzziTKDLJ5yVcZHBYWVefZ6SYneNINLVs2+UIXqtytQ1D8fpSxPrp9T jNuw== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@mediatek.com header.s=dk header.b=e1HhZCOP; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.38 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=QUARANTINE sp=QUARANTINE dis=NONE) header.from=mediatek.com Received: from fry.vger.email (fry.vger.email. [23.128.96.38]) by mx.google.com with ESMTPS id e4-20020a170902d38400b001c724f99800si7416005pld.44.2023.10.23.20.51.35 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Mon, 23 Oct 2023 20:51:35 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.38 as permitted sender) client-ip=23.128.96.38; Authentication-Results: mx.google.com; dkim=pass header.i=@mediatek.com header.s=dk header.b=e1HhZCOP; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.38 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=QUARANTINE sp=QUARANTINE dis=NONE) header.from=mediatek.com Received: from out1.vger.email (depot.vger.email [IPv6:2620:137:e000::3:0]) by fry.vger.email (Postfix) with ESMTP id 4760280A9A98; Mon, 23 Oct 2023 20:51:33 -0700 (PDT) X-Virus-Status: Clean X-Virus-Scanned: clamav-milter 0.103.10 at fry.vger.email Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S232258AbjJXDvH (ORCPT + 27 others); Mon, 23 Oct 2023 23:51:07 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:35084 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S232111AbjJXDu4 (ORCPT ); Mon, 23 Oct 2023 23:50:56 -0400 Received: from mailgw02.mediatek.com (unknown [210.61.82.184]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id C3432111 for ; Mon, 23 Oct 2023 20:50:51 -0700 (PDT) X-UUID: 834a1522722011ee8051498923ad61e6-20231024 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=QfVVtZBb9l5MkYex/BrRtzyJ2IeY7PLkE34QeN8pkSQ=; b=e1HhZCOPG2VBJGY1NG3BVi4+f/XIDerEVOlus5kHYJw3afd5UTMkjk6gz+UmjnpJOqtCCIMH6TRr/KvMSlSQHSYMA3zVFTPMGDwMOlWTyaHPQSLfpTKX8AF/Y2JsO9meenhBi2hwBRE3ik884FbneCWeCdIDk48geQ00uq0iwfQ=; X-CID-P-RULE: Release_Ham X-CID-O-INFO: VERSION:1.1.32,REQID:6ecd9648-9318-448e-95bf-75ea406d78ff,IP:0,U RL:0,TC:0,Content:-5,EDM:0,RT:0,SF:0,FILE:0,BULK:0,RULE:Release_Ham,ACTION :release,TS:-5 X-CID-META: VersionHash:5f78ec9,CLOUDID:94a58d94-10ce-4e4b-85c2-c9b5229ff92b,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,LES:1,SPR:NO, DKR:0,DKP:0,BRR:0,BRE:0 X-CID-BVR: 0,NGT X-CID-BAS: 0,NGT,0,_ X-CID-FACTOR: TF_CID_SPAM_SNR X-UUID: 834a1522722011ee8051498923ad61e6-20231024 Received: from mtkmbs11n2.mediatek.inc [(172.21.101.187)] by mailgw02.mediatek.com (envelope-from ) (Generic MTA with TLSv1.2 ECDHE-RSA-AES256-GCM-SHA384 256/256) with ESMTP id 977540919; Tue, 24 Oct 2023 11:50:46 +0800 Received: from mtkmbs11n2.mediatek.inc (172.21.101.187) by mtkmbs11n2.mediatek.inc (172.21.101.187) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.2.1118.26; Tue, 24 Oct 2023 11:50:45 +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.26 via Frontend Transport; Tue, 24 Oct 2023 11:50:45 +0800 From: Maso Huang To: Liam Girdwood , Mark Brown , Matthias Brugger , AngeloGioacchino Del Regno , Jaroslav Kysela , Takashi Iwai , , , , CC: Maso Huang Subject: [PATCH v2 1/3] ASoC: mediatek: mt7986: drop the remove callback of mt7986_wm8960 Date: Tue, 24 Oct 2023 11:50:17 +0800 Message-ID: <20231024035019.11732-2-maso.huang@mediatek.com> X-Mailer: git-send-email 2.18.0 In-Reply-To: <20231024035019.11732-1-maso.huang@mediatek.com> References: <20231024035019.11732-1-maso.huang@mediatek.com> MIME-Version: 1.0 X-Spam-Status: No, score=-0.8 required=5.0 tests=DKIM_SIGNED,DKIM_VALID, DKIM_VALID_AU,HEADER_FROM_DIFFERENT_DOMAINS,MAILING_LIST_MULTI, SPF_HELO_NONE,SPF_PASS,UNPARSEABLE_RELAY autolearn=unavailable autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on fry.vger.email Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org X-Greylist: Sender passed SPF test, not delayed by milter-greylist-4.6.4 (fry.vger.email [0.0.0.0]); Mon, 23 Oct 2023 20:51:33 -0700 (PDT) X-getmail-retrieved-from-mailbox: INBOX X-GMAIL-THRID: 1780607348165581397 X-GMAIL-MSGID: 1780607348165581397 Drop the remove callback of mt7986_wm8960. Signed-off-by: Maso Huang Reviewed-by: AngeloGioacchino Del Regno --- sound/soc/mediatek/mt7986/mt7986-wm8960.c | 10 ---------- 1 file changed, 10 deletions(-) diff --git a/sound/soc/mediatek/mt7986/mt7986-wm8960.c b/sound/soc/mediatek/mt7986/mt7986-wm8960.c index 364d13b1c426..f6b9794b7229 100644 --- a/sound/soc/mediatek/mt7986/mt7986-wm8960.c +++ b/sound/soc/mediatek/mt7986/mt7986-wm8960.c @@ -163,15 +163,6 @@ static int mt7986_wm8960_machine_probe(struct platform_device *pdev) return ret; } -static void mt7986_wm8960_machine_remove(struct platform_device *pdev) -{ - struct snd_soc_card *card = platform_get_drvdata(pdev); - struct mt7986_wm8960_priv *priv = snd_soc_card_get_drvdata(card); - - of_node_put(priv->codec_node); - of_node_put(priv->platform_node); -} - static const struct of_device_id mt7986_wm8960_machine_dt_match[] = { {.compatible = "mediatek,mt7986-wm8960-sound"}, { /* sentinel */ } @@ -184,7 +175,6 @@ static struct platform_driver mt7986_wm8960_machine = { .of_match_table = mt7986_wm8960_machine_dt_match, }, .probe = mt7986_wm8960_machine_probe, - .remove_new = mt7986_wm8960_machine_remove, }; module_platform_driver(mt7986_wm8960_machine); From patchwork Tue Oct 24 03:50:18 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: =?utf-8?b?TWFzbyBIdWFuZyAo6buD5Yqg56u5KQ==?= X-Patchwork-Id: 157236 Return-Path: Delivered-To: ouuuleilei@gmail.com Received: by 2002:a59:ce89:0:b0:403:3b70:6f57 with SMTP id p9csp1699649vqx; Mon, 23 Oct 2023 20:51:20 -0700 (PDT) X-Google-Smtp-Source: AGHT+IFlqcazg6+DiraYNt9BSjiE2tYDt05QsNKAtVczAEz5zM0EgGlyuWNLk5IALCfVCB6MpNzP X-Received: by 2002:a05:6a20:918b:b0:152:4615:cb9d with SMTP id v11-20020a056a20918b00b001524615cb9dmr2005775pzd.12.1698119479855; Mon, 23 Oct 2023 20:51:19 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1698119479; cv=none; d=google.com; s=arc-20160816; b=S+OAjoZ9P7XTtvUylDbYXeogkcO9rni+MQajuOoWVj2xyJXIFqYlmlIOh9xxQvZIj7 Z2Q2B3x5nGUKW8pztUIgnto7iz27RbExdg7QKW0JvOuSTrTju8Dv7bkyLZRywStSPr9N QvrQITkuXwZx2yo57kIJDZRDHh5aJFkuPByMLXtsZfpk4LLd/trMAeJ7rHTpPvi9PmYv knsy5nJzHh/BTuHqMwItiV8uhM+7DnFHMhFrncM4Wq8D/DeMdilF9Utl7JOebLhE1r2D ylYura5amikZHr/crJwnFJX0MI0scvsx6/8U4aY6RAuwR7cEzHu3MkE5Ci44QQOQ+GYn 65sA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:mime-version:references:in-reply-to:message-id :date:subject:cc:to:from:dkim-signature; bh=7BreaDgCH7mRp5CSo98g29nYk3nW8Yu1AIFy53p6Y/I=; fh=JK4CFQ8GWUIPGXLDWWc8KlajGC5ELjySWqtosj4q5Ec=; b=s5GhJ/iduDWRMW8fjRNrey5M0Vzww9cVPYnGnPlKYK3NkjGiqgWSerfQEW6lirAzEr syyC3D3HtLlJLQzBJOsyTEIFuHoE3GEOReemEJGWspHCWUwvBBfnIwdGW5wAEXfy/mD4 z73JGDgkVAS9XAM/0DnrPyX0E6LkAyVMRnT70l9nhI/3vyHPwBBgJGINstFX4IE+oC1l 71aEsOVFqbDzR4svm5WX+b/7MCGhfQiz452erDngyiYwXo+5OMEoSJaTwQF5Z7QaDV0x zErKLS36cPAz7RMqV9RgJlbJGiKM6El5uhdipt37M5D3gXI81YhCMe7SPlUVMWGwkqUU z3uQ== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@mediatek.com header.s=dk header.b="CJXfn8d/"; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::3:1 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=QUARANTINE sp=QUARANTINE dis=NONE) header.from=mediatek.com Received: from morse.vger.email (morse.vger.email. [2620:137:e000::3:1]) by mx.google.com with ESMTPS id p23-20020a639517000000b005b43f17562fsi7588263pgd.266.2023.10.23.20.51.19 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Mon, 23 Oct 2023 20:51:19 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::3:1 as permitted sender) client-ip=2620:137:e000::3:1; Authentication-Results: mx.google.com; dkim=pass header.i=@mediatek.com header.s=dk header.b="CJXfn8d/"; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::3:1 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=QUARANTINE sp=QUARANTINE dis=NONE) header.from=mediatek.com Received: from out1.vger.email (depot.vger.email [IPv6:2620:137:e000::3:0]) by morse.vger.email (Postfix) with ESMTP id A7EAF80ABFF7; Mon, 23 Oct 2023 20:51:16 -0700 (PDT) X-Virus-Status: Clean X-Virus-Scanned: clamav-milter 0.103.10 at morse.vger.email Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S232099AbjJXDvC (ORCPT + 27 others); Mon, 23 Oct 2023 23:51:02 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:38986 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S232058AbjJXDu5 (ORCPT ); Mon, 23 Oct 2023 23:50:57 -0400 Received: from mailgw02.mediatek.com (unknown [210.61.82.184]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id B886E10C9 for ; Mon, 23 Oct 2023 20:50:54 -0700 (PDT) X-UUID: 85b63340722011ee8051498923ad61e6-20231024 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=7BreaDgCH7mRp5CSo98g29nYk3nW8Yu1AIFy53p6Y/I=; b=CJXfn8d/wyUDfFeGKn9UG1PQazyiexpxAbXW8E17y95LARaiPHHM6GuDZRb9sIfXKfG3PuFOZpV+ijayl1GzZiOpnxyhGHOoiCiMCO7JVYJhVce2m7y5fsqeiIAuQr3jX/Rg31/nSDp0oVNemIlh16z9A3MGlnaqazGlPHOwEio=; X-CID-P-RULE: Release_Ham X-CID-O-INFO: VERSION:1.1.32,REQID:e8b26b00-aa94-4de8-8fd4-eb0983131630,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:5f78ec9,CLOUDID:b7a58d94-10ce-4e4b-85c2-c9b5229ff92b,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,LES:1,SPR:NO, DKR:0,DKP:0,BRR:0,BRE:0 X-CID-BVR: 0,NGT X-CID-BAS: 0,NGT,0,_ X-CID-FACTOR: TF_CID_SPAM_SNR X-UUID: 85b63340722011ee8051498923ad61e6-20231024 Received: from mtkmbs11n2.mediatek.inc [(172.21.101.187)] by mailgw02.mediatek.com (envelope-from ) (Generic MTA with TLSv1.2 ECDHE-RSA-AES256-GCM-SHA384 256/256) with ESMTP id 1306072661; Tue, 24 Oct 2023 11:50:50 +0800 Received: from mtkmbs11n2.mediatek.inc (172.21.101.187) by mtkmbs10n2.mediatek.inc (172.21.101.183) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.2.1118.26; Tue, 24 Oct 2023 11:50:48 +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.26 via Frontend Transport; Tue, 24 Oct 2023 11:50:48 +0800 From: Maso Huang To: Liam Girdwood , Mark Brown , Matthias Brugger , AngeloGioacchino Del Regno , Jaroslav Kysela , Takashi Iwai , , , , CC: Maso Huang Subject: [PATCH v2 2/3] ASoC: mediatek: mt7986: remove the mt7986_wm8960_priv structure Date: Tue, 24 Oct 2023 11:50:18 +0800 Message-ID: <20231024035019.11732-3-maso.huang@mediatek.com> X-Mailer: git-send-email 2.18.0 In-Reply-To: <20231024035019.11732-1-maso.huang@mediatek.com> References: <20231024035019.11732-1-maso.huang@mediatek.com> MIME-Version: 1.0 X-TM-AS-Product-Ver: SMEX-14.0.0.3152-9.1.1006-23728.005 X-TM-AS-Result: No-10--2.396400-8.000000 X-TMASE-MatchedRID: fmS20tPE9ksZ9uxgtDtJQgPZZctd3P4BCt59Uh3p/NUKogmGusPLb7uA YZFvH/IiJ7vDzKaAUziGwpg7pPpeGdEdmUPXI8FxRnmgWPGIUuN9LQinZ4QefPcjNeVeWlqY+gt Hj7OwNO34ZhR52Rc1agOckpztc5q9DTKwjifCv/JaBY1H+rGnJmceWHNlxh0NYxCRwJSgalga8k 2hFPMqR5nyvuWwh3WTLDv877bId1VPpulV5YAHJ0ma3zYT97IFAYfQIAUhBayZvmCbKVb49sZL6 x5U/HridGByp+zdaDg= X-TM-AS-User-Approved-Sender: No X-TM-AS-User-Blocked-Sender: No X-TMASE-Result: 10--2.396400-8.000000 X-TMASE-Version: SMEX-14.0.0.3152-9.1.1006-23728.005 X-TM-SNTS-SMTP: F482FDE8C42D897BE79991F8C5C7B1E56E94812EDF60B7011729E2E99BD7179F2000:8 X-Spam-Status: No, score=-0.8 required=5.0 tests=DKIM_SIGNED,DKIM_VALID, DKIM_VALID_AU,HEADER_FROM_DIFFERENT_DOMAINS,MAILING_LIST_MULTI, SPF_HELO_NONE,SPF_PASS,UNPARSEABLE_RELAY autolearn=unavailable autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on morse.vger.email Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org X-Greylist: Sender passed SPF test, not delayed by milter-greylist-4.6.4 (morse.vger.email [0.0.0.0]); Mon, 23 Oct 2023 20:51:16 -0700 (PDT) X-getmail-retrieved-from-mailbox: INBOX X-GMAIL-THRID: 1780607331705235411 X-GMAIL-MSGID: 1780607331705235411 Remove the mt7986_wm8960_priv structure. Signed-off-by: Maso Huang Reviewed-by: AngeloGioacchino Del Regno --- sound/soc/mediatek/mt7986/mt7986-wm8960.c | 33 +++++++++-------------- 1 file changed, 12 insertions(+), 21 deletions(-) diff --git a/sound/soc/mediatek/mt7986/mt7986-wm8960.c b/sound/soc/mediatek/mt7986/mt7986-wm8960.c index f6b9794b7229..c1390b373410 100644 --- a/sound/soc/mediatek/mt7986/mt7986-wm8960.c +++ b/sound/soc/mediatek/mt7986/mt7986-wm8960.c @@ -12,11 +12,6 @@ #include "mt7986-afe-common.h" -struct mt7986_wm8960_priv { - struct device_node *platform_node; - struct device_node *codec_node; -}; - static const struct snd_soc_dapm_widget mt7986_wm8960_widgets[] = { SND_SOC_DAPM_HP("Headphone", NULL), SND_SOC_DAPM_MIC("AMIC", NULL), @@ -92,20 +87,18 @@ static int mt7986_wm8960_machine_probe(struct platform_device *pdev) struct snd_soc_card *card = &mt7986_wm8960_card; struct snd_soc_dai_link *dai_link; struct device_node *platform, *codec; - struct mt7986_wm8960_priv *priv; + struct device_node *platform_dai_node, *codec_dai_node; int ret, i; - priv = devm_kzalloc(&pdev->dev, sizeof(*priv), GFP_KERNEL); - if (!priv) - return -ENOMEM; + card->dev = &pdev->dev; platform = of_get_child_by_name(pdev->dev.of_node, "platform"); if (platform) { - priv->platform_node = of_parse_phandle(platform, "sound-dai", 0); + platform_dai_node = of_parse_phandle(platform, "sound-dai", 0); of_node_put(platform); - if (!priv->platform_node) { + if (!platform_dai_node) { dev_err(&pdev->dev, "Failed to parse platform/sound-dai property\n"); return -EINVAL; } @@ -117,24 +110,22 @@ static int mt7986_wm8960_machine_probe(struct platform_device *pdev) for_each_card_prelinks(card, i, dai_link) { if (dai_link->platforms->name) continue; - dai_link->platforms->of_node = priv->platform_node; + dai_link->platforms->of_node = platform_dai_node; } - card->dev = &pdev->dev; - codec = of_get_child_by_name(pdev->dev.of_node, "codec"); if (codec) { - priv->codec_node = of_parse_phandle(codec, "sound-dai", 0); + codec_dai_node = of_parse_phandle(codec, "sound-dai", 0); of_node_put(codec); - if (!priv->codec_node) { - of_node_put(priv->platform_node); + if (!codec_dai_node) { + of_node_put(platform_dai_node); dev_err(&pdev->dev, "Failed to parse codec/sound-dai property\n"); return -EINVAL; } } else { - of_node_put(priv->platform_node); + of_node_put(platform_dai_node); dev_err(&pdev->dev, "Property 'codec' missing or invalid\n"); return -EINVAL; } @@ -142,7 +133,7 @@ static int mt7986_wm8960_machine_probe(struct platform_device *pdev) for_each_card_prelinks(card, i, dai_link) { if (dai_link->codecs->name) continue; - dai_link->codecs->of_node = priv->codec_node; + dai_link->codecs->of_node = codec_dai_node; } ret = snd_soc_of_parse_audio_routing(card, "audio-routing"); @@ -158,8 +149,8 @@ static int mt7986_wm8960_machine_probe(struct platform_device *pdev) } err_of_node_put: - of_node_put(priv->codec_node); - of_node_put(priv->platform_node); + of_node_put(platform_dai_node); + of_node_put(codec_dai_node); return ret; } From patchwork Tue Oct 24 03:50:19 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: =?utf-8?b?TWFzbyBIdWFuZyAo6buD5Yqg56u5KQ==?= X-Patchwork-Id: 157237 Return-Path: Delivered-To: ouuuleilei@gmail.com Received: by 2002:a59:ce89:0:b0:403:3b70:6f57 with SMTP id p9csp1699670vqx; Mon, 23 Oct 2023 20:51:25 -0700 (PDT) X-Google-Smtp-Source: AGHT+IE16gQ916+1HjEZeCIz5Ia5Y8q8PdrZKVqwNYdiNrfnSK3/nupZvtzaYN9L31uncKeMHvcC X-Received: by 2002:a17:902:e414:b0:1b8:94e9:e7cb with SMTP id m20-20020a170902e41400b001b894e9e7cbmr6471797ple.21.1698119485546; Mon, 23 Oct 2023 20:51:25 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1698119485; cv=none; d=google.com; s=arc-20160816; b=LfTIv6DS63I08cNY7LpOAvw2YprFijbeWt8IpsIxcsnFc9+fqDk4EAd82glMA4MsVJ ou+RR4Ozdy7rJWaALLENcjtL9MhO5BHVsoQ+fLz1HdXmTqEwpFyu4Pq3x9JqXfrgCLT3 rrJidqizDQVCsyDOz6h2gjh1C8OvQ0bS9YVUQ/Mv2O1l5iQ3xE6kZBq2Ewb7rFDipzWu Kdn/BZqoM3qcLbFMxUFQF56albuQv7TudUVM2dv42I5aA3nszJJKHBjvaXLaH2oKyZjP iY/QInSo+GlLADYj55fuitMXUA382al+76RoVFKXVtNS/FlhKJbE/xX4PTgnab/X5+zw axyg== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:mime-version:references:in-reply-to:message-id :date:subject:cc:to:from:dkim-signature; bh=Hzi+kjq1QCG+TxJwfKjMZ8NZ7VLcxkHOjhgyuRv3grs=; fh=JK4CFQ8GWUIPGXLDWWc8KlajGC5ELjySWqtosj4q5Ec=; b=hwNBK2g0WR6oF3j0HpoksO+YvC9rRWmHFffhVHhen2aMb9Em9CsB4m7ukO1ka1b1Zn m/WsyUlUdiSzjIORSDRSxio8iBGigcK17F0ooMMw+wtuuOJ+rIdpMLo5X3mkQQvr04dZ kmEohIWQjo4+JHCeOkP7PAl7GBnizixVz7/V6uFZlA5kka5XojriEnJGpl4DP3U2IAjj Jr6EPGj/KjA9fXtfAHkHZca5jb0jvbaabnnk3IEdGsS1RwvaVCAGu07YLF/1Wt/uqVv8 WtdRBsXKBAPE6g3whJ3EZ3cEWsK74rt+wQ3NBVhxIaW3WPR6ThU4WT54nI4GsE04DNlN hwyQ== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@mediatek.com header.s=dk header.b=ZAtbjqhL; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.31 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=QUARANTINE sp=QUARANTINE dis=NONE) header.from=mediatek.com Received: from morse.vger.email (morse.vger.email. [23.128.96.31]) by mx.google.com with ESMTPS id jm17-20020a17090304d100b001c0c4be62basi7491646plb.617.2023.10.23.20.51.25 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Mon, 23 Oct 2023 20:51:25 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.31 as permitted sender) client-ip=23.128.96.31; Authentication-Results: mx.google.com; dkim=pass header.i=@mediatek.com header.s=dk header.b=ZAtbjqhL; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.31 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=QUARANTINE sp=QUARANTINE dis=NONE) header.from=mediatek.com Received: from out1.vger.email (depot.vger.email [IPv6:2620:137:e000::3:0]) by morse.vger.email (Postfix) with ESMTP id 5FB438077910; Mon, 23 Oct 2023 20:51:23 -0700 (PDT) X-Virus-Status: Clean X-Virus-Scanned: clamav-milter 0.103.10 at morse.vger.email Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S231982AbjJXDvM (ORCPT + 27 others); Mon, 23 Oct 2023 23:51:12 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:38974 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S232082AbjJXDvB (ORCPT ); Mon, 23 Oct 2023 23:51:01 -0400 Received: from mailgw01.mediatek.com (unknown [60.244.123.138]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 6C747111 for ; Mon, 23 Oct 2023 20:50:59 -0700 (PDT) X-UUID: 86e65fba722011eea33bb35ae8d461a2-20231024 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=Hzi+kjq1QCG+TxJwfKjMZ8NZ7VLcxkHOjhgyuRv3grs=; b=ZAtbjqhLEC3Phj/sfE1wRmh7bYNDNxDQDQabtBKbODJfpmQkSqAbe7YLSOCz1/2tStXGtxgmFew7lArJYnNG1eS+NZIp6Mo44oeKdiQbZ4B+tDg8l+qplYQ0Nq8kurcegbjaYAr1x/n70y7HMAH7gzidwsF4mRHVsZup+q1xYZU=; X-CID-P-RULE: Release_Ham X-CID-O-INFO: VERSION:1.1.32,REQID:24b6c52f-7136-465e-bf3f-a467d2bd27cb,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:5f78ec9,CLOUDID:c4153dd7-04a0-4e50-8742-3543eab8cb8e,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,LES:1,SPR:NO, DKR:0,DKP:0,BRR:0,BRE:0 X-CID-BVR: 0 X-CID-BAS: 0,_,0,_ X-CID-FACTOR: TF_CID_SPAM_SNR X-UUID: 86e65fba722011eea33bb35ae8d461a2-20231024 Received: from mtkmbs10n1.mediatek.inc [(172.21.101.34)] by mailgw01.mediatek.com (envelope-from ) (Generic MTA with TLSv1.2 ECDHE-RSA-AES256-GCM-SHA384 256/256) with ESMTP id 1219510997; Tue, 24 Oct 2023 11:50:52 +0800 Received: from mtkmbs11n2.mediatek.inc (172.21.101.187) by mtkmbs10n2.mediatek.inc (172.21.101.183) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.2.1118.26; Tue, 24 Oct 2023 11:50:50 +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.26 via Frontend Transport; Tue, 24 Oct 2023 11:50:50 +0800 From: Maso Huang To: Liam Girdwood , Mark Brown , Matthias Brugger , AngeloGioacchino Del Regno , Jaroslav Kysela , Takashi Iwai , , , , CC: Maso Huang Subject: [PATCH v2 3/3] ASoC: mediatek: mt7986: add sample rate checker Date: Tue, 24 Oct 2023 11:50:19 +0800 Message-ID: <20231024035019.11732-4-maso.huang@mediatek.com> X-Mailer: git-send-email 2.18.0 In-Reply-To: <20231024035019.11732-1-maso.huang@mediatek.com> References: <20231024035019.11732-1-maso.huang@mediatek.com> MIME-Version: 1.0 X-TM-AS-Product-Ver: SMEX-14.0.0.3152-9.1.1006-23728.005 X-TM-AS-Result: No-10--0.254500-8.000000 X-TMASE-MatchedRID: WkwGkWg/ZspKHSI+NapVgED6z8N1m1ALjZfFaL+4qfbfUZT83lbkEEFN G6vV64NpO3riJykx75rW3uke8Pv2jOF/B1jEjV+6syw+ZJnFumSO7tU+Bv65zZsoi2XrUn/Jn6K dMrRsL14qtq5d3cxkNRqXnrxrKCOXCZj5fT4j8U275XnfFOTeSbM3sLfmvJJnL8byqNXfKSxrcR mc7SDNwoCTKY6V6aLxs+jdM0RxJufk5os5jdQqLeFh/bIV6nmTF0aD5ljt43pMcHZD6gqu7wxMj fifIXfowkvVoA11Twp+3BndfXUhXQ== X-TM-AS-User-Approved-Sender: No X-TM-AS-User-Blocked-Sender: No X-TMASE-Result: 10--0.254500-8.000000 X-TMASE-Version: SMEX-14.0.0.3152-9.1.1006-23728.005 X-TM-SNTS-SMTP: D6FCDEDC649C83FF83C52FDACE0A28DEEB531C3639EE048AE42732BB07E90FCF2000:8 X-Spam-Status: No, score=-0.8 required=5.0 tests=DKIM_SIGNED,DKIM_VALID, DKIM_VALID_AU,HEADER_FROM_DIFFERENT_DOMAINS,MAILING_LIST_MULTI, SPF_HELO_NONE,SPF_PASS,UNPARSEABLE_RELAY autolearn=unavailable autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on morse.vger.email Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org X-Greylist: Sender passed SPF test, not delayed by milter-greylist-4.6.4 (morse.vger.email [0.0.0.0]); Mon, 23 Oct 2023 20:51:23 -0700 (PDT) X-getmail-retrieved-from-mailbox: INBOX X-GMAIL-THRID: 1780607337907982094 X-GMAIL-MSGID: 1780607337907982094 mt7986 only supports 8/12/16/24/32/48/96/192 kHz Signed-off-by: Maso Huang Reviewed-by: AngeloGioacchino Del Regno --- sound/soc/mediatek/mt7986/mt7986-dai-etdm.c | 23 +++++++++++++++++---- 1 file changed, 19 insertions(+), 4 deletions(-) diff --git a/sound/soc/mediatek/mt7986/mt7986-dai-etdm.c b/sound/soc/mediatek/mt7986/mt7986-dai-etdm.c index e523d33846fe..d57971413a04 100644 --- a/sound/soc/mediatek/mt7986/mt7986-dai-etdm.c +++ b/sound/soc/mediatek/mt7986/mt7986-dai-etdm.c @@ -237,12 +237,27 @@ static int mtk_dai_etdm_hw_params(struct snd_pcm_substream *substream, struct snd_pcm_hw_params *params, struct snd_soc_dai *dai) { + unsigned int rate = params_rate(params); struct mtk_base_afe *afe = snd_soc_dai_get_drvdata(dai); - mtk_dai_etdm_config(afe, params, dai, SNDRV_PCM_STREAM_PLAYBACK); - mtk_dai_etdm_config(afe, params, dai, SNDRV_PCM_STREAM_CAPTURE); - - return 0; + switch (rate) { + case 8000: + case 12000: + case 16000: + case 24000: + case 32000: + case 48000: + case 96000: + case 192000: + mtk_dai_etdm_config(afe, params, dai, SNDRV_PCM_STREAM_PLAYBACK); + mtk_dai_etdm_config(afe, params, dai, SNDRV_PCM_STREAM_CAPTURE); + return 0; + default: + dev_err(afe->dev, + "Sample rate %d invalid. Supported rates: 8/12/16/24/32/48/96/192 kHz\n", + rate); + return -EINVAL; + } } static int mtk_dai_etdm_trigger(struct snd_pcm_substream *substream, int cmd,