Patchwork [4/6] ata: i.MX PATA: add devicetree support

login
register
mail settings
Submitter Sascha Hauer
Date April 4, 2013, 9:25 a.m.
Message ID <1365067509-10186-5-git-send-email-s.hauer@pengutronix.de>
Download mbox | patch
Permalink /patch/233692/
State Not Applicable
Delegated to: David Miller
Headers show

Comments

Sascha Hauer - April 4, 2013, 9:25 a.m.
Not much to do here, only the compatible entries have to be added.

Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
---
 Documentation/devicetree/bindings/ata/imx-pata.txt | 17 +++++++++++++++++
 drivers/ata/pata_imx.c                             |  9 +++++++++
 2 files changed, 26 insertions(+)
 create mode 100644 Documentation/devicetree/bindings/ata/imx-pata.txt
Jeff Garzik - April 11, 2013, 11:38 p.m.
On 04/04/2013 05:25 AM, Sascha Hauer wrote:
> Not much to do here, only the compatible entries have to be added.
>
> Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
> ---
>   Documentation/devicetree/bindings/ata/imx-pata.txt | 17 +++++++++++++++++
>   drivers/ata/pata_imx.c                             |  9 +++++++++
>   2 files changed, 26 insertions(+)
>   create mode 100644 Documentation/devicetree/bindings/ata/imx-pata.txt

applied 1-4



--
To unsubscribe from this list: send the line "unsubscribe linux-ide" in
the body of a message to majordomo@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html

Patch

diff --git a/Documentation/devicetree/bindings/ata/imx-pata.txt b/Documentation/devicetree/bindings/ata/imx-pata.txt
new file mode 100644
index 0000000..e38d734
--- /dev/null
+++ b/Documentation/devicetree/bindings/ata/imx-pata.txt
@@ -0,0 +1,17 @@ 
+* Freescale i.MX PATA Controller
+
+Required properties:
+- compatible: "fsl,imx27-pata"
+- reg: Address range of the PATA Controller
+- interrupts: The interrupt of the PATA Controller
+- clocks: the clocks for the PATA Controller
+
+Example:
+
+	pata: pata@83fe0000 {
+		compatible = "fsl,imx51-pata", "fsl,imx27-pata";
+		reg = <0x83fe0000 0x4000>;
+		interrupts = <70>;
+		clocks = <&clks 161>;
+		status = "disabled";
+	};
diff --git a/drivers/ata/pata_imx.c b/drivers/ata/pata_imx.c
index adbb01d..aa3d166 100644
--- a/drivers/ata/pata_imx.c
+++ b/drivers/ata/pata_imx.c
@@ -230,11 +230,20 @@  static const struct dev_pm_ops pata_imx_pm_ops = {
 };
 #endif
 
+static const struct of_device_id imx_pata_dt_ids[] = {
+	{
+		.compatible = "fsl,imx27-pata",
+	}, {
+		/* sentinel */
+	}
+};
+
 static struct platform_driver pata_imx_driver = {
 	.probe		= pata_imx_probe,
 	.remove		= pata_imx_remove,
 	.driver = {
 		.name		= DRV_NAME,
+		.of_match_table	= imx_pata_dt_ids,
 		.owner		= THIS_MODULE,
 #ifdef CONFIG_PM
 		.pm		= &pata_imx_pm_ops,