ux500_chargalg.h 959 B

1234567891011121314151617181920212223242526272829303132333435363738
  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. */
  25. struct ux500_charger {
  26. struct power_supply psy;
  27. struct ux500_charger_ops ops;
  28. int max_out_volt;
  29. int max_out_curr;
  30. };
  31. #endif