summaryrefslogtreecommitdiffstats
path: root/firmware/target/hosted/fiio/usb-fiio.c
diff options
context:
space:
mode:
Diffstat (limited to 'firmware/target/hosted/fiio/usb-fiio.c')
-rw-r--r--firmware/target/hosted/fiio/usb-fiio.c6
1 files changed, 6 insertions, 0 deletions
diff --git a/firmware/target/hosted/fiio/usb-fiio.c b/firmware/target/hosted/fiio/usb-fiio.c
index 76a0ec5a2b..3084ee0169 100644
--- a/firmware/target/hosted/fiio/usb-fiio.c
+++ b/firmware/target/hosted/fiio/usb-fiio.c
@@ -39,8 +39,14 @@ int usb_detect(void)
return present ? USB_INSERTED : USB_EXTRACTED;
}
+static bool usb_enabled = 0;
+
void usb_enable(bool on)
{
+ if (usb_enabled == on)
+ return;
+
+ usb_enabled = on;
if (on)
{
system ("insmod /lib/modules/3.10.14/kernel/driver/usb/gadget/libcomposite.ko");