diff options
Diffstat (limited to 'drivers')
-rw-r--r-- | drivers/clk/mxs/clk-imx23.c | 4 | ||||
-rw-r--r-- | drivers/clk/mxs/clk-imx28.c | 8 | ||||
-rw-r--r-- | drivers/mmc/host/mxs-mmc.c | 32 |
3 files changed, 28 insertions, 16 deletions
diff --git a/drivers/clk/mxs/clk-imx23.c b/drivers/clk/mxs/clk-imx23.c index 96562f5f92f..f7be225f544 100644 --- a/drivers/clk/mxs/clk-imx23.c +++ b/drivers/clk/mxs/clk-imx23.c | |||
@@ -93,8 +93,8 @@ static struct clk_lookup xbus_lookups[] __initdata = { | |||
93 | }; | 93 | }; |
94 | 94 | ||
95 | static struct clk_lookup ssp_lookups[] __initdata = { | 95 | static struct clk_lookup ssp_lookups[] __initdata = { |
96 | { .dev_id = "mxs-mmc.0", }, | 96 | { .dev_id = "imx23-mmc.0", }, |
97 | { .dev_id = "mxs-mmc.1", }, | 97 | { .dev_id = "imx23-mmc.1", }, |
98 | { .dev_id = "80010000.ssp", }, | 98 | { .dev_id = "80010000.ssp", }, |
99 | { .dev_id = "80034000.ssp", }, | 99 | { .dev_id = "80034000.ssp", }, |
100 | }; | 100 | }; |
diff --git a/drivers/clk/mxs/clk-imx28.c b/drivers/clk/mxs/clk-imx28.c index a7ff4f106ce..2826a2606a2 100644 --- a/drivers/clk/mxs/clk-imx28.c +++ b/drivers/clk/mxs/clk-imx28.c | |||
@@ -148,22 +148,22 @@ static struct clk_lookup xbus_lookups[] __initdata = { | |||
148 | }; | 148 | }; |
149 | 149 | ||
150 | static struct clk_lookup ssp0_lookups[] __initdata = { | 150 | static struct clk_lookup ssp0_lookups[] __initdata = { |
151 | { .dev_id = "mxs-mmc.0", }, | 151 | { .dev_id = "imx28-mmc.0", }, |
152 | { .dev_id = "80010000.ssp", }, | 152 | { .dev_id = "80010000.ssp", }, |
153 | }; | 153 | }; |
154 | 154 | ||
155 | static struct clk_lookup ssp1_lookups[] __initdata = { | 155 | static struct clk_lookup ssp1_lookups[] __initdata = { |
156 | { .dev_id = "mxs-mmc.1", }, | 156 | { .dev_id = "imx28-mmc.1", }, |
157 | { .dev_id = "80012000.ssp", }, | 157 | { .dev_id = "80012000.ssp", }, |
158 | }; | 158 | }; |
159 | 159 | ||
160 | static struct clk_lookup ssp2_lookups[] __initdata = { | 160 | static struct clk_lookup ssp2_lookups[] __initdata = { |
161 | { .dev_id = "mxs-mmc.2", }, | 161 | { .dev_id = "imx28-mmc.2", }, |
162 | { .dev_id = "80014000.ssp", }, | 162 | { .dev_id = "80014000.ssp", }, |
163 | }; | 163 | }; |
164 | 164 | ||
165 | static struct clk_lookup ssp3_lookups[] __initdata = { | 165 | static struct clk_lookup ssp3_lookups[] __initdata = { |
166 | { .dev_id = "mxs-mmc.3", }, | 166 | { .dev_id = "imx28-mmc.3", }, |
167 | { .dev_id = "80016000.ssp", }, | 167 | { .dev_id = "80016000.ssp", }, |
168 | }; | 168 | }; |
169 | 169 | ||
diff --git a/drivers/mmc/host/mxs-mmc.c b/drivers/mmc/host/mxs-mmc.c index a699a867376..92395563cd8 100644 --- a/drivers/mmc/host/mxs-mmc.c +++ b/drivers/mmc/host/mxs-mmc.c | |||
@@ -42,7 +42,6 @@ | |||
42 | #include <linux/pinctrl/consumer.h> | 42 | #include <linux/pinctrl/consumer.h> |
43 | #include <linux/stmp_device.h> | 43 | #include <linux/stmp_device.h> |
44 | 44 | ||
45 | #include <mach/mxs.h> | ||
46 | #include <mach/mmc.h> | 45 | #include <mach/mmc.h> |
47 | 46 | ||
48 | #define DRIVER_NAME "mxs-mmc" | 47 | #define DRIVER_NAME "mxs-mmc" |
@@ -50,8 +49,7 @@ | |||
50 | /* card detect polling timeout */ | 49 | /* card detect polling timeout */ |
51 | #define MXS_MMC_DETECT_TIMEOUT (HZ/2) | 50 | #define MXS_MMC_DETECT_TIMEOUT (HZ/2) |
52 | 51 | ||
53 | #define SSP_VERSION_LATEST 4 | 52 | #define ssp_is_old(host) ((host)->devid == IMX23_MMC) |
54 | #define ssp_is_old(host) ((host)->version < SSP_VERSION_LATEST) | ||
55 | 53 | ||
56 | /* SSP registers */ | 54 | /* SSP registers */ |
57 | #define HW_SSP_CTRL0 0x000 | 55 | #define HW_SSP_CTRL0 0x000 |
@@ -123,8 +121,6 @@ | |||
123 | #define HW_SSP_STATUS(h) (ssp_is_old(h) ? 0x0c0 : 0x100) | 121 | #define HW_SSP_STATUS(h) (ssp_is_old(h) ? 0x0c0 : 0x100) |
124 | #define BM_SSP_STATUS_CARD_DETECT (1 << 28) | 122 | #define BM_SSP_STATUS_CARD_DETECT (1 << 28) |
125 | #define BM_SSP_STATUS_SDIO_IRQ (1 << 17) | 123 | #define BM_SSP_STATUS_SDIO_IRQ (1 << 17) |
126 | #define HW_SSP_VERSION (cpu_is_mx23() ? 0x110 : 0x130) | ||
127 | #define BP_SSP_VERSION_MAJOR (24) | ||
128 | 124 | ||
129 | #define BF_SSP(value, field) (((value) << BP_SSP_##field) & BM_SSP_##field) | 125 | #define BF_SSP(value, field) (((value) << BP_SSP_##field) & BM_SSP_##field) |
130 | 126 | ||
@@ -139,6 +135,11 @@ | |||
139 | 135 | ||
140 | #define SSP_PIO_NUM 3 | 136 | #define SSP_PIO_NUM 3 |
141 | 137 | ||
138 | enum mxs_mmc_id { | ||
139 | IMX23_MMC, | ||
140 | IMX28_MMC, | ||
141 | }; | ||
142 | |||
142 | struct mxs_mmc_host { | 143 | struct mxs_mmc_host { |
143 | struct mmc_host *mmc; | 144 | struct mmc_host *mmc; |
144 | struct mmc_request *mrq; | 145 | struct mmc_request *mrq; |
@@ -158,7 +159,7 @@ struct mxs_mmc_host { | |||
158 | enum dma_transfer_direction slave_dirn; | 159 | enum dma_transfer_direction slave_dirn; |
159 | u32 ssp_pio_words[SSP_PIO_NUM]; | 160 | u32 ssp_pio_words[SSP_PIO_NUM]; |
160 | 161 | ||
161 | unsigned int version; | 162 | enum mxs_mmc_id devid; |
162 | unsigned char bus_width; | 163 | unsigned char bus_width; |
163 | spinlock_t lock; | 164 | spinlock_t lock; |
164 | int sdio_irq_en; | 165 | int sdio_irq_en; |
@@ -678,6 +679,19 @@ static bool mxs_mmc_dma_filter(struct dma_chan *chan, void *param) | |||
678 | return true; | 679 | return true; |
679 | } | 680 | } |
680 | 681 | ||
682 | static struct platform_device_id mxs_mmc_ids[] = { | ||
683 | { | ||
684 | .name = "imx23-mmc", | ||
685 | .driver_data = IMX23_MMC, | ||
686 | }, { | ||
687 | .name = "imx28-mmc", | ||
688 | .driver_data = IMX28_MMC, | ||
689 | }, { | ||
690 | /* sentinel */ | ||
691 | } | ||
692 | }; | ||
693 | MODULE_DEVICE_TABLE(platform, mxs_mmc_ids); | ||
694 | |||
681 | static int mxs_mmc_probe(struct platform_device *pdev) | 695 | static int mxs_mmc_probe(struct platform_device *pdev) |
682 | { | 696 | { |
683 | struct mxs_mmc_host *host; | 697 | struct mxs_mmc_host *host; |
@@ -712,10 +726,7 @@ static int mxs_mmc_probe(struct platform_device *pdev) | |||
712 | goto out_mmc_free; | 726 | goto out_mmc_free; |
713 | } | 727 | } |
714 | 728 | ||
715 | /* only major verion does matter */ | 729 | host->devid = pdev->id_entry->driver_data; |
716 | host->version = readl(host->base + HW_SSP_VERSION) >> | ||
717 | BP_SSP_VERSION_MAJOR; | ||
718 | |||
719 | host->mmc = mmc; | 730 | host->mmc = mmc; |
720 | host->res = r; | 731 | host->res = r; |
721 | host->dma_res = dmares; | 732 | host->dma_res = dmares; |
@@ -866,6 +877,7 @@ static const struct dev_pm_ops mxs_mmc_pm_ops = { | |||
866 | static struct platform_driver mxs_mmc_driver = { | 877 | static struct platform_driver mxs_mmc_driver = { |
867 | .probe = mxs_mmc_probe, | 878 | .probe = mxs_mmc_probe, |
868 | .remove = mxs_mmc_remove, | 879 | .remove = mxs_mmc_remove, |
880 | .id_table = mxs_mmc_ids, | ||
869 | .driver = { | 881 | .driver = { |
870 | .name = DRIVER_NAME, | 882 | .name = DRIVER_NAME, |
871 | .owner = THIS_MODULE, | 883 | .owner = THIS_MODULE, |