2 * Copyright (c) 2011, Google Inc. All rights reserved.
3 * SPDX-License-Identifier: GPL-2.0+
9 #define TEGRA_GPIOS_PER_PORT 8
10 #define TEGRA_PORTS_PER_BANK 4
11 #define MAX_NUM_GPIOS (TEGRA_GPIO_PORTS * TEGRA_GPIO_BANKS * 8)
12 #define GPIO_NAME_SIZE 20 /* gpio_request max label len */
14 #define GPIO_BANK(x) ((x) >> 5)
15 #define GPIO_PORT(x) (((x) >> 3) & 0x3)
16 #define GPIO_FULLPORT(x) ((x) >> 3)
17 #define GPIO_BIT(x) ((x) & 0x7)
19 enum tegra_gpio_init {
25 struct tegra_gpio_config {
31 * tegra_spl_gpio_direction_output() - set the output value of a GPIO
33 * This function is only used from SPL on seaboard, which needs to enable a
34 * GPIO to get the UART running. It could be done in U-Boot rather than SPL,
35 * but for now, this gets it working
37 int tegra_spl_gpio_direction_output(int gpio, int value);
40 * Configure a list of GPIOs
42 * @param config List of GPIO configurations
43 * @param len Number of config items in list
45 void gpio_config_table(const struct tegra_gpio_config *config, int len);
47 #endif /* TEGRA_GPIO_H_ */