Lines Matching refs:gpio

200 	"gpio",
215 pxa_gpio_get_function(int gpio)
222 rv = pxagpio_reg_read(sc, GPIO_FN_REG(gpio)) >> GPIO_FN_SHIFT(gpio);
225 io = pxagpio_reg_read(sc, PXA250_GPIO_REG(GPIO_GPDR0, gpio));
226 if (io & GPIO_BIT(gpio))
229 io = pxagpio_reg_read(sc, PXA250_GPIO_REG(GPIO_GPLR0, gpio));
230 if (io & GPIO_BIT(gpio))
237 pxa_gpio_set_function(int gpio, uint32_t fn)
244 oldfn = pxa_gpio_get_function(gpio);
270 bit = GPIO_BIT(gpio);
276 pxagpio_reg_write(sc, PXA250_GPIO_REG(GPIO_GPSR0, gpio), bit);
278 pxagpio_reg_write(sc, PXA250_GPIO_REG(GPIO_GPCR0, gpio), bit);
283 rv = pxagpio_reg_read(sc, PXA250_GPIO_REG(GPIO_GPDR0, gpio)) & ~bit;
286 pxagpio_reg_write(sc, PXA250_GPIO_REG(GPIO_GPDR0, gpio), rv);
291 bit = GPIO_FN_MASK << GPIO_FN_SHIFT(gpio);
292 fn = GPIO_FN(fn) << GPIO_FN_SHIFT(gpio);
293 rv = pxagpio_reg_read(sc, GPIO_FN_REG(gpio)) & ~bit;
294 pxagpio_reg_write(sc, GPIO_FN_REG(gpio), rv | fn);
308 int gpio;
311 gpio = IRQ_TO_GPIO(irq);
313 val = pxagpio_reg_read(sc, PXA250_GPIO_REG(GPIO_GRER0, gpio));
314 val &= ~GPIO_BIT(gpio);
315 pxagpio_reg_write(sc, PXA250_GPIO_REG(GPIO_GRER0, gpio), val);
323 int gpio;
326 gpio = IRQ_TO_GPIO(irq);
328 val = pxagpio_reg_read(sc, PXA250_GPIO_REG(GPIO_GRER0, gpio));
329 val |= GPIO_BIT(gpio);
330 pxagpio_reg_write(sc, PXA250_GPIO_REG(GPIO_GRER0, gpio), val);
337 int gpio;
342 gpio = ffs(sc->pg_intr[0]) - 1;
343 sc->pg_intr[0] &= ~(1 << gpio);
344 return (GPIO_TO_IRQ(gpio));
347 gpio = ffs(sc->pg_intr[1]) - 1;
348 sc->pg_intr[1] &= ~(1 << gpio);
349 return (GPIO_TO_IRQ(gpio + 32));
352 gpio = ffs(sc->pg_intr[2]) - 1;
353 sc->pg_intr[2] &= ~(1 << gpio);
354 return (GPIO_TO_IRQ(gpio + 64));