From patchwork Fri Oct 1 23:34:27 2010 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Tony Lindgren X-Patchwork-Id: 226082 X-Patchwork-Delegate: tony@atomide.com 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 o91NYWIA010939 for ; Fri, 1 Oct 2010 23:34:32 GMT Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1754430Ab0JAXeb (ORCPT ); Fri, 1 Oct 2010 19:34:31 -0400 Received: from mho-02-ewr.mailhop.org ([204.13.248.72]:50527 "EHLO mho-02-ewr.mailhop.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1754381Ab0JAXea (ORCPT ); Fri, 1 Oct 2010 19:34:30 -0400 Received: from c-67-188-36-105.hsd1.ca.comcast.net ([67.188.36.105] helo=baageli.muru.com) by mho-02-ewr.mailhop.org with esmtpa (Exim 4.68) (envelope-from ) id 1P1p7U-000HDX-9a; Fri, 01 Oct 2010 23:34:28 +0000 X-Mail-Handler: MailHop Outbound by DynDNS X-Originating-IP: 67.188.36.105 X-Report-Abuse-To: abuse@dyndns.com (see http://www.dyndns.com/services/mailhop/outbound_abuse.html for abuse reporting information) X-MHO-User: U2FsdGVkX187Svf55FQ4gI9EU/fDvoUZ Subject: [PATCH 8/8] omap4 hsmmc: Update ocr mask for MMC2 for regulator to use To: linux-arm-kernel@lists.infradead.org From: Tony Lindgren Cc: Adrian Hunter , Andrew Morton , linux-omap@vger.kernel.org, Kishore Kadiyala , Madhusudhan Chikkature Date: Fri, 01 Oct 2010 16:34:27 -0700 Message-ID: <20101001233427.31894.61695.stgit@baageli.muru.com> In-Reply-To: <20101001233315.31894.49599.stgit@baageli.muru.com> References: <20101001233315.31894.49599.stgit@baageli.muru.com> User-Agent: StGit/0.15 MIME-Version: 1.0 Sender: linux-omap-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-omap@vger.kernel.org X-Greylist: IP, sender and recipient auto-whitelisted, not delayed by milter-greylist-4.2.3 (demeter1.kernel.org [140.211.167.41]); Fri, 01 Oct 2010 23:34:32 +0000 (UTC) diff --git a/arch/arm/mach-omap2/board-4430sdp.c b/arch/arm/mach-omap2/board-4430sdp.c index cdb9373..9f75dc2 100644 --- a/arch/arm/mach-omap2/board-4430sdp.c +++ b/arch/arm/mach-omap2/board-4430sdp.c @@ -242,6 +242,7 @@ static struct omap2_hsmmc_info mmc[] = { .gpio_cd = -EINVAL, .gpio_wp = -EINVAL, .nonremovable = true, + .ocr_mask = MMC_VDD_29_30, }, {} /* Terminator */ }; diff --git a/drivers/mmc/host/omap_hsmmc.c b/drivers/mmc/host/omap_hsmmc.c index dc95756..4693e62 100644 --- a/drivers/mmc/host/omap_hsmmc.c +++ b/drivers/mmc/host/omap_hsmmc.c @@ -364,6 +364,7 @@ static int omap_hsmmc_reg_get(struct omap_hsmmc_host *host) { struct regulator *reg; int ret = 0; + int ocr_value = 0; switch (host->id) { case OMAP_MMC1_DEVID: @@ -396,6 +397,17 @@ static int omap_hsmmc_reg_get(struct omap_hsmmc_host *host) } } else { host->vcc = reg; + ocr_value = mmc_regulator_get_ocrmask(reg); + if (!mmc_slot(host).ocr_mask) { + mmc_slot(host).ocr_mask = ocr_value; + } else { + if (!(mmc_slot(host).ocr_mask & ocr_value)) { + pr_err("MMC%d ocrmask %x is not supported\n", + host->id, mmc_slot(host).ocr_mask); + mmc_slot(host).ocr_mask = 0; + return -EINVAL; + } + } mmc_slot(host).ocr_mask = mmc_regulator_get_ocrmask(reg); /* Allow an aux regulator */