Skip to content

Commit b6c3af4

Browse files
andy-shevlinusw
authored andcommitted
pinctrl: cy8c95x0: Don't miss reading the last bank registers
When code had been changed to use for_each_set_clump8(), it mistakenly switched from chip->nport to chip->tpin since the cy8c9540 and cy8c9560 have a 4-pin gap. This, in particular, led to the missed read of the last bank interrupt status register and hence missing interrupts on those pins. Restore the upper limit in for_each_set_clump8() to take into consideration that gap. Fixes: 83e29a7 ("pinctrl: cy8c95x0; Switch to use for_each_set_clump8()") Cc: [email protected] Signed-off-by: Andy Shevchenko <[email protected]> Signed-off-by: Linus Walleij <[email protected]>
1 parent 01e10d0 commit b6c3af4

1 file changed

Lines changed: 2 additions & 2 deletions

File tree

drivers/pinctrl/pinctrl-cy8c95x0.c

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -627,7 +627,7 @@ static int cy8c95x0_write_regs_mask(struct cy8c95x0_pinctrl *chip, int reg,
627627
bitmap_scatter(tmask, mask, chip->map, MAX_LINE);
628628
bitmap_scatter(tval, val, chip->map, MAX_LINE);
629629

630-
for_each_set_clump8(offset, bits, tmask, chip->tpin) {
630+
for_each_set_clump8(offset, bits, tmask, chip->nport * BANK_SZ) {
631631
unsigned int i = offset / 8;
632632

633633
write_val = bitmap_get_value8(tval, offset);
@@ -655,7 +655,7 @@ static int cy8c95x0_read_regs_mask(struct cy8c95x0_pinctrl *chip, int reg,
655655
bitmap_scatter(tmask, mask, chip->map, MAX_LINE);
656656
bitmap_scatter(tval, val, chip->map, MAX_LINE);
657657

658-
for_each_set_clump8(offset, bits, tmask, chip->tpin) {
658+
for_each_set_clump8(offset, bits, tmask, chip->nport * BANK_SZ) {
659659
unsigned int i = offset / 8;
660660

661661
ret = cy8c95x0_regmap_read_bits(chip, reg, i, bits, &read_val);

0 commit comments

Comments
 (0)