Lines Matching defs:gpio

3  * Xilinx gpio driver for xps/axi_gpio IP.
15 #include <linux/gpio/driver.h>
51 static inline int xgpio_index(struct xgpio_instance *chip, int gpio)
53 if (gpio >= chip->gpio_width[0])
59 static inline int xgpio_regoffset(struct xgpio_instance *chip, int gpio)
61 if (xgpio_index(chip, gpio))
67 static inline int xgpio_offset(struct xgpio_instance *chip, int gpio)
69 if (xgpio_index(chip, gpio))
70 return gpio - chip->gpio_width[0];
72 return gpio;
78 * @gpio: GPIO signal number.
86 static int xgpio_get(struct gpio_chip *gc, unsigned int gpio)
92 xgpio_regoffset(chip, gpio));
94 return !!(val & BIT(xgpio_offset(chip, gpio)));
100 * @gpio: GPIO signal number.
106 static void xgpio_set(struct gpio_chip *gc, unsigned int gpio, int val)
110 int index = xgpio_index(chip, gpio);
111 int offset = xgpio_offset(chip, gpio);
122 xgpio_regoffset(chip, gpio), chip->gpio_state[index]);
177 * @gpio: GPIO signal number.
183 static int xgpio_dir_in(struct gpio_chip *gc, unsigned int gpio)
187 int index = xgpio_index(chip, gpio);
188 int offset = xgpio_offset(chip, gpio);
195 xgpio_regoffset(chip, gpio), chip->gpio_dir[index]);
205 * @gpio: GPIO signal number.
214 static int xgpio_dir_out(struct gpio_chip *gc, unsigned int gpio, int val)
218 int index = xgpio_index(chip, gpio);
219 int offset = xgpio_offset(chip, gpio);
229 xgpio_regoffset(chip, gpio), chip->gpio_state[index]);
234 xgpio_regoffset(chip, gpio), chip->gpio_dir[index]);
291 if (of_property_read_u32(np, "xlnx,gpio-width", &chip->gpio_width[0]))
349 { .compatible = "xlnx,xps-gpio-1.00.a", },
358 .name = "gpio-xilinx",