2 * RockChip ADC Battery Driver
3 * Copyright (C) 2012, RockChip
5 * Authors: xuhuicong <xhc@rock-chips.com>
7 * Based on rk30_adc_battery.c
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.
15 #ifndef RK30_FACTORY_ADC_BATTERY_H
16 #define RK30_FACTORY_ADC_BATTERY_H
20 struct rk30_adc_battery_platform_data {
22 int (*io_deinit)(void);
23 int (*is_dc_charging)(void);
24 int (*charging_ok)(void);
26 int (*is_usb_charging)(void);
27 int spport_usb_charging ;
28 int (*control_usb_charging)(int);
37 int ctrl_charge_led_pin;
38 int ctrl_charge_enable;
39 void (*ctrl_charge_led)(int);
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;
54 int low_voltage_protection; // low voltage protection
56 int charging_sleep; // don't have lock,if chargeing_sleep = 0;else have lock
58 int is_reboot_charging;
59 int save_capacity; //save capacity to /data/bat_last_capacity.dat, suggested use
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
65 int time_down_discharge; //the time of capactiy drop 1% --discharge
66 int time_up_charge; //the time of capacity up 1% ---charging
73 int *board_batt_table;
78 struct iio_channel *chan;