Skip to content

Commit def8b72

Browse files
committed
Merge tag 'gpio-v5.3-5' of git://git.kernel.org/pub/scm/linux/kernel/git/linusw/linux-gpio
Pull GPIO fixes from Linus Walleij: "All related to the PCA953x driver when handling chips with more than 8 ports, now that works again" * tag 'gpio-v5.3-5' of git://git.kernel.org/pub/scm/linux/kernel/git/linusw/linux-gpio: gpio: pca953x: use pca953x_read_regs instead of regmap_bulk_read gpio: pca953x: correct type of reg_direction
2 parents 950b07c + 89f2c04 commit def8b72

File tree

1 file changed

+6
-9
lines changed

1 file changed

+6
-9
lines changed

drivers/gpio/gpio-pca953x.c

Lines changed: 6 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -604,10 +604,9 @@ static void pca953x_irq_bus_sync_unlock(struct irq_data *d)
604604
u8 new_irqs;
605605
int level, i;
606606
u8 invert_irq_mask[MAX_BANK];
607-
int reg_direction[MAX_BANK];
607+
u8 reg_direction[MAX_BANK];
608608

609-
regmap_bulk_read(chip->regmap, chip->regs->direction, reg_direction,
610-
NBANK(chip));
609+
pca953x_read_regs(chip, chip->regs->direction, reg_direction);
611610

612611
if (chip->driver_data & PCA_PCAL) {
613612
/* Enable latch on interrupt-enabled inputs */
@@ -679,7 +678,7 @@ static bool pca953x_irq_pending(struct pca953x_chip *chip, u8 *pending)
679678
bool pending_seen = false;
680679
bool trigger_seen = false;
681680
u8 trigger[MAX_BANK];
682-
int reg_direction[MAX_BANK];
681+
u8 reg_direction[MAX_BANK];
683682
int ret, i;
684683

685684
if (chip->driver_data & PCA_PCAL) {
@@ -710,8 +709,7 @@ static bool pca953x_irq_pending(struct pca953x_chip *chip, u8 *pending)
710709
return false;
711710

712711
/* Remove output pins from the equation */
713-
regmap_bulk_read(chip->regmap, chip->regs->direction, reg_direction,
714-
NBANK(chip));
712+
pca953x_read_regs(chip, chip->regs->direction, reg_direction);
715713
for (i = 0; i < NBANK(chip); i++)
716714
cur_stat[i] &= reg_direction[i];
717715

@@ -768,7 +766,7 @@ static int pca953x_irq_setup(struct pca953x_chip *chip,
768766
{
769767
struct i2c_client *client = chip->client;
770768
struct irq_chip *irq_chip = &chip->irq_chip;
771-
int reg_direction[MAX_BANK];
769+
u8 reg_direction[MAX_BANK];
772770
int ret, i;
773771

774772
if (!client->irq)
@@ -789,8 +787,7 @@ static int pca953x_irq_setup(struct pca953x_chip *chip,
789787
* interrupt. We have to rely on the previous read for
790788
* this purpose.
791789
*/
792-
regmap_bulk_read(chip->regmap, chip->regs->direction, reg_direction,
793-
NBANK(chip));
790+
pca953x_read_regs(chip, chip->regs->direction, reg_direction);
794791
for (i = 0; i < NBANK(chip); i++)
795792
chip->irq_stat[i] &= reg_direction[i];
796793
mutex_init(&chip->irq_lock);

0 commit comments

Comments
 (0)