1 /* SPDX-License-Identifier: GPL-2.0+ */
3 * Copyright (c) 2011, Google Inc. All rights reserved.
9 #include <dt-bindings/gpio/tegra-gpio.h>
11 #define TEGRA_GPIOS_PER_PORT 8
12 #define TEGRA_PORTS_PER_BANK 4
13 #define MAX_NUM_GPIOS (TEGRA_GPIO_PORTS * TEGRA_GPIO_BANKS * 8)
14 #define GPIO_NAME_SIZE 20 /* gpio_request max label len */
16 #define GPIO_BANK(x) ((x) >> 5)
17 #define GPIO_PORT(x) (((x) >> 3) & 0x3)
18 #define GPIO_FULLPORT(x) ((x) >> 3)
19 #define GPIO_BIT(x) ((x) & 0x7)
21 enum tegra_gpio_init {
27 struct tegra_gpio_config {
33 * Configure a list of GPIOs
35 * @param config List of GPIO configurations
36 * @param len Number of config items in list
38 void gpio_config_table(const struct tegra_gpio_config *config, int len);
40 #endif /* TEGRA_GPIO_H_ */