From patchwork Fri Mar 11 08:24:10 2011 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Guennadi Liakhovetski X-Patchwork-Id: 627791 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 p2B8O8UU012548 for ; Fri, 11 Mar 2011 08:24:17 GMT Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1752157Ab1CKIYR (ORCPT ); Fri, 11 Mar 2011 03:24:17 -0500 Received: from moutng.kundenserver.de ([212.227.17.8]:62518 "EHLO moutng.kundenserver.de" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1751950Ab1CKIYQ (ORCPT ); Fri, 11 Mar 2011 03:24:16 -0500 Received: from axis700.grange (pD9EB8C3C.dip0.t-ipconnect.de [217.235.140.60]) by mrelayeu.kundenserver.de (node=mrbap0) with ESMTP (Nemesis) id 0MbaU9-1Ph7DK0VFd-00J5Ut; Fri, 11 Mar 2011 09:24:11 +0100 Received: by axis700.grange (Postfix, from userid 1000) id C059E189B86; Fri, 11 Mar 2011 09:24:10 +0100 (CET) Received: from localhost (localhost [127.0.0.1]) by axis700.grange (Postfix) with ESMTP id BDFCC189B85; Fri, 11 Mar 2011 09:24:10 +0100 (CET) Date: Fri, 11 Mar 2011 09:24:10 +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 2/2 v2] mmc: tmio: support aggressive clock gating In-Reply-To: Message-ID: References: MIME-Version: 1.0 X-Provags-ID: V02:K0:uqxd2Bcf6HVrXYPgVp/iNqNVzToCyFLHdygICq8MKnw xg/q+mSCIHY8qdQgc9XnGG7eA33R94vwAUvUHJmPgYC+mDZC8s zbyEw8tZmM3l/8XgsMZ/QwRP+UQZ85LDxk6SByFCB7lFYJdaMZ D4nwKmtN1RgF3Iis8HHQcTz0Y426zDw8+w3XZgeR1R76VpdC0z ZkLxMjfrRw07+4FyVqxesUXyYsWHlvPCFD4Ha601Bw= 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]); Fri, 11 Mar 2011 08:24:17 +0000 (UTC) diff --git a/drivers/mmc/host/tmio_mmc_pio.c b/drivers/mmc/host/tmio_mmc_pio.c index 69772ab..e35e179 100644 --- a/drivers/mmc/host/tmio_mmc_pio.c +++ b/drivers/mmc/host/tmio_mmc_pio.c @@ -747,19 +747,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) {