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 | |
| 16 | #define UAUDIO_STREAM_SERVICE_ID_V01 0x41C |
| 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 | |
| 61 | struct qmi_uaudio_stream_req_msg_v01 { |
| 62 | uint32_t priv_data; |
| 63 | uint8_t enable; |
| 64 | uint32_t usb_token; |
| 65 | uint32_t audio_format; |
| 66 | uint32_t number_of_ch; |
| 67 | uint32_t bit_rate; |
| 68 | uint32_t xfer_buff_size; |
| 69 | }; |
| 70 | #define QMI_UAUDIO_STREAM_REQ_MSG_V01_MAX_MSG_LEN 46 |
| 71 | extern struct elem_info qmi_uaudio_stream_req_msg_v01_ei[]; |
| 72 | |
| 73 | struct qmi_uaudio_stream_resp_msg_v01 { |
| 74 | uint32_t priv_data; |
| 75 | uint32_t status; |
| 76 | uint32_t slot_id; |
| 77 | uint8_t bSubslotSize; |
| 78 | struct usb_interface_descriptor_v01 std_as_opr_intf_desc; |
| 79 | struct usb_endpoint_descriptor_v01 std_as_data_ep_desc; |
| 80 | struct usb_endpoint_descriptor_v01 std_as_sync_ep_desc; |
| 81 | uint8_t bDelay; |
| 82 | uint16_t bcdADC; |
| 83 | struct apps_mem_info_v01 xhci_mem_info; |
| 84 | uint8_t interrupter_num; |
| 85 | }; |
| 86 | #define QMI_UAUDIO_STREAM_RESP_MSG_V01_MAX_MSG_LEN 177 |
| 87 | extern struct elem_info qmi_uaudio_stream_resp_msg_v01_ei[]; |
| 88 | |
| 89 | struct qmi_uaudio_stream_ind_msg_v01 { |
| 90 | uint32_t usb_token; |
| 91 | uint32_t priv_data; |
| 92 | uint32_t status; |
| 93 | uint32_t slot_id; |
| 94 | uint8_t bSubslotSize; |
| 95 | struct usb_interface_descriptor_v01 std_as_opr_intf_desc; |
| 96 | struct usb_endpoint_descriptor_v01 std_as_data_ep_desc; |
| 97 | struct usb_endpoint_descriptor_v01 std_as_sync_ep_desc; |
| 98 | struct apps_mem_info_v01 xhci_mem_info; |
| 99 | }; |
| 100 | #define QMI_UAUDIO_STREAM_IND_MSG_V01_MAX_MSG_LEN 171 |
| 101 | extern struct elem_info qmi_uaudio_stream_ind_msg_v01_ei[]; |
| 102 | |
| 103 | #endif |