aboutsummaryrefslogtreecommitdiffstats
path: root/arch
diff options
context:
space:
mode:
authorBenoit Cousson <b-cousson@ti.com>2011-08-16 05:51:54 -0400
committerBenoit Cousson <b-cousson@ti.com>2012-03-12 09:58:22 -0400
commite3e5a92db430689fe918041e99cb04b8761f5a50 (patch)
tree59e7b7a3cea73f32932d3b82d82c9bab51c87da7 /arch
parent93651b85bbd1479321af1de0d14ca95c231e538a (diff)
arm/dts: OMAP4: Add gpio nodes
Add the 6 GPIOs controller nodes present in OMAP4. Remove gpio static device initialisation if DT is populated. Signed-off-by: Benoit Cousson <b-cousson@ti.com> Cc: Grant Likely <grant.likely@secretlab.ca>
Diffstat (limited to 'arch')
-rw-r--r--arch/arm/boot/dts/omap4.dtsi54
-rw-r--r--arch/arm/mach-omap2/gpio.c8
2 files changed, 60 insertions, 2 deletions
diff --git a/arch/arm/boot/dts/omap4.dtsi b/arch/arm/boot/dts/omap4.dtsi
index 3d35559e77bc..7f8463b666fd 100644
--- a/arch/arm/boot/dts/omap4.dtsi
+++ b/arch/arm/boot/dts/omap4.dtsi
@@ -104,6 +104,60 @@
104 <0x48240100 0x0100>; 104 <0x48240100 0x0100>;
105 }; 105 };
106 106
107 gpio1: gpio@4a310000 {
108 compatible = "ti,omap4-gpio";
109 ti,hwmods = "gpio1";
110 gpio-controller;
111 #gpio-cells = <2>;
112 interrupt-controller;
113 #interrupt-cells = <1>;
114 };
115
116 gpio2: gpio@48055000 {
117 compatible = "ti,omap4-gpio";
118 ti,hwmods = "gpio2";
119 gpio-controller;
120 #gpio-cells = <2>;
121 interrupt-controller;
122 #interrupt-cells = <1>;
123 };
124
125 gpio3: gpio@48057000 {
126 compatible = "ti,omap4-gpio";
127 ti,hwmods = "gpio3";
128 gpio-controller;
129 #gpio-cells = <2>;
130 interrupt-controller;
131 #interrupt-cells = <1>;
132 };
133
134 gpio4: gpio@48059000 {
135 compatible = "ti,omap4-gpio";
136 ti,hwmods = "gpio4";
137 gpio-controller;
138 #gpio-cells = <2>;
139 interrupt-controller;
140 #interrupt-cells = <1>;
141 };
142
143 gpio5: gpio@4805b000 {
144 compatible = "ti,omap4-gpio";
145 ti,hwmods = "gpio5";
146 gpio-controller;
147 #gpio-cells = <2>;
148 interrupt-controller;
149 #interrupt-cells = <1>;
150 };
151
152 gpio6: gpio@4805d000 {
153 compatible = "ti,omap4-gpio";
154 ti,hwmods = "gpio6";
155 gpio-controller;
156 #gpio-cells = <2>;
157 interrupt-controller;
158 #interrupt-cells = <1>;
159 };
160
107 uart1: serial@4806a000 { 161 uart1: serial@4806a000 {
108 compatible = "ti,omap4-uart"; 162 compatible = "ti,omap4-uart";
109 ti,hwmods = "uart1"; 163 ti,hwmods = "uart1";
diff --git a/arch/arm/mach-omap2/gpio.c b/arch/arm/mach-omap2/gpio.c
index 8cbfbc2918ce..8412746bad71 100644
--- a/arch/arm/mach-omap2/gpio.c
+++ b/arch/arm/mach-omap2/gpio.c
@@ -20,6 +20,7 @@
20#include <linux/err.h> 20#include <linux/err.h>
21#include <linux/slab.h> 21#include <linux/slab.h>
22#include <linux/interrupt.h> 22#include <linux/interrupt.h>
23#include <linux/of.h>
23 24
24#include <plat/omap_hwmod.h> 25#include <plat/omap_hwmod.h>
25#include <plat/omap_device.h> 26#include <plat/omap_device.h>
@@ -122,7 +123,10 @@ static int omap2_gpio_dev_init(struct omap_hwmod *oh, void *unused)
122 */ 123 */
123static int __init omap2_gpio_init(void) 124static int __init omap2_gpio_init(void)
124{ 125{
125 return omap_hwmod_for_each_by_class("gpio", omap2_gpio_dev_init, 126 /* If dtb is there, the devices will be created dynamically */
126 NULL); 127 if (of_have_populated_dt())
128 return -ENODEV;
129
130 return omap_hwmod_for_each_by_class("gpio", omap2_gpio_dev_init, NULL);
127} 131}
128postcore_initcall(omap2_gpio_init); 132postcore_initcall(omap2_gpio_init);