max17048_fuelgauge.h 1.5 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859
  1. /*
  2. * max17048_fuelgauge.h
  3. * Samsung MAX17048 Fuel Gauge Header
  4. *
  5. * Copyright (C) 2012 Samsung Electronics, Inc.
  6. *
  7. * This software is licensed under the terms of the GNU General Public
  8. * License version 2, as published by the Free Software Foundation, and
  9. * may be copied, distributed, and modified under those terms.
  10. *
  11. * This program is distributed in the hope that it will be useful,
  12. * but WITHOUT ANY WARRANTY; without even the implied warranty of
  13. * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
  14. * GNU General Public License for more details.
  15. *
  16. */
  17. #ifndef __MAX17048_FUELGAUGE_H
  18. #define __MAX17048_FUELGAUGE_H __FILE__
  19. /* Slave address should be shifted to the right 1bit.
  20. * R/W bit should NOT be included.
  21. */
  22. #define SEC_FUELGAUGE_I2C_SLAVEADDR (0x6D >> 1)
  23. #define MAX17048_VCELL_MSB 0x02
  24. #define MAX17048_VCELL_LSB 0x03
  25. #define MAX17048_SOC_MSB 0x04
  26. #define MAX17048_SOC_LSB 0x05
  27. #define MAX17048_MODE_MSB 0x06
  28. #define MAX17048_MODE_LSB 0x07
  29. #define MAX17048_VER_MSB 0x08
  30. #define MAX17048_VER_LSB 0x09
  31. #define MAX17048_RCOMP_MSB 0x0C
  32. #define MAX17048_RCOMP_LSB 0x0D
  33. #define MAX17048_OCV_MSB 0x0E
  34. #define MAX17048_OCV_LSB 0x0F
  35. #define MAX17048_CMD_MSB 0xFE
  36. #define MAX17048_CMD_LSB 0xFF
  37. #define RCOMP0_TEMP 20
  38. #define AVER_SAMPLE_CNT 5
  39. struct battery_data_t {
  40. u8 RCOMP0;
  41. u8 RCOMP_charging;
  42. int temp_cohot;
  43. int temp_cocold;
  44. bool is_using_model_data;
  45. u8 *type_str;
  46. };
  47. struct sec_fg_info {
  48. bool dummy;
  49. };
  50. #endif /* __MAX17048_FUELGAUGE_H */