max8903_charger.h 1.7 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657
  1. /*
  2. * max8903_charger.h - Maxim 8903 USB/Adapter Charger Driver
  3. *
  4. * Copyright (C) 2011 Samsung Electronics
  5. * MyungJoo Ham <myungjoo.ham@samsung.com>
  6. *
  7. * This program is free software; you can redistribute it and/or modify
  8. * it under the terms of the GNU General Public License as published by
  9. * the Free Software Foundation; either version 2 of the License, or
  10. * (at your option) any later version.
  11. *
  12. * This program is distributed in the hope that it will be useful,
  13. * but WITHOUT ANY WARRANTY; without even the implied warranty of
  14. * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
  15. * GNU General Public License for more details.
  16. *
  17. * You should have received a copy of the GNU General Public License
  18. * along with this program; if not, write to the Free Software
  19. * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
  20. *
  21. */
  22. #ifndef __MAX8903_CHARGER_H__
  23. #define __MAX8903_CHARGER_H__
  24. struct max8903_pdata {
  25. /*
  26. * GPIOs
  27. * cen, chg, flt, and usus are optional.
  28. * dok, dcm, and uok are not optional depending on the status of
  29. * dc_valid and usb_valid.
  30. */
  31. int cen; /* Charger Enable input */
  32. int dok; /* DC(Adapter) Power OK output */
  33. int uok; /* USB Power OK output */
  34. int chg; /* Charger status output */
  35. int flt; /* Fault output */
  36. int dcm; /* Current-Limit Mode input (1: DC, 2: USB) */
  37. int usus; /* USB Suspend Input (1: suspended) */
  38. /*
  39. * DC(Adapter/TA) is wired
  40. * When dc_valid is true,
  41. * dok and dcm should be valid.
  42. *
  43. * At least one of dc_valid or usb_valid should be true.
  44. */
  45. bool dc_valid;
  46. /*
  47. * USB is wired
  48. * When usb_valid is true,
  49. * uok should be valid.
  50. */
  51. bool usb_valid;
  52. };
  53. #endif /* __MAX8903_CHARGER_H__ */