Lines Matching refs:pin

68     struct gpio_pin *pin, uint32_t flags);
83 static int ar71xx_gpio_pin_getcaps(device_t dev, uint32_t pin, uint32_t *caps);
84 static int ar71xx_gpio_pin_getflags(device_t dev, uint32_t pin, uint32_t
86 static int ar71xx_gpio_pin_getname(device_t dev, uint32_t pin, char *name);
87 static int ar71xx_gpio_pin_setflags(device_t dev, uint32_t pin, uint32_t flags);
88 static int ar71xx_gpio_pin_set(device_t dev, uint32_t pin, unsigned int value);
89 static int ar71xx_gpio_pin_get(device_t dev, uint32_t pin, unsigned int *val);
90 static int ar71xx_gpio_pin_toggle(device_t dev, uint32_t pin);
115 ar71xx_gpio_pin_configure(struct ar71xx_gpio_softc *sc, struct gpio_pin *pin,
120 mask = 1 << pin->gp_pin;
126 pin->gp_flags &= ~(GPIO_PIN_INPUT|GPIO_PIN_OUTPUT);
128 pin->gp_flags |= GPIO_PIN_OUTPUT;
132 pin->gp_flags |= GPIO_PIN_INPUT;
168 ar71xx_gpio_pin_getcaps(device_t dev, uint32_t pin, uint32_t *caps)
174 if (sc->gpio_pins[i].gp_pin == pin)
189 ar71xx_gpio_pin_getflags(device_t dev, uint32_t pin, uint32_t *flags)
195 if (sc->gpio_pins[i].gp_pin == pin)
210 ar71xx_gpio_pin_getname(device_t dev, uint32_t pin, char *name)
216 if (sc->gpio_pins[i].gp_pin == pin)
231 ar71xx_gpio_pin_setflags(device_t dev, uint32_t pin, uint32_t flags)
237 if (sc->gpio_pins[i].gp_pin == pin)
250 ar71xx_gpio_pin_set(device_t dev, uint32_t pin, unsigned int value)
256 if (sc->gpio_pins[i].gp_pin == pin)
264 GPIO_WRITE(sc, AR71XX_GPIO_SET, (1 << pin));
266 GPIO_WRITE(sc, AR71XX_GPIO_CLEAR, (1 << pin));
272 ar71xx_gpio_pin_get(device_t dev, uint32_t pin, unsigned int *val)
278 if (sc->gpio_pins[i].gp_pin == pin)
285 *val = (GPIO_READ(sc, AR71XX_GPIO_IN) & (1 << pin)) ? 1 : 0;
291 ar71xx_gpio_pin_toggle(device_t dev, uint32_t pin)
297 if (sc->gpio_pins[i].gp_pin == pin)
304 res = (GPIO_READ(sc, AR71XX_GPIO_IN) & (1 << pin)) ? 1 : 0;
306 GPIO_WRITE(sc, AR71XX_GPIO_CLEAR, (1 << pin));
308 GPIO_WRITE(sc, AR71XX_GPIO_SET, (1 << pin));
405 /* Initialise all pins specified in the mask, up to the pin count */
425 "pin %d", j);