Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S965903AbcJ1QCj (ORCPT ); Fri, 28 Oct 2016 12:02:39 -0400 Received: from us01smtprelay-2.synopsys.com ([198.182.47.9]:57191 "EHLO smtprelay.synopsys.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S965695AbcJ1QCg (ORCPT ); Fri, 28 Oct 2016 12:02:36 -0400 From: Eugeniy Paltsev To: dmaengine@vger.kernel.org Cc: linux-kernel@vger.kernel.org, vinod.koul@intel.com, dan.j.williams@intel.com, andriy.shevchenko@linux.intel.com, vireshk@kernel.org, linux-snps-arc@lists.infradead.org, Eugeniy Paltsev Subject: [PATCH v3 3/3] dmaengine: DW DMAC: move "nollp" to "dwc->flags" Date: Fri, 28 Oct 2016 19:00:02 +0300 Message-Id: <1477670402-23943-4-git-send-email-Eugeniy.Paltsev@synopsys.com> X-Mailer: git-send-email 2.5.5 In-Reply-To: <1477670402-23943-1-git-send-email-Eugeniy.Paltsev@synopsys.com> References: <1477670402-23943-1-git-send-email-Eugeniy.Paltsev@synopsys.com> Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Content-Length: 2096 Lines: 69 Add "DW_DMA_IS_LLP_SUPPORTED" flag. Use this flag to get rid of "dwc->nollp" as separate variable. Signed-off-by: Eugeniy Paltsev --- drivers/dma/dw/core.c | 11 ++++++----- drivers/dma/dw/regs.h | 2 +- 2 files changed, 7 insertions(+), 6 deletions(-) diff --git a/drivers/dma/dw/core.c b/drivers/dma/dw/core.c index 6281009..98beb16 100644 --- a/drivers/dma/dw/core.c +++ b/drivers/dma/dw/core.c @@ -227,7 +227,7 @@ static void dwc_dostart(struct dw_dma_chan *dwc, struct dw_desc *first) return; } - if (dwc->nollp) { + if (!test_bit(DW_DMA_IS_LLP_SUPPORTED, &dwc->flags)) { was_soft_llp = test_and_set_bit(DW_DMA_IS_SOFT_LLP, &dwc->flags); if (was_soft_llp) { @@ -1265,7 +1265,7 @@ struct dw_cyclic_desc *dw_dma_cyclic_prep(struct dma_chan *chan, unsigned long flags; spin_lock_irqsave(&dwc->lock, flags); - if (dwc->nollp) { + if (!test_bit(DW_DMA_IS_LLP_SUPPORTED, &dwc->flags)) { spin_unlock_irqrestore(&dwc->lock, flags); dev_dbg(chan2dev(&dwc->chan), "channel doesn't support LLP transfers\n"); @@ -1570,11 +1570,12 @@ int dw_dma_probe(struct dw_dma_chip *chip) */ dwc->block_size = (4 << ((pdata->block_size >> 4 * i) & 0xf)) - 1; - dwc->nollp = - (dwc_params >> DWC_PARAMS_MBLK_EN & 0x1) == 0; + if ((dwc_params >> DWC_PARAMS_MBLK_EN & 0x1) != 0) + set_bit(DW_DMA_IS_LLP_SUPPORTED, &dwc->flags); } else { dwc->block_size = pdata->block_size; - dwc->nollp = pdata->is_nollp; + if (!pdata->is_nollp) + set_bit(DW_DMA_IS_LLP_SUPPORTED, &dwc->flags); } } diff --git a/drivers/dma/dw/regs.h b/drivers/dma/dw/regs.h index f65dd10..f50c0fc 100644 --- a/drivers/dma/dw/regs.h +++ b/drivers/dma/dw/regs.h @@ -218,6 +218,7 @@ enum dw_dmac_flags { DW_DMA_IS_SOFT_LLP = 1, DW_DMA_IS_PAUSED = 2, DW_DMA_IS_INITIALIZED = 3, + DW_DMA_IS_LLP_SUPPORTED = 4, }; struct dw_dma_chan { @@ -242,7 +243,6 @@ struct dw_dma_chan { /* hardware configuration */ unsigned int block_size; - bool nollp; /* custom slave configuration */ struct dw_dma_slave dws; -- 2.5.5