aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/gpio/gpio-ge.c
diff options
context:
space:
mode:
authorMartyn Welch <martyn.welch@ge.com>2012-03-12 13:13:00 -0400
committerKumar Gala <galak@kernel.crashing.org>2012-03-16 12:15:48 -0400
commite041013ac0df7fc7dea73c9ca73a33ab5b48d155 (patch)
tree223d3cc0558010519456af6caffa0df1fd4cf03f /drivers/gpio/gpio-ge.c
parent44b24b74abc37e3c0f28c8288178056f10074863 (diff)
powerpc/85xx: Board support for GE IMP3A
Initial board support for the GE IMP3A, a 3U compactPCI card with a p2020 processor. Signed-off-by: Martyn Welch <martyn.welch@ge.com> Signed-off-by: Kumar Gala <galak@kernel.crashing.org>
Diffstat (limited to 'drivers/gpio/gpio-ge.c')
-rw-r--r--drivers/gpio/gpio-ge.c28
1 files changed, 28 insertions, 0 deletions
diff --git a/drivers/gpio/gpio-ge.c b/drivers/gpio/gpio-ge.c
index f8e628952921..7b95a4a8318c 100644
--- a/drivers/gpio/gpio-ge.c
+++ b/drivers/gpio/gpio-ge.c
@@ -162,6 +162,34 @@ static int __init gef_gpio_init(void)
162 } 162 }
163 } 163 }
164 164
165 for_each_compatible_node(np, NULL, "ge,imp3a-gpio") {
166
167 pr_debug("%s: Initialising GE GPIO\n", np->full_name);
168
169 /* Allocate chip structure */
170 gef_gpio_chip = kzalloc(sizeof(*gef_gpio_chip), GFP_KERNEL);
171 if (!gef_gpio_chip) {
172 pr_err("%s: Unable to allocate structure\n",
173 np->full_name);
174 continue;
175 }
176
177 /* Setup pointers to chip functions */
178 gef_gpio_chip->gc.of_gpio_n_cells = 2;
179 gef_gpio_chip->gc.ngpio = 16;
180 gef_gpio_chip->gc.direction_input = gef_gpio_dir_in;
181 gef_gpio_chip->gc.direction_output = gef_gpio_dir_out;
182 gef_gpio_chip->gc.get = gef_gpio_get;
183 gef_gpio_chip->gc.set = gef_gpio_set;
184
185 /* This function adds a memory mapped GPIO chip */
186 retval = of_mm_gpiochip_add(np, gef_gpio_chip);
187 if (retval) {
188 kfree(gef_gpio_chip);
189 pr_err("%s: Unable to add GPIO\n", np->full_name);
190 }
191 }
192
165 return 0; 193 return 0;
166}; 194};
167arch_initcall(gef_gpio_init); 195arch_initcall(gef_gpio_init);