ipa_interrupt.h 3.0 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108
  1. /* SPDX-License-Identifier: GPL-2.0 */
  2. /* Copyright (c) 2012-2018, The Linux Foundation. All rights reserved.
  3. * Copyright (C) 2018-2024 Linaro Ltd.
  4. */
  5. #ifndef _IPA_INTERRUPT_H_
  6. #define _IPA_INTERRUPT_H_
  7. #include <linux/types.h>
  8. struct platform_device;
  9. struct ipa;
  10. struct ipa_interrupt;
  11. enum ipa_irq_id;
  12. /**
  13. * ipa_interrupt_suspend_enable - Enable TX_SUSPEND for an endpoint
  14. * @interrupt: IPA interrupt structure
  15. * @endpoint_id: Endpoint whose interrupt should be enabled
  16. *
  17. * Note: The "TX" in the name is from the perspective of the IPA hardware.
  18. * A TX_SUSPEND interrupt arrives on an AP RX enpoint when packet data can't
  19. * be delivered to the endpoint because it is suspended (or its underlying
  20. * channel is stopped).
  21. */
  22. void ipa_interrupt_suspend_enable(struct ipa_interrupt *interrupt,
  23. u32 endpoint_id);
  24. /**
  25. * ipa_interrupt_suspend_disable - Disable TX_SUSPEND for an endpoint
  26. * @interrupt: IPA interrupt structure
  27. * @endpoint_id: Endpoint whose interrupt should be disabled
  28. */
  29. void ipa_interrupt_suspend_disable(struct ipa_interrupt *interrupt,
  30. u32 endpoint_id);
  31. /**
  32. * ipa_interrupt_simulate_suspend() - Simulate TX_SUSPEND IPA interrupt
  33. * @interrupt: IPA interrupt structure
  34. *
  35. * This calls the TX_SUSPEND interrupt handler, as if such an interrupt
  36. * had been signaled. This is needed to work around a hardware quirk
  37. * that occurs if aggregation is active on an endpoint when its underlying
  38. * channel is suspended.
  39. */
  40. void ipa_interrupt_simulate_suspend(struct ipa_interrupt *interrupt);
  41. /**
  42. * ipa_interrupt_enable() - Enable an IPA interrupt type
  43. * @ipa: IPA pointer
  44. * @ipa_irq: IPA interrupt ID
  45. */
  46. void ipa_interrupt_enable(struct ipa *ipa, enum ipa_irq_id ipa_irq);
  47. /**
  48. * ipa_interrupt_disable() - Disable an IPA interrupt type
  49. * @ipa: IPA pointer
  50. * @ipa_irq: IPA interrupt ID
  51. */
  52. void ipa_interrupt_disable(struct ipa *ipa, enum ipa_irq_id ipa_irq);
  53. /**
  54. * ipa_interrupt_irq_enable() - Enable IPA interrupts
  55. * @ipa: IPA pointer
  56. *
  57. * This enables the IPA interrupt line
  58. */
  59. void ipa_interrupt_irq_enable(struct ipa *ipa);
  60. /**
  61. * ipa_interrupt_irq_disable() - Disable IPA interrupts
  62. * @ipa: IPA pointer
  63. *
  64. * This disables the IPA interrupt line
  65. */
  66. void ipa_interrupt_irq_disable(struct ipa *ipa);
  67. /**
  68. * ipa_interrupt_config() - Configure IPA interrupts
  69. * @ipa: IPA pointer
  70. *
  71. * Return: 0 if successful, or a negative error code
  72. */
  73. int ipa_interrupt_config(struct ipa *ipa);
  74. /**
  75. * ipa_interrupt_deconfig() - Inverse of ipa_interrupt_config()
  76. * @ipa: IPA pointer
  77. */
  78. void ipa_interrupt_deconfig(struct ipa *ipa);
  79. /**
  80. * ipa_interrupt_init() - Initialize the IPA interrupt structure
  81. * @pdev: IPA platform device pointer
  82. *
  83. * Return: Pointer to an IPA interrupt structure, or a pointer-coded error
  84. */
  85. struct ipa_interrupt *ipa_interrupt_init(struct platform_device *pdev);
  86. /**
  87. * ipa_interrupt_exit() - Inverse of ipa_interrupt_init()
  88. * @interrupt: IPA interrupt structure
  89. */
  90. void ipa_interrupt_exit(struct ipa_interrupt *interrupt);
  91. #endif /* _IPA_INTERRUPT_H_ */