drivers: power: report battery voltage in AOSP compatible format cm-14.1
authorStricted <info@stricted.net>
Tue, 8 May 2018 15:50:50 +0000 (17:50 +0200)
committerStricted <info@stricted.net>
Tue, 8 May 2018 15:50:50 +0000 (17:50 +0200)
drivers/power/power_supply_sysfs.c

index 0c687ea850dcfaf3264225688fa192a05f98f837..72e76c3488b41484b18f0d1b4409e5384b84c9ff 100644 (file)
@@ -109,6 +109,8 @@ static ssize_t power_supply_show_property(struct device *dev,
 
        if (off == POWER_SUPPLY_PROP_CHARGE_COUNTER_EXT)
                return sprintf(buf, "%lld\n", value.int64val);
+       else if (off == POWER_SUPPLY_PROP_batt_vol)
+               return sprintf(buf, "%d\n", (value.intval * 1000));
        else
                return sprintf(buf, "%d\n", value.intval);
 }