blob: af301e7150f8f7ae6af111ef0d2ae1b93ffb79cb [file] [log] [blame]
Tom Warren80205862011-04-14 12:09:40 +00001/*
2 * Copyright (c) 2011, Google Inc. All rights reserved.
Tom Warrenc570d7a2012-05-22 12:19:25 +00003 * Portions Copyright 2011-2012 NVIDIA Corporation
Tom Warren80205862011-04-14 12:09:40 +00004 *
Wolfgang Denkd79de1d2013-07-08 09:37:19 +02005 * SPDX-License-Identifier: GPL-2.0+
Tom Warren80205862011-04-14 12:09:40 +00006 */
7
Tom Warrenab371962012-09-19 15:50:56 -07008#ifndef _TEGRA20_GPIO_H_
9#define _TEGRA20_GPIO_H_
Tom Warren80205862011-04-14 12:09:40 +000010
11/*
Tom Warrenb3878b82011-06-17 06:27:28 +000012 * The Tegra 2x GPIO controller has 224 GPIOs arranged in 7 banks of 4 ports,
Tom Warren80205862011-04-14 12:09:40 +000013 * each with 8 GPIOs.
14 */
Tom Warrenb3878b82011-06-17 06:27:28 +000015#define TEGRA_GPIO_PORTS 4 /* number of ports per bank */
16#define TEGRA_GPIO_BANKS 7 /* number of banks */
Tom Warrenab371962012-09-19 15:50:56 -070017
18#include <asm/arch-tegra/gpio.h>
Tom Warren80205862011-04-14 12:09:40 +000019
20/* GPIO Controller registers for a single bank */
21struct 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
32struct gpio_ctlr {
33 struct gpio_ctlr_bank gpio_bank[TEGRA_GPIO_BANKS];
34};
35
Tom Warrenab371962012-09-19 15:50:56 -070036#endif /* TEGRA20_GPIO_H_ */