mirror of
https://github.com/BobTheBlinker/android_kernel_motorola_sm6375.git
synced 2026-10-29 11:11:45 -04:00
mfd: sm501 fix gpio number calculation for upper bank
The sm501_gpio_pin2nr() routine returns the wrong values for gpios in the upper bank. Signed-off-by: Ben Dooks <[email protected]> Signed-off-by: Andrew Morton <[email protected]> Signed-off-by: Linus Torvalds <[email protected]>
This commit is contained in:
parent
f2999209d7
commit
53a9600c63
1 changed files with 3 additions and 1 deletions
|
|
@ -1108,7 +1108,9 @@ static void sm501_gpio_remove(struct sm501_devdata *sm)
|
|||
static inline int sm501_gpio_pin2nr(struct sm501_devdata *sm, unsigned int pin)
|
||||
{
|
||||
struct sm501_gpio *gpio = &sm->gpio;
|
||||
return pin + (pin < 32) ? gpio->low.gpio.base : gpio->high.gpio.base;
|
||||
int base = (pin < 32) ? gpio->low.gpio.base : gpio->high.gpio.base;
|
||||
|
||||
return (pin % 32) + base;
|
||||
}
|
||||
|
||||
static inline int sm501_gpio_isregistered(struct sm501_devdata *sm)
|
||||
|
|
|
|||
Loading…
Reference in a new issue