2012-02-29 23:24:25 +07:00
|
|
|
/*
|
|
|
|
* 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);
|
2013-02-14 16:24:10 +07:00
|
|
|
int (*check_enable) (struct ux500_charger *, int, int);
|
2012-02-29 23:24:25 +07:00
|
|
|
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
|
2012-04-26 15:00:04 +07:00
|
|
|
* @enabled indicates if this charger is used or not
|
2012-05-10 20:33:56 +07:00
|
|
|
* @external external charger unit (pm2xxx)
|
2012-02-29 23:24:25 +07:00
|
|
|
*/
|
|
|
|
struct ux500_charger {
|
|
|
|
struct power_supply psy;
|
|
|
|
struct ux500_charger_ops ops;
|
|
|
|
int max_out_volt;
|
|
|
|
int max_out_curr;
|
2012-05-10 20:33:56 +07:00
|
|
|
int wdt_refresh;
|
2012-04-26 15:00:04 +07:00
|
|
|
bool enabled;
|
2012-05-10 20:33:56 +07:00
|
|
|
bool external;
|
2012-02-29 23:24:25 +07:00
|
|
|
};
|
|
|
|
|
|
|
|
#endif
|