fsa4480-i2c.h 1.1 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748
  1. /* SPDX-License-Identifier: GPL-2.0-only */
  2. /*
  3. * Copyright (c) 2018-2021, The Linux Foundation. All rights reserved.
  4. * Copyright (c) 2023 Qualcomm Innovation Center, Inc. All rights reserved.
  5. */
  6. #ifndef FSA4480_I2C_H
  7. #define FSA4480_I2C_H
  8. #include <linux/of.h>
  9. #include <linux/notifier.h>
  10. enum fsa_function {
  11. FSA_MIC_GND_SWAP,
  12. FSA_USBC_ORIENTATION_CC1,
  13. FSA_USBC_ORIENTATION_CC2,
  14. FSA_USBC_DISPLAYPORT_DISCONNECTED,
  15. FSA_EVENT_MAX,
  16. };
  17. #if IS_ENABLED(CONFIG_QCOM_FSA4480_I2C)
  18. int fsa4480_switch_event(struct device_node *node,
  19. enum fsa_function event);
  20. int fsa4480_reg_notifier(struct notifier_block *nb,
  21. struct device_node *node);
  22. int fsa4480_unreg_notifier(struct notifier_block *nb,
  23. struct device_node *node);
  24. #else
  25. static inline int fsa4480_switch_event(struct device_node *node,
  26. enum fsa_function event)
  27. {
  28. return 0;
  29. }
  30. static inline int fsa4480_reg_notifier(struct notifier_block *nb,
  31. struct device_node *node)
  32. {
  33. return 0;
  34. }
  35. static inline int fsa4480_unreg_notifier(struct notifier_block *nb,
  36. struct device_node *node)
  37. {
  38. return 0;
  39. }
  40. #endif /* CONFIG_QCOM_FSA4480_I2C */
  41. #endif /* FSA4480_I2C_H */