Rockbox open source high quality audio player as a Music Player Daemon
mpris rockbox mpd libadwaita audio rust zig deno
2
fork

Configure Feed

Select the types of activity you want to include in your feed.

sonynwz: Properly support multidrive, with hotswap of the SD card

Change-Id: I7eb8efb0986a395d5ffbcc06a54bb680e0b59e9d

+81 -11
+1
firmware/export/config/samsungypr0.h
··· 169 169 #define HAVE_HOTSWAP 170 170 #define HAVE_STORAGE_FLUSH 171 171 #define MULTIDRIVE_DIR "/mnt/mmc" 172 + #define MULTIDRIVE_DEV "/sys/block/mmcblk0"
+2
firmware/export/config/sonynwa20.h
··· 13 13 /* sqrt(240^2 + 320^2) / 2 = 200 */ 14 14 #define LCD_DPI 200 15 15 16 + #define NWZ_HAS_SD 17 + 16 18 #include "sonynwzlinux.h"
+2
firmware/export/config/sonynwza10.h
··· 13 13 /* sqrt(240^2 + 320^2) / 2 = 200 */ 14 14 #define LCD_DPI 200 15 15 16 + #define NWZ_HAS_SD 17 + 16 18 #include "sonynwzlinux.h"
+10 -3
firmware/export/config/sonynwzlinux.h
··· 57 57 /* The number of bytes reserved for loadable plugins */ 58 58 #define PLUGIN_BUFFER_SIZE 0x100000 59 59 60 - 61 - 62 - 63 60 #define CONFIG_TUNER SI4700 64 61 65 62 /* There is no hardware tone control */ ··· 105 102 /* Define this to the CPU frequency */ 106 103 #define CPU_FREQ 532000000 107 104 105 + #ifdef NWZ_HAS_SD 106 + /* External SD card can be mounted */ 107 + #define CONFIG_STORAGE (STORAGE_HOSTFS|STORAGE_SD) 108 + #define HAVE_MULTIDRIVE /* But _not_ CONFIG_STORAGE_MULTI */ 109 + #define NUM_DRIVES 2 110 + #define HAVE_HOTSWAP 111 + #define MULTIDRIVE_DIR "/mnt/media" 112 + #define MULTIDRIVE_DEV "/sys/block/mmcblk1" 113 + #else 108 114 /* No special storage */ 109 115 #define CONFIG_STORAGE STORAGE_HOSTFS 116 + #endif 110 117 #define HAVE_STORAGE_FLUSH 111 118 112 119 /* Battery */
+66 -8
firmware/target/hosted/sonynwz/system-nwz.c
··· 1 1 /*************************************************************************** 2 - * __________ __ ___. 3 - * Open \______ \ ____ ____ | | _\_ |__ _______ ___ 4 - * Source | _// _ \_/ ___\| |/ /| __ \ / _ \ \/ / 5 - * Jukebox | | ( <_> ) \___| < | \_\ ( <_> > < < 6 - * Firmware |____|_ /\____/ \___ >__|_ \|___ /\____/__/\_ \ 7 - * \/ \/ \/ \/ \/ 2 + * __________ __ ___. 3 + * Open \______ \ ____ ____ | | _\_ |__ _______ ___ 4 + * Source | _// _ \_/ ___\| |/ /| __ \ / _ \ \/ / 5 + * Jukebox | | ( <_> ) \___| < | \_\ ( <_> > < < 6 + * Firmware |____|_ /\____/ \___ >__|_ \|___ /\____/__/\_ \ 7 + * \/ \/ \/ \/ \/ 8 8 * 9 9 * Copyright (C) 2016 Amaury Pouly 10 10 * ··· 23 23 #include <signal.h> 24 24 #include <ucontext.h> 25 25 #include <string.h> 26 + #include <stdio.h> 27 + 26 28 #include "system.h" 27 29 #include "lcd.h" 28 30 #include "font.h" 29 - #include "logf.h" 30 31 #include "system.h" 31 32 #include "backlight-target.h" 32 33 #include "button.h" 33 34 #include "adc.h" 34 35 #include "power.h" 36 + #include "mv.h" 35 37 #include "power-nwz.h" 36 38 #include <backtrace.h> 37 - #include <stdio.h> 39 + 40 + #include "logf.h" 38 41 39 42 static const char **kern_mod_list; 43 + bool os_file_exists(const char *ospath); 40 44 41 45 void power_off(void) 42 46 { ··· 238 242 return true; 239 243 return false; 240 244 } 245 + 246 + #ifdef CONFIG_STORAGE_MULTI 247 + int hostfs_driver_type(int drive) 248 + { 249 + return drive > 0 ? STORAGE_SD_NUM : STORAGE_HOSTFS_NUM; 250 + } 251 + #endif /* CONFIG_STORAGE_MULTI */ 252 + 253 + #ifdef HAVE_HOTSWAP 254 + bool hostfs_removable(IF_MD_NONVOID(int volume)) 255 + { 256 + #ifdef HAVE_MULTIDRIVE 257 + if (volume > 0) 258 + return true; 259 + else 260 + #endif 261 + return false; /* internal: always present */ 262 + } 263 + 264 + bool hostfs_present(int volume) 265 + { 266 + #ifdef HAVE_MULTIDRIVE 267 + if (volume > 0) 268 + #if defined(MULTIDRIVE_DEV) 269 + return os_file_exists(MULTIDRIVE_DEV); 270 + #else 271 + return true; // FIXME? 272 + #endif 273 + else 274 + #endif 275 + return true; /* internal: always present */ 276 + } 277 + #endif /* HAVE_HOTSWAP */ 278 + 279 + #ifdef HAVE_MULTIDRIVE 280 + int volume_drive(int drive) 281 + { 282 + return drive; 283 + } 284 + #endif /* HAVE_MULTIDRIVE */ 285 + 286 + #ifdef HAVE_HOTSWAP 287 + bool volume_removable(IF_MV_NONVOID(int volume)) 288 + { 289 + /* don't support more than one partition yet, so volume == drive */ 290 + return hostfs_removable(volume); 291 + } 292 + 293 + bool volume_present(int volume) 294 + { 295 + /* don't support more than one partition yet, so volume == drive */ 296 + return hostfs_present(volume); 297 + } 298 + #endif /* HAVE_HOTSWAP */