Skip to content

Commit 7d2c8a5

Browse files
juhosgpopcornmix
authored andcommitted
pinctrl: armada-37xx: use correct OUTPUT_VAL register for GPIOs > 31
commit 947c93e upstream. The controller has two consecutive OUTPUT_VAL registers and both holds output value for 32 GPIOs. Due to a missing adjustment, the current code always uses the first register while setting the output value whereas it should use the second one for GPIOs > 31. Add the missing armada_37xx_update_reg() call to adjust the register according to the 'offset' parameter of the function to fix the issue. Cc: [email protected] Fixes: 6702abb ("pinctrl: armada-37xx: Fix direction_output() callback behavior") Signed-off-by: Imre Kaloz <[email protected]> Reviewed-by: Andrew Lunn <[email protected]> Signed-off-by: Gabor Juhos <[email protected]> Link: https://lore.kernel.org/[email protected] Signed-off-by: Linus Walleij <[email protected]> Signed-off-by: Greg Kroah-Hartman <[email protected]>
1 parent 4739447 commit 7d2c8a5

File tree

1 file changed

+3
-0
lines changed

1 file changed

+3
-0
lines changed

drivers/pinctrl/mvebu/pinctrl-armada-37xx.c

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -417,6 +417,7 @@ static int armada_37xx_gpio_direction_output(struct gpio_chip *chip,
417417
unsigned int offset, int value)
418418
{
419419
struct armada_37xx_pinctrl *info = gpiochip_get_data(chip);
420+
unsigned int val_offset = offset;
420421
unsigned int reg = OUTPUT_EN;
421422
unsigned int mask, val, ret;
422423

@@ -429,6 +430,8 @@ static int armada_37xx_gpio_direction_output(struct gpio_chip *chip,
429430
return ret;
430431

431432
reg = OUTPUT_VAL;
433+
armada_37xx_update_reg(&reg, &val_offset);
434+
432435
val = value ? mask : 0;
433436
regmap_update_bits(info->regmap, reg, mask, val);
434437

0 commit comments

Comments
 (0)