* [PATCH 07/23] i2c: stu300: device tree support
@ 2013-04-22 9:53 ` Linus Walleij
0 siblings, 0 replies; 4+ messages in thread
From: Linus Walleij @ 2013-04-22 9:53 UTC (permalink / raw)
To: linux-arm-kernel
From: Linus Walleij <linus.walleij@linaro.org>
This adds device tree support for the ST DDC I2C driver known
as "stu300" in the kernel tree.
Cc: Wolfram Sang <wsa@the-dreams.de>
Signed-off-by: Linus Walleij <linus.walleij@linaro.org>
---
Wolfram, I'm seeking an ACK to take this with the other lump
of U300 device tree patches through the ARM SoC tree.
---
Documentation/devicetree/bindings/i2c/i2c-st-ddci2c.txt | 15 +++++++++++++++
drivers/i2c/busses/i2c-stu300.c | 12 ++++++++++++
2 files changed, 27 insertions(+)
create mode 100644 Documentation/devicetree/bindings/i2c/i2c-st-ddci2c.txt
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 0000000..bd81a48
--- /dev/null
+++ b/Documentation/devicetree/bindings/i2c/i2c-st-ddci2c.txt
@@ -0,0 +1,15 @@
+ST Microelectronics DDC I2C
+
+Required properties :
+- compatible : Must be "st,ddci2c"
+- reg: physical base address of the controller and length of memory mapped
+ region.
+- interrupts: interrupt number to the cpu.
+- #address-cells = <1>;
+- #size-cells = <0>;
+
+Optional properties:
+- Child nodes conforming to i2c bus binding
+
+Examples :
+
diff --git a/drivers/i2c/busses/i2c-stu300.c b/drivers/i2c/busses/i2c-stu300.c
index 0a6f941..1beaa05a 100644
--- a/drivers/i2c/busses/i2c-stu300.c
+++ b/drivers/i2c/busses/i2c-stu300.c
@@ -17,6 +17,7 @@
#include <linux/clk.h>
#include <linux/io.h>
#include <linux/slab.h>
+#include <linux/of_i2c.h>
/* the name of this kernel module */
#define NAME "stu300"
@@ -923,6 +924,7 @@ stu300_probe(struct platform_device *pdev)
adap->nr = bus_nr;
adap->algo = &stu300_algo;
adap->dev.parent = &pdev->dev;
+ adap->dev.of_node = pdev->dev.of_node;
i2c_set_adapdata(adap, dev);
/* i2c device drivers may be active on return from add_adapter() */
@@ -934,6 +936,10 @@ stu300_probe(struct platform_device *pdev)
}
platform_set_drvdata(pdev, dev);
+ dev_info(&pdev->dev, "ST DDC I2C @ %p, irq %d\n",
+ dev->virtbase, dev->irq);
+ of_i2c_register_devices(adap);
+
return 0;
}
@@ -978,11 +984,17 @@ stu300_remove(struct platform_device *pdev)
return 0;
}
+static const struct of_device_id stu300_dt_match[] = {
+ { .compatible = "st,ddci2c" },
+ {},
+};
+
static struct platform_driver stu300_i2c_driver = {
.driver = {
.name = NAME,
.owner = THIS_MODULE,
.pm = STU300_I2C_PM,
+ .of_match_table = stu300_dt_match,
},
.remove = __exit_p(stu300_remove),
--
1.7.11.3
^ permalink raw reply related [flat|nested] 4+ messages in thread* [PATCH 07/23] i2c: stu300: device tree support
@ 2013-04-22 9:53 ` Linus Walleij
0 siblings, 0 replies; 4+ messages in thread
From: Linus Walleij @ 2013-04-22 9:53 UTC (permalink / raw)
To: linux-arm-kernel-IAPFreCvJWM7uuMidbF8XUB+6BGkLq7r, Wolfram Sang
Cc: devicetree-discuss-uLR06cmDAlY/bJ5BZ2RsiQ
From: Linus Walleij <linus.walleij-QSEj5FYQhm4dnm+yROfE0A@public.gmane.org>
This adds device tree support for the ST DDC I2C driver known
as "stu300" in the kernel tree.
Cc: Wolfram Sang <wsa-z923LK4zBo2bacvFa/9K2g@public.gmane.org>
Signed-off-by: Linus Walleij <linus.walleij-QSEj5FYQhm4dnm+yROfE0A@public.gmane.org>
---
Wolfram, I'm seeking an ACK to take this with the other lump
of U300 device tree patches through the ARM SoC tree.
---
Documentation/devicetree/bindings/i2c/i2c-st-ddci2c.txt | 15 +++++++++++++++
drivers/i2c/busses/i2c-stu300.c | 12 ++++++++++++
2 files changed, 27 insertions(+)
create mode 100644 Documentation/devicetree/bindings/i2c/i2c-st-ddci2c.txt
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 0000000..bd81a48
--- /dev/null
+++ b/Documentation/devicetree/bindings/i2c/i2c-st-ddci2c.txt
@@ -0,0 +1,15 @@
+ST Microelectronics DDC I2C
+
+Required properties :
+- compatible : Must be "st,ddci2c"
+- reg: physical base address of the controller and length of memory mapped
+ region.
+- interrupts: interrupt number to the cpu.
+- #address-cells = <1>;
+- #size-cells = <0>;
+
+Optional properties:
+- Child nodes conforming to i2c bus binding
+
+Examples :
+
diff --git a/drivers/i2c/busses/i2c-stu300.c b/drivers/i2c/busses/i2c-stu300.c
index 0a6f941..1beaa05a 100644
--- a/drivers/i2c/busses/i2c-stu300.c
+++ b/drivers/i2c/busses/i2c-stu300.c
@@ -17,6 +17,7 @@
#include <linux/clk.h>
#include <linux/io.h>
#include <linux/slab.h>
+#include <linux/of_i2c.h>
/* the name of this kernel module */
#define NAME "stu300"
@@ -923,6 +924,7 @@ stu300_probe(struct platform_device *pdev)
adap->nr = bus_nr;
adap->algo = &stu300_algo;
adap->dev.parent = &pdev->dev;
+ adap->dev.of_node = pdev->dev.of_node;
i2c_set_adapdata(adap, dev);
/* i2c device drivers may be active on return from add_adapter() */
@@ -934,6 +936,10 @@ stu300_probe(struct platform_device *pdev)
}
platform_set_drvdata(pdev, dev);
+ dev_info(&pdev->dev, "ST DDC I2C @ %p, irq %d\n",
+ dev->virtbase, dev->irq);
+ of_i2c_register_devices(adap);
+
return 0;
}
@@ -978,11 +984,17 @@ stu300_remove(struct platform_device *pdev)
return 0;
}
+static const struct of_device_id stu300_dt_match[] = {
+ { .compatible = "st,ddci2c" },
+ {},
+};
+
static struct platform_driver stu300_i2c_driver = {
.driver = {
.name = NAME,
.owner = THIS_MODULE,
.pm = STU300_I2C_PM,
+ .of_match_table = stu300_dt_match,
},
.remove = __exit_p(stu300_remove),
--
1.7.11.3
^ permalink raw reply related [flat|nested] 4+ messages in thread* [PATCH 07/23] i2c: stu300: device tree support
2013-04-22 9:53 ` Linus Walleij
@ 2013-04-22 11:50 ` Wolfram Sang
-1 siblings, 0 replies; 4+ messages in thread
From: Wolfram Sang @ 2013-04-22 11:50 UTC (permalink / raw)
To: linux-arm-kernel
On Mon, Apr 22, 2013 at 11:53:03AM +0200, Linus Walleij wrote:
> From: Linus Walleij <linus.walleij@linaro.org>
>
> This adds device tree support for the ST DDC I2C driver known
> as "stu300" in the kernel tree.
>
> Cc: Wolfram Sang <wsa@the-dreams.de>
> Signed-off-by: Linus Walleij <linus.walleij@linaro.org>
> ---
> Wolfram, I'm seeking an ACK to take this with the other lump
> of U300 device tree patches through the ARM SoC tree.
Reviewed-by: Wolfram Sang <wsa@the-dreams.de>
^ permalink raw reply [flat|nested] 4+ messages in thread
* Re: [PATCH 07/23] i2c: stu300: device tree support
@ 2013-04-22 11:50 ` Wolfram Sang
0 siblings, 0 replies; 4+ messages in thread
From: Wolfram Sang @ 2013-04-22 11:50 UTC (permalink / raw)
To: Linus Walleij
Cc: devicetree-discuss, Arnd Bergmann, linux-arm-kernel,
Linus Walleij
On Mon, Apr 22, 2013 at 11:53:03AM +0200, Linus Walleij wrote:
> From: Linus Walleij <linus.walleij@linaro.org>
>
> This adds device tree support for the ST DDC I2C driver known
> as "stu300" in the kernel tree.
>
> Cc: Wolfram Sang <wsa@the-dreams.de>
> Signed-off-by: Linus Walleij <linus.walleij@linaro.org>
> ---
> Wolfram, I'm seeking an ACK to take this with the other lump
> of U300 device tree patches through the ARM SoC tree.
Reviewed-by: Wolfram Sang <wsa@the-dreams.de>
^ permalink raw reply [flat|nested] 4+ messages in thread
end of thread, other threads:[~2013-04-22 11:50 UTC | newest]
Thread overview: 4+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2013-04-22 9:53 [PATCH 07/23] i2c: stu300: device tree support Linus Walleij
2013-04-22 9:53 ` Linus Walleij
2013-04-22 11:50 ` Wolfram Sang
2013-04-22 11:50 ` Wolfram Sang
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.