From patchwork Mon Jan 7 11:21:49 2013 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Fabio Baltieri X-Patchwork-Id: 1940741 Return-Path: X-Original-To: patchwork-linux-arm@patchwork.kernel.org Delivered-To: patchwork-process-083081@patchwork2.kernel.org Received: from merlin.infradead.org (merlin.infradead.org [205.233.59.134]) by patchwork2.kernel.org (Postfix) with ESMTP id 8184CDF230 for ; Mon, 7 Jan 2013 11:29:40 +0000 (UTC) Received: from localhost ([::1] helo=merlin.infradead.org) by merlin.infradead.org with esmtp (Exim 4.76 #1 (Red Hat Linux)) id 1TsApW-00018R-Pv; Mon, 07 Jan 2013 11:25:24 +0000 Received: from mail-we0-f175.google.com ([74.125.82.175]) by merlin.infradead.org with esmtps (Exim 4.76 #1 (Red Hat Linux)) id 1TsAoW-0000jd-BU for linux-arm-kernel@lists.infradead.org; Mon, 07 Jan 2013 11:24:22 +0000 Received: by mail-we0-f175.google.com with SMTP id z53so9878791wey.20 for ; Mon, 07 Jan 2013 03:24:18 -0800 (PST) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=20120113; h=x-received:from:to:cc:subject:date:message-id:x-mailer:in-reply-to :references:x-gm-message-state; bh=xrJ10UreId0q23svhGJd2N/34D+ALPkYUZey/v1w0TA=; b=Ib8ew5a1b6hxnqww2bAEj7ZmzCD7votf5e00HhqEna0e6Eh32k/GwZAFTsMj8ac1m/ CGmvtSAMJq0QV9OanbiQeKIXJUNsyoEKnC/w56UJBq4MkDdFYZ05rVTHQ3zhbmJa9hu3 2hjQxaJfhRPyuiyBlPKoGGECwztP4YEW5miHx+av7/QqT1au6rpi/lMk60Z9FrWC7Qnb ywlpJlzL1zaQAAthyvr36LIyYNdFFGzdJ0MLSjPB2A/neheH7/D50t6Mk9PGHuwFseXL siXRcSDjUEVtBvq1QGV3qpz7i7LbiU4kl+70VCpL3jxP04yjr7NdnZ7eKj5eQ0vSu+5Q yXng== X-Received: by 10.180.75.208 with SMTP id e16mr8797329wiw.3.1357557858579; Mon, 07 Jan 2013 03:24:18 -0800 (PST) Received: from localhost ([2a01:2029:1:11e3:8e70:5aff:feac:ad8]) by mx.google.com with ESMTPS id dm3sm11642451wib.9.2013.01.07.03.24.12 (version=TLSv1.2 cipher=RC4-SHA bits=128/128); Mon, 07 Jan 2013 03:24:17 -0800 (PST) From: Fabio Baltieri To: Vinod Koul Subject: [PATCH 07/16] dmaengine: ste_dma40: support fixed physical channel allocation Date: Mon, 7 Jan 2013 12:21:49 +0100 Message-Id: <1357557718-15676-8-git-send-email-fabio.baltieri@linaro.org> X-Mailer: git-send-email 1.7.12.1 In-Reply-To: <1357557718-15676-1-git-send-email-fabio.baltieri@linaro.org> References: <1357557718-15676-1-git-send-email-fabio.baltieri@linaro.org> X-Gm-Message-State: ALoCoQk0CMlPsru8fKe9zAlrArsAzd1w5+ZRPErfsKlaapxBLtrX/jTfzw9esbidgmdPXcQ5N09N X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20130107_062420_889019_3A154A53 X-CRM114-Status: GOOD ( 12.43 ) X-Spam-Score: -2.6 (--) X-Spam-Report: SpamAssassin version 3.3.2 on merlin.infradead.org summary: Content analysis details: (-2.6 points) pts rule name description ---- ---------------------- -------------------------------------------------- -0.7 RCVD_IN_DNSWL_LOW RBL: Sender listed at http://www.dnswl.org/, low trust [74.125.82.175 listed in list.dnswl.org] -1.9 BAYES_00 BODY: Bayes spam probability is 0 to 1% [score: 0.0000] Cc: Gerald Baeza , Srinidhi Kasagar , Fabio Baltieri , Linus Walleij , linux-kernel@vger.kernel.org, Dan Williams , linux-arm-kernel@lists.infradead.org X-BeenThere: linux-arm-kernel@lists.infradead.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , MIME-Version: 1.0 Sender: linux-arm-kernel-bounces@lists.infradead.org Errors-To: linux-arm-kernel-bounces+patchwork-linux-arm=patchwork.kernel.org@lists.infradead.org From: Gerald Baeza This patch makes existing use_fixed_channel field (of stedma40_chan_cfg structure) applicable to physical channels. Signed-off-by: Gerald Baeza Tested-by: Yannick Fertre Reviewed-by: Per Forlin Acked-by: Linus Walleij Signed-off-by: Fabio Baltieri --- drivers/dma/ste_dma40.c | 13 +++++++++++-- 1 file changed, 11 insertions(+), 2 deletions(-) diff --git a/drivers/dma/ste_dma40.c b/drivers/dma/ste_dma40.c index 9f8964a..5feab7db9 100644 --- a/drivers/dma/ste_dma40.c +++ b/drivers/dma/ste_dma40.c @@ -1711,10 +1711,12 @@ static int d40_allocate_channel(struct d40_chan *d40c, bool *first_phy_user) int i; int j; int log_num; + int num_phy_chans; bool is_src; bool is_log = d40c->dma_cfg.mode == STEDMA40_MODE_LOGICAL; phys = d40c->base->phy_res; + num_phy_chans = d40c->base->num_phy_chans; if (d40c->dma_cfg.dir == STEDMA40_PERIPH_TO_MEM) { dev_type = d40c->dma_cfg.src_dev_type; @@ -1735,12 +1737,19 @@ static int d40_allocate_channel(struct d40_chan *d40c, bool *first_phy_user) if (!is_log) { if (d40c->dma_cfg.dir == STEDMA40_MEM_TO_MEM) { /* Find physical half channel */ - for (i = 0; i < d40c->base->num_phy_chans; i++) { - + if (d40c->dma_cfg.use_fixed_channel) { + i = d40c->dma_cfg.phy_channel; if (d40_alloc_mask_set(&phys[i], is_src, 0, is_log, first_phy_user)) goto found_phy; + } else { + for (i = 0; i < num_phy_chans; i++) { + if (d40_alloc_mask_set(&phys[i], is_src, + 0, is_log, + first_phy_user)) + goto found_phy; + } } } else for (j = 0; j < d40c->base->num_phy_chans; j += 8) {