ux500_chargalg.h 1.1 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243
  1. /*
  2. * Copyright (C) ST-Ericsson SA 2012
  3. * Author: Johan Gardsmark <johan.gardsmark@stericsson.com> for ST-Ericsson.
  4. * License terms: GNU General Public License (GPL), version 2
  5. */
  6. #ifndef _UX500_CHARGALG_H
  7. #define _UX500_CHARGALG_H
  8. #include <linux/power_supply.h>
  9. #define psy_to_ux500_charger(x) container_of((x), \
  10. struct ux500_charger, psy)
  11. /* Forward declaration */
  12. struct ux500_charger;
  13. struct ux500_charger_ops {
  14. int (*enable) (struct ux500_charger *, int, int, int);
  15. int (*kick_wd) (struct ux500_charger *);
  16. int (*update_curr) (struct ux500_charger *, int);
  17. };
  18. /**
  19. * struct ux500_charger - power supply ux500 charger sub class
  20. * @psy power supply base class
  21. * @ops ux500 charger operations
  22. * @max_out_volt maximum output charger voltage in mV
  23. * @max_out_curr maximum output charger current in mA
  24. * @enabled indicates if this charger is used or not
  25. * @external external charger unit (pm2xxx)
  26. */
  27. struct ux500_charger {
  28. struct power_supply psy;
  29. struct ux500_charger_ops ops;
  30. int max_out_volt;
  31. int max_out_curr;
  32. int wdt_refresh;
  33. bool enabled;
  34. bool external;
  35. };
  36. #endif