This thread has been locked.

If you have a related question, please click the "Ask a related question" button in the top right corner. The newly created question will be automatically linked to this question.

Issue with TPS659xx GPIO driver

 

I am using the A8 2.xx WEC7 with a 35xx platform.

All of a sudden the SDHC card detect started throwing an error at:

    // Associate event with GPIO interrupt

    if (!GPIOInterruptInitialize(m_hGPIO, m_dwCardDetectGPIO, &m_dwCDSysintr, m_hCardDetectEvent))

    {

        RETAILMSG (SDCARD_ZONE_ERROR, (L"ERROR: CSDIOController::SDHCCardDetectIstThreadImpl: Failed associate event with CD GPIO interrupt\r\n"));

        goto cleanUp;

    }

 

Digging deeper I noticed GPIOInterruptInitialize worked when I used one of the native OMAPs GPIO for card detect but it fails when I use 0x100 (256) ...which translates to GPIO 0 on the 659xx. (the standard SDHC 1 card detect).  Yes, both the TPS659xx and TPS659xx GPIO drivers are selected from the catalog.

Digging deeper yet it appears the "GIO2:", the TPS659xx GPIO driver was not loading.

Looking at tps659xx_gpio.cpp:

DWORD GIO_Init(

               LPCTSTR pContext,

               DWORD dwBusContext

               )

{

    HANDLE devCtxt;

    UINT count;

 

    UNREFERENCED_PARAMETER(dwBusContext);

 

    if (Tps659xxGpioInit(pContext,&devCtxt,&count))

    {

        if (Tps659xxGpioPostInit(devCtxt))

        {

            return (DWORD) devCtxt;

        }

    }

    return NULL;

}

 

I stepped it through and it is indeed making it through the two inner if statements but it is returning the uninitialized devCtxt value. The devCtxt never seems to be set. I guess it was returning junk so in most cases it appeared to work. In my case it is now returning zero which makes the driver fail loading.

Can you advise how to correct?  Is returning pContext instead the right solution or should it be some other context?