gunyah.h 614 B

123456789101112131415161718192021222324
  1. /* SPDX-License-Identifier: GPL-2.0-only */
  2. /*
  3. * Copyright (c) 2022-2023 Qualcomm Innovation Center, Inc. All rights reserved.
  4. */
  5. #ifndef _ASM_GUNYAH_H
  6. #define _ASM_GUNYAH_H
  7. #include <linux/irq.h>
  8. #include <dt-bindings/interrupt-controller/arm-gic.h>
  9. static inline int arch_gh_fill_irq_fwspec_params(u32 virq, struct irq_fwspec *fwspec)
  10. {
  11. /* Assume that Gunyah gave us an SPI; defensively check it */
  12. if (WARN_ON(virq < 32 || virq > 1019))
  13. return -EINVAL;
  14. fwspec->param_count = 3;
  15. fwspec->param[0] = GIC_SPI;
  16. fwspec->param[1] = virq - 32;
  17. fwspec->param[2] = IRQ_TYPE_EDGE_RISING;
  18. return 0;
  19. }
  20. #endif