Skip to content

Commit

Permalink
---
Browse files Browse the repository at this point in the history
yaml
---
r: 242577
b: refs/heads/master
c: 3413b4e
h: refs/heads/master
i:
  242575: 9397d4b
v: v3
  • Loading branch information
Lars-Peter Clausen committed Feb 22, 2011
1 parent 4e06ff2 commit f48c480
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 3 deletions.
2 changes: 1 addition & 1 deletion [refs]
Original file line number Diff line number Diff line change
@@ -1,2 +1,2 @@
---
refs/heads/master: a2e5118c370e78c3841606e7edc7677c986325fa
refs/heads/master: 3413b4ea250ff0b4142a154a2764e33979957e8b
9 changes: 7 additions & 2 deletions trunk/drivers/power/bq27x00_battery.c
Original file line number Diff line number Diff line change
Expand Up @@ -252,16 +252,21 @@ static int bq27x00_battery_get_property(struct power_supply *psy,
{
int ret = 0;
struct bq27x00_device_info *di = to_bq27x00_device_info(psy);
int voltage = bq27x00_battery_voltage(di);

if (psp != POWER_SUPPLY_PROP_PRESENT && voltage <= 0)
return -ENODEV;

switch (psp) {
case POWER_SUPPLY_PROP_STATUS:
ret = bq27x00_battery_status(di, val);
break;
case POWER_SUPPLY_PROP_VOLTAGE_NOW:
val->intval = voltage;
break;
case POWER_SUPPLY_PROP_PRESENT:
val->intval = bq27x00_battery_voltage(di);
if (psp == POWER_SUPPLY_PROP_PRESENT)
val->intval = val->intval <= 0 ? 0 : 1;
val->intval = voltage <= 0 ? 0 : 1;
break;
case POWER_SUPPLY_PROP_CURRENT_NOW:
val->intval = bq27x00_battery_current(di);
Expand Down

0 comments on commit f48c480

Please sign in to comment.