From patchwork Fri Dec 14 14:30:29 2012 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Ulf Hansson X-Patchwork-Id: 1879021 Return-Path: X-Original-To: patchwork-linux-arm@patchwork.kernel.org Delivered-To: patchwork-process-083081@patchwork2.kernel.org Received: from merlin.infradead.org (merlin.infradead.org [205.233.59.134]) by patchwork2.kernel.org (Postfix) with ESMTP id BF814DF230 for ; Fri, 14 Dec 2012 15:03:24 +0000 (UTC) Received: from localhost ([::1] helo=merlin.infradead.org) by merlin.infradead.org with esmtp (Exim 4.76 #1 (Red Hat Linux)) id 1TjWkZ-00013D-2L; Fri, 14 Dec 2012 15:00:31 +0000 Received: from eu1sys200aog107.obsmtp.com ([207.126.144.123]) by merlin.infradead.org with smtps (Exim 4.76 #1 (Red Hat Linux)) id 1TjWkV-00012p-4b for linux-arm-kernel@lists.infradead.org; Fri, 14 Dec 2012 15:00:28 +0000 Received: from beta.dmz-ap.st.com ([138.198.100.35]) (using TLSv1) by eu1sys200aob107.postini.com ([207.126.147.11]) with SMTP ID DSNKUMs+/0jpyfAvnxUpYsQc0OTMC7cE9fVc@postini.com; Fri, 14 Dec 2012 15:00:26 UTC Received: from zeta.dmz-ap.st.com (ns6.st.com [138.198.234.13]) by beta.dmz-ap.st.com (STMicroelectronics) with ESMTP id 8CAF9E4; Fri, 14 Dec 2012 14:22:47 +0000 (GMT) Received: from relay2.stm.gmessaging.net (unknown [10.230.100.18]) by zeta.dmz-ap.st.com (STMicroelectronics) with ESMTP id 370A01133; Fri, 14 Dec 2012 14:30:59 +0000 (GMT) Received: from exdcvycastm022.EQ1STM.local (alteon-source-exch [10.230.100.61]) (using TLSv1 with cipher RC4-MD5 (128/128 bits)) (Client CN "exdcvycastm022", Issuer "exdcvycastm022" (not verified)) by relay2.stm.gmessaging.net (Postfix) with ESMTPS id E7148A8074; Fri, 14 Dec 2012 15:30:52 +0100 (CET) Received: from steludxu1397.lud.stericsson.com (10.230.100.153) by smtp.stericsson.com (10.230.100.30) with Microsoft SMTP Server (TLS) id 8.3.83.0; Fri, 14 Dec 2012 15:30:57 +0100 From: Ulf Hansson To: , Chris Ball Subject: [PATCH V2 2/2] mmc: mmci: Move ios_handler functionality into the driver Date: Fri, 14 Dec 2012 15:30:29 +0100 Message-ID: <1355495429-12510-3-git-send-email-ulf.hansson@stericsson.com> X-Mailer: git-send-email 1.7.10 In-Reply-To: <1355495429-12510-1-git-send-email-ulf.hansson@stericsson.com> References: <1355495429-12510-1-git-send-email-ulf.hansson@stericsson.com> MIME-Version: 1.0 X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20121214_100027_419837_8E7E6023 X-CRM114-Status: GOOD ( 12.42 ) X-Spam-Score: -4.2 (----) X-Spam-Report: SpamAssassin version 3.3.2 on merlin.infradead.org summary: Content analysis details: (-4.2 points) pts rule name description ---- ---------------------- -------------------------------------------------- -2.3 RCVD_IN_DNSWL_MED RBL: Sender listed at http://www.dnswl.org/, medium trust [207.126.144.123 listed in list.dnswl.org] -1.9 BAYES_00 BODY: Bayes spam probability is 0 to 1% [score: 0.0000] Cc: Lee Jones , Linus Walleij , Russell King , Ulf Hansson , linux-arm-kernel@lists.infradead.org X-BeenThere: linux-arm-kernel@lists.infradead.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: linux-arm-kernel-bounces@lists.infradead.org Errors-To: linux-arm-kernel-bounces+patchwork-linux-arm=patchwork.kernel.org@lists.infradead.org From: Lee Jones There are currently two instances of the ios_handler being used. Both of which mearly toy with some regulator settings. Now there is a GPIO regulator API, we can use that instead, and lessen the per platform burden. By doing this, we also become more Device Tree compatible. Cc: Chris Ball Cc: Russell King Signed-off-by: Lee Jones Signed-off-by: Ulf Hansson --- drivers/mmc/host/mmci.c | 9 +++++++++ 1 file changed, 9 insertions(+) diff --git a/drivers/mmc/host/mmci.c b/drivers/mmc/host/mmci.c index 9da5f24..e56655a 100644 --- a/drivers/mmc/host/mmci.c +++ b/drivers/mmc/host/mmci.c @@ -1097,6 +1097,11 @@ static void mmci_set_ios(struct mmc_host *mmc, struct mmc_ios *ios) case MMC_POWER_OFF: if (!IS_ERR(mmc->supply.vmmc)) mmc_regulator_set_ocr(mmc, mmc->supply.vmmc, 0); + + if (!IS_ERR(mmc->supply.vqmmc) && + regulator_is_enabled(mmc->supply.vqmmc)) + regulator_disable(mmc->supply.vqmmc); + break; case MMC_POWER_UP: if (!IS_ERR(mmc->supply.vmmc)) @@ -1111,6 +1116,10 @@ static void mmci_set_ios(struct mmc_host *mmc, struct mmc_ios *ios) break; case MMC_POWER_ON: + if (!IS_ERR(mmc->supply.vqmmc) && + !regulator_is_enabled(mmc->supply.vqmmc)) + regulator_enable(mmc->supply.vqmmc); + pwr |= MCI_PWR_ON; break; }