wcd-irq.h 1.5 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556
  1. /* SPDX-License-Identifier: GPL-2.0 */
  2. /*
  3. * Copyright (c) 2018, The Linux Foundation. All rights reserved.
  4. */
  5. #ifndef __WCD_IRQ_H_
  6. #define __WCD_IRQ_H_
  7. #include <linux/types.h>
  8. #include <linux/interrupt.h>
  9. #include <linux/regmap.h>
  10. struct wcd_irq_info {
  11. struct regmap_irq_chip *wcd_regmap_irq_chip;
  12. char *codec_name;
  13. struct regmap *regmap;
  14. struct regmap_irq_chip_data *irq_chip;
  15. struct device *dev;
  16. };
  17. #if IS_ENABLED(CONFIG_WCD9XXX_CODEC_CORE)
  18. int wcd_irq_init(struct wcd_irq_info *irq_info, struct irq_domain **virq);
  19. int wcd_irq_exit(struct wcd_irq_info *irq_info, struct irq_domain *virq);
  20. int wcd_request_irq(struct wcd_irq_info *irq_info, int irq, const char *name,
  21. irq_handler_t handler, void *data);
  22. void wcd_free_irq(struct wcd_irq_info *irq_info, int irq, void *data);
  23. void wcd_enable_irq(struct wcd_irq_info *irq_info, int irq);
  24. void wcd_disable_irq(struct wcd_irq_info *irq_info, int irq);
  25. #else
  26. static inline int wcd_irq_init(struct wcd_irq_info *irq_info,
  27. struct irq_domain **virq)
  28. {
  29. return 0;
  30. };
  31. static inline int wcd_irq_exit(struct wcd_irq_info *irq_info,
  32. struct irq_domain *virq)
  33. {
  34. return 0;
  35. };
  36. static inline int wcd_request_irq(struct wcd_irq_info *irq,
  37. int irq, const char *name,
  38. irq_handler_t handler, void *data)
  39. {
  40. return 0;
  41. };
  42. static inline void wcd_free_irq(struct wcd_irq_info *irq, int irq, void *data);
  43. {
  44. };
  45. static inline void wcd_enable_irq(struct wcd_irq_info *irq, int irq);
  46. {
  47. };
  48. static inline void wcd_disable_irq(struct wcd_irq_info *irq, int irq);
  49. {
  50. };
  51. #endif
  52. #endif /* __WCD_IRQ_H_ */