aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorLinus Walleij <linus.walleij@linaro.org>2013-06-09 18:17:56 -0400
committerLinus Walleij <linus.walleij@linaro.org>2013-08-06 18:59:06 -0400
commit66e0c12f9e17a1c97fc358f9e1f5e1dc615e279a (patch)
tree6fdc361e76ad63073cfa63a4f2b5b0723ab771fe
parentad81f0545ef01ea651886dddac4bef6cec930092 (diff)
ARM: nomadik: switch to use the Nomadik I2C driver
Instead of using bit-banged I2C, let's use the actual I2C driver in the kernel. Since the I2C block may be communicating with things like the PMIC, we need to select it from the Kconfig just like the bit-banged adapter is selected today. The rest of the configuration for this driver can be done from the device tree. Signed-off-by: Linus Walleij <linus.walleij@linaro.org>
-rw-r--r--arch/arm/boot/dts/ste-nomadik-stn8815.dtsi42
-rw-r--r--arch/arm/mach-nomadik/Kconfig1
2 files changed, 32 insertions, 11 deletions
diff --git a/arch/arm/boot/dts/ste-nomadik-stn8815.dtsi b/arch/arm/boot/dts/ste-nomadik-stn8815.dtsi
index a3acfa7b3dc9..9169d3025f39 100644
--- a/arch/arm/boot/dts/ste-nomadik-stn8815.dtsi
+++ b/arch/arm/boot/dts/ste-nomadik-stn8815.dtsi
@@ -140,18 +140,30 @@
140 }; 140 };
141 }; 141 };
142 i2c0 { 142 i2c0 {
143 i2c0_default_mux: i2c0_mux {
144 i2c0_default_mux {
145 ste,function = "i2c0";
146 ste,pins = "i2c0_a_1";
147 };
148 };
143 i2c0_default_mode: i2c0_default { 149 i2c0_default_mode: i2c0_default {
144 i2c0_default_cfg { 150 i2c0_default_cfg {
145 ste,pins = "GPIO62_D3", "GPIO63_D2"; 151 ste,pins = "GPIO62_D3", "GPIO63_D2";
146 ste,input = <1>; 152 ste,input = <0>;
147 }; 153 };
148 }; 154 };
149 }; 155 };
150 i2c1 { 156 i2c1 {
157 i2c1_default_mux: i2c1_mux {
158 i2c1_default_mux {
159 ste,function = "i2c1";
160 ste,pins = "i2c1_a_1";
161 };
162 };
151 i2c1_default_mode: i2c1_default { 163 i2c1_default_mode: i2c1_default {
152 i2c1_default_cfg { 164 i2c1_default_cfg {
153 ste,pins = "GPIO53_L4", "GPIO54_L3"; 165 ste,pins = "GPIO53_L4", "GPIO54_L3";
154 ste,input = <1>; 166 ste,input = <0>;
155 }; 167 };
156 }; 168 };
157 }; 169 };
@@ -159,7 +171,7 @@
159 i2c2_default_mode: i2c2_default { 171 i2c2_default_mode: i2c2_default {
160 i2c2_default_cfg { 172 i2c2_default_cfg {
161 ste,pins = "GPIO73_C21", "GPIO74_C20"; 173 ste,pins = "GPIO73_C21", "GPIO74_C20";
162 ste,input = <1>; 174 ste,input = <0>;
163 }; 175 };
164 }; 176 };
165 }; 177 };
@@ -682,13 +694,17 @@
682 694
683 /* I2C0 connected to the STw4811 power management chip */ 695 /* I2C0 connected to the STw4811 power management chip */
684 i2c0 { 696 i2c0 {
685 compatible = "i2c-gpio"; 697 compatible = "st,nomadik-i2c", "arm,primecell";
686 gpios = <&gpio1 31 0>, /* sda */ 698 reg = <0x101f8000 0x1000>;
687 <&gpio1 30 0>; /* scl */ 699 interrupt-parent = <&vica>;
700 interrupts = <20>;
701 clock-frequency = <100000>;
688 #address-cells = <1>; 702 #address-cells = <1>;
689 #size-cells = <0>; 703 #size-cells = <0>;
704 clocks = <&i2c0clk>, <&pclki2c0>;
705 clock-names = "mclk", "apb_pclk";
690 pinctrl-names = "default"; 706 pinctrl-names = "default";
691 pinctrl-0 = <&i2c0_default_mode>; 707 pinctrl-0 = <&i2c0_default_mux>, <&i2c0_default_mode>;
692 708
693 stw4811@2d { 709 stw4811@2d {
694 compatible = "st,stw4811"; 710 compatible = "st,stw4811";
@@ -698,13 +714,17 @@
698 714
699 /* I2C1 connected to various sensors */ 715 /* I2C1 connected to various sensors */
700 i2c1 { 716 i2c1 {
701 compatible = "i2c-gpio"; 717 compatible = "st,nomadik-i2c", "arm,primecell";
702 gpios = <&gpio1 22 0>, /* sda */ 718 reg = <0x101f7000 0x1000>;
703 <&gpio1 21 0>; /* scl */ 719 interrupt-parent = <&vica>;
720 interrupts = <21>;
721 clock-frequency = <100000>;
704 #address-cells = <1>; 722 #address-cells = <1>;
705 #size-cells = <0>; 723 #size-cells = <0>;
724 clocks = <&i2c1clk>, <&pclki2c1>;
725 clock-names = "mclk", "apb_pclk";
706 pinctrl-names = "default"; 726 pinctrl-names = "default";
707 pinctrl-0 = <&i2c1_default_mode>; 727 pinctrl-0 = <&i2c1_default_mux>, <&i2c1_default_mode>;
708 728
709 camera@2d { 729 camera@2d {
710 compatible = "st,camera"; 730 compatible = "st,camera";
diff --git a/arch/arm/mach-nomadik/Kconfig b/arch/arm/mach-nomadik/Kconfig
index 5981c3db9b41..4d42da49753c 100644
--- a/arch/arm/mach-nomadik/Kconfig
+++ b/arch/arm/mach-nomadik/Kconfig
@@ -27,6 +27,7 @@ config MACH_NOMADIK_8815NHK
27 select NOMADIK_8815 27 select NOMADIK_8815
28 select I2C 28 select I2C
29 select I2C_ALGOBIT 29 select I2C_ALGOBIT
30 select I2C_NOMADIK
30 31
31endmenu 32endmenu
32endif 33endif