diff options
Diffstat (limited to 'drivers/i2c/busses/i2c-mxs.c')
-rw-r--r-- | drivers/i2c/busses/i2c-mxs.c | 13 |
1 files changed, 13 insertions, 0 deletions
diff --git a/drivers/i2c/busses/i2c-mxs.c b/drivers/i2c/busses/i2c-mxs.c index 7fa73eed84a7..7dca58b0e746 100644 --- a/drivers/i2c/busses/i2c-mxs.c +++ b/drivers/i2c/busses/i2c-mxs.c | |||
@@ -27,6 +27,9 @@ | |||
27 | #include <linux/jiffies.h> | 27 | #include <linux/jiffies.h> |
28 | #include <linux/io.h> | 28 | #include <linux/io.h> |
29 | #include <linux/pinctrl/consumer.h> | 29 | #include <linux/pinctrl/consumer.h> |
30 | #include <linux/of.h> | ||
31 | #include <linux/of_device.h> | ||
32 | #include <linux/of_i2c.h> | ||
30 | 33 | ||
31 | #include <mach/common.h> | 34 | #include <mach/common.h> |
32 | 35 | ||
@@ -371,6 +374,7 @@ static int __devinit mxs_i2c_probe(struct platform_device *pdev) | |||
371 | adap->algo = &mxs_i2c_algo; | 374 | adap->algo = &mxs_i2c_algo; |
372 | adap->dev.parent = dev; | 375 | adap->dev.parent = dev; |
373 | adap->nr = pdev->id; | 376 | adap->nr = pdev->id; |
377 | adap->dev.of_node = pdev->dev.of_node; | ||
374 | i2c_set_adapdata(adap, i2c); | 378 | i2c_set_adapdata(adap, i2c); |
375 | err = i2c_add_numbered_adapter(adap); | 379 | err = i2c_add_numbered_adapter(adap); |
376 | if (err) { | 380 | if (err) { |
@@ -380,6 +384,8 @@ static int __devinit mxs_i2c_probe(struct platform_device *pdev) | |||
380 | return err; | 384 | return err; |
381 | } | 385 | } |
382 | 386 | ||
387 | of_i2c_register_devices(adap); | ||
388 | |||
383 | return 0; | 389 | return 0; |
384 | } | 390 | } |
385 | 391 | ||
@@ -399,10 +405,17 @@ static int __devexit mxs_i2c_remove(struct platform_device *pdev) | |||
399 | return 0; | 405 | return 0; |
400 | } | 406 | } |
401 | 407 | ||
408 | static const struct of_device_id mxs_i2c_dt_ids[] = { | ||
409 | { .compatible = "fsl,imx28-i2c", }, | ||
410 | { /* sentinel */ } | ||
411 | }; | ||
412 | MODULE_DEVICE_TABLE(of, mxs_i2c_dt_ids); | ||
413 | |||
402 | static struct platform_driver mxs_i2c_driver = { | 414 | static struct platform_driver mxs_i2c_driver = { |
403 | .driver = { | 415 | .driver = { |
404 | .name = DRIVER_NAME, | 416 | .name = DRIVER_NAME, |
405 | .owner = THIS_MODULE, | 417 | .owner = THIS_MODULE, |
418 | .of_match_table = mxs_i2c_dt_ids, | ||
406 | }, | 419 | }, |
407 | .remove = __devexit_p(mxs_i2c_remove), | 420 | .remove = __devexit_p(mxs_i2c_remove), |
408 | }; | 421 | }; |