diff --git a/drivers/mmc/core/sd.c b/drivers/mmc/core/sd.c index 20ca371b9f874660e7acdc8e4e54cb0eb532fef9..8760b749292b8c97510b319ee0c99e321cd9db01 100644 --- a/drivers/mmc/core/sd.c +++ b/drivers/mmc/core/sd.c @@ -1163,9 +1163,9 @@ static int _mmc_sd_suspend(struct mmc_host *host) err = mmc_deselect_cards(host); if (!err) { - if (!(mmc_is_ascend_customized(host->parent))) + if (!mmc_is_ascend_customized(host->parent)) mmc_power_off(host); - else if (mmc_card_keep_power(host)) + else if (!mmc_card_keep_power(host)) mmc_power_off(host); mmc_card_set_suspended(host->card); } @@ -1269,42 +1269,10 @@ static int mmc_sd_runtime_resume(struct mmc_host *host) return 0; } -#ifdef CONFIG_ASCEND_HISI_MMC -/*********************sd ops begin**********************/ -static int mmc_do_sd_reset(struct mmc_host *host) -{ - struct mmc_card *card = host->card; - - if (!host->bus_ops->power_restore) - return -EOPNOTSUPP; - - if (!card) - return -EINVAL; - - /* hw_reset for ip reset */ - if (host->ops->hw_reset) - host->ops->hw_reset(host); - - /* Only for K930/920 SD slow down clk*/ - if (host->ops->slowdown_clk) - host->ops->slowdown_clk(host, host->ios.timing); - - mmc_power_off(host); - mmc_set_clock(host, host->f_init); - /* Wait at least 200 ms */ - mmc_delay(200); - mmc_power_up(host, host->card->ocr); - (void)mmc_select_voltage(host, host->card->ocr); - - return host->bus_ops->power_restore(host); -} -#endif static int mmc_sd_hw_reset(struct mmc_host *host) { -#ifdef CONFIG_ASCEND_HISI_MMC if (mmc_is_ascend_customized(host->parent)) - return mmc_do_sd_reset(host); -#endif + return mmc_sd_reset(host); mmc_power_cycle(host, host->card->ocr); return mmc_sd_init_card(host, host->card->ocr, host->card); } diff --git a/drivers/mmc/host/dw_mmc_extern.h b/drivers/mmc/host/dw_mmc_extern.h index 04d8c23f39e9a84c15fa0073f0e43022e0c5d945..ab077b49559408a0d338b6c3c1a12dc2bc607218 100644 --- a/drivers/mmc/host/dw_mmc_extern.h +++ b/drivers/mmc/host/dw_mmc_extern.h @@ -8,7 +8,7 @@ #include "dw_mmc.h" -#ifdef CONFIG_MMC_DW_HI3XXX_MODULE +#if defined(CONFIG_MMC_DW_HI3XXX) || defined(CONFIG_MMC_DW_HI3XXX_MODULE) extern void dw_mci_reg_dump(struct dw_mci *host); extern void dw_mci_set_timeout(struct dw_mci *host); extern bool dw_mci_stop_abort_cmd(struct mmc_command *cmd); diff --git a/include/linux/mmc/host.h b/include/linux/mmc/host.h index 78b4d0a813b717a092f25abd336fc516dabf5421..fabc23d1562420f1b2e1fc2fde0476ca91222675 100644 --- a/include/linux/mmc/host.h +++ b/include/linux/mmc/host.h @@ -542,13 +542,13 @@ struct mmc_host { bool cqe_enabled; bool cqe_on; - unsigned long private[0] ____cacheline_aligned; #ifdef CONFIG_ASCEND_HISI_MMC const struct mmc_cmdq_host_ops *cmdq_ops; int sdio_present; unsigned int cmdq_slots; struct mmc_cmdq_context_info cmdq_ctx; #endif + unsigned long private[0] ____cacheline_aligned; }; struct device_node;