Received: by 2002:a25:f815:0:0:0:0:0 with SMTP id u21csp3573200ybd; Tue, 25 Jun 2019 05:04:41 -0700 (PDT) X-Google-Smtp-Source: APXvYqwFsp+tt7TIMWkemvru5N8DNJW0FB9PQ9E6Al8UB1y+0faZscv81+7g6FUn6e8rVWaOA6IP X-Received: by 2002:a17:90a:342c:: with SMTP id o41mr31537554pjb.1.1561464281274; Tue, 25 Jun 2019 05:04:41 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1561464281; cv=none; d=google.com; s=arc-20160816; b=AGYgQOeNsJ2hD3mIhc0K6i+7nKUVhvNFuwCAG1HrZKG/t7sFTqe9iYDJKjYFvtTLGZ NkTj1VjQpLA8oFFbGw5bcSGpiZNkhfKTsu+NVMwZ+cpZ62MRm+giZut4020gZHpK4sJi PAekbRn+81syx2GkGljbMpqC5ZWgXZrYixKHY+ar2lDzdt7f/zrNmFRVI7fTNUKc7rFa PquyKtgzo/P+ccXZTV2HNXdqnSe2OcZgQM+c26tpQKtPi9OzbiIhtladAN/NALLb+KwY 0st87pR+Cw1bZvc1FQ/7fHXMu1oi46w9lsZhX6cSSyuARtxMEFa2wXOInkfphJg3SBCf WtRw== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:references:in-reply-to:message-id:date :subject:cc:to:from; bh=YPZpi+dKi6OASvOKEm6ajEdzgkOUyjFHqGCAXtSaw6Q=; b=zJrwPhmo7rd5Tt9L+bIq6+aOfZxhpWXVXr33fUCRKPK9kr2qlMjfHEImvkjUkFQZ0C luuKFccSGJW78CdoMqUUBPwAAe37C1mPR5g2FjyzgIho248yqUtk0Zru+HxhE5crr+cP EvcMj29TGg9U5VlgOU3V/6jWkMS+pkAOT6H+VmsOG8Xviiz8I0J0VQWk/lvWoC8GPftQ zDO1Dw5Rer0b6x5aCryybHOAqTpERszPJupcl0/YUiiYSI1jy1cb2vg1AGvqHCSmT1wO aA9EhFTe721hGzh8/38eqW6EVRdq/gDLZwxYvub3iMVhh4l6GB8hjedUGNBDkavvkLTm pQtw== ARC-Authentication-Results: i=1; mx.google.com; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=nxp.com Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id x2si2634558pjp.105.2019.06.25.05.04.18; Tue, 25 Jun 2019 05:04:41 -0700 (PDT) Received-SPF: pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) client-ip=209.132.180.67; Authentication-Results: mx.google.com; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=nxp.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1731740AbfFYJmM (ORCPT + 99 others); Tue, 25 Jun 2019 05:42:12 -0400 Received: from inva021.nxp.com ([92.121.34.21]:52324 "EHLO inva021.nxp.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1726557AbfFYJlu (ORCPT ); Tue, 25 Jun 2019 05:41:50 -0400 Received: from inva021.nxp.com (localhost [127.0.0.1]) by inva021.eu-rdc02.nxp.com (Postfix) with ESMTP id 836A9200727; Tue, 25 Jun 2019 11:41:48 +0200 (CEST) Received: from invc005.ap-rdc01.nxp.com (invc005.ap-rdc01.nxp.com [165.114.16.14]) by inva021.eu-rdc02.nxp.com (Postfix) with ESMTP id 6900120072B; Tue, 25 Jun 2019 11:41:41 +0200 (CEST) Received: from mega.ap.freescale.net (mega.ap.freescale.net [10.192.208.232]) by invc005.ap-rdc01.nxp.com (Postfix) with ESMTP id 827424030F; Tue, 25 Jun 2019 17:41:32 +0800 (SGT) From: yibin.gong@nxp.com To: robh@kernel.org, shawnguo@kernel.org, s.hauer@pengutronix.de, festevam@gmail.com, mark.rutland@arm.com, vkoul@kernel.org, dan.j.williams@intel.com, angelo@sysam.it Cc: linux-imx@nxp.com, linux-arm-kernel@lists.infradead.org, linux-kernel@vger.kernel.org, dmaengine@vger.kernel.org, devicetree@vger.kernel.org, kernel@pengutronix.de Subject: [PATCH v5 2/6] dmaengine: fsl-edma-common: move dmamux register to another single function Date: Tue, 25 Jun 2019 17:43:20 +0800 Message-Id: <20190625094324.19196-3-yibin.gong@nxp.com> X-Mailer: git-send-email 2.17.1 In-Reply-To: <20190625094324.19196-1-yibin.gong@nxp.com> References: <20190625094324.19196-1-yibin.gong@nxp.com> X-Virus-Scanned: ClamAV using ClamSMTP Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org From: Robin Gong Prepare for edmav2 on i.mx7ulp whose dmamux register is 32bit. No function impacted. Signed-off-by: Robin Gong --- drivers/dma/fsl-edma-common.c | 18 ++++++++++++++---- 1 file changed, 14 insertions(+), 4 deletions(-) diff --git a/drivers/dma/fsl-edma-common.c b/drivers/dma/fsl-edma-common.c index 07d9689..ba74e10 100644 --- a/drivers/dma/fsl-edma-common.c +++ b/drivers/dma/fsl-edma-common.c @@ -77,6 +77,19 @@ void fsl_edma_disable_request(struct fsl_edma_chan *fsl_chan) } EXPORT_SYMBOL_GPL(fsl_edma_disable_request); +static void mux_configure8(struct fsl_edma_chan *fsl_chan, void __iomem *addr, + u32 off, u32 slot, bool enable) +{ + u8 val8; + + if (enable) + val8 = EDMAMUX_CHCFG_ENBL | slot; + else + val8 = EDMAMUX_CHCFG_DIS; + + iowrite8(val8, addr + off); +} + void fsl_edma_chan_mux(struct fsl_edma_chan *fsl_chan, unsigned int slot, bool enable) { @@ -90,10 +103,7 @@ void fsl_edma_chan_mux(struct fsl_edma_chan *fsl_chan, muxaddr = fsl_chan->edma->muxbase[ch / chans_per_mux]; slot = EDMAMUX_CHCFG_SOURCE(slot); - if (enable) - iowrite8(EDMAMUX_CHCFG_ENBL | slot, muxaddr + ch_off); - else - iowrite8(EDMAMUX_CHCFG_DIS, muxaddr + ch_off); + mux_configure8(fsl_chan, muxaddr, ch_off, slot, enable); } EXPORT_SYMBOL_GPL(fsl_edma_chan_mux); -- 2.7.4