mxc_mmc_force_detect usage

cancel
Showing results for 
Show  only  | Search instead for 
Did you mean: 

mxc_mmc_force_detect usage

370 Views
bdp42
Contributor IV

Hi,

We have an IMX53 based platform running Android Gingerbread, Linux kernel 2.6.35.

I'm trying to force the mmc stack to detect and process the removal and insertion of an SDIO card via a software mechanism as opposed to a hardware mechanism.

It looked like the function mxc_mmc_force_detect was doing just that and would forcing the card detect handler to run and detect the presence/absence of the card. It does not appear to work as I expected.

void mxc_mmc_force_detect(int id)

{

    struct sdhci_host *host;

    if ((id < 0) || (id >= MXC_SDHCI_NUM))

        return;

    if (!mxc_fix_chips[id])

        return;

    host = mxc_fix_chips[id]->hosts[0];

    if (host->detect_irq)

        return;

    schedule_work(&host->cd_wq);

    return;

}

When the function is called, mxc_fix_chips[id] is zero and so it simply returns at this point. Secondly host->detect_irq is non zero and so it would also return here.

So it looks like this only schedules the handler when in a certain state. Can anyone explain what this function does and when it should be called? Is this the appropriate function to achieve what I want or is there another way to do this?

Thanks,

Bruno

Labels (3)
0 Kudos
0 Replies