2 * Copyright (c) 2012, Google Inc. All rights reserved.
3 * SPDX-License-Identifier: GPL-2.0
9 #include <linux/compiler.h>
10 #include <asm/arch/gpio.h>
11 #include <asm-generic/gpio.h>
13 struct ich6_bank_platdata {
15 const char *bank_name;
18 #define GPIO_MODE_NATIVE 0
19 #define GPIO_MODE_GPIO 1
20 #define GPIO_MODE_NONE 1
22 #define GPIO_DIR_OUTPUT 0
23 #define GPIO_DIR_INPUT 1
25 #define GPIO_NO_INVERT 0
28 #define GPIO_LEVEL_LOW 0
29 #define GPIO_LEVEL_HIGH 1
31 #define GPIO_NO_BLINK 0
34 #define GPIO_RESET_PWROK 0
35 #define GPIO_RESET_RSMRST 1
37 struct pch_gpio_set1 {
72 struct pch_gpio_set2 {
107 struct pch_gpio_set3 {
123 * This hilariously complex structure came from Coreboot. The
124 * setup_pch_gpios() function uses it. It could be move to device tree, or
125 * adjust to use masks instead of bitfields.
127 struct pch_gpio_map {
129 const struct pch_gpio_set1 *mode;
130 const struct pch_gpio_set1 *direction;
131 const struct pch_gpio_set1 *level;
132 const struct pch_gpio_set1 *reset;
133 const struct pch_gpio_set1 *invert;
134 const struct pch_gpio_set1 *blink;
137 const struct pch_gpio_set2 *mode;
138 const struct pch_gpio_set2 *direction;
139 const struct pch_gpio_set2 *level;
140 const struct pch_gpio_set2 *reset;
143 const struct pch_gpio_set3 *mode;
144 const struct pch_gpio_set3 *direction;
145 const struct pch_gpio_set3 *level;
146 const struct pch_gpio_set3 *reset;
150 void setup_pch_gpios(u16 gpiobase, const struct pch_gpio_map *gpio);
151 void ich_gpio_set_gpio_map(const struct pch_gpio_map *map);
153 #endif /* _X86_GPIO_H_ */