Lines Matching refs:gpio

3  * arch/arm/mach-tegra/gpio.c
17 #include <linux/gpio/driver.h>
120 unsigned int gpio, u32 value)
124 val = 0x100 << GPIO_BIT(gpio);
126 val |= 1 << GPIO_BIT(gpio);
130 static void tegra_gpio_enable(struct tegra_gpio_info *tgi, unsigned int gpio)
132 tegra_gpio_mask_write(tgi, GPIO_MSK_CNF(tgi, gpio), gpio, 1);
135 static void tegra_gpio_disable(struct tegra_gpio_info *tgi, unsigned int gpio)
137 tegra_gpio_mask_write(tgi, GPIO_MSK_CNF(tgi, gpio), gpio, 0);
161 /* If gpio is in output mode then read from the out value */
274 unsigned int gpio = d->hwirq;
276 tegra_gpio_writel(tgi, 1 << GPIO_BIT(gpio), GPIO_INT_CLR(tgi, gpio));
283 unsigned int gpio = d->hwirq;
285 tegra_gpio_mask_write(tgi, GPIO_MSK_INT_ENB(tgi, gpio), gpio, 0);
286 gpiochip_disable_irq(chip, gpio);
293 unsigned int gpio = d->hwirq;
295 gpiochip_enable_irq(chip, gpio);
296 tegra_gpio_mask_write(tgi, GPIO_MSK_INT_ENB(tgi, gpio), gpio, 1);
301 unsigned int gpio = d->hwirq, port = GPIO_PORT(gpio), lvl_type;
338 val = tegra_gpio_readl(tgi, GPIO_INT_LVL(tgi, gpio));
339 val &= ~(GPIO_INT_LVL_MASK << GPIO_BIT(gpio));
340 val |= lvl_type << GPIO_BIT(gpio);
341 tegra_gpio_writel(tgi, val, GPIO_INT_LVL(tgi, gpio));
345 tegra_gpio_mask_write(tgi, GPIO_MSK_OE(tgi, gpio), gpio, 0);
346 tegra_gpio_enable(tgi, gpio);
348 ret = gpiochip_lock_as_irq(&tgi->gc, gpio);
351 "unable to lock Tegra GPIO %u as IRQ\n", gpio);
352 tegra_gpio_disable(tgi, gpio);
371 unsigned int gpio = d->hwirq;
374 gpiochip_unlock_as_irq(&tgi->gc, gpio);
384 unsigned int port, pin, gpio, i;
402 gpio = tegra_gpio_compose(bank->bank, port, 0);
403 sta = tegra_gpio_readl(tgi, GPIO_INT_STA(tgi, gpio)) &
404 tegra_gpio_readl(tgi, GPIO_INT_ENB(tgi, gpio));
405 lvl = tegra_gpio_readl(tgi, GPIO_INT_LVL(tgi, gpio));
411 GPIO_INT_CLR(tgi, gpio));
413 /* if gpio is edge triggered, clear condition
422 ret = generic_handle_domain_irq(domain, gpio + pin);
423 WARN_RATELIMIT(ret, "hwirq = %d", gpio + pin);
469 unsigned int gpio = (b << 5) | (p << 3);
472 GPIO_CNF(tgi, gpio));
476 GPIO_DBC_CNT(tgi, gpio));
478 GPIO_MSK_DBC_EN(tgi, gpio));
482 GPIO_OUT(tgi, gpio));
484 GPIO_OE(tgi, gpio));
486 GPIO_INT_LVL(tgi, gpio));
488 GPIO_INT_ENB(tgi, gpio));
504 unsigned int gpio = (b << 5) | (p << 3);
507 GPIO_CNF(tgi, gpio));
509 GPIO_OUT(tgi, gpio));
511 GPIO_OE(tgi, gpio));
514 GPIO_MSK_DBC_EN(tgi, gpio));
520 GPIO_INT_ENB(tgi, gpio));
522 GPIO_INT_LVL(tgi, gpio));
524 /* Enable gpio irq for wake up source */
526 GPIO_INT_ENB(tgi, gpio));
538 unsigned int gpio = d->hwirq;
544 port = GPIO_PORT(gpio);
545 bit = GPIO_BIT(gpio);
647 unsigned int gpio = tegra_gpio_compose(i, j, 0);
652 tegra_gpio_readl(tgi, GPIO_CNF(tgi, gpio)),
653 tegra_gpio_readl(tgi, GPIO_OE(tgi, gpio)),
654 tegra_gpio_readl(tgi, GPIO_OUT(tgi, gpio)),
655 tegra_gpio_readl(tgi, GPIO_IN(tgi, gpio)),
656 tegra_gpio_readl(tgi, GPIO_INT_STA(tgi, gpio)),
657 tegra_gpio_readl(tgi, GPIO_INT_ENB(tgi, gpio)),
658 tegra_gpio_readl(tgi, GPIO_INT_LVL(tgi, gpio)));
714 tgi->gc.label = "tegra-gpio";
787 int gpio = tegra_gpio_compose(i, j, 0);
789 tegra_gpio_writel(tgi, 0x00, GPIO_INT_ENB(tgi, gpio));
819 { .compatible = "nvidia,tegra210-gpio", .data = &tegra210_gpio_config },
820 { .compatible = "nvidia,tegra30-gpio", .data = &tegra30_gpio_config },
821 { .compatible = "nvidia,tegra20-gpio", .data = &tegra20_gpio_config },
828 .name = "tegra-gpio",