diff options
author | Aidan MacDonald <amachronic@protonmail.com> | 2021-07-13 22:01:17 +0100 |
---|---|---|
committer | Aidan MacDonald <amachronic@protonmail.com> | 2021-07-13 22:01:17 +0100 |
commit | 3abb7c5dd5be2ec6744bfc0a80967b20f1b59e30 (patch) | |
tree | b96e54d218a3eaa4abe6fb99c6f74b926afeab60 /firmware/target/mips/ingenic_x1000/msc-x1000.h | |
parent | 3c4fdf10e24d54ca0f11ca35eaf614126a476bb6 (diff) | |
download | rockbox-3abb7c5dd5be2ec6744bfc0a80967b20f1b59e30.tar.gz rockbox-3abb7c5dd5be2ec6744bfc0a80967b20f1b59e30.zip |
x1000: revamp MSC driver card detection logic
Debounce logic now handles both removal and insertion and verifies
the detection is stable for 100ms before taking any action.
This solves the bootloader "file not found" issue on the Shanling Q1.
It seems a false removal event was generated, causing the filesystem
to be automatically unmounted. Probably this is due to some transient
noise at boot. Delays didn't solve the problem, probably because the
bogus hotplug event was queued, and normal mdelay() would simply delay
event delivery.
Change-Id: I8b03fb3550309f5a7ab4be0be7465a3dab2d3450
Diffstat (limited to 'firmware/target/mips/ingenic_x1000/msc-x1000.h')
-rw-r--r-- | firmware/target/mips/ingenic_x1000/msc-x1000.h | 3 |
1 files changed, 2 insertions, 1 deletions
diff --git a/firmware/target/mips/ingenic_x1000/msc-x1000.h b/firmware/target/mips/ingenic_x1000/msc-x1000.h index 70f67a70d6..b7b05b859d 100644 --- a/firmware/target/mips/ingenic_x1000/msc-x1000.h +++ b/firmware/target/mips/ingenic_x1000/msc-x1000.h | |||
@@ -126,7 +126,8 @@ typedef struct msc_drv { | |||
126 | unsigned iflag_done; | 126 | unsigned iflag_done; |
127 | 127 | ||
128 | volatile int req_running; | 128 | volatile int req_running; |
129 | volatile int card_present; | 129 | volatile int card_present; /* Debounced status */ |
130 | volatile int card_present_last; /* Status when we last polled it */ | ||
130 | 131 | ||
131 | struct mutex lock; | 132 | struct mutex lock; |
132 | struct semaphore cmd_done; | 133 | struct semaphore cmd_done; |