step-chg-jeita.h 754 B

123456789101112131415161718192021222324252627282930313233
  1. /* SPDX-License-Identifier: GPL-2.0-only */
  2. /*
  3. * Copyright (c) 2017-2020 The Linux Foundation. All rights reserved.
  4. * Copyright (c) 2022-2023, Qualcomm Innovation Center, Inc. All rights reserved.
  5. */
  6. #ifndef __STEP_CHG_H__
  7. #define __STEP_CHG_H__
  8. #include <linux/iio/consumer.h>
  9. #include "smb5-iio.h"
  10. #define MAX_STEP_CHG_ENTRIES 8
  11. struct step_chg_jeita_param {
  12. u32 psy_prop;
  13. u32 iio_prop;
  14. char *prop_name;
  15. int rise_hys;
  16. int fall_hys;
  17. bool use_bms;
  18. };
  19. struct range_data {
  20. int low_threshold;
  21. int high_threshold;
  22. u32 value;
  23. };
  24. int qcom_step_chg_init(struct device *dev, bool step_chg_enable,
  25. bool sw_jeita_enable, bool jeita_arb_en, struct iio_channel *iio_chans);
  26. void qcom_step_chg_deinit(void);
  27. #endif /* __STEP_CHG_H__ */