pm2301_charger.h 1.7 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162
  1. /*
  2. * PM2301 charger driver.
  3. *
  4. * Copyright (C) 2012 ST Ericsson Corporation
  5. *
  6. * Contact: Olivier LAUNAY (olivier.launay@stericsson.com
  7. *
  8. * This program is free software; you can redistribute it and/or
  9. * modify it under the terms of the GNU General Public License
  10. * version 2 as published by the Free Software Foundation.
  11. *
  12. * This program is distributed in the hope that it will be useful, but
  13. * WITHOUT ANY WARRANTY; without even the implied warranty of
  14. * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
  15. * 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., 51 Franklin St, Fifth Floor, Boston, MA
  20. * 02110-1301 USA
  21. */
  22. #ifndef __LINUX_PM2301_H
  23. #define __LINUX_PM2301_H
  24. /**
  25. * struct pm2xxx_bm_charger_parameters - Charger specific parameters
  26. * @ac_volt_max: maximum allowed AC charger voltage in mV
  27. * @ac_curr_max: maximum allowed AC charger current in mA
  28. */
  29. struct pm2xxx_bm_charger_parameters {
  30. int ac_volt_max;
  31. int ac_curr_max;
  32. };
  33. /**
  34. * struct pm2xxx_bm_data - pm2xxx battery management data
  35. * @enable_overshoot flag to enable VBAT overshoot control
  36. * @chg_params charger parameters
  37. */
  38. struct pm2xxx_bm_data {
  39. bool enable_overshoot;
  40. const struct pm2xxx_bm_charger_parameters *chg_params;
  41. };
  42. struct pm2xxx_charger_platform_data {
  43. char **supplied_to;
  44. size_t num_supplicants;
  45. int i2c_bus;
  46. const char *label;
  47. int gpio_irq_number;
  48. unsigned int lpn_gpio;
  49. int irq_type;
  50. };
  51. struct pm2xxx_platform_data {
  52. struct pm2xxx_charger_platform_data *wall_charger;
  53. struct pm2xxx_bm_data *battery;
  54. };
  55. #endif /* __LINUX_PM2301_H */