From patchwork Sun Sep 6 18:56:21 2009 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Madhusudhan X-Patchwork-Id: 45988 Received: from vger.kernel.org (vger.kernel.org [209.132.176.167]) by demeter.kernel.org (8.14.2/8.14.2) with ESMTP id n86IuTLp018995 for ; Sun, 6 Sep 2009 18:56:29 GMT Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1758108AbZIFS4Z (ORCPT ); Sun, 6 Sep 2009 14:56:25 -0400 Received: (majordomo@vger.kernel.org) by vger.kernel.org id S1758100AbZIFS4Z (ORCPT ); Sun, 6 Sep 2009 14:56:25 -0400 Received: from comal.ext.ti.com ([198.47.26.152]:57607 "EHLO comal.ext.ti.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1758089AbZIFS4Y (ORCPT ); Sun, 6 Sep 2009 14:56:24 -0400 Received: from dlep35.itg.ti.com ([157.170.170.118]) by comal.ext.ti.com (8.13.7/8.13.7) with ESMTP id n86IuMLF001440 for ; Sun, 6 Sep 2009 13:56:27 -0500 Received: from webmail.ti.com (localhost [127.0.0.1]) by dlep35.itg.ti.com (8.13.7/8.13.7) with ESMTP id n86IuKYF024335 for ; Sun, 6 Sep 2009 13:56:21 -0500 (CDT) Received: from 192.168.10.88 (proxying for 128.247.79.84) (SquirrelMail authenticated user x0070977); by dbdmail.itg.ti.com with HTTP; Mon, 7 Sep 2009 00:26:21 +0530 (IST) Message-ID: <38467.192.168.10.88.1252263381.squirrel@dbdmail.itg.ti.com> Date: Mon, 7 Sep 2009 00:26:21 +0530 (IST) Subject: [PATCH]Optimize the delay in MMC power sequence From: "Madhusudhan Chikkature" To: linux-omap@vger.kernel.org User-Agent: SquirrelMail/1.4.3a X-Mailer: SquirrelMail/1.4.3a MIME-Version: 1.0 X-Priority: 3 (Normal) Importance: Normal Sender: linux-omap-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-omap@vger.kernel.org commit 004a049bbab47d382a741d8e8fc6a1b9b44b36ac Author: Madhu Date: Sun Sep 6 13:18:21 2009 -0400 Replace the 100mS delay in the MMC power sequence with an appropriate delay based on the measurements taken for VDDS stability on SDP with T2 power IC. The delay in the power down sequence is not needed since it is taken care in the power up sequence. Signed-off-by: Madhusudhan Chikkature return ret; --- To unsubscribe from this list: send the line "unsubscribe linux-omap" in the body of a message to majordomo@vger.kernel.org More majordomo info at http://vger.kernel.org/majordomo-info.html diff --git a/arch/arm/mach-omap2/mmc-twl4030.c b/arch/arm/mach-omap2/mmc-twl4030.c index 3c04c2f..6a9be61 100644 --- a/arch/arm/mach-omap2/mmc-twl4030.c +++ b/arch/arm/mach-omap2/mmc-twl4030.c @@ -237,30 +237,27 @@ static int twl_mmc1_set_power(struct device *dev, int slot, int power_on, reg &= ~OMAP2_PBIASLITEPWRDNZ0; omap_ctrl_writel(reg, control_pbias_offset); - ret = mmc_regulator_set_ocr(c->vcc, vdd); - - /* 100ms delay required for PBIAS configuration */ - msleep(100); reg = omap_ctrl_readl(control_pbias_offset); - reg |= (OMAP2_PBIASLITEPWRDNZ0 | OMAP2_PBIASSPEEDCTRL0); if ((1 << vdd) <= MMC_VDD_165_195) reg &= ~OMAP2_PBIASLITEVMODE0; else reg |= OMAP2_PBIASLITEVMODE0; omap_ctrl_writel(reg, control_pbias_offset); + + ret = mmc_regulator_set_ocr(c->vcc, vdd); + + /* 400uS required for VDDS to stable */ + udelay(400); + + reg = omap_ctrl_readl(control_pbias_offset); + reg |= OMAP2_PBIASLITEPWRDNZ0; + omap_ctrl_writel(reg, control_pbias_offset); } else { reg = omap_ctrl_readl(control_pbias_offset); reg &= ~OMAP2_PBIASLITEPWRDNZ0; omap_ctrl_writel(reg, control_pbias_offset); ret = mmc_regulator_set_ocr(c->vcc, 0); - - /* 100ms delay required for PBIAS configuration */ - msleep(100); - reg = omap_ctrl_readl(control_pbias_offset); - reg |= (OMAP2_PBIASSPEEDCTRL0 | OMAP2_PBIASLITEPWRDNZ0 | - OMAP2_PBIASLITEVMODE0); - omap_ctrl_writel(reg, control_pbias_offset); }