1*41eca741SStefano Babic /*
2*41eca741SStefano Babic  * Copyright (C) 2011
3*41eca741SStefano Babic  * Stefano Babic, DENX Software Engineering, <sbabic@denx.de>
4*41eca741SStefano Babic  *
5*41eca741SStefano Babic  * See file CREDITS for list of people who contributed to this
6*41eca741SStefano Babic  * project.
7*41eca741SStefano Babic  *
8*41eca741SStefano Babic  * This program is free software; you can redistribute it and/or
9*41eca741SStefano Babic  * modify it under the terms of the GNU General Public License as
10*41eca741SStefano Babic  * published by the Free Software Foundation; either version 2 of
11*41eca741SStefano Babic  * the License, or (at your option) any later version.
12*41eca741SStefano Babic  *
13*41eca741SStefano Babic  * This program is distributed in the hope that it will be useful,
14*41eca741SStefano Babic  * but WITHOUT ANY WARRANTY; without even the implied warranty of
15*41eca741SStefano Babic  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
16*41eca741SStefano Babic  * GNU General Public License for more details.
17*41eca741SStefano Babic  *
18*41eca741SStefano Babic  * You should have received a copy of the GNU General Public License
19*41eca741SStefano Babic  * along with this program; if not, write to the Free Software
20*41eca741SStefano Babic  * Foundation, Inc., 59 Temple Place, Suite 330, Boston,
21*41eca741SStefano Babic  * MA 02111-1307 USA
22*41eca741SStefano Babic  */
23*41eca741SStefano Babic 
24*41eca741SStefano Babic 
25*41eca741SStefano Babic #ifndef __ASM_ARCH_MX25_GPIO_H
26*41eca741SStefano Babic #define __ASM_ARCH_MX25_GPIO_H
27*41eca741SStefano Babic 
28*41eca741SStefano Babic /* Converts a GPIO port number and the internal bit position
29*41eca741SStefano Babic  * to the GPIO number
30*41eca741SStefano Babic  */
31*41eca741SStefano Babic #define MXC_GPIO_PORT_TO_NUM(port, bit) (((port - 1) << 5) + (bit & 0x1f))
32*41eca741SStefano Babic 
33*41eca741SStefano Babic /* GPIO registers */
34*41eca741SStefano Babic struct gpio_regs {
35*41eca741SStefano Babic 	u32 gpio_dr;	/* data */
36*41eca741SStefano Babic 	u32 gpio_dir;	/* direction */
37*41eca741SStefano Babic 	u32 psr;	/* pad satus */
38*41eca741SStefano Babic 	u32 icr1;	/* interrupt config 1 */
39*41eca741SStefano Babic 	u32 icr2;	/* interrupt config 2 */
40*41eca741SStefano Babic 	u32 imr;	/* interrupt mask */
41*41eca741SStefano Babic 	u32 isr;	/* interrupt status */
42*41eca741SStefano Babic 	u32 edge_sel;	/* edge select */
43*41eca741SStefano Babic };
44*41eca741SStefano Babic 
45*41eca741SStefano Babic #endif
46