diff options
| author | Todd Poynor <toddpoynor@google.com> | 2014-09-26 17:30:58 -0700 |
|---|---|---|
| committer | Moyster <oysterized@gmail.com> | 2017-12-13 21:51:11 +0100 |
| commit | 66ab0808aa404e6605f86950afc32c7e6a5a2e5b (patch) | |
| tree | 3549b7504f22aa6218bde36aef6b48407f9d14e4 /drivers | |
| parent | e286a8c13178f9420888869c3c2ef11c40ba6fca (diff) | |
power: mediatek: add voltage_now battery property
Add battery property voltage_now, in units of uV per power_supply standard.
healthd and Android will use this value instead of the existing batt_vol
property (which is unepxectedly in mV units).
Change-Id: Ida25d702c30507ecedba4818a84be9baf66f67e0
Signed-off-by: Todd Poynor <toddpoynor@google.com>
Diffstat (limited to 'drivers')
| -rw-r--r-- | drivers/power/mediatek/battery_common.c | 4 |
1 files changed, 4 insertions, 0 deletions
diff --git a/drivers/power/mediatek/battery_common.c b/drivers/power/mediatek/battery_common.c index 2aa5a14f4..b75da558b 100644 --- a/drivers/power/mediatek/battery_common.c +++ b/drivers/power/mediatek/battery_common.c @@ -294,6 +294,7 @@ static enum power_supply_property battery_props[] = { POWER_SUPPLY_PROP_PRESENT, POWER_SUPPLY_PROP_TECHNOLOGY, POWER_SUPPLY_PROP_CAPACITY, + POWER_SUPPLY_PROP_VOLTAGE_NOW, #ifdef MEIZU_M81 POWER_SUPPLY_PROP_CURRENT_NOW, #endif @@ -642,6 +643,9 @@ static int battery_get_property(struct power_supply *psy, case POWER_SUPPLY_PROP_CAPACITY: val->intval = data->BAT_CAPACITY; break; + case POWER_SUPPLY_PROP_VOLTAGE_NOW: + val->intval = data->BAT_batt_vol * 1000; /* uV */ + break; #ifdef MEIZU_M81 case POWER_SUPPLY_PROP_CURRENT_NOW: is_charging = battery_meter_get_battery_current_sign(); |
