blob: 26483fa94b75109d13ed56ace45af8ed9c44656d [file] [log] [blame]
Shawn Guob78d8e52011-06-06 00:07:55 +08001/*
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 Guoe0557c02012-09-13 15:51:15 +08009#include "devices-common.h"
Shawn Guob78d8e52011-06-06 00:07:55 +080010
Shawn Guoe7fc6ae2011-07-07 00:37:41 +080011struct platform_device *__init mxc_register_gpio(char *name, int id,
Shawn Guob78d8e52011-06-06 00:07:55 +080012 resource_size_t iobase, resource_size_t iosize, int irq, int irq_high)
13{
14 struct resource res[] = {
15 {
16 .start = iobase,
17 .end = iobase + iosize - 1,
18 .flags = IORESOURCE_MEM,
19 }, {
20 .start = irq,
21 .end = irq,
22 .flags = IORESOURCE_IRQ,
23 }, {
24 .start = irq_high,
25 .end = irq_high,
26 .flags = IORESOURCE_IRQ,
27 },
28 };
29
30 return platform_device_register_resndata(&mxc_aips_bus,
Shawn Guoe7fc6ae2011-07-07 00:37:41 +080031 name, id, res, ARRAY_SIZE(res), NULL, 0);
Shawn Guob78d8e52011-06-06 00:07:55 +080032}