From mboxrd@z Thu Jan 1 00:00:00 1970 From: Denis Carikli 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> References: <1382532229-32755-1-git-send-email-denis@eukrea.com> Mime-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: QUOTED-PRINTABLE Return-path: In-Reply-To: <1382532229-32755-1-git-send-email-denis-fO0SIAKYzcbQT0dZR+AlfA@public.gmane.org> Sender: devicetree-owner-u79uwXL29TY76Z2rM5mHXA@public.gmane.org To: Sascha Hauer Cc: Shawn Guo , =?UTF-8?q?Eric=20B=C3=A9nard?= , linux-arm-kernel-IAPFreCvJWM7uuMidbF8XUB+6BGkLq7r@public.gmane.org, Denis Carikli , Rob Herring , Pawel Moll , Mark Rutland , Stephen Warren , Ian Campbell , devicetree-u79uwXL29TY76Z2rM5mHXA@public.gmane.org, Vinod Koul , Dan Williams List-Id: devicetree@vger.kernel.org Cc: Rob Herring Cc: Pawel Moll Cc: Mark Rutland Cc: Stephen Warren Cc: Ian Campbell Cc: devicetree-u79uwXL29TY76Z2rM5mHXA@public.gmane.org Cc: Vinod Koul Cc: Dan Williams Cc: Sascha Hauer Cc: linux-arm-kernel-IAPFreCvJWM7uuMidbF8XUB+6BGkLq7r@public.gmane.org Cc: Eric B=C3=A9nard Signed-off-by: Denis Carikli --- ChangeLog v2->v3: - The DMA channels are not exposed anymore in order to look more like t= he 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.t= xt diff --git a/Documentation/devicetree/bindings/dma/fsl-imx-ipu.txt b/Do= cumentation/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 optio= nal and + should contain DMA Error interrupt. + +Example: + + ipu: ipu@53fc0000 { + compatible =3D "fsl,imx31-ipu"; + reg =3D < 0x53fc0000 0x5f + 0x53fc0088 0x2b >; + interrupts =3D <42 41>; + clocks =3D <&clks 55>; + clock-names =3D ""; + status =3D "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 =20 #include "../dmaengine.h" @@ -1768,6 +1769,12 @@ static int ipu_remove(struct platform_device *pd= ev) return 0; } =20 +static const struct of_device_id ipu_dma_of_dev_id[] =3D { + { .compatible =3D "fsl,imx31-ipu", }, + { /* Sentinel */ } +}; +MODULE_DEVICE_TABLE(of, ipu_dma_of_dev_id); + /* * We need two MEM resources - with IPU-common and Image Converter reg= isters, * including PF_CONF and IDMAC_* registers, and two IRQs - function an= d error @@ -1775,6 +1782,7 @@ static int ipu_remove(struct platform_device *pde= v) static struct platform_driver ipu_platform_driver =3D { .driver =3D { .name =3D "ipu-core", + .of_match_table =3D of_match_ptr(ipu_dma_of_dev_id), .owner =3D THIS_MODULE, }, .remove =3D ipu_remove, --=20 1.7.9.5 -- To unsubscribe from this list: send the line "unsubscribe devicetree" i= n the body of a message to majordomo-u79uwXL29TY76Z2rM5mHXA@public.gmane.org More majordomo info at http://vger.kernel.org/majordomo-info.html From mboxrd@z Thu Jan 1 00:00:00 1970 From: denis@eukrea.com (Denis Carikli) Date: Wed, 23 Oct 2013 14:43:46 +0200 Subject: [PATCHv3][ 2/5] dma: ipu: Add devicetree support. In-Reply-To: <1382532229-32755-1-git-send-email-denis@eukrea.com> References: <1382532229-32755-1-git-send-email-denis@eukrea.com> Message-ID: <1382532229-32755-2-git-send-email-denis@eukrea.com> To: linux-arm-kernel@lists.infradead.org List-Id: linux-arm-kernel.lists.infradead.org Cc: Rob Herring Cc: Pawel Moll Cc: Mark Rutland Cc: Stephen Warren Cc: Ian Campbell Cc: devicetree at vger.kernel.org Cc: Vinod Koul Cc: Dan Williams Cc: Sascha Hauer Cc: linux-arm-kernel at 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 at 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 at 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, -- 1.7.9.5