| 1 | /* SPDX-License-Identifier: GPL-2.0-or-later */ |
| 2 | /* |
| 3 | * Dumb driver for LiIon batteries using TWL4030 madc. |
| 4 | * |
| 5 | * Copyright 2013 Golden Delicious Computers |
| 6 | * Nikolaus Schaller <hns@goldelico.com> |
| 7 | */ |
| 8 | |
| 9 | #ifndef __TWL4030_MADC_BATTERY_H |
| 10 | #define __TWL4030_MADC_BATTERY_H |
| 11 | |
| 12 | /* |
| 13 | * Usually we can assume 100% @ 4.15V and 0% @ 3.3V but curves differ for |
| 14 | * charging and discharging! |
| 15 | */ |
| 16 | |
| 17 | struct twl4030_madc_bat_calibration { |
| 18 | short voltage; /* in mV - specify -1 for end of list */ |
| 19 | short level; /* in percent (0 .. 100%) */ |
| 20 | }; |
| 21 | |
| 22 | struct twl4030_madc_bat_platform_data { |
| 23 | unsigned int capacity; /* total capacity in uAh */ |
| 24 | struct twl4030_madc_bat_calibration *charging; |
| 25 | int charging_size; |
| 26 | struct twl4030_madc_bat_calibration *discharging; |
| 27 | int discharging_size; |
| 28 | }; |
| 29 | |
| 30 | #endif |
| 31 | |