From patchwork Mon Dec 10 08:55:54 2012 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Lee Jones X-Patchwork-Id: 1856091 Return-Path: X-Original-To: patchwork-linux-arm@patchwork.kernel.org Delivered-To: patchwork-process-083081@patchwork1.kernel.org Received: from merlin.infradead.org (merlin.infradead.org [205.233.59.134]) by patchwork1.kernel.org (Postfix) with ESMTP id E909C3FCF2 for ; Mon, 10 Dec 2012 09:00:50 +0000 (UTC) Received: from localhost ([::1] helo=merlin.infradead.org) by merlin.infradead.org with esmtp (Exim 4.76 #1 (Red Hat Linux)) id 1ThzAy-0008Nn-5Q; Mon, 10 Dec 2012 08:57:24 +0000 Received: from mail-wi0-f179.google.com ([209.85.212.179]) by merlin.infradead.org with esmtps (Exim 4.76 #1 (Red Hat Linux)) id 1ThzA3-0008AA-98 for linux-arm-kernel@lists.infradead.org; Mon, 10 Dec 2012 08:56:29 +0000 Received: by mail-wi0-f179.google.com with SMTP id o1so790914wic.0 for ; Mon, 10 Dec 2012 00:56:26 -0800 (PST) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=20120113; h=from:to:cc:subject:date:message-id:x-mailer:in-reply-to:references :x-gm-message-state; bh=CDrZWPv2FFa4gfm5ICv07gH86DAgKeaBPjUPp9iW//o=; b=NkwepVmhNxJCqHQTq6ropg+jCX6Mg0IXZOW0kQGQAs8t40I8uYOA2A7/2rALVHyhn2 K+j4xqkni37rDiuerPzmR4Aa7lBPUAdjkJl8OVw1/z33JogxiStkFCvxAgn9tyg0xfta lMGRu/Lyua+U5GI6bCFFiw388d7h59J7hkqecW4aiqMAj71dVyVmTzlfKJ/vp2r27UVy V1mM+ufR91tjju1T2zo2By2JwnhL++Z0ZB1GGTFpzHwgR8bXmeUwIJDrE6sm579nl5XA wwhGZbk0HIAeJ+t/MAGrdfGQBXd2MIeaZSMBdWRcJaxOO8C2TtlCCAyV+M/X2iUnbH81 MyIw== Received: by 10.216.56.68 with SMTP id l46mr2025354wec.108.1355129786022; Mon, 10 Dec 2012 00:56:26 -0800 (PST) Received: from localhost.localdomain (cpc1-aztw13-0-0-cust473.18-1.cable.virginmedia.com. [77.102.241.218]) by mx.google.com with ESMTPS id fv2sm9173114wib.4.2012.12.10.00.56.24 (version=TLSv1/SSLv3 cipher=OTHER); Mon, 10 Dec 2012 00:56:25 -0800 (PST) From: Lee Jones To: linux-arm-kernel@lists.infradead.org, linux-kernel@vger.kernel.org Subject: [PATCH 05/12] mmc: mmci: Move ios_handler functionality into the driver Date: Mon, 10 Dec 2012 08:55:54 +0000 Message-Id: <1355129761-8088-6-git-send-email-lee.jones@linaro.org> X-Mailer: git-send-email 1.7.9.5 In-Reply-To: <1355129761-8088-1-git-send-email-lee.jones@linaro.org> References: <1355129761-8088-1-git-send-email-lee.jones@linaro.org> X-Gm-Message-State: ALoCoQlk92sr98/GVxmUHwA++g7bwH/b3h6Rn/EAkJtP2pNijy3Z8yUBsRYgYtdxEiVjADr9xmyc X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20121210_035627_742284_A71D62DD X-CRM114-Status: GOOD ( 15.44 ) X-Spam-Score: -2.6 (--) X-Spam-Report: SpamAssassin version 3.3.2 on merlin.infradead.org summary: Content analysis details: (-2.6 points) pts rule name description ---- ---------------------- -------------------------------------------------- -0.7 RCVD_IN_DNSWL_LOW RBL: Sender listed at http://www.dnswl.org/, low trust [209.85.212.179 listed in list.dnswl.org] -1.9 BAYES_00 BODY: Bayes spam probability is 0 to 1% [score: 0.0000] Cc: ulf.hansson@linaro.org, linus.walleij@stericsson.com, arnd@arndb.de, Russell King , Chris Ball , Lee Jones 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: , MIME-Version: 1.0 Sender: linux-arm-kernel-bounces@lists.infradead.org Errors-To: linux-arm-kernel-bounces+patchwork-linux-arm=patchwork.kernel.org@lists.infradead.org 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 Acked-by: Ulf Hansson Signed-off-by: Lee Jones --- drivers/mmc/host/mmci.c | 22 ++++++++++++++++++++++ drivers/mmc/host/mmci.h | 1 + 2 files changed, 23 insertions(+) diff --git a/drivers/mmc/host/mmci.c b/drivers/mmc/host/mmci.c index edc3e9b..d45c931 100644 --- a/drivers/mmc/host/mmci.c +++ b/drivers/mmc/host/mmci.c @@ -1091,6 +1091,16 @@ static void mmci_set_ios(struct mmc_host *mmc, struct mmc_ios *ios) case MMC_POWER_OFF: if (host->vcc) ret = mmc_regulator_set_ocr(mmc, host->vcc, 0); + + if (host->vqmmc) { + if (regulator_is_enabled(host->vqmmc)) { + ret = regulator_disable(host->vqmmc); + if (ret < 0) + dev_warn(mmc_dev(mmc), + "unable to disable vmmc-ios\n"); + } + } + break; case MMC_POWER_UP: if (host->vcc) { @@ -1115,6 +1125,14 @@ static void mmci_set_ios(struct mmc_host *mmc, struct mmc_ios *ios) break; case MMC_POWER_ON: + if (host->vqmmc) + if (!regulator_is_enabled(host->vqmmc)) { + ret = regulator_enable(host->vqmmc); + if (ret < 0) + dev_warn(mmc_dev(mmc), + "unable to enable vmmc-ios\n"); + } + pwr |= MCI_PWR_ON; break; } @@ -1379,6 +1397,10 @@ static int __devinit mmci_probe(struct amba_device *dev, "(using regulator instead)\n"); } } + + host->vqmmc = regulator_get(&dev->dev, "vqmmc"); + if (IS_ERR(host->vqmmc)) + host->vqmmc = NULL; #endif /* Fall back to platform data if no regulator is found */ if (host->vcc == NULL) diff --git a/drivers/mmc/host/mmci.h b/drivers/mmc/host/mmci.h index d437ccf..b87d9e2 100644 --- a/drivers/mmc/host/mmci.h +++ b/drivers/mmc/host/mmci.h @@ -194,6 +194,7 @@ struct mmci_host { struct sg_mapping_iter sg_miter; unsigned int size; struct regulator *vcc; + struct regulator *vqmmc; #ifdef CONFIG_DMA_ENGINE /* DMA stuff */