From patchwork Sun Jan 17 01:34:07 2010 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Adrian Hunter X-Patchwork-Id: 73462 X-Patchwork-Delegate: tony@atomide.com Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by demeter.kernel.org (8.14.3/8.14.2) with ESMTP id o0H1YaSj022657 for ; Sun, 17 Jan 2010 01:34:41 GMT Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1753311Ab0AQBej (ORCPT ); Sat, 16 Jan 2010 20:34:39 -0500 Received: (majordomo@vger.kernel.org) by vger.kernel.org id S1753303Ab0AQBej (ORCPT ); Sat, 16 Jan 2010 20:34:39 -0500 Received: from smtp.nokia.com ([192.100.122.233]:58044 "EHLO mgw-mx06.nokia.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1753300Ab0AQBei (ORCPT ); Sat, 16 Jan 2010 20:34:38 -0500 Received: from esebh106.NOE.Nokia.com (esebh106.ntc.nokia.com [172.21.138.213]) by mgw-mx06.nokia.com (Switch-3.3.3/Switch-3.3.3) with ESMTP id o0H1Y9lF014485; Sun, 17 Jan 2010 03:34:10 +0200 Received: from esebh102.NOE.Nokia.com ([172.21.138.183]) by esebh106.NOE.Nokia.com with Microsoft SMTPSVC(6.0.3790.3959); Sun, 17 Jan 2010 03:34:09 +0200 Received: from mgw-sa01.ext.nokia.com ([147.243.1.47]) by esebh102.NOE.Nokia.com over TLS secured channel with Microsoft SMTPSVC(6.0.3790.3959); Sun, 17 Jan 2010 03:34:09 +0200 Received: from ahunter-work.research.nokia.com (essapo-nirac25346.europe.nokia.com [10.162.253.46]) by mgw-sa01.ext.nokia.com (Switch-3.3.3/Switch-3.3.3) with ESMTP id o0H1Y7FR004204; Sun, 17 Jan 2010 03:34:07 +0200 From: Adrian Hunter To: Tony Lindgren Cc: Adrian Hunter , Madhusudhan Chikkature , Paul Walmsley , linux-omap Mailing List , linux-mmc Mailing List , Andrew Morton Date: Sun, 17 Jan 2010 03:34:07 +0200 Message-Id: <20100117013407.17308.92367.sendpatchset@ahunter-work.research.nokia.com> In-Reply-To: <20100117013250.17308.17861.sendpatchset@ahunter-work.research.nokia.com> References: <20100117013250.17308.17861.sendpatchset@ahunter-work.research.nokia.com> Subject: [PATCH V2 10/10] omap_hsmmc: Allow for a shared VccQ X-OriginalArrivalTime: 17 Jan 2010 01:34:09.0610 (UTC) FILETIME=[2A7812A0:01CA9715] X-Nokia-AV: Clean Sender: linux-omap-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-omap@vger.kernel.org diff --git a/arch/arm/mach-omap2/hsmmc.c b/arch/arm/mach-omap2/hsmmc.c index 7e63296..1156b28 100644 --- a/arch/arm/mach-omap2/hsmmc.c +++ b/arch/arm/mach-omap2/hsmmc.c @@ -204,6 +204,9 @@ void __init omap2_hsmmc_init(struct omap2_hsmmc_info *controllers) if (c->no_off) mmc->slots[0].no_off = 1; + if (c->vcc_aux_disable_is_sleep) + mmc->slots[0].vcc_aux_disable_is_sleep = 1; + /* NOTE: MMC slots should have a Vcc regulator set up. * This may be from a TWL4030-family chip, another * controllable regulator, or a fixed supply. diff --git a/arch/arm/mach-omap2/hsmmc.h b/arch/arm/mach-omap2/hsmmc.h index 2453a7a..36f0ba8 100644 --- a/arch/arm/mach-omap2/hsmmc.h +++ b/arch/arm/mach-omap2/hsmmc.h @@ -15,6 +15,7 @@ struct omap2_hsmmc_info { bool nonremovable; /* Nonremovable e.g. eMMC */ bool power_saving; /* Try to sleep or power off when possible */ bool no_off; /* power_saving and power is not to go off */ + bool vcc_aux_disable_is_sleep; /* Regulator off remapped to sleep */ int gpio_cd; /* or -EINVAL */ int gpio_wp; /* or -EINVAL */ char *name; /* or NULL for default */ diff --git a/arch/arm/plat-omap/include/plat/mmc.h b/arch/arm/plat-omap/include/plat/mmc.h index b463949..a1bac07 100644 --- a/arch/arm/plat-omap/include/plat/mmc.h +++ b/arch/arm/plat-omap/include/plat/mmc.h @@ -99,6 +99,9 @@ struct omap_mmc_platform_data { /* If using power_saving and the MMC power is not to go off */ unsigned no_off:1; + /* Regulator off remapped to sleep */ + unsigned vcc_aux_disable_is_sleep:1; + int switch_pin; /* gpio (card detect) */ int gpio_wp; /* gpio (write protect) */ diff --git a/drivers/mmc/host/omap_hsmmc.c b/drivers/mmc/host/omap_hsmmc.c index d2fad58..af37477 100644 --- a/drivers/mmc/host/omap_hsmmc.c +++ b/drivers/mmc/host/omap_hsmmc.c @@ -347,7 +347,14 @@ static int omap_hsmmc_23_set_sleep(struct device *dev, int slot, int sleep, err = regulator_set_mode(host->vcc, mode); if (err) return err; - return regulator_set_mode(host->vcc_aux, mode); + + if (!mmc_slot(host).vcc_aux_disable_is_sleep) + return regulator_set_mode(host->vcc_aux, mode); + + if (sleep) + return regulator_disable(host->vcc_aux); + else + return regulator_enable(host->vcc_aux); } static int omap_hsmmc_gpio_init(struct omap_mmc_platform_data *pdata) @@ -1982,6 +1989,13 @@ static int __init omap_hsmmc_probe(struct platform_device *pdev) else mmc->ops = &omap_hsmmc_ops; + /* + * If regulator_disable can only put vcc_aux to sleep then there is + * no off state. + */ + if (mmc_slot(host).vcc_aux_disable_is_sleep) + mmc_slot(host).no_off = 1; + mmc->f_min = 400000; mmc->f_max = 52000000;