leds-qpnp-flash.h 1.0 KB

123456789101112131415161718192021222324252627282930313233343536373839404142
  1. /* SPDX-License-Identifier: GPL-2.0-only */
  2. /*
  3. * Copyright (c) 2016-2020, The Linux Foundation. All rights reserved.
  4. */
  5. #ifndef __LEDS_QPNP_FLASH_H
  6. #define __LEDS_QPNP_FLASH_H
  7. #include <linux/leds.h>
  8. #define ENABLE_REGULATOR BIT(0)
  9. #define DISABLE_REGULATOR BIT(1)
  10. #define QUERY_MAX_AVAIL_CURRENT BIT(2)
  11. #define QUERY_MAX_CURRENT BIT(3)
  12. #define FLASH_LED_PREPARE_OPTIONS_MASK GENMASK(3, 0)
  13. int qpnp_flash_register_led_prepare(struct device *dev, void *data);
  14. #if IS_ENABLED(CONFIG_LEDS_QPNP_FLASH_V2)
  15. int qpnp_flash_led_prepare(struct led_trigger *trig, int options,
  16. int *max_current);
  17. #else
  18. static inline int qpnp_flash_led_prepare(struct led_trigger *trig, int options,
  19. int *max_current)
  20. {
  21. return -ENODEV;
  22. }
  23. #endif
  24. #if IS_ENABLED(CONFIG_BACKLIGHT_QCOM_SPMI_WLED)
  25. int wled_flash_led_prepare(struct led_trigger *trig, int options,
  26. int *max_current);
  27. #else
  28. static inline int wled_flash_led_prepare(struct led_trigger *trig, int options,
  29. int *max_current)
  30. {
  31. return -EINVAL;
  32. }
  33. #endif
  34. #endif