extern int brcmf_sdio_function_init(void);
extern void brcmf_sdio_function_cleanup(void);
-#if !defined(OOB_INTR_ONLY)
static void brcmf_sdioh_irqhandler(struct sdio_func *func);
static void brcmf_sdioh_irqhandler_f2(struct sdio_func *func);
-#endif /* !defined(OOB_INTR_ONLY) */
static int brcmf_sdioh_get_cisaddr(struct sdioh_info *sd, u32 regaddr);
extern int brcmf_sdioh_reset_comm(struct mmc_card *card);
int brcmf_sdioh_card_regread(struct sdioh_info *sd, int func, u32 regaddr,
int regsize, u32 *data);
-void brcmf_sdioh_set_host_pm_flags(int flag)
-{
- if (sdio_set_host_pm_flags(gInstance->func[1], flag))
- printk(KERN_ERR "%s: Failed to set pm_flags 0x%08x\n",\
- __func__, (unsigned int)flag);
-}
-
static int brcmf_sdioh_enablefuncs(struct sdioh_info *sd)
{
int err_ret;
return SDIOH_API_RC_SUCCESS;
}
-#if defined(OOB_INTR_ONLY) && defined(HW_OOB)
-
-extern int brcmf_sdioh_enable_func_intr(void)
-{
- u8 reg;
- int err;
-
- if (gInstance->func[0]) {
- sdio_claim_host(gInstance->func[0]);
-
- reg = sdio_readb(gInstance->func[0], SDIOD_CCCR_INTEN, &err);
- if (err) {
- sd_err(("%s: error for read SDIO_CCCR_IENx : 0x%x\n",
- __func__, err));
- sdio_release_host(gInstance->func[0]);
- return SDIOH_API_RC_FAIL;
- }
-
- /* Enable F1 and F2 interrupts, set master enable */
- reg |=
- (INTR_CTL_FUNC1_EN | INTR_CTL_FUNC2_EN |
- INTR_CTL_MASTER_EN);
-
- sdio_writeb(gInstance->func[0], reg, SDIOD_CCCR_INTEN, &err);
- sdio_release_host(gInstance->func[0]);
-
- if (err) {
- sd_err(("%s: error for write SDIO_CCCR_IENx : 0x%x\n",
- __func__, err));
- return SDIOH_API_RC_FAIL;
- }
- }
-
- return SDIOH_API_RC_SUCCESS;
-}
-
-extern int brcmf_sdioh_disable_func_intr(void)
-{
- u8 reg;
- int err;
-
- if (gInstance->func[0]) {
- sdio_claim_host(gInstance->func[0]);
- reg = sdio_readb(gInstance->func[0], SDIOD_CCCR_INTEN, &err);
- if (err) {
- sd_err(("%s: error for read SDIO_CCCR_IENx : 0x%x\n",
- __func__, err));
- sdio_release_host(gInstance->func[0]);
- return SDIOH_API_RC_FAIL;
- }
-
- reg &= ~(INTR_CTL_FUNC1_EN | INTR_CTL_FUNC2_EN);
- /* Disable master interrupt with the last function interrupt */
- if (!(reg & 0xFE))
- reg = 0;
- sdio_writeb(gInstance->func[0], reg, SDIOD_CCCR_INTEN, &err);
-
- sdio_release_host(gInstance->func[0]);
- if (err) {
- sd_err(("%s: error for write SDIO_CCCR_IENx : 0x%x\n",
- __func__, err));
- return SDIOH_API_RC_FAIL;
- }
- }
- return SDIOH_API_RC_SUCCESS;
-}
-#endif /* defined(OOB_INTR_ONLY) && defined(HW_OOB) */
-
/* Configure callback to client when we receive client interrupt */
extern int
brcmf_sdioh_interrupt_register(struct sdioh_info *sd, sdioh_cb_fn_t fn,
__func__));
return SDIOH_API_RC_FAIL;
}
-#if !defined(OOB_INTR_ONLY)
+
sd->intr_handler = fn;
sd->intr_handler_arg = argh;
sd->intr_handler_valid = true;
sdio_claim_irq(gInstance->func[1], brcmf_sdioh_irqhandler);
sdio_release_host(gInstance->func[1]);
}
-#elif defined(HW_OOB)
- brcmf_sdioh_enable_func_intr();
-#endif /* defined(OOB_INTR_ONLY) */
+
return SDIOH_API_RC_SUCCESS;
}
{
sd_trace(("%s: Entering\n", __func__));
-#if !defined(OOB_INTR_ONLY)
if (gInstance->func[1]) {
/* register and unmask irq */
sdio_claim_host(gInstance->func[1]);
sd->intr_handler_valid = false;
sd->intr_handler = NULL;
sd->intr_handler_arg = NULL;
-#elif defined(HW_OOB)
- brcmf_sdioh_disable_func_intr();
-#endif /* !defined(OOB_INTR_ONLY) */
+
return SDIOH_API_RC_SUCCESS;
}
return SDIOH_API_RC_SUCCESS;
}
-#if defined(DHD_DEBUG)
+#if defined(BCMDBG)
extern bool brcmf_sdioh_interrupt_pending(struct sdioh_info *sd)
{
return 0;
size) */
{"sd_ints", IOV_USEINTS, 0, IOVT_BOOL, 0},
{"sd_numints", IOV_NUMINTS, 0, IOVT_UINT32, 0},
- {"sd_devreg", IOV_DEVREG, 0, IOVT_BUFFER, sizeof(sdreg_t)}
+ {"sd_devreg", IOV_DEVREG, 0, IOVT_BUFFER, sizeof(struct brcmf_sdreg)}
,
{"sd_rxchain", IOV_RXCHAIN, 0, IOVT_BOOL, 0}
,
case IOV_GVAL(IOV_DEVREG):
{
- sdreg_t *sd_ptr = (sdreg_t *) params;
+ struct brcmf_sdreg *sd_ptr =
+ (struct brcmf_sdreg *) params;
u8 data = 0;
if (brcmf_sdioh_cfg_read
case IOV_SVAL(IOV_DEVREG):
{
- sdreg_t *sd_ptr = (sdreg_t *) params;
+ struct brcmf_sdreg *sd_ptr =
+ (struct brcmf_sdreg *) params;
u8 data = (u8) sd_ptr->value;
if (brcmf_sdioh_cfg_write
return bcmerror;
}
-#if defined(OOB_INTR_ONLY) && defined(HW_OOB)
-
-int brcmf_sdioh_enable_hw_oob_intr(struct sdioh_info *sd, bool enable)
-{
- int status;
- u8 data;
-
- if (enable)
- data = 3; /* enable hw oob interrupt */
- else
- data = 4; /* disable hw oob interrupt */
- data |= 4; /* Active HIGH */
-
- status = brcmf_sdioh_request_byte(sd, SDIOH_WRITE, 0, 0xf2, &data);
- return status;
-}
-#endif /* defined(OOB_INTR_ONLY) && defined(HW_OOB) */
-
extern int
brcmf_sdioh_cfg_read(struct sdioh_info *sd, uint fnc_num, u32 addr, u8 *data)
{
sdio_release_host(gInstance->func[2]);
}
}
-#if defined(MMC_SDIO_ABORT)
/* to allow abort command through F1 */
else if (regaddr == SDIO_CCCR_ABORT) {
sdio_claim_host(gInstance->func[func]);
regaddr, &err_ret);
sdio_release_host(gInstance->func[func]);
}
-#endif /* MMC_SDIO_ABORT */
else if (regaddr < 0xF0) {
sd_err(("bcmsdh_sdmmc: F0 Wr:0x%02x: write "
"disallowed\n", regaddr));
pkt_len += 3;
pkt_len &= 0xFFFFFFFC;
-#ifdef CONFIG_MMC_MSM7X00A
- if ((pkt_len % 64) == 32) {
- sd_trace(("%s: Rounding up TX packet +=32\n",
- __func__));
- pkt_len += 32;
- }
-#endif /* CONFIG_MMC_MSM7X00A */
/* Make sure the packet is aligned properly.
* If it isn't, then this
* is the fault of brcmf_sdioh_request_buffer() which
/* this function performs "abort" for both of host & device */
extern int brcmf_sdioh_abort(struct sdioh_info *sd, uint func)
{
-#if defined(MMC_SDIO_ABORT)
char t_func = (char)func;
-#endif /* defined(MMC_SDIO_ABORT) */
sd_trace(("%s: Enter\n", __func__));
-#if defined(MMC_SDIO_ABORT)
/* issue abort cmd52 command through F0 */
brcmf_sdioh_request_byte(sd, SDIOH_WRITE, SDIO_FUNC_0, SDIO_CCCR_ABORT,
&t_func);
-#endif /* defined(MMC_SDIO_ABORT) */
sd_trace(("%s: Exit\n", __func__));
return SDIOH_API_RC_SUCCESS;
return SUCCESS;
}
-#if !defined(OOB_INTR_ONLY)
/* bcmsdh_sdmmc interrupt handler */
static void brcmf_sdioh_irqhandler(struct sdio_func *func)
{
ASSERT(sd != NULL);
}
-#endif /* !defined(OOB_INTR_ONLY) */
-
-#ifdef NOTUSED
-/* Write client card reg */
-static int
-brcmf_sdioh_card_regwrite(struct sdioh_info *sd, int func, u32 regaddr,
- int regsize, u32 data)
-{
-
- if ((func == 0) || (regsize == 1)) {
- u8 temp;
-
- temp = data & 0xff;
- brcmf_sdioh_request_byte(sd, SDIOH_READ, func, regaddr, &temp);
- sd_data(("%s: byte write data=0x%02x\n", __func__, data));
- } else {
- if (regsize == 2)
- data &= 0xffff;
-
- brcmf_sdioh_request_word(sd, 0, SDIOH_READ, func, regaddr,
- &data, regsize);
-
- sd_data(("%s: word write data=0x%08x\n", __func__, data));
- }
-
- return SUCCESS;
-}
-#endif /* NOTUSED */
int brcmf_sdioh_start(struct sdioh_info *si, int stage)
{