Lines Matching refs:pin

114 a10_gpio_get_function(struct a10_gpio_softc *sc, uint32_t pin)
118 bank = pin / 32;
119 pin = pin - 32 * bank;
120 func = pin >> 3;
121 offset = ((pin & 0x07) << 2);
144 a10_gpio_set_function(struct a10_gpio_softc *sc, uint32_t pin, uint32_t f)
151 bank = pin / 32;
152 pin = pin - 32 * bank;
153 func = pin >> 3;
154 offset = ((pin & 0x07) << 2);
163 a10_gpio_set_pud(struct a10_gpio_softc *sc, uint32_t pin, uint32_t state)
170 bank = pin / 32;
171 pin = pin - 32 * bank;
172 pull = pin >> 4;
173 offset = ((pin & 0x0f) << 1);
182 a10_gpio_pin_configure(struct a10_gpio_softc *sc, struct gpio_pin *pin,
192 pin->gp_flags &= ~(GPIO_PIN_INPUT|GPIO_PIN_OUTPUT);
194 pin->gp_flags |= GPIO_PIN_OUTPUT;
195 a10_gpio_set_function(sc, pin->gp_pin,
198 pin->gp_flags |= GPIO_PIN_INPUT;
199 a10_gpio_set_function(sc, pin->gp_pin,
205 pin->gp_flags &= ~(GPIO_PIN_PULLUP|GPIO_PIN_PULLDOWN);
208 pin->gp_flags |= GPIO_PIN_PULLUP;
209 a10_gpio_set_pud(sc, pin->gp_pin, A10_GPIO_PULLUP);
211 pin->gp_flags |= GPIO_PIN_PULLDOWN;
212 a10_gpio_set_pud(sc, pin->gp_pin, A10_GPIO_PULLDOWN);
215 a10_gpio_set_pud(sc, pin->gp_pin, A10_GPIO_NONE);
229 a10_gpio_pin_getcaps(device_t dev, uint32_t pin, uint32_t *caps)
235 if (sc->sc_gpio_pins[i].gp_pin == pin)
250 a10_gpio_pin_getflags(device_t dev, uint32_t pin, uint32_t *flags)
256 if (sc->sc_gpio_pins[i].gp_pin == pin)
271 a10_gpio_pin_getname(device_t dev, uint32_t pin, char *name)
277 if (sc->sc_gpio_pins[i].gp_pin == pin)
292 a10_gpio_pin_setflags(device_t dev, uint32_t pin, uint32_t flags)
298 if (sc->sc_gpio_pins[i].gp_pin == pin)
311 a10_gpio_pin_set(device_t dev, uint32_t pin, unsigned int value)
318 if (sc->sc_gpio_pins[i].gp_pin == pin)
325 bank = pin / 32;
326 pin = pin - 32 * bank;
327 offset = pin & 0x1f;
342 a10_gpio_pin_get(device_t dev, uint32_t pin, unsigned int *val)
349 if (sc->sc_gpio_pins[i].gp_pin == pin)
356 bank = pin / 32;
357 pin = pin - 32 * bank;
358 offset = pin & 0x1f;
369 a10_gpio_pin_toggle(device_t dev, uint32_t pin)
376 if (sc->sc_gpio_pins[i].gp_pin == pin)
383 bank = pin / 32;
384 pin = pin - 32 * bank;
385 offset = pin & 0x1f;
455 "pin %d", i);
515 a10_emac_gpio_config(uint32_t pin)
522 /* Configure pin mux settings for MII. */
524 a10_gpio_set_function(sc, pin, A10_GPIO_PULLDOWN);