diff options
-rw-r--r-- | drivers/gpio/Kconfig | 4 | ||||
-rw-r--r-- | drivers/gpio/Makefile | 2 | ||||
-rw-r--r-- | drivers/gpio/gpio-pca953x.c | 4 | ||||
-rw-r--r-- | drivers/gpio/gpio-tc3589x.c | 2 | ||||
-rw-r--r-- | drivers/gpio/gpiolib.c | 7 |
5 files changed, 9 insertions, 10 deletions
diff --git a/drivers/gpio/Kconfig b/drivers/gpio/Kconfig index d011cb89d25e..ed37e5908b91 100644 --- a/drivers/gpio/Kconfig +++ b/drivers/gpio/Kconfig | |||
@@ -22,10 +22,6 @@ menuconfig GPIOLIB | |||
22 | 22 | ||
23 | if GPIOLIB | 23 | if GPIOLIB |
24 | 24 | ||
25 | config GPIO_DEVRES | ||
26 | def_bool y | ||
27 | depends on HAS_IOMEM | ||
28 | |||
29 | config OF_GPIO | 25 | config OF_GPIO |
30 | def_bool y | 26 | def_bool y |
31 | depends on OF | 27 | depends on OF |
diff --git a/drivers/gpio/Makefile b/drivers/gpio/Makefile index ab28a2daeacc..d074c2299393 100644 --- a/drivers/gpio/Makefile +++ b/drivers/gpio/Makefile | |||
@@ -2,7 +2,7 @@ | |||
2 | 2 | ||
3 | ccflags-$(CONFIG_DEBUG_GPIO) += -DDEBUG | 3 | ccflags-$(CONFIG_DEBUG_GPIO) += -DDEBUG |
4 | 4 | ||
5 | obj-$(CONFIG_GPIO_DEVRES) += devres.o | 5 | obj-$(CONFIG_GPIOLIB) += devres.o |
6 | obj-$(CONFIG_GPIOLIB) += gpiolib.o | 6 | obj-$(CONFIG_GPIOLIB) += gpiolib.o |
7 | obj-$(CONFIG_GPIOLIB) += gpiolib-legacy.o | 7 | obj-$(CONFIG_GPIOLIB) += gpiolib-legacy.o |
8 | obj-$(CONFIG_OF_GPIO) += gpiolib-of.o | 8 | obj-$(CONFIG_OF_GPIO) += gpiolib-of.o |
diff --git a/drivers/gpio/gpio-pca953x.c b/drivers/gpio/gpio-pca953x.c index e422568e14ad..fe731f094257 100644 --- a/drivers/gpio/gpio-pca953x.c +++ b/drivers/gpio/gpio-pca953x.c | |||
@@ -372,14 +372,15 @@ static void pca953x_gpio_set_multiple(struct gpio_chip *gc, | |||
372 | 372 | ||
373 | bank_shift = fls((chip->gpio_chip.ngpio - 1) / BANK_SZ); | 373 | bank_shift = fls((chip->gpio_chip.ngpio - 1) / BANK_SZ); |
374 | 374 | ||
375 | memcpy(reg_val, chip->reg_output, NBANK(chip)); | ||
376 | mutex_lock(&chip->i2c_lock); | 375 | mutex_lock(&chip->i2c_lock); |
376 | memcpy(reg_val, chip->reg_output, NBANK(chip)); | ||
377 | for (bank = 0; bank < NBANK(chip); bank++) { | 377 | for (bank = 0; bank < NBANK(chip); bank++) { |
378 | bank_mask = mask[bank / sizeof(*mask)] >> | 378 | bank_mask = mask[bank / sizeof(*mask)] >> |
379 | ((bank % sizeof(*mask)) * 8); | 379 | ((bank % sizeof(*mask)) * 8); |
380 | if (bank_mask) { | 380 | if (bank_mask) { |
381 | bank_val = bits[bank / sizeof(*bits)] >> | 381 | bank_val = bits[bank / sizeof(*bits)] >> |
382 | ((bank % sizeof(*bits)) * 8); | 382 | ((bank % sizeof(*bits)) * 8); |
383 | bank_val &= bank_mask; | ||
383 | reg_val[bank] = (reg_val[bank] & ~bank_mask) | bank_val; | 384 | reg_val[bank] = (reg_val[bank] & ~bank_mask) | bank_val; |
384 | } | 385 | } |
385 | } | 386 | } |
@@ -607,7 +608,6 @@ static int pca953x_irq_setup(struct pca953x_chip *chip, | |||
607 | 608 | ||
608 | if (client->irq && irq_base != -1 | 609 | if (client->irq && irq_base != -1 |
609 | && (chip->driver_data & PCA_INT)) { | 610 | && (chip->driver_data & PCA_INT)) { |
610 | |||
611 | ret = pca953x_read_regs(chip, | 611 | ret = pca953x_read_regs(chip, |
612 | chip->regs->input, chip->irq_stat); | 612 | chip->regs->input, chip->irq_stat); |
613 | if (ret) | 613 | if (ret) |
diff --git a/drivers/gpio/gpio-tc3589x.c b/drivers/gpio/gpio-tc3589x.c index 5a5a6cb00eea..d6e21f1a70a9 100644 --- a/drivers/gpio/gpio-tc3589x.c +++ b/drivers/gpio/gpio-tc3589x.c | |||
@@ -97,7 +97,7 @@ static int tc3589x_gpio_get_direction(struct gpio_chip *chip, | |||
97 | if (ret < 0) | 97 | if (ret < 0) |
98 | return ret; | 98 | return ret; |
99 | 99 | ||
100 | return !!(ret & BIT(pos)); | 100 | return !(ret & BIT(pos)); |
101 | } | 101 | } |
102 | 102 | ||
103 | static int tc3589x_gpio_set_single_ended(struct gpio_chip *chip, | 103 | static int tc3589x_gpio_set_single_ended(struct gpio_chip *chip, |
diff --git a/drivers/gpio/gpiolib.c b/drivers/gpio/gpiolib.c index 93ed0e00c578..868128a676ba 100644 --- a/drivers/gpio/gpiolib.c +++ b/drivers/gpio/gpiolib.c | |||
@@ -2737,8 +2737,11 @@ int gpiochip_lock_as_irq(struct gpio_chip *chip, unsigned int offset) | |||
2737 | if (IS_ERR(desc)) | 2737 | if (IS_ERR(desc)) |
2738 | return PTR_ERR(desc); | 2738 | return PTR_ERR(desc); |
2739 | 2739 | ||
2740 | /* Flush direction if something changed behind our back */ | 2740 | /* |
2741 | if (chip->get_direction) { | 2741 | * If it's fast: flush the direction setting if something changed |
2742 | * behind our back | ||
2743 | */ | ||
2744 | if (!chip->can_sleep && chip->get_direction) { | ||
2742 | int dir = chip->get_direction(chip, offset); | 2745 | int dir = chip->get_direction(chip, offset); |
2743 | 2746 | ||
2744 | if (dir) | 2747 | if (dir) |