ux500_chargalg.h 1.1 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344
  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 (*check_enable) (struct ux500_charger *, int, int);
  16. int (*kick_wd) (struct ux500_charger *);
  17. int (*update_curr) (struct ux500_charger *, int);
  18. };
  19. /**
  20. * struct ux500_charger - power supply ux500 charger sub class
  21. * @psy power supply base class
  22. * @ops ux500 charger operations
  23. * @max_out_volt maximum output charger voltage in mV
  24. * @max_out_curr maximum output charger current in mA
  25. * @enabled indicates if this charger is used or not
  26. * @external external charger unit (pm2xxx)
  27. */
  28. struct ux500_charger {
  29. struct power_supply psy;
  30. struct ux500_charger_ops ops;
  31. int max_out_volt;
  32. int max_out_curr;
  33. int wdt_refresh;
  34. bool enabled;
  35. bool external;
  36. };
  37. #endif