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:
- dwc_otg can’t coexist with other USB drivers raspberrypi/linux#881
- RPi zero Support for USB Gadget Mode (pi shows up as keyboard, disk, net, camera etc) raspberrypi/linux#1212