diff options
author | Rafaël Carré <rafael.carre@gmail.com> | 2009-07-01 23:39:57 +0000 |
---|---|---|
committer | Rafaël Carré <rafael.carre@gmail.com> | 2009-07-01 23:39:57 +0000 |
commit | 293b499093baef544f7148a0fcfa18d28ed3d1ea (patch) | |
tree | d1b7dc73085f2d443a683cd40569ef3d9b558c6e /firmware/drivers/sd.c | |
parent | ccbd8f4f31ec7f2c2ca03d3ac57ccdb28afc132c (diff) | |
download | rockbox-293b499093baef544f7148a0fcfa18d28ed3d1ea.tar.gz rockbox-293b499093baef544f7148a0fcfa18d28ed3d1ea.zip |
Move sd_get_info() into common sd code
git-svn-id: svn://svn.rockbox.org/rockbox/trunk@21610 a1c6a512-1295-4272-9138-f99709370657
Diffstat (limited to 'firmware/drivers/sd.c')
-rw-r--r-- | firmware/drivers/sd.c | 23 |
1 files changed, 23 insertions, 0 deletions
diff --git a/firmware/drivers/sd.c b/firmware/drivers/sd.c index 3e05b05742..d566e614d2 100644 --- a/firmware/drivers/sd.c +++ b/firmware/drivers/sd.c | |||
@@ -21,6 +21,7 @@ | |||
21 | 21 | ||
22 | #include "config.h" | 22 | #include "config.h" |
23 | #include "hotswap.h" | 23 | #include "hotswap.h" |
24 | #include "storage.h" | ||
24 | 25 | ||
25 | static const unsigned char sd_mantissa[] = { /* *10 */ | 26 | static const unsigned char sd_mantissa[] = { /* *10 */ |
26 | 0, 10, 12, 13, 15, 20, 25, 30, 35, 40, 45, 50, 55, 60, 70, 80 }; | 27 | 0, 10, 12, 13, 15, 20, 25, 30, 35, 40, 45, 50, 55, 60, 70, 80 }; |
@@ -75,3 +76,25 @@ void sd_spindown(int seconds) | |||
75 | { | 76 | { |
76 | (void)seconds; | 77 | (void)seconds; |
77 | } | 78 | } |
79 | |||
80 | #ifdef STORAGE_GET_INFO | ||
81 | void sd_get_info(IF_MV2(int drive,) struct storage_info *info) | ||
82 | { | ||
83 | #ifndef HAVE_MULTIVOLUME | ||
84 | const int drive=0; | ||
85 | #endif | ||
86 | |||
87 | tCardInfo *card = card_get_info_target(drive); | ||
88 | |||
89 | info->sector_size=card->blocksize; | ||
90 | info->num_sectors=card->numblocks; | ||
91 | info->vendor="Rockbox"; | ||
92 | #if CONFIG_STORAGE == STORAGE_SD | ||
93 | info->product = (drive==0) ? "Internal Storage" : "SD Card Slot"; | ||
94 | #else /* Internal storage is not SD */ | ||
95 | info->product = "SD Card Slot"; | ||
96 | #endif | ||
97 | info->revision="0.00"; | ||
98 | } | ||
99 | #endif | ||
100 | |||