mirror of
https://github.com/BobTheBlinker/android_kernel_motorola_sm6375.git
synced 2026-10-30 03:27:44 -04:00
gpio: pca953x: Fix corruption of other gpios in set_multiple.
gpiod_set_array_value_complex does not clear the bits field.
Therefore when the drivers set_multiple funciton is called bits outside
the mask are undefined and can be either set or not. So bank_val needs
to be masked with bank_mask before or with the reg_val cache.
Cc: [email protected]
Fixes: b4818afeac ("gpio: pca953x: Add set_multiple to allow multiple")
Signed-off-by: Phil Reid <[email protected]>
Signed-off-by: Linus Walleij <[email protected]>
This commit is contained in:
parent
bc33b0ca11
commit
53f8d32223
1 changed files with 1 additions and 0 deletions
|
|
@ -380,6 +380,7 @@ static void pca953x_gpio_set_multiple(struct gpio_chip *gc,
|
|||
if (bank_mask) {
|
||||
bank_val = bits[bank / sizeof(*bits)] >>
|
||||
((bank % sizeof(*bits)) * 8);
|
||||
bank_val &= bank_mask;
|
||||
reg_val[bank] = (reg_val[bank] & ~bank_mask) | bank_val;
|
||||
}
|
||||
}
|
||||
|
|
|
|||
Loading…
Reference in a new issue