sec_battery_ttf.h 1.9 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364
  1. /*
  2. * sec_battery.h
  3. * Samsung Mobile Battery Header
  4. *
  5. *
  6. * Copyright (C) 2012 Samsung Electronics, Inc.
  7. *
  8. *
  9. * This software is licensed under the terms of the GNU General Public
  10. * License version 2, as published by the Free Software Foundation, and
  11. * may be copied, distributed, and modified under those terms.
  12. *
  13. * This program is distributed in the hope that it will be useful,
  14. * but WITHOUT ANY WARRANTY; without even the implied warranty of
  15. * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
  16. * GNU General Public License for more details.
  17. *
  18. */
  19. #ifndef __SEC_BATTERY_TTF_H
  20. #define __SEC_BATTERY_TTF_H __FILE__
  21. struct sec_cv_slope {
  22. int fg_current;
  23. int soc;
  24. int time;
  25. };
  26. struct sec_battery_info;
  27. struct sec_ttf_data {
  28. void *pdev;
  29. int timetofull;
  30. int old_timetofull;
  31. unsigned int ttf_hv_12v_charge_current;
  32. unsigned int ttf_hv_charge_current;
  33. unsigned int ttf_hv_wireless_charge_current;
  34. unsigned int ttf_wireless_charge_current;
  35. unsigned int ttf_dc25_charge_current;
  36. unsigned int ttf_dc45_charge_current;
  37. unsigned int ttf_wc20_wireless_charge_current;
  38. unsigned int ttf_wc21_wireless_charge_current;
  39. unsigned int ttf_fpdo_dc_charge_current;
  40. struct sec_cv_slope *cv_data;
  41. int cv_data_length;
  42. unsigned int ttf_capacity;
  43. struct delayed_work timetofull_work;
  44. };
  45. int sec_calc_ttf(struct sec_battery_info * battery, unsigned int ttf_curr);
  46. extern void sec_bat_calc_time_to_full(struct sec_battery_info * battery);
  47. int sec_get_ttf_standard_curr(struct sec_battery_info *battery);
  48. extern void sec_bat_time_to_full_work(struct work_struct *work);
  49. extern void ttf_init(struct sec_battery_info *battery);
  50. extern void ttf_work_start(struct sec_battery_info *battery);
  51. extern int ttf_display(unsigned int capacity, int bat_sts, int thermal_zone, int time);
  52. #ifdef CONFIG_OF
  53. int sec_ttf_parse_dt(struct sec_battery_info *battery);
  54. #endif
  55. #endif /* __SEC_BATTERY_H */