Lines Matching +full:gpio +full:- +full:dir

7  * Copyright (C) 2008-2011 Florian Fainelli <florian@openwrt.org>
14 #include <linux/gpio/driver.h>
39 unsigned gpio, int val) in bcm63xx_gpio_set() argument
46 BUG_ON(gpio >= chip->ngpio); in bcm63xx_gpio_set()
48 if (gpio < 32) { in bcm63xx_gpio_set()
50 mask = 1 << gpio; in bcm63xx_gpio_set()
54 mask = 1 << (gpio - 32); in bcm63xx_gpio_set()
67 static int bcm63xx_gpio_get(struct gpio_chip *chip, unsigned gpio) in bcm63xx_gpio_get() argument
72 BUG_ON(gpio >= chip->ngpio); in bcm63xx_gpio_get()
74 if (gpio < 32) { in bcm63xx_gpio_get()
76 mask = 1 << gpio; in bcm63xx_gpio_get()
79 mask = 1 << (gpio - 32); in bcm63xx_gpio_get()
86 unsigned gpio, int dir) in bcm63xx_gpio_set_direction() argument
93 BUG_ON(gpio >= chip->ngpio); in bcm63xx_gpio_set_direction()
95 if (gpio < 32) { in bcm63xx_gpio_set_direction()
97 mask = 1 << gpio; in bcm63xx_gpio_set_direction()
100 mask = 1 << (gpio - 32); in bcm63xx_gpio_set_direction()
105 if (dir == BCM63XX_GPIO_DIR_IN) in bcm63xx_gpio_set_direction()
115 static int bcm63xx_gpio_direction_input(struct gpio_chip *chip, unsigned gpio) in bcm63xx_gpio_direction_input() argument
117 return bcm63xx_gpio_set_direction(chip, gpio, BCM63XX_GPIO_DIR_IN); in bcm63xx_gpio_direction_input()
121 unsigned gpio, int value) in bcm63xx_gpio_direction_output() argument
123 bcm63xx_gpio_set(chip, gpio, value); in bcm63xx_gpio_direction_output()
124 return bcm63xx_gpio_set_direction(chip, gpio, BCM63XX_GPIO_DIR_OUT); in bcm63xx_gpio_direction_output()
129 .label = "bcm63xx-gpio",