via raspberrypi/linux#884:

Use the upstream dwc2 driver in gadget mode - this in theory “should work” but hasn’t really been tested in device mode. The hardware is similar to the type underneath the s3c_hsotg driver in upstream and there is an ongoing effort to consolidate both codebases. This would be the ideal solution if you just require device mode.

Other useful threads: