usb: gadget: function: f_uac1: implement get_alt()
authorRuslan Bilovol <ruslan.bilovol@gmail.com>
Sat, 17 Jun 2017 21:23:58 +0000 (00:23 +0300)
committerFelipe Balbi <felipe.balbi@linux.intel.com>
Mon, 19 Jun 2017 06:22:45 +0000 (09:22 +0300)
commit1fc4926d92b9515b44f35b339bab5d2ca474a723
tree381bb1a6decd18bcfa862d7dcb0c968e58ba9434
parentd423b9657f27c0e7de514a8bce8bb71a31a7549b
usb: gadget: function: f_uac1: implement get_alt()

After commit 7e4da3fcf7c9 ("usb: gadget: composite:
Test get_alt() presence instead of set_alt()") f_uac1
function became broken because it doesn't have
get_alt() callback implementation and composite
framework never set altsetting 1 for audiostreaming
interface. On host site it looks like:

 [424339.017711] 21:1:1: usb_set_interface failed (-32)

Since host can't set altsetting 1, it can't start
playing audio.

In order to fix it implemented get_alt along with
minor improvements (error conditions checking)
similar to what existing f_uac2 has.

Cc: Krzysztof Opasiak <k.opasiak@samsung.com>
Signed-off-by: Ruslan Bilovol <ruslan.bilovol@gmail.com>
Signed-off-by: Felipe Balbi <felipe.balbi@linux.intel.com>
drivers/usb/gadget/function/f_uac1.c