[PATCH 5/5] i2c: fsl: Add devicetree probe support

Sascha Hauer s.hauer at pengutronix.de
Mon May 20 16:11:24 EDT 2013


Signed-off-by: Sascha Hauer <s.hauer at pengutronix.de>
---
 drivers/i2c/busses/i2c-imx.c | 10 ++++++++++
 1 file changed, 10 insertions(+)

diff --git a/drivers/i2c/busses/i2c-imx.c b/drivers/i2c/busses/i2c-imx.c
index 9fcfd5c..c607bcb 100644
--- a/drivers/i2c/busses/i2c-imx.c
+++ b/drivers/i2c/busses/i2c-imx.c
@@ -545,6 +545,7 @@ static int __init i2c_fsl_probe(struct device_d *pdev)
 	i2c_fsl->adapter.master_xfer = i2c_fsl_xfer;
 	i2c_fsl->adapter.nr = pdev->id;
 	i2c_fsl->adapter.dev.parent = pdev;
+	i2c_fsl->adapter.dev.device_node = pdev->device_node;
 	i2c_fsl->base = dev_request_mem_region(pdev, 0);
 	i2c_fsl->dfsrr = -1;
 
@@ -572,8 +573,17 @@ fail:
 	return ret;
 }
 
+static __maybe_unused struct of_device_id imx_i2c_dt_ids[] = {
+	{
+		.compatible = "fsl,imx21-i2c",
+	}, {
+		/* sentinel */
+	}
+};
+
 static struct driver_d i2c_fsl_driver = {
 	.probe	= i2c_fsl_probe,
 	.name	= DRIVER_NAME,
+	.of_compatible = DRV_OF_COMPAT(imx_i2c_dt_ids),
 };
 device_platform_driver(i2c_fsl_driver);
-- 
1.8.2.rc2




More information about the barebox mailing list