qg-profile-lib.h 832 B

1234567891011121314151617181920212223242526272829
  1. /* SPDX-License-Identifier: GPL-2.0-only */
  2. /*
  3. * Copyright (c) 2018-2020 The Linux Foundation. All rights reserved.
  4. * Copyright (c) 2022-2023, Qualcomm Innovation Center, Inc. All rights reserved.
  5. */
  6. #ifndef __QG_PROFILE_LIB_H__
  7. #define __QG_PROFILE_LIB_H__
  8. struct profile_table_data {
  9. char *name;
  10. int rows;
  11. int cols;
  12. int *row_entries;
  13. int *col_entries;
  14. int **data;
  15. };
  16. int qg_linear_interpolate(int y0, int x0, int y1, int x1, int x);
  17. int qg_interpolate_single_row_lut(struct profile_table_data *lut,
  18. int x, int scale);
  19. int qg_interpolate_soc(struct profile_table_data *lut,
  20. int batt_temp, int ocv);
  21. int qg_interpolate_var(struct profile_table_data *lut,
  22. int batt_temp, int soc);
  23. int qg_interpolate_slope(struct profile_table_data *lut,
  24. int batt_temp, int soc);
  25. #endif /*__QG_PROFILE_LIB_H__ */