Tom Warren | 8020586 | 2011-04-14 12:09:40 +0000 | [diff] [blame] | 1 | /* |
| 2 | * Copyright (c) 2011, Google Inc. All rights reserved. |
Tom Warren | c570d7a | 2012-05-22 12:19:25 +0000 | [diff] [blame] | 3 | * Portions Copyright 2011-2012 NVIDIA Corporation |
Tom Warren | 8020586 | 2011-04-14 12:09:40 +0000 | [diff] [blame] | 4 | * |
Wolfgang Denk | d79de1d | 2013-07-08 09:37:19 +0200 | [diff] [blame] | 5 | * SPDX-License-Identifier: GPL-2.0+ |
Tom Warren | 8020586 | 2011-04-14 12:09:40 +0000 | [diff] [blame] | 6 | */ |
| 7 | |
Tom Warren | ab37196 | 2012-09-19 15:50:56 -0700 | [diff] [blame] | 8 | #ifndef _TEGRA20_GPIO_H_ |
| 9 | #define _TEGRA20_GPIO_H_ |
Tom Warren | 8020586 | 2011-04-14 12:09:40 +0000 | [diff] [blame] | 10 | |
| 11 | /* |
Tom Warren | b3878b8 | 2011-06-17 06:27:28 +0000 | [diff] [blame] | 12 | * The Tegra 2x GPIO controller has 224 GPIOs arranged in 7 banks of 4 ports, |
Tom Warren | 8020586 | 2011-04-14 12:09:40 +0000 | [diff] [blame] | 13 | * each with 8 GPIOs. |
| 14 | */ |
Tom Warren | b3878b8 | 2011-06-17 06:27:28 +0000 | [diff] [blame] | 15 | #define TEGRA_GPIO_PORTS 4 /* number of ports per bank */ |
| 16 | #define TEGRA_GPIO_BANKS 7 /* number of banks */ |
Tom Warren | ab37196 | 2012-09-19 15:50:56 -0700 | [diff] [blame] | 17 | |
| 18 | #include <asm/arch-tegra/gpio.h> |
Tom Warren | 8020586 | 2011-04-14 12:09:40 +0000 | [diff] [blame] | 19 | |
| 20 | /* GPIO Controller registers for a single bank */ |
| 21 | struct gpio_ctlr_bank { |
| 22 | uint gpio_config[TEGRA_GPIO_PORTS]; |
| 23 | uint gpio_dir_out[TEGRA_GPIO_PORTS]; |
| 24 | uint gpio_out[TEGRA_GPIO_PORTS]; |
| 25 | uint gpio_in[TEGRA_GPIO_PORTS]; |
| 26 | uint gpio_int_status[TEGRA_GPIO_PORTS]; |
| 27 | uint gpio_int_enable[TEGRA_GPIO_PORTS]; |
| 28 | uint gpio_int_level[TEGRA_GPIO_PORTS]; |
| 29 | uint gpio_int_clear[TEGRA_GPIO_PORTS]; |
| 30 | }; |
| 31 | |
| 32 | struct gpio_ctlr { |
| 33 | struct gpio_ctlr_bank gpio_bank[TEGRA_GPIO_BANKS]; |
| 34 | }; |
| 35 | |
Tom Warren | ab37196 | 2012-09-19 15:50:56 -0700 | [diff] [blame] | 36 | #endif /* TEGRA20_GPIO_H_ */ |