blob: 3775dccef4adc2d2f0d9557401c105a8aecfc006 [file] [log] [blame]
Juergen Beisert07bd1a62008-07-05 10:02:49 +02001/*
2 * MXC GPIO support. (c) 2008 Daniel Mack <daniel@caiaq.de>
3 * Copyright 2008 Juergen Beisert, kernel@pengutronix.de
4 *
5 * Based on code from Freescale,
Dinh Nguyene24798e2010-04-22 16:28:42 +03006 * Copyright (C) 2004-2010 Freescale Semiconductor, Inc. All Rights Reserved.
Juergen Beisert07bd1a62008-07-05 10:02:49 +02007 *
8 * This program is free software; you can redistribute it and/or
9 * modify it under the terms of the GNU General Public License
10 * as published by the Free Software Foundation; either version 2
11 * of the License, or (at your option) any later version.
12 * This program is distributed in the hope that it will be useful,
13 * but WITHOUT ANY WARRANTY; without even the implied warranty of
14 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
15 * GNU General Public License for more details.
16 *
17 * You should have received a copy of the GNU General Public License
18 * along with this program; if not, write to the Free Software
19 * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
20 */
21
22#include <linux/init.h>
Dinh Nguyena3484ff2010-10-23 09:12:48 -050023#include <linux/interrupt.h>
Juergen Beisert07bd1a62008-07-05 10:02:49 +020024#include <linux/io.h>
25#include <linux/irq.h>
26#include <linux/gpio.h>
Shawn Guob78d8e52011-06-06 00:07:55 +080027#include <linux/platform_device.h>
28#include <linux/slab.h>
Shawn Guo2ce420d2011-06-06 13:22:41 +080029#include <linux/basic_mmio_gpio.h>
Juergen Beisert07bd1a62008-07-05 10:02:49 +020030#include <asm-generic/bug.h>
31
Shawn Guoe7fc6ae2011-07-07 00:37:41 +080032enum mxc_gpio_hwtype {
33 IMX1_GPIO, /* runs on i.mx1 */
34 IMX21_GPIO, /* runs on i.mx21 and i.mx27 */
35 IMX31_GPIO, /* runs on all other i.mx */
36};
37
38/* device type dependent stuff */
39struct mxc_gpio_hwdata {
40 unsigned dr_reg;
41 unsigned gdir_reg;
42 unsigned psr_reg;
43 unsigned icr1_reg;
44 unsigned icr2_reg;
45 unsigned imr_reg;
46 unsigned isr_reg;
47 unsigned low_level;
48 unsigned high_level;
49 unsigned rise_edge;
50 unsigned fall_edge;
51};
52
Shawn Guob78d8e52011-06-06 00:07:55 +080053struct mxc_gpio_port {
54 struct list_head node;
55 void __iomem *base;
56 int irq;
57 int irq_high;
58 int virtual_irq_start;
Shawn Guo2ce420d2011-06-06 13:22:41 +080059 struct bgpio_chip bgc;
Shawn Guob78d8e52011-06-06 00:07:55 +080060 u32 both_edges;
Shawn Guob78d8e52011-06-06 00:07:55 +080061};
62
Shawn Guoe7fc6ae2011-07-07 00:37:41 +080063static struct mxc_gpio_hwdata imx1_imx21_gpio_hwdata = {
64 .dr_reg = 0x1c,
65 .gdir_reg = 0x00,
66 .psr_reg = 0x24,
67 .icr1_reg = 0x28,
68 .icr2_reg = 0x2c,
69 .imr_reg = 0x30,
70 .isr_reg = 0x34,
71 .low_level = 0x03,
72 .high_level = 0x02,
73 .rise_edge = 0x00,
74 .fall_edge = 0x01,
75};
76
77static struct mxc_gpio_hwdata imx31_gpio_hwdata = {
78 .dr_reg = 0x00,
79 .gdir_reg = 0x04,
80 .psr_reg = 0x08,
81 .icr1_reg = 0x0c,
82 .icr2_reg = 0x10,
83 .imr_reg = 0x14,
84 .isr_reg = 0x18,
85 .low_level = 0x00,
86 .high_level = 0x01,
87 .rise_edge = 0x02,
88 .fall_edge = 0x03,
89};
90
91static enum mxc_gpio_hwtype mxc_gpio_hwtype;
92static struct mxc_gpio_hwdata *mxc_gpio_hwdata;
93
94#define GPIO_DR (mxc_gpio_hwdata->dr_reg)
95#define GPIO_GDIR (mxc_gpio_hwdata->gdir_reg)
96#define GPIO_PSR (mxc_gpio_hwdata->psr_reg)
97#define GPIO_ICR1 (mxc_gpio_hwdata->icr1_reg)
98#define GPIO_ICR2 (mxc_gpio_hwdata->icr2_reg)
99#define GPIO_IMR (mxc_gpio_hwdata->imr_reg)
100#define GPIO_ISR (mxc_gpio_hwdata->isr_reg)
101
102#define GPIO_INT_LOW_LEV (mxc_gpio_hwdata->low_level)
103#define GPIO_INT_HIGH_LEV (mxc_gpio_hwdata->high_level)
104#define GPIO_INT_RISE_EDGE (mxc_gpio_hwdata->rise_edge)
105#define GPIO_INT_FALL_EDGE (mxc_gpio_hwdata->fall_edge)
106#define GPIO_INT_NONE 0x4
107
108static struct platform_device_id mxc_gpio_devtype[] = {
109 {
110 .name = "imx1-gpio",
111 .driver_data = IMX1_GPIO,
112 }, {
113 .name = "imx21-gpio",
114 .driver_data = IMX21_GPIO,
115 }, {
116 .name = "imx31-gpio",
117 .driver_data = IMX31_GPIO,
118 }, {
119 /* sentinel */
120 }
121};
122
Shawn Guob78d8e52011-06-06 00:07:55 +0800123/*
124 * MX2 has one interrupt *for all* gpio ports. The list is used
125 * to save the references to all ports, so that mx2_gpio_irq_handler
126 * can walk through all interrupt status registers.
127 */
128static LIST_HEAD(mxc_gpio_ports);
Juergen Beisert07bd1a62008-07-05 10:02:49 +0200129
130/* Note: This driver assumes 32 GPIOs are handled in one register */
131
Lennert Buytenhek4d935792010-11-29 11:16:23 +0100132static int gpio_set_irq_type(struct irq_data *d, u32 type)
Juergen Beisert07bd1a62008-07-05 10:02:49 +0200133{
Lennert Buytenhek4d935792010-11-29 11:16:23 +0100134 u32 gpio = irq_to_gpio(d->irq);
Shawn Guoe4ea9332011-06-07 16:25:37 +0800135 struct irq_chip_generic *gc = irq_data_get_irq_chip_data(d);
136 struct mxc_gpio_port *port = gc->private;
Juergen Beisert07bd1a62008-07-05 10:02:49 +0200137 u32 bit, val;
138 int edge;
139 void __iomem *reg = port->base;
140
Guennadi Liakhovetski910862e2009-03-12 12:46:41 +0100141 port->both_edges &= ~(1 << (gpio & 31));
Juergen Beisert07bd1a62008-07-05 10:02:49 +0200142 switch (type) {
Dmitry Baryshkov6cab4862008-07-27 04:23:31 +0100143 case IRQ_TYPE_EDGE_RISING:
Juergen Beisert07bd1a62008-07-05 10:02:49 +0200144 edge = GPIO_INT_RISE_EDGE;
145 break;
Dmitry Baryshkov6cab4862008-07-27 04:23:31 +0100146 case IRQ_TYPE_EDGE_FALLING:
Juergen Beisert07bd1a62008-07-05 10:02:49 +0200147 edge = GPIO_INT_FALL_EDGE;
148 break;
Guennadi Liakhovetski910862e2009-03-12 12:46:41 +0100149 case IRQ_TYPE_EDGE_BOTH:
Shawn Guo5523f86b2011-06-12 01:33:29 +0800150 val = gpio_get_value(gpio);
Guennadi Liakhovetski910862e2009-03-12 12:46:41 +0100151 if (val) {
152 edge = GPIO_INT_LOW_LEV;
153 pr_debug("mxc: set GPIO %d to low trigger\n", gpio);
154 } else {
155 edge = GPIO_INT_HIGH_LEV;
156 pr_debug("mxc: set GPIO %d to high trigger\n", gpio);
157 }
158 port->both_edges |= 1 << (gpio & 31);
159 break;
Dmitry Baryshkov6cab4862008-07-27 04:23:31 +0100160 case IRQ_TYPE_LEVEL_LOW:
Juergen Beisert07bd1a62008-07-05 10:02:49 +0200161 edge = GPIO_INT_LOW_LEV;
162 break;
Dmitry Baryshkov6cab4862008-07-27 04:23:31 +0100163 case IRQ_TYPE_LEVEL_HIGH:
Juergen Beisert07bd1a62008-07-05 10:02:49 +0200164 edge = GPIO_INT_HIGH_LEV;
165 break;
Guennadi Liakhovetski910862e2009-03-12 12:46:41 +0100166 default:
Juergen Beisert07bd1a62008-07-05 10:02:49 +0200167 return -EINVAL;
168 }
169
170 reg += GPIO_ICR1 + ((gpio & 0x10) >> 2); /* lower or upper register */
171 bit = gpio & 0xf;
Shawn Guob78d8e52011-06-06 00:07:55 +0800172 val = readl(reg) & ~(0x3 << (bit << 1));
173 writel(val | (edge << (bit << 1)), reg);
Shawn Guoe4ea9332011-06-07 16:25:37 +0800174 writel(1 << (gpio & 0x1f), port->base + GPIO_ISR);
Juergen Beisert07bd1a62008-07-05 10:02:49 +0200175
176 return 0;
177}
178
Guennadi Liakhovetski910862e2009-03-12 12:46:41 +0100179static void mxc_flip_edge(struct mxc_gpio_port *port, u32 gpio)
180{
181 void __iomem *reg = port->base;
182 u32 bit, val;
183 int edge;
184
185 reg += GPIO_ICR1 + ((gpio & 0x10) >> 2); /* lower or upper register */
186 bit = gpio & 0xf;
Shawn Guob78d8e52011-06-06 00:07:55 +0800187 val = readl(reg);
Guennadi Liakhovetski910862e2009-03-12 12:46:41 +0100188 edge = (val >> (bit << 1)) & 3;
189 val &= ~(0x3 << (bit << 1));
Uwe Kleine-König3d40f7f2010-02-05 22:14:37 +0100190 if (edge == GPIO_INT_HIGH_LEV) {
Guennadi Liakhovetski910862e2009-03-12 12:46:41 +0100191 edge = GPIO_INT_LOW_LEV;
192 pr_debug("mxc: switch GPIO %d to low trigger\n", gpio);
Uwe Kleine-König3d40f7f2010-02-05 22:14:37 +0100193 } else if (edge == GPIO_INT_LOW_LEV) {
Guennadi Liakhovetski910862e2009-03-12 12:46:41 +0100194 edge = GPIO_INT_HIGH_LEV;
195 pr_debug("mxc: switch GPIO %d to high trigger\n", gpio);
Uwe Kleine-König3d40f7f2010-02-05 22:14:37 +0100196 } else {
Guennadi Liakhovetski910862e2009-03-12 12:46:41 +0100197 pr_err("mxc: invalid configuration for GPIO %d: %x\n",
198 gpio, edge);
199 return;
200 }
Shawn Guob78d8e52011-06-06 00:07:55 +0800201 writel(val | (edge << (bit << 1)), reg);
Guennadi Liakhovetski910862e2009-03-12 12:46:41 +0100202}
203
Uwe Kleine-König3621f182010-02-08 21:02:30 +0100204/* handle 32 interrupts in one status register */
Juergen Beisert07bd1a62008-07-05 10:02:49 +0200205static void mxc_gpio_irq_handler(struct mxc_gpio_port *port, u32 irq_stat)
206{
Uwe Kleine-König3621f182010-02-08 21:02:30 +0100207 u32 gpio_irq_no_base = port->virtual_irq_start;
Juergen Beisert07bd1a62008-07-05 10:02:49 +0200208
Uwe Kleine-König3621f182010-02-08 21:02:30 +0100209 while (irq_stat != 0) {
210 int irqoffset = fls(irq_stat) - 1;
Juergen Beisert07bd1a62008-07-05 10:02:49 +0200211
Uwe Kleine-König3621f182010-02-08 21:02:30 +0100212 if (port->both_edges & (1 << irqoffset))
213 mxc_flip_edge(port, irqoffset);
Guennadi Liakhovetski910862e2009-03-12 12:46:41 +0100214
Uwe Kleine-König3621f182010-02-08 21:02:30 +0100215 generic_handle_irq(gpio_irq_no_base + irqoffset);
Guennadi Liakhovetski910862e2009-03-12 12:46:41 +0100216
Uwe Kleine-König3621f182010-02-08 21:02:30 +0100217 irq_stat &= ~(1 << irqoffset);
Juergen Beisert07bd1a62008-07-05 10:02:49 +0200218 }
219}
220
Paulius Zaleckascfca8b52008-11-14 11:01:38 +0100221/* MX1 and MX3 has one interrupt *per* gpio port */
Juergen Beisert07bd1a62008-07-05 10:02:49 +0200222static void mx3_gpio_irq_handler(u32 irq, struct irq_desc *desc)
223{
224 u32 irq_stat;
Thomas Gleixner6845664a2011-03-24 13:25:22 +0100225 struct mxc_gpio_port *port = irq_get_handler_data(irq);
Juergen Beisert07bd1a62008-07-05 10:02:49 +0200226
Shawn Guob78d8e52011-06-06 00:07:55 +0800227 irq_stat = readl(port->base + GPIO_ISR) & readl(port->base + GPIO_IMR);
Sascha Hauere2c97e72009-04-21 12:39:59 +0200228
Juergen Beisert07bd1a62008-07-05 10:02:49 +0200229 mxc_gpio_irq_handler(port, irq_stat);
230}
Juergen Beisert07bd1a62008-07-05 10:02:49 +0200231
Juergen Beisert07bd1a62008-07-05 10:02:49 +0200232/* MX2 has one interrupt *for all* gpio ports */
233static void mx2_gpio_irq_handler(u32 irq, struct irq_desc *desc)
234{
Juergen Beisert07bd1a62008-07-05 10:02:49 +0200235 u32 irq_msk, irq_stat;
Shawn Guob78d8e52011-06-06 00:07:55 +0800236 struct mxc_gpio_port *port;
Juergen Beisert07bd1a62008-07-05 10:02:49 +0200237
238 /* walk through all interrupt status registers */
Shawn Guob78d8e52011-06-06 00:07:55 +0800239 list_for_each_entry(port, &mxc_gpio_ports, node) {
240 irq_msk = readl(port->base + GPIO_IMR);
Juergen Beisert07bd1a62008-07-05 10:02:49 +0200241 if (!irq_msk)
242 continue;
243
Shawn Guob78d8e52011-06-06 00:07:55 +0800244 irq_stat = readl(port->base + GPIO_ISR) & irq_msk;
Juergen Beisert07bd1a62008-07-05 10:02:49 +0200245 if (irq_stat)
Shawn Guob78d8e52011-06-06 00:07:55 +0800246 mxc_gpio_irq_handler(port, irq_stat);
Juergen Beisert07bd1a62008-07-05 10:02:49 +0200247 }
248}
Juergen Beisert07bd1a62008-07-05 10:02:49 +0200249
Dinh Nguyena3484ff2010-10-23 09:12:48 -0500250/*
251 * Set interrupt number "irq" in the GPIO as a wake-up source.
252 * While system is running, all registered GPIO interrupts need to have
253 * wake-up enabled. When system is suspended, only selected GPIO interrupts
254 * need to have wake-up enabled.
255 * @param irq interrupt source number
256 * @param enable enable as wake-up if equal to non-zero
257 * @return This function returns 0 on success.
258 */
Lennert Buytenhek4d935792010-11-29 11:16:23 +0100259static int gpio_set_wake_irq(struct irq_data *d, u32 enable)
Dinh Nguyena3484ff2010-10-23 09:12:48 -0500260{
Lennert Buytenhek4d935792010-11-29 11:16:23 +0100261 u32 gpio = irq_to_gpio(d->irq);
Dinh Nguyena3484ff2010-10-23 09:12:48 -0500262 u32 gpio_idx = gpio & 0x1F;
Shawn Guoe4ea9332011-06-07 16:25:37 +0800263 struct irq_chip_generic *gc = irq_data_get_irq_chip_data(d);
264 struct mxc_gpio_port *port = gc->private;
Dinh Nguyena3484ff2010-10-23 09:12:48 -0500265
266 if (enable) {
267 if (port->irq_high && (gpio_idx >= 16))
268 enable_irq_wake(port->irq_high);
269 else
270 enable_irq_wake(port->irq);
271 } else {
272 if (port->irq_high && (gpio_idx >= 16))
273 disable_irq_wake(port->irq_high);
274 else
275 disable_irq_wake(port->irq);
276 }
277
278 return 0;
279}
280
Shawn Guoe4ea9332011-06-07 16:25:37 +0800281static void __init mxc_gpio_init_gc(struct mxc_gpio_port *port)
282{
283 struct irq_chip_generic *gc;
284 struct irq_chip_type *ct;
Juergen Beisert07bd1a62008-07-05 10:02:49 +0200285
Shawn Guoe4ea9332011-06-07 16:25:37 +0800286 gc = irq_alloc_generic_chip("gpio-mxc", 1, port->virtual_irq_start,
287 port->base, handle_level_irq);
288 gc->private = port;
289
290 ct = gc->chip_types;
291 ct->chip.irq_ack = irq_gc_ack,
292 ct->chip.irq_mask = irq_gc_mask_clr_bit;
293 ct->chip.irq_unmask = irq_gc_mask_set_bit;
294 ct->chip.irq_set_type = gpio_set_irq_type;
295 ct->chip.irq_set_wake = gpio_set_wake_irq,
296 ct->regs.ack = GPIO_ISR;
297 ct->regs.mask = GPIO_IMR;
298
299 irq_setup_generic_chip(gc, IRQ_MSK(32), IRQ_GC_INIT_NESTED_LOCK,
300 IRQ_NOREQUEST, 0);
301}
Thomas Gleixnerb5eee2f2011-04-04 14:29:58 +0200302
Shawn Guoe7fc6ae2011-07-07 00:37:41 +0800303static void __devinit mxc_gpio_get_hw(struct platform_device *pdev)
304{
305 enum mxc_gpio_hwtype hwtype = pdev->id_entry->driver_data;
306
307 if (mxc_gpio_hwtype) {
308 /*
309 * The driver works with a reasonable presupposition,
310 * that is all gpio ports must be the same type when
311 * running on one soc.
312 */
313 BUG_ON(mxc_gpio_hwtype != hwtype);
314 return;
315 }
316
317 if (hwtype == IMX31_GPIO)
318 mxc_gpio_hwdata = &imx31_gpio_hwdata;
319 else
320 mxc_gpio_hwdata = &imx1_imx21_gpio_hwdata;
321
322 mxc_gpio_hwtype = hwtype;
323}
324
Shawn Guob78d8e52011-06-06 00:07:55 +0800325static int __devinit mxc_gpio_probe(struct platform_device *pdev)
Juergen Beisert07bd1a62008-07-05 10:02:49 +0200326{
Shawn Guob78d8e52011-06-06 00:07:55 +0800327 struct mxc_gpio_port *port;
328 struct resource *iores;
Shawn Guoe4ea9332011-06-07 16:25:37 +0800329 int err;
Juergen Beisert07bd1a62008-07-05 10:02:49 +0200330
Shawn Guoe7fc6ae2011-07-07 00:37:41 +0800331 mxc_gpio_get_hw(pdev);
332
Shawn Guob78d8e52011-06-06 00:07:55 +0800333 port = kzalloc(sizeof(struct mxc_gpio_port), GFP_KERNEL);
334 if (!port)
335 return -ENOMEM;
Juergen Beisert07bd1a62008-07-05 10:02:49 +0200336
Shawn Guob78d8e52011-06-06 00:07:55 +0800337 port->virtual_irq_start = MXC_GPIO_IRQ_START + pdev->id * 32;
Juergen Beisert07bd1a62008-07-05 10:02:49 +0200338
Shawn Guob78d8e52011-06-06 00:07:55 +0800339 iores = platform_get_resource(pdev, IORESOURCE_MEM, 0);
340 if (!iores) {
341 err = -ENODEV;
342 goto out_kfree;
343 }
Juergen Beisert07bd1a62008-07-05 10:02:49 +0200344
Shawn Guob78d8e52011-06-06 00:07:55 +0800345 if (!request_mem_region(iores->start, resource_size(iores),
346 pdev->name)) {
347 err = -EBUSY;
348 goto out_kfree;
349 }
Juergen Beisert07bd1a62008-07-05 10:02:49 +0200350
Shawn Guob78d8e52011-06-06 00:07:55 +0800351 port->base = ioremap(iores->start, resource_size(iores));
352 if (!port->base) {
353 err = -ENOMEM;
354 goto out_release_mem;
355 }
Baruch Siach14cb0de2010-07-06 14:03:22 +0300356
Shawn Guob78d8e52011-06-06 00:07:55 +0800357 port->irq_high = platform_get_irq(pdev, 1);
358 port->irq = platform_get_irq(pdev, 0);
359 if (port->irq < 0) {
360 err = -EINVAL;
361 goto out_iounmap;
362 }
Juergen Beisert07bd1a62008-07-05 10:02:49 +0200363
Shawn Guob78d8e52011-06-06 00:07:55 +0800364 /* disable the interrupt and clear the status */
365 writel(0, port->base + GPIO_IMR);
366 writel(~0, port->base + GPIO_ISR);
367
Shawn Guoe4ea9332011-06-07 16:25:37 +0800368 /* gpio-mxc can be a generic irq chip */
369 mxc_gpio_init_gc(port);
Juergen Beisert07bd1a62008-07-05 10:02:49 +0200370
Shawn Guoe7fc6ae2011-07-07 00:37:41 +0800371 if (mxc_gpio_hwtype == IMX21_GPIO) {
Sascha Hauer8afaada2009-06-15 12:36:25 +0200372 /* setup one handler for all GPIO interrupts */
Shawn Guob78d8e52011-06-06 00:07:55 +0800373 if (pdev->id == 0)
374 irq_set_chained_handler(port->irq,
375 mx2_gpio_irq_handler);
376 } else {
377 /* setup one handler for each entry */
378 irq_set_chained_handler(port->irq, mx3_gpio_irq_handler);
379 irq_set_handler_data(port->irq, port);
380 if (port->irq_high > 0) {
381 /* setup handler for GPIO 16 to 31 */
382 irq_set_chained_handler(port->irq_high,
383 mx3_gpio_irq_handler);
384 irq_set_handler_data(port->irq_high, port);
385 }
Sascha Hauer8afaada2009-06-15 12:36:25 +0200386 }
387
Shawn Guo2ce420d2011-06-06 13:22:41 +0800388 err = bgpio_init(&port->bgc, &pdev->dev, 4,
389 port->base + GPIO_PSR,
390 port->base + GPIO_DR, NULL,
391 port->base + GPIO_GDIR, NULL, false);
Shawn Guob78d8e52011-06-06 00:07:55 +0800392 if (err)
393 goto out_iounmap;
394
Shawn Guo2ce420d2011-06-06 13:22:41 +0800395 port->bgc.gc.base = pdev->id * 32;
Lothar Waßmannfb149212011-07-07 14:50:16 +0200396 port->bgc.dir = port->bgc.read_reg(port->bgc.reg_dir);
397 port->bgc.data = port->bgc.read_reg(port->bgc.reg_set);
Shawn Guo2ce420d2011-06-06 13:22:41 +0800398
399 err = gpiochip_add(&port->bgc.gc);
400 if (err)
401 goto out_bgpio_remove;
402
Shawn Guob78d8e52011-06-06 00:07:55 +0800403 list_add_tail(&port->node, &mxc_gpio_ports);
404
Juergen Beisert07bd1a62008-07-05 10:02:49 +0200405 return 0;
Shawn Guob78d8e52011-06-06 00:07:55 +0800406
Shawn Guo2ce420d2011-06-06 13:22:41 +0800407out_bgpio_remove:
408 bgpio_remove(&port->bgc);
Shawn Guob78d8e52011-06-06 00:07:55 +0800409out_iounmap:
410 iounmap(port->base);
411out_release_mem:
412 release_mem_region(iores->start, resource_size(iores));
413out_kfree:
414 kfree(port);
415 dev_info(&pdev->dev, "%s failed with errno %d\n", __func__, err);
416 return err;
Juergen Beisert07bd1a62008-07-05 10:02:49 +0200417}
Shawn Guob78d8e52011-06-06 00:07:55 +0800418
419static struct platform_driver mxc_gpio_driver = {
420 .driver = {
421 .name = "gpio-mxc",
422 .owner = THIS_MODULE,
423 },
424 .probe = mxc_gpio_probe,
Shawn Guoe7fc6ae2011-07-07 00:37:41 +0800425 .id_table = mxc_gpio_devtype,
Shawn Guob78d8e52011-06-06 00:07:55 +0800426};
427
428static int __init gpio_mxc_init(void)
429{
430 return platform_driver_register(&mxc_gpio_driver);
431}
432postcore_initcall(gpio_mxc_init);
433
434MODULE_AUTHOR("Freescale Semiconductor, "
435 "Daniel Mack <danielncaiaq.de>, "
436 "Juergen Beisert <kernel@pengutronix.de>");
437MODULE_DESCRIPTION("Freescale MXC GPIO");
438MODULE_LICENSE("GPL");