|
@@ -499,11 +499,11 @@ static int tps65010_gpio_get(struct gpio_chip *chip, unsigned offset)
|
|
if (offset < 4) {
|
|
if (offset < 4) {
|
|
value = i2c_smbus_read_byte_data(tps->client, TPS_DEFGPIO);
|
|
value = i2c_smbus_read_byte_data(tps->client, TPS_DEFGPIO);
|
|
if (value < 0)
|
|
if (value < 0)
|
|
- return 0;
|
|
|
|
|
|
+ return value;
|
|
if (value & (1 << (offset + 4))) /* output */
|
|
if (value & (1 << (offset + 4))) /* output */
|
|
return !(value & (1 << offset));
|
|
return !(value & (1 << offset));
|
|
else /* input */
|
|
else /* input */
|
|
- return (value & (1 << offset));
|
|
|
|
|
|
+ return !!(value & (1 << offset));
|
|
}
|
|
}
|
|
|
|
|
|
/* REVISIT we *could* report LED1/nPG and LED2 state ... */
|
|
/* REVISIT we *could* report LED1/nPG and LED2 state ... */
|