FROMLIST: usb: gadget: f_uac1: Fix endpoint reading

The endpoint is stored in the lower byte of wIndex, according to USB
Audio 1.0 specification, section 5.2.1.1.

Link: https://lore.kernel.org/patchwork/patch/805284/
Signed-off-by: Julian Scheel <julian@jusst.de>
Signed-off-by: Ren Jianing <jianing.ren@rock-chips.com>
Change-Id: I16634151e98cfb0f7107e96463a20b8fa8d7072f
This commit is contained in:
Julian Scheel
2017-06-30 12:00:34 +02:00
committed by Tao Huang
parent 10e9abc766
commit 9cc791ff36

View File

@@ -337,7 +337,7 @@ static int audio_set_endpoint_req(struct usb_function *f,
{
struct usb_composite_dev *cdev = f->config->cdev;
int value = -EOPNOTSUPP;
u16 ep = le16_to_cpu(ctrl->wIndex);
u8 ep = le16_to_cpu(ctrl->wIndex) & 0xff;
u16 len = le16_to_cpu(ctrl->wLength);
u16 w_value = le16_to_cpu(ctrl->wValue);
@@ -373,7 +373,7 @@ static int audio_get_endpoint_req(struct usb_function *f,
{
struct usb_composite_dev *cdev = f->config->cdev;
int value = -EOPNOTSUPP;
u8 ep = ((le16_to_cpu(ctrl->wIndex) >> 8) & 0xFF);
u8 ep = le16_to_cpu(ctrl->wIndex) & 0xff;
u16 len = le16_to_cpu(ctrl->wLength);
u16 w_value = le16_to_cpu(ctrl->wValue);