summaryrefslogtreecommitdiff
path: root/firmware/drivers
diff options
context:
space:
mode:
Diffstat (limited to 'firmware/drivers')
-rw-r--r--firmware/drivers/audio/as3514.c3
-rw-r--r--firmware/drivers/fat.c19
2 files changed, 18 insertions, 4 deletions
diff --git a/firmware/drivers/audio/as3514.c b/firmware/drivers/audio/as3514.c
index 08d4d538a4..d51341d8c3 100644
--- a/firmware/drivers/audio/as3514.c
+++ b/firmware/drivers/audio/as3514.c
@@ -132,9 +132,6 @@ void audiohw_init(void)
132{ 132{
133 unsigned int i; 133 unsigned int i;
134 134
135 /* reset I2C */
136 i2c_init();
137
138 /* normal outputs for CDI and I2S pin groups */ 135 /* normal outputs for CDI and I2S pin groups */
139 DEV_INIT2 &= ~0x300; 136 DEV_INIT2 &= ~0x300;
140 137
diff --git a/firmware/drivers/fat.c b/firmware/drivers/fat.c
index 9dd27cf72a..f3374fc4c4 100644
--- a/firmware/drivers/fat.c
+++ b/firmware/drivers/fat.c
@@ -172,6 +172,7 @@ struct bpb
172}; 172};
173 173
174static struct bpb fat_bpbs[NUM_VOLUMES]; /* mounted partition info */ 174static struct bpb fat_bpbs[NUM_VOLUMES]; /* mounted partition info */
175static bool initialized = false;
175 176
176static int update_fsinfo(IF_MV_NONVOID(struct bpb* fat_bpb)); 177static int update_fsinfo(IF_MV_NONVOID(struct bpb* fat_bpb));
177static int flush_fat(IF_MV_NONVOID(struct bpb* fat_bpb)); 178static int flush_fat(IF_MV_NONVOID(struct bpb* fat_bpb));
@@ -202,6 +203,18 @@ static char fat_cache_sectors[FAT_CACHE_SIZE][SECTOR_SIZE];
202static struct fat_cache_entry fat_cache[FAT_CACHE_SIZE]; 203static struct fat_cache_entry fat_cache[FAT_CACHE_SIZE];
203static struct mutex cache_mutex NOCACHEBSS_ATTR; 204static struct mutex cache_mutex NOCACHEBSS_ATTR;
204 205
206#ifdef HAVE_HOTSWAP
207void fat_lock(void)
208{
209 mutex_lock(&cache_mutex);
210}
211
212void fat_unlock(void)
213{
214 mutex_unlock(&cache_mutex);
215}
216#endif
217
205static long cluster2sec(IF_MV2(struct bpb* fat_bpb,) long cluster) 218static long cluster2sec(IF_MV2(struct bpb* fat_bpb,) long cluster)
206{ 219{
207#ifndef HAVE_MULTIVOLUME 220#ifndef HAVE_MULTIVOLUME
@@ -240,7 +253,11 @@ void fat_init(void)
240{ 253{
241 unsigned int i; 254 unsigned int i;
242 255
243 mutex_init(&cache_mutex); 256 if (!initialized)
257 {
258 initialized = true;
259 mutex_init(&cache_mutex);
260 }
244 261
245 /* mark the FAT cache as unused */ 262 /* mark the FAT cache as unused */
246 for(i = 0;i < FAT_CACHE_SIZE;i++) 263 for(i = 0;i < FAT_CACHE_SIZE;i++)