cmdr |= SDMMC_CMD_DAT_WR;
}
- if (!test_bit(DW_MMC_CARD_NO_USE_HOLD, &slot->flags))
+ if (!test_bit(DW_MMC_CARD_NO_USE_HOLD, &host->flags))
cmdr |= SDMMC_CMD_USE_HOLD_REG;
return cmdr;
cmdr = stop->opcode | SDMMC_CMD_STOP |
SDMMC_CMD_RESP_CRC | SDMMC_CMD_RESP_EXP;
- if (!test_bit(DW_MMC_CARD_NO_USE_HOLD, &host->slot->flags))
+ if (!test_bit(DW_MMC_CARD_NO_USE_HOLD, &host->flags))
cmdr |= SDMMC_CMD_USE_HOLD_REG;
return cmdr;
|| !mmc_card_is_removable(mmc))) {
present = 1;
- if (!test_bit(DW_MMC_CARD_PRESENT, &slot->flags)) {
+ if (!test_bit(DW_MMC_CARD_PRESENT, &host->flags)) {
if (mmc->caps & MMC_CAP_NEEDS_POLL) {
dev_info(&mmc->class_dev,
"card is polling.\n");
dev_info(&mmc->class_dev,
"card is non-removable.\n");
}
- set_bit(DW_MMC_CARD_PRESENT, &slot->flags);
+ set_bit(DW_MMC_CARD_PRESENT, &host->flags);
}
return present;
== 0 ? 1 : 0;
spin_lock_bh(&host->lock);
- if (present && !test_and_set_bit(DW_MMC_CARD_PRESENT, &slot->flags))
+ if (present && !test_and_set_bit(DW_MMC_CARD_PRESENT, &host->flags))
dev_dbg(&mmc->class_dev, "card is present\n");
else if (!present &&
- !test_and_clear_bit(DW_MMC_CARD_PRESENT, &slot->flags))
+ !test_and_clear_bit(DW_MMC_CARD_PRESENT, &host->flags))
dev_dbg(&mmc->class_dev, "card is not present\n");
spin_unlock_bh(&host->lock);
div = (host->bus_hz != clock) ? DIV_ROUND_UP(div, 2) : 0;
if ((clock != slot->__clk_old &&
- !test_bit(DW_MMC_CARD_NEEDS_POLL, &slot->flags)) ||
+ !test_bit(DW_MMC_CARD_NEEDS_POLL, &host->flags)) ||
force_clkinit) {
/* Silent the verbose log if calling from PM context */
if (!force_clkinit)
*/
if (host->mmc->caps & MMC_CAP_NEEDS_POLL &&
host->mmc->f_min == clock)
- set_bit(DW_MMC_CARD_NEEDS_POLL, &slot->flags);
+ set_bit(DW_MMC_CARD_NEEDS_POLL, &host->flags);
}
/* disable clock */
/* enable clock; only low power if no SDIO */
clk_en_a = SDMMC_CLKEN_ENABLE << slot->id;
- if (!test_bit(DW_MMC_CARD_NO_LOW_PWR, &slot->flags))
+ if (!test_bit(DW_MMC_CARD_NO_LOW_PWR, &host->flags))
clk_en_a |= SDMMC_CLKEN_LOW_PWR << slot->id;
mci_writel(host, CLKENA, clk_en_a);
cmdflags = dw_mci_prepare_command(host->mmc, cmd);
/* this is the first command, send the initialization clock */
- if (test_and_clear_bit(DW_MMC_CARD_NEED_INIT, &slot->flags))
+ if (test_and_clear_bit(DW_MMC_CARD_NEED_INIT, &host->flags))
cmdflags |= SDMMC_CMD_INIT;
if (data) {
dev_err(slot->host->dev, "failed to enable vmmc regulator\n");
return;
}
- set_bit(DW_MMC_CARD_NEED_INIT, &slot->flags);
+ set_bit(DW_MMC_CARD_NEED_INIT, &slot->host->flags);
regs = mci_readl(slot->host, PWREN);
regs |= (1 << slot->id);
mci_writel(slot->host, PWREN, regs);
clk_en_a_old = mci_readl(host, CLKENA);
if (prepare) {
- set_bit(DW_MMC_CARD_NO_LOW_PWR, &slot->flags);
+ set_bit(DW_MMC_CARD_NO_LOW_PWR, &host->flags);
clk_en_a = clk_en_a_old & ~clken_low_pwr;
} else {
- clear_bit(DW_MMC_CARD_NO_LOW_PWR, &slot->flags);
+ clear_bit(DW_MMC_CARD_NO_LOW_PWR, &host->flags);
clk_en_a = clk_en_a_old | clken_low_pwr;
}
* @cto_timer: Timer for broken command transfer over scheme.
* @dto_timer: Timer for broken data transfer over scheme.
* @mmc: The mmc_host representing this dw_mci.
+ * @flags: Random state bits associated with the host.
*
* Locking
* =======
struct hrtimer fault_timer;
#endif
struct mmc_host *mmc;
+ unsigned long flags;
+#define DW_MMC_CARD_PRESENT 0
+#define DW_MMC_CARD_NEED_INIT 1
+#define DW_MMC_CARD_NO_LOW_PWR 2
+#define DW_MMC_CARD_NO_USE_HOLD 3
+#define DW_MMC_CARD_NEEDS_POLL 4
};
/* DMA ops for Internal/External DMAC interface */
* @clock: Clock rate configured by set_ios(). Protected by host->lock.
* @__clk_old: The last clock value that was requested from core.
* Keeping track of this helps us to avoid spamming the console.
- * @flags: Random state bits associated with the slot.
* @id: Number of this slot.
* @sdio_id: Number of this slot in the SDIO interrupt registers.
*/
unsigned int clock;
unsigned int __clk_old;
- unsigned long flags;
-#define DW_MMC_CARD_PRESENT 0
-#define DW_MMC_CARD_NEED_INIT 1
-#define DW_MMC_CARD_NO_LOW_PWR 2
-#define DW_MMC_CARD_NO_USE_HOLD 3
-#define DW_MMC_CARD_NEEDS_POLL 4
int id;
int sdio_id;
};