gh_irq_lend.h 2.6 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105
  1. /* SPDX-License-Identifier: GPL-2.0-only */
  2. /*
  3. * Copyright (c) 2020-2021, The Linux Foundation. All rights reserved.
  4. * Copyright (c) 2023 Qualcomm Innovation Center, Inc. All rights reserved.
  5. */
  6. #ifndef __GH_IRQ_LEND_H
  7. #define __GH_IRQ_LEND_H
  8. #include <linux/types.h>
  9. #include "gh_common.h"
  10. #include "gh_rm_drv.h"
  11. enum gh_irq_label {
  12. GH_IRQ_LABEL_SDE,
  13. GH_IRQ_LABEL_TRUSTED_TOUCH_PRIMARY,
  14. GH_IRQ_LABEL_TRUSTED_TOUCH_SECONDARY,
  15. GH_IRQ_LABEL_TEST_TUIVM,
  16. GH_IRQ_LABEL_TEST_OEMVM,
  17. GH_IRQ_LABEL_EVA,
  18. GH_IRQ_LABEL_CAM_BASE,
  19. GH_IRQ_LABEL_CAM_MAX = GH_IRQ_LABEL_CAM_BASE + 49,
  20. GH_IRQ_LABEL_MAX
  21. };
  22. typedef void (*gh_irq_handle_fn)(void *req, enum gh_irq_label label);
  23. typedef void (*gh_irq_handle_fn_v2)(void *req, unsigned long notif_type,
  24. enum gh_irq_label label);
  25. #if IS_ENABLED(CONFIG_GH_IRQ_LEND)
  26. int gh_irq_lend(enum gh_irq_label label, enum gh_vm_names name,
  27. int hw_irq, gh_irq_handle_fn cb_handle, void *data);
  28. int gh_irq_lend_v2(enum gh_irq_label label, enum gh_vm_names name,
  29. int hw_irq, gh_irq_handle_fn_v2 cb_handle, void *data);
  30. int gh_irq_lend_notify(enum gh_irq_label label);
  31. int gh_irq_reclaim(enum gh_irq_label label);
  32. int gh_irq_wait_for_lend(enum gh_irq_label label, enum gh_vm_names name,
  33. gh_irq_handle_fn on_lend, void *data);
  34. int gh_irq_wait_for_lend_v2(enum gh_irq_label label, enum gh_vm_names name,
  35. gh_irq_handle_fn_v2 on_lend, void *data);
  36. int gh_irq_accept(enum gh_irq_label label, int irq, int type);
  37. int gh_irq_accept_notify(enum gh_irq_label label);
  38. int gh_irq_release(enum gh_irq_label label);
  39. int gh_irq_release_notify(enum gh_irq_label label);
  40. #else
  41. int gh_irq_lend(enum gh_irq_label label, enum gh_vm_names name,
  42. int hw_irq, gh_irq_handle_fn cb_handle, void *data)
  43. {
  44. return -EINVAL;
  45. }
  46. int gh_irq_lend_v2(enum gh_irq_label label, enum gh_vm_names name,
  47. int hw_irq, gh_irq_handle_fn_v2 cb_handle, void *data)
  48. {
  49. return -EINVAL;
  50. }
  51. int gh_irq_lend_notify(enum gh_irq_label label)
  52. {
  53. return -EINVAL;
  54. }
  55. int gh_irq_reclaim(enum gh_irq_label label)
  56. {
  57. return -EINVAL;
  58. }
  59. int gh_irq_wait_for_lend(enum gh_irq_label label, enum gh_vm_names name,
  60. gh_irq_handle_fn on_lend, void *data)
  61. {
  62. return -EINVAL;
  63. }
  64. int gh_irq_wait_for_lend_v2(enum gh_irq_label label, enum gh_vm_names name,
  65. gh_irq_handle_fn_v2 on_lend, void *data)
  66. {
  67. return -EINVAL;
  68. }
  69. int gh_irq_accept(enum gh_irq_label label, int irq, int type)
  70. {
  71. return -EINVAL;
  72. }
  73. int gh_irq_accept_notify(enum gh_irq_label label)
  74. {
  75. return -EINVAL;
  76. }
  77. int gh_irq_release(enum gh_irq_label label)
  78. {
  79. return -EINVAL;
  80. }
  81. int gh_irq_release_notify(enum gh_irq_label label)
  82. {
  83. return -EINVAL;
  84. }
  85. #endif
  86. #endif