Skip to content
Closed
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
7 changes: 5 additions & 2 deletions drivers/gpio/gpio-pca953x.c
Original file line number Diff line number Diff line change
Expand Up @@ -716,13 +716,16 @@ static bool pca953x_irq_pending(struct pca953x_chip *chip, u8 *pending)
trigger[i] = (cur_stat[i] ^ old_stat[i]) & chip->irq_mask[i];
if (trigger[i])
trigger_seen = true;

/* We want the current status recorded in the chip->irq stat regardless the
* chip->irq_mask setting in order to have a change detected when the interrupt
* mask gets changed i.e. echo "both" > /sys/class/gpioXYZ/edge */
chip->irq_stat[i] = cur_stat[i];
}

if (!trigger_seen)
return false;

memcpy(chip->irq_stat, cur_stat, NBANK(chip));

for (i = 0; i < NBANK(chip); i++) {
pending[i] = (old_stat[i] & chip->irq_trig_fall[i]) |
(cur_stat[i] & chip->irq_trig_raise[i]);
Expand Down