Merge "sound: usb: Provide controller number in QMI response"

This commit is contained in:
Linux Build Service Account 2017-11-29 04:26:06 -08:00 committed by Gerrit - the friendly Code Review server
commit 0f011956d5
5 changed files with 73 additions and 3 deletions

View file

@ -5031,6 +5031,13 @@ dma_addr_t xhci_get_xfer_ring_dma_addr(struct usb_hcd *hcd,
return 0;
}
int xhci_get_core_id(struct usb_hcd *hcd)
{
struct xhci_hcd *xhci = hcd_to_xhci(hcd);
return xhci->core_id;
}
static const struct hc_driver xhci_hc_driver = {
.description = "xhci-hcd",
.product_desc = "xHCI Host Controller",
@ -5095,6 +5102,7 @@ static const struct hc_driver xhci_hc_driver = {
.get_sec_event_ring_dma_addr = xhci_get_sec_event_ring_dma_addr,
.get_xfer_ring_dma_addr = xhci_get_xfer_ring_dma_addr,
.get_dcba_dma_addr = xhci_get_dcba_dma_addr,
.get_core_id = xhci_get_core_id,
};
void xhci_init_driver(struct hc_driver *drv,

View file

@ -1948,6 +1948,7 @@ int xhci_hub_control(struct usb_hcd *hcd, u16 typeReq, u16 wValue, u16 wIndex,
char *buf, u16 wLength);
int xhci_hub_status_data(struct usb_hcd *hcd, char *buf);
int xhci_find_raw_port_number(struct usb_hcd *hcd, int port1);
int xhci_get_core_id(struct usb_hcd *hcd);
#ifdef CONFIG_PM
int xhci_bus_suspend(struct usb_hcd *hcd);

View file

@ -555,6 +555,13 @@ skip_sync_ep:
resp->interrupter_num = uaudio_qdev->intr_num;
resp->interrupter_num_valid = 1;
ret = usb_get_controller_id(subs->dev);
if (ret < 0)
goto err;
resp->controller_num = ret;
resp->controller_num_valid = 1;
/* map xhci data structures PA memory to iova */
/* event ring */

View file

@ -1,4 +1,4 @@
/* Copyright (c) 2016, The Linux Foundation. All rights reserved.
/* Copyright (c) 2017, The Linux Foundation. All rights reserved.
*
* This program is free software; you can redistribute it and/or modify
* it under the terms of the GNU General Public License version 2 and
@ -632,6 +632,46 @@ struct elem_info qmi_uaudio_stream_resp_msg_v01_ei[] = {
struct qmi_uaudio_stream_resp_msg_v01,
interrupter_num),
},
{
.data_type = QMI_OPT_FLAG,
.elem_len = 1,
.elem_size = sizeof(uint8_t),
.is_array = NO_ARRAY,
.tlv_type = 0x1C,
.offset = offsetof(
struct qmi_uaudio_stream_resp_msg_v01,
speed_info_valid),
},
{
.data_type = QMI_SIGNED_4_BYTE_ENUM,
.elem_len = 1,
.elem_size = sizeof(enum usb_audio_device_speed_enum_v01),
.is_array = NO_ARRAY,
.tlv_type = 0x1C,
.offset = offsetof(
struct qmi_uaudio_stream_resp_msg_v01,
speed_info),
},
{
.data_type = QMI_OPT_FLAG,
.elem_len = 1,
.elem_size = sizeof(uint8_t),
.is_array = NO_ARRAY,
.tlv_type = 0x1D,
.offset = offsetof(
struct qmi_uaudio_stream_resp_msg_v01,
controller_num_valid),
},
{
.data_type = QMI_UNSIGNED_1_BYTE,
.elem_len = 1,
.elem_size = sizeof(uint8_t),
.is_array = NO_ARRAY,
.tlv_type = 0x1D,
.offset = offsetof(
struct qmi_uaudio_stream_resp_msg_v01,
controller_num),
},
{
.data_type = QMI_EOTI,
.is_array = NO_ARRAY,

View file

@ -1,4 +1,4 @@
/* Copyright (c) 2016, The Linux Foundation. All rights reserved.
/* Copyright (c) 2017, The Linux Foundation. All rights reserved.
*
* This program is free software; you can redistribute it and/or modify
* it under the terms of the GNU General Public License version 2 and
@ -77,6 +77,16 @@ enum usb_audio_device_indication_enum_v01 {
USB_AUDIO_DEVICE_INDICATION_ENUM_MAX_VAL_V01 = INT_MAX,
};
enum usb_audio_device_speed_enum_v01 {
USB_AUDIO_DEVICE_SPEED_ENUM_MIN_VAL_V01 = INT_MIN,
USB_AUDIO_DEVICE_SPEED_INVALID_V01 = 0,
USB_AUDIO_DEVICE_SPEED_LOW_V01 = 1,
USB_AUDIO_DEVICE_SPEED_FULL_V01 = 2,
USB_AUDIO_DEVICE_SPEED_HIGH_V01 = 3,
USB_AUDIO_DEVICE_SPEED_SUPER_V01 = 4,
USB_AUDIO_DEVICE_SPEED_ENUM_MAX_VAL_V01 = INT_MAX,
};
struct qmi_uaudio_stream_req_msg_v01 {
uint8_t enable;
uint32_t usb_token;
@ -118,8 +128,12 @@ struct qmi_uaudio_stream_resp_msg_v01 {
struct apps_mem_info_v01 xhci_mem_info;
uint8_t interrupter_num_valid;
uint8_t interrupter_num;
uint8_t speed_info_valid;
enum usb_audio_device_speed_enum_v01 speed_info;
uint8_t controller_num_valid;
uint8_t controller_num;
};
#define QMI_UAUDIO_STREAM_RESP_MSG_V01_MAX_MSG_LEN 191
#define QMI_UAUDIO_STREAM_RESP_MSG_V01_MAX_MSG_LEN 202
extern struct elem_info qmi_uaudio_stream_resp_msg_v01_ei[];
struct qmi_uaudio_stream_ind_msg_v01 {