Revert "Input: adp5589-keys - fix adp5589_gpio_get_value()"

This reverts commit 983421299c.
This commit is contained in:
Ksawlii 2024-11-24 00:23:01 +01:00
parent fbadae29fe
commit 18cb742137

View file

@ -390,17 +390,10 @@ static int adp5589_gpio_get_value(struct gpio_chip *chip, unsigned off)
struct adp5589_kpad *kpad = gpiochip_get_data(chip);
unsigned int bank = kpad->var->bank(kpad->gpiomap[off]);
unsigned int bit = kpad->var->bit(kpad->gpiomap[off]);
int val;
mutex_lock(&kpad->gpio_lock);
if (kpad->dir[bank] & bit)
val = kpad->dat_out[bank];
else
val = adp5589_read(kpad->client,
kpad->var->reg(ADP5589_GPI_STATUS_A) + bank);
mutex_unlock(&kpad->gpio_lock);
return !!(val & bit);
return !!(adp5589_read(kpad->client,
kpad->var->reg(ADP5589_GPI_STATUS_A) + bank) &
bit);
}
static void adp5589_gpio_set_value(struct gpio_chip *chip,