Hemant Kumar | 0ef9fbb | 2016-01-28 11:41:42 -0800 | [diff] [blame] | 1 | /* Copyright (c) 2016, 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 USB_QMI_V01_H |
| 14 | #define USB_QMI_V01_H |
| 15 | |
Hemant Kumar | aa2fa3c | 2016-07-18 16:26:48 -0700 | [diff] [blame^] | 16 | #define UAUDIO_STREAM_SERVICE_ID_V01 0x41D |
Hemant Kumar | 0ef9fbb | 2016-01-28 11:41:42 -0800 | [diff] [blame] | 17 | #define UAUDIO_STREAM_SERVICE_VERS_V01 0x01 |
| 18 | |
| 19 | #define QMI_UAUDIO_STREAM_RESP_V01 0x0001 |
| 20 | #define QMI_UAUDIO_STREAM_REQ_V01 0x0001 |
| 21 | #define QMI_UADUIO_STREAM_IND_V01 0x0001 |
| 22 | |
| 23 | |
| 24 | struct mem_info_v01 { |
| 25 | uint64_t va; |
| 26 | uint64_t pa; |
| 27 | uint32_t size; |
| 28 | }; |
| 29 | |
| 30 | struct apps_mem_info_v01 { |
| 31 | struct mem_info_v01 evt_ring; |
| 32 | struct mem_info_v01 tr_data; |
| 33 | struct mem_info_v01 tr_sync; |
| 34 | struct mem_info_v01 xfer_buff; |
| 35 | struct mem_info_v01 dcba; |
| 36 | }; |
| 37 | |
| 38 | struct usb_endpoint_descriptor_v01 { |
| 39 | uint8_t bLength; |
| 40 | uint8_t bDescriptorType; |
| 41 | uint8_t bEndpointAddress; |
| 42 | uint8_t bmAttributes; |
| 43 | uint16_t wMaxPacketSize; |
| 44 | uint8_t bInterval; |
| 45 | uint8_t bRefresh; |
| 46 | uint8_t bSynchAddress; |
| 47 | }; |
| 48 | |
| 49 | struct usb_interface_descriptor_v01 { |
| 50 | uint8_t bLength; |
| 51 | uint8_t bDescriptorType; |
| 52 | uint8_t bInterfaceNumber; |
| 53 | uint8_t bAlternateSetting; |
| 54 | uint8_t bNumEndpoints; |
| 55 | uint8_t bInterfaceClass; |
| 56 | uint8_t bInterfaceSubClass; |
| 57 | uint8_t bInterfaceProtocol; |
| 58 | uint8_t iInterface; |
| 59 | }; |
| 60 | |
Hemant Kumar | aa2fa3c | 2016-07-18 16:26:48 -0700 | [diff] [blame^] | 61 | enum usb_audio_stream_status_enum_v01 { |
| 62 | USB_AUDIO_STREAM_STATUS_ENUM_MIN_VAL_V01 = INT_MIN, |
| 63 | USB_AUDIO_STREAM_REQ_SUCCESS_V01 = 0, |
| 64 | USB_AUDIO_STREAM_REQ_FAILURE_V01 = 1, |
| 65 | USB_AUDIO_STREAM_REQ_FAILURE_NOT_FOUND_V01 = 2, |
| 66 | USB_AUDIO_STREAM_REQ_FAILURE_INVALID_PARAM_V01 = 3, |
| 67 | USB_AUDIO_STREAM_REQ_FAILURE_MEMALLOC_V01 = 4, |
| 68 | USB_AUDIO_STREAM_STATUS_ENUM_MAX_VAL_V01 = INT_MAX, |
| 69 | }; |
| 70 | |
| 71 | enum usb_audio_device_indication_enum_v01 { |
| 72 | USB_AUDIO_DEVICE_INDICATION_ENUM_MIN_VAL_V01 = INT_MIN, |
| 73 | USB_AUDIO_DEV_CONNECT_V01 = 0, |
| 74 | USB_AUDIO_DEV_DISCONNECT_V01 = 1, |
| 75 | USB_AUDIO_DEV_SUSPEND_V01 = 2, |
| 76 | USB_AUDIO_DEV_RESUME_V01 = 3, |
| 77 | USB_AUDIO_DEVICE_INDICATION_ENUM_MAX_VAL_V01 = INT_MAX, |
| 78 | }; |
| 79 | |
Hemant Kumar | 0ef9fbb | 2016-01-28 11:41:42 -0800 | [diff] [blame] | 80 | struct qmi_uaudio_stream_req_msg_v01 { |
Hemant Kumar | 0ef9fbb | 2016-01-28 11:41:42 -0800 | [diff] [blame] | 81 | uint8_t enable; |
| 82 | uint32_t usb_token; |
Hemant Kumar | aa2fa3c | 2016-07-18 16:26:48 -0700 | [diff] [blame^] | 83 | uint8_t audio_format_valid; |
Hemant Kumar | 0ef9fbb | 2016-01-28 11:41:42 -0800 | [diff] [blame] | 84 | uint32_t audio_format; |
Hemant Kumar | aa2fa3c | 2016-07-18 16:26:48 -0700 | [diff] [blame^] | 85 | uint8_t number_of_ch_valid; |
Hemant Kumar | 0ef9fbb | 2016-01-28 11:41:42 -0800 | [diff] [blame] | 86 | uint32_t number_of_ch; |
Hemant Kumar | aa2fa3c | 2016-07-18 16:26:48 -0700 | [diff] [blame^] | 87 | uint8_t bit_rate_valid; |
Hemant Kumar | 0ef9fbb | 2016-01-28 11:41:42 -0800 | [diff] [blame] | 88 | uint32_t bit_rate; |
Hemant Kumar | aa2fa3c | 2016-07-18 16:26:48 -0700 | [diff] [blame^] | 89 | uint8_t xfer_buff_size_valid; |
Hemant Kumar | 0ef9fbb | 2016-01-28 11:41:42 -0800 | [diff] [blame] | 90 | uint32_t xfer_buff_size; |
| 91 | }; |
Hemant Kumar | aa2fa3c | 2016-07-18 16:26:48 -0700 | [diff] [blame^] | 92 | #define QMI_UAUDIO_STREAM_REQ_MSG_V01_MAX_MSG_LEN 39 |
Hemant Kumar | 0ef9fbb | 2016-01-28 11:41:42 -0800 | [diff] [blame] | 93 | extern struct elem_info qmi_uaudio_stream_req_msg_v01_ei[]; |
| 94 | |
| 95 | struct qmi_uaudio_stream_resp_msg_v01 { |
Hemant Kumar | aa2fa3c | 2016-07-18 16:26:48 -0700 | [diff] [blame^] | 96 | struct qmi_response_type_v01 resp; |
| 97 | uint8_t status_valid; |
| 98 | enum usb_audio_stream_status_enum_v01 status; |
| 99 | uint8_t internal_status_valid; |
| 100 | uint32_t internal_status; |
| 101 | uint8_t slot_id_valid; |
Hemant Kumar | 0ef9fbb | 2016-01-28 11:41:42 -0800 | [diff] [blame] | 102 | uint32_t slot_id; |
Hemant Kumar | aa2fa3c | 2016-07-18 16:26:48 -0700 | [diff] [blame^] | 103 | uint8_t usb_token_valid; |
| 104 | uint32_t usb_token; |
| 105 | uint8_t std_as_opr_intf_desc_valid; |
Hemant Kumar | 0ef9fbb | 2016-01-28 11:41:42 -0800 | [diff] [blame] | 106 | struct usb_interface_descriptor_v01 std_as_opr_intf_desc; |
Hemant Kumar | aa2fa3c | 2016-07-18 16:26:48 -0700 | [diff] [blame^] | 107 | uint8_t std_as_data_ep_desc_valid; |
Hemant Kumar | 0ef9fbb | 2016-01-28 11:41:42 -0800 | [diff] [blame] | 108 | struct usb_endpoint_descriptor_v01 std_as_data_ep_desc; |
Hemant Kumar | aa2fa3c | 2016-07-18 16:26:48 -0700 | [diff] [blame^] | 109 | uint8_t std_as_sync_ep_desc_valid; |
Hemant Kumar | 0ef9fbb | 2016-01-28 11:41:42 -0800 | [diff] [blame] | 110 | struct usb_endpoint_descriptor_v01 std_as_sync_ep_desc; |
Hemant Kumar | aa2fa3c | 2016-07-18 16:26:48 -0700 | [diff] [blame^] | 111 | uint8_t usb_audio_spec_revision_valid; |
| 112 | uint16_t usb_audio_spec_revision; |
| 113 | uint8_t data_path_delay_valid; |
| 114 | uint8_t data_path_delay; |
| 115 | uint8_t usb_audio_subslot_size_valid; |
| 116 | uint8_t usb_audio_subslot_size; |
| 117 | uint8_t xhci_mem_info_valid; |
Hemant Kumar | 0ef9fbb | 2016-01-28 11:41:42 -0800 | [diff] [blame] | 118 | struct apps_mem_info_v01 xhci_mem_info; |
Hemant Kumar | aa2fa3c | 2016-07-18 16:26:48 -0700 | [diff] [blame^] | 119 | uint8_t interrupter_num_valid; |
Hemant Kumar | 0ef9fbb | 2016-01-28 11:41:42 -0800 | [diff] [blame] | 120 | uint8_t interrupter_num; |
| 121 | }; |
Hemant Kumar | aa2fa3c | 2016-07-18 16:26:48 -0700 | [diff] [blame^] | 122 | #define QMI_UAUDIO_STREAM_RESP_MSG_V01_MAX_MSG_LEN 191 |
Hemant Kumar | 0ef9fbb | 2016-01-28 11:41:42 -0800 | [diff] [blame] | 123 | extern struct elem_info qmi_uaudio_stream_resp_msg_v01_ei[]; |
| 124 | |
| 125 | struct qmi_uaudio_stream_ind_msg_v01 { |
Hemant Kumar | aa2fa3c | 2016-07-18 16:26:48 -0700 | [diff] [blame^] | 126 | enum usb_audio_device_indication_enum_v01 dev_event; |
Hemant Kumar | 0ef9fbb | 2016-01-28 11:41:42 -0800 | [diff] [blame] | 127 | uint32_t slot_id; |
Hemant Kumar | aa2fa3c | 2016-07-18 16:26:48 -0700 | [diff] [blame^] | 128 | uint8_t usb_token_valid; |
| 129 | uint32_t usb_token; |
| 130 | uint8_t std_as_opr_intf_desc_valid; |
Hemant Kumar | 0ef9fbb | 2016-01-28 11:41:42 -0800 | [diff] [blame] | 131 | struct usb_interface_descriptor_v01 std_as_opr_intf_desc; |
Hemant Kumar | aa2fa3c | 2016-07-18 16:26:48 -0700 | [diff] [blame^] | 132 | uint8_t std_as_data_ep_desc_valid; |
Hemant Kumar | 0ef9fbb | 2016-01-28 11:41:42 -0800 | [diff] [blame] | 133 | struct usb_endpoint_descriptor_v01 std_as_data_ep_desc; |
Hemant Kumar | aa2fa3c | 2016-07-18 16:26:48 -0700 | [diff] [blame^] | 134 | uint8_t std_as_sync_ep_desc_valid; |
Hemant Kumar | 0ef9fbb | 2016-01-28 11:41:42 -0800 | [diff] [blame] | 135 | struct usb_endpoint_descriptor_v01 std_as_sync_ep_desc; |
Hemant Kumar | aa2fa3c | 2016-07-18 16:26:48 -0700 | [diff] [blame^] | 136 | uint8_t usb_audio_spec_revision_valid; |
| 137 | uint16_t usb_audio_spec_revision; |
| 138 | uint8_t data_path_delay_valid; |
| 139 | uint8_t data_path_delay; |
| 140 | uint8_t usb_audio_subslot_size_valid; |
| 141 | uint8_t usb_audio_subslot_size; |
| 142 | uint8_t xhci_mem_info_valid; |
Hemant Kumar | 0ef9fbb | 2016-01-28 11:41:42 -0800 | [diff] [blame] | 143 | struct apps_mem_info_v01 xhci_mem_info; |
Hemant Kumar | aa2fa3c | 2016-07-18 16:26:48 -0700 | [diff] [blame^] | 144 | uint8_t interrupter_num_valid; |
| 145 | uint8_t interrupter_num; |
Hemant Kumar | 0ef9fbb | 2016-01-28 11:41:42 -0800 | [diff] [blame] | 146 | }; |
Hemant Kumar | aa2fa3c | 2016-07-18 16:26:48 -0700 | [diff] [blame^] | 147 | #define QMI_UAUDIO_STREAM_IND_MSG_V01_MAX_MSG_LEN 177 |
Hemant Kumar | 0ef9fbb | 2016-01-28 11:41:42 -0800 | [diff] [blame] | 148 | extern struct elem_info qmi_uaudio_stream_ind_msg_v01_ei[]; |
| 149 | |
| 150 | #endif |