Merge "WLAN: WCN1314: Add API to enable/disable interrupts from chip." into msm-3.0
This commit is contained in:
committed by
QuIC Gerrit Code Review
commit
f4635f606f
@@ -29,6 +29,37 @@ static unsigned short libra_sdio_card_id;
|
||||
static suspend_handler_t *libra_suspend_hldr;
|
||||
static resume_handler_t *libra_resume_hldr;
|
||||
|
||||
int libra_enable_sdio_irq_in_chip(struct sdio_func *func, u8 enable)
|
||||
{
|
||||
unsigned char reg = 0;
|
||||
int err = 0;
|
||||
|
||||
sdio_claim_host(func);
|
||||
|
||||
/* Read the value into reg */
|
||||
libra_sdiocmd52(func, SDIO_CCCR_IENx, ®, 0, &err);
|
||||
if (err)
|
||||
printk(KERN_ERR "%s: Could not read SDIO_CCCR_IENx register "
|
||||
"err=%d\n", __func__, err);
|
||||
|
||||
if (libra_mmc_host) {
|
||||
if (enable) {
|
||||
reg |= 1 << func->num;
|
||||
reg |= 1;
|
||||
} else {
|
||||
reg &= ~(1 << func->num);
|
||||
}
|
||||
libra_sdiocmd52(func, SDIO_CCCR_IENx, ®, 1, &err);
|
||||
if (err)
|
||||
printk(KERN_ERR "%s: Could not enable/disable irq "
|
||||
"err=%d\n", __func__, err);
|
||||
}
|
||||
sdio_release_host(func);
|
||||
|
||||
return err;
|
||||
}
|
||||
EXPORT_SYMBOL(libra_enable_sdio_irq_in_chip);
|
||||
|
||||
/**
|
||||
* libra_sdio_configure() - Function to configure the SDIO device param
|
||||
* @libra_sdio_rxhandler Rx handler
|
||||
@@ -89,6 +120,8 @@ int libra_sdio_configure(sdio_irq_handler_t libra_sdio_rxhandler,
|
||||
goto cfg_error;
|
||||
}
|
||||
|
||||
libra_enable_sdio_irq_in_chip(func, 0);
|
||||
|
||||
sdio_release_host(func);
|
||||
|
||||
return 0;
|
||||
|
||||
@@ -35,6 +35,7 @@
|
||||
typedef int (suspend_handler_t)(struct sdio_func *);
|
||||
typedef void (resume_handler_t)(struct sdio_func *);
|
||||
|
||||
int libra_enable_sdio_irq_in_chip(struct sdio_func *func, u8 enable);
|
||||
int libra_sdio_configure(sdio_irq_handler_t libra_sdio_rxhandler,
|
||||
void (*func_drv_fn)(int *status),
|
||||
u32 funcdrv_timeout, u32 blksize);
|
||||
|
||||
Reference in New Issue
Block a user