aboutsummaryrefslogtreecommitdiffstats
path: root/arch/arm/mach-ak98/include/mach/bat.h
blob: 54fbcb8560e979f15d43fe18bb75acfccabe66e7 (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
#ifndef __AK98_BAT_H_
#define __AK98_BAT_H_ __FILE__

#include <mach/gpio.h>
#include <mach/adc1.h>

struct bat_gpio{

	int active;					/* active value */
	int irq;						/* use for ac in or out irq */
	struct gpio_info pindata;		/* battery gpios info */

};

struct bat_info{
	int charge_full_pin;	/* use for juge if battery charge full */ 									  
	int voltage_sample;		/* read how many voltge sample */	
	int power_down_level;	/* if (capacity<=power_down_level), power down */
	int max_voltage;		/* max battery voltage  */
    int min_voltage;		/* min battery voltage  */
    int full_capacity;
    int charge_max_time;
};

struct bat_ad4{
	unsigned int sample_rate;		/* the same as touch screen */
	unsigned int wait_time;			/* the same as touch screen */
	int up_resistance;				/* read ad4 voltage resistance */
	int dw_resistance;
	int voltage_correct;			/* correct voltage from adc1-4*/
	int adc_avdd;					/* adc avdd */
	int adc_poweroff;				/* poweroff adc value */
};

struct bat_charge_bight{
	int *capacity;
	int *time;
	int	length;
	int points;
};

struct bat_discharge_bight{
	int *capacity;
	int *voltage;
	int length;
	int points;
};

struct bat_charge_cv_bight{
	int *capacity;
	int *voltage;
	int length;
	int points;
};

struct ak98_bat_mach_info {

	void (* gpio_init) (const struct gpio_info *);
	struct bat_gpio usb_gpio;
	struct bat_gpio ac_gpio;
	struct bat_gpio state_gpio;
	struct bat_info bat_mach_info;
	struct bat_ad4  bat_adc;
	struct bat_charge_bight charge;
	struct bat_charge_cv_bight charge_cv;
	struct bat_discharge_bight discharge;
};

#endif				/* __AK98_BAT_H_ */