diff options
Diffstat (limited to 'drivers/gpio/pca953x.c')
| -rw-r--r-- | drivers/gpio/pca953x.c | 14 |
1 files changed, 13 insertions, 1 deletions
diff --git a/drivers/gpio/pca953x.c b/drivers/gpio/pca953x.c index 7d521e1d17e1..b827c976dc62 100644 --- a/drivers/gpio/pca953x.c +++ b/drivers/gpio/pca953x.c | |||
| @@ -252,6 +252,18 @@ static void pca953x_irq_bus_lock(unsigned int irq) | |||
| 252 | static void pca953x_irq_bus_sync_unlock(unsigned int irq) | 252 | static void pca953x_irq_bus_sync_unlock(unsigned int irq) |
| 253 | { | 253 | { |
| 254 | struct pca953x_chip *chip = get_irq_chip_data(irq); | 254 | struct pca953x_chip *chip = get_irq_chip_data(irq); |
| 255 | uint16_t new_irqs; | ||
| 256 | uint16_t level; | ||
| 257 | |||
| 258 | /* Look for any newly setup interrupt */ | ||
| 259 | new_irqs = chip->irq_trig_fall | chip->irq_trig_raise; | ||
| 260 | new_irqs &= ~chip->reg_direction; | ||
| 261 | |||
| 262 | while (new_irqs) { | ||
| 263 | level = __ffs(new_irqs); | ||
| 264 | pca953x_gpio_direction_input(&chip->gpio_chip, level); | ||
| 265 | new_irqs &= ~(1 << level); | ||
| 266 | } | ||
| 255 | 267 | ||
| 256 | mutex_unlock(&chip->irq_lock); | 268 | mutex_unlock(&chip->irq_lock); |
| 257 | } | 269 | } |
| @@ -278,7 +290,7 @@ static int pca953x_irq_set_type(unsigned int irq, unsigned int type) | |||
| 278 | else | 290 | else |
| 279 | chip->irq_trig_raise &= ~mask; | 291 | chip->irq_trig_raise &= ~mask; |
| 280 | 292 | ||
| 281 | return pca953x_gpio_direction_input(&chip->gpio_chip, level); | 293 | return 0; |
| 282 | } | 294 | } |
| 283 | 295 | ||
| 284 | static struct irq_chip pca953x_irq_chip = { | 296 | static struct irq_chip pca953x_irq_chip = { |
