lp8727.h 1.6 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768
  1. /*
  2. * LP8727 Micro/Mini USB IC with integrated charger
  3. *
  4. * Copyright (C) 2011 Texas Instruments
  5. * Copyright (C) 2011 National Semiconductor
  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 version 2 as
  9. * published by the Free Software Foundation.
  10. */
  11. #ifndef _LP8727_H
  12. #define _LP8727_H
  13. enum lp8727_eoc_level {
  14. LP8727_EOC_5P,
  15. LP8727_EOC_10P,
  16. LP8727_EOC_16P,
  17. LP8727_EOC_20P,
  18. LP8727_EOC_25P,
  19. LP8727_EOC_33P,
  20. LP8727_EOC_50P,
  21. };
  22. enum lp8727_ichg {
  23. LP8727_ICHG_90mA,
  24. LP8727_ICHG_100mA,
  25. LP8727_ICHG_400mA,
  26. LP8727_ICHG_450mA,
  27. LP8727_ICHG_500mA,
  28. LP8727_ICHG_600mA,
  29. LP8727_ICHG_700mA,
  30. LP8727_ICHG_800mA,
  31. LP8727_ICHG_900mA,
  32. LP8727_ICHG_1000mA,
  33. };
  34. /**
  35. * struct lp8727_chg_param
  36. * @eoc_level : end of charge level setting
  37. * @ichg : charging current
  38. */
  39. struct lp8727_chg_param {
  40. enum lp8727_eoc_level eoc_level;
  41. enum lp8727_ichg ichg;
  42. };
  43. /**
  44. * struct lp8727_platform_data
  45. * @get_batt_present : check battery status - exists or not
  46. * @get_batt_level : get battery voltage (mV)
  47. * @get_batt_capacity : get battery capacity (%)
  48. * @get_batt_temp : get battery temperature
  49. * @ac : charging parameters for AC type charger
  50. * @usb : charging parameters for USB type charger
  51. * @debounce_msec : interrupt debounce time
  52. */
  53. struct lp8727_platform_data {
  54. u8 (*get_batt_present)(void);
  55. u16 (*get_batt_level)(void);
  56. u8 (*get_batt_capacity)(void);
  57. u8 (*get_batt_temp)(void);
  58. struct lp8727_chg_param *ac;
  59. struct lp8727_chg_param *usb;
  60. unsigned int debounce_msec;
  61. };
  62. #endif