From patchwork Tue Jul 12 07:46:10 2016 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Aisheng Dong X-Patchwork-Id: 9224787 Return-Path: Received: from mail.wl.linuxfoundation.org (pdx-wl-mail.web.codeaurora.org [172.30.200.125]) by pdx-korg-patchwork.web.codeaurora.org (Postfix) with ESMTP id A1C4C60868 for ; Tue, 12 Jul 2016 08:27:27 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 92A3C27E63 for ; Tue, 12 Jul 2016 08:27:27 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id 86F5027EED; Tue, 12 Jul 2016 08:27:27 +0000 (UTC) X-Spam-Checker-Version: SpamAssassin 3.3.1 (2010-03-16) on pdx-wl-mail.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-6.9 required=2.0 tests=BAYES_00,RCVD_IN_DNSWL_HI autolearn=unavailable version=3.3.1 Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 08C6F27E63 for ; Tue, 12 Jul 2016 08:27:27 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1751707AbcGLI10 (ORCPT ); Tue, 12 Jul 2016 04:27:26 -0400 Received: from mail-dm3nam03on0085.outbound.protection.outlook.com ([104.47.41.85]:26272 "EHLO NAM03-DM3-obe.outbound.protection.outlook.com" rhost-flags-OK-OK-OK-FAIL) by vger.kernel.org with ESMTP id S1751121AbcGLI1Y (ORCPT ); Tue, 12 Jul 2016 04:27:24 -0400 X-Greylist: delayed 1995 seconds by postgrey-1.27 at vger.kernel.org; Tue, 12 Jul 2016 04:27:24 EDT Received: from BN3PR0301CA0041.namprd03.prod.outlook.com (10.160.180.179) by SN1PR0301MB1998.namprd03.prod.outlook.com (10.163.225.27) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_CBC_SHA384_P384) id 15.1.534.14; Tue, 12 Jul 2016 07:54:08 +0000 Received: from BY2FFO11FD012.protection.gbl (2a01:111:f400:7c0c::131) by BN3PR0301CA0041.outlook.office365.com (2a01:111:e400:4000::51) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_CBC_SHA384_P384) id 15.1.528.16 via Frontend Transport; Tue, 12 Jul 2016 07:54:08 +0000 Authentication-Results: spf=fail (sender IP is 192.88.168.50) smtp.mailfrom=nxp.com; gmail.com; dkim=none (message not signed) header.d=none; gmail.com; dmarc=fail action=none header.from=nxp.com; Received-SPF: Fail (protection.outlook.com: domain of nxp.com does not designate 192.88.168.50 as permitted sender) receiver=protection.outlook.com; client-ip=192.88.168.50; helo=tx30smr01.am.freescale.net; Received: from tx30smr01.am.freescale.net (192.88.168.50) by BY2FFO11FD012.mail.protection.outlook.com (10.1.14.130) with Microsoft SMTP Server (TLS) id 15.1.523.9 via Frontend Transport; Tue, 12 Jul 2016 07:54:07 +0000 Received: from shlinux2.ap.freescale.net (shlinux2.ap.freescale.net [10.192.224.44]) by tx30smr01.am.freescale.net (8.14.3/8.14.0) with ESMTP id u6C7rxtY002725; Tue, 12 Jul 2016 00:54:03 -0700 From: Dong Aisheng To: CC: , , , , , , , Subject: [PATCH V2 01/15] mmc: sdhci: using common mmc_regulator_set_vqmmc() Date: Tue, 12 Jul 2016 15:46:10 +0800 Message-ID: <1468309584-3591-2-git-send-email-aisheng.dong@nxp.com> X-Mailer: git-send-email 1.9.1 In-Reply-To: <1468309584-3591-1-git-send-email-aisheng.dong@nxp.com> References: <1468309584-3591-1-git-send-email-aisheng.dong@nxp.com> X-EOPAttributedMessage: 0 X-Matching-Connectors: 131127836474589176; (91ab9b29-cfa4-454e-5278-08d120cd25b8); () X-Forefront-Antispam-Report: CIP:192.88.168.50; IPV:NLI; CTRY:US; EFV:NLI; SFV:NSPM; SFS:(10009020)(6009001)(7916002)(2980300002)(1110001)(1109001)(339900001)(189002)(199003)(104016004)(47776003)(586003)(6806005)(87936001)(11100500001)(106466001)(189998001)(110136002)(356003)(8666005)(50226002)(2351001)(2950100001)(86362001)(105606002)(229853001)(7846002)(305945005)(8936002)(68736007)(81156014)(50466002)(81166006)(8676002)(76176999)(50986999)(97736004)(48376002)(85426001)(33646002)(19580405001)(19580395003)(36756003)(4326007)(2906002)(92566002)(5003940100001)(77096005)(7059030); DIR:OUT; SFP:1101; SCL:1; SRVR:SN1PR0301MB1998; H:tx30smr01.am.freescale.net; FPR:; SPF:Fail; PTR:InfoDomainNonexistent; MX:1; A:1; LANG:en; X-Microsoft-Exchange-Diagnostics: 1; BY2FFO11FD012; 1:DIpOaLIJrg0ZTxyJDAOv23d85ciK+d1cBKSWVZoN6kLBtCqJXK8oeJMtIvj+dcF5yHfFdbysN3xsHq4MdCgFe4DdlyPBrK1MVIzCSzk7tcR3qrznR5x1W7sWwupZWN74XI8ejxi89TbeQSl5z/q1gA33SpU62B5tuQ+GjiYLPwC2Z99F39npHrTQChU5Akh3eOI6tvJjFgBH65tNX7wq30EBM8MkVoS86NFPh1zXyIWbdtBvob5BX1ItHF4CeI7uS5PR2W/fEiYTZdQjYAyrCVq9NZCE1xFyOFDMmU6or2U8JSmwK2g0R8ojuFJsjjiv7nW3ycF18/NK2cLAXycf75QT+xfX0jecv+SmdgpoHN2ZvFy+adc+M3jkLwKAjbZMUDbArphBTl2Nv5in+/OU9OLv8wnwQ5bDcZtH41IdRSo64pJrI0/MguLab+E4JAgmejp7MM74ud57lqVQDVl9Eozj/vap/EhfKzkppb7dlbYgT5WWubR20fI1dcaCUIYQycW017Ad4OLOyB8iCl9pdOBvj1rRGxlOWQJgzyEr28qXOcjEPpP2VsQxZKu+It2Tdw+iMUdBw6TUqIBU3uR8hquSwJHUFWWqFO1u2mm1rgVnLIvcJdQ0juD4T3rrJpfGSaUJgMhGwF2gh9dZzH+HUh2VK0QEQhgO383T1LyZOFY= MIME-Version: 1.0 X-MS-Office365-Filtering-Correlation-Id: a2b1e13b-6d85-491f-bff8-08d3aa29b3b2 X-Microsoft-Exchange-Diagnostics: 1; SN1PR0301MB1998; 2:nTBKfXF4JyUJqK1vr9Cndpbh9zsk1bLCPDLMKMlymbx8mMo3uss+Zje5NpuGAzisM4VyD9PAdfyHtozVYXd9G980lDoaNIuXjc2vPgohjRrFeX2EoxLiEhBvU7kyzWtn4MpvfsrHch2dHK7yZ54UDZ4d3J9httMlh353V7VijdLo6X94sIBxmHtepq1Jd08+; 3:D41YlUZCxVFTUJA4qHKBypQIZJ03H6djx9GRgERlfRhpzFIlWkXcgM2uXCqtIIV1G6a+VRGWT1TDb8GZyubpMSIp4HerZ1+JKW1cCo5owsOgpDt/LWu8n0uFwZR/ez8w70DWhHRyBK7kYOuKrafOFlv4JsZsk/ptzmXA1XjIxwiXU2HfZZj5N8HrY5fpWBv6swZcBHDCbUm/3eUM/zHG66WsoXJrI8xs43pz5biSLa4= X-Microsoft-Antispam: UriScan:;BCL:0;PCL:0;RULEID:;SRVR:SN1PR0301MB1998; X-Microsoft-Exchange-Diagnostics: 1; SN1PR0301MB1998; 25:Uv3OmedLscGKL08Ey7qEfvnQLpKYz6OrAThyRRo6YoqQGfd049/EbYOt4oc6T+TJ/1VxLNsLEgi/iwgC/reS4eQlM1vXm/5tPcgTaQIVTupVU7Or/U7Xa0V98uKOuyWRGSXLm39f1SXUXkKvCLzO4N8xC1nHBkqa1pECZrbchyWx8CfOY5nl7nNOob48cAxN+pP1/DenE0H5BcJxoFVBdriA34sYRk/WBtWt4911KRoQws39WgiiBlQyxQ+SEZt6BQDeiXUchdsqBQ8L/1EPPCcWmqgj4mIxS0hRgtBV7m3Chb8LER5QpKiYRJivMBVyPpa1m7ditn+f1omDmyp4AxrMAzaYkl1qG34Q+xvde+aP/p+Ui/mVjQ2XE97PcBNZcviJXXxAMJqogeVE/xaQ4q2cLMHamyYh/onwFVisi5bzPapkPtc5PCG90S95FIwlD7TuE5MFCd7Aa57uOUOpjh3zG/iuhxCjIxDPg00AymyX5fC2zgM9QEJqkGVz39zg9nUBQqTM9ZR5lyXJCvXBt/n1dK5L9UIZqSHoyIVUSVWxIrWyHIr18yGKzi72FJXiFmj6DVW08/bR0rxbRVHpbwYDtRpdPs0RVijtn6BcxFgrib0oG0UCC637LDiLsQQKK7jcYdnePFXFl149QpaLh0yMEN+ueWWOAFnxJ/ukbPQTT1sIHuBnvfHOjG2WTMU4apiy3NXyX+2+3EL8joYnug==; 31:FKobS8tTWr0Rdt+7qC/i37wJe3jzjZjmlf+FcNHVb7jCWyuDL9CfnD0n6+mAYDIbxQcabf+2pQbLtKekid2b+2cEjkzKdJoxWCim++wyz2z4UwTyYnymoIjyLUQVxXU4B/K2WodugeWr2g0BDUGEw0AWDWoPFIk9JbCHIMMe9eLcrAoY0oD0RTEsprQlb/DHNSMtE+Lfwkx jqm75oLvWSQ== X-Microsoft-Antispam-PRVS: X-Exchange-Antispam-Report-Test: UriScan:(185117386973197); X-Exchange-Antispam-Report-CFA-Test: BCL:0; PCL:0; RULEID:(601004)(2401047)(13017025)(13023025)(13024025)(13018025)(13015025)(8121501046)(5005006)(10201501046)(3002001)(6055026); SRVR:SN1PR0301MB1998; BCL:0; PCL:0; RULEID:(400006); SRVR:SN1PR0301MB1998; X-Microsoft-Exchange-Diagnostics: 1; SN1PR0301MB1998; 4:2aHpcgIN23ypXEMOV+E8WBBbn6KgdxdfC3DVb3O/hO3G4bB5Qdbu5LOGeX9+jRdY23lcGwE9gJKC+6V8fKhdTJh3mHpblqRkJ+S43jUAvERPm1grxwo2pV7rSRNCg36QDsspXhLfQa0i6vbqkMNKKoS8+HA8WYH4FfN6vTYs9TjbXVpC8PgR4bmnDXll3xkuf//ZZUStQy8Gsdpcm7alP2VEXFNSbAcpSYwd+c5jyG5Yi+/G84AgFqOuc9uIWmiDzdPqmtwGOX7BKNsXO5T14YHEU8HvuuZZ9YJzbjIkkUHkznJ/FeLGB6WU6epk82CWQMM02q3Y95RmwYs72IWgjJLKM0US2uj+FR7CYVCbaeLObWkjT5owGDnEb5ImmLPUv/6Tesr3m9WCni70EIj9Vht5aY7Gc5yRRsHT0juzd6fclNO8Ow2qNGrDYv3UaH8XVXZEhMu8gop1TTwyzEYpZ3zFi1d1SsPNqDQXZI9c7IWVLwc6Etv2SlmBULDK0eyeqUQAXR8JQw0hhEu9UW4Zhw== X-Forefront-PRVS: 0001227049 X-Microsoft-Exchange-Diagnostics: =?us-ascii?Q?1; SN1PR0301MB1998; 23:uNKiQkfBd9LYJzrOwtr7+GvWuwbfWJ7d5icpmTF?= =?us-ascii?Q?itbpzg2hinLPqcmtaUu2lheNXjH8s/BFQB+IbecLm0T2D3KUJJc1m+3iYF0l?= =?us-ascii?Q?wd0Oc4tqKCUoFAIIGtZOUdfB4GBr5hPesDYE2/C1e5WjMunz77lk/BkvP+gx?= =?us-ascii?Q?qTaxVyAH3zh7hjGPY3qRbsCUSW8OrdPwJVDl/p8u20d8pwqurKT7g9BV0ixn?= =?us-ascii?Q?GMe/gniGxOXeBTuRljRtgLQPijgslfEkWRlb1Nk9QCk162wjymH8VYYARJy+?= =?us-ascii?Q?+cN8/dijbGhFQY+1sy1yIGIZLQ8WZObHx9qk+sN0Y7ShYlKf/hQo69bHDbfq?= =?us-ascii?Q?l5CC/vfUjZbB9Tea6fMZd4HwLc7fSPnnX/AOTxU1CM3gnfijNo5RdMm3UPH2?= =?us-ascii?Q?VLSnDab5P2lF23AfGkPFF2MgDO4/9qir+5GHWcluWP5o2MgmMROPpmIPZykl?= =?us-ascii?Q?9bJvcOUeuSg7O/Bp35pf0+wr5MLIf/1jAnPBR2CS+eckzYejbCyMEJO0AqoH?= =?us-ascii?Q?DbVv/2QaC48l35dAkklfPX17PakuRNszE7M8v1DEmjEo9xE3I0Xjq6pM4Ero?= =?us-ascii?Q?p/5JOC3256dr9H1dTx4o0jTeqRiLVXQ7KpwwQB/7sRI9inuUG5Q3fPBJ81nk?= =?us-ascii?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qTtQVwByyCjZjM+k9eTvJ5FKCCp35ICl8w6QBtDz7bB1IZdT8Abw3V/kuc=; 24:wUF61n0VFoL9HBwc8/xYhtdfDAy1TV/kt2N2PNrgk8F5nHAg+2Yt68FCM3n/y9B3ut54eGPsnPAGtMwU6L6V7mOFiIoUGLrZgSHcGAy0r9Q=; 7:nIeMBQncu2J1uF3HcW2++Yr2BPWH/G83il/bQ4MeZBU9mPe7VZ6tqV6fgX+Lu78LgWSeMj9nx2hXAKduWWRKhNNkE1ggfbSFezQo2OK+dPJsFHDqnzDllre35RoVuDRXw2BoXfModcV7BsuE2C/430RyjOD1NDEmvGsqg979kQal3pLVLTJKikLxTGD16e+DJVMHdd/DHBofdRAwgDyCTVlT90K64rLTwN6y1MGRljv+ix5Dg7wB7dbV3FrUI4gb SpamDiagnosticOutput: 1:99 SpamDiagnosticMetadata: NSPM X-MS-Exchange-CrossTenant-OriginalArrivalTime: 12 Jul 2016 07:54:07.2561 (UTC) X-MS-Exchange-CrossTenant-Id: 5afe0b00-7697-4969-b663-5eab37d5f47e X-MS-Exchange-CrossTenant-OriginalAttributedTenantConnectingIp: TenantId=5afe0b00-7697-4969-b663-5eab37d5f47e; Ip=[192.88.168.50]; Helo=[tx30smr01.am.freescale.net] X-MS-Exchange-CrossTenant-FromEntityHeader: HybridOnPrem X-MS-Exchange-Transport-CrossTenantHeadersStamped: SN1PR0301MB1998 Sender: linux-mmc-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-mmc@vger.kernel.org X-Virus-Scanned: ClamAV using ClamSMTP Switch to use the more robust common mmc_regulator_set_vqmmc() function in MMC core which set the target voltage as close as possible to target voltage. We did not re-factor the whole sdhci_start_signal_voltage_switch() cause we want to keep the original signal switch order between host and card to avoid potential break. Signed-off-by: Dong Aisheng Acked-by: Adrian Hunter --- drivers/mmc/host/sdhci.c | 9 +++------ 1 file changed, 3 insertions(+), 6 deletions(-) diff --git a/drivers/mmc/host/sdhci.c b/drivers/mmc/host/sdhci.c index 2ee8bfa77116..7894652b9929 100644 --- a/drivers/mmc/host/sdhci.c +++ b/drivers/mmc/host/sdhci.c @@ -1835,8 +1835,7 @@ static int sdhci_start_signal_voltage_switch(struct mmc_host *mmc, sdhci_writew(host, ctrl, SDHCI_HOST_CONTROL2); if (!IS_ERR(mmc->supply.vqmmc)) { - ret = regulator_set_voltage(mmc->supply.vqmmc, 2700000, - 3600000); + ret = mmc_regulator_set_vqmmc(mmc, ios); if (ret) { pr_warn("%s: Switching to 3.3V signalling voltage failed\n", mmc_hostname(mmc)); @@ -1859,8 +1858,7 @@ static int sdhci_start_signal_voltage_switch(struct mmc_host *mmc, if (!(host->flags & SDHCI_SIGNALING_180)) return -EINVAL; if (!IS_ERR(mmc->supply.vqmmc)) { - ret = regulator_set_voltage(mmc->supply.vqmmc, - 1700000, 1950000); + ret = mmc_regulator_set_vqmmc(mmc, ios); if (ret) { pr_warn("%s: Switching to 1.8V signalling voltage failed\n", mmc_hostname(mmc)); @@ -1892,8 +1890,7 @@ static int sdhci_start_signal_voltage_switch(struct mmc_host *mmc, if (!(host->flags & SDHCI_SIGNALING_120)) return -EINVAL; if (!IS_ERR(mmc->supply.vqmmc)) { - ret = regulator_set_voltage(mmc->supply.vqmmc, 1100000, - 1300000); + ret = mmc_regulator_set_vqmmc(mmc, ios); if (ret) { pr_warn("%s: Switching to 1.2V signalling voltage failed\n", mmc_hostname(mmc));