aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/i2c/busses
diff options
context:
space:
mode:
authorLinus Walleij <linus.walleij@linaro.org>2013-04-11 08:59:47 -0400
committerLinus Walleij <linus.walleij@linaro.org>2013-05-31 05:25:51 -0400
commit8c58d891576c726bb8217842e955827ba8bb405a (patch)
treeac23e6dd91afcf2c39ccafaba705e380b5bf48de /drivers/i2c/busses
parent978577ea21fb05c12511c25b71e493859e36892f (diff)
i2c: stu300: device tree support
This adds device tree support for the ST DDC I2C driver known as "stu300" in the kernel tree. Reviewed-by: Wolfram Sang <wsa@the-dreams.de> Signed-off-by: Linus Walleij <linus.walleij@linaro.org>
Diffstat (limited to 'drivers/i2c/busses')
-rw-r--r--drivers/i2c/busses/i2c-stu300.c12
1 files changed, 12 insertions, 0 deletions
diff --git a/drivers/i2c/busses/i2c-stu300.c b/drivers/i2c/busses/i2c-stu300.c
index 0a6f941133f6..1beaa05a3d2c 100644
--- a/drivers/i2c/busses/i2c-stu300.c
+++ b/drivers/i2c/busses/i2c-stu300.c
@@ -17,6 +17,7 @@
17#include <linux/clk.h> 17#include <linux/clk.h>
18#include <linux/io.h> 18#include <linux/io.h>
19#include <linux/slab.h> 19#include <linux/slab.h>
20#include <linux/of_i2c.h>
20 21
21/* the name of this kernel module */ 22/* the name of this kernel module */
22#define NAME "stu300" 23#define NAME "stu300"
@@ -923,6 +924,7 @@ stu300_probe(struct platform_device *pdev)
923 adap->nr = bus_nr; 924 adap->nr = bus_nr;
924 adap->algo = &stu300_algo; 925 adap->algo = &stu300_algo;
925 adap->dev.parent = &pdev->dev; 926 adap->dev.parent = &pdev->dev;
927 adap->dev.of_node = pdev->dev.of_node;
926 i2c_set_adapdata(adap, dev); 928 i2c_set_adapdata(adap, dev);
927 929
928 /* i2c device drivers may be active on return from add_adapter() */ 930 /* i2c device drivers may be active on return from add_adapter() */
@@ -934,6 +936,10 @@ stu300_probe(struct platform_device *pdev)
934 } 936 }
935 937
936 platform_set_drvdata(pdev, dev); 938 platform_set_drvdata(pdev, dev);
939 dev_info(&pdev->dev, "ST DDC I2C @ %p, irq %d\n",
940 dev->virtbase, dev->irq);
941 of_i2c_register_devices(adap);
942
937 return 0; 943 return 0;
938} 944}
939 945
@@ -978,11 +984,17 @@ stu300_remove(struct platform_device *pdev)
978 return 0; 984 return 0;
979} 985}
980 986
987static const struct of_device_id stu300_dt_match[] = {
988 { .compatible = "st,ddci2c" },
989 {},
990};
991
981static struct platform_driver stu300_i2c_driver = { 992static struct platform_driver stu300_i2c_driver = {
982 .driver = { 993 .driver = {
983 .name = NAME, 994 .name = NAME,
984 .owner = THIS_MODULE, 995 .owner = THIS_MODULE,
985 .pm = STU300_I2C_PM, 996 .pm = STU300_I2C_PM,
997 .of_match_table = stu300_dt_match,
986 }, 998 },
987 .remove = __exit_p(stu300_remove), 999 .remove = __exit_p(stu300_remove),
988 1000