From patchwork Fri Mar 14 07:24:27 2014 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Jaehoon Chung X-Patchwork-Id: 3831151 Return-Path: X-Original-To: patchwork-linux-mmc@patchwork.kernel.org Delivered-To: patchwork-parsemail@patchwork1.web.kernel.org Received: from mail.kernel.org (mail.kernel.org [198.145.19.201]) by patchwork1.web.kernel.org (Postfix) with ESMTP id BC4D89F2BB for ; Fri, 14 Mar 2014 07:24:39 +0000 (UTC) Received: from mail.kernel.org (localhost [127.0.0.1]) by mail.kernel.org (Postfix) with ESMTP id D2CDF202E9 for ; Fri, 14 Mar 2014 07:24:38 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by mail.kernel.org (Postfix) with ESMTP id 834C0202A7 for ; Fri, 14 Mar 2014 07:24:37 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1755278AbaCNHY2 (ORCPT ); Fri, 14 Mar 2014 03:24:28 -0400 Received: from mailout4.samsung.com ([203.254.224.34]:57284 "EHLO mailout4.samsung.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1755133AbaCNHY1 (ORCPT ); Fri, 14 Mar 2014 03:24:27 -0400 Received: from epcpsbgr5.samsung.com (u145.gpu120.samsung.co.kr [203.254.230.145]) by mailout4.samsung.com (Oracle Communications Messaging Server 7u4-24.01 (7.0.4.24.0) 64bit (built Nov 17 2011)) with ESMTP id <0N2F00DFY0KM3S40@mailout4.samsung.com> for linux-mmc@vger.kernel.org; Fri, 14 Mar 2014 16:24:22 +0900 (KST) Received: from epcpsbgm2.samsung.com ( [172.20.52.116]) by epcpsbgr5.samsung.com (EPCPMTA) with SMTP id 2E.4E.14803.6AEA2235; Fri, 14 Mar 2014 16:24:22 +0900 (KST) X-AuditID: cbfee691-b7efc6d0000039d3-f0-5322aea6184d Received: from epmmp2 ( [203.254.227.17]) by epcpsbgm2.samsung.com (EPCPMTA) with SMTP id 42.B9.28157.5AEA2235; Fri, 14 Mar 2014 16:24:22 +0900 (KST) Received: from [10.252.81.186] by mmp2.samsung.com (Oracle Communications Messaging Server 7u4-24.01(7.0.4.24.0) 64bit (built Nov 17 2011)) with ESMTPA id <0N2F00JLN0KLYMN0@mmp2.samsung.com>; Fri, 14 Mar 2014 16:24:21 +0900 (KST) Message-id: <5322AEAB.8010602@samsung.com> Date: Fri, 14 Mar 2014 16:24:27 +0900 From: Jaehoon Chung User-Agent: Mozilla/5.0 (X11; Linux i686; rv:24.0) Gecko/20100101 Thunderbird/24.3.0 MIME-version: 1.0 To: "linux-mmc@vger.kernel.org" Cc: Chris Ball , Seungwon Jeon , Ulf Hansson Subject: [PATCH] mmc: dw_mmc: add the vqmmc regulator Content-type: text/plain; charset=ISO-8859-1 Content-transfer-encoding: 7bit X-Brightmail-Tracker: H4sIAAAAAAAAA+NgFprAIsWRmVeSWpSXmKPExsWyRsSkRHfZOqVggx1tPBYTLm9ntDjyv5/R 4sP9i8wWx9eGO7B43Lm2h83jxquFTB59W1YxenzeJBfAEsVlk5Kak1mWWqRvl8CVcellF0vB M7GKezenMjYwXhPqYuTkkBAwkTh7YhUrhC0mceHeerYuRi4OIYGljBLLFxxjgSk6ePkyO0Ri OqPE33MrWSGc14wS3ye1MIFU8QpoSZw40glmswioShztncMMYrMJ6Ehs/3YcLC4qECbx+P5c Zoh6QYkfk+8BbeDgEBGwlmj+LQsSZhbIl5hw8wcjiC0sYCrRe6mHBSKuI7G/dRobhC0vsXnN W2aI46azSxxalQCxVkDi2+RDYCMlBGQlNh2AKpGUOLjiBssERpFZSBbPQjJ1FpKpCxiZVzGK phYkFxQnpReZ6hUn5haX5qXrJefnbmIExsbpf88m7mC8f8D6EGMy0MqJzFKiyfnA2MoriTc0 NjOyMDUxNTYytzQjTVhJnDf9UVKQkEB6YklqdmpqQWpRfFFpTmrxIUYmDk6pBka5Dc4l+2dr vpqx3jbC4vLdyw+TJF3D9/4vM/2taLot7mRvaL3o7qyVdV+qdWMeeF2exDj9wYccR9f2830r KxhautRvR0hfevGX4/5zkfW6azM7uoJvl92NjJD/+GA9tzLnnePRXzeta9N6uFDxFwOr4i4T hRauh1EnZace5ZVct7amN6NvuogSS3FGoqEWc1FxIgB0nz02owIAAA== X-Brightmail-Tracker: H4sIAAAAAAAAA+NgFnrHIsWRmVeSWpSXmKPExsVy+t9jQd1l65SCDQ6fZ7aYcHk7o8WR//2M Fh/uX2S2OL423IHF4861PWweN14tZPLo27KK0ePzJrkAlqgGRpuM1MSU1CKF1Lzk/JTMvHRb Je/geOd4UzMDQ11DSwtzJYW8xNxUWyUXnwBdt8wcoJVKCmWJOaVAoYDE4mIlfTtME0JD3HQt YBojdH1DguB6jAzQQMIaxoxLL7tYCp6JVdy7OZWxgfGaUBcjJ4eEgInEwcuX2SFsMYkL99az dTFycQgJTGeU+HtuJSuE85pR4vukFiaQKl4BLYkTRzrBbBYBVYmjvXOYQWw2AR2J7d+Og8VF BcIkHt+fywxRLyjxY/I9li5GDg4RAWuJ5t+yIGFmgXyJCTd/MILYwgKmEr2Xelgg4joS+1un sUHY8hKb17xlnsDINwvJpFlIymYhKVvAyLyKUTS1ILmgOCk910ivODG3uDQvXS85P3cTIzj2 nknvYFzVYHGIUYCDUYmHd8ZRxWAh1sSy4srcQ4wSHMxKIrwM85SChXhTEiurUovy44tKc1KL DzEmAz06kVlKNDkfmBbySuINjU3MjCyNzA0tjIzNSRNWEuc92GodKCSQnliSmp2aWpBaBLOF iYNTqoFx7Toxtecd0l316jypc4uv3ZzjX3l2odieDKaF31QVVng43U5/eOj5r6fHsjXZNTp6 AmVXl6t29Zl8PSlqvr7kt/ip2A11U9yPmi/wmT9j3rmKtbJVUhen3DN80ui898H9+zNY3m2c IbFw68xFtWzXF14xnbCwQvCm1OpNIrqMjzXVuv/JRhbfUGIpzkg01GIuKk4EANOc6UQBAwAA DLP-Filter: Pass X-MTR: 20000000000000000@CPGS X-CFilter-Loop: Reflected Sender: linux-mmc-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-mmc@vger.kernel.org X-Spam-Status: No, score=-6.9 required=5.0 tests=BAYES_00, RCVD_IN_DNSWL_HI, T_RP_MATCHES_RCVD, UNPARSEABLE_RELAY autolearn=unavailable version=3.3.1 X-Spam-Checker-Version: SpamAssassin 3.3.1 (2010-03-16) on mail.kernel.org X-Virus-Scanned: ClamAV using ClamSMTP Add the "vqmmc" regulator into dw_mmc.c This patch depend on below patches. ([PATCH v4 1/7] mmc: dw_mmc: use the mmc_of_parse() instead of local parser ~) https://patchwork.kernel.org/patch/3750681/ https://patchwork.kernel.org/patch/3750691/ https://patchwork.kernel.org/patch/3750711/ https://patchwork.kernel.org/patch/3750701/ https://patchwork.kernel.org/patch/3750721/ https://patchwork.kernel.org/patch/3750731/ https://patchwork.kernel.org/patch/3750741/ Signed-off-by: Jaehoon Chung --- drivers/mmc/host/dw_mmc.c | 34 ++++++++++++++++++++++++++++++++++ include/linux/mmc/dw_mmc.h | 1 + 2 files changed, 35 insertions(+) diff --git a/drivers/mmc/host/dw_mmc.c b/drivers/mmc/host/dw_mmc.c index 5e78748..9a33a6d 100644 --- a/drivers/mmc/host/dw_mmc.c +++ b/drivers/mmc/host/dw_mmc.c @@ -2393,6 +2393,24 @@ int dw_mci_probe(struct dw_mci *host) } } + host->vqmmc = devm_regulator_get_optional(host->dev, "vqmmc"); + if (IS_ERR(host->vqmmc)) { + ret = PTR_ERR(host->vqmmc); + if (ret == -EPROBE_DEFER) + goto err_vqmmc; + + dev_info(host->dev, "no vqmmc regulator found: %d\n", ret); + host->vqmmc = NULL; + } else { + ret = regulator_enable(host->vqmmc); + if (ret) { + if (ret != -EPROBE_DEFER) + dev_err(host->dev, + "regulator_enable fail: %d\n", ret); + goto err_vqmmc; + } + } + host->quirks = host->pdata->quirks; spin_lock_init(&host->lock); @@ -2536,6 +2554,9 @@ err_workqueue: err_dmaunmap: if (host->use_dma && host->dma_ops->exit) host->dma_ops->exit(host); + if (host->vqmmc) + regulator_disable(host->vqmmc); +err_vqmmc: if (host->vmmc) regulator_disable(host->vmmc); @@ -2575,6 +2596,8 @@ void dw_mci_remove(struct dw_mci *host) if (host->vmmc) regulator_disable(host->vmmc); + if (host->vqmmc) + regulator_disable(host->vqmmc); if (!IS_ERR(host->ciu_clk)) clk_disable_unprepare(host->ciu_clk); @@ -2594,6 +2617,8 @@ int dw_mci_suspend(struct dw_mci *host) { if (host->vmmc) regulator_disable(host->vmmc); + if (host->vqmmc) + regulator_disable(host->vqmmc); return 0; } @@ -2612,6 +2637,15 @@ int dw_mci_resume(struct dw_mci *host) } } + if (host->vqmmc) { + ret = regulator_enable(host->vqmmc); + if (ret) { + dev_err(host->dev, + "failed to enable regulator: %d\n", ret); + return ret; + } + } + if (!dw_mci_ctrl_all_reset(host)) { ret = -ENODEV; return ret; diff --git a/include/linux/mmc/dw_mmc.h b/include/linux/mmc/dw_mmc.h index babaea9..8912d92 100644 --- a/include/linux/mmc/dw_mmc.h +++ b/include/linux/mmc/dw_mmc.h @@ -189,6 +189,7 @@ struct dw_mci { u32 quirks; struct regulator *vmmc; /* Power regulator */ + struct regulator *vqmmc; /* Signalling regulator */ unsigned long irq_flags; /* IRQ flags */ int irq; };