diff options
-rw-r--r-- | drivers/mmc/host/dw_mmc.c | 33 | ||||
-rw-r--r-- | include/linux/mmc/dw_mmc.h | 14 |
2 files changed, 3 insertions, 44 deletions
diff --git a/drivers/mmc/host/dw_mmc.c b/drivers/mmc/host/dw_mmc.c index 55c34cb702d4..81991eca5671 100644 --- a/drivers/mmc/host/dw_mmc.c +++ b/drivers/mmc/host/dw_mmc.c | |||
@@ -850,8 +850,6 @@ static void __dw_mci_start_request(struct dw_mci *host, | |||
850 | u32 cmdflags; | 850 | u32 cmdflags; |
851 | 851 | ||
852 | mrq = slot->mrq; | 852 | mrq = slot->mrq; |
853 | if (host->pdata->select_slot) | ||
854 | host->pdata->select_slot(slot->id); | ||
855 | 853 | ||
856 | host->cur_slot = slot; | 854 | host->cur_slot = slot; |
857 | host->mrq = mrq; | 855 | host->mrq = mrq; |
@@ -985,17 +983,11 @@ static void dw_mci_set_ios(struct mmc_host *mmc, struct mmc_ios *ios) | |||
985 | switch (ios->power_mode) { | 983 | switch (ios->power_mode) { |
986 | case MMC_POWER_UP: | 984 | case MMC_POWER_UP: |
987 | set_bit(DW_MMC_CARD_NEED_INIT, &slot->flags); | 985 | set_bit(DW_MMC_CARD_NEED_INIT, &slot->flags); |
988 | /* Power up slot */ | ||
989 | if (slot->host->pdata->setpower) | ||
990 | slot->host->pdata->setpower(slot->id, mmc->ocr_avail); | ||
991 | regs = mci_readl(slot->host, PWREN); | 986 | regs = mci_readl(slot->host, PWREN); |
992 | regs |= (1 << slot->id); | 987 | regs |= (1 << slot->id); |
993 | mci_writel(slot->host, PWREN, regs); | 988 | mci_writel(slot->host, PWREN, regs); |
994 | break; | 989 | break; |
995 | case MMC_POWER_OFF: | 990 | case MMC_POWER_OFF: |
996 | /* Power down slot */ | ||
997 | if (slot->host->pdata->setpower) | ||
998 | slot->host->pdata->setpower(slot->id, 0); | ||
999 | regs = mci_readl(slot->host, PWREN); | 991 | regs = mci_readl(slot->host, PWREN); |
1000 | regs &= ~(1 << slot->id); | 992 | regs &= ~(1 << slot->id); |
1001 | mci_writel(slot->host, PWREN, regs); | 993 | mci_writel(slot->host, PWREN, regs); |
@@ -1009,13 +1001,10 @@ static int dw_mci_get_ro(struct mmc_host *mmc) | |||
1009 | { | 1001 | { |
1010 | int read_only; | 1002 | int read_only; |
1011 | struct dw_mci_slot *slot = mmc_priv(mmc); | 1003 | struct dw_mci_slot *slot = mmc_priv(mmc); |
1012 | struct dw_mci_board *brd = slot->host->pdata; | ||
1013 | 1004 | ||
1014 | /* Use platform get_ro function, else try on board write protect */ | 1005 | /* Use platform get_ro function, else try on board write protect */ |
1015 | if (slot->quirks & DW_MCI_SLOT_QUIRK_NO_WRITE_PROTECT) | 1006 | if (slot->quirks & DW_MCI_SLOT_QUIRK_NO_WRITE_PROTECT) |
1016 | read_only = 0; | 1007 | read_only = 0; |
1017 | else if (brd->get_ro) | ||
1018 | read_only = brd->get_ro(slot->id); | ||
1019 | else if (gpio_is_valid(slot->wp_gpio)) | 1008 | else if (gpio_is_valid(slot->wp_gpio)) |
1020 | read_only = gpio_get_value(slot->wp_gpio); | 1009 | read_only = gpio_get_value(slot->wp_gpio); |
1021 | else | 1010 | else |
@@ -1039,8 +1028,6 @@ static int dw_mci_get_cd(struct mmc_host *mmc) | |||
1039 | /* Use platform get_cd function, else try onboard card detect */ | 1028 | /* Use platform get_cd function, else try onboard card detect */ |
1040 | if (brd->quirks & DW_MCI_QUIRK_BROKEN_CARD_DETECTION) | 1029 | if (brd->quirks & DW_MCI_QUIRK_BROKEN_CARD_DETECTION) |
1041 | present = 1; | 1030 | present = 1; |
1042 | else if (brd->get_cd) | ||
1043 | present = !brd->get_cd(slot->id); | ||
1044 | else if (!IS_ERR_VALUE(gpio_cd)) | 1031 | else if (!IS_ERR_VALUE(gpio_cd)) |
1045 | present = gpio_cd; | 1032 | present = gpio_cd; |
1046 | else | 1033 | else |
@@ -2138,17 +2125,7 @@ static int dw_mci_init_slot(struct dw_mci *host, unsigned int id) | |||
2138 | mmc->f_max = freq[1]; | 2125 | mmc->f_max = freq[1]; |
2139 | } | 2126 | } |
2140 | 2127 | ||
2141 | if (host->pdata->get_ocr) | 2128 | mmc->ocr_avail = MMC_VDD_32_33 | MMC_VDD_33_34; |
2142 | mmc->ocr_avail = host->pdata->get_ocr(id); | ||
2143 | else | ||
2144 | mmc->ocr_avail = MMC_VDD_32_33 | MMC_VDD_33_34; | ||
2145 | |||
2146 | /* | ||
2147 | * Start with slot power disabled, it will be enabled when a card | ||
2148 | * is detected. | ||
2149 | */ | ||
2150 | if (host->pdata->setpower) | ||
2151 | host->pdata->setpower(id, 0); | ||
2152 | 2129 | ||
2153 | if (host->pdata->caps) | 2130 | if (host->pdata->caps) |
2154 | mmc->caps = host->pdata->caps; | 2131 | mmc->caps = host->pdata->caps; |
@@ -2217,10 +2194,6 @@ err_setup_bus: | |||
2217 | 2194 | ||
2218 | static void dw_mci_cleanup_slot(struct dw_mci_slot *slot, unsigned int id) | 2195 | static void dw_mci_cleanup_slot(struct dw_mci_slot *slot, unsigned int id) |
2219 | { | 2196 | { |
2220 | /* Shutdown detect IRQ */ | ||
2221 | if (slot->host->pdata->exit) | ||
2222 | slot->host->pdata->exit(id); | ||
2223 | |||
2224 | /* Debugfs stuff is cleaned up by mmc core */ | 2197 | /* Debugfs stuff is cleaned up by mmc core */ |
2225 | mmc_remove_host(slot->mmc); | 2198 | mmc_remove_host(slot->mmc); |
2226 | slot->host->slot[id] = NULL; | 2199 | slot->host->slot[id] = NULL; |
@@ -2395,9 +2368,9 @@ int dw_mci_probe(struct dw_mci *host) | |||
2395 | } | 2368 | } |
2396 | } | 2369 | } |
2397 | 2370 | ||
2398 | if (!host->pdata->select_slot && host->pdata->num_slots > 1) { | 2371 | if (host->pdata->num_slots > 1) { |
2399 | dev_err(host->dev, | 2372 | dev_err(host->dev, |
2400 | "Platform data must supply select_slot function\n"); | 2373 | "Platform data must supply num_slots.\n"); |
2401 | return -ENODEV; | 2374 | return -ENODEV; |
2402 | } | 2375 | } |
2403 | 2376 | ||
diff --git a/include/linux/mmc/dw_mmc.h b/include/linux/mmc/dw_mmc.h index 6ce7d2cd3c7a..babaea93bca6 100644 --- a/include/linux/mmc/dw_mmc.h +++ b/include/linux/mmc/dw_mmc.h | |||
@@ -248,20 +248,6 @@ struct dw_mci_board { | |||
248 | /* delay in mS before detecting cards after interrupt */ | 248 | /* delay in mS before detecting cards after interrupt */ |
249 | u32 detect_delay_ms; | 249 | u32 detect_delay_ms; |
250 | 250 | ||
251 | int (*init)(u32 slot_id, irq_handler_t , void *); | ||
252 | int (*get_ro)(u32 slot_id); | ||
253 | int (*get_cd)(u32 slot_id); | ||
254 | int (*get_ocr)(u32 slot_id); | ||
255 | int (*get_bus_wd)(u32 slot_id); | ||
256 | /* | ||
257 | * Enable power to selected slot and set voltage to desired level. | ||
258 | * Voltage levels are specified using MMC_VDD_xxx defines defined | ||
259 | * in linux/mmc/host.h file. | ||
260 | */ | ||
261 | void (*setpower)(u32 slot_id, u32 volt); | ||
262 | void (*exit)(u32 slot_id); | ||
263 | void (*select_slot)(u32 slot_id); | ||
264 | |||
265 | struct dw_mci_dma_ops *dma_ops; | 251 | struct dw_mci_dma_ops *dma_ops; |
266 | struct dma_pdata *data; | 252 | struct dma_pdata *data; |
267 | struct block_settings *blk_settings; | 253 | struct block_settings *blk_settings; |