summaryrefslogtreecommitdiffstats
path: root/firmware/target/hosted/fiio/usb-fiio.c
diff options
context:
space:
mode:
authorSolomon Peachy <pizza@shaftnet.org>2020-10-15 14:11:41 -0400
committerSolomon Peachy <pizza@shaftnet.org>2020-10-15 14:11:41 -0400
commit2e072236908deb8b331d16b058c7294226422b67 (patch)
tree39ce68d108c186e0124dda81e91e855c3c14edbd /firmware/target/hosted/fiio/usb-fiio.c
parent455a23bdabb544de6296f4be9d5a6d8363a3d9cf (diff)
downloadrockbox-2e07223690.tar.gz
rockbox-2e07223690.tar.bz2
rockbox-2e07223690.zip
m3k: Fixes for the M3K.
* Cannot turn off the LCD directly (have to rely on backlight) * Only insmod/rmmod the usb gadget modules if state changes Change-Id: I9ea90177d496cd035ada93e04a93a7c6f2e84706
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");