Lines Matching refs:pin
64 #define GPIO_PIN(pin) ((pin) * 4)
78 #define GPIO_IRQ(grp, pin) (0x800 + (grp) * 64 + ((pin) >> 5) * 4)
110 apple_gpio_pin_ctl(void *cookie, int pin, int flags)
114 KASSERT(pin < sc->sc_npins);
116 uint32_t reg = PINCTRL_READ(sc, GPIO_PIN(pin));
128 PINCTRL_WRITE(sc, GPIO_PIN(pin), reg);
135 struct apple_gpio_pin *pin;
147 pin = kmem_alloc(sizeof(*pin), KM_SLEEP);
148 pin->pin_no = pinno;
149 pin->pin_flags = flags;
150 pin->pin_actlo = actlo;
152 apple_gpio_pin_ctl(sc, pin->pin_no, pin->pin_flags);
154 return pin;
161 struct apple_gpio_pin *pin = priv;
163 apple_gpio_pin_ctl(sc, pin->pin_no, GPIO_PIN_INPUT);
164 kmem_free(pin, sizeof(*pin));
171 struct apple_gpio_pin *pin = priv;
173 KASSERT(pin->pin_no < sc->sc_npins);
175 uint32_t reg = PINCTRL_READ(sc, GPIO_PIN(pin->pin_no));
177 if (!raw && pin->pin_actlo)
187 struct apple_gpio_pin *pin = priv;
189 KASSERT(pin->pin_no < sc->sc_npins);
191 if (!raw && pin->pin_actlo)
195 PINCTRL_SET(sc, GPIO_PIN(pin->pin_no), GPIO_PIN_DATA);
197 PINCTRL_CLR(sc, GPIO_PIN(pin->pin_no), GPIO_PIN_DATA);