
AB and PMxxx doesn't have same watchdog refresh period. Add watchdog to refresh period parameters in x500 charger structure, this should kick watchdog every 30sec. The AC charging should also kick both pm2xxx and the AB charger watchdog. Signed-off-by: Rajkumar Kasirajan <rajkumar.kasirajan@stericsson.com> Signed-off-by: Loic Pallardy <loic.pallardy@stericsson.com> Signed-off-by: Lee Jones <lee.jones@linaro.org> Reviewed-by: Michel JAOUEN <michel.jaouen@stericsson.com> Reviewed-by: Marcus COOPER <marcus.xm.cooper@stericsson.com> Reviewed-by: Jonas ABERG <jonas.aberg@stericsson.com> Tested-by: Michel JAOUEN <michel.jaouen@stericsson.com> Tested-by: Jonas ABERG <jonas.aberg@stericsson.com>
44 lines
1.1 KiB
C
44 lines
1.1 KiB
C
/*
|
|
* Copyright (C) ST-Ericsson SA 2012
|
|
* Author: Johan Gardsmark <johan.gardsmark@stericsson.com> for ST-Ericsson.
|
|
* License terms: GNU General Public License (GPL), version 2
|
|
*/
|
|
|
|
#ifndef _UX500_CHARGALG_H
|
|
#define _UX500_CHARGALG_H
|
|
|
|
#include <linux/power_supply.h>
|
|
|
|
#define psy_to_ux500_charger(x) container_of((x), \
|
|
struct ux500_charger, psy)
|
|
|
|
/* Forward declaration */
|
|
struct ux500_charger;
|
|
|
|
struct ux500_charger_ops {
|
|
int (*enable) (struct ux500_charger *, int, int, int);
|
|
int (*kick_wd) (struct ux500_charger *);
|
|
int (*update_curr) (struct ux500_charger *, int);
|
|
};
|
|
|
|
/**
|
|
* struct ux500_charger - power supply ux500 charger sub class
|
|
* @psy power supply base class
|
|
* @ops ux500 charger operations
|
|
* @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
|