power: android battery: add generic android battery driver
[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 };
24
25 struct android_bat_platform_data {
26         void (*register_callbacks)(struct android_bat_callbacks *);
27         void (*unregister_callbacks)(void);
28         void (*set_charging_current) (int);
29         void (*set_charging_enable) (int);
30         int (*poll_charge_source) (void);
31         int (*get_capacity) (void);
32         int (*get_temperature) (int *);
33         int (*get_voltage_now)(void);
34         int (*get_current_now)(int *);
35
36         int temp_high_threshold;
37         int temp_high_recovery;
38         int temp_low_recovery;
39         int temp_low_threshold;
40 };
41
42 #endif