aboutsummaryrefslogtreecommitdiffstats
path: root/arch/arm/mach-omap2/hsmmc.c
diff options
context:
space:
mode:
authorIgor Grinberg <grinberg@compulab.co.il>2011-11-29 04:37:48 -0500
committerTony Lindgren <tony@atomide.com>2011-12-09 15:29:34 -0500
commite62245ba1caaf78d6fe2619266939c8e7caa150c (patch)
tree76a02c3f4587b080c555039f8fae0bd449a751c3 /arch/arm/mach-omap2/hsmmc.c
parentfac1d933f4691d59eb5f6ec02bb8eae8d5c68297 (diff)
ARM: OMAP: hsmmc: Add support for MMC 2 setup for AM35x
AM35x MMC 2 controller has internal clock loopback setting which cannot be utilized without this patch and thus SDIO devices connected to this controller and depend on this setting will fail to initialize. Signed-off-by: Igor Grinberg <grinberg@compulab.co.il> [tony@atomide.com: updated comments] Signed-off-by: Tony Lindgren <tony@atomide.com>
Diffstat (limited to 'arch/arm/mach-omap2/hsmmc.c')
-rw-r--r--arch/arm/mach-omap2/hsmmc.c42
1 files changed, 30 insertions, 12 deletions
diff --git a/arch/arm/mach-omap2/hsmmc.c b/arch/arm/mach-omap2/hsmmc.c
index 97dfedce084..59830d0eeb5 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
174static 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
174static void hsmmc23_before_set_reg(struct device *dev, int slot, 185static 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); 197static 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
194static int nop_mmc_set_power(struct device *dev, int slot, int power_on, 208static 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)) {