2 * Copyright (c) 2012, Google Inc. All rights reserved.
3 * SPDX-License-Identifier: GPL-2.0
9 #include <linux/compiler.h>
10 #include <asm-generic/gpio.h>
12 struct ich6_bank_platdata {
14 const char *bank_name;
17 #define GPIO_MODE_NATIVE 0
18 #define GPIO_MODE_GPIO 1
19 #define GPIO_MODE_NONE 1
21 #define GPIO_DIR_OUTPUT 0
22 #define GPIO_DIR_INPUT 1
24 #define GPIO_NO_INVERT 0
27 #define GPIO_LEVEL_LOW 0
28 #define GPIO_LEVEL_HIGH 1
30 #define GPIO_NO_BLINK 0
33 #define GPIO_RESET_PWROK 0
34 #define GPIO_RESET_RSMRST 1
36 struct pch_gpio_set1 {
71 struct pch_gpio_set2 {
106 struct pch_gpio_set3 {
122 * This hilariously complex structure came from Coreboot. The
123 * setup_pch_gpios() function uses it. It could be move to device tree, or
124 * adjust to use masks instead of bitfields.
126 struct pch_gpio_map {
128 const struct pch_gpio_set1 *mode;
129 const struct pch_gpio_set1 *direction;
130 const struct pch_gpio_set1 *level;
131 const struct pch_gpio_set1 *reset;
132 const struct pch_gpio_set1 *invert;
133 const struct pch_gpio_set1 *blink;
136 const struct pch_gpio_set2 *mode;
137 const struct pch_gpio_set2 *direction;
138 const struct pch_gpio_set2 *level;
139 const struct pch_gpio_set2 *reset;
142 const struct pch_gpio_set3 *mode;
143 const struct pch_gpio_set3 *direction;
144 const struct pch_gpio_set3 *level;
145 const struct pch_gpio_set3 *reset;
149 int gpio_ich6_pinctrl_init(void);
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_ */