mirror of
https://github.com/hardkernel/linux.git
synced 2026-06-06 19:08:57 +09:00
usb: gadget: f_uac1_legacy: disable ep in f_audio_disable()
The f_audio_disable() doesn't disable usb ep, and this cause usb enumeration fail. So add usb ep disable operation. This patch also reinitializes the opts->bound flag to false in f_audio_free(), and then it can setup ALSA audio device again in f_audio_bind(). Change-Id: I7b10630f5085b1a03792bc4b9e7eabb02d2bd5a2 Signed-off-by: William Wu <william.wu@rock-chips.com>
This commit is contained in:
@@ -668,6 +668,11 @@ static int f_audio_get_alt(struct usb_function *f, unsigned intf)
|
||||
|
||||
static void f_audio_disable(struct usb_function *f)
|
||||
{
|
||||
struct f_audio *audio = func_to_audio(f);
|
||||
struct usb_ep *out_ep = audio->out_ep;
|
||||
|
||||
usb_ep_disable(out_ep);
|
||||
|
||||
return;
|
||||
}
|
||||
|
||||
@@ -968,6 +973,7 @@ static void f_audio_free(struct usb_function *f)
|
||||
|
||||
gaudio_cleanup(&audio->card);
|
||||
opts = container_of(f->fi, struct f_uac1_legacy_opts, func_inst);
|
||||
opts->bound = false;
|
||||
kfree(audio);
|
||||
mutex_lock(&opts->lock);
|
||||
--opts->refcnt;
|
||||
|
||||
Reference in New Issue
Block a user