diff options
| author | Ajay Agarwal <ajaya@codeaurora.org> | 2019-01-08 19:26:58 +0530 |
|---|---|---|
| committer | Ajay Agarwal <ajaya@codeaurora.org> | 2019-01-09 10:16:54 +0530 |
| commit | 7c5d95219e780b578e56ca1e9780182a64aad2e1 (patch) | |
| tree | b0ae71eb6fff772db501f052c7883239405614a9 | |
| parent | 84ac0da7f690a19c5bed696d16333d11e0333cdd (diff) | |
Revert "usb: gadget: function: f_uac1: implement get_alt()"
This reverts commit a1f2b05323e7e782bb79f18efbcea703e0cb613b.
Required for clean picking of UAC opensource changes.
Change-Id: Ic58920a40e59ad744dceb99a85818ab1fd6f3bab
Signed-off-by: Ajay Agarwal <ajaya@codeaurora.org>
| -rw-r--r-- | drivers/usb/gadget/function/f_uac1.c | 40 |
1 files changed, 1 insertions, 39 deletions
diff --git a/drivers/usb/gadget/function/f_uac1.c b/drivers/usb/gadget/function/f_uac1.c index 366e7b6045e4..6a2346b99f55 100644 --- a/drivers/usb/gadget/function/f_uac1.c +++ b/drivers/usb/gadget/function/f_uac1.c @@ -277,9 +277,6 @@ static void f_audio_buffer_free(struct f_audio_buf *audio_buf) struct f_audio { struct gaudio card; - u8 ac_intf, ac_alt; - u8 as_intf, as_alt; - /* endpoints handle full and/or high speeds */ struct usb_ep *out_ep; @@ -589,20 +586,7 @@ static int f_audio_set_alt(struct usb_function *f, unsigned intf, unsigned alt) req_count = opts->req_count; audio_buf_size = opts->audio_buf_size; - /* No i/f has more than 2 alt settings */ - if (alt > 1) { - ERROR(cdev, "%s:%d Error!\n", __func__, __LINE__); - return -EINVAL; - } - - if (intf == audio->ac_intf) { - /* Control I/f has only 1 AltSetting - 0 */ - if (alt) { - ERROR(cdev, "%s:%d Error!\n", __func__, __LINE__); - return -EINVAL; - } - return 0; - } else if (intf == audio->as_intf) { + if (intf == 1) { if (alt == 1) { err = config_ep_by_speed(cdev->gadget, f, out_ep); if (err) @@ -647,28 +631,11 @@ static int f_audio_set_alt(struct usb_function *f, unsigned intf, unsigned alt) schedule_work(&audio->playback_work); } } - audio->as_alt = alt; } return err; } -static int f_audio_get_alt(struct usb_function *f, unsigned intf) -{ - struct f_audio *audio = func_to_audio(f); - struct usb_composite_dev *cdev = f->config->cdev; - - if (intf == audio->ac_intf) - return audio->ac_alt; - else if (intf == audio->as_intf) - return audio->as_alt; - else - ERROR(cdev, "%s:%d Invalid Interface %d!\n", - __func__, __LINE__, intf); - - return -EINVAL; -} - static void f_audio_disable(struct usb_function *f) { return; @@ -735,16 +702,12 @@ f_audio_bind(struct usb_configuration *c, struct usb_function *f) if (status < 0) goto fail; ac_interface_desc.bInterfaceNumber = status; - audio->ac_intf = status; - audio->ac_alt = 0; status = usb_interface_id(c, f); if (status < 0) goto fail; as_interface_alt_0_desc.bInterfaceNumber = status; as_interface_alt_1_desc.bInterfaceNumber = status; - audio->as_intf = status; - audio->as_alt = 0; status = -ENODEV; @@ -1002,7 +965,6 @@ static struct usb_function *f_audio_alloc(struct usb_function_instance *fi) audio->card.func.bind = f_audio_bind; audio->card.func.unbind = f_audio_unbind; audio->card.func.set_alt = f_audio_set_alt; - audio->card.func.get_alt = f_audio_get_alt; audio->card.func.setup = f_audio_setup; audio->card.func.disable = f_audio_disable; audio->card.func.free_func = f_audio_free; |
