iommu/vt-d: Fix a deadlock in intel_svm_drain_prq()
[linux-2.6-microblaze.git] / drivers / power / supply / ab8500-chargalg.h
1 /* SPDX-License-Identifier: GPL-2.0-only */
2 /*
3  * Copyright (C) ST-Ericsson SA 2012
4  * Author: Johan Gardsmark <johan.gardsmark@stericsson.com> for ST-Ericsson.
5  */
6
7 #ifndef _AB8500_CHARGALG_H_
8 #define _AB8500_CHARGALG_H_
9
10 #include <linux/power_supply.h>
11
12 /*
13  * Valid only for supplies of type:
14  * - POWER_SUPPLY_TYPE_MAINS,
15  * - POWER_SUPPLY_TYPE_USB,
16  * because only them store as drv_data pointer to struct ux500_charger.
17  */
18 #define psy_to_ux500_charger(x) power_supply_get_drvdata(x)
19
20 /* Forward declaration */
21 struct ux500_charger;
22
23 struct ux500_charger_ops {
24         int (*enable) (struct ux500_charger *, int, int, int);
25         int (*check_enable) (struct ux500_charger *, int, int);
26         int (*kick_wd) (struct ux500_charger *);
27         int (*update_curr) (struct ux500_charger *, int);
28 };
29
30 /**
31  * struct ux500_charger - power supply ux500 charger sub class
32  * @psy                 power supply base class
33  * @ops                 ux500 charger operations
34  * @max_out_volt        maximum output charger voltage in mV
35  * @max_out_curr        maximum output charger current in mA
36  * @enabled             indicates if this charger is used or not
37  * @external            external charger unit (pm2xxx)
38  */
39 struct ux500_charger {
40         struct power_supply *psy;
41         struct ux500_charger_ops ops;
42         int max_out_volt;
43         int max_out_curr;
44         int wdt_refresh;
45         bool enabled;
46         bool external;
47 };
48
49 extern struct blocking_notifier_head charger_notifier_list;
50
51 #endif /* _AB8500_CHARGALG_H_ */