slatecom_interface.h 3.4 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167
  1. /* SPDX-License-Identifier: GPL-2.0-only */
  2. /*
  3. * Copyright (c) 2017-2021, The Linux Foundation. All rights reserved.
  4. * Copyright (c) 2022-2023, Qualcomm Innovation Center, Inc. All rights reserved.
  5. */
  6. #ifndef SLATECOM_INTERFACE_H
  7. #define SLATECOM_INTERFACE_H
  8. /*
  9. * slate_soft_reset() - soft reset Slate
  10. * Return 0 on success or -Ve on error
  11. */
  12. int slate_soft_reset(void);
  13. /*
  14. * is_twm_exit()
  15. * Return true if device is booting up on TWM exit.
  16. * value is auto cleared once read.
  17. */
  18. bool is_twm_exit(void);
  19. /*
  20. * is_slate_running()
  21. * Return true if slate is running.
  22. * value is auto cleared once read.
  23. */
  24. bool is_slate_running(void);
  25. /*
  26. * set_slate_dsp_state()
  27. * Set slate dsp state
  28. */
  29. void set_slate_dsp_state(bool status);
  30. /*
  31. * set_slate_bt_state()
  32. * Set slate bt state
  33. */
  34. void set_slate_bt_state(bool status);
  35. struct subsys_state_ops {
  36. void (*set_dsp_state)(bool status);
  37. void (*set_bt_state)(bool status);
  38. };
  39. void slatecom_state_init(void (*fn1)(bool), void (*fn2)(bool));
  40. /*
  41. * Message header type - generic header structure
  42. */
  43. struct msg_header_t {
  44. uint32_t opcode;
  45. uint32_t payload_size;
  46. };
  47. /**
  48. * Opcodes to be received on slate-control channel.
  49. */
  50. enum WMSlateCtrlChnlOpcode {
  51. /*
  52. * Command to slate to enter TWM mode
  53. */
  54. GMI_MGR_ENTER_TWM = 1,
  55. /*
  56. * Notification to slate about Modem Processor Sub System
  57. * is down due to a subsystem reset.
  58. */
  59. GMI_MGR_SSR_MPSS_DOWN_NOTIFICATION = 2,
  60. /*
  61. * Notification to slate about Modem Processor Sub System
  62. * being brought up after a subsystem reset.
  63. */
  64. GMI_MGR_SSR_MPSS_UP_NOTIFICATION = 3,
  65. /*
  66. * Notification to slate about ADSP Sub System
  67. * is down due to a subsystem reset.
  68. */
  69. GMI_MGR_SSR_ADSP_DOWN_INDICATION = 8,
  70. /*
  71. * Notification to slate about Modem Processor
  72. * Sub System being brought up after a subsystem reset.
  73. */
  74. GMI_MGR_SSR_ADSP_UP_INDICATION = 9,
  75. /*
  76. * Notification to MSM for generic wakeup in tracker mode
  77. */
  78. GMI_MGR_WAKE_UP_NO_REASON = 10,
  79. /*
  80. * Notification to Slate About Entry to Tracker-DS
  81. */
  82. GMI_MGR_ENTER_TRACKER_DS = 11,
  83. /*
  84. * Notification to Slate About Entry to Tracker-DS
  85. */
  86. GMI_MGR_EXIT_TRACKER_DS = 12,
  87. /*
  88. * Notification to Slate About Time-sync update
  89. */
  90. GMI_MGR_TIME_SYNC_UPDATE = 13, /* payload struct: time_sync_t*/
  91. /*
  92. * Notification to Slate About Timeval UTC
  93. */
  94. GMI_MGR_TIMEVAL_UTC = 14, /* payload struct: timeval_utc_t*/
  95. /*
  96. * Notification to Slate About Daylight saving time
  97. */
  98. GMI_MGR_DST = 15, /* payload struct: dst_t*/
  99. /*
  100. * Notification to slate about WLAN boot init
  101. */
  102. GMI_MGR_WLAN_BOOT_INIT = 16,
  103. /*
  104. * Notification to slate about boot complete
  105. */
  106. GMI_MGR_WLAN_BOOT_COMPLETE = 17,
  107. GMI_WLAN_5G_CONNECT = 18,
  108. GMI_WLAN_5G_DISCONNECT = 19,
  109. /*
  110. * DEBUG Opcodes
  111. */
  112. GMI_MGR_ENABLE_QCLI = 91, /* Enable QCLI */
  113. GMI_MGR_DISABLE_QCLI = 92, /* Disable QCLI */
  114. GMI_MGR_ENABLE_PMIC_RTC = 93, /* Enable PMIC RTC */
  115. GMI_MGR_DISABLE_PMIC_RTC = 94, /* Disable PMIC RTC */
  116. };
  117. /*
  118. * Notification to slate about WLAN state
  119. */
  120. #if IS_ENABLED(CONFIG_MSM_SLATECOM_INTERFACE)
  121. int send_wlan_state(enum WMSlateCtrlChnlOpcode type);
  122. #else
  123. static inline int send_wlan_state(enum WMSlateCtrlChnlOpcode type)
  124. {
  125. return 0;
  126. }
  127. #endif
  128. #ifdef CONFIG_COMPAT
  129. long compat_slate_com_ioctl(struct file *file, unsigned int cmd, unsigned long arg);
  130. #else
  131. #define compat_slate_com_ioctl NULL
  132. #endif
  133. #endif /* SLATECOM_INTERFACE_H */