twl4030_madc_battery.h 765 B

123456789101112131415161718192021222324252627282930
  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 <[email protected]>
  7. */
  8. #ifndef __TWL4030_MADC_BATTERY_H
  9. #define __TWL4030_MADC_BATTERY_H
  10. /*
  11. * Usually we can assume 100% @ 4.15V and 0% @ 3.3V but curves differ for
  12. * charging and discharging!
  13. */
  14. struct twl4030_madc_bat_calibration {
  15. short voltage; /* in mV - specify -1 for end of list */
  16. short level; /* in percent (0 .. 100%) */
  17. };
  18. struct twl4030_madc_bat_platform_data {
  19. unsigned int capacity; /* total capacity in uAh */
  20. struct twl4030_madc_bat_calibration *charging;
  21. int charging_size;
  22. struct twl4030_madc_bat_calibration *discharging;
  23. int discharging_size;
  24. };
  25. #endif