Received: by 2002:a05:6a10:c604:0:0:0:0 with SMTP id y4csp2608079pxt; Mon, 9 Aug 2021 04:54:04 -0700 (PDT) X-Google-Smtp-Source: ABdhPJyIwzPDLAQmJTHx6R0uajlwMqds+WzkGBuGvz8b1cl6/Pj0uH3/l7ql0CMyX9bmqTlM8kuw X-Received: by 2002:a92:2809:: with SMTP id l9mr167151ilf.159.1628510044387; Mon, 09 Aug 2021 04:54:04 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1628510044; cv=none; d=google.com; s=arc-20160816; b=dnzuJk/bkmFlX/qMN2Qk+cdAtGb1kNMI5EfIqF1hUSo+jxFNNT2AG5k1UIohVSPbOx 5gBwMAYWt99DMDFBBb9FrNlPokiWpUEXlhdbGxaNX7RdV0vPjPb/is8oiGXzPUHPkHAx 2bXphVnCzpQAk3MP+nWNCTuJE4gOMPuWLyoXoje2Ont6yHKEa6V71BvfcrfLEgHiqezW 5yY+VNlnKgMihS8klCSxZ5Osu8rnR52H3eH61y03fsoqNfZMw4Aqr/5SsJ1Cf3ZnrLxa T3TZrFJYHiWK9O2XYn2mMy9xCAlWq1N6ZSLbl6JeCC/tY5NAJZxhFtzNj8CP23d4bQrH 6kHA== 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; bh=Rkw1KV5Zie4bFZ1rNh94WgTlCMR2lPgJjkAGmTLhfWo=; b=HPMtFubxN5UorPG9xRUvGHwDuzwzPFlDgvwWkRSnkijJwtB2IrB7QjZOpeTzcSXLzy aSkKUAjVwal7qDTi7Hrta4Wy3Ik1Q9LD6G0MUY9bZE3vmty5k6IXiJJ9gihuS96O7HgK 3LyJ1rtVDBwCyEu3O8i6mecXlBNR/Ner9Si4NAuxmkptaHNQKjenBBM1n/Vfy9SbXqgU bWqfMvFiuQXdBWlY5dB9UaObziMWHbnYKUlSu8H/pQ9WWhqS3hYDkSPceCcb3stKTw+p gfoFPN6hEWcfzZnjn3U5Xu0+nLVBo4Wz+9nFYcvenMtoJXyQEY8w2+KvY4z9sohCVsCS VZlw== ARC-Authentication-Results: i=1; mx.google.com; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=mediatek.com Return-Path: Received: from vger.kernel.org (vger.kernel.org. [23.128.96.18]) by mx.google.com with ESMTP id u11si19173890jad.56.2021.08.09.04.53.51; Mon, 09 Aug 2021 04:54:04 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) client-ip=23.128.96.18; Authentication-Results: mx.google.com; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=mediatek.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S234828AbhHIJtj (ORCPT + 99 others); Mon, 9 Aug 2021 05:49:39 -0400 Received: from mailgw01.mediatek.com ([60.244.123.138]:53172 "EHLO mailgw01.mediatek.com" rhost-flags-OK-FAIL-OK-FAIL) by vger.kernel.org with ESMTP id S234738AbhHIJt0 (ORCPT ); Mon, 9 Aug 2021 05:49:26 -0400 X-UUID: c6d47340b26a425f98eaf493e32a1584-20210809 X-UUID: c6d47340b26a425f98eaf493e32a1584-20210809 Received: from mtkexhb01.mediatek.inc [(172.21.101.102)] by mailgw01.mediatek.com (envelope-from ) (Generic MTA with TLSv1.2 ECDHE-RSA-AES256-SHA384 256/256) with ESMTP id 65568658; Mon, 09 Aug 2021 17:49:00 +0800 Received: from mtkcas11.mediatek.inc (172.21.101.40) by mtkmbs05n2.mediatek.inc (172.21.101.140) with Microsoft SMTP Server (TLS) id 15.0.1497.2; Mon, 9 Aug 2021 17:48:58 +0800 Received: from mtksdccf07.mediatek.inc (172.21.84.99) by mtkcas11.mediatek.inc (172.21.101.73) with Microsoft SMTP Server id 15.0.1497.2 via Frontend Transport; Mon, 9 Aug 2021 17:48:58 +0800 From: Trevor Wu To: , , , CC: , , , , , , , , , , Subject: [PATCH v3 1/9] ASoC: mediatek: mt8195: update mediatek common driver Date: Mon, 9 Aug 2021 17:48:47 +0800 Message-ID: <20210809094855.7169-2-trevor.wu@mediatek.com> X-Mailer: git-send-email 2.18.0 In-Reply-To: <20210809094855.7169-1-trevor.wu@mediatek.com> References: <20210809094855.7169-1-trevor.wu@mediatek.com> MIME-Version: 1.0 Content-Type: text/plain X-MTK: N Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Update mediatek common driver to support MT8195 Signed-off-by: Trevor Wu Reported-by: kernel test robot --- sound/soc/mediatek/common/mtk-afe-fe-dai.c | 22 +++++++++++++++++++--- sound/soc/mediatek/common/mtk-base-afe.h | 10 ++++++++-- 2 files changed, 27 insertions(+), 5 deletions(-) diff --git a/sound/soc/mediatek/common/mtk-afe-fe-dai.c b/sound/soc/mediatek/common/mtk-afe-fe-dai.c index 3cb2adf420bb..baaa5881b1d4 100644 --- a/sound/soc/mediatek/common/mtk-afe-fe-dai.c +++ b/sound/soc/mediatek/common/mtk-afe-fe-dai.c @@ -139,7 +139,7 @@ int mtk_afe_fe_hw_params(struct snd_pcm_substream *substream, substream->runtime->dma_area, substream->runtime->dma_bytes); - memset_io(substream->runtime->dma_area, 0, + memset_io((void __force __iomem *)substream->runtime->dma_area, 0, substream->runtime->dma_bytes); /* set addr */ @@ -433,11 +433,20 @@ int mtk_memif_set_addr(struct mtk_base_afe *afe, int id, phys_buf_addr_upper_32); } - /* set MSB to 33-bit */ - if (memif->data->msb_reg >= 0) + /* + * set MSB to 33-bit, for memif address + * only for memif base address, if msb_end_reg exists + */ + if (memif->data->msb_reg) mtk_regmap_update_bits(afe->regmap, memif->data->msb_reg, 1, msb_at_bit33, memif->data->msb_shift); + /* set MSB to 33-bit, for memif end address */ + if (memif->data->msb_end_reg) + mtk_regmap_update_bits(afe->regmap, memif->data->msb_end_reg, + 1, msb_at_bit33, + memif->data->msb_end_shift); + return 0; } EXPORT_SYMBOL_GPL(mtk_memif_set_addr); @@ -464,6 +473,13 @@ int mtk_memif_set_channel(struct mtk_base_afe *afe, else mono = (channel == 1) ? 1 : 0; + /* for specific configuration of memif mono mode */ + if (memif->data->int_odd_flag_reg) + mtk_regmap_update_bits(afe->regmap, + memif->data->int_odd_flag_reg, + 1, mono, + memif->data->int_odd_flag_shift); + return mtk_regmap_update_bits(afe->regmap, memif->data->mono_reg, 1, mono, memif->data->mono_shift); } diff --git a/sound/soc/mediatek/common/mtk-base-afe.h b/sound/soc/mediatek/common/mtk-base-afe.h index a6f68c68581c..ef83e78c22a8 100644 --- a/sound/soc/mediatek/common/mtk-base-afe.h +++ b/sound/soc/mediatek/common/mtk-base-afe.h @@ -29,6 +29,8 @@ struct mtk_base_memif_data { int quad_ch_reg; int quad_ch_mask; int quad_ch_shift; + int int_odd_flag_reg; + int int_odd_flag_shift; int enable_reg; int enable_shift; int hd_reg; @@ -37,10 +39,13 @@ struct mtk_base_memif_data { int hd_align_mshift; int msb_reg; int msb_shift; - int msb2_reg; - int msb2_shift; + int msb_end_reg; + int msb_end_shift; int agent_disable_reg; int agent_disable_shift; + int ch_num_reg; + int ch_num_shift; + int ch_num_maskbit; /* playback memif only */ int pbuf_reg; int pbuf_mask; @@ -62,6 +67,7 @@ struct mtk_base_irq_data { int irq_en_shift; int irq_clr_reg; int irq_clr_shift; + int irq_status_shift; }; struct device; -- 2.18.0