summaryrefslogtreecommitdiff
path: root/firmware/target/arm/as3525/sd-as3525v2.c
diff options
context:
space:
mode:
Diffstat (limited to 'firmware/target/arm/as3525/sd-as3525v2.c')
-rw-r--r--firmware/target/arm/as3525/sd-as3525v2.c20
1 files changed, 10 insertions, 10 deletions
diff --git a/firmware/target/arm/as3525/sd-as3525v2.c b/firmware/target/arm/as3525/sd-as3525v2.c
index 2f263f7378..65fc13feae 100644
--- a/firmware/target/arm/as3525/sd-as3525v2.c
+++ b/firmware/target/arm/as3525/sd-as3525v2.c
@@ -342,6 +342,7 @@ static volatile bool retry;
342 342
343#if defined(HAVE_MULTIDRIVE) 343#if defined(HAVE_MULTIDRIVE)
344int active_card = 0; 344int active_card = 0;
345#define EXT_SD_BITS (1<<2)
345#endif 346#endif
346 347
347static inline void mci_delay(void) { udelay(1000); } 348static inline void mci_delay(void) { udelay(1000); }
@@ -687,14 +688,12 @@ int sd_init(void)
687 wakeup_init(&transfer_completion_signal); 688 wakeup_init(&transfer_completion_signal);
688 689
689#ifdef HAVE_MULTIDRIVE 690#ifdef HAVE_MULTIDRIVE
690 /* setup isr for microsd monitoring */
691 VIC_INT_ENABLE = (INTERRUPT_GPIOA);
692 /* clear previous irq */ 691 /* clear previous irq */
693 GPIOA_IC = (1<<2); 692 GPIOA_IC = EXT_SD_BITS;
694 /* enable edge detecting */ 693 /* enable edge detecting */
695 GPIOA_IS &= ~(1<<2); 694 GPIOA_IS &= ~EXT_SD_BITS;
696 /* detect both raising and falling edges */ 695 /* detect both raising and falling edges */
697 GPIOA_IBE |= (1<<2); 696 GPIOA_IBE |= EXT_SD_BITS;
698 /* Configure XPD for SD-MCI interface */ 697 /* Configure XPD for SD-MCI interface */
699 CCU_IO |= (1<<2); 698 CCU_IO |= (1<<2);
700#endif 699#endif
@@ -961,20 +960,21 @@ static int sd1_oneshot_callback(struct timeout *tmo)
961 return 0; 960 return 0;
962} 961}
963 962
964void INT_GPIOA(void) 963void sd_gpioa_isr(void)
965{ 964{
966 static struct timeout sd1_oneshot; 965 static struct timeout sd1_oneshot;
966 if (GPIOA_MIS & EXT_SD_BITS)
967 timeout_register(&sd1_oneshot, sd1_oneshot_callback, (3*HZ/10), 0);
967 /* acknowledge interrupt */ 968 /* acknowledge interrupt */
968 GPIOA_IC = (1<<2); 969 GPIOA_IC = EXT_SD_BITS;
969 timeout_register(&sd1_oneshot, sd1_oneshot_callback, (3*HZ/10), 0);
970} 970}
971 971
972void card_enable_monitoring_target(bool on) 972void card_enable_monitoring_target(bool on)
973{ 973{
974 if (on) /* enable interrupt */ 974 if (on) /* enable interrupt */
975 GPIOA_IE |= (1<<2); 975 GPIOA_IE |= EXT_SD_BITS;
976 else /* disable interrupt */ 976 else /* disable interrupt */
977 GPIOA_IE &= ~(1<<2); 977 GPIOA_IE &= ~EXT_SD_BITS;
978} 978}
979#endif /* HAVE_HOTSWAP */ 979#endif /* HAVE_HOTSWAP */
980 980