summaryrefslogtreecommitdiff
path: root/firmware/target/arm/ata-sd-pp.c
diff options
context:
space:
mode:
Diffstat (limited to 'firmware/target/arm/ata-sd-pp.c')
-rw-r--r--firmware/target/arm/ata-sd-pp.c27
1 files changed, 6 insertions, 21 deletions
diff --git a/firmware/target/arm/ata-sd-pp.c b/firmware/target/arm/ata-sd-pp.c
index f7b4a992e4..a2dcfe518f 100644
--- a/firmware/target/arm/ata-sd-pp.c
+++ b/firmware/target/arm/ata-sd-pp.c
@@ -1190,27 +1190,6 @@ void sd_enable(bool on)
1190 } 1190 }
1191} 1191}
1192 1192
1193#ifdef HAVE_HOTSWAP
1194void card_enable_monitoring_target(bool on)
1195{
1196 if (on)
1197 {
1198#ifdef SANSA_E200
1199 GPIO_SET_BITWISE(GPIOA_INT_EN, 0x80);
1200#elif defined(SANSA_C200)
1201 GPIO_SET_BITWISE(GPIOL_INT_EN, 0x08);
1202#endif
1203 }
1204 else
1205 {
1206#ifdef SANSA_E200
1207 GPIO_CLEAR_BITWISE(GPIOA_INT_EN, 0x80);
1208#elif defined(SANSA_C200)
1209 GPIO_CLEAR_BITWISE(GPIOL_INT_EN, 0x08);
1210#endif
1211 }
1212}
1213#endif
1214 1193
1215int sd_init(void) 1194int sd_init(void)
1216{ 1195{
@@ -1275,6 +1254,9 @@ int sd_init(void)
1275 GPIOA_INT_LEV = (0x80 << 8) | (~GPIOA_INPUT_VAL & 0x80); 1254 GPIOA_INT_LEV = (0x80 << 8) | (~GPIOA_INPUT_VAL & 0x80);
1276 1255
1277 GPIOA_INT_CLR = 0x80; 1256 GPIOA_INT_CLR = 0x80;
1257
1258 /* enable the card detect interrupt */
1259 GPIO_SET_BITWISE(GPIOA_INT_EN, 0x80);
1278#elif defined SANSA_C200 1260#elif defined SANSA_C200
1279 CPU_INT_EN = HI_MASK; 1261 CPU_INT_EN = HI_MASK;
1280 CPU_HI_INT_EN = GPIO2_MASK; 1262 CPU_HI_INT_EN = GPIO2_MASK;
@@ -1282,6 +1264,9 @@ int sd_init(void)
1282 GPIOL_INT_LEV = (0x08 << 8) | (~GPIOL_INPUT_VAL & 0x08); 1264 GPIOL_INT_LEV = (0x08 << 8) | (~GPIOL_INPUT_VAL & 0x08);
1283 1265
1284 GPIOL_INT_CLR = 0x08; 1266 GPIOL_INT_CLR = 0x08;
1267
1268 /* enable the card detect interrupt */
1269 GPIO_SET_BITWISE(GPIOL_INT_EN, 0x08);
1285#endif 1270#endif
1286#endif 1271#endif
1287 } 1272 }