]> git.kernelconcepts.de Git - karo-tx-linux.git/blob - include/linux/mfd/abx500/ux500_chargalg.h
Merge remote-tracking branch 'asoc/fix/ux500' into asoc-linus
[karo-tx-linux.git] / include / linux / mfd / abx500 / ux500_chargalg.h
1 /*
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
5  */
6
7 #ifndef _UX500_CHARGALG_H
8 #define _UX500_CHARGALG_H
9
10 #include <linux/power_supply.h>
11
12 #define psy_to_ux500_charger(x) container_of((x), \
13                 struct ux500_charger, psy)
14
15 /* Forward declaration */
16 struct ux500_charger;
17
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);
25 };
26
27 /**
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
36  */
37 struct ux500_charger {
38         struct power_supply psy;
39         struct ux500_charger_ops ops;
40         int max_out_volt;
41         int max_out_curr;
42         int wdt_refresh;
43         bool enabled;
44         bool external;
45         bool power_path;
46 };
47
48 extern struct blocking_notifier_head charger_notifier_list;
49
50 #endif