Skip to content

Commit

Permalink
---
Browse files Browse the repository at this point in the history
yaml
---
r: 330515
b: refs/heads/master
c: 20414e2
h: refs/heads/master
i:
  330513: 2b3f27e
  330511: b9b0ef4
v: v3
  • Loading branch information
Kim, Milo authored and Anton Vorontsov committed Sep 21, 2012
1 parent 3531d6b commit 9478856
Show file tree
Hide file tree
Showing 2 changed files with 14 additions and 10 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: e06374b0d6055ef21e49d14d955eb9fc5088f707
refs/heads/master: 20414e2e0e10c2152e44784599e6d66fae39d77c
22 changes: 13 additions & 9 deletions trunk/drivers/power/lp8727_charger.c
Original file line number Diff line number Diff line change
Expand Up @@ -393,16 +393,20 @@ static int lp8727_battery_get_property(struct power_supply *psy,
static void lp8727_charger_changed(struct power_supply *psy)
{
struct lp8727_chg *pchg = dev_get_drvdata(psy->dev->parent);
u8 eoc_level;
u8 ichg;
u8 val;
u8 eoc_level, ichg;

if (lp8727_is_charger_attached(psy->name, pchg->devid)) {
if (pchg->chg_parm) {
eoc_level = pchg->chg_parm->eoc_level;
ichg = pchg->chg_parm->ichg;
val = (ichg << LP8727_ICHG_SHIFT) | eoc_level;
lp8727_write_byte(pchg, LP8727_CHGCTRL2, val);
}

/* skip if no charger exists */
if (!lp8727_is_charger_attached(psy->name, pchg->devid))
return;

/* update charging parameters */
if (pchg->chg_parm) {
eoc_level = pchg->chg_parm->eoc_level;
ichg = pchg->chg_parm->ichg;
val = (ichg << LP8727_ICHG_SHIFT) | eoc_level;
lp8727_write_byte(pchg, LP8727_CHGCTRL2, val);
}
}

Expand Down

0 comments on commit 9478856

Please sign in to comment.