usb: gadget: hidg: register OUT INT endpoint for SET_REPORT
usb: gadget: hidg: register OUT INT endpoint for SET_REPORT

The hidg function driver currently handles its SET_REPORT calls via EP0.
This is the implicit behaviour when no OUT interrupt endpoint is
configured and generally works fine.

The problem is that due to EP0's role in the gadget framework, we cannot
hold back packets and control traffic flow to sync it to the char device,
and hence there's a high risk of loosing packets with this
implementation.

This patch adds an OUT interrupt endpoint to the interface and queues a
fix number of request to catch SET_REPORT events. According to the
specs, host drivers should always use the dedicated OUT endpoint when
present.

The char device's read implementation was rewritten to retrieve data
from the list of completed output requests.

Signed-off-by: Daniel Mack <70806a71956ed8873ecff8522779dae1401a1b4a@gmail.com>
Cc: Felipe Balbi <94dddeeef08b001e003cce128ddc162a4e2c6cd2@ti.com>
Cc: Greg Kroah-Hartman <4645f7897fd33786a2ee1264d590b3c400559d85@suse.de>
Signed-off-by: Felipe Balbi <94dddeeef08b001e003cce128ddc162a4e2c6cd2@ti.com>

KristFoundation/Programs,KristFoundation/Programs,KristFoundation/Programs,TeamVee-Kanas/android_kernel_samsung_kanas,KristFoundation/Programs,TeamVee-Kanas/android_kernel_samsung_kanas,KristFoundation/Programs,KristFoundation/Programs,TeamVee-Kanas/android_kernel_samsung_kanas,TeamVee-Kanas/android_kernel_samsung_kanas,TeamVee-Kanas/android_kernel_samsung_kanas