Shawn Guo | b78d8e5 | 2011-06-06 00:07:55 +0800 | [diff] [blame] | 1 | /* |
| 2 | * Copyright 2011 Freescale Semiconductor, Inc. All Rights Reserved. |
| 3 | * Copyright 2011 Linaro Limited |
| 4 | * |
| 5 | * This program is free software; you can redistribute it and/or modify it under |
| 6 | * the terms of the GNU General Public License version 2 as published by the |
| 7 | * Free Software Foundation. |
| 8 | */ |
Shawn Guo | e0557c0 | 2012-09-13 15:51:15 +0800 | [diff] [blame] | 9 | #include "devices-common.h" |
Ben Dooks | ba4d86a | 2016-06-08 18:26:17 +0100 | [diff] [blame] | 10 | #include "../common.h" |
Shawn Guo | b78d8e5 | 2011-06-06 00:07:55 +0800 | [diff] [blame] | 11 | |
Shawn Guo | e7fc6ae | 2011-07-07 00:37:41 +0800 | [diff] [blame] | 12 | struct platform_device *__init mxc_register_gpio(char *name, int id, |
Shawn Guo | b78d8e5 | 2011-06-06 00:07:55 +0800 | [diff] [blame] | 13 | resource_size_t iobase, resource_size_t iosize, int irq, int irq_high) |
| 14 | { |
| 15 | struct resource res[] = { |
| 16 | { |
| 17 | .start = iobase, |
| 18 | .end = iobase + iosize - 1, |
| 19 | .flags = IORESOURCE_MEM, |
| 20 | }, { |
| 21 | .start = irq, |
| 22 | .end = irq, |
| 23 | .flags = IORESOURCE_IRQ, |
| 24 | }, { |
| 25 | .start = irq_high, |
| 26 | .end = irq_high, |
| 27 | .flags = IORESOURCE_IRQ, |
| 28 | }, |
| 29 | }; |
| 30 | |
| 31 | return platform_device_register_resndata(&mxc_aips_bus, |
Shawn Guo | e7fc6ae | 2011-07-07 00:37:41 +0800 | [diff] [blame] | 32 | name, id, res, ARRAY_SIZE(res), NULL, 0); |
Shawn Guo | b78d8e5 | 2011-06-06 00:07:55 +0800 | [diff] [blame] | 33 | } |