Skip to content

Commit dba7857

Browse files
puyoulubrgl
authored andcommitted
gpio: pca953x: fix irq_stat not updated when irq is disabled (irq_mask not set)
When one port's input state get inverted (eg. from low to hight) after pca953x_irq_setup but before setting irq_mask (by some other driver such as "gpio-keys"), the next inversion of this port (eg. from hight to low) will not be triggered any more (because irq_stat is not updated at the first time). Issue should be fixed after this commit. Fixes: 89ea8bb ("gpio: pca953x.c: add interrupt handling capability") Signed-off-by: Puyou Lu <puyou.lu@gmail.com> Signed-off-by: Bartosz Golaszewski <brgl@bgdev.pl>
1 parent 171865d commit dba7857

1 file changed

Lines changed: 2 additions & 2 deletions

File tree

drivers/gpio/gpio-pca953x.c

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -762,11 +762,11 @@ static bool pca953x_irq_pending(struct pca953x_chip *chip, unsigned long *pendin
762762
bitmap_xor(cur_stat, new_stat, old_stat, gc->ngpio);
763763
bitmap_and(trigger, cur_stat, chip->irq_mask, gc->ngpio);
764764

765+
bitmap_copy(chip->irq_stat, new_stat, gc->ngpio);
766+
765767
if (bitmap_empty(trigger, gc->ngpio))
766768
return false;
767769

768-
bitmap_copy(chip->irq_stat, new_stat, gc->ngpio);
769-
770770
bitmap_and(cur_stat, chip->irq_trig_fall, old_stat, gc->ngpio);
771771
bitmap_and(old_stat, chip->irq_trig_raise, new_stat, gc->ngpio);
772772
bitmap_or(new_stat, old_stat, cur_stat, gc->ngpio);

0 commit comments

Comments
 (0)