summaryrefstree
path: root/kernel/drivers/battery/common/sec_battery_ttf.h
blob: 3c9e85854d9daf542027242da8a006ace98f94da (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
/*
 * sec_battery.h
 * Samsung Mobile Battery Header
 *
 *
 * Copyright (C) 2012 Samsung Electronics, Inc.
 *
 *
 * This software is licensed under the terms of the GNU General Public
 * License version 2, as published by the Free Software Foundation, and
 * may be copied, distributed, and modified under those terms.
 *
 * This program is distributed in the hope that it will be useful,
 * but WITHOUT ANY WARRANTY; without even the implied warranty of
 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
 * GNU General Public License for more details.
 *
 */

#ifndef __SEC_BATTERY_TTF_H
#define __SEC_BATTERY_TTF_H __FILE__

struct sec_cv_slope {
		int fg_current;
		int soc;
		int time;
};

struct sec_battery_info;

struct sec_ttf_data {
	void *pdev;
	int timetofull;

	unsigned int ttf_hv_12v_charge_current;
	unsigned int ttf_hv_charge_current;
	unsigned int ttf_hv_12v_wireless_charge_current;
	unsigned int ttf_hv_wireless_charge_current;
	unsigned int ttf_wireless_charge_current;
	unsigned int ttf_dc25_charge_current;
	unsigned int ttf_dc45_charge_current;
	unsigned int ttf_predict_wc20_charge_current;

	struct sec_cv_slope *cv_data;
	int cv_data_length;
	unsigned int ttf_capacity;

	struct delayed_work timetofull_work;
};

int sec_calc_ttf(struct sec_battery_info * battery, unsigned int ttf_curr);
extern void sec_bat_calc_time_to_full(struct sec_battery_info * battery);
void sec_bat_predict_wireless20_time_to_full_current(struct sec_battery_info *battery, int rx_power);
extern void sec_bat_time_to_full_work(struct work_struct *work);
extern void ttf_init(struct sec_battery_info *battery);
extern void ttf_work_start(struct sec_battery_info *battery);
extern int ttf_display(struct sec_battery_info *battery);
#ifdef CONFIG_OF
int sec_ttf_parse_dt(struct sec_battery_info *battery);
#endif

#endif /* __SEC_BATTERY_H */