From patchwork Mon Mar 7 18:48:03 2011 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Guennadi Liakhovetski X-Patchwork-Id: 616461 Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by demeter1.kernel.org (8.14.4/8.14.3) with ESMTP id p27Im8l3030437 for ; Mon, 7 Mar 2011 18:48:12 GMT Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1755607Ab1CGSsH (ORCPT ); Mon, 7 Mar 2011 13:48:07 -0500 Received: from moutng.kundenserver.de ([212.227.17.10]:58864 "EHLO moutng.kundenserver.de" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1755562Ab1CGSsG (ORCPT ); Mon, 7 Mar 2011 13:48:06 -0500 Received: from axis700.grange (pD9EB8CE6.dip0.t-ipconnect.de [217.235.140.230]) by mrelayeu.kundenserver.de (node=mrbap1) with ESMTP (Nemesis) id 0MCfaM-1PoO013jAQ-009dZa; Mon, 07 Mar 2011 19:48:04 +0100 Received: by axis700.grange (Postfix, from userid 1000) id 8E0DE189B86; Mon, 7 Mar 2011 19:48:03 +0100 (CET) Received: from localhost (localhost [127.0.0.1]) by axis700.grange (Postfix) with ESMTP id 8BB37189B85; Mon, 7 Mar 2011 19:48:03 +0100 (CET) Date: Mon, 7 Mar 2011 19:48:03 +0100 (CET) From: Guennadi Liakhovetski X-X-Sender: lyakh@axis700.grange To: linux-sh@vger.kernel.org cc: linux-mmc@vger.kernel.org, Chris Ball , Ian Molton Subject: [PATCH/RFC 5/5] mmc: tmio: support aggressive clock gating In-Reply-To: Message-ID: References: MIME-Version: 1.0 X-Provags-ID: V02:K0:HrwGSyFb0q36K64JJQqdKhM0I5qm7cGaN6+rtJnYR0I Zpc6tz2mUQ6Q1jTt9TTl4xSjMS3x16JP859Vwms+cejqhMBBnf I7guWlHUUHYrsTDm/Vi1xlVWPr7Bj/gUwZsDhSkI1liU9Q90xt 4WrqBBYHn6d467vCTxpKZKkpUaVlufCf4NmXl8Xx0CSnPxh8PK 1TvE+x1S6HWXi7B7Ym7gZ6bcIzDW2LAWwhZ8otJlsw= Sender: linux-mmc-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-mmc@vger.kernel.org X-Greylist: IP, sender and recipient auto-whitelisted, not delayed by milter-greylist-4.2.6 (demeter1.kernel.org [140.211.167.41]); Mon, 07 Mar 2011 18:48:13 +0000 (UTC) diff --git a/drivers/mmc/host/tmio_mmc.c b/drivers/mmc/host/tmio_mmc.c index 5e880c06..13e447a 100644 --- a/drivers/mmc/host/tmio_mmc.c +++ b/drivers/mmc/host/tmio_mmc.c @@ -1155,19 +1155,18 @@ static void tmio_mmc_set_ios(struct mmc_host *mmc, struct mmc_ios *ios) tmio_mmc_set_clock(host, ios->clock); /* Power sequence - OFF -> UP -> ON */ - switch (ios->power_mode) { - case MMC_POWER_OFF: /* power down SD bus */ - if (host->set_pwr) + if (ios->power_mode == MMC_POWER_OFF || !ios->clock) { + /* power down SD bus */ + if (ios->power_mode == MMC_POWER_OFF && host->set_pwr) host->set_pwr(host->pdev, 0); tmio_mmc_clk_stop(host); - break; - case MMC_POWER_ON: /* start bus clock */ - tmio_mmc_clk_start(host); - break; - case MMC_POWER_UP: /* power up SD bus */ + } else if (ios->power_mode == MMC_POWER_UP) { + /* power up SD bus */ if (host->set_pwr) host->set_pwr(host->pdev, 1); - break; + } else { + /* start bus clock */ + tmio_mmc_clk_start(host); } switch (ios->bus_width) {