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: 13585 Return-Path: X-Original-To: patchwork@peony.canonical.com Delivered-To: patchwork@peony.canonical.com Received: from fiordland.canonical.com (fiordland.canonical.com [91.189.94.145]) by peony.canonical.com (Postfix) with ESMTP id AAFD623FB6 for ; Fri, 14 Dec 2012 15:00:29 +0000 (UTC) Received: from mail-ie0-f180.google.com (mail-ie0-f180.google.com [209.85.223.180]) by fiordland.canonical.com (Postfix) with ESMTP id 57F06A195AD for ; Fri, 14 Dec 2012 15:00:29 +0000 (UTC) Received: by mail-ie0-f180.google.com with SMTP id c10so6003604ieb.11 for ; Fri, 14 Dec 2012 07:00:28 -0800 (PST) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=20120113; h=x-forwarded-to:x-forwarded-for:delivered-to:received-spf:from:to:cc :subject:date:message-id:x-mailer:in-reply-to:references :mime-version:content-type:x-gm-message-state; bh=RoyaVciRllnx+RL1xu0A8w/FPcI1+2ByXbW0PgW7lKI=; b=jNeM3wbqzX5HDKTS4myPeF2yxCtqcF8/Fu+kwV5gC9KGtCidz+x6O0h0ZsCoqk789L i8Jc6aepCWd7CN0hqTzaggkkgeNh9fPzQW1bXEUXHm70NWBqcQAxvfsfPKqekuwuJ8TP zf3AqwEukJkVGq4gtVkXZwnKim43kEFxfIeBwWR/OzPdIdK1Qtpc4O9z+aYfD9Bb1KBt IRlTuKledQYKdWVklkjO7XVb659P2FM4kgw7myq43l9oBjm172BaeVhJQcwthSOvMNu/ a6Xshr5biIGHTQumDTFd6sZHicVoEc/Gxbj/xdJYXK1gEia8YuloHz5LTjJNvOC0H/vK M10A== Received: by 10.50.36.164 with SMTP id r4mr1745584igj.57.1355497228776; Fri, 14 Dec 2012 07:00:28 -0800 (PST) X-Forwarded-To: linaro-patchwork@canonical.com X-Forwarded-For: patch@linaro.org linaro-patchwork@canonical.com Delivered-To: patches@linaro.org Received: by 10.50.67.148 with SMTP id n20csp76987igt; Fri, 14 Dec 2012 07:00:28 -0800 (PST) Received: by 10.14.203.2 with SMTP id e2mr15762253eeo.20.1355497227136; Fri, 14 Dec 2012 07:00:27 -0800 (PST) Received: from eu1sys200aog107.obsmtp.com (eu1sys200aog107.obsmtp.com [207.126.144.123]) by mx.google.com with SMTP id s8si12670030eeo.19.2012.12.14.07.00.18 (version=TLSv1/SSLv3 cipher=OTHER); Fri, 14 Dec 2012 07:00:27 -0800 (PST) Received-SPF: neutral (google.com: 207.126.144.123 is neither permitted nor denied by best guess record for domain of ulf.hansson@stericsson.com) client-ip=207.126.144.123; Authentication-Results: mx.google.com; spf=neutral (google.com: 207.126.144.123 is neither permitted nor denied by best guess record for domain of ulf.hansson@stericsson.com) smtp.mail=ulf.hansson@stericsson.com 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 Cc: , Russell King , Linus Walleij , Lee Jones , Ulf Hansson 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-Gm-Message-State: ALoCoQmJ5w8DLPUaE4hhgpSQIKPxd/bFtc11rou6SxOgs8ZQXiiKCnr+wGyTRsFJQVMxmzfPocWn 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; }