Exemplo n.º 1
0
/* Protect against reentrancy (disable device interrupts while executing) */
void
spi_lock(sdioh_info_t *sd)
{
    ulong flags;
    struct sdos_info *sdos;

    sdos = (struct sdos_info *)sd->sdos_info;
    ASSERT(sdos);

    sd_trace(("%s: %d\n", __FUNCTION__, sd->lockcount));

    spin_lock_irqsave(&sdos->lock, flags);
    if (sd->lockcount) {
        sd_err(("%s: Already locked!\n", __FUNCTION__));
        ASSERT(sd->lockcount == 0);
    }
#ifdef BCMSPI_ANDROID
    if (sd->client_intr_enabled)
        bcmsdh_oob_intr_set(0);
#else
    spi_devintr_off(sd);
#endif /* BCMSPI_ANDROID */
    sd->lockcount++;
    spin_unlock_irqrestore(&sdos->lock, flags);
}
Exemplo n.º 2
0
static int wifi_suspend(struct platform_device *pdev, pm_message_t state)
{
	DHD_TRACE(("##> %s\n", __FUNCTION__));
#if defined(OOB_INTR_ONLY)
	bcmsdh_oob_intr_set(0);
#endif /* (OOB_INTR_ONLY) */
	return 0;
}
Exemplo n.º 3
0
static int wifi_suspend(struct platform_device *pdev, pm_message_t state)
{
	DBG_871X("##> %s\n", __FUNCTION__);
#if (LINUX_VERSION_CODE <= KERNEL_VERSION(2, 6, 39)) && defined(OOB_INTR_ONLY)
	bcmsdh_oob_intr_set(0);
#endif
	return 0;
}
Exemplo n.º 4
0
static int wifi_resume(struct platform_device *pdev)
{
	DHD_TRACE(("##> %s\n", __FUNCTION__));
#if defined(OOB_INTR_ONLY)
	bcmsdh_oob_intr_set(1);
#endif /* (OOB_INTR_ONLY) */
	return 0;
}
Exemplo n.º 5
0
static int wifi_resume(struct platform_device *pdev)
{
	DHD_TRACE(("##> %s\n", __FUNCTION__));
#if defined(OOB_INTR_ONLY)
	if (dhd_os_check_if_up(bcmsdh_get_drvdata()))
		bcmsdh_oob_intr_set(1);
#endif /* (OOB_INTR_ONLY) */
	return 0;
}
Exemplo n.º 6
0
static int wifi_plat_dev_drv_resume(struct platform_device *pdev)
{
	DHD_TRACE(("##> %s\n", __FUNCTION__));
#if (LINUX_VERSION_CODE <= KERNEL_VERSION(2, 6, 39)) && defined(OOB_INTR_ONLY)
	if (dhd_os_check_if_up(wl_cfg80211_get_dhdp()))
		bcmsdh_oob_intr_set(1);
#endif /* (OOB_INTR_ONLY) */
	return 0;
}
Exemplo n.º 7
0
static int wifi_plat_dev_drv_suspend(struct platform_device *pdev, pm_message_t state)
{
	DHD_TRACE(("##> %s\n", __FUNCTION__));
#if (LINUX_VERSION_CODE <= KERNEL_VERSION(2, 6, 39)) && defined(OOB_INTR_ONLY) && \
	defined(BCMSDIO)
	bcmsdh_oob_intr_set(0);
#endif /* (OOB_INTR_ONLY) */
	return 0;
}
Exemplo n.º 8
0
static int wifi_resume(struct platform_device *pdev)
{
	DBG_871X("##> %s\n", __FUNCTION__);
#if (LINUX_VERSION_CODE <= KERNEL_VERSION(2, 6, 39)) && defined(OOB_INTR_ONLY)
	if (dhd_os_check_if_up(bcmsdh_get_drvdata()))
		bcmsdh_oob_intr_set(1);
#endif
	return 0;
}
static irqreturn_t wlan_oob_irq(int irq, void *dev_id)
{
	bcmsdh_info_t *bcmsdh = (bcmsdh_info_t *)dev_id;
	bcmsdh_os_info_t *bcmsdh_osinfo = bcmsdh->os_cxt;

	bcmsdh_oob_intr_set(bcmsdh, FALSE);
	bcmsdh_osinfo->oob_irq_handler(bcmsdh_osinfo->oob_irq_handler_context);

	return IRQ_HANDLED;
}
Exemplo n.º 10
0
static int bcmsdh_sdmmc_suspend(struct device *pdev)
{
	struct sdio_func *func = dev_to_sdio_func(pdev);
	mmc_pm_flag_t sdio_flags;
	int ret = 0;

	if (func->num != 2)
		return 0;

	sd_trace(("%s Enter\n", __FUNCTION__));

	if (dhd_os_check_wakelock(bcmsdh_get_drvdata()))
		return -EBUSY;


	sdio_flags = sdio_get_host_pm_caps(func);

	if (!(sdio_flags & MMC_PM_KEEP_POWER)) {
		sd_err(("%s: can't keep power while host is suspended\n", __FUNCTION__));
		return  -EINVAL;
	}

	/* keep power while host suspended */
	ret = sdio_set_host_pm_flags(func, MMC_PM_KEEP_POWER);
	if (ret) {
		sd_err(("%s: error while trying to keep power\n", __FUNCTION__));
		return ret;
	}

#if defined(OOB_INTR_ONLY)
	bcmsdh_oob_intr_set(0);
#endif /* defined(OOB_INTR_ONLY) */

	sdio_flags = sdio_get_host_pm_caps(func);

	if (!(sdio_flags & MMC_PM_KEEP_POWER)) {
		sd_err(("can't keep power while host "
				"is suspended\n", __FUNCTION__));
		ret = -EINVAL;
		goto out;
	}

	/* keep power while host suspended */
	ret = sdio_set_host_pm_flags(func, MMC_PM_KEEP_POWER);
	if (ret) {
		sd_err(("error while trying to keep power\n", __FUNCTION__));
		goto out;
	}

	dhd_mmc_suspend = TRUE;
	smp_mb();

out:
	return ret;
}
Exemplo n.º 11
0
static irqreturn_t wlan_oob_irq(int irq, void *dev_id)
{
	bcmsdh_info_t *bcmsdh = (bcmsdh_info_t *)dev_id;
	bcmsdh_os_info_t *bcmsdh_osinfo = bcmsdh->os_cxt;

#ifndef BCMSPI_ANDROID
	bcmsdh_oob_intr_set(bcmsdh, FALSE);
#endif /* !BCMSPI_ANDROID */
	bcmsdh_osinfo->oob_irq_handler(bcmsdh_osinfo->oob_irq_handler_context);

	return IRQ_HANDLED;
}
static int wifi_suspend(struct platform_device *pdev, pm_message_t state)
{
	ANDROID_TRACE(("##> %s\n", __FUNCTION__));
#if defined(CONFIG_ARCH_RHEA) || defined(CONFIG_ARCH_CAPRI)
	if (dhd_os_check_wakelock(bcmsdh_get_drvdata()))
		return -EBUSY;
#endif /* defined(CONFIG_ARCH_RHEA) || defined(CONFIG_ARCH_CAPRI) */
#if (LINUX_VERSION_CODE <= KERNEL_VERSION(2, 6, 39)) && defined(OOB_INTR_ONLY) && 1
	bcmsdh_oob_intr_set(0);
#endif /* (OOB_INTR_ONLY) */
	return 0;
}
Exemplo n.º 13
0
static int bcmsdh_sdmmc_resume(struct device *pdev)
{
#if defined(OOB_INTR_ONLY)
	struct sdio_func *func = dev_to_sdio_func(pdev);
#endif
	sd_trace(("%s Enter\n", __FUNCTION__));
	dhd_mmc_suspend = FALSE;
#if defined(OOB_INTR_ONLY)
	if ((func->num == 2) && dhd_os_check_if_up(bcmsdh_get_drvdata()))
		bcmsdh_oob_intr_set(1);
#endif
	smp_mb();
	return 0;
}
static int bcmsdh_sdmmc_resume(struct device *pdev)
{
	struct sdio_func *func = dev_to_sdio_func(pdev);

	if (func->num != 2)
		return 0;
	dhd_mmc_suspend = FALSE;
#if defined(OOB_INTR_ONLY)
	if (dhd_os_check_if_up(bcmsdh_get_drvdata()))
		bcmsdh_oob_intr_set(1);
#endif
	smp_mb();
	return 0;
}
static int bcmsdh_sdmmc_suspend(struct device *pdev)
{
	struct sdio_func *func = dev_to_sdio_func(pdev);

	if (func->num != 2)
		return 0;
	if (dhd_os_check_wakelock(bcmsdh_get_drvdata()))
		return -EBUSY;
#if defined(OOB_INTR_ONLY)
	bcmsdh_oob_intr_set(0);
#endif
	dhd_mmc_suspend = TRUE;
	smp_mb();

	return 0;
}
static int bcmsdh_sdmmc_suspend(struct device *pdev)
{
	int err;
	sdioh_info_t *sdioh;
	struct sdio_func *func = dev_to_sdio_func(pdev);
	mmc_pm_flag_t sdio_flags;

	sd_err(("%s +\n", __FUNCTION__));
	if (func->num != 2)
		return 0;

	sdioh = sdio_get_drvdata(func);
	err = bcmsdh_suspend(sdioh->bcmsdh);
	if (err){
		sd_err(("%s -\n", __FUNCTION__));
		return err;
	}

	sdio_flags = sdio_get_host_pm_caps(func);
	if (!(sdio_flags & MMC_PM_KEEP_POWER)) {
		sd_err(("%s: can't keep power while host is suspended\n", __FUNCTION__));
		sd_err(("%s -\n", __FUNCTION__));
		return  -EINVAL;
	}

	/* keep power while host suspended */
	err = sdio_set_host_pm_flags(func, MMC_PM_KEEP_POWER);
	if (err) {
		sd_err(("%s: error while trying to keep power\n", __FUNCTION__));
		sd_err(("%s -\n", __FUNCTION__));
		return err;
	}
#if defined(OOB_INTR_ONLY)
#ifndef HW_WIFI_OOB_INT_SET
	bcmsdh_oob_intr_set(sdioh->bcmsdh, FALSE);
#endif
#endif
	dhd_mmc_suspend = TRUE;
#ifdef HW_WIFI_WAKEUP_SRC_PARSE
	g_wifi_firstwake = TRUE;
#endif

	smp_mb();
	sd_err(("%s -\n", __FUNCTION__));

	return 0;
}
Exemplo n.º 17
0
static irqreturn_t wlan_oob_irq(int irq, void *dev_id)
{
	dhd_pub_t *dhdp;

	dhdp = (dhd_pub_t *) dev_get_drvdata(sdhcinfo->dev);

	bcmsdh_oob_intr_set(0);

	if (dhdp == NULL) {
		SDLX_MSG(("Out of band GPIO interrupt fired way too early\n"));
		return IRQ_HANDLED;
	}

	WAKE_LOCK_TIMEOUT(dhdp, WAKE_LOCK_TMOUT, 25);

	dhdsdio_isr((void *)dhdp->bus);

	return IRQ_HANDLED;
}
Exemplo n.º 18
0
static int bcmsdh_sdmmc_suspend(struct device *pdev)
{
	int err;
	sdioh_info_t *sdioh;
	struct sdio_func *func = dev_to_sdio_func(pdev);
	mmc_pm_flag_t sdio_flags;

	sd_err(("%s Enter\n", __FUNCTION__));
	if (func->num != 2)
		return 0;

	dhd_mmc_suspend = TRUE;
	sdioh = sdio_get_drvdata(func);
	err = bcmsdh_suspend(sdioh->bcmsdh);
	if (err) {
		dhd_mmc_suspend = FALSE;
		return err;
	}

	sdio_flags = sdio_get_host_pm_caps(func);
	if (!(sdio_flags & MMC_PM_KEEP_POWER)) {
		sd_err(("%s: can't keep power while host is suspended\n", __FUNCTION__));
		dhd_mmc_suspend = FALSE;
		return  -EINVAL;
	}

	/* keep power while host suspended */
	err = sdio_set_host_pm_flags(func, MMC_PM_KEEP_POWER);
	if (err) {
		sd_err(("%s: error while trying to keep power\n", __FUNCTION__));
		dhd_mmc_suspend = FALSE;
		return err;
	}
#if defined(OOB_INTR_ONLY) && !defined(CUSTOMER_HW4)
	bcmsdh_oob_intr_set(sdioh->bcmsdh, FALSE);
#endif /* OOB_INTR_ONLY && !CUSTOMER_HW4 */
	smp_mb();

	return 0;
}
Exemplo n.º 19
0
/* Enable client interrupt */
void
spi_unlock(sdioh_info_t *sd)
{
    ulong flags;
    struct sdos_info *sdos;

    sd_trace(("%s: %d, %d\n", __FUNCTION__, sd->lockcount, sd->client_intr_enabled));
    ASSERT(sd->lockcount > 0);

    sdos = (struct sdos_info *)sd->sdos_info;
    ASSERT(sdos);

    spin_lock_irqsave(&sdos->lock, flags);
    if (--sd->lockcount == 0 && sd->client_intr_enabled) {
#ifdef BCMSPI_ANDROID
        bcmsdh_oob_intr_set(1);
#else
        spi_devintr_on(sd);
#endif /* BCMSPI_ANDROID */
    }
    spin_unlock_irqrestore(&sdos->lock, flags);
}