diff options
author | Arun Murthy <arun.murthy@stericsson.com> | 2011-05-26 16:48:47 +0530 |
---|---|---|
committer | Ulf Hansson <ulf.hansson@stericsson.com> | 2011-09-19 15:15:47 +0200 |
commit | a377fa599a006a8a2fd9a461a97b9b2ee6de4947 (patch) | |
tree | 99b5a88be4b12ee3b558393e70c5ff00409be15e /include/linux | |
parent | 5f7eaa017c80b7eb07e42fe983af7408742c7bca (diff) |
power: abx500-chargalg: charging algorithm
A generic charging algorithm for all abx500 varants. It is a high
level algorithm and hence doesn't include any low level or hardware
interaction. Each of the abx500 charging drivers will implement low
level hardware interaction function and provide inputs to this
generic charging algorithm to monitor and implement the charging
functionality.
ST-Ericsson Linux next: Not Tested
ST-Ericsson ID: WP256401
ST-Ericsson FOSS-OUT ID: Trivial
Change-Id: I8634160b2e67132ae68a09fda7a9fd9d36dd23d2
Signed-off-by: Arun Murthy <arun.murthy@stericsson.com>
Reviewed-on: http://gerrit.lud.stericsson.com/gerrit/23150
Reviewed-by: QATEST
Reviewed-by: Johan PALSSON <johan.palsson@stericsson.com>
Reviewed-by: Srinidhi KASAGAR <srinidhi.kasagar@stericsson.com>
Diffstat (limited to 'include/linux')
-rw-r--r-- | include/linux/mfd/abx500/ux500_chargalg.h | 38 |
1 files changed, 38 insertions, 0 deletions
diff --git a/include/linux/mfd/abx500/ux500_chargalg.h b/include/linux/mfd/abx500/ux500_chargalg.h new file mode 100644 index 00000000000..f04e47ff56a --- /dev/null +++ b/include/linux/mfd/abx500/ux500_chargalg.h @@ -0,0 +1,38 @@ +/* + * Copyright (C) ST-Ericsson SA 2011 + * 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 + */ +struct ux500_charger { + struct power_supply psy; + struct ux500_charger_ops ops; + int max_out_volt; + int max_out_curr; +}; + +#endif |