2 * Copyright 2006-2007 Freescale Semiconductor, Inc. All Rights Reserved.
3 * Copyright 2008 Sascha Hauer, kernel@pengutronix.de
4 * Copyright (c) 2008 Paulius Zaleckas <paulius.zaleckas@teltonika.lt>
6 * This program is free software; you can redistribute it and/or
7 * modify it under the terms of the GNU General Public License
8 * as published by the Free Software Foundation; either version 2
9 * of the License, or (at your option) any later version.
10 * This program is distributed in the hope that it will be useful,
11 * but WITHOUT ANY WARRANTY; without even the implied warranty of
12 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
13 * GNU General Public License for more details.
15 * You should have received a copy of the GNU General Public License
16 * along with this program; if not, write to the Free Software
17 * Foundation, Inc., 51 Franklin Street, Fifth Floor,
18 * Boston, MA 02110-1301, USA.
21 #include <linux/kernel.h>
22 #include <linux/init.h>
23 #include <linux/platform_device.h>
24 #include <linux/gpio.h>
25 #include <mach/hardware.h>
27 static struct resource imx_uart1_resources[] = {
29 .start = UART1_BASE_ADDR,
30 .end = UART1_BASE_ADDR + 0xD0,
31 .flags = IORESOURCE_MEM,
34 .start = UART1_MINT_RX,
36 .flags = IORESOURCE_IRQ,
39 .start = UART1_MINT_TX,
41 .flags = IORESOURCE_IRQ,
44 .start = UART1_MINT_RTS,
45 .end = UART1_MINT_RTS,
46 .flags = IORESOURCE_IRQ,
50 struct platform_device imx_uart1_device = {
53 .num_resources = ARRAY_SIZE(imx_uart1_resources),
54 .resource = imx_uart1_resources,
57 static struct resource imx_uart2_resources[] = {
59 .start = UART2_BASE_ADDR,
60 .end = UART2_BASE_ADDR + 0xD0,
61 .flags = IORESOURCE_MEM,
64 .start = UART2_MINT_RX,
66 .flags = IORESOURCE_IRQ,
69 .start = UART2_MINT_TX,
71 .flags = IORESOURCE_IRQ,
74 .start = UART2_MINT_RTS,
75 .end = UART2_MINT_RTS,
76 .flags = IORESOURCE_IRQ,
80 struct platform_device imx_uart2_device = {
83 .num_resources = ARRAY_SIZE(imx_uart2_resources),
84 .resource = imx_uart2_resources,
87 /* GPIO port description */
88 static struct mxc_gpio_port imx_gpio_ports[] = {
90 .chip.label = "gpio-0",
91 .base = (void __iomem *)IO_ADDRESS(GPIO_BASE_ADDR),
92 .irq = GPIO_INT_PORTA,
93 .virtual_irq_start = MXC_MAX_INT_LINES
96 .chip.label = "gpio-1",
97 .base = (void __iomem *)IO_ADDRESS(GPIO_BASE_ADDR + 0x100),
98 .irq = GPIO_INT_PORTB,
99 .virtual_irq_start = MXC_MAX_INT_LINES + 32
102 .chip.label = "gpio-2",
103 .base = (void __iomem *)IO_ADDRESS(GPIO_BASE_ADDR + 0x200),
104 .irq = GPIO_INT_PORTC,
105 .virtual_irq_start = MXC_MAX_INT_LINES + 64
108 .chip.label = "gpio-3",
109 .base = (void __iomem *)IO_ADDRESS(GPIO_BASE_ADDR + 0x300),
110 .irq = GPIO_INT_PORTD,
111 .virtual_irq_start = MXC_MAX_INT_LINES + 96
115 int __init mxc_register_gpios(void)
117 return mxc_gpio_init(imx_gpio_ports, ARRAY_SIZE(imx_gpio_ports));