From nobody Thu Dec 18 08:39:19 2025 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 vger.kernel.org (vger.kernel.org [23.128.96.18]) by smtp.lore.kernel.org (Postfix) with ESMTP id CE5C3C77B60 for ; Wed, 26 Apr 2023 05:52:41 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S239491AbjDZFwk (ORCPT ); Wed, 26 Apr 2023 01:52:40 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:58864 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S239485AbjDZFwc (ORCPT ); Wed, 26 Apr 2023 01:52:32 -0400 Received: from mailgw02.mediatek.com (unknown [210.61.82.184]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 90D053A9B; Tue, 25 Apr 2023 22:52:04 -0700 (PDT) X-UUID: 6235f4eae3f611edb6b9f13eb10bd0fe-20230426 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=iQxj2f8v6Hq2mM43K9p34deiZ+cOeCScETZMUSLPaL4=; b=kiIuCLckKOtluUlWv9w4O4pYIjgeulrzYmF4cPXRtyUKiaVwDFA8cgGFg8PQa6Ar6YgUEScvWvV1/5QaNCZtCElkmeBfrb56GJoKOZo5/GXDyXdgH9voY9v93e3kdQfcy5FP5QTSikif4aDrFCAi7hb41++RjJ8+4EM67saR1J8=; X-CID-P-RULE: Release_Ham X-CID-O-INFO: VERSION:1.1.22,REQID:1d5a1158-31ac-4a8f-b758-8bc7bd345983,IP:0,U RL:0,TC:0,Content:-25,EDM:0,RT:0,SF:95,FILE:0,BULK:0,RULE:Release_Ham,ACTI ON:release,TS:70 X-CID-INFO: VERSION:1.1.22,REQID:1d5a1158-31ac-4a8f-b758-8bc7bd345983,IP:0,URL :0,TC:0,Content:-25,EDM:0,RT:0,SF:95,FILE:0,BULK:0,RULE:Spam_GS981B3D,ACTI ON:quarantine,TS:70 X-CID-META: VersionHash:120426c,CLOUDID:5c472dec-db6f-41fe-8b83-13fe7ed1ef52,B ulkID:230426135128WJPHPIVF,BulkQuantity:0,Recheck:0,SF:38|29|28|17|19|48,T C:nil,Content:0,EDM:-3,IP:nil,URL:0,File:nil,Bulk:nil,QS:nil,BEC:nil,COL:0 ,OSI:0,OSA:0,AV:0 X-CID-BVR: 0,NGT X-CID-BAS: 0,NGT,0,_ X-UUID: 6235f4eae3f611edb6b9f13eb10bd0fe-20230426 Received: from mtkmbs10n1.mediatek.inc [(172.21.101.34)] by mailgw02.mediatek.com (envelope-from ) (Generic MTA with TLSv1.2 ECDHE-RSA-AES256-GCM-SHA384 256/256) with ESMTP id 792603456; Wed, 26 Apr 2023 13:51:26 +0800 Received: from mtkmbs11n1.mediatek.inc (172.21.101.185) 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.26; Wed, 26 Apr 2023 13:51:26 +0800 Received: from mtksdccf07.mediatek.inc (172.21.84.99) by mtkmbs11n1.mediatek.inc (172.21.101.73) with Microsoft SMTP Server id 15.2.1118.25 via Frontend Transport; Wed, 26 Apr 2023 13:51:26 +0800 From: Trevor Wu To: , , , , , , , CC: , , , , , Subject: [PATCH v3 5/7] ASoC: mediatek: mt8188: combine afe component registration Date: Wed, 26 Apr 2023 13:51:22 +0800 Message-ID: <20230426055124.16529-6-trevor.wu@mediatek.com> X-Mailer: git-send-email 2.18.0 In-Reply-To: <20230426055124.16529-1-trevor.wu@mediatek.com> References: <20230426055124.16529-1-trevor.wu@mediatek.com> MIME-Version: 1.0 X-MTK: N Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Content-Transfer-Encoding: quoted-printable Content-Type: text/plain; charset="utf-8" There is no benefit to separate two components for AFE, so DAI driver registration is moved to dev_snd_soc_register_component to merge these two components. Signed-off-by: Trevor Wu --- sound/soc/mediatek/mt8188/mt8188-afe-pcm.c | 37 ++-------------------- 1 file changed, 2 insertions(+), 35 deletions(-) diff --git a/sound/soc/mediatek/mt8188/mt8188-afe-pcm.c b/sound/soc/mediate= k/mt8188/mt8188-afe-pcm.c index e5f9373bed56..fecc891f892d 100644 --- a/sound/soc/mediatek/mt8188/mt8188-afe-pcm.c +++ b/sound/soc/mediatek/mt8188/mt8188-afe-pcm.c @@ -1898,10 +1898,6 @@ static const struct snd_kcontrol_new mt8188_memif_co= ntrols[] =3D { MT8188_AFE_MEMIF_UL10), }; =20 -static const struct snd_soc_component_driver mt8188_afe_pcm_dai_component = =3D { - .name =3D "mt8188-afe-pcm-dai", -}; - static const struct mtk_base_memif_data memif_data[MT8188_AFE_MEMIF_NUM] = =3D { [MT8188_AFE_MEMIF_DL2] =3D { .name =3D "DL2", @@ -3142,9 +3138,8 @@ static int mt8188_afe_pcm_dev_probe(struct platform_d= evice *pdev) struct mtk_base_afe *afe; struct mt8188_afe_private *afe_priv; struct device *dev; - int i, irq_id, ret; - struct snd_soc_component *component; struct reset_control *rstc; + int i, irq_id, ret; =20 ret =3D dma_set_mask_and_coherent(&pdev->dev, DMA_BIT_MASK(33)); if (ret) @@ -3280,34 +3275,12 @@ static int mt8188_afe_pcm_dev_probe(struct platform= _device *pdev) =20 /* register component */ ret =3D devm_snd_soc_register_component(dev, &mt8188_afe_component, - NULL, 0); + afe->dai_drivers, afe->num_dai_drivers); if (ret) { dev_warn(dev, "err_platform\n"); goto err_pm_put; } =20 - component =3D devm_kzalloc(&pdev->dev, sizeof(*component), GFP_KERNEL); - if (!component) { - ret =3D -ENOMEM; - goto err_pm_put; - } - - ret =3D snd_soc_component_initialize(component, - &mt8188_afe_pcm_dai_component, - &pdev->dev); - if (ret) - goto err_pm_put; -#ifdef CONFIG_DEBUG_FS - component->debugfs_prefix =3D "pcm"; -#endif - ret =3D snd_soc_add_component(component, - afe->dai_drivers, - afe->num_dai_drivers); - if (ret) { - dev_warn(dev, "err_add_component\n"); - goto err_pm_put; - } - mt8188_afe_init_registers(afe); =20 pm_runtime_put_sync(&pdev->dev); @@ -3323,11 +3296,6 @@ static int mt8188_afe_pcm_dev_probe(struct platform_= device *pdev) return ret; } =20 -static void mt8188_afe_pcm_dev_remove(struct platform_device *pdev) -{ - snd_soc_unregister_component(&pdev->dev); -} - static const struct of_device_id mt8188_afe_pcm_dt_match[] =3D { { .compatible =3D "mediatek,mt8188-afe", }, {}, @@ -3346,7 +3314,6 @@ static struct platform_driver mt8188_afe_pcm_driver = =3D { .pm =3D &mt8188_afe_pm_ops, }, .probe =3D mt8188_afe_pcm_dev_probe, - .remove_new =3D mt8188_afe_pcm_dev_remove, }; =20 module_platform_driver(mt8188_afe_pcm_driver); --=20 2.18.0