86v:merge change for 86v
[firefly-linux-kernel-4.4.55.git] / include / linux / power / rk30_factory_adc_battery.h
1 /*
2  * RockChip ADC Battery Driver 
3  * Copyright (C) 2012, RockChip
4  *
5  * Authors: xuhuicong <xhc@rock-chips.com>
6  *
7  * Based on rk30_adc_battery.c
8
9  * This program is free software; you can redistribute it and/or modify
10  * it under the terms of the GNU General Public License version 2 as
11  * published by the Free Software Foundation.
12  *
13  */
14
15 #ifndef RK30_FACTORY_ADC_BATTERY_H
16 #define RK30_FACTORY_ADC_BATTERY_H
17
18
19 /* adc battery */
20 struct rk30_adc_battery_platform_data {
21         int (*io_init)(void);
22         int (*io_deinit)(void);
23         int (*is_dc_charging)(void);
24         int (*charging_ok)(void);
25
26         int (*is_usb_charging)(void);
27         int spport_usb_charging ;
28         int (*control_usb_charging)(int);
29
30         int usb_det_pin;
31         int dc_det_pin;
32         int batt_low_pin;
33         int charge_ok_pin;
34         int charge_set_pin;
35         int back_light_pin;
36
37         int ctrl_charge_led_pin;
38         int ctrl_charge_enable;
39         void (*ctrl_charge_led)(int);
40         
41         int dc_det_level;
42         int batt_low_level;
43         int charge_ok_level;
44         int charge_set_level;
45         int usb_det_level;
46         
47         int adc_channel;
48
49         int dc_det_pin_pull;    //pull up/down enable/disbale
50         int batt_low_pin_pull;
51         int charge_ok_pin_pull;
52         int charge_set_pin_pull;
53
54         int low_voltage_protection; // low voltage protection
55
56         int charging_sleep; // don't have lock,if chargeing_sleep = 0;else have lock
57         
58         int is_reboot_charging;
59         int save_capacity;  //save capacity to /data/bat_last_capacity.dat,  suggested use
60
61         int reference_voltage; // the rK2928 is 3300;RK3066 and rk29 are 2500;rk3066B is 1800;
62         int pull_up_res;      //divider resistance ,  pull-up resistor
63         int pull_down_res; //divider resistance , pull-down resistor
64
65         int time_down_discharge; //the time of capactiy drop 1% --discharge
66         int time_up_charge; //the time of capacity up 1% ---charging 
67
68         int  use_board_table;
69         int  table_size;
70         int  *discharge_table;
71         int  *charge_table;
72         int  *property_tabel;
73         int *board_batt_table;
74         int *dts_batt_table;
75
76 int is_dc_charge;
77 int is_usb_charge;
78  struct iio_channel *chan;
79
80 };
81
82 #endif