aqt1000-irq.h 2.0 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273
  1. /* Copyright (c) 2018, The Linux Foundation. All rights reserved.
  2. *
  3. * This program is free software; you can redistribute it and/or modify
  4. * it under the terms of the GNU General Public License version 2 and
  5. * only version 2 as published by the Free Software Foundation.
  6. *
  7. * This program is distributed in the hope that it will be useful,
  8. * but WITHOUT ANY WARRANTY; without even the implied warranty of
  9. * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
  10. * GNU General Public License for more details.
  11. */
  12. #ifndef __AQT1000_IRQ_H_
  13. #define __AQT1000_IRQ_H_
  14. #include <linux/interrupt.h>
  15. #include <linux/regmap.h>
  16. enum {
  17. /* INTR_CTRL_INT_MASK_2 */
  18. AQT1000_IRQ_MBHC_BUTTON_RELEASE_DET = 0,
  19. AQT1000_IRQ_MBHC_BUTTON_PRESS_DET,
  20. AQT1000_IRQ_MBHC_ELECT_INS_REM_DET,
  21. AQT1000_IRQ_MBHC_ELECT_INS_REM_LEG_DET,
  22. AQT1000_IRQ_MBHC_SW_DET,
  23. AQT1000_IRQ_HPH_PA_OCPL_FAULT,
  24. AQT1000_IRQ_HPH_PA_OCPR_FAULT,
  25. AQT1000_IRQ_HPH_PA_CNPL_COMPLETE,
  26. /* INTR_CTRL_INT_MASK_3 */
  27. AQT1000_IRQ_HPH_PA_CNPR_COMPLETE,
  28. AQT1000_CDC_HPHL_SURGE,
  29. AQT1000_CDC_HPHR_SURGE,
  30. AQT1000_PLL_LOCK_LOSS,
  31. AQT1000_FLL_LOCK_LOSS,
  32. AQT1000_DSD_INT,
  33. AQT1000_NUM_IRQS,
  34. };
  35. /**
  36. * struct aqt_irq - AQT IRQ resource structure
  37. * @irq_lock: lock used by irq_chip functions.
  38. * @nested_irq_lock: lock used while handling nested interrupts.
  39. * @irq: interrupt number.
  40. * @irq_masks_cur: current mask value to be written to mask registers.
  41. * @irq_masks_cache: cached mask value.
  42. * @num_irqs: number of supported interrupts.
  43. * @num_irq_regs: number of irq registers.
  44. * @parent: parent pointer.
  45. * @dev: device pointer.
  46. * @domain: irq domain pointer.
  47. *
  48. * Contains required members used in wsa irq driver.
  49. */
  50. struct aqt1000_irq {
  51. struct mutex irq_lock;
  52. struct mutex nested_irq_lock;
  53. unsigned int irq;
  54. u8 irq_masks_cur;
  55. u8 irq_masks_cache;
  56. bool irq_level_high[8];
  57. int num_irqs;
  58. int num_irq_regs;
  59. void *parent;
  60. struct device *dev;
  61. struct irq_domain *domain;
  62. };
  63. int aqt_irq_init(void);
  64. void aqt_irq_exit(void);
  65. #endif /* __AQT1000_IRQ_H_ */