From patchwork Fri Apr 29 10:19:41 2011 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Jaehoon Chung X-Patchwork-Id: 740701 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 p3TAMISF005665 for ; Fri, 29 Apr 2011 10:22:18 GMT Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1756301Ab1D2KWR (ORCPT ); Fri, 29 Apr 2011 06:22:17 -0400 Received: from mailout2.samsung.com ([203.254.224.25]:35970 "EHLO mailout2.samsung.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1754247Ab1D2KWR (ORCPT ); Fri, 29 Apr 2011 06:22:17 -0400 Received: from epcpsbgm1.samsung.com (mailout2.samsung.com [203.254.224.25]) by mailout2.samsung.com (Oracle Communications Messaging Exchange Server 7u4-19.01 64bit (built Sep 7 2010)) with ESMTP id <0LKE005AISSZ05R0@mailout2.samsung.com> for linux-mmc@vger.kernel.org; Fri, 29 Apr 2011 19:22:15 +0900 (KST) X-AuditID: cbfee61a-b7c84ae000006ee6-4d-4dba91560319 Received: from epmmp1 ( [203.254.227.16]) by epcpsbgm1.samsung.com (MMPCPMTA) with SMTP id 77.A1.28390.6519ABD4; Fri, 29 Apr 2011 19:22:14 +0900 (KST) Received: from TNRNDGASPAPP1.tn.corp.samsungelectronics.net ([165.213.149.150]) by mmp1.samsung.com (iPlanet Messaging Server 5.2 Patch 2 (built Jul 14 2004)) with ESMTPA id <0LKE0029ZST207@mmp1.samsung.com> for linux-mmc@vger.kernel.org; Fri, 29 Apr 2011 19:22:14 +0900 (KST) Received: from [165.213.219.108] ([165.213.219.108]) by TNRNDGASPAPP1.tn.corp.samsungelectronics.net with Microsoft SMTPSVC(6.0.3790.4675); Fri, 29 Apr 2011 19:22:14 +0900 Date: Fri, 29 Apr 2011 19:19:41 +0900 From: Jaehoon Chung Subject: [PATCH] dw_mmc: fixed regulator control To: "linux-mmc@vger.kernel.org" Cc: Chris Ball , will.newton@imgtec.com, Kyungmin Park Message-id: <4DBA90BD.8070804@samsung.com> MIME-version: 1.0 Content-type: text/plain; charset=ISO-8859-1 Content-transfer-encoding: 7BIT User-Agent: Thunderbird 2.0.0.24 (X11/20100317) X-OriginalArrivalTime: 29 Apr 2011 10:22:14.0803 (UTC) FILETIME=[4F3A1630:01CC0657] X-Brightmail-Tracker: AAAAAA== Sender: linux-mmc-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-mmc@vger.kernel.org X-Greylist: IP, sender and recipient auto-whitelisted, not delayed by milter-greylist-4.2.6 (demeter1.kernel.org [140.211.167.41]); Fri, 29 Apr 2011 10:22:23 +0000 (UTC) This patch fixed regulator control in dw_mmc.c If we didn't set CONFIG_REGULATOR, always entered error condition. But that's not error..because we didn't use regulator framework. So when we only used CONFIG_REGULATOR, i think that need to get regulator. And In suspend function, regulator_enable() need not.. need that in resume function. (i didn't know why located there...) Thanks, Jaehoon Chung Signed-off-by: Jaehoon Chung Signed-off-by: Kyungmin Park --- drivers/mmc/host/dw_mmc.c | 8 +++++--- 1 files changed, 5 insertions(+), 3 deletions(-) -- To unsubscribe from this list: send the line "unsubscribe linux-mmc" in the body of a message to majordomo@vger.kernel.org More majordomo info at http://vger.kernel.org/majordomo-info.html diff --git a/drivers/mmc/host/dw_mmc.c b/drivers/mmc/host/dw_mmc.c index 87e1f57..62b900f 100644 --- a/drivers/mmc/host/dw_mmc.c +++ b/drivers/mmc/host/dw_mmc.c @@ -1441,12 +1441,14 @@ static int __init dw_mci_init_slot(struct dw_mci *host, unsigned int id) } #endif /* CONFIG_MMC_DW_IDMAC */ +#ifdef CONFIG_REGULATOR host->vmmc = regulator_get(mmc_dev(mmc), "vmmc"); if (IS_ERR(host->vmmc)) { printk(KERN_INFO "%s: no vmmc regulator found\n", mmc_hostname(mmc)); host->vmmc = NULL; } else regulator_enable(host->vmmc); +#endif /* CONFIG_REGULATOR */ if (dw_mci_get_cd(mmc)) set_bit(DW_MMC_CARD_PRESENT, &slot->flags); @@ -1769,9 +1771,6 @@ static int dw_mci_suspend(struct platform_device *pdev, pm_message_t mesg) int i, ret; struct dw_mci *host = platform_get_drvdata(pdev); - if (host->vmmc) - regulator_enable(host->vmmc); - for (i = 0; i < host->num_slots; i++) { struct dw_mci_slot *slot = host->slot[i]; if (!slot) @@ -1798,6 +1797,9 @@ static int dw_mci_resume(struct platform_device *pdev) int i, ret; struct dw_mci *host = platform_get_drvdata(pdev); + if (host->vmmc) + regulator_enable(host->vmmc); + if (host->dma_ops->init) host->dma_ops->init(host);