Skip to content

Commit

Permalink
---
Browse files Browse the repository at this point in the history
yaml
---
r: 350649
b: refs/heads/master
c: 0ed5107
h: refs/heads/master
i:
  350647: ae6e8ee
v: v3
  • Loading branch information
Jonas Aaberg authored and Lee Jones committed Jan 23, 2013
1 parent 386bf18 commit c83273a
Show file tree
Hide file tree
Showing 3 changed files with 36 additions and 7 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: 1a793a10899487d40ac3071f52a6e231260d935d
refs/heads/master: 0ed5107fa86013c91b1752230d44b79dffee0cda
22 changes: 16 additions & 6 deletions trunk/drivers/power/ab8500_charger.c
Original file line number Diff line number Diff line change
Expand Up @@ -2671,13 +2671,23 @@ static int ab8500_charger_init_hw_registers(struct ab8500_charger *di)
}
}

/* VBUS OVV set to 6.3V and enable automatic current limitiation */
ret = abx500_set_register_interruptible(di->dev,
AB8500_CHARGER,
AB8500_USBCH_CTRL2_REG,
VBUS_OVV_SELECT_6P3V | VBUS_AUTO_IN_CURR_LIM_ENA);
if (is_ab9540_2p0(di->parent) || is_ab8505_2p0(di->parent))
ret = abx500_mask_and_set_register_interruptible(di->dev,
AB8500_CHARGER,
AB8500_USBCH_CTRL2_REG,
VBUS_AUTO_IN_CURR_LIM_ENA,
VBUS_AUTO_IN_CURR_LIM_ENA);
else
/*
* VBUS OVV set to 6.3V and enable automatic current limitation
*/
ret = abx500_set_register_interruptible(di->dev,
AB8500_CHARGER,
AB8500_USBCH_CTRL2_REG,
VBUS_OVV_SELECT_6P3V | VBUS_AUTO_IN_CURR_LIM_ENA);
if (ret) {
dev_err(di->dev, "failed to set VBUS OVV\n");
dev_err(di->dev,
"failed to set automatic current limitation\n");
goto out;
}

Expand Down
19 changes: 19 additions & 0 deletions trunk/include/linux/mfd/abx500/ab8500.h
Original file line number Diff line number Diff line change
Expand Up @@ -346,4 +346,23 @@ static inline int is_ab8500_2p0(struct ab8500 *ab)
return (is_ab8500(ab) && (ab->chip_id == AB8500_CUT2P0));
}

static inline int is_ab8505_1p0_or_earlier(struct ab8500 *ab)
{
return (is_ab8505(ab) && (ab->chip_id <= AB8500_CUT1P0));
}

static inline int is_ab8505_2p0(struct ab8500 *ab)
{
return (is_ab8505(ab) && (ab->chip_id == AB8500_CUT2P0));
}

static inline int is_ab9540_1p0_or_earlier(struct ab8500 *ab)
{
return (is_ab9540(ab) && (ab->chip_id <= AB8500_CUT1P0));
}

static inline int is_ab9540_2p0(struct ab8500 *ab)
{
return (is_ab9540(ab) && (ab->chip_id == AB8500_CUT2P0));
}
#endif /* MFD_AB8500_H */

0 comments on commit c83273a

Please sign in to comment.