|
@@ -1273,48 +1273,6 @@ void mmc_set_driver_type(struct mmc_host *host, unsigned int drv_type)
|
|
|
mmc_host_clk_release(host);
|
|
|
}
|
|
|
|
|
|
-static void mmc_poweroff_notify(struct mmc_host *host)
|
|
|
-{
|
|
|
- struct mmc_card *card;
|
|
|
- unsigned int timeout;
|
|
|
- unsigned int notify_type = EXT_CSD_NO_POWER_NOTIFICATION;
|
|
|
- int err = 0;
|
|
|
-
|
|
|
- card = host->card;
|
|
|
- mmc_claim_host(host);
|
|
|
-
|
|
|
- /*
|
|
|
- * Send power notify command only if card
|
|
|
- * is mmc and notify state is powered ON
|
|
|
- */
|
|
|
- if (card && mmc_card_mmc(card) &&
|
|
|
- (card->poweroff_notify_state == MMC_POWERED_ON)) {
|
|
|
-
|
|
|
- if (host->power_notify_type == MMC_HOST_PW_NOTIFY_SHORT) {
|
|
|
- notify_type = EXT_CSD_POWER_OFF_SHORT;
|
|
|
- timeout = card->ext_csd.generic_cmd6_time;
|
|
|
- card->poweroff_notify_state = MMC_POWEROFF_SHORT;
|
|
|
- } else {
|
|
|
- notify_type = EXT_CSD_POWER_OFF_LONG;
|
|
|
- timeout = card->ext_csd.power_off_longtime;
|
|
|
- card->poweroff_notify_state = MMC_POWEROFF_LONG;
|
|
|
- }
|
|
|
-
|
|
|
- err = mmc_switch(card, EXT_CSD_CMD_SET_NORMAL,
|
|
|
- EXT_CSD_POWER_OFF_NOTIFICATION,
|
|
|
- notify_type, timeout);
|
|
|
-
|
|
|
- if (err && err != -EBADMSG)
|
|
|
- pr_err("Device failed to respond within %d poweroff "
|
|
|
- "time. Forcefully powering down the device\n",
|
|
|
- timeout);
|
|
|
-
|
|
|
- /* Set the card state to no notification after the poweroff */
|
|
|
- card->poweroff_notify_state = MMC_NO_POWER_NOTIFICATION;
|
|
|
- }
|
|
|
- mmc_release_host(host);
|
|
|
-}
|
|
|
-
|
|
|
/*
|
|
|
* Apply power to the MMC stack. This is a two-stage process.
|
|
|
* First, we enable power to the card without the clock running.
|
|
@@ -1377,8 +1335,6 @@ static void mmc_power_up(struct mmc_host *host)
|
|
|
|
|
|
void mmc_power_off(struct mmc_host *host)
|
|
|
{
|
|
|
- int err = 0;
|
|
|
-
|
|
|
if (host->ios.power_mode == MMC_POWER_OFF)
|
|
|
return;
|
|
|
|
|
@@ -1387,22 +1343,6 @@ void mmc_power_off(struct mmc_host *host)
|
|
|
host->ios.clock = 0;
|
|
|
host->ios.vdd = 0;
|
|
|
|
|
|
- /*
|
|
|
- * For eMMC 4.5 device send AWAKE command before
|
|
|
- * POWER_OFF_NOTIFY command, because in sleep state
|
|
|
- * eMMC 4.5 devices respond to only RESET and AWAKE cmd
|
|
|
- */
|
|
|
- if (host->card && mmc_card_is_sleep(host->card) &&
|
|
|
- host->bus_ops->resume) {
|
|
|
- err = host->bus_ops->resume(host);
|
|
|
-
|
|
|
- if (!err)
|
|
|
- mmc_poweroff_notify(host);
|
|
|
- else
|
|
|
- pr_warning("%s: error %d during resume "
|
|
|
- "(continue with poweroff sequence)\n",
|
|
|
- mmc_hostname(host), err);
|
|
|
- }
|
|
|
|
|
|
/*
|
|
|
* Reset ocr mask to be the highest possible voltage supported for
|
|
@@ -2579,7 +2519,6 @@ int mmc_pm_notify(struct notifier_block *notify_block,
|
|
|
|
|
|
spin_lock_irqsave(&host->lock, flags);
|
|
|
host->rescan_disable = 1;
|
|
|
- host->power_notify_type = MMC_HOST_PW_NOTIFY_SHORT;
|
|
|
spin_unlock_irqrestore(&host->lock, flags);
|
|
|
cancel_delayed_work_sync(&host->detect);
|
|
|
|
|
@@ -2603,7 +2542,6 @@ int mmc_pm_notify(struct notifier_block *notify_block,
|
|
|
|
|
|
spin_lock_irqsave(&host->lock, flags);
|
|
|
host->rescan_disable = 0;
|
|
|
- host->power_notify_type = MMC_HOST_PW_NOTIFY_LONG;
|
|
|
spin_unlock_irqrestore(&host->lock, flags);
|
|
|
mmc_detect_change(host, 0);
|
|
|
|