blob: 83a966c48bed388cb277bd718e81839e5a14b9b0 [file] [log] [blame]
Hemant Kumar0ef9fbb2016-01-28 11:41:42 -08001/* 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 Kumaraa2fa3c2016-07-18 16:26:48 -070016#define UAUDIO_STREAM_SERVICE_ID_V01 0x41D
Hemant Kumar0ef9fbb2016-01-28 11:41:42 -080017#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
24struct mem_info_v01 {
25 uint64_t va;
26 uint64_t pa;
27 uint32_t size;
28};
29
30struct 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
38struct 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
49struct 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 Kumaraa2fa3c2016-07-18 16:26:48 -070061enum 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
71enum 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 Kumar0ef9fbb2016-01-28 11:41:42 -080080struct qmi_uaudio_stream_req_msg_v01 {
Hemant Kumar0ef9fbb2016-01-28 11:41:42 -080081 uint8_t enable;
82 uint32_t usb_token;
Hemant Kumaraa2fa3c2016-07-18 16:26:48 -070083 uint8_t audio_format_valid;
Hemant Kumar0ef9fbb2016-01-28 11:41:42 -080084 uint32_t audio_format;
Hemant Kumaraa2fa3c2016-07-18 16:26:48 -070085 uint8_t number_of_ch_valid;
Hemant Kumar0ef9fbb2016-01-28 11:41:42 -080086 uint32_t number_of_ch;
Hemant Kumaraa2fa3c2016-07-18 16:26:48 -070087 uint8_t bit_rate_valid;
Hemant Kumar0ef9fbb2016-01-28 11:41:42 -080088 uint32_t bit_rate;
Hemant Kumaraa2fa3c2016-07-18 16:26:48 -070089 uint8_t xfer_buff_size_valid;
Hemant Kumar0ef9fbb2016-01-28 11:41:42 -080090 uint32_t xfer_buff_size;
91};
Hemant Kumaraa2fa3c2016-07-18 16:26:48 -070092#define QMI_UAUDIO_STREAM_REQ_MSG_V01_MAX_MSG_LEN 39
Hemant Kumar0ef9fbb2016-01-28 11:41:42 -080093extern struct elem_info qmi_uaudio_stream_req_msg_v01_ei[];
94
95struct qmi_uaudio_stream_resp_msg_v01 {
Hemant Kumaraa2fa3c2016-07-18 16:26:48 -070096 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 Kumar0ef9fbb2016-01-28 11:41:42 -0800102 uint32_t slot_id;
Hemant Kumaraa2fa3c2016-07-18 16:26:48 -0700103 uint8_t usb_token_valid;
104 uint32_t usb_token;
105 uint8_t std_as_opr_intf_desc_valid;
Hemant Kumar0ef9fbb2016-01-28 11:41:42 -0800106 struct usb_interface_descriptor_v01 std_as_opr_intf_desc;
Hemant Kumaraa2fa3c2016-07-18 16:26:48 -0700107 uint8_t std_as_data_ep_desc_valid;
Hemant Kumar0ef9fbb2016-01-28 11:41:42 -0800108 struct usb_endpoint_descriptor_v01 std_as_data_ep_desc;
Hemant Kumaraa2fa3c2016-07-18 16:26:48 -0700109 uint8_t std_as_sync_ep_desc_valid;
Hemant Kumar0ef9fbb2016-01-28 11:41:42 -0800110 struct usb_endpoint_descriptor_v01 std_as_sync_ep_desc;
Hemant Kumaraa2fa3c2016-07-18 16:26:48 -0700111 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 Kumar0ef9fbb2016-01-28 11:41:42 -0800118 struct apps_mem_info_v01 xhci_mem_info;
Hemant Kumaraa2fa3c2016-07-18 16:26:48 -0700119 uint8_t interrupter_num_valid;
Hemant Kumar0ef9fbb2016-01-28 11:41:42 -0800120 uint8_t interrupter_num;
121};
Hemant Kumaraa2fa3c2016-07-18 16:26:48 -0700122#define QMI_UAUDIO_STREAM_RESP_MSG_V01_MAX_MSG_LEN 191
Hemant Kumar0ef9fbb2016-01-28 11:41:42 -0800123extern struct elem_info qmi_uaudio_stream_resp_msg_v01_ei[];
124
125struct qmi_uaudio_stream_ind_msg_v01 {
Hemant Kumaraa2fa3c2016-07-18 16:26:48 -0700126 enum usb_audio_device_indication_enum_v01 dev_event;
Hemant Kumar0ef9fbb2016-01-28 11:41:42 -0800127 uint32_t slot_id;
Hemant Kumaraa2fa3c2016-07-18 16:26:48 -0700128 uint8_t usb_token_valid;
129 uint32_t usb_token;
130 uint8_t std_as_opr_intf_desc_valid;
Hemant Kumar0ef9fbb2016-01-28 11:41:42 -0800131 struct usb_interface_descriptor_v01 std_as_opr_intf_desc;
Hemant Kumaraa2fa3c2016-07-18 16:26:48 -0700132 uint8_t std_as_data_ep_desc_valid;
Hemant Kumar0ef9fbb2016-01-28 11:41:42 -0800133 struct usb_endpoint_descriptor_v01 std_as_data_ep_desc;
Hemant Kumaraa2fa3c2016-07-18 16:26:48 -0700134 uint8_t std_as_sync_ep_desc_valid;
Hemant Kumar0ef9fbb2016-01-28 11:41:42 -0800135 struct usb_endpoint_descriptor_v01 std_as_sync_ep_desc;
Hemant Kumaraa2fa3c2016-07-18 16:26:48 -0700136 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 Kumar0ef9fbb2016-01-28 11:41:42 -0800143 struct apps_mem_info_v01 xhci_mem_info;
Hemant Kumaraa2fa3c2016-07-18 16:26:48 -0700144 uint8_t interrupter_num_valid;
145 uint8_t interrupter_num;
Hemant Kumar0ef9fbb2016-01-28 11:41:42 -0800146};
Hemant Kumaraa2fa3c2016-07-18 16:26:48 -0700147#define QMI_UAUDIO_STREAM_IND_MSG_V01_MAX_MSG_LEN 177
Hemant Kumar0ef9fbb2016-01-28 11:41:42 -0800148extern struct elem_info qmi_uaudio_stream_ind_msg_v01_ei[];
149
150#endif