]> asedeno.scripts.mit.edu Git - linux.git/commitdiff
ARM: bcm2835: add I2C controllers to DT
authorStephen Warren <swarren@wwwdotorg.org>
Tue, 1 Jan 2013 06:26:45 +0000 (23:26 -0700)
committerStephen Warren <swarren@wwwdotorg.org>
Tue, 15 Jan 2013 04:47:09 +0000 (21:47 -0700)
The BCM2835 has 3 identical I2C controllers. Instantiate them all in the
SoC .dtsi file, and enable the relevant two in the Raspberry Pi board
.dts file.

Note that on the Raspberry Pi Model B revision 1, I2C0 is connected to
the general-purpose expansion header, and I2C1 is connected to the camera
connector. Revision 2 of the board swaps these assignments:-(

Signed-off-by: Stephen Warren <swarren@wwwdotorg.org>
arch/arm/boot/dts/bcm2835-rpi-b.dts
arch/arm/boot/dts/bcm2835.dtsi

index 0544ef86062319250da5f2d3d5d3220f1945791f..aafda174a605b67c278580c0ce30a8669ef1ae20 100644 (file)
@@ -25,6 +25,16 @@ alt3: alt3 {
        };
 };
 
+&i2c0 {
+       status = "okay";
+       clock-frequency = <100000>;
+};
+
+&i2c1 {
+       status = "okay";
+       clock-frequency = <100000>;
+};
+
 &sdhci {
        status = "okay";
        bus-width = <4>;
index 1d7e4f5c0b1e1748853e999f53d2770222a97a2c..c69a591631b897083c30c5ee8c79aee6b7913487 100644 (file)
@@ -64,6 +64,22 @@ gpio: gpio {
                        #interrupt-cells = <2>;
                };
 
+               i2c0: i2c@20205000 {
+                       compatible = "brcm,bcm2835-i2c";
+                       reg = <0x7e205000 0x1000>;
+                       interrupts = <2 21>;
+                       clocks = <&clk_i2c>;
+                       status = "disabled";
+               };
+
+               i2c1: i2c@20804000 {
+                       compatible = "brcm,bcm2835-i2c";
+                       reg = <0x7e804000 0x1000>;
+                       interrupts = <2 21>;
+                       clocks = <&clk_i2c>;
+                       status = "disabled";
+               };
+
                sdhci: sdhci {
                        compatible = "brcm,bcm2835-sdhci";
                        reg = <0x7e300000 0x100>;
@@ -73,6 +89,12 @@ sdhci: sdhci {
                };
        };
 
+       clk_i2c: clock {
+               compatible = "fixed-clock";
+               #clock-cells = <0>;
+               clock-frequency = <150000000>;
+       };
+
        clk_mmc: clock {
                compatible = "fixed-clock";
                #clock-cells = <0>;