From patchwork Wed Oct 23 12:43:46 2013 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: Denis Carikli X-Patchwork-Id: 3088211 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.19.201]) by patchwork1.web.kernel.org (Postfix) with ESMTP id 8266F9F2B7 for ; Wed, 23 Oct 2013 12:45:15 +0000 (UTC) Received: from mail.kernel.org (localhost [127.0.0.1]) by mail.kernel.org (Postfix) with ESMTP id 35BD420353 for ; Wed, 23 Oct 2013 12:45:14 +0000 (UTC) Received: from casper.infradead.org (casper.infradead.org [85.118.1.10]) (using TLSv1 with cipher DHE-RSA-AES256-SHA (256/256 bits)) (No client certificate requested) by mail.kernel.org (Postfix) with ESMTPS id 95FDE2033F for ; Wed, 23 Oct 2013 12:45:12 +0000 (UTC) Received: from merlin.infradead.org ([2001:4978:20e::2]) by casper.infradead.org with esmtps (Exim 4.80.1 #2 (Red Hat Linux)) id 1VYxnu-00055D-BT; Wed, 23 Oct 2013 12:44:50 +0000 Received: from localhost ([::1] helo=merlin.infradead.org) by merlin.infradead.org with esmtp (Exim 4.80.1 #2 (Red Hat Linux)) id 1VYxnk-0005Hu-UO; Wed, 23 Oct 2013 12:44:40 +0000 Received: from smtp5-g21.free.fr ([2a01:e0c:1:1599::14]) by merlin.infradead.org with esmtp (Exim 4.80.1 #2 (Red Hat Linux)) id 1VYxnZ-0005GG-Dh for linux-arm-kernel@lists.infradead.org; Wed, 23 Oct 2013 12:44:31 +0000 Received: from denis-N73SV.local.eukrea.com (unknown [88.170.243.169]) by smtp5-g21.free.fr (Postfix) with ESMTP id 322A7D48158; Wed, 23 Oct 2013 14:44:00 +0200 (CEST) From: Denis Carikli To: Sascha Hauer Subject: [PATCHv3][ 2/5] dma: ipu: Add devicetree support. Date: Wed, 23 Oct 2013 14:43:46 +0200 Message-Id: <1382532229-32755-2-git-send-email-denis@eukrea.com> X-Mailer: git-send-email 1.7.9.5 In-Reply-To: <1382532229-32755-1-git-send-email-denis@eukrea.com> References: <1382532229-32755-1-git-send-email-denis@eukrea.com> MIME-Version: 1.0 X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20131023_084430_132400_8D775FA4 X-CRM114-Status: GOOD ( 15.01 ) X-Spam-Score: -1.2 (-) Cc: Mark Rutland , devicetree@vger.kernel.org, Pawel Moll , Stephen Warren , Vinod Koul , Ian Campbell , Rob Herring , Denis Carikli , =?UTF-8?q?Eric=20B=C3=A9nard?= , Dan Williams , Shawn Guo , linux-arm-kernel@lists.infradead.org X-BeenThere: linux-arm-kernel@lists.infradead.org X-Mailman-Version: 2.1.15 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: "linux-arm-kernel" Errors-To: linux-arm-kernel-bounces+patchwork-linux-arm=patchwork.kernel.org@lists.infradead.org X-Spam-Status: No, score=-4.6 required=5.0 tests=BAYES_00, RCVD_IN_DNSWL_MED, RP_MATCHES_RCVD, 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 Cc: Rob Herring Cc: Pawel Moll Cc: Mark Rutland Cc: Stephen Warren Cc: Ian Campbell Cc: devicetree@vger.kernel.org Cc: Vinod Koul Cc: Dan Williams Cc: Sascha Hauer Cc: linux-arm-kernel@lists.infradead.org Cc: Eric BĂ©nard Signed-off-by: Denis Carikli --- ChangeLog v2->v3: - The DMA channels are not exposed anymore in order to look more like the IPUv3 bindings. --- .../devicetree/bindings/dma/fsl-imx-ipu.txt | 33 ++++++++++++++++++++ drivers/dma/ipu/ipu_idmac.c | 8 +++++ 2 files changed, 41 insertions(+) create mode 100644 Documentation/devicetree/bindings/dma/fsl-imx-ipu.txt diff --git a/Documentation/devicetree/bindings/dma/fsl-imx-ipu.txt b/Documentation/devicetree/bindings/dma/fsl-imx-ipu.txt new file mode 100644 index 0000000..ee66e1a --- /dev/null +++ b/Documentation/devicetree/bindings/dma/fsl-imx-ipu.txt @@ -0,0 +1,33 @@ +* Freescale Image Processing Unit DMA support for i.MX3x. + +This dma driver supports the imx31 and imx35 devices. + +Required properties: +- compatible : Should be "fsl,imx31-ipu". +- reg : Should contain DMA registers location and length +- interrupts : First item should be DMA interrupt, second one is optional and + should contain DMA Error interrupt. + +Example: + + ipu: ipu@53fc0000 { + compatible = "fsl,imx31-ipu"; + reg = < 0x53fc0000 0x5f + 0x53fc0088 0x2b >; + interrupts = <42 41>; + clocks = <&clks 55>; + clock-names = ""; + status = "disabled"; + }; + +* DMA client + +Clients have to specify the DMA requests with phandles in a list. + +Required properties: +Example: + + lcdc: mx3fb@53fc00b4 { + ... + ... + }; diff --git a/drivers/dma/ipu/ipu_idmac.c b/drivers/dma/ipu/ipu_idmac.c index cb9c0bc..d853ee1 100644 --- a/drivers/dma/ipu/ipu_idmac.c +++ b/drivers/dma/ipu/ipu_idmac.c @@ -22,6 +22,7 @@ #include #include #include +#include #include #include "../dmaengine.h" @@ -1768,6 +1769,12 @@ static int ipu_remove(struct platform_device *pdev) return 0; } +static const struct of_device_id ipu_dma_of_dev_id[] = { + { .compatible = "fsl,imx31-ipu", }, + { /* Sentinel */ } +}; +MODULE_DEVICE_TABLE(of, ipu_dma_of_dev_id); + /* * We need two MEM resources - with IPU-common and Image Converter registers, * including PF_CONF and IDMAC_* registers, and two IRQs - function and error @@ -1775,6 +1782,7 @@ static int ipu_remove(struct platform_device *pdev) static struct platform_driver ipu_platform_driver = { .driver = { .name = "ipu-core", + .of_match_table = of_match_ptr(ipu_dma_of_dev_id), .owner = THIS_MODULE, }, .remove = ipu_remove,