1 #ifndef __LINUX_BQ27X00_BATTERY_H__
2 #define __LINUX_BQ27X00_BATTERY_H__
5 BQ27000 = 1, /* bq27000, bq27200 */
6 BQ27010, /* bq27010, bq27210 */
7 BQ27500, /* bq27500, bq27510, bq27520 */
8 BQ27530, /* bq27530, bq27531 */
9 BQ27541, /* bq27541, bq27542, bq27546, bq27742 */
10 BQ27545, /* bq27545 */
11 BQ27421, /* bq27421, bq27425, bq27441, bq27621 */
15 * struct bq27xxx_plaform_data - Platform data for bq27xxx devices
16 * @name: Name of the battery.
17 * @chip: Chip class number of this device.
18 * @read: HDQ read callback.
19 * This function should provide access to the HDQ bus the battery is
21 * The first parameter is a pointer to the battery device, the second the
22 * register to be read. The return value should either be the content of
23 * the passed register or an error value.
25 struct bq27xxx_platform_data {
27 enum bq27xxx_chip chip;
28 int (*read)(struct device *dev, unsigned int);
31 struct bq27xxx_device_info;
32 struct bq27xxx_access_methods {
33 int (*read)(struct bq27xxx_device_info *di, u8 reg, bool single);
36 struct bq27xxx_reg_cache {
39 int time_to_empty_avg;
50 struct bq27xxx_device_info {
53 enum bq27xxx_chip chip;
55 struct bq27xxx_access_methods bus;
56 struct bq27xxx_reg_cache cache;
57 int charge_design_full;
58 unsigned long last_update;
59 struct delayed_work work;
60 struct power_supply *bat;
65 void bq27xxx_battery_update(struct bq27xxx_device_info *di);
66 int bq27xxx_battery_setup(struct bq27xxx_device_info *di);
67 void bq27xxx_battery_teardown(struct bq27xxx_device_info *di);