gpio-ge.c (6518bb69f463446a1552f52093cc699497f18fe0) gpio-ge.c (e041013ac0df7fc7dea73c9ca73a33ab5b48d155)
1/*
2 * Driver for GE FPGA based GPIO
3 *
4 * Author: Martyn Welch <martyn.welch@ge.com>
5 *
6 * 2008 (c) GE Intelligent Platforms Embedded Systems, Inc.
7 *
8 * This file is licensed under the terms of the GNU General Public License

--- 148 unchanged lines hidden (view full) ---

157 /* This function adds a memory mapped GPIO chip */
158 retval = of_mm_gpiochip_add(np, gef_gpio_chip);
159 if (retval) {
160 kfree(gef_gpio_chip);
161 pr_err("%s: Unable to add GPIO\n", np->full_name);
162 }
163 }
164
1/*
2 * Driver for GE FPGA based GPIO
3 *
4 * Author: Martyn Welch <martyn.welch@ge.com>
5 *
6 * 2008 (c) GE Intelligent Platforms Embedded Systems, Inc.
7 *
8 * This file is licensed under the terms of the GNU General Public License

--- 148 unchanged lines hidden (view full) ---

157 /* This function adds a memory mapped GPIO chip */
158 retval = of_mm_gpiochip_add(np, gef_gpio_chip);
159 if (retval) {
160 kfree(gef_gpio_chip);
161 pr_err("%s: Unable to add GPIO\n", np->full_name);
162 }
163 }
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;
166};
167arch_initcall(gef_gpio_init);
168
169MODULE_DESCRIPTION("GE I/O FPGA GPIO driver");
170MODULE_AUTHOR("Martyn Welch <martyn.welch@ge.com");
171MODULE_LICENSE("GPL");
193 return 0;
194};
195arch_initcall(gef_gpio_init);
196
197MODULE_DESCRIPTION("GE I/O FPGA GPIO driver");
198MODULE_AUTHOR("Martyn Welch <martyn.welch@ge.com");
199MODULE_LICENSE("GPL");