Received: by 2002:a05:6358:3188:b0:123:57c1:9b43 with SMTP id q8csp37951704rwd; Wed, 12 Jul 2023 00:29:46 -0700 (PDT) X-Google-Smtp-Source: APBJJlFb32S8knO8hQKPNa0iTOJ6Z3cCh1MzdSJovcwb1l/xnRs64bipzekYLPn2DbCyrpdWhCcr X-Received: by 2002:a05:620a:17a2:b0:767:30a5:4cad with SMTP id ay34-20020a05620a17a200b0076730a54cadmr20593092qkb.27.1689146986399; Wed, 12 Jul 2023 00:29:46 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1689146986; cv=none; d=google.com; s=arc-20160816; b=sQc7iK1Aa3Y777TJLMTFv4d7RXQ9TSgYdJCgiGqM5r7/r/cKSbX+G5AJOiZY5sbluI YHLaMXDT6sGUI2Vy2Ofzpj/mazZPkhROL9Bc4SScy2jKkCEzXJ8CG/7W+3SQQQuTZQWt lQNDuSRka0vTZEXm1GCzon2XSKAvRcnp5iy4fVFVJfjYfDn+YQS4myDn3h5srl6Cc6S6 5kw/MMIfVffFs8VauW9CmSsptVM/qRDY/FosToPKlKIJrMQgWreXA/S1dIU4Xr/q3lhm AS4gqxjCmlIIyh8Z2m9dwkJImWj1mb0AcGuJTu//7luaLKvpWJn23A7NS8wPi87maHTf ZFcA== 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=Qi3pNvb+/UkgZQSIW/v9NFWhcRMbBNVFPD0l1h5cxDs=; fh=5e1wTiCyJULScphmgfXJOukODIMU612coI1S3/9yfPc=; b=BeLkpJzcnAyzkqvWdI6WnrZmNIHnncFFDRjw+PIigH52xD0HFk3h9bNvUcSY29mSdX E1G6CvhylBkH2AF8s6rQha+7MNF288jkjGvcOLbbgMeld2oiV2x/dn+ibAympHXt310T 1j8Hp2eEmzNrUqGUUgfY2yXFX8rZOlLXFsKMiqsyoAWbdQU8N+OUqk9iFuKD558DtZT7 +iatN1KJak+Q2bLQtuI/yFcJW9o+YCljYnFgK6ZTVM5/AzRW+1LtC+DLSBBjWzI7kkZd qcvxVigyUXaFPNNsvvI23oN7Y0/51BZText/kLz7ozVKp8taPCccUyyI0RKOp2AOYTfP qIoA== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@mediatek.com header.s=dk header.b=O3qMWxiQ; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=QUARANTINE sp=QUARANTINE dis=NONE) header.from=mediatek.com Return-Path: Received: from out1.vger.email (out1.vger.email. [2620:137:e000::1:20]) by mx.google.com with ESMTP id a64-20020a639043000000b00553c2f8509esi2617176pge.706.2023.07.12.00.29.33; Wed, 12 Jul 2023 00:29:46 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) client-ip=2620:137:e000::1:20; Authentication-Results: mx.google.com; dkim=pass header.i=@mediatek.com header.s=dk header.b=O3qMWxiQ; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=QUARANTINE sp=QUARANTINE dis=NONE) header.from=mediatek.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S232049AbjGLHIl (ORCPT + 99 others); Wed, 12 Jul 2023 03:08:41 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:51000 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S230241AbjGLHIh (ORCPT ); Wed, 12 Jul 2023 03:08:37 -0400 Received: from mailgw02.mediatek.com (unknown [210.61.82.184]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 45786E5F; Wed, 12 Jul 2023 00:08:31 -0700 (PDT) X-UUID: e44e9130208211eeb20a276fd37b9834-20230712 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=Qi3pNvb+/UkgZQSIW/v9NFWhcRMbBNVFPD0l1h5cxDs=; b=O3qMWxiQ+oPd0cQUVOYb7Gr4Z2+ckR3CAZz4rgpezxVb5Tbdj2JO/q2ggUXH9eKQX8KM4SiVA5DH04XhWtY+Dbi4sG2/6OsxZtt7YCMD/MsYXrTBlo4ACmYz43lVvM3kL8foqUVLojbNCsPc2QViePxq89f8DJE1lMn4ZSvk4dU=; X-CID-P-RULE: Release_Ham X-CID-O-INFO: VERSION:1.1.28,REQID:0da97254-6e61-450f-aca5-a856f2e0b676,IP:0,U RL:0,TC:0,Content:0,EDM:0,RT:0,SF:95,FILE:0,BULK:0,RULE:Release_Ham,ACTION :release,TS:95 X-CID-INFO: VERSION:1.1.28,REQID:0da97254-6e61-450f-aca5-a856f2e0b676,IP:0,URL :0,TC:0,Content:0,EDM:0,RT:0,SF:95,FILE:0,BULK:0,RULE:Spam_GS981B3D,ACTION :quarantine,TS:95 X-CID-META: VersionHash:176cd25,CLOUDID:0b24d80d-26a8-467f-b838-f99719a9c083,B ulkID:230712150825J3EIQWDX,BulkQuantity:1,Recheck:0,SF:38|29|28|17|19|48,T C:nil,Content:0,EDM:-3,IP:nil,URL:0,File:nil,Bulk:43,QS:nil,BEC:nil,COL:0, OSI:0,OSA:0,AV:0,LES:1,SPR:NO,DKR:0,DKP:0 X-CID-BVR: 0,NGT X-CID-BAS: 0,NGT,0,_ X-CID-FACTOR: TF_CID_SPAM_SDM,TF_CID_SPAM_ASC,TF_CID_SPAM_FAS,TF_CID_SPAM_FSD, TF_CID_SPAM_SNR X-UUID: e44e9130208211eeb20a276fd37b9834-20230712 Received: from mtkmbs14n1.mediatek.inc [(172.21.101.75)] by mailgw02.mediatek.com (envelope-from ) (Generic MTA with TLSv1.2 ECDHE-RSA-AES256-GCM-SHA384 256/256) with ESMTP id 1548716550; Wed, 12 Jul 2023 15:08:24 +0800 Received: from mtkmbs13n1.mediatek.inc (172.21.101.193) 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; Wed, 12 Jul 2023 15:08:23 +0800 Received: from mtksdccf07.mediatek.inc (172.21.84.99) by mtkmbs13n1.mediatek.inc (172.21.101.73) with Microsoft SMTP Server id 15.2.1118.26 via Frontend Transport; Wed, 12 Jul 2023 15:08:23 +0800 From: Trevor Wu To: , , , , , , , , CC: , , , , , Subject: [RESEND 1/2] ASoC: mediatek: mt8188: add memory-region support Date: Wed, 12 Jul 2023 15:08:20 +0800 Message-ID: <20230712070821.23971-2-trevor.wu@mediatek.com> X-Mailer: git-send-email 2.18.0 In-Reply-To: <20230712070821.23971-1-trevor.wu@mediatek.com> References: <20230712070821.23971-1-trevor.wu@mediatek.com> MIME-Version: 1.0 Content-Type: text/plain X-MTK: N X-Spam-Status: No, score=-2.1 required=5.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,RCVD_IN_DNSWL_BLOCKED, SPF_HELO_PASS,SPF_PASS,T_SCC_BODY_TEXT_LINE,UNPARSEABLE_RELAY, URIBL_BLOCKED autolearn=ham autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on lindbergh.monkeyblade.net Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org In certain projects, it is necessary to utilize the reserved memory region for audio dma. The patch takes into account the dts property 'memory-region', allowing for the specification of memory for afe memif through device tree. Signed-off-by: Trevor Wu --- sound/soc/mediatek/mt8188/mt8188-afe-pcm.c | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) diff --git a/sound/soc/mediatek/mt8188/mt8188-afe-pcm.c b/sound/soc/mediatek/mt8188/mt8188-afe-pcm.c index 6a24b339444b..5e14655c5617 100644 --- a/sound/soc/mediatek/mt8188/mt8188-afe-pcm.c +++ b/sound/soc/mediatek/mt8188/mt8188-afe-pcm.c @@ -16,6 +16,7 @@ #include #include #include +#include #include #include #include @@ -3193,11 +3194,15 @@ static int mt8188_afe_pcm_dev_probe(struct platform_device *pdev) { struct mtk_base_afe *afe; struct mt8188_afe_private *afe_priv; - struct device *dev; + struct device *dev = &pdev->dev; struct reset_control *rstc; struct regmap *infra_ao; int i, irq_id, ret; + ret = of_reserved_mem_device_init(dev); + if (ret) + dev_dbg(dev, "failed to assign memory region: %d\n", ret); + ret = dma_set_mask_and_coherent(&pdev->dev, DMA_BIT_MASK(33)); if (ret) return ret; @@ -3213,7 +3218,6 @@ static int mt8188_afe_pcm_dev_probe(struct platform_device *pdev) afe_priv = afe->platform_priv; afe->dev = &pdev->dev; - dev = afe->dev; afe->base_addr = devm_platform_ioremap_resource(pdev, 0); if (IS_ERR(afe->base_addr)) -- 2.18.0