diff options
Diffstat (limited to 'arch/arm/mach-u300/mmc.c')
-rw-r--r-- | arch/arm/mach-u300/mmc.c | 22 |
1 files changed, 20 insertions, 2 deletions
diff --git a/arch/arm/mach-u300/mmc.c b/arch/arm/mach-u300/mmc.c index 585cc013639d..7b6b016786bb 100644 --- a/arch/arm/mach-u300/mmc.c +++ b/arch/arm/mach-u300/mmc.c | |||
@@ -19,15 +19,16 @@ | |||
19 | #include <linux/regulator/consumer.h> | 19 | #include <linux/regulator/consumer.h> |
20 | #include <linux/regulator/machine.h> | 20 | #include <linux/regulator/machine.h> |
21 | #include <linux/gpio.h> | 21 | #include <linux/gpio.h> |
22 | #include <linux/amba/mmci.h> | ||
22 | 23 | ||
23 | #include <asm/mach/mmc.h> | ||
24 | #include "mmc.h" | 24 | #include "mmc.h" |
25 | #include "padmux.h" | ||
25 | 26 | ||
26 | struct mmci_card_event { | 27 | struct mmci_card_event { |
27 | struct input_dev *mmc_input; | 28 | struct input_dev *mmc_input; |
28 | int mmc_inserted; | 29 | int mmc_inserted; |
29 | struct work_struct workq; | 30 | struct work_struct workq; |
30 | struct mmc_platform_data mmc0_plat_data; | 31 | struct mmci_platform_data mmc0_plat_data; |
31 | }; | 32 | }; |
32 | 33 | ||
33 | static unsigned int mmc_status(struct device *dev) | 34 | static unsigned int mmc_status(struct device *dev) |
@@ -146,6 +147,7 @@ int __devinit mmc_init(struct amba_device *adev) | |||
146 | { | 147 | { |
147 | struct mmci_card_event *mmci_card; | 148 | struct mmci_card_event *mmci_card; |
148 | struct device *mmcsd_device = &adev->dev; | 149 | struct device *mmcsd_device = &adev->dev; |
150 | struct pmx *pmx; | ||
149 | int ret = 0; | 151 | int ret = 0; |
150 | 152 | ||
151 | mmci_card = kzalloc(sizeof(struct mmci_card_event), GFP_KERNEL); | 153 | mmci_card = kzalloc(sizeof(struct mmci_card_event), GFP_KERNEL); |
@@ -158,6 +160,8 @@ int __devinit mmc_init(struct amba_device *adev) | |||
158 | mmci_card->mmc0_plat_data.status = mmc_status; | 160 | mmci_card->mmc0_plat_data.status = mmc_status; |
159 | mmci_card->mmc0_plat_data.gpio_wp = -1; | 161 | mmci_card->mmc0_plat_data.gpio_wp = -1; |
160 | mmci_card->mmc0_plat_data.gpio_cd = -1; | 162 | mmci_card->mmc0_plat_data.gpio_cd = -1; |
163 | mmci_card->mmc0_plat_data.capabilities = MMC_CAP_MMC_HIGHSPEED | | ||
164 | MMC_CAP_SD_HIGHSPEED | MMC_CAP_4_BIT_DATA; | ||
161 | 165 | ||
162 | mmcsd_device->platform_data = (void *) &mmci_card->mmc0_plat_data; | 166 | mmcsd_device->platform_data = (void *) &mmci_card->mmc0_plat_data; |
163 | 167 | ||
@@ -207,6 +211,20 @@ int __devinit mmc_init(struct amba_device *adev) | |||
207 | 211 | ||
208 | input_set_drvdata(mmci_card->mmc_input, mmci_card); | 212 | input_set_drvdata(mmci_card->mmc_input, mmci_card); |
209 | 213 | ||
214 | /* | ||
215 | * Setup padmuxing for MMC. Since this must always be | ||
216 | * compiled into the kernel, pmx is never released. | ||
217 | */ | ||
218 | pmx = pmx_get(mmcsd_device, U300_APP_PMX_MMC_SETTING); | ||
219 | |||
220 | if (IS_ERR(pmx)) | ||
221 | pr_warning("Could not get padmux handle\n"); | ||
222 | else { | ||
223 | ret = pmx_activate(mmcsd_device, pmx); | ||
224 | if (IS_ERR_VALUE(ret)) | ||
225 | pr_warning("Could not activate padmuxing\n"); | ||
226 | } | ||
227 | |||
210 | ret = gpio_register_callback(U300_GPIO_PIN_MMC_CD, mmci_callback, | 228 | ret = gpio_register_callback(U300_GPIO_PIN_MMC_CD, mmci_callback, |
211 | mmci_card); | 229 | mmci_card); |
212 | 230 | ||