diff options
author | Gary King <gking@nvidia.com> | 2009-12-16 15:59:42 -0800 |
---|---|---|
committer | Gary King <gking@nvidia.com> | 2009-12-16 19:27:47 -0800 |
commit | 1d49dee8978542cb94ffe04184433002a5c78d16 (patch) | |
tree | 39d9047625996cfbb370fc2f0488fd23d49da621 /drivers/power | |
parent | 7f3aed6eb9e2040475df4afacedd5bc1ffca5f3b (diff) |
power: enable charger status in tegra NvEc battery driver
enables charger status in tegra NvEc battery driver
modify the reported status to match Android expectations:
* HIGH returns FULL
* NO_BATTERY returns UNKNOWN
* any unmatched case returns UNKNOWN
Diffstat (limited to 'drivers/power')
-rw-r--r-- | drivers/power/nvec_battery.c | 10 |
1 files changed, 7 insertions, 3 deletions
diff --git a/drivers/power/nvec_battery.c b/drivers/power/nvec_battery.c index 1075b10fc7c2..48385e66bab3 100644 --- a/drivers/power/nvec_battery.c +++ b/drivers/power/nvec_battery.c @@ -38,7 +38,7 @@ /* This defines the manufacturer name and model name length */ #define BATTERY_INFO_NAME_LEN 30 -#define GET_CHARGER_STATUS 0 +#define GET_CHARGER_STATUS 1 typedef enum { @@ -291,13 +291,17 @@ static int tegra_battery_get_property(struct power_supply *psy, val->intval = POWER_SUPPLY_STATUS_UNKNOWN; } else if (state == NVODM_BATTERY_STATUS_NO_BATTERY) { batt_dev->present = NV_FALSE; - val->intval = POWER_SUPPLY_STATUS_NOT_CHARGING; + val->intval = POWER_SUPPLY_STATUS_UNKNOWN; } else if (state & NVODM_BATTERY_STATUS_CHARGING) { batt_dev->present = NV_TRUE; val->intval = POWER_SUPPLY_STATUS_CHARGING; /* TODO:Get Charger status here */ + } else if (state & NVODM_BATTERY_STATUS_HIGH) { + batt_dev->present = NV_TRUE; + val->intval = POWER_SUPPLY_STATUS_FULL; + /* TODO:Get Charger status here */ } else - val->intval = POWER_SUPPLY_STATUS_DISCHARGING; + val->intval = POWER_SUPPLY_STATUS_UNKNOWN; #endif /* Getting the battery info once here so for the other property * requests there will not be lot of ec req */ |