From patchwork Fri Mar 18 14:12:26 2016 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Jean-Francois Moine X-Patchwork-Id: 8621071 Return-Path: X-Original-To: patchwork-linux-arm@patchwork.kernel.org Delivered-To: patchwork-parsemail@patchwork1.web.kernel.org Received: from mail.kernel.org (mail.kernel.org [198.145.29.136]) by patchwork1.web.kernel.org (Postfix) with ESMTP id 7CBCB9F44D for ; Fri, 18 Mar 2016 15:05:20 +0000 (UTC) Received: from mail.kernel.org (localhost [127.0.0.1]) by mail.kernel.org (Postfix) with ESMTP id B3DCC202E9 for ; Fri, 18 Mar 2016 15:05:19 +0000 (UTC) Received: from bombadil.infradead.org (unknown [198.137.202.9]) (using TLSv1.2 with cipher AES128-GCM-SHA256 (128/128 bits)) (No client certificate requested) by mail.kernel.org (Postfix) with ESMTPS id C165820204 for ; Fri, 18 Mar 2016 15:05:18 +0000 (UTC) Received: from localhost ([127.0.0.1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.80.1 #2 (Red Hat Linux)) id 1agvp1-0000Kq-Sq; Fri, 18 Mar 2016 14:56:15 +0000 Received: from smtp5-g21.free.fr ([212.27.42.5]) by bombadil.infradead.org with esmtps (Exim 4.80.1 #2 (Red Hat Linux)) id 1agvoX-0008HS-EK for linux-arm-kernel@lists.infradead.org; Fri, 18 Mar 2016 14:55:47 +0000 Received: from localhost (unknown [IPv6:2a01:e35:2f5c:9de0:6b55:87da:4920:b782]) by smtp5-g21.free.fr (Postfix) with ESMTP id 05679D480D7; Fri, 18 Mar 2016 15:51:07 +0100 (CET) X-Mailbox-Line: From 8485d9976f327cf23e051f64c3a3c5cbff4214a7 Mon Sep 17 00:00:00 2001 Message-Id: <8485d9976f327cf23e051f64c3a3c5cbff4214a7.1458311540.git.moinejf@free.fr> In-Reply-To: References: From: Jean-Francois Moine Date: Fri, 18 Mar 2016 15:12:26 +0100 Subject: [PATCH v3 2/5] dmaengine: sun6i: Add 4 as a possible burst value for the H3 To: Vinod Koul , Maxime Ripard , Chen-Yu Tsai X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20160318_075545_973800_861A32AB X-CRM114-Status: UNSURE ( 9.94 ) X-CRM114-Notice: Please train this message. X-Spam-Score: -2.6 (--) X-BeenThere: linux-arm-kernel@lists.infradead.org X-Mailman-Version: 2.1.20 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: dmaengine@vger.kernel.org, Jens Kuske , linux-arm-kernel@lists.infradead.org MIME-Version: 1.0 Sender: "linux-arm-kernel" Errors-To: linux-arm-kernel-bounces+patchwork-linux-arm=patchwork.kernel.org@lists.infradead.org X-Spam-Status: No, score=-3.4 required=5.0 tests=BAYES_00,FREEMAIL_FROM, RCVD_IN_DNSWL_MED,RDNS_NONE,UNPARSEABLE_RELAY autolearn=unavailable version=3.3.1 X-Spam-Checker-Version: SpamAssassin 3.3.1 (2010-03-16) on mail.kernel.org X-Virus-Scanned: ClamAV using ClamSMTP The H3 accepts 4 as a burst value. Signed-off-by: Jean-Francois Moine --- drivers/dma/sun6i-dma.c | 9 +++++++++ 1 file changed, 9 insertions(+) diff --git a/drivers/dma/sun6i-dma.c b/drivers/dma/sun6i-dma.c index ce1e4d6..9378fda 100644 --- a/drivers/dma/sun6i-dma.c +++ b/drivers/dma/sun6i-dma.c @@ -101,6 +101,7 @@ struct sun6i_dma_config { u32 nr_max_channels; u32 nr_max_requests; u32 nr_max_vchans; + u32 burst_4; }; /* @@ -238,6 +239,8 @@ static inline s8 convert_burst(u32 maxburst) switch (maxburst) { case 1: return 0; + case 4: + return 1; case 8: return 2; default: @@ -470,6 +473,10 @@ static int set_config(struct sun6i_dma_dev *sdev, { s8 src_width, dst_width, src_burst, dst_burst; + if (!sdev->cfg->burst_4 && + (sconfig->src_maxburst == 4 || sconfig->dst_maxburst == 4)) + return -EINVAL; + if (direction == DMA_MEM_TO_DEV) { src_burst = convert_burst(sconfig->src_maxburst ? sconfig->src_maxburst : 8); @@ -900,12 +907,14 @@ static struct sun6i_dma_config sun8i_a23_dma_cfg = { /* * The H3 has 12 physical channels, a maximum DRQ port id of 27, * and a total of 34 usable source and destination endpoints. + * Setting the maxburst to '4' is possible. */ static struct sun6i_dma_config sun8i_h3_dma_cfg = { .nr_max_channels = 12, .nr_max_requests = 27, .nr_max_vchans = 34, + .burst_4 = 1, }; static const struct of_device_id sun6i_dma_match[] = {