Lines Matching defs:gpio
7 #include <linux/gpio/driver.h>
24 * offset = (gpio / XLP_GPIO_REGSZ) * 4;
27 * where addr is base address of the that feature register and gpio is the pin.
97 static int xlp_gpio_get_reg(void __iomem *addr, unsigned gpio)
101 pos = gpio % XLP_GPIO_REGSZ;
102 regset = (gpio / XLP_GPIO_REGSZ) * 4;
106 static void xlp_gpio_set_reg(void __iomem *addr, unsigned gpio, int state)
110 pos = gpio % XLP_GPIO_REGSZ;
111 regset = (gpio / XLP_GPIO_REGSZ) * 4;
205 int gpio, regoff;
212 for_each_set_bit(gpio, priv->gpio_enabled_mask, XLP_MAX_NR_GPIO) {
213 if (regoff != gpio / XLP_GPIO_REGSZ) {
214 regoff = gpio / XLP_GPIO_REGSZ;
218 if (gpio_stat & BIT(gpio % XLP_GPIO_REGSZ))
220 priv->chip.irq.domain, gpio));
225 static int xlp_gpio_dir_output(struct gpio_chip *gc, unsigned gpio, int state)
229 BUG_ON(gpio >= gc->ngpio);
230 xlp_gpio_set_reg(priv->gpio_out_en, gpio, 0x1);
235 static int xlp_gpio_dir_input(struct gpio_chip *gc, unsigned gpio)
239 BUG_ON(gpio >= gc->ngpio);
240 xlp_gpio_set_reg(priv->gpio_out_en, gpio, 0x0);
245 static int xlp_gpio_get(struct gpio_chip *gc, unsigned gpio)
249 BUG_ON(gpio >= gc->ngpio);
250 return xlp_gpio_get_reg(priv->gpio_paddrv, gpio);
253 static void xlp_gpio_set(struct gpio_chip *gc, unsigned gpio, int state)
257 BUG_ON(gpio >= gc->ngpio);
258 xlp_gpio_set_reg(priv->gpio_paddrv, gpio, state);
263 .compatible = "netlogic,xlp832-gpio",
267 .compatible = "netlogic,xlp316-gpio",
271 .compatible = "netlogic,xlp208-gpio",
275 .compatible = "netlogic,xlp980-gpio",
279 .compatible = "netlogic,xlp532-gpio",
283 .compatible = "brcm,vulcan-gpio",
433 .name = "xlp-gpio",