power: android-battery: add charge timeouts and recharge logic
[firefly-linux-kernel-4.4.55.git] / include / linux / platform_data / android_battery.h
1 /*
2  *  android_battery.h
3  *
4  *  Copyright (C) 2012 Samsung Electronics
5  *
6  * This program is free software; you can redistribute it and/or modify
7  * it under the terms of the GNU General Public License version 2 as
8  * published by the Free Software Foundation.
9  */
10
11 #ifndef _LINUX_ANDROID_BATTERY_H
12 #define _LINUX_ANDROID_BATTERY_H
13
14 enum {
15         CHARGE_SOURCE_NONE = 0,
16         CHARGE_SOURCE_AC,
17         CHARGE_SOURCE_USB,
18 };
19
20 struct android_bat_callbacks {
21         void (*charge_source_changed)
22                 (struct android_bat_callbacks *, int);
23         void (*battery_set_full)(struct android_bat_callbacks *);
24 };
25
26 struct android_bat_platform_data {
27         void (*register_callbacks)(struct android_bat_callbacks *);
28         void (*unregister_callbacks)(void);
29         void (*set_charging_current) (int);
30         void (*set_charging_enable) (int);
31         int (*poll_charge_source) (void);
32         int (*get_capacity) (void);
33         int (*get_temperature) (int *);
34         int (*get_voltage_now)(void);
35         int (*get_current_now)(int *);
36
37         int temp_high_threshold;
38         int temp_high_recovery;
39         int temp_low_recovery;
40         int temp_low_threshold;
41
42         unsigned long full_charging_time;
43         unsigned long recharging_time;
44         unsigned int recharging_voltage;
45 };
46
47 #endif