diff --git a/ipc.h b/ipc.h index bb3ca77..1071f08 100644 --- a/ipc.h +++ b/ipc.h @@ -77,6 +77,7 @@ Copyright (C) 2009 John Kelley // etc. #define IPC_SDHC_DISCOVER 0x0000 +#define IPC_SDHC_EXIT 0x0001 #define IPC_SDMMC_ACK 0x0000 #define IPC_SDMMC_READ 0x0001 diff --git a/sdhc.c b/sdhc.c index 336c0a3..5b072d9 100644 --- a/sdhc.c +++ b/sdhc.c @@ -1033,6 +1033,14 @@ void sdhc_init(void) // sdhc_host_found(&__softc, 0, 0x0d080000, 1); } +void sdhc_exit(void) +{ +#ifdef CAN_HAZ_IRQ + irq_disable(IRQ_SDHC); +#endif + sdhc_shutdown(&__softc); +} + #ifdef CAN_HAZ_IPC void sdhc_ipc(volatile ipc_request *req) { @@ -1040,6 +1048,9 @@ void sdhc_ipc(volatile ipc_request *req) case IPC_SDHC_DISCOVER: sdmmc_needs_discover((struct device *)req->args[0]); break; + case IPC_SDHC_EXIT: + sdhc_exit(); + ipc_post(req->code, req->tag, 0); } } #endif diff --git a/sdhcvar.h b/sdhcvar.h index d098a58..3398d09 100644 --- a/sdhcvar.h +++ b/sdhcvar.h @@ -57,6 +57,7 @@ void sdhc_power(int, void *); void sdhc_shutdown(void *); int sdhc_intr(void *); void sdhc_init(void); +void sdhc_exit(void); void sdhc_irq(void); #ifdef CAN_HAZ_IPC void sdhc_ipc(volatile ipc_request *req);