Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit 4d96fb1e authored by Heiko Stuebner's avatar Heiko Stuebner Committed by Sebastian Reichel
Browse files

power: gpio-charger: do not use gpio value directly



Some gpio implementations return interesting values for gpio_get_value when
the value is not 0 - as seen on a imx6sl board. Therefore do not use the
value returned from gpio_get_value directly but simply check for 0 or not 0.

Signed-off-by: default avatarHeiko Stuebner <heiko.stuebner@bq.com>
Reviewed-by: default avatarDoug Anderson <dianders@chromium.org>
Tested-by: default avatarDoug Anderson <dianders@chromium.org>
Signed-off-by: default avatarSebastian Reichel <sre@kernel.org>
parent ddd26dff
Loading
Loading
Loading
Loading
+1 −1
Original line number Diff line number Diff line
@@ -55,7 +55,7 @@ static int gpio_charger_get_property(struct power_supply *psy,

	switch (psp) {
	case POWER_SUPPLY_PROP_ONLINE:
		val->intval = gpio_get_value_cansleep(pdata->gpio);
		val->intval = !!gpio_get_value_cansleep(pdata->gpio);
		val->intval ^= pdata->gpio_active_low;
		break;
	default: