wcd_spi_ctl_v01.c 3.3 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129
  1. // SPDX-License-Identifier: GPL-2.0-only
  2. /* Copyright (c) 2018-2019, The Linux Foundation. All rights reserved.
  3. */
  4. #include <linux/qmi_encdec.h>
  5. #include <soc/qcom/msm_qmi_interface.h>
  6. #include "wcd_spi_ctl_v01.h"
  7. struct elem_info wcd_spi_req_access_msg_v01_ei[] = {
  8. {
  9. .data_type = QMI_OPT_FLAG,
  10. .elem_len = 1,
  11. .elem_size = sizeof(u8),
  12. .is_array = NO_ARRAY,
  13. .tlv_type = 0x10,
  14. .offset = offsetof(struct wcd_spi_req_access_msg_v01,
  15. reason_valid),
  16. },
  17. {
  18. .data_type = QMI_UNSIGNED_8_BYTE,
  19. .elem_len = 1,
  20. .elem_size = sizeof(u64),
  21. .is_array = NO_ARRAY,
  22. .tlv_type = 0x10,
  23. .offset = offsetof(struct wcd_spi_req_access_msg_v01,
  24. reason),
  25. },
  26. {
  27. .data_type = QMI_EOTI,
  28. .is_array = NO_ARRAY,
  29. .tlv_type = QMI_COMMON_TLV_TYPE,
  30. },
  31. };
  32. struct elem_info wcd_spi_req_access_resp_v01_ei[] = {
  33. {
  34. .data_type = QMI_STRUCT,
  35. .elem_len = 1,
  36. .elem_size = sizeof(struct qmi_response_type_v01),
  37. .is_array = NO_ARRAY,
  38. .tlv_type = 0x02,
  39. .offset = offsetof(struct wcd_spi_req_access_resp_v01,
  40. resp),
  41. .ei_array = get_qmi_response_type_v01_ei(),
  42. },
  43. {
  44. .data_type = QMI_EOTI,
  45. .is_array = NO_ARRAY,
  46. .tlv_type = QMI_COMMON_TLV_TYPE,
  47. },
  48. };
  49. struct elem_info wcd_spi_rel_access_msg_v01_ei[] = {
  50. {
  51. .data_type = QMI_EOTI,
  52. .is_array = NO_ARRAY,
  53. .tlv_type = QMI_COMMON_TLV_TYPE,
  54. },
  55. };
  56. struct elem_info wcd_spi_rel_access_resp_v01_ei[] = {
  57. {
  58. .data_type = QMI_STRUCT,
  59. .elem_len = 1,
  60. .elem_size = sizeof(struct qmi_response_type_v01),
  61. .is_array = NO_ARRAY,
  62. .tlv_type = 0x02,
  63. .offset = offsetof(struct wcd_spi_rel_access_resp_v01,
  64. resp),
  65. .ei_array = get_qmi_response_type_v01_ei(),
  66. },
  67. {
  68. .data_type = QMI_EOTI,
  69. .is_array = NO_ARRAY,
  70. .tlv_type = QMI_COMMON_TLV_TYPE,
  71. },
  72. };
  73. struct elem_info wcd_spi_buff_msg_v01_ei[] = {
  74. {
  75. .data_type = QMI_UNSIGNED_4_BYTE,
  76. .elem_len = WCD_SPI_BUFF_CHANNELS_MAX_V01,
  77. .elem_size = sizeof(u32),
  78. .is_array = STATIC_ARRAY,
  79. .tlv_type = 0x01,
  80. .offset = offsetof(struct wcd_spi_buff_msg_v01,
  81. buff_addr_1),
  82. },
  83. {
  84. .data_type = QMI_OPT_FLAG,
  85. .elem_len = 1,
  86. .elem_size = sizeof(u8),
  87. .is_array = NO_ARRAY,
  88. .tlv_type = 0x10,
  89. .offset = offsetof(struct wcd_spi_buff_msg_v01,
  90. buff_addr_2_valid),
  91. },
  92. {
  93. .data_type = QMI_UNSIGNED_4_BYTE,
  94. .elem_len = WCD_SPI_BUFF_CHANNELS_MAX_V01,
  95. .elem_size = sizeof(u32),
  96. .is_array = STATIC_ARRAY,
  97. .tlv_type = 0x10,
  98. .offset = offsetof(struct wcd_spi_buff_msg_v01,
  99. buff_addr_2),
  100. },
  101. {
  102. .data_type = QMI_EOTI,
  103. .is_array = NO_ARRAY,
  104. .tlv_type = QMI_COMMON_TLV_TYPE,
  105. },
  106. };
  107. struct elem_info wcd_spi_buff_resp_v01_ei[] = {
  108. {
  109. .data_type = QMI_STRUCT,
  110. .elem_len = 1,
  111. .elem_size = sizeof(struct qmi_response_type_v01),
  112. .is_array = NO_ARRAY,
  113. .tlv_type = 0x02,
  114. .offset = offsetof(struct wcd_spi_buff_resp_v01,
  115. resp),
  116. .ei_array = get_qmi_response_type_v01_ei(),
  117. },
  118. {
  119. .data_type = QMI_EOTI,
  120. .is_array = NO_ARRAY,
  121. .tlv_type = QMI_COMMON_TLV_TYPE,
  122. },
  123. };