battery_charger.h 1.0 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445
  1. /* SPDX-License-Identifier: GPL-2.0-only */
  2. /*
  3. * Copyright (c) 2020, The Linux Foundation. All rights reserved.
  4. * Copyright (c) 2022, Qualcomm Innovation Center, Inc. All rights reserved.
  5. */
  6. #ifndef _BATTERY_CHARGER_H
  7. #define _BATTERY_CHARGER_H
  8. #include <linux/notifier.h>
  9. enum battery_charger_prop {
  10. BATTERY_RESISTANCE,
  11. BATTERY_CHARGER_PROP_MAX,
  12. };
  13. enum bc_hboost_event {
  14. VMAX_CLAMP,
  15. };
  16. #if IS_ENABLED(CONFIG_QTI_BATTERY_CHARGER)
  17. int qti_battery_charger_get_prop(const char *name,
  18. enum battery_charger_prop prop_id, int *val);
  19. int register_hboost_event_notifier(struct notifier_block *nb);
  20. int unregister_hboost_event_notifier(struct notifier_block *nb);
  21. #else
  22. static inline int
  23. qti_battery_charger_get_prop(const char *name,
  24. enum battery_charger_prop prop_id, int *val)
  25. {
  26. return -EINVAL;
  27. }
  28. static inline int register_hboost_event_notifier(struct notifier_block *nb)
  29. {
  30. return -EOPNOTSUPP;
  31. }
  32. static inline int unregister_hboost_event_notifier(struct notifier_block *nb)
  33. {
  34. return -EOPNOTSUPP;
  35. }
  36. #endif
  37. #endif