ux500_chargalg.h 1.4 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950
  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. int (*pp_enable) (struct ux500_charger *, bool);
  19. int (*pre_chg_enable) (struct ux500_charger *, bool);
  20. };
  21. /**
  22. * struct ux500_charger - power supply ux500 charger sub class
  23. * @psy power supply base class
  24. * @ops ux500 charger operations
  25. * @max_out_volt maximum output charger voltage in mV
  26. * @max_out_curr maximum output charger current in mA
  27. * @enabled indicates if this charger is used or not
  28. * @external external charger unit (pm2xxx)
  29. * @power_path USB power path support
  30. */
  31. struct ux500_charger {
  32. struct power_supply psy;
  33. struct ux500_charger_ops ops;
  34. int max_out_volt;
  35. int max_out_curr;
  36. int wdt_refresh;
  37. bool enabled;
  38. bool external;
  39. bool power_path;
  40. };
  41. extern struct blocking_notifier_head charger_notifier_list;
  42. #endif