pda_power.h 1005 B

123456789101112131415161718192021222324252627282930313233343536373839
  1. /* SPDX-License-Identifier: GPL-2.0-only */
  2. /*
  3. * Common power driver for PDAs and phones with one or two external
  4. * power supplies (AC/USB) connected to main and backup batteries,
  5. * and optional builtin charger.
  6. *
  7. * Copyright © 2007 Anton Vorontsov <cbou@mail.ru>
  8. */
  9. #ifndef __PDA_POWER_H__
  10. #define __PDA_POWER_H__
  11. #define PDA_POWER_CHARGE_AC (1 << 0)
  12. #define PDA_POWER_CHARGE_USB (1 << 1)
  13. struct device;
  14. struct pda_power_pdata {
  15. int (*init)(struct device *dev);
  16. int (*is_ac_online)(void);
  17. int (*is_usb_online)(void);
  18. void (*set_charge)(int flags);
  19. void (*exit)(struct device *dev);
  20. int (*suspend)(pm_message_t state);
  21. int (*resume)(void);
  22. char **supplied_to;
  23. size_t num_supplicants;
  24. unsigned int wait_for_status; /* msecs, default is 500 */
  25. unsigned int wait_for_charger; /* msecs, default is 500 */
  26. unsigned int polling_interval; /* msecs, default is 2000 */
  27. unsigned long ac_max_uA; /* current to draw when on AC */
  28. bool use_otg_notifier;
  29. };
  30. #endif /* __PDA_POWER_H__ */