Skip to content

Commit

Permalink
---
Browse files Browse the repository at this point in the history
yaml
---
r: 330507
b: refs/heads/master
c: faaae9b
h: refs/heads/master
i:
  330505: 1b9b862
  330503: b2ebb53
v: v3
  • Loading branch information
Kim, Milo authored and Anton Vorontsov committed Sep 21, 2012
1 parent 2f339aa commit c1e5a36
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 12 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: b1ad079680b24386d12aa99dd9afd4eb7093bbee
refs/heads/master: faaae9bbb1f91f8bcd03bd9976620ac08d8b4454
16 changes: 5 additions & 11 deletions trunk/drivers/power/lp8727_charger.c
Original file line number Diff line number Diff line change
Expand Up @@ -55,6 +55,7 @@
#define CHGSTAT (3 << 4)
#define CHPORT (1 << 6)
#define DCPORT (1 << 7)
#define LP8727_STAT_EOC 0x30

/* STATUS2 register */
#define TEMP_STAT (3 << 5)
Expand All @@ -69,13 +70,6 @@ enum lp8727_dev_id {
ID_MAX,
};

enum lp8727_chg_stat {
PRECHG,
CC,
CV,
EOC,
};

enum lp8727_die_temp {
LP8788_TEMP_75C,
LP8788_TEMP_95C,
Expand Down Expand Up @@ -348,10 +342,10 @@ static int lp8727_battery_get_property(struct power_supply *psy,
case POWER_SUPPLY_PROP_STATUS:
if (lp8727_is_charger_attached(psy->name, pchg->devid)) {
lp8727_read_byte(pchg, STATUS1, &read);
if (((read & CHGSTAT) >> 4) == EOC)
val->intval = POWER_SUPPLY_STATUS_FULL;
else
val->intval = POWER_SUPPLY_STATUS_CHARGING;

val->intval = (read & CHGSTAT) == LP8727_STAT_EOC ?
POWER_SUPPLY_STATUS_FULL :
POWER_SUPPLY_STATUS_CHARGING;
} else {
val->intval = POWER_SUPPLY_STATUS_DISCHARGING;
}
Expand Down

0 comments on commit c1e5a36

Please sign in to comment.