diff options
-rw-r--r-- | arch/arm/mach-imx/clk-imx27.c | 12 | ||||
-rw-r--r-- | arch/arm/mach-imx/clk-imx31.c | 4 | ||||
-rw-r--r-- | arch/arm/mach-imx/devices/devices-common.h | 1 | ||||
-rw-r--r-- | arch/arm/mach-imx/devices/platform-mxc-mmc.c | 15 | ||||
-rw-r--r-- | arch/arm/mach-imx/mach-mx31_3ds.c | 2 | ||||
-rw-r--r-- | arch/arm/mach-imx/mach-mx31moboard.c | 4 | ||||
-rw-r--r-- | arch/arm/mach-imx/mach-pcm038.c | 2 | ||||
-rw-r--r-- | drivers/mmc/host/mxcmmc.c | 31 |
8 files changed, 50 insertions, 21 deletions
diff --git a/arch/arm/mach-imx/clk-imx27.c b/arch/arm/mach-imx/clk-imx27.c index 6170c03d4905..46764d864232 100644 --- a/arch/arm/mach-imx/clk-imx27.c +++ b/arch/arm/mach-imx/clk-imx27.c | |||
@@ -212,12 +212,12 @@ int __init mx27_clocks_init(unsigned long fref) | |||
212 | clk_register_clkdev(clk[gpt6_ipg_gate], "ipg", "imx-gpt.5"); | 212 | clk_register_clkdev(clk[gpt6_ipg_gate], "ipg", "imx-gpt.5"); |
213 | clk_register_clkdev(clk[per1_gate], "per", "imx-gpt.5"); | 213 | clk_register_clkdev(clk[per1_gate], "per", "imx-gpt.5"); |
214 | clk_register_clkdev(clk[pwm_ipg_gate], NULL, "mxc_pwm.0"); | 214 | clk_register_clkdev(clk[pwm_ipg_gate], NULL, "mxc_pwm.0"); |
215 | clk_register_clkdev(clk[per2_gate], "per", "mxc-mmc.0"); | 215 | clk_register_clkdev(clk[per2_gate], "per", "imx21-mmc.0"); |
216 | clk_register_clkdev(clk[sdhc1_ipg_gate], "ipg", "mxc-mmc.0"); | 216 | clk_register_clkdev(clk[sdhc1_ipg_gate], "ipg", "imx21-mmc.0"); |
217 | clk_register_clkdev(clk[per2_gate], "per", "mxc-mmc.1"); | 217 | clk_register_clkdev(clk[per2_gate], "per", "imx21-mmc.1"); |
218 | clk_register_clkdev(clk[sdhc2_ipg_gate], "ipg", "mxc-mmc.1"); | 218 | clk_register_clkdev(clk[sdhc2_ipg_gate], "ipg", "imx21-mmc.1"); |
219 | clk_register_clkdev(clk[per2_gate], "per", "mxc-mmc.2"); | 219 | clk_register_clkdev(clk[per2_gate], "per", "imx21-mmc.2"); |
220 | clk_register_clkdev(clk[sdhc2_ipg_gate], "ipg", "mxc-mmc.2"); | 220 | clk_register_clkdev(clk[sdhc2_ipg_gate], "ipg", "imx21-mmc.2"); |
221 | clk_register_clkdev(clk[cspi1_ipg_gate], NULL, "imx27-cspi.0"); | 221 | clk_register_clkdev(clk[cspi1_ipg_gate], NULL, "imx27-cspi.0"); |
222 | clk_register_clkdev(clk[cspi2_ipg_gate], NULL, "imx27-cspi.1"); | 222 | clk_register_clkdev(clk[cspi2_ipg_gate], NULL, "imx27-cspi.1"); |
223 | clk_register_clkdev(clk[cspi3_ipg_gate], NULL, "imx27-cspi.2"); | 223 | clk_register_clkdev(clk[cspi3_ipg_gate], NULL, "imx27-cspi.2"); |
diff --git a/arch/arm/mach-imx/clk-imx31.c b/arch/arm/mach-imx/clk-imx31.c index d9ff16e2b1e2..1277f732d1f9 100644 --- a/arch/arm/mach-imx/clk-imx31.c +++ b/arch/arm/mach-imx/clk-imx31.c | |||
@@ -159,8 +159,8 @@ int __init mx31_clocks_init(unsigned long fref) | |||
159 | clk_register_clkdev(clk[i2c2_gate], NULL, "imx21-i2c.1"); | 159 | clk_register_clkdev(clk[i2c2_gate], NULL, "imx21-i2c.1"); |
160 | clk_register_clkdev(clk[i2c3_gate], NULL, "imx21-i2c.2"); | 160 | clk_register_clkdev(clk[i2c3_gate], NULL, "imx21-i2c.2"); |
161 | clk_register_clkdev(clk[owire_gate], NULL, "mxc_w1.0"); | 161 | clk_register_clkdev(clk[owire_gate], NULL, "mxc_w1.0"); |
162 | clk_register_clkdev(clk[sdhc1_gate], NULL, "mxc-mmc.0"); | 162 | clk_register_clkdev(clk[sdhc1_gate], NULL, "imx31-mmc.0"); |
163 | clk_register_clkdev(clk[sdhc2_gate], NULL, "mxc-mmc.1"); | 163 | clk_register_clkdev(clk[sdhc2_gate], NULL, "imx31-mmc.1"); |
164 | clk_register_clkdev(clk[ssi1_gate], NULL, "imx-ssi.0"); | 164 | clk_register_clkdev(clk[ssi1_gate], NULL, "imx-ssi.0"); |
165 | clk_register_clkdev(clk[ssi2_gate], NULL, "imx-ssi.1"); | 165 | clk_register_clkdev(clk[ssi2_gate], NULL, "imx-ssi.1"); |
166 | clk_register_clkdev(clk[firi_gate], "firi", NULL); | 166 | clk_register_clkdev(clk[firi_gate], "firi", NULL); |
diff --git a/arch/arm/mach-imx/devices/devices-common.h b/arch/arm/mach-imx/devices/devices-common.h index d213da9dfd93..4caf1c61e350 100644 --- a/arch/arm/mach-imx/devices/devices-common.h +++ b/arch/arm/mach-imx/devices/devices-common.h | |||
@@ -246,6 +246,7 @@ struct platform_device *__init imx_add_mxc_ehci( | |||
246 | 246 | ||
247 | #include <linux/platform_data/mmc-mxcmmc.h> | 247 | #include <linux/platform_data/mmc-mxcmmc.h> |
248 | struct imx_mxc_mmc_data { | 248 | struct imx_mxc_mmc_data { |
249 | const char *devid; | ||
249 | int id; | 250 | int id; |
250 | resource_size_t iobase; | 251 | resource_size_t iobase; |
251 | resource_size_t iosize; | 252 | resource_size_t iosize; |
diff --git a/arch/arm/mach-imx/devices/platform-mxc-mmc.c b/arch/arm/mach-imx/devices/platform-mxc-mmc.c index ce90ab0c22fc..487f61cfbc8f 100644 --- a/arch/arm/mach-imx/devices/platform-mxc-mmc.c +++ b/arch/arm/mach-imx/devices/platform-mxc-mmc.c | |||
@@ -10,21 +10,22 @@ | |||
10 | #include <mach/hardware.h> | 10 | #include <mach/hardware.h> |
11 | #include "devices-common.h" | 11 | #include "devices-common.h" |
12 | 12 | ||
13 | #define imx_mxc_mmc_data_entry_single(soc, _id, _hwid, _size) \ | 13 | #define imx_mxc_mmc_data_entry_single(soc, _devid, _id, _hwid, _size) \ |
14 | { \ | 14 | { \ |
15 | .devid = _devid, \ | ||
15 | .id = _id, \ | 16 | .id = _id, \ |
16 | .iobase = soc ## _SDHC ## _hwid ## _BASE_ADDR, \ | 17 | .iobase = soc ## _SDHC ## _hwid ## _BASE_ADDR, \ |
17 | .iosize = _size, \ | 18 | .iosize = _size, \ |
18 | .irq = soc ## _INT_SDHC ## _hwid, \ | 19 | .irq = soc ## _INT_SDHC ## _hwid, \ |
19 | .dmareq = soc ## _DMA_REQ_SDHC ## _hwid, \ | 20 | .dmareq = soc ## _DMA_REQ_SDHC ## _hwid, \ |
20 | } | 21 | } |
21 | #define imx_mxc_mmc_data_entry(soc, _id, _hwid, _size) \ | 22 | #define imx_mxc_mmc_data_entry(soc, _devid, _id, _hwid, _size) \ |
22 | [_id] = imx_mxc_mmc_data_entry_single(soc, _id, _hwid, _size) | 23 | [_id] = imx_mxc_mmc_data_entry_single(soc, _devid, _id, _hwid, _size) |
23 | 24 | ||
24 | #ifdef CONFIG_SOC_IMX21 | 25 | #ifdef CONFIG_SOC_IMX21 |
25 | const struct imx_mxc_mmc_data imx21_mxc_mmc_data[] __initconst = { | 26 | const struct imx_mxc_mmc_data imx21_mxc_mmc_data[] __initconst = { |
26 | #define imx21_mxc_mmc_data_entry(_id, _hwid) \ | 27 | #define imx21_mxc_mmc_data_entry(_id, _hwid) \ |
27 | imx_mxc_mmc_data_entry(MX21, _id, _hwid, SZ_4K) | 28 | imx_mxc_mmc_data_entry(MX21, "imx21-mmc", _id, _hwid, SZ_4K) |
28 | imx21_mxc_mmc_data_entry(0, 1), | 29 | imx21_mxc_mmc_data_entry(0, 1), |
29 | imx21_mxc_mmc_data_entry(1, 2), | 30 | imx21_mxc_mmc_data_entry(1, 2), |
30 | }; | 31 | }; |
@@ -33,7 +34,7 @@ const struct imx_mxc_mmc_data imx21_mxc_mmc_data[] __initconst = { | |||
33 | #ifdef CONFIG_SOC_IMX27 | 34 | #ifdef CONFIG_SOC_IMX27 |
34 | const struct imx_mxc_mmc_data imx27_mxc_mmc_data[] __initconst = { | 35 | const struct imx_mxc_mmc_data imx27_mxc_mmc_data[] __initconst = { |
35 | #define imx27_mxc_mmc_data_entry(_id, _hwid) \ | 36 | #define imx27_mxc_mmc_data_entry(_id, _hwid) \ |
36 | imx_mxc_mmc_data_entry(MX27, _id, _hwid, SZ_4K) | 37 | imx_mxc_mmc_data_entry(MX27, "imx21-mmc", _id, _hwid, SZ_4K) |
37 | imx27_mxc_mmc_data_entry(0, 1), | 38 | imx27_mxc_mmc_data_entry(0, 1), |
38 | imx27_mxc_mmc_data_entry(1, 2), | 39 | imx27_mxc_mmc_data_entry(1, 2), |
39 | }; | 40 | }; |
@@ -42,7 +43,7 @@ const struct imx_mxc_mmc_data imx27_mxc_mmc_data[] __initconst = { | |||
42 | #ifdef CONFIG_SOC_IMX31 | 43 | #ifdef CONFIG_SOC_IMX31 |
43 | const struct imx_mxc_mmc_data imx31_mxc_mmc_data[] __initconst = { | 44 | const struct imx_mxc_mmc_data imx31_mxc_mmc_data[] __initconst = { |
44 | #define imx31_mxc_mmc_data_entry(_id, _hwid) \ | 45 | #define imx31_mxc_mmc_data_entry(_id, _hwid) \ |
45 | imx_mxc_mmc_data_entry(MX31, _id, _hwid, SZ_16K) | 46 | imx_mxc_mmc_data_entry(MX31, "imx31-mmc", _id, _hwid, SZ_16K) |
46 | imx31_mxc_mmc_data_entry(0, 1), | 47 | imx31_mxc_mmc_data_entry(0, 1), |
47 | imx31_mxc_mmc_data_entry(1, 2), | 48 | imx31_mxc_mmc_data_entry(1, 2), |
48 | }; | 49 | }; |
@@ -67,7 +68,7 @@ struct platform_device *__init imx_add_mxc_mmc( | |||
67 | .flags = IORESOURCE_DMA, | 68 | .flags = IORESOURCE_DMA, |
68 | }, | 69 | }, |
69 | }; | 70 | }; |
70 | return imx_add_platform_device_dmamask("mxc-mmc", data->id, | 71 | return imx_add_platform_device_dmamask(data->devid, data->id, |
71 | res, ARRAY_SIZE(res), | 72 | res, ARRAY_SIZE(res), |
72 | pdata, sizeof(*pdata), DMA_BIT_MASK(32)); | 73 | pdata, sizeof(*pdata), DMA_BIT_MASK(32)); |
73 | } | 74 | } |
diff --git a/arch/arm/mach-imx/mach-mx31_3ds.c b/arch/arm/mach-imx/mach-mx31_3ds.c index 5377c88c9ceb..0333567ca5a1 100644 --- a/arch/arm/mach-imx/mach-mx31_3ds.c +++ b/arch/arm/mach-imx/mach-mx31_3ds.c | |||
@@ -393,7 +393,7 @@ static struct regulator_init_data gpo_init = { | |||
393 | }; | 393 | }; |
394 | 394 | ||
395 | static struct regulator_consumer_supply vmmc2_consumers[] = { | 395 | static struct regulator_consumer_supply vmmc2_consumers[] = { |
396 | REGULATOR_SUPPLY("vmmc", "mxc-mmc.0"), | 396 | REGULATOR_SUPPLY("vmmc", "imx31-mmc.0"), |
397 | }; | 397 | }; |
398 | 398 | ||
399 | static struct regulator_init_data vmmc2_init = { | 399 | static struct regulator_init_data vmmc2_init = { |
diff --git a/arch/arm/mach-imx/mach-mx31moboard.c b/arch/arm/mach-imx/mach-mx31moboard.c index e719c767bf68..31c7d05cc33c 100644 --- a/arch/arm/mach-imx/mach-mx31moboard.c +++ b/arch/arm/mach-imx/mach-mx31moboard.c | |||
@@ -175,11 +175,11 @@ static const struct spi_imx_master moboard_spi1_pdata __initconst = { | |||
175 | 175 | ||
176 | static struct regulator_consumer_supply sdhc_consumers[] = { | 176 | static struct regulator_consumer_supply sdhc_consumers[] = { |
177 | { | 177 | { |
178 | .dev_name = "mxc-mmc.0", | 178 | .dev_name = "imx31-mmc.0", |
179 | .supply = "sdhc0_vcc", | 179 | .supply = "sdhc0_vcc", |
180 | }, | 180 | }, |
181 | { | 181 | { |
182 | .dev_name = "mxc-mmc.1", | 182 | .dev_name = "imx31-mmc.1", |
183 | .supply = "sdhc1_vcc", | 183 | .supply = "sdhc1_vcc", |
184 | }, | 184 | }, |
185 | }; | 185 | }; |
diff --git a/arch/arm/mach-imx/mach-pcm038.c b/arch/arm/mach-imx/mach-pcm038.c index 4a5234003f39..8bf95f5741c4 100644 --- a/arch/arm/mach-imx/mach-pcm038.c +++ b/arch/arm/mach-imx/mach-pcm038.c | |||
@@ -212,7 +212,7 @@ static const struct spi_imx_master pcm038_spi0_data __initconst = { | |||
212 | 212 | ||
213 | static struct regulator_consumer_supply sdhc1_consumers[] = { | 213 | static struct regulator_consumer_supply sdhc1_consumers[] = { |
214 | { | 214 | { |
215 | .dev_name = "mxc-mmc.1", | 215 | .dev_name = "imx21-mmc.1", |
216 | .supply = "sdhc_vcc", | 216 | .supply = "sdhc_vcc", |
217 | }, | 217 | }, |
218 | }; | 218 | }; |
diff --git a/drivers/mmc/host/mxcmmc.c b/drivers/mmc/host/mxcmmc.c index 565c2e4fac75..d735ba913f9b 100644 --- a/drivers/mmc/host/mxcmmc.c +++ b/drivers/mmc/host/mxcmmc.c | |||
@@ -41,7 +41,6 @@ | |||
41 | #include <linux/platform_data/mmc-mxcmmc.h> | 41 | #include <linux/platform_data/mmc-mxcmmc.h> |
42 | 42 | ||
43 | #include <linux/platform_data/dma-imx.h> | 43 | #include <linux/platform_data/dma-imx.h> |
44 | #include <mach/hardware.h> | ||
45 | 44 | ||
46 | #define DRIVER_NAME "mxc-mmc" | 45 | #define DRIVER_NAME "mxc-mmc" |
47 | #define MXCMCI_TIMEOUT_MS 10000 | 46 | #define MXCMCI_TIMEOUT_MS 10000 |
@@ -113,6 +112,11 @@ | |||
113 | #define INT_WRITE_OP_DONE_EN (1 << 1) | 112 | #define INT_WRITE_OP_DONE_EN (1 << 1) |
114 | #define INT_READ_OP_EN (1 << 0) | 113 | #define INT_READ_OP_EN (1 << 0) |
115 | 114 | ||
115 | enum mxcmci_type { | ||
116 | IMX21_MMC, | ||
117 | IMX31_MMC, | ||
118 | }; | ||
119 | |||
116 | struct mxcmci_host { | 120 | struct mxcmci_host { |
117 | struct mmc_host *mmc; | 121 | struct mmc_host *mmc; |
118 | struct resource *res; | 122 | struct resource *res; |
@@ -153,7 +157,26 @@ struct mxcmci_host { | |||
153 | struct imx_dma_data dma_data; | 157 | struct imx_dma_data dma_data; |
154 | 158 | ||
155 | struct timer_list watchdog; | 159 | struct timer_list watchdog; |
160 | enum mxcmci_type devtype; | ||
161 | }; | ||
162 | |||
163 | static struct platform_device_id mxcmci_devtype[] = { | ||
164 | { | ||
165 | .name = "imx21-mmc", | ||
166 | .driver_data = IMX21_MMC, | ||
167 | }, { | ||
168 | .name = "imx31-mmc", | ||
169 | .driver_data = IMX31_MMC, | ||
170 | }, { | ||
171 | /* sentinel */ | ||
172 | } | ||
156 | }; | 173 | }; |
174 | MODULE_DEVICE_TABLE(platform, mxcmci_devtype); | ||
175 | |||
176 | static inline int is_imx31_mmc(struct mxcmci_host *host) | ||
177 | { | ||
178 | return host->devtype == IMX31_MMC; | ||
179 | } | ||
157 | 180 | ||
158 | static void mxcmci_set_clk_rate(struct mxcmci_host *host, unsigned int clk_ios); | 181 | static void mxcmci_set_clk_rate(struct mxcmci_host *host, unsigned int clk_ios); |
159 | 182 | ||
@@ -843,6 +866,8 @@ static void mxcmci_enable_sdio_irq(struct mmc_host *mmc, int enable) | |||
843 | 866 | ||
844 | static void mxcmci_init_card(struct mmc_host *host, struct mmc_card *card) | 867 | static void mxcmci_init_card(struct mmc_host *host, struct mmc_card *card) |
845 | { | 868 | { |
869 | struct mxcmci_host *mxcmci = mmc_priv(host); | ||
870 | |||
846 | /* | 871 | /* |
847 | * MX3 SoCs have a silicon bug which corrupts CRC calculation of | 872 | * MX3 SoCs have a silicon bug which corrupts CRC calculation of |
848 | * multi-block transfers when connected SDIO peripheral doesn't | 873 | * multi-block transfers when connected SDIO peripheral doesn't |
@@ -850,7 +875,7 @@ static void mxcmci_init_card(struct mmc_host *host, struct mmc_card *card) | |||
850 | * One way to prevent this is to only allow 1-bit transfers. | 875 | * One way to prevent this is to only allow 1-bit transfers. |
851 | */ | 876 | */ |
852 | 877 | ||
853 | if (cpu_is_mx3() && card->type == MMC_TYPE_SDIO) | 878 | if (is_imx31_mmc(mxcmci) && card->type == MMC_TYPE_SDIO) |
854 | host->caps &= ~MMC_CAP_4_BIT_DATA; | 879 | host->caps &= ~MMC_CAP_4_BIT_DATA; |
855 | else | 880 | else |
856 | host->caps |= MMC_CAP_4_BIT_DATA; | 881 | host->caps |= MMC_CAP_4_BIT_DATA; |
@@ -948,6 +973,7 @@ static int mxcmci_probe(struct platform_device *pdev) | |||
948 | 973 | ||
949 | host->mmc = mmc; | 974 | host->mmc = mmc; |
950 | host->pdata = pdev->dev.platform_data; | 975 | host->pdata = pdev->dev.platform_data; |
976 | host->devtype = pdev->id_entry->driver_data; | ||
951 | spin_lock_init(&host->lock); | 977 | spin_lock_init(&host->lock); |
952 | 978 | ||
953 | mxcmci_init_ocr(host); | 979 | mxcmci_init_ocr(host); |
@@ -1120,6 +1146,7 @@ static const struct dev_pm_ops mxcmci_pm_ops = { | |||
1120 | static struct platform_driver mxcmci_driver = { | 1146 | static struct platform_driver mxcmci_driver = { |
1121 | .probe = mxcmci_probe, | 1147 | .probe = mxcmci_probe, |
1122 | .remove = mxcmci_remove, | 1148 | .remove = mxcmci_remove, |
1149 | .id_table = mxcmci_devtype, | ||
1123 | .driver = { | 1150 | .driver = { |
1124 | .name = DRIVER_NAME, | 1151 | .name = DRIVER_NAME, |
1125 | .owner = THIS_MODULE, | 1152 | .owner = THIS_MODULE, |