struct sdhci_pltfm_host *pltfm_host = sdhci_priv(sdhci);
struct sdhci_tegra *tegra_host = pltfm_host->priv;
int err = 0;
+ struct platform_device *pdev = to_platform_device(mmc_dev(sdhci->mmc));
+ const struct tegra_sdhci_platform_data *plat;
+ unsigned int cd_irq;
tegra_sdhci_set_clock(sdhci, 0);
dev_err(mmc_dev(sdhci->mmc),
"Regulators disable in suspend failed %d\n", err);
}
+ plat = pdev->dev.platform_data;
+ if (plat && gpio_is_valid(plat->cd_gpio)) {
+ if (!plat->cd_wakeup_incapable) {
+ /* Enable wake irq at end of suspend */
+ cd_irq = gpio_to_irq(plat->cd_gpio);
+ err = enable_irq_wake(cd_irq);
+ if (err < 0)
+ dev_err(mmc_dev(sdhci->mmc),
+ "SD card wake-up event registration for irq=%d failed with error: %d\n",
+ cd_irq, err);
+ }
+ }
return err;
}
struct tegra_sdhci_platform_data *plat;
unsigned int signal_voltage = 0;
int err;
+ unsigned int cd_irq;
pdev = to_platform_device(mmc_dev(sdhci->mmc));
plat = pdev->dev.platform_data;
- if (gpio_is_valid(plat->cd_gpio)) {
+ if (plat && gpio_is_valid(plat->cd_gpio)) {
+ /* disable wake capability at start of resume */
+ if (!plat->cd_wakeup_incapable) {
+ cd_irq = gpio_to_irq(plat->cd_gpio);
+ disable_irq_wake(cd_irq);
+ }
tegra_host->card_present =
(gpio_get_value_cansleep(plat->cd_gpio) == 0);
}
return err;
}
if (tegra_host->vdd_io_reg) {
- if (plat->mmc_data.ocr_mask & SDHOST_1V8_OCR_MASK)
+ if (plat && (plat->mmc_data.ocr_mask & SDHOST_1V8_OCR_MASK))
signal_voltage = MMC_SIGNAL_VOLTAGE_180;
else
signal_voltage = MMC_SIGNAL_VOLTAGE_330;
dev_err(mmc_dev(host->mmc), "request irq error\n");
goto err_cd_irq_req;
}
- if (!plat->cd_wakeup_incapable) {
- rc = enable_irq_wake(gpio_to_irq(plat->cd_gpio));
- if (rc < 0)
- dev_err(mmc_dev(host->mmc),
- "SD card wake-up event registration "
- "failed with error: %d\n", rc);
- }
}
sdhci_tegra_error_stats_debugfs(host);
device_create_file(&pdev->dev, &dev_attr_cmd_state);
sdhci_remove_host(host, dead);
- disable_irq_wake(gpio_to_irq(plat->cd_gpio));
-
rc = tegra_sdhci_configure_regulators(tegra_host, CONFIG_REG_DIS, 0, 0);
if (rc)
dev_err(mmc_dev(host->mmc),