diff options
author | Linus Torvalds <torvalds@linux-foundation.org> | 2011-08-14 15:28:15 -0400 |
---|---|---|
committer | Linus Torvalds <torvalds@linux-foundation.org> | 2011-08-14 15:28:15 -0400 |
commit | 97c24d1d455df17ca3ef281d1a290988f4686643 (patch) | |
tree | 36e4602be13301bf1669fcb7998b8a2d431cf1c9 /drivers | |
parent | 91d85ea6786107aa2837bef3e957165ad7c8b823 (diff) | |
parent | 7fd781e8f9b72544a1c7f04456eb33d5ffaed592 (diff) |
Merge branch 'for-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/cjb/mmc
* 'for-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/cjb/mmc:
mmc: remove unused "ddr" parameter in struct mmc_ios
mmc: dw_mmc: Fix DDR mode support.
mmc: core: use defined R1_STATE_PRG macro for card status
mmc: sdhci: use f_max instead of host->clock for timeouts
mmc: sdhci: move timeout_clk calculation farther down
mmc: sdhci: check host->clock before using it as a denominator
mmc: Revert "mmc: sdhci: Fix SDHCI_QUIRK_TIMEOUT_USES_SDCLK"
mmc: tmio: eliminate unused variable 'mmc' warning
mmc: esdhc-imx: fix card interrupt loss on freescale eSDHC
mmc: sdhci-s3c: Fix build for header change
mmc: dw_mmc: Fix mask in IDMAC_SET_BUFFER1_SIZE macro
mmc: cb710: fix possible pci_dev leak in cb710_pci_configure()
mmc: core: Detect eMMC v4.5 ext_csd entries
mmc: mmc_test: avoid stalled file in debugfs
mmc: sdhci-s3c: add BROKEN_ADMA_ZEROLEN_DESC quirk
mmc: sdhci: pxav3: controller needs 32 bit ADMA addressing
mmc: sdhci: fix retuning timer wrongly deleted in sdhci_tasklet_finish
Diffstat (limited to 'drivers')
-rw-r--r-- | drivers/misc/cb710/core.c | 3 | ||||
-rw-r--r-- | drivers/mmc/card/mmc_test.c | 58 | ||||
-rw-r--r-- | drivers/mmc/core/core.c | 2 | ||||
-rw-r--r-- | drivers/mmc/core/mmc.c | 2 | ||||
-rw-r--r-- | drivers/mmc/core/mmc_ops.c | 2 | ||||
-rw-r--r-- | drivers/mmc/host/dw_mmc.c | 6 | ||||
-rw-r--r-- | drivers/mmc/host/sdhci-esdhc-imx.c | 40 | ||||
-rw-r--r-- | drivers/mmc/host/sdhci-pxav3.c | 3 | ||||
-rw-r--r-- | drivers/mmc/host/sdhci-s3c.c | 4 | ||||
-rw-r--r-- | drivers/mmc/host/sdhci.c | 53 | ||||
-rw-r--r-- | drivers/mmc/host/tmio_mmc.c | 2 |
11 files changed, 100 insertions, 75 deletions
diff --git a/drivers/misc/cb710/core.c b/drivers/misc/cb710/core.c index efec4139c3f6..68cd05b6d829 100644 --- a/drivers/misc/cb710/core.c +++ b/drivers/misc/cb710/core.c | |||
@@ -33,7 +33,7 @@ EXPORT_SYMBOL_GPL(cb710_pci_update_config_reg); | |||
33 | static int __devinit cb710_pci_configure(struct pci_dev *pdev) | 33 | static int __devinit cb710_pci_configure(struct pci_dev *pdev) |
34 | { | 34 | { |
35 | unsigned int devfn = PCI_DEVFN(PCI_SLOT(pdev->devfn), 0); | 35 | unsigned int devfn = PCI_DEVFN(PCI_SLOT(pdev->devfn), 0); |
36 | struct pci_dev *pdev0 = pci_get_slot(pdev->bus, devfn); | 36 | struct pci_dev *pdev0; |
37 | u32 val; | 37 | u32 val; |
38 | 38 | ||
39 | cb710_pci_update_config_reg(pdev, 0x48, | 39 | cb710_pci_update_config_reg(pdev, 0x48, |
@@ -43,6 +43,7 @@ static int __devinit cb710_pci_configure(struct pci_dev *pdev) | |||
43 | if (val & 0x80000000) | 43 | if (val & 0x80000000) |
44 | return 0; | 44 | return 0; |
45 | 45 | ||
46 | pdev0 = pci_get_slot(pdev->bus, devfn); | ||
46 | if (!pdev0) | 47 | if (!pdev0) |
47 | return -ENODEV; | 48 | return -ENODEV; |
48 | 49 | ||
diff --git a/drivers/mmc/card/mmc_test.c b/drivers/mmc/card/mmc_test.c index 006a5e9f8ab8..2bf229acd3b8 100644 --- a/drivers/mmc/card/mmc_test.c +++ b/drivers/mmc/card/mmc_test.c | |||
@@ -224,7 +224,7 @@ static void mmc_test_prepare_mrq(struct mmc_test_card *test, | |||
224 | static int mmc_test_busy(struct mmc_command *cmd) | 224 | static int mmc_test_busy(struct mmc_command *cmd) |
225 | { | 225 | { |
226 | return !(cmd->resp[0] & R1_READY_FOR_DATA) || | 226 | return !(cmd->resp[0] & R1_READY_FOR_DATA) || |
227 | (R1_CURRENT_STATE(cmd->resp[0]) == 7); | 227 | (R1_CURRENT_STATE(cmd->resp[0]) == R1_STATE_PRG); |
228 | } | 228 | } |
229 | 229 | ||
230 | /* | 230 | /* |
@@ -2900,7 +2900,7 @@ static const struct file_operations mmc_test_fops_testlist = { | |||
2900 | .release = single_release, | 2900 | .release = single_release, |
2901 | }; | 2901 | }; |
2902 | 2902 | ||
2903 | static void mmc_test_free_file_test(struct mmc_card *card) | 2903 | static void mmc_test_free_dbgfs_file(struct mmc_card *card) |
2904 | { | 2904 | { |
2905 | struct mmc_test_dbgfs_file *df, *dfs; | 2905 | struct mmc_test_dbgfs_file *df, *dfs; |
2906 | 2906 | ||
@@ -2917,34 +2917,21 @@ static void mmc_test_free_file_test(struct mmc_card *card) | |||
2917 | mutex_unlock(&mmc_test_lock); | 2917 | mutex_unlock(&mmc_test_lock); |
2918 | } | 2918 | } |
2919 | 2919 | ||
2920 | static int mmc_test_register_file_test(struct mmc_card *card) | 2920 | static int __mmc_test_register_dbgfs_file(struct mmc_card *card, |
2921 | const char *name, mode_t mode, const struct file_operations *fops) | ||
2921 | { | 2922 | { |
2922 | struct dentry *file = NULL; | 2923 | struct dentry *file = NULL; |
2923 | struct mmc_test_dbgfs_file *df; | 2924 | struct mmc_test_dbgfs_file *df; |
2924 | int ret = 0; | ||
2925 | |||
2926 | mutex_lock(&mmc_test_lock); | ||
2927 | |||
2928 | if (card->debugfs_root) | ||
2929 | file = debugfs_create_file("test", S_IWUSR | S_IRUGO, | ||
2930 | card->debugfs_root, card, &mmc_test_fops_test); | ||
2931 | |||
2932 | if (IS_ERR_OR_NULL(file)) { | ||
2933 | dev_err(&card->dev, | ||
2934 | "Can't create test. Perhaps debugfs is disabled.\n"); | ||
2935 | ret = -ENODEV; | ||
2936 | goto err; | ||
2937 | } | ||
2938 | 2925 | ||
2939 | if (card->debugfs_root) | 2926 | if (card->debugfs_root) |
2940 | file = debugfs_create_file("testlist", S_IRUGO, | 2927 | file = debugfs_create_file(name, mode, card->debugfs_root, |
2941 | card->debugfs_root, card, &mmc_test_fops_testlist); | 2928 | card, fops); |
2942 | 2929 | ||
2943 | if (IS_ERR_OR_NULL(file)) { | 2930 | if (IS_ERR_OR_NULL(file)) { |
2944 | dev_err(&card->dev, | 2931 | dev_err(&card->dev, |
2945 | "Can't create testlist. Perhaps debugfs is disabled.\n"); | 2932 | "Can't create %s. Perhaps debugfs is disabled.\n", |
2946 | ret = -ENODEV; | 2933 | name); |
2947 | goto err; | 2934 | return -ENODEV; |
2948 | } | 2935 | } |
2949 | 2936 | ||
2950 | df = kmalloc(sizeof(struct mmc_test_dbgfs_file), GFP_KERNEL); | 2937 | df = kmalloc(sizeof(struct mmc_test_dbgfs_file), GFP_KERNEL); |
@@ -2952,14 +2939,31 @@ static int mmc_test_register_file_test(struct mmc_card *card) | |||
2952 | debugfs_remove(file); | 2939 | debugfs_remove(file); |
2953 | dev_err(&card->dev, | 2940 | dev_err(&card->dev, |
2954 | "Can't allocate memory for internal usage.\n"); | 2941 | "Can't allocate memory for internal usage.\n"); |
2955 | ret = -ENOMEM; | 2942 | return -ENOMEM; |
2956 | goto err; | ||
2957 | } | 2943 | } |
2958 | 2944 | ||
2959 | df->card = card; | 2945 | df->card = card; |
2960 | df->file = file; | 2946 | df->file = file; |
2961 | 2947 | ||
2962 | list_add(&df->link, &mmc_test_file_test); | 2948 | list_add(&df->link, &mmc_test_file_test); |
2949 | return 0; | ||
2950 | } | ||
2951 | |||
2952 | static int mmc_test_register_dbgfs_file(struct mmc_card *card) | ||
2953 | { | ||
2954 | int ret; | ||
2955 | |||
2956 | mutex_lock(&mmc_test_lock); | ||
2957 | |||
2958 | ret = __mmc_test_register_dbgfs_file(card, "test", S_IWUSR | S_IRUGO, | ||
2959 | &mmc_test_fops_test); | ||
2960 | if (ret) | ||
2961 | goto err; | ||
2962 | |||
2963 | ret = __mmc_test_register_dbgfs_file(card, "testlist", S_IRUGO, | ||
2964 | &mmc_test_fops_testlist); | ||
2965 | if (ret) | ||
2966 | goto err; | ||
2963 | 2967 | ||
2964 | err: | 2968 | err: |
2965 | mutex_unlock(&mmc_test_lock); | 2969 | mutex_unlock(&mmc_test_lock); |
@@ -2974,7 +2978,7 @@ static int mmc_test_probe(struct mmc_card *card) | |||
2974 | if (!mmc_card_mmc(card) && !mmc_card_sd(card)) | 2978 | if (!mmc_card_mmc(card) && !mmc_card_sd(card)) |
2975 | return -ENODEV; | 2979 | return -ENODEV; |
2976 | 2980 | ||
2977 | ret = mmc_test_register_file_test(card); | 2981 | ret = mmc_test_register_dbgfs_file(card); |
2978 | if (ret) | 2982 | if (ret) |
2979 | return ret; | 2983 | return ret; |
2980 | 2984 | ||
@@ -2986,7 +2990,7 @@ static int mmc_test_probe(struct mmc_card *card) | |||
2986 | static void mmc_test_remove(struct mmc_card *card) | 2990 | static void mmc_test_remove(struct mmc_card *card) |
2987 | { | 2991 | { |
2988 | mmc_test_free_result(card); | 2992 | mmc_test_free_result(card); |
2989 | mmc_test_free_file_test(card); | 2993 | mmc_test_free_dbgfs_file(card); |
2990 | } | 2994 | } |
2991 | 2995 | ||
2992 | static struct mmc_driver mmc_driver = { | 2996 | static struct mmc_driver mmc_driver = { |
@@ -3006,7 +3010,7 @@ static void __exit mmc_test_exit(void) | |||
3006 | { | 3010 | { |
3007 | /* Clear stalled data if card is still plugged */ | 3011 | /* Clear stalled data if card is still plugged */ |
3008 | mmc_test_free_result(NULL); | 3012 | mmc_test_free_result(NULL); |
3009 | mmc_test_free_file_test(NULL); | 3013 | mmc_test_free_dbgfs_file(NULL); |
3010 | 3014 | ||
3011 | mmc_unregister_driver(&mmc_driver); | 3015 | mmc_unregister_driver(&mmc_driver); |
3012 | } | 3016 | } |
diff --git a/drivers/mmc/core/core.c b/drivers/mmc/core/core.c index 89bdeaec7182..91a0a7460ebb 100644 --- a/drivers/mmc/core/core.c +++ b/drivers/mmc/core/core.c | |||
@@ -1502,7 +1502,7 @@ static int mmc_do_erase(struct mmc_card *card, unsigned int from, | |||
1502 | goto out; | 1502 | goto out; |
1503 | } | 1503 | } |
1504 | } while (!(cmd.resp[0] & R1_READY_FOR_DATA) || | 1504 | } while (!(cmd.resp[0] & R1_READY_FOR_DATA) || |
1505 | R1_CURRENT_STATE(cmd.resp[0]) == 7); | 1505 | R1_CURRENT_STATE(cmd.resp[0]) == R1_STATE_PRG); |
1506 | out: | 1506 | out: |
1507 | return err; | 1507 | return err; |
1508 | } | 1508 | } |
diff --git a/drivers/mmc/core/mmc.c b/drivers/mmc/core/mmc.c index aa7d1d79b8c5..5700b1cbdfec 100644 --- a/drivers/mmc/core/mmc.c +++ b/drivers/mmc/core/mmc.c | |||
@@ -259,7 +259,7 @@ static int mmc_read_ext_csd(struct mmc_card *card, u8 *ext_csd) | |||
259 | } | 259 | } |
260 | 260 | ||
261 | card->ext_csd.rev = ext_csd[EXT_CSD_REV]; | 261 | card->ext_csd.rev = ext_csd[EXT_CSD_REV]; |
262 | if (card->ext_csd.rev > 5) { | 262 | if (card->ext_csd.rev > 6) { |
263 | printk(KERN_ERR "%s: unrecognised EXT_CSD revision %d\n", | 263 | printk(KERN_ERR "%s: unrecognised EXT_CSD revision %d\n", |
264 | mmc_hostname(card->host), card->ext_csd.rev); | 264 | mmc_hostname(card->host), card->ext_csd.rev); |
265 | err = -EINVAL; | 265 | err = -EINVAL; |
diff --git a/drivers/mmc/core/mmc_ops.c b/drivers/mmc/core/mmc_ops.c index 845ce7c533b9..770c3d06f5dc 100644 --- a/drivers/mmc/core/mmc_ops.c +++ b/drivers/mmc/core/mmc_ops.c | |||
@@ -407,7 +407,7 @@ int mmc_switch(struct mmc_card *card, u8 set, u8 index, u8 value, | |||
407 | break; | 407 | break; |
408 | if (mmc_host_is_spi(card->host)) | 408 | if (mmc_host_is_spi(card->host)) |
409 | break; | 409 | break; |
410 | } while (R1_CURRENT_STATE(status) == 7); | 410 | } while (R1_CURRENT_STATE(status) == R1_STATE_PRG); |
411 | 411 | ||
412 | if (mmc_host_is_spi(card->host)) { | 412 | if (mmc_host_is_spi(card->host)) { |
413 | if (status & R1_SPI_ILLEGAL_COMMAND) | 413 | if (status & R1_SPI_ILLEGAL_COMMAND) |
diff --git a/drivers/mmc/host/dw_mmc.c b/drivers/mmc/host/dw_mmc.c index 77f0b6b1681d..ff0f714b012c 100644 --- a/drivers/mmc/host/dw_mmc.c +++ b/drivers/mmc/host/dw_mmc.c | |||
@@ -62,7 +62,7 @@ struct idmac_desc { | |||
62 | 62 | ||
63 | u32 des1; /* Buffer sizes */ | 63 | u32 des1; /* Buffer sizes */ |
64 | #define IDMAC_SET_BUFFER1_SIZE(d, s) \ | 64 | #define IDMAC_SET_BUFFER1_SIZE(d, s) \ |
65 | ((d)->des1 = ((d)->des1 & 0x03ffc000) | ((s) & 0x3fff)) | 65 | ((d)->des1 = ((d)->des1 & 0x03ffe000) | ((s) & 0x1fff)) |
66 | 66 | ||
67 | u32 des2; /* buffer 1 physical address */ | 67 | u32 des2; /* buffer 1 physical address */ |
68 | 68 | ||
@@ -699,7 +699,7 @@ static void dw_mci_set_ios(struct mmc_host *mmc, struct mmc_ios *ios) | |||
699 | } | 699 | } |
700 | 700 | ||
701 | /* DDR mode set */ | 701 | /* DDR mode set */ |
702 | if (ios->ddr) { | 702 | if (ios->timing == MMC_TIMING_UHS_DDR50) { |
703 | regs = mci_readl(slot->host, UHS_REG); | 703 | regs = mci_readl(slot->host, UHS_REG); |
704 | regs |= (0x1 << slot->id) << 16; | 704 | regs |= (0x1 << slot->id) << 16; |
705 | mci_writel(slot->host, UHS_REG, regs); | 705 | mci_writel(slot->host, UHS_REG, regs); |
@@ -1646,7 +1646,7 @@ static int __init dw_mci_init_slot(struct dw_mci *host, unsigned int id) | |||
1646 | mmc->caps |= MMC_CAP_4_BIT_DATA; | 1646 | mmc->caps |= MMC_CAP_4_BIT_DATA; |
1647 | 1647 | ||
1648 | if (host->pdata->quirks & DW_MCI_QUIRK_HIGHSPEED) | 1648 | if (host->pdata->quirks & DW_MCI_QUIRK_HIGHSPEED) |
1649 | mmc->caps |= MMC_CAP_SD_HIGHSPEED; | 1649 | mmc->caps |= MMC_CAP_SD_HIGHSPEED | MMC_CAP_MMC_HIGHSPEED; |
1650 | 1650 | ||
1651 | #ifdef CONFIG_MMC_DW_IDMAC | 1651 | #ifdef CONFIG_MMC_DW_IDMAC |
1652 | mmc->max_segs = host->ring_size; | 1652 | mmc->max_segs = host->ring_size; |
diff --git a/drivers/mmc/host/sdhci-esdhc-imx.c b/drivers/mmc/host/sdhci-esdhc-imx.c index 9ebfb4b482f5..0e9780f5a4a9 100644 --- a/drivers/mmc/host/sdhci-esdhc-imx.c +++ b/drivers/mmc/host/sdhci-esdhc-imx.c | |||
@@ -27,6 +27,7 @@ | |||
27 | #include "sdhci-pltfm.h" | 27 | #include "sdhci-pltfm.h" |
28 | #include "sdhci-esdhc.h" | 28 | #include "sdhci-esdhc.h" |
29 | 29 | ||
30 | #define SDHCI_CTRL_D3CD 0x08 | ||
30 | /* VENDOR SPEC register */ | 31 | /* VENDOR SPEC register */ |
31 | #define SDHCI_VENDOR_SPEC 0xC0 | 32 | #define SDHCI_VENDOR_SPEC 0xC0 |
32 | #define SDHCI_VENDOR_SPEC_SDIO_QUIRK 0x00000002 | 33 | #define SDHCI_VENDOR_SPEC_SDIO_QUIRK 0x00000002 |
@@ -141,13 +142,32 @@ static void esdhc_writel_le(struct sdhci_host *host, u32 val, int reg) | |||
141 | struct sdhci_pltfm_host *pltfm_host = sdhci_priv(host); | 142 | struct sdhci_pltfm_host *pltfm_host = sdhci_priv(host); |
142 | struct pltfm_imx_data *imx_data = pltfm_host->priv; | 143 | struct pltfm_imx_data *imx_data = pltfm_host->priv; |
143 | struct esdhc_platform_data *boarddata = &imx_data->boarddata; | 144 | struct esdhc_platform_data *boarddata = &imx_data->boarddata; |
144 | 145 | u32 data; | |
145 | if (unlikely((reg == SDHCI_INT_ENABLE || reg == SDHCI_SIGNAL_ENABLE) | 146 | |
146 | && (boarddata->cd_type == ESDHC_CD_GPIO))) | 147 | if (unlikely(reg == SDHCI_INT_ENABLE || reg == SDHCI_SIGNAL_ENABLE)) { |
147 | /* | 148 | if (boarddata->cd_type == ESDHC_CD_GPIO) |
148 | * these interrupts won't work with a custom card_detect gpio | 149 | /* |
149 | */ | 150 | * These interrupts won't work with a custom |
150 | val &= ~(SDHCI_INT_CARD_REMOVE | SDHCI_INT_CARD_INSERT); | 151 | * card_detect gpio (only applied to mx25/35) |
152 | */ | ||
153 | val &= ~(SDHCI_INT_CARD_REMOVE | SDHCI_INT_CARD_INSERT); | ||
154 | |||
155 | if (val & SDHCI_INT_CARD_INT) { | ||
156 | /* | ||
157 | * Clear and then set D3CD bit to avoid missing the | ||
158 | * card interrupt. This is a eSDHC controller problem | ||
159 | * so we need to apply the following workaround: clear | ||
160 | * and set D3CD bit will make eSDHC re-sample the card | ||
161 | * interrupt. In case a card interrupt was lost, | ||
162 | * re-sample it by the following steps. | ||
163 | */ | ||
164 | data = readl(host->ioaddr + SDHCI_HOST_CONTROL); | ||
165 | data &= ~SDHCI_CTRL_D3CD; | ||
166 | writel(data, host->ioaddr + SDHCI_HOST_CONTROL); | ||
167 | data |= SDHCI_CTRL_D3CD; | ||
168 | writel(data, host->ioaddr + SDHCI_HOST_CONTROL); | ||
169 | } | ||
170 | } | ||
151 | 171 | ||
152 | if (unlikely((imx_data->flags & ESDHC_FLAG_MULTIBLK_NO_INT) | 172 | if (unlikely((imx_data->flags & ESDHC_FLAG_MULTIBLK_NO_INT) |
153 | && (reg == SDHCI_INT_STATUS) | 173 | && (reg == SDHCI_INT_STATUS) |
@@ -217,8 +237,10 @@ static void esdhc_writeb_le(struct sdhci_host *host, u8 val, int reg) | |||
217 | */ | 237 | */ |
218 | return; | 238 | return; |
219 | case SDHCI_HOST_CONTROL: | 239 | case SDHCI_HOST_CONTROL: |
220 | /* FSL messed up here, so we can just keep those two */ | 240 | /* FSL messed up here, so we can just keep those three */ |
221 | new_val = val & (SDHCI_CTRL_LED | SDHCI_CTRL_4BITBUS); | 241 | new_val = val & (SDHCI_CTRL_LED | \ |
242 | SDHCI_CTRL_4BITBUS | \ | ||
243 | SDHCI_CTRL_D3CD); | ||
222 | /* ensure the endianess */ | 244 | /* ensure the endianess */ |
223 | new_val |= ESDHC_HOST_CONTROL_LE; | 245 | new_val |= ESDHC_HOST_CONTROL_LE; |
224 | /* DMA mode bits are shifted */ | 246 | /* DMA mode bits are shifted */ |
diff --git a/drivers/mmc/host/sdhci-pxav3.c b/drivers/mmc/host/sdhci-pxav3.c index 4198dbbc5c20..fc7e4a515629 100644 --- a/drivers/mmc/host/sdhci-pxav3.c +++ b/drivers/mmc/host/sdhci-pxav3.c | |||
@@ -195,7 +195,8 @@ static int __devinit sdhci_pxav3_probe(struct platform_device *pdev) | |||
195 | clk_enable(clk); | 195 | clk_enable(clk); |
196 | 196 | ||
197 | host->quirks = SDHCI_QUIRK_BROKEN_TIMEOUT_VAL | 197 | host->quirks = SDHCI_QUIRK_BROKEN_TIMEOUT_VAL |
198 | | SDHCI_QUIRK_NO_ENDATTR_IN_NOPDESC; | 198 | | SDHCI_QUIRK_NO_ENDATTR_IN_NOPDESC |
199 | | SDHCI_QUIRK_32BIT_ADMA_SIZE; | ||
199 | 200 | ||
200 | /* enable 1/8V DDR capable */ | 201 | /* enable 1/8V DDR capable */ |
201 | host->mmc->caps |= MMC_CAP_1_8V_DDR; | 202 | host->mmc->caps |= MMC_CAP_1_8V_DDR; |
diff --git a/drivers/mmc/host/sdhci-s3c.c b/drivers/mmc/host/sdhci-s3c.c index 460ffaf0f6d7..2bd7bf4fece7 100644 --- a/drivers/mmc/host/sdhci-s3c.c +++ b/drivers/mmc/host/sdhci-s3c.c | |||
@@ -19,6 +19,7 @@ | |||
19 | #include <linux/clk.h> | 19 | #include <linux/clk.h> |
20 | #include <linux/io.h> | 20 | #include <linux/io.h> |
21 | #include <linux/gpio.h> | 21 | #include <linux/gpio.h> |
22 | #include <linux/module.h> | ||
22 | 23 | ||
23 | #include <linux/mmc/host.h> | 24 | #include <linux/mmc/host.h> |
24 | 25 | ||
@@ -502,6 +503,9 @@ static int __devinit sdhci_s3c_probe(struct platform_device *pdev) | |||
502 | /* This host supports the Auto CMD12 */ | 503 | /* This host supports the Auto CMD12 */ |
503 | host->quirks |= SDHCI_QUIRK_MULTIBLOCK_READ_ACMD12; | 504 | host->quirks |= SDHCI_QUIRK_MULTIBLOCK_READ_ACMD12; |
504 | 505 | ||
506 | /* Samsung SoCs need BROKEN_ADMA_ZEROLEN_DESC */ | ||
507 | host->quirks |= SDHCI_QUIRK_BROKEN_ADMA_ZEROLEN_DESC; | ||
508 | |||
505 | if (pdata->cd_type == S3C_SDHCI_CD_NONE || | 509 | if (pdata->cd_type == S3C_SDHCI_CD_NONE || |
506 | pdata->cd_type == S3C_SDHCI_CD_PERMANENT) | 510 | pdata->cd_type == S3C_SDHCI_CD_PERMANENT) |
507 | host->quirks |= SDHCI_QUIRK_BROKEN_CARD_DETECTION; | 511 | host->quirks |= SDHCI_QUIRK_BROKEN_CARD_DETECTION; |
diff --git a/drivers/mmc/host/sdhci.c b/drivers/mmc/host/sdhci.c index c31a3343340d..0e02cc1df12e 100644 --- a/drivers/mmc/host/sdhci.c +++ b/drivers/mmc/host/sdhci.c | |||
@@ -628,12 +628,11 @@ static u8 sdhci_calc_timeout(struct sdhci_host *host, struct mmc_command *cmd) | |||
628 | /* timeout in us */ | 628 | /* timeout in us */ |
629 | if (!data) | 629 | if (!data) |
630 | target_timeout = cmd->cmd_timeout_ms * 1000; | 630 | target_timeout = cmd->cmd_timeout_ms * 1000; |
631 | else | 631 | else { |
632 | target_timeout = data->timeout_ns / 1000 + | 632 | target_timeout = data->timeout_ns / 1000; |
633 | data->timeout_clks / host->clock; | 633 | if (host->clock) |
634 | 634 | target_timeout += data->timeout_clks / host->clock; | |
635 | if (host->quirks & SDHCI_QUIRK_DATA_TIMEOUT_USES_SDCLK) | 635 | } |
636 | host->timeout_clk = host->clock / 1000; | ||
637 | 636 | ||
638 | /* | 637 | /* |
639 | * Figure out needed cycles. | 638 | * Figure out needed cycles. |
@@ -645,7 +644,6 @@ static u8 sdhci_calc_timeout(struct sdhci_host *host, struct mmc_command *cmd) | |||
645 | * => | 644 | * => |
646 | * (1) / (2) > 2^6 | 645 | * (1) / (2) > 2^6 |
647 | */ | 646 | */ |
648 | BUG_ON(!host->timeout_clk); | ||
649 | count = 0; | 647 | count = 0; |
650 | current_timeout = (1 << 13) * 1000 / host->timeout_clk; | 648 | current_timeout = (1 << 13) * 1000 / host->timeout_clk; |
651 | while (current_timeout < target_timeout) { | 649 | while (current_timeout < target_timeout) { |
@@ -1867,9 +1865,6 @@ static void sdhci_tasklet_finish(unsigned long param) | |||
1867 | 1865 | ||
1868 | del_timer(&host->timer); | 1866 | del_timer(&host->timer); |
1869 | 1867 | ||
1870 | if (host->version >= SDHCI_SPEC_300) | ||
1871 | del_timer(&host->tuning_timer); | ||
1872 | |||
1873 | mrq = host->mrq; | 1868 | mrq = host->mrq; |
1874 | 1869 | ||
1875 | /* | 1870 | /* |
@@ -2461,22 +2456,6 @@ int sdhci_add_host(struct sdhci_host *host) | |||
2461 | host->max_clk = host->ops->get_max_clock(host); | 2456 | host->max_clk = host->ops->get_max_clock(host); |
2462 | } | 2457 | } |
2463 | 2458 | ||
2464 | host->timeout_clk = | ||
2465 | (caps[0] & SDHCI_TIMEOUT_CLK_MASK) >> SDHCI_TIMEOUT_CLK_SHIFT; | ||
2466 | if (host->timeout_clk == 0) { | ||
2467 | if (host->ops->get_timeout_clock) { | ||
2468 | host->timeout_clk = host->ops->get_timeout_clock(host); | ||
2469 | } else if (!(host->quirks & | ||
2470 | SDHCI_QUIRK_DATA_TIMEOUT_USES_SDCLK)) { | ||
2471 | printk(KERN_ERR | ||
2472 | "%s: Hardware doesn't specify timeout clock " | ||
2473 | "frequency.\n", mmc_hostname(mmc)); | ||
2474 | return -ENODEV; | ||
2475 | } | ||
2476 | } | ||
2477 | if (caps[0] & SDHCI_TIMEOUT_CLK_UNIT) | ||
2478 | host->timeout_clk *= 1000; | ||
2479 | |||
2480 | /* | 2459 | /* |
2481 | * In case of Host Controller v3.00, find out whether clock | 2460 | * In case of Host Controller v3.00, find out whether clock |
2482 | * multiplier is supported. | 2461 | * multiplier is supported. |
@@ -2509,10 +2488,26 @@ int sdhci_add_host(struct sdhci_host *host) | |||
2509 | } else | 2488 | } else |
2510 | mmc->f_min = host->max_clk / SDHCI_MAX_DIV_SPEC_200; | 2489 | mmc->f_min = host->max_clk / SDHCI_MAX_DIV_SPEC_200; |
2511 | 2490 | ||
2491 | host->timeout_clk = | ||
2492 | (caps[0] & SDHCI_TIMEOUT_CLK_MASK) >> SDHCI_TIMEOUT_CLK_SHIFT; | ||
2493 | if (host->timeout_clk == 0) { | ||
2494 | if (host->ops->get_timeout_clock) { | ||
2495 | host->timeout_clk = host->ops->get_timeout_clock(host); | ||
2496 | } else if (!(host->quirks & | ||
2497 | SDHCI_QUIRK_DATA_TIMEOUT_USES_SDCLK)) { | ||
2498 | printk(KERN_ERR | ||
2499 | "%s: Hardware doesn't specify timeout clock " | ||
2500 | "frequency.\n", mmc_hostname(mmc)); | ||
2501 | return -ENODEV; | ||
2502 | } | ||
2503 | } | ||
2504 | if (caps[0] & SDHCI_TIMEOUT_CLK_UNIT) | ||
2505 | host->timeout_clk *= 1000; | ||
2506 | |||
2512 | if (host->quirks & SDHCI_QUIRK_DATA_TIMEOUT_USES_SDCLK) | 2507 | if (host->quirks & SDHCI_QUIRK_DATA_TIMEOUT_USES_SDCLK) |
2513 | mmc->max_discard_to = (1 << 27) / (mmc->f_max / 1000); | 2508 | host->timeout_clk = mmc->f_max / 1000; |
2514 | else | 2509 | |
2515 | mmc->max_discard_to = (1 << 27) / host->timeout_clk; | 2510 | mmc->max_discard_to = (1 << 27) / host->timeout_clk; |
2516 | 2511 | ||
2517 | mmc->caps |= MMC_CAP_SDIO_IRQ | MMC_CAP_ERASE | MMC_CAP_CMD23; | 2512 | mmc->caps |= MMC_CAP_SDIO_IRQ | MMC_CAP_ERASE | MMC_CAP_CMD23; |
2518 | 2513 | ||
diff --git a/drivers/mmc/host/tmio_mmc.c b/drivers/mmc/host/tmio_mmc.c index 8d185de90d20..44a9668c4b7a 100644 --- a/drivers/mmc/host/tmio_mmc.c +++ b/drivers/mmc/host/tmio_mmc.c | |||
@@ -27,7 +27,6 @@ | |||
27 | static int tmio_mmc_suspend(struct platform_device *dev, pm_message_t state) | 27 | static int tmio_mmc_suspend(struct platform_device *dev, pm_message_t state) |
28 | { | 28 | { |
29 | const struct mfd_cell *cell = mfd_get_cell(dev); | 29 | const struct mfd_cell *cell = mfd_get_cell(dev); |
30 | struct mmc_host *mmc = platform_get_drvdata(dev); | ||
31 | int ret; | 30 | int ret; |
32 | 31 | ||
33 | ret = tmio_mmc_host_suspend(&dev->dev); | 32 | ret = tmio_mmc_host_suspend(&dev->dev); |
@@ -42,7 +41,6 @@ static int tmio_mmc_suspend(struct platform_device *dev, pm_message_t state) | |||
42 | static int tmio_mmc_resume(struct platform_device *dev) | 41 | static int tmio_mmc_resume(struct platform_device *dev) |
43 | { | 42 | { |
44 | const struct mfd_cell *cell = mfd_get_cell(dev); | 43 | const struct mfd_cell *cell = mfd_get_cell(dev); |
45 | struct mmc_host *mmc = platform_get_drvdata(dev); | ||
46 | int ret = 0; | 44 | int ret = 0; |
47 | 45 | ||
48 | /* Tell the MFD core we are ready to be enabled */ | 46 | /* Tell the MFD core we are ready to be enabled */ |