Received: by 2002:ac0:a5a6:0:0:0:0:0 with SMTP id m35-v6csp1218133imm; Wed, 22 Aug 2018 22:20:10 -0700 (PDT) X-Google-Smtp-Source: AA+uWPzuIs+inY4dN9vSa6ChRMRQSJn5zqpOWSaYaKytmUMtArFBnCzSZAAnBZbwPODxctNzMxSD X-Received: by 2002:a17:902:15c5:: with SMTP id a5-v6mr56657394plh.137.1535001610710; Wed, 22 Aug 2018 22:20:10 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1535001610; cv=none; d=google.com; s=arc-20160816; b=UREIbvrXD+mCOxlHlYZpb2bxkc4NubTSfEKrrOjBPHsC6eQWyIf5CWeFhk1AGKwOr0 PRaMxZUXfN95G+RY+Co33ZQBr6aI+22hWCW/V/zOUkEpJM2bffMnch33V6x+6arpKQw7 KNzOBlkcK8o1vsJXtn3J4pA5Ya+0Oh56P0fNDWiVJ22iWWq+XMwnlEK1TEsVq23q5PZ3 vwwtkjCqQ2Hc/YX2bh2tzWnUo5kd3A2Gyw3JjKRfcm5wa1W+3tiSGauby4DUql5v5pDe kxNK75LnOgZeAdK1xob5RoDWTHNBq1qyoJxM2bMsLZpy3josylzU0Y4eKu/tjbi2WBoL p2Zw== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:cc:to:subject:message-id:date:from :references:in-reply-to:mime-version:dkim-signature:dkim-filter :arc-authentication-results; bh=UJ7wuCUp8N+t6aD4NZES1oiF+tswbP+9Mts7n5Fqms4=; b=ZhkhJaN17fgdW59lZl4NbQXSi0LQXNXXdcg270XeREzcMpAlu5Tlo9DXdiieMEA/DE 4FjSsMR5sbqz6w7OBgxq3os2ROBoF5evEbzh+HHJk0dFNq7acB3XOFcRgJU9zI2eiGUK GdeJZV5vRHIbI7sp14Q/n1ixKbOyZgJWJBT4zeXzYEoMRwnVOQwDKe9V5+Qq+N39POf4 XWPxHg/ETHcnK0gNws+bjHfkdYt5usk9MdY6eITzXnLTpktj6ONv0ZXDAJqgzP26rydI AwQQexLTpTKzvivD12tyDgUhgCLTiglOlGEmjhxHM2M9Qbmzidee5+DV34cHzmZqpVWv 6Huw== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@nifty.com header.s=dec2015msa header.b=loPqoOLO; 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 Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id p1-v6si3381413plk.294.2018.08.22.22.19.54; Wed, 22 Aug 2018 22:20:10 -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; dkim=pass header.i=@nifty.com header.s=dec2015msa header.b=loPqoOLO; 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 Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1728409AbeHWIqo (ORCPT + 99 others); Thu, 23 Aug 2018 04:46:44 -0400 Received: from conssluserg-05.nifty.com ([210.131.2.90]:31958 "EHLO conssluserg-05.nifty.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1728144AbeHWIqo (ORCPT ); Thu, 23 Aug 2018 04:46:44 -0400 Received: from mail-ua1-f54.google.com (mail-ua1-f54.google.com [209.85.222.54]) (authenticated) by conssluserg-05.nifty.com with ESMTP id w7N5IgTZ015569; Thu, 23 Aug 2018 14:18:43 +0900 DKIM-Filter: OpenDKIM Filter v2.10.3 conssluserg-05.nifty.com w7N5IgTZ015569 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=nifty.com; s=dec2015msa; t=1535001523; bh=UJ7wuCUp8N+t6aD4NZES1oiF+tswbP+9Mts7n5Fqms4=; h=In-Reply-To:References:From:Date:Subject:To:Cc:From; b=loPqoOLOQzbX1AomkXLfHcZyvo7vc22uUxF3L1fgH44KqviWrGNQuMJlWRMAHayFQ K9FMaHsay8VSTOqGVLfQoxaNYmPJzfevKlxf/qmEZWkzHTcSVW9CBcpXQdBH4cnrsC jmueXgcYaR/7eY3rvmftcXM0DDD0p76PauR7i5FwaO4eBn9bIt6yFNXlQ/bZA7KWcA Y4vh/tsnDbF9ZhN0KZ4ekcR3AH7bvI7JsbuG0prNd/7V6Uc12bF/PYoPe/svZY0qKd RpZFU5f6HQ7IHxf0MB+yvCMe3Z12z6Y8uoCpDh988MkAqPZW32S8O+jdTZo+8fuOIQ keqzjY9//3e8A== X-Nifty-SrcIP: [209.85.222.54] Received: by mail-ua1-f54.google.com with SMTP id 101-v6so1677815uav.7; Wed, 22 Aug 2018 22:18:42 -0700 (PDT) X-Gm-Message-State: APzg51Am6/Wq26mCxosVZcQihR95SCjipm52pXYosv4oHFRc1GtnsTyL xGLsRvbXd+oruigNbex4cnQzXwuXtFNn3jg5Rvc= X-Received: by 2002:ab0:4f17:: with SMTP id n23-v6mr8029612uah.135.1535001521662; Wed, 22 Aug 2018 22:18:41 -0700 (PDT) MIME-Version: 1.0 Received: by 2002:ab0:2642:0:0:0:0:0 with HTTP; Wed, 22 Aug 2018 22:18:01 -0700 (PDT) In-Reply-To: References: <1534843809-4137-1-git-send-email-yamada.masahiro@socionext.com> <1534843809-4137-2-git-send-email-yamada.masahiro@socionext.com> From: Masahiro Yamada Date: Thu, 23 Aug 2018 14:18:01 +0900 X-Gmail-Original-Message-ID: Message-ID: Subject: Re: [PATCH 1/2] dt-bindings: dmaengine: add DT binding for UniPhier MIO DMAC To: Jassi Brar Cc: Vinod Koul , dmaengine@vger.kernel.org, Masami Hiramatsu , Rob Herring , DTML , Linux Kernel Mailing List Content-Type: text/plain; charset="UTF-8" Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Hi Jassi, 2018-08-21 19:44 GMT+09:00 Jassi Brar : > On 21 August 2018 at 15:17, Masahiro Yamada > wrote: >> (+CC Rob, DT, LKML) >> >> I forgot to CC this to DT community... >> >> >> 2018-08-21 18:30 GMT+09:00 Masahiro Yamada : >>> The MIO DMAC (Media IO DMA Controller) is used in UniPhier LD4, >>> Pro4, and sLD8 SoCs. >>> >>> Signed-off-by: Masahiro Yamada >>> --- >>> >>> .../devicetree/bindings/dma/uniphier-mio-dmac.txt | 28 ++++++++++++++++++++++ >>> 1 file changed, 28 insertions(+) >>> create mode 100644 Documentation/devicetree/bindings/dma/uniphier-mio-dmac.txt >>> >>> diff --git a/Documentation/devicetree/bindings/dma/uniphier-mio-dmac.txt b/Documentation/devicetree/bindings/dma/uniphier-mio-dmac.txt >>> new file mode 100644 >>> index 0000000..a9e969e >>> --- /dev/null >>> +++ b/Documentation/devicetree/bindings/dma/uniphier-mio-dmac.txt >>> @@ -0,0 +1,28 @@ >>> +UniPhier Media IO DMA controller >>> + >>> +This works as an external DMA engine for SD/eMMC controllers etc. >>> +found in UniPhier LD4, Pro4, sLD8 SoCs. >>> + >>> +Required properties: >>> +- compatible: should be "socionext,uniphier-mio-dmac". >>> +- reg: offset and length of the register set for the device. >>> +- interrupts: a list of interrupt specifiers associated with the DMA channels. >>> +- clocks: a single clock specifier >>> +- #dma-cells: should be <1>. The single cell represents the channel number. >>> +- dma-channels: specify the number of the DMA channels. This should match to >>> + the number of tuples in the interrupts property. >>> + > Can we not infer the number of channels from interrupt tuples? After > all the driver assumes they are same. It would be possible to count the number of tuples in "interrupts". I know of_irq_count(), but I do not see any driver in drivers/dma/ that calls it. I guess the reason is that of_irq_count() is not exported, so tristate drivers like this cannot use it. I checked Documentation/devicetree/bindings/dma/, and some controllers specify _redundant_ dma-channels property. fsl-mxs-dma.txt renesas,rcar-dmac.txt renesas,usb-dmac.txt I also see counter-implementation. bcm2835-dma.c hard-codes the number of channels in the driver. tegra210-adma.c associates nr_channels with compatible string. I will wait for comments from the maintainers. If desired, I will export of_irq_count() and use it from my driver. Thanks. -- Best Regards Masahiro Yamada