diff options
Diffstat (limited to 'drivers/pinctrl/bcm/pinctrl-bcm2835.c')
-rw-r--r-- | drivers/pinctrl/bcm/pinctrl-bcm2835.c | 15 |
1 files changed, 10 insertions, 5 deletions
diff --git a/drivers/pinctrl/bcm/pinctrl-bcm2835.c b/drivers/pinctrl/bcm/pinctrl-bcm2835.c index b607d10e4cbd..c4ebfa852b42 100644 --- a/drivers/pinctrl/bcm/pinctrl-bcm2835.c +++ b/drivers/pinctrl/bcm/pinctrl-bcm2835.c @@ -313,7 +313,10 @@ static inline void bcm2835_pinctrl_fsel_set( static int bcm2835_gpio_direction_input(struct gpio_chip *chip, unsigned offset) { - return pinctrl_gpio_direction_input(chip->base + offset); + struct bcm2835_pinctrl *pc = gpiochip_get_data(chip); + + bcm2835_pinctrl_fsel_set(pc, offset, BCM2835_FSEL_GPIO_IN); + return 0; } static int bcm2835_gpio_get(struct gpio_chip *chip, unsigned offset) @@ -348,8 +351,11 @@ static void bcm2835_gpio_set(struct gpio_chip *chip, unsigned offset, int value) static int bcm2835_gpio_direction_output(struct gpio_chip *chip, unsigned offset, int value) { - bcm2835_gpio_set(chip, offset, value); - return pinctrl_gpio_direction_output(chip->base + offset); + struct bcm2835_pinctrl *pc = gpiochip_get_data(chip); + + bcm2835_gpio_set_bit(pc, value ? GPSET0 : GPCLR0, offset); + bcm2835_pinctrl_fsel_set(pc, offset, BCM2835_FSEL_GPIO_OUT); + return 0; } static const struct gpio_chip bcm2835_gpio_chip = { @@ -407,7 +413,7 @@ static void bcm2835_gpio_irq_handler(struct irq_desc *desc) struct bcm2835_pinctrl *pc = gpiochip_get_data(chip); struct irq_chip *host_chip = irq_desc_get_chip(desc); int irq = irq_desc_get_irq(desc); - int group; + int group = 0; int i; for (i = 0; i < BCM2835_NUM_IRQS; i++) { @@ -1222,7 +1228,6 @@ static int bcm2835_pinctrl_probe(struct platform_device *pdev) pc->gpio_chip = *pdata->gpio_chip; pc->gpio_chip.parent = dev; - pc->gpio_chip.of_node = np; for (i = 0; i < BCM2835_NUM_BANKS; i++) { unsigned long events; |