thermal_mitigation_device_service_v01.h 4.9 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128
  1. /* Copyright (c) 2017, The Linux Foundation. All rights reserved.
  2. *
  3. * This program is free software; you can redistribute it and/or modify
  4. * it under the terms of the GNU General Public License version 2 and
  5. * only version 2 as published by the Free Software Foundation.
  6. *
  7. * This program is distributed in the hope that it will be useful,
  8. * but WITHOUT ANY WARRANTY; without even the implied warranty of
  9. * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
  10. * GNU General Public License for more details.
  11. *
  12. */
  13. #ifndef THERMAL_MITIGATION_DEVICE_SERVICE_V01_H
  14. #define THERMAL_MITIGATION_DEVICE_SERVICE_V01_H
  15. #define TMD_SERVICE_ID_V01 0x18
  16. #define TMD_SERVICE_VERS_V01 0x01
  17. #define QMI_TMD_GET_MITIGATION_DEVICE_LIST_RESP_V01 0x0020
  18. #define QMI_TMD_GET_MITIGATION_LEVEL_REQ_V01 0x0022
  19. #define QMI_TMD_GET_SUPPORTED_MSGS_REQ_V01 0x001E
  20. #define QMI_TMD_SET_MITIGATION_LEVEL_REQ_V01 0x0021
  21. #define QMI_TMD_REGISTER_NOTIFICATION_MITIGATION_LEVEL_RESP_V01 0x0023
  22. #define QMI_TMD_GET_SUPPORTED_MSGS_RESP_V01 0x001E
  23. #define QMI_TMD_SET_MITIGATION_LEVEL_RESP_V01 0x0021
  24. #define QMI_TMD_DEREGISTER_NOTIFICATION_MITIGATION_LEVEL_RESP_V01 0x0024
  25. #define QMI_TMD_MITIGATION_LEVEL_REPORT_IND_V01 0x0025
  26. #define QMI_TMD_GET_MITIGATION_LEVEL_RESP_V01 0x0022
  27. #define QMI_TMD_GET_SUPPORTED_FIELDS_REQ_V01 0x001F
  28. #define QMI_TMD_GET_MITIGATION_DEVICE_LIST_REQ_V01 0x0020
  29. #define QMI_TMD_REGISTER_NOTIFICATION_MITIGATION_LEVEL_REQ_V01 0x0023
  30. #define QMI_TMD_DEREGISTER_NOTIFICATION_MITIGATION_LEVEL_REQ_V01 0x0024
  31. #define QMI_TMD_GET_SUPPORTED_FIELDS_RESP_V01 0x001F
  32. #define QMI_TMD_MITIGATION_DEV_ID_LENGTH_MAX_V01 32
  33. #define QMI_TMD_MITIGATION_DEV_LIST_MAX_V01 32
  34. struct tmd_mitigation_dev_id_type_v01 {
  35. char mitigation_dev_id[QMI_TMD_MITIGATION_DEV_ID_LENGTH_MAX_V01 + 1];
  36. };
  37. struct tmd_mitigation_dev_list_type_v01 {
  38. struct tmd_mitigation_dev_id_type_v01 mitigation_dev_id;
  39. uint8_t max_mitigation_level;
  40. };
  41. struct tmd_get_mitigation_device_list_req_msg_v01 {
  42. char placeholder;
  43. };
  44. #define TMD_GET_MITIGATION_DEVICE_LIST_REQ_MSG_V01_MAX_MSG_LEN 0
  45. extern struct elem_info tmd_get_mitigation_device_list_req_msg_v01_ei[];
  46. struct tmd_get_mitigation_device_list_resp_msg_v01 {
  47. struct qmi_response_type_v01 resp;
  48. uint8_t mitigation_device_list_valid;
  49. uint32_t mitigation_device_list_len;
  50. struct tmd_mitigation_dev_list_type_v01
  51. mitigation_device_list[QMI_TMD_MITIGATION_DEV_LIST_MAX_V01];
  52. };
  53. #define TMD_GET_MITIGATION_DEVICE_LIST_RESP_MSG_V01_MAX_MSG_LEN 1099
  54. extern struct elem_info tmd_get_mitigation_device_list_resp_msg_v01_ei[];
  55. struct tmd_set_mitigation_level_req_msg_v01 {
  56. struct tmd_mitigation_dev_id_type_v01 mitigation_dev_id;
  57. uint8_t mitigation_level;
  58. };
  59. #define TMD_SET_MITIGATION_LEVEL_REQ_MSG_V01_MAX_MSG_LEN 40
  60. extern struct elem_info tmd_set_mitigation_level_req_msg_v01_ei[];
  61. struct tmd_set_mitigation_level_resp_msg_v01 {
  62. struct qmi_response_type_v01 resp;
  63. };
  64. #define TMD_SET_MITIGATION_LEVEL_RESP_MSG_V01_MAX_MSG_LEN 7
  65. extern struct elem_info tmd_set_mitigation_level_resp_msg_v01_ei[];
  66. struct tmd_get_mitigation_level_req_msg_v01 {
  67. struct tmd_mitigation_dev_id_type_v01 mitigation_device;
  68. };
  69. #define TMD_GET_MITIGATION_LEVEL_REQ_MSG_V01_MAX_MSG_LEN 36
  70. extern struct elem_info tmd_get_mitigation_level_req_msg_v01_ei[];
  71. struct tmd_get_mitigation_level_resp_msg_v01 {
  72. struct qmi_response_type_v01 resp;
  73. uint8_t current_mitigation_level_valid;
  74. uint8_t current_mitigation_level;
  75. uint8_t requested_mitigation_level_valid;
  76. uint8_t requested_mitigation_level;
  77. };
  78. #define TMD_GET_MITIGATION_LEVEL_RESP_MSG_V01_MAX_MSG_LEN 15
  79. extern struct elem_info tmd_get_mitigation_level_resp_msg_v01_ei[];
  80. struct tmd_register_notification_mitigation_level_req_msg_v01 {
  81. struct tmd_mitigation_dev_id_type_v01 mitigation_device;
  82. };
  83. #define TMD_REGISTER_NOTIFICATION_MITIGATION_LEVEL_REQ_MSG_V01_MAX_MSG_LEN 36
  84. extern struct elem_info
  85. tmd_register_notification_mitigation_level_req_msg_v01_ei[];
  86. struct tmd_register_notification_mitigation_level_resp_msg_v01 {
  87. struct qmi_response_type_v01 resp;
  88. };
  89. #define TMD_REGISTER_NOTIFICATION_MITIGATION_LEVEL_RESP_MSG_V01_MAX_MSG_LEN 7
  90. extern struct elem_info
  91. tmd_register_notification_mitigation_level_resp_msg_v01_ei[];
  92. struct tmd_deregister_notification_mitigation_level_req_msg_v01 {
  93. struct tmd_mitigation_dev_id_type_v01 mitigation_device;
  94. };
  95. #define TMD_DEREGISTER_NOTIFICATION_MITIGATION_LEVEL_REQ_MSG_V01_MAX_MSG_LEN 36
  96. extern struct elem_info
  97. tmd_deregister_notification_mitigation_level_req_msg_v01_ei[];
  98. struct tmd_deregister_notification_mitigation_level_resp_msg_v01 {
  99. struct qmi_response_type_v01 resp;
  100. };
  101. #define TMD_DEREGISTER_NOTIFICATION_MITIGATION_LEVEL_RESP_MSG_V01_MAX_MSG_LEN 7
  102. extern struct elem_info
  103. tmd_deregister_notification_mitigation_level_resp_msg_v01_ei[];
  104. struct tmd_mitigation_level_report_ind_msg_v01 {
  105. struct tmd_mitigation_dev_id_type_v01 mitigation_device;
  106. uint8_t current_mitigation_level;
  107. };
  108. #define TMD_MITIGATION_LEVEL_REPORT_IND_MSG_V01_MAX_MSG_LEN 40
  109. extern struct elem_info tmd_mitigation_level_report_ind_msg_v01_ei[];
  110. #endif