trem | cf233ed | 2012-08-25 05:30:33 +0000 | [diff] [blame] | 1 | /* |
| 2 | * Copyright (C) 2012 |
| 3 | * Philippe Reynes <tremyfr@yahoo.fr> |
| 4 | * |
Wolfgang Denk | d79de1d | 2013-07-08 09:37:19 +0200 | [diff] [blame] | 5 | * SPDX-License-Identifier: GPL-2.0+ |
trem | cf233ed | 2012-08-25 05:30:33 +0000 | [diff] [blame] | 6 | */ |
| 7 | |
| 8 | |
| 9 | #ifndef __ASM_ARCH_MX27_GPIO_H |
| 10 | #define __ASM_ARCH_MX27_GPIO_H |
| 11 | |
| 12 | /* GPIO registers */ |
| 13 | struct gpio_regs { |
| 14 | u32 gpio_dir; /* DDIR */ |
| 15 | u32 ocr1; |
| 16 | u32 ocr2; |
| 17 | u32 iconfa1; |
| 18 | u32 iconfa2; |
| 19 | u32 iconfb1; |
| 20 | u32 iconfb2; |
| 21 | u32 gpio_dr; /* DR */ |
| 22 | u32 gius; |
| 23 | u32 gpio_psr; /* SSR */ |
| 24 | u32 icr1; |
| 25 | u32 icr2; |
| 26 | u32 imr; |
| 27 | u32 isr; |
| 28 | u32 gpr; |
| 29 | u32 swr; |
| 30 | u32 puen; |
| 31 | u32 res[0x2f]; |
| 32 | }; |
| 33 | |
| 34 | /* This structure is used by the function imx_gpio_mode */ |
| 35 | struct gpio_port_regs { |
| 36 | struct gpio_regs port[6]; |
| 37 | }; |
| 38 | |
Peng Fan | cf99d02 | 2015-05-15 07:29:13 +0800 | [diff] [blame] | 39 | /* |
| 40 | * GPIO Module and I/O Multiplexer |
| 41 | */ |
| 42 | #define PORTA 0 |
| 43 | #define PORTB 1 |
| 44 | #define PORTC 2 |
| 45 | #define PORTD 3 |
| 46 | #define PORTE 4 |
| 47 | #define PORTF 5 |
| 48 | |
| 49 | #define GPIO_PIN_MASK 0x1f |
| 50 | #define GPIO_PORT_SHIFT 5 |
| 51 | #define GPIO_PORT_MASK (0x7 << GPIO_PORT_SHIFT) |
| 52 | #define GPIO_PORTA (PORTA << GPIO_PORT_SHIFT) |
| 53 | #define GPIO_PORTB (PORTB << GPIO_PORT_SHIFT) |
| 54 | #define GPIO_PORTC (PORTC << GPIO_PORT_SHIFT) |
| 55 | #define GPIO_PORTD (PORTD << GPIO_PORT_SHIFT) |
| 56 | #define GPIO_PORTE (PORTE << GPIO_PORT_SHIFT) |
| 57 | #define GPIO_PORTF (PORTF << GPIO_PORT_SHIFT) |
| 58 | |
trem | cf233ed | 2012-08-25 05:30:33 +0000 | [diff] [blame] | 59 | #endif |