diff options
-rw-r--r-- | arch/arm/mach-omap2/hsmmc.c | 42 |
1 files changed, 30 insertions, 12 deletions
diff --git a/arch/arm/mach-omap2/hsmmc.c b/arch/arm/mach-omap2/hsmmc.c index 97dfedce084b..59830d0eeb55 100644 --- a/arch/arm/mach-omap2/hsmmc.c +++ b/arch/arm/mach-omap2/hsmmc.c | |||
@@ -171,6 +171,17 @@ static void omap4_hsmmc1_after_set_reg(struct device *dev, int slot, | |||
171 | } | 171 | } |
172 | } | 172 | } |
173 | 173 | ||
174 | static void hsmmc2_select_input_clk_src(struct omap_mmc_platform_data *mmc) | ||
175 | { | ||
176 | u32 reg; | ||
177 | |||
178 | if (mmc->slots[0].internal_clock) { | ||
179 | reg = omap_ctrl_readl(control_devconf1_offset); | ||
180 | reg |= OMAP2_MMCSDIO2ADPCLKISEL; | ||
181 | omap_ctrl_writel(reg, control_devconf1_offset); | ||
182 | } | ||
183 | } | ||
184 | |||
174 | static void hsmmc23_before_set_reg(struct device *dev, int slot, | 185 | static void hsmmc23_before_set_reg(struct device *dev, int slot, |
175 | int power_on, int vdd) | 186 | int power_on, int vdd) |
176 | { | 187 | { |
@@ -179,16 +190,19 @@ static void hsmmc23_before_set_reg(struct device *dev, int slot, | |||
179 | if (mmc->slots[0].remux) | 190 | if (mmc->slots[0].remux) |
180 | mmc->slots[0].remux(dev, slot, power_on); | 191 | mmc->slots[0].remux(dev, slot, power_on); |
181 | 192 | ||
182 | if (power_on) { | 193 | if (power_on) |
183 | /* Only MMC2 supports a CLKIN */ | 194 | hsmmc2_select_input_clk_src(mmc); |
184 | if (mmc->slots[0].internal_clock) { | 195 | } |
185 | u32 reg; | ||
186 | 196 | ||
187 | reg = omap_ctrl_readl(control_devconf1_offset); | 197 | static int am35x_hsmmc2_set_power(struct device *dev, int slot, |
188 | reg |= OMAP2_MMCSDIO2ADPCLKISEL; | 198 | int power_on, int vdd) |
189 | omap_ctrl_writel(reg, control_devconf1_offset); | 199 | { |
190 | } | 200 | struct omap_mmc_platform_data *mmc = dev->platform_data; |
191 | } | 201 | |
202 | if (power_on) | ||
203 | hsmmc2_select_input_clk_src(mmc); | ||
204 | |||
205 | return 0; | ||
192 | } | 206 | } |
193 | 207 | ||
194 | static int nop_mmc_set_power(struct device *dev, int slot, int power_on, | 208 | static int nop_mmc_set_power(struct device *dev, int slot, int power_on, |
@@ -339,9 +353,7 @@ static int __init omap_hsmmc_pdata_init(struct omap2_hsmmc_info *c, | |||
339 | */ | 353 | */ |
340 | mmc->slots[0].ocr_mask = c->ocr_mask; | 354 | mmc->slots[0].ocr_mask = c->ocr_mask; |
341 | 355 | ||
342 | if (cpu_is_omap3517() || cpu_is_omap3505()) | 356 | if (!cpu_is_omap3517() && !cpu_is_omap3505()) |
343 | mmc->slots[0].set_power = nop_mmc_set_power; | ||
344 | else | ||
345 | mmc->slots[0].features |= HSMMC_HAS_PBIAS; | 357 | mmc->slots[0].features |= HSMMC_HAS_PBIAS; |
346 | 358 | ||
347 | if (cpu_is_omap44xx() && (omap_rev() > OMAP4430_REV_ES1_0)) | 359 | if (cpu_is_omap44xx() && (omap_rev() > OMAP4430_REV_ES1_0)) |
@@ -364,6 +376,9 @@ static int __init omap_hsmmc_pdata_init(struct omap2_hsmmc_info *c, | |||
364 | } | 376 | } |
365 | } | 377 | } |
366 | 378 | ||
379 | if (cpu_is_omap3517() || cpu_is_omap3505()) | ||
380 | mmc->slots[0].set_power = nop_mmc_set_power; | ||
381 | |||
367 | /* OMAP3630 HSMMC1 supports only 4-bit */ | 382 | /* OMAP3630 HSMMC1 supports only 4-bit */ |
368 | if (cpu_is_omap3630() && | 383 | if (cpu_is_omap3630() && |
369 | (c->caps & MMC_CAP_8_BIT_DATA)) { | 384 | (c->caps & MMC_CAP_8_BIT_DATA)) { |
@@ -373,6 +388,9 @@ static int __init omap_hsmmc_pdata_init(struct omap2_hsmmc_info *c, | |||
373 | } | 388 | } |
374 | break; | 389 | break; |
375 | case 2: | 390 | case 2: |
391 | if (cpu_is_omap3517() || cpu_is_omap3505()) | ||
392 | mmc->slots[0].set_power = am35x_hsmmc2_set_power; | ||
393 | |||
376 | if (c->ext_clock) | 394 | if (c->ext_clock) |
377 | c->transceiver = 1; | 395 | c->transceiver = 1; |
378 | if (c->transceiver && (c->caps & MMC_CAP_8_BIT_DATA)) { | 396 | if (c->transceiver && (c->caps & MMC_CAP_8_BIT_DATA)) { |