aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--Documentation/devicetree/bindings/i2c/i2c-st-ddci2c.txt15
-rw-r--r--drivers/i2c/busses/i2c-stu300.c12
2 files changed, 27 insertions, 0 deletions
diff --git a/Documentation/devicetree/bindings/i2c/i2c-st-ddci2c.txt b/Documentation/devicetree/bindings/i2c/i2c-st-ddci2c.txt
new file mode 100644
index 000000000000..bd81a482634f
--- /dev/null
+++ b/Documentation/devicetree/bindings/i2c/i2c-st-ddci2c.txt
@@ -0,0 +1,15 @@
1ST Microelectronics DDC I2C
2
3Required properties :
4- compatible : Must be "st,ddci2c"
5- reg: physical base address of the controller and length of memory mapped
6 region.
7- interrupts: interrupt number to the cpu.
8- #address-cells = <1>;
9- #size-cells = <0>;
10
11Optional properties:
12- Child nodes conforming to i2c bus binding
13
14Examples :
15
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