|
@@ -2995,17 +2995,15 @@ static void dw_mci_enable_cd(struct dw_mci *host)
|
|
{
|
|
{
|
|
unsigned long irqflags;
|
|
unsigned long irqflags;
|
|
u32 temp;
|
|
u32 temp;
|
|
- struct dw_mci_slot *slot;
|
|
|
|
|
|
|
|
/*
|
|
/*
|
|
* No need for CD if all slots have a non-error GPIO
|
|
* No need for CD if all slots have a non-error GPIO
|
|
* as well as broken card detection is found.
|
|
* as well as broken card detection is found.
|
|
*/
|
|
*/
|
|
- slot = host->slot;
|
|
|
|
- if (slot->mmc->caps & MMC_CAP_NEEDS_POLL)
|
|
|
|
|
|
+ if (host->slot->mmc->caps & MMC_CAP_NEEDS_POLL)
|
|
return;
|
|
return;
|
|
|
|
|
|
- if (mmc_gpio_get_cd(slot->mmc) < 0) {
|
|
|
|
|
|
+ if (mmc_gpio_get_cd(host->slot->mmc) < 0) {
|
|
spin_lock_irqsave(&host->irq_lock, irqflags);
|
|
spin_lock_irqsave(&host->irq_lock, irqflags);
|
|
temp = mci_readl(host, INTMASK);
|
|
temp = mci_readl(host, INTMASK);
|
|
temp |= SDMMC_INT_CD;
|
|
temp |= SDMMC_INT_CD;
|
|
@@ -3273,7 +3271,6 @@ int dw_mci_runtime_resume(struct device *dev)
|
|
{
|
|
{
|
|
int ret = 0;
|
|
int ret = 0;
|
|
struct dw_mci *host = dev_get_drvdata(dev);
|
|
struct dw_mci *host = dev_get_drvdata(dev);
|
|
- struct dw_mci_slot *slot = host->slot;
|
|
|
|
|
|
|
|
if (host->slot &&
|
|
if (host->slot &&
|
|
(mmc_can_gpio_cd(host->slot->mmc) ||
|
|
(mmc_can_gpio_cd(host->slot->mmc) ||
|
|
@@ -3313,11 +3310,11 @@ int dw_mci_runtime_resume(struct device *dev)
|
|
mci_writel(host, CTRL, SDMMC_CTRL_INT_ENABLE);
|
|
mci_writel(host, CTRL, SDMMC_CTRL_INT_ENABLE);
|
|
|
|
|
|
|
|
|
|
- if (slot->mmc->pm_flags & MMC_PM_KEEP_POWER)
|
|
|
|
- dw_mci_set_ios(slot->mmc, &slot->mmc->ios);
|
|
|
|
|
|
+ if (host->slot->mmc->pm_flags & MMC_PM_KEEP_POWER)
|
|
|
|
+ dw_mci_set_ios(host->slot->mmc, &host->slot->mmc->ios);
|
|
|
|
|
|
/* Force setup bus to guarantee available clock output */
|
|
/* Force setup bus to guarantee available clock output */
|
|
- dw_mci_setup_bus(slot, true);
|
|
|
|
|
|
+ dw_mci_setup_bus(host->slot, true);
|
|
|
|
|
|
/* Now that slots are all setup, we can enable card detect */
|
|
/* Now that slots are all setup, we can enable card detect */
|
|
dw_mci_enable_cd(host);
|
|
dw_mci_enable_cd(host);
|