aboutsummaryrefslogtreecommitdiffstats
path: root/include/linux/power/sec_battery_px.h
blob: 7b8dadc0f86623590b9218c835303cfc58b9adf6 (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
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
/*
 *  sec_battery.h
 *  charger systems for lithium-ion (Li+) batteries
 *
 *  Copyright (C) 2010 Samsung Electronics
 *
 * This program is free software; you can redistribute it and/or modify
 * it under the terms of the GNU General Public License version 2 as
 * published by the Free Software Foundation.
 */

#ifndef _LINUX_SEC_BATTERY_H
#define _LINUX_SEC_BATTERY_H

enum charger_type {
	CHARGER_BATTERY = 0,
	CHARGER_USB,
	CHARGER_AC,
	CHARGER_DOCK,
	CHARGER_MISC,
	CHARGER_DISCHARGE
};

struct max8903_charger_data {
	int enable_line;
	int connect_line;
	int fullcharge_line;
	int currentset_line;
	int accessory_line;
};

struct sec_battery_platform_data {
	struct max8903_charger_data charger;

	void (*set_charging_state) (int, int);
	int (*get_charging_state) (void);
	void (*set_charging_current) (int);
	int (*get_charging_current) (void);
	int (*get_charger_is_full)(void);

	void (*init_charger_gpio) (void);
	void (*inform_charger_connection) (int);
	int temp_high_threshold;
	int temp_high_recovery;
	int temp_low_recovery;
	int temp_low_threshold;
	int charge_duration;
	int recharge_duration;
	int recharge_voltage;
	int (*check_lp_charging_boot) (void);
	int (*check_jig_status) (void);

};

/* for test driver */
#define __TEST_DEVICE_DRIVER__

enum capacity_type {
	CAPACITY_TYPE_FULL = 0,
	CAPACITY_TYPE_MIX,
	CAPACITY_TYPE_AV,
	CAPACITY_TYPE_REP,
};

enum dock_type {
	DOCK_NONE = 0,
	DOCK_DESK,
	DOCK_KEYBOARD,
};

extern int low_batt_compensation(int fg_soc, int fg_vcell, int fg_current);
extern void reset_low_batt_comp_cnt(void);
extern int get_fuelgauge_value(int data);
extern struct max17042_chip *max17042_chip_data;
extern int get_fuelgauge_capacity(enum capacity_type type);

#if defined(CONFIG_STMPE811_ADC)
u16 stmpe811_get_adc_data(u8 channel);
#endif

#endif