Ejemplo n.º 1
0
DWORD STREAM_PREFIX(Init)(DWORD InitContext)
{
    SDHCD_HW_DEVICE *pHWDevice = NULL;
     
    DBG_PRINT(SDDBG_TRACE,("_Init called  dc:0x%X \n",InitContext));
    
    do {
        
        if (!SDIO_LibraryInit()) {
            break;    
        }
        
        if (!SDIO_BusInit()) {
            SDIO_LibraryDeinit();
            DBG_PRINT(SDDBG_ERROR,("SDIO BusInit failed! \n"));
            break;  
        }
        
        pHWDevice = InitializeSPIHW((PTSTR)InitContext); 
        
        if (NULL == pHWDevice) {
            SDIO_BusDeinit();   
            SDIO_LibraryDeinit(); 
            break;
        }
        
            /* notify that SPI module is installed */
        SDIO_HandleHcdEvent(&pHWDevice->pDevice->Hcd, EVENT_HCD_ATTACH);
        
        SDIO_BusLoadClients();
        
    } while (FALSE);
        
    return (DWORD)pHWDevice;   
}
Ejemplo n.º 2
0
BOOL STREAM_PREFIX(Deinit)(DWORD DeviceContext)
{

    DBG_PRINT(SDDBG_TRACE,("_Deinit called  dc:0x%X \n",DeviceContext));
    CleanupSPIHW((SDHCD_HW_DEVICE *)DeviceContext);
    SDIO_BusDeinit();
    SDIO_LibraryDeinit();
    return TRUE;
}    
BOOL STREAM_PREFIX(Deinit)(DWORD DeviceContext)
{

    DBG_PRINT(SDDBG_TRACE,("_Deinit called  dc:0x%X \n",DeviceContext));
       
        /* unload any attached clients first */
    SDIO_BusUnloadClients();
        /* cleanup SPI HW layer, this de-registers the host controller */
    CleanupSPIHW((SDHCD_HW_DEVICE *)DeviceContext);
    SDIO_BusDeinit();
    SDIO_LibraryDeinit();
    return TRUE;
}