2 * Copyright (C) ST-Ericsson SA 2012
3 * Author: Johan Gardsmark <johan.gardsmark@stericsson.com> for ST-Ericsson.
4 * License terms: GNU General Public License (GPL), version 2
7 #ifndef _UX500_CHARGALG_H
8 #define _UX500_CHARGALG_H
10 #include <linux/power_supply.h>
12 #define psy_to_ux500_charger(x) container_of((x), \
13 struct ux500_charger, psy)
15 /* Forward declaration */
18 struct ux500_charger_ops {
19 int (*enable) (struct ux500_charger *, int, int, int);
20 int (*check_enable) (struct ux500_charger *, int, int);
21 int (*kick_wd) (struct ux500_charger *);
22 int (*update_curr) (struct ux500_charger *, int);
23 int (*pp_enable) (struct ux500_charger *, bool);
24 int (*pre_chg_enable) (struct ux500_charger *, bool);
28 * struct ux500_charger - power supply ux500 charger sub class
29 * @psy power supply base class
30 * @ops ux500 charger operations
31 * @max_out_volt maximum output charger voltage in mV
32 * @max_out_curr maximum output charger current in mA
33 * @enabled indicates if this charger is used or not
34 * @external external charger unit (pm2xxx)
35 * @power_path USB power path support
37 struct ux500_charger {
38 struct power_supply psy;
39 struct ux500_charger_ops ops;
48 extern struct blocking_notifier_head charger_notifier_list;