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;
}
コード例 #2
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;
}
コード例 #3
0
static int bcmsdh_sdmmc_suspend(struct sdio_func *func, pm_message_t state)
{
	if (func->num == 1) bcmsdh_suspend(&sdmmc_dev);
	return 0;
}