[PATCH 2/4] i2c: versatile: add devicetree support
Antony Pavlov
antonynpavlov at gmail.com
Thu Jun 19 14:28:38 PDT 2014
Signed-off-by: Antony Pavlov <antonynpavlov at gmail.com>
---
drivers/i2c/busses/i2c-versatile.c | 7 +++++++
1 file changed, 7 insertions(+)
diff --git a/drivers/i2c/busses/i2c-versatile.c b/drivers/i2c/busses/i2c-versatile.c
index d395e1d..4fead61 100644
--- a/drivers/i2c/busses/i2c-versatile.c
+++ b/drivers/i2c/busses/i2c-versatile.c
@@ -84,6 +84,7 @@ static int i2c_versatile_probe(struct device_d *dev)
i2c->adap.algo_data = &i2c->algo;
i2c->adap.dev.parent = dev;
+ i2c->adap.dev.device_node = dev->device_node;
i2c->algo = i2c_versatile_algo;
i2c->algo.data = i2c;
@@ -99,8 +100,14 @@ static int i2c_versatile_probe(struct device_d *dev)
return ret;
}
+static struct of_device_id i2c_versatile_match[] = {
+ { .compatible = "arm,versatile-i2c", },
+ {},
+};
+
static struct driver_d i2c_versatile_driver = {
.name = "versatile-i2c",
.probe = i2c_versatile_probe,
+ .of_compatible = DRV_OF_COMPAT(i2c_versatile_match),
};
device_platform_driver(i2c_versatile_driver);
--
1.9.2
More information about the barebox
mailing list