Skip to content

Commit

Permalink
---
Browse files Browse the repository at this point in the history
yaml
---
r: 350641
b: refs/heads/master
c: e07a564
h: refs/heads/master
i:
  350639: fc43f52
v: v3
  • Loading branch information
Loic Pallardy authored and Lee Jones committed Jan 23, 2013
1 parent af04e88 commit 80ddeac
Show file tree
Hide file tree
Showing 6 changed files with 24 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: e3455002d04276c256a531f7175dce0f7d1cb78a
refs/heads/master: e07a56453b14b929cf01bf032cc3e3220094609c
6 changes: 6 additions & 0 deletions trunk/drivers/power/ab8500_charger.c
Original file line number Diff line number Diff line change
Expand Up @@ -93,6 +93,8 @@

#define CHARGER_STATUS_POLL 10 /* in ms */

#define CHG_WD_INTERVAL (60 * HZ)

/* UsbLineStatus register - usb types */
enum ab8500_charger_link_status {
USB_STAT_NOT_CONFIGURED,
Expand Down Expand Up @@ -2953,7 +2955,9 @@ static int ab8500_charger_probe(struct platform_device *pdev)
ARRAY_SIZE(ab8500_charger_voltage_map) - 1];
di->ac_chg.max_out_curr = ab8500_charger_current_map[
ARRAY_SIZE(ab8500_charger_current_map) - 1];
di->ac_chg.wdt_refresh = CHG_WD_INTERVAL;
di->ac_chg.enabled = di->pdata->ac_enabled;
di->ac_chg.external = false;

/* USB supply */
/* power_supply base class */
Expand All @@ -2972,7 +2976,9 @@ static int ab8500_charger_probe(struct platform_device *pdev)
ARRAY_SIZE(ab8500_charger_voltage_map) - 1];
di->usb_chg.max_out_curr = ab8500_charger_current_map[
ARRAY_SIZE(ab8500_charger_current_map) - 1];
di->usb_chg.wdt_refresh = CHG_WD_INTERVAL;
di->usb_chg.enabled = di->pdata->usb_enabled;
di->usb_chg.external = false;

/* Create a work queue for the charger */
di->charger_wq =
Expand Down
12 changes: 11 additions & 1 deletion trunk/drivers/power/abx500_chargalg.c
Original file line number Diff line number Diff line change
Expand Up @@ -445,8 +445,18 @@ static int abx500_chargalg_kick_watchdog(struct abx500_chargalg *di)
{
/* Check if charger exists and kick watchdog if charging */
if (di->ac_chg && di->ac_chg->ops.kick_wd &&
di->chg_info.online_chg & AC_CHG)
di->chg_info.online_chg & AC_CHG) {
/*
* If AB charger watchdog expired, pm2xxx charging
* gets disabled. To be safe, kick both AB charger watchdog
* and pm2xxx watchdog.
*/
if (di->ac_chg->external &&
di->usb_chg && di->usb_chg->ops.kick_wd)
di->usb_chg->ops.kick_wd(di->usb_chg);

return di->ac_chg->ops.kick_wd(di->ac_chg);
}
else if (di->usb_chg && di->usb_chg->ops.kick_wd &&
di->chg_info.online_chg & USB_CHG)
return di->usb_chg->ops.kick_wd(di->usb_chg);
Expand Down
2 changes: 2 additions & 0 deletions trunk/drivers/power/pm2301_charger.c
Original file line number Diff line number Diff line change
Expand Up @@ -875,7 +875,9 @@ static int __devinit pm2xxx_wall_charger_probe(struct i2c_client *i2c_client,
ARRAY_SIZE(pm2xxx_charger_voltage_map) - 1];
pm2->ac_chg.max_out_curr = pm2xxx_charger_current_map[
ARRAY_SIZE(pm2xxx_charger_current_map) - 1];
pm2->ac_chg.wdt_refresh = WD_KICK_INTERVAL;
pm2->ac_chg.enabled = true;
pm2->ac_chg.external = true;

/* Create a work queue for the charger */
pm2->charger_wq =
Expand Down
2 changes: 1 addition & 1 deletion trunk/drivers/power/pm2301_charger.h
Original file line number Diff line number Diff line change
Expand Up @@ -32,7 +32,7 @@

/* Watchdog timeout constant */
#define WD_TIMER 0x30 /* 4min */
#define WD_KICK_INTERVAL (60 * HZ)
#define WD_KICK_INTERVAL (30 * HZ)

#define PM2XXX_NUM_INT_REG 0x6

Expand Down
3 changes: 3 additions & 0 deletions trunk/include/linux/mfd/abx500/ux500_chargalg.h
Original file line number Diff line number Diff line change
Expand Up @@ -28,13 +28,16 @@ struct ux500_charger_ops {
* @max_out_volt maximum output charger voltage in mV
* @max_out_curr maximum output charger current in mA
* @enabled indicates if this charger is used or not
* @external external charger unit (pm2xxx)
*/
struct ux500_charger {
struct power_supply psy;
struct ux500_charger_ops ops;
int max_out_volt;
int max_out_curr;
int wdt_refresh;
bool enabled;
bool external;
};

#endif

0 comments on commit 80ddeac

Please sign in to comment.