From: Tom Rini Date: Tue, 4 Nov 2014 10:56:01 -0500 Subject: [U-Boot] [PATCH v2 2/2] omap_hsmmc: Board-specific TWL4030 MMC power initializations In-Reply-To: <1414838144-4270-2-git-send-email-contact@paulk.fr> References: <1414517144-2183-1-git-send-email-contact@paulk.fr> <1414838144-4270-1-git-send-email-contact@paulk.fr> <1414838144-4270-2-git-send-email-contact@paulk.fr> Message-ID: <20141104155601.GJ15133@bill-the-cat> List-Id: MIME-Version: 1.0 Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit To: u-boot@lists.denx.de On Sat, Nov 01, 2014 at 11:35:44AM +0100, Paul Kocialkowski wrote: > Boards using the TWL4030 regulator may not all use the LDOs the same way > (e.g. MMC2 power can be controlled by another LDO than VMMC2). > This delegates TWL4030 MMC power initializations to board-specific functions, > that may still call twl4030_power_mmc_init for the default behavior. [snip] > +int board_mmc_power_init(void) > +{ > +#if defined(CONFIG_TWL4030_POWER) > + twl4030_power_mmc_init(); > + mdelay(100); /* ramp-up delay from Linux code */ > +#endif > + return 0; > +} > #endif I think we can do away with the #if defined(CONFIG_TWL4030_POWER) part here since all of these boards will fail pretty spectacularly without that being set and if someone does remove that a link error is better than a crazy runtime problem. [snip] > diff --git a/drivers/mmc/omap_hsmmc.c b/drivers/mmc/omap_hsmmc.c > index 5b0c302..6e93a07 100644 > --- a/drivers/mmc/omap_hsmmc.c > +++ b/drivers/mmc/omap_hsmmc.c > @@ -130,12 +130,7 @@ static unsigned char mmc_board_init(struct mmc *mmc) > pbias_lite = readl(&t2_base->pbias_lite); > pbias_lite &= ~(PBIASLITEPWRDNZ1 | PBIASLITEPWRDNZ0); > writel(pbias_lite, &t2_base->pbias_lite); > -#endif > -#if defined(CONFIG_TWL4030_POWER) > - twl4030_power_mmc_init(); > - mdelay(100); /* ramp-up delay from Linux code */ > -#endif > -#if defined(CONFIG_OMAP34XX) > + > writel(pbias_lite | PBIASLITEPWRDNZ1 | > PBIASSPEEDCTRL0 | PBIASLITEPWRDNZ0, > &t2_base->pbias_lite); Since it's not clear from the context here, it's OK to drop the check on CONFIG_OMAP34XX here since there's already a test on it above where diff cut us off? Thanks! -- Tom -------------- next part -------------- A non-text attachment was scrubbed... Name: signature.asc Type: application/pgp-signature Size: 836 bytes Desc: Digital signature URL: