From patchwork Fri Feb 25 15:58:38 2011 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Guennadi Liakhovetski X-Patchwork-Id: 590341 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 p1PFwfCC029931 for ; Fri, 25 Feb 2011 15:58:42 GMT Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S932566Ab1BYP6k (ORCPT ); Fri, 25 Feb 2011 10:58:40 -0500 Received: from moutng.kundenserver.de ([212.227.126.186]:54770 "EHLO moutng.kundenserver.de" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S932411Ab1BYP6k (ORCPT ); Fri, 25 Feb 2011 10:58:40 -0500 Received: from axis700.grange (pD9EB8A36.dip0.t-ipconnect.de [217.235.138.54]) by mrelayeu.kundenserver.de (node=mreu2) with ESMTP (Nemesis) id 0MKdiF-1Pr53J3YAh-001u8R; Fri, 25 Feb 2011 16:58:39 +0100 Received: by axis700.grange (Postfix, from userid 1000) id 6AA6D189B80; Fri, 25 Feb 2011 16:58:38 +0100 (CET) Received: from localhost (localhost [127.0.0.1]) by axis700.grange (Postfix) with ESMTP id 637A8189B7F; Fri, 25 Feb 2011 16:58:38 +0100 (CET) Date: Fri, 25 Feb 2011 16:58:38 +0100 (CET) From: Guennadi Liakhovetski X-X-Sender: lyakh@axis700.grange To: linux-sh@vger.kernel.org cc: linux-mmc@vger.kernel.org Subject: [PATCH] mmc: sh_mmcif: support aggressive clock gating Message-ID: MIME-Version: 1.0 X-Provags-ID: V02:K0:VRzZv4vmqEkgO5qoL+lLs0gs2XpAcb1fH3BElRF8R/F gK4TUGbLCj9RlH9NlyMqjhOhKumrC6gaIcfIoMgGPe7pUAeGZb +SP9TXcru97lZdY+DspK88wKads7c3qr69sYqiFtXJfJ8SRh38 7UdUzp9J7DLFLh4wyI3Bb2+1TmhkheZyy/8awwOaXVDer1FoZu P32d73iD7evBv16/bwc14GHfGb+Po8JAVmzy1psFMU= 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, 25 Feb 2011 15:58:42 +0000 (UTC) diff --git a/drivers/mmc/host/sh_mmcif.c b/drivers/mmc/host/sh_mmcif.c index 12884c2..3d735da 100644 --- a/drivers/mmc/host/sh_mmcif.c +++ b/drivers/mmc/host/sh_mmcif.c @@ -850,15 +850,15 @@ static void sh_mmcif_set_ios(struct mmc_host *mmc, struct mmc_ios *ios) struct sh_mmcif_host *host = mmc_priv(mmc); struct sh_mmcif_plat_data *p = host->pd->dev.platform_data; - if (ios->power_mode == MMC_POWER_OFF) { + if (ios->power_mode == MMC_POWER_UP) { + if (p->set_pwr) + p->set_pwr(host->pd, ios->power_mode); + } else if (ios->power_mode == MMC_POWER_OFF || !ios->clock) { /* clock stop */ sh_mmcif_clock_control(host, 0); - if (p->down_pwr) + if (ios->power_mode == MMC_POWER_OFF && p->down_pwr) p->down_pwr(host->pd); return; - } else if (ios->power_mode == MMC_POWER_UP) { - if (p->set_pwr) - p->set_pwr(host->pd, ios->power_mode); } if (ios->clock)