Hi Alecrim ,
Following is experience of SDIO I know. The office SDIO stack appear at 2.6.24 and the libertas driver used.
The SD/SDIO host driver (ex. omap_hsmmc.c or pxamci.c) need to declare the host has SDIO capacity and add enable/disable SDIO card interrupt function.
And the host driver need to take care the SDIO interrupt in Interrupt handler.
Basically the office SDIO stack using polling that make the non-SDIO host work with SDIO peripheral. But the performance always bad but work.
------------------------------------------------
mmc->caps |= MMC_CAP_SDIO_IRQ; // declare SDIO capacity
------------------------------------------------
#define CIRQ_ENABLE (1<<8) // The enable/disable SDIO irq function for SDIO stack
static void omap_hsmmc_enable_sdio_irq(struct mmc_host *host, int enable)
{
struct mmc_omap_host *host = mmc_priv(host);
unsigned long flags;
u32 reg;
reg = INT_EN_MASK;
reg &= ~CIRQ_ENABLE;
if (enable)
reg |= CIRQ_ENABLE;
OMAP_HSMMC_WRITE(host->base, ISE, reg);
OMAP_HSMMC_WRITE(host->base, IE, reg);
mmiowb();
}
static struct mmc_host_ops mmc_omap_ops = {
.request = omap_mmc_request,
.set_ios = omap_mmc_set_ios,
.enable_sdio_irq = omap_hsmmc_enable_sdio_irq,
};
------------------------------------------------
static irqreturn_t mmc_omap_irq(int irq, void *dev_id) // the modified part of irq handler
{
......
if (status & (CIRQ_ENABLE)) {
printk("MMC: Card Interrupt.\n");
mmc_signal_sdio_irq(host->mmc);
}
return IRQ_HANDLED;
}
------------------------------------------------
Claud Yu