From patchwork Fri Apr 15 17:29:30 2016 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Aisheng Dong X-Patchwork-Id: 8853611 Return-Path: X-Original-To: patchwork-linux-mmc@patchwork.kernel.org Delivered-To: patchwork-parsemail@patchwork2.web.kernel.org Received: from mail.kernel.org (mail.kernel.org [198.145.29.136]) by patchwork2.web.kernel.org (Postfix) with ESMTP id E35D9BF29F for ; Fri, 15 Apr 2016 17:37:40 +0000 (UTC) Received: from mail.kernel.org (localhost [127.0.0.1]) by mail.kernel.org (Postfix) with ESMTP id E860020160 for ; Fri, 15 Apr 2016 17:37:39 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by mail.kernel.org (Postfix) with ESMTP id 81AEE20204 for ; Fri, 15 Apr 2016 17:37:38 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1752616AbcDORhc (ORCPT ); Fri, 15 Apr 2016 13:37:32 -0400 Received: from mail-bl2on0074.outbound.protection.outlook.com ([65.55.169.74]:39296 "EHLO na01-bl2-obe.outbound.protection.outlook.com" rhost-flags-OK-OK-OK-FAIL) by vger.kernel.org with ESMTP id S1752637AbcDORh3 (ORCPT ); Fri, 15 Apr 2016 13:37:29 -0400 Received: from BN3PR0301CA0015.namprd03.prod.outlook.com (10.160.180.153) by CO2PR03MB2231.namprd03.prod.outlook.com (10.166.92.136) with Microsoft SMTP Server (TLS) id 15.1.453.26; Fri, 15 Apr 2016 17:37:25 +0000 Received: from BN1BFFO11FD047.protection.gbl (2a01:111:f400:7c10::1:179) by BN3PR0301CA0015.outlook.office365.com (2a01:111:e400:4000::25) with Microsoft SMTP Server (TLS) id 15.1.466.19 via Frontend Transport; Fri, 15 Apr 2016 17:37:25 +0000 Authentication-Results: spf=fail (sender IP is 192.88.158.2) smtp.mailfrom=nxp.com; gmail.com; dkim=none (message not signed) header.d=none; gmail.com; dmarc=none action=none header.from=nxp.com; Received-SPF: Fail (protection.outlook.com: domain of nxp.com does not designate 192.88.158.2 as permitted sender) receiver=protection.outlook.com; client-ip=192.88.158.2; helo=az84smr01.freescale.net; Received: from az84smr01.freescale.net (192.88.158.2) by BN1BFFO11FD047.mail.protection.outlook.com (10.58.145.2) with Microsoft SMTP Server (TLS) id 15.1.453.6 via Frontend Transport; Fri, 15 Apr 2016 17:37:24 +0000 Received: from shlinux2.ap.freescale.net (shlinux2.ap.freescale.net [10.192.224.44]) by az84smr01.freescale.net (8.14.3/8.14.0) with ESMTP id u3FHb2HH019919; Fri, 15 Apr 2016 10:37:21 -0700 From: Dong Aisheng To: CC: , , , , , , , Subject: [PATCH 06/23] mmc: sdhci: using common mmc_regulator_set_vqmmc() Date: Sat, 16 Apr 2016 01:29:30 +0800 Message-ID: <1460741387-23815-7-git-send-email-aisheng.dong@nxp.com> X-Mailer: git-send-email 1.9.1 In-Reply-To: <1460741387-23815-1-git-send-email-aisheng.dong@nxp.com> References: <1460741387-23815-1-git-send-email-aisheng.dong@nxp.com> X-EOPAttributedMessage: 0 X-Matching-Connectors: 131052154456194263; (91ab9b29-cfa4-454e-5278-08d120cd25b8); () X-Forefront-Antispam-Report: CIP:192.88.158.2; IPV:NLI; CTRY:US; EFV:NLI; SFV:NSPM; SFS:(10009020)(6009001)(2980300002)(1109001)(1110001)(339900001)(199003)(189002)(77096005)(50986999)(5008740100001)(76176999)(586003)(19580395003)(19580405001)(1220700001)(1096002)(2950100001)(4326007)(87936001)(105606002)(85426001)(110136002)(81166005)(189998001)(33646002)(2351001)(50466002)(50226001)(229853001)(5003940100001)(104016004)(48376002)(106466001)(92566002)(47776003)(11100500001)(6806005)(36756003)(2906002)(86362001)(7059030); DIR:OUT; SFP:1101; SCL:1; SRVR:CO2PR03MB2231; H:az84smr01.freescale.net; FPR:; SPF:Fail; MLV:sfv; A:1; MX:1; LANG:en; X-Microsoft-Exchange-Diagnostics: 1; BN1BFFO11FD047; 1:OvGF+EzLI5Vx7iwESBmxxa6Qpf1vm8w4+obvkLnuSJKLPJY3hipMHep4RoX2fXwrPsFpc24qkEtYkTnjhH2zpEZJkuo4LvzbbXQl+K62ovUw1dNK8VUex/GbrvSBy5X3ddrYxTY5+57x0Y3gyDJ8EV7akFGQxONCVO6b7Bk0bq/9C9m4T/wu9m+F99kV6P17o8JvmToxsZOjpcskv2t8ZESayZK+qVnHn38wW7NUcAxkDcZgfQGWW0dMOObPZElQQ9WQ1dVDg5pvxeO91JgP/GEU22qw+aZXHvgZOjdOAiR89XVEc0BLY5/2mbi+D6tZrrW13H6LrgBgmaodOom+UJ0cJPPYMAibhUN6JICiMeqHxFoDcUmy8QLv7yThPk6OewJm4AsGwKrQmmB9OpbgnMcHlb03wSWvitM6w/2Np+qc58flJ5nMPYeiIiVFZ7H6dcr2ilptyCSKGIXHimh78W0d5JTXeS6qp1xVcZrwLG3aGHQAroXaKlutNyoPlYL+vaUIp+D3JsRjaGNhFY3u6App1mmA+WsVSbR4GjK24ITrILws0xMyJQ4dzrW+nlGfXwf/48U5AF7wTjI5Y6ghgx1oY24cAdItqE0VL2aH/9AHfjtBkIRj7eEvyKxbEZC8 MIME-Version: 1.0 X-MS-Office365-Filtering-Correlation-Id: dd0bbc2f-213f-480c-db79-08d365549bdd X-Microsoft-Exchange-Diagnostics: 1; CO2PR03MB2231; 2:gKEeq9nMBraivZDuaDb9Vucp0A7DkS52m4nX++/7uaPdrgEixBRYt+4FY5NndAGpDcJ4yFbdGU/D3+O9H5JWBAnDifnuEpcocNI62yPelza6CWTy2hwJcbKUK6whtoy0nlxAtoJRmbxaGUasIj7y5YvKvgumCeMLdoJZrh5/jUWhCHMVw4tRuu2w2OLJAmBy; 3:3HBtAeTrNF+UrOeYksi5BYQ6rZYchzw8pBapNz0n1hC0dm+oAPEYpnXA4ThijD7U3HcDs+8/CcvT+JmOCWHVlVhPX9bNAyLk1pv7qp+oihbrpe+onY7gyf5k9efBXCqj5UCGwEFUtxOGA7KqMtCJwopvIya5Ta59sxfpvbebbSW13SQBVMB2q2z98v1aI973CVL46+C97bcC5L1y0tI1e1kNd2t0qPwePnlnBhDeua0=; 25:BUmh6l9iN4YEJFfxXkXrkD5neGKWensaHvgPKenL/VAABoDxk0kn5/Ocd8kqr2dwkcJrCvTT/9o2tPhz8x7crShYmpHvulZI1ox5yeSHHjHYg0H6AP4Gn6RoHs3chw1n67jKDmSiEbxtT3OBuoxAinOJx9Jp9j7jLzLhJlXFtu6u7DDcJ4ca1gkKmGQvjKWxv4ojxfmMDMeJeamGVQTtzfSU5ZxCdV1F/vk0u8FK+MlLkPBQEpziHir1tODiwlWbY+5dCUvCvxkxywWSOiciO+WbQrW/16I5/wUTQmOk0Sh+1Ptq8ljp/N7eFr0ECtv+6VdUg8j0pBJWgbL7AZYoxg== X-Microsoft-Antispam: UriScan:;BCL:0;PCL:0;RULEID:;SRVR:CO2PR03MB2231; X-Microsoft-Antispam-PRVS: X-Exchange-Antispam-Report-Test: UriScan:; X-Exchange-Antispam-Report-CFA-Test: BCL:0; PCL:0; RULEID:(601004)(2401047)(8121501046)(13015025)(13018025)(13017025)(13023025)(13024025)(5005006)(10201501046)(3002001)(6055026); SRVR:CO2PR03MB2231; BCL:0; PCL:0; RULEID:(400006); SRVR:CO2PR03MB2231; X-Microsoft-Exchange-Diagnostics: 1; CO2PR03MB2231; 4:BruYbafqppa4dnjPrIEHe6UVC3OK1PlB2hE7zEOlh3DJp0vfUeKCSNxyP1N+eQFdRSCcS72JdWSP9UufbRxa8I5ccELssq680Ncd4K5HoJYscZbwetuo9/XDJkspSllne+Leq/+EMBd8yuoI0dJnafhYpH0jG2OUqIuUP+U/x8aZ3M2iL0tdHTaKvPeiaVfF6TN2eg98tEGDrRAdZAjDiD48Py8QWXn98qaUr5NPX5z0QZm2DYzhjEtX4Xp4lzP2xpMkTww4ePFgB2XWJk2WgbcUfae0rTYauR2+oEsu37eejpoSVDF0nq+V3mhTc1ZvQA0AwGj2fq7hTsY419+TJ5wp8MvFCA8yXUOWK/SzqlErSK7ySn02cNk54KFzFjG78UxQLXyuziNpNSLjMuI0Xx6o4RQWF3qz7x4l0doxTCC1VZfnFEQWaXtblRAHmCFtYl495nmYuA/UBCMLFxHo7nHucACRf2VfVGZJDPqiQWI= X-Forefront-PRVS: 0913EA1D60 X-Microsoft-Exchange-Diagnostics: =?us-ascii?Q?1; CO2PR03MB2231; 23:YJqHFmIY3u0cR0AJTp/PLuZiSuh5svLqoIaCEvHsr?= =?us-ascii?Q?yEcz3KNvyMk/plPbrFzDwFTWgzyIFRzraYdjoYc1n5KIkkrafMXB39Jvb53B?= =?us-ascii?Q?moONZUyqfELvXqOecJ0T1d+3smZWqnQ+2lZBwbOtD+VC9wSgVIqhuJiwzY0L?= =?us-ascii?Q?2CxABrpXq+1bWwvrr+fOwnA+aOefu6h7b7/PnzRKJTqHUq8A/Yijf73O9hnT?= =?us-ascii?Q?yLbWPp5s/6BtCuW3Nx4m49ovVsiJ3+ohrSB/jFOuDM8Etqav+rrfdjXGUBUI?= =?us-ascii?Q?934Stm2XgXg+QEndsCkuV3AHLIqobv2Os+ojYCtFinPy1CZMhTn95sl8Uult?= =?us-ascii?Q?zyg5b5oJs78qVwztArKmZguMe+fS9shcE9UhQZEwY8fKkZoN9RzkFxANC5gO?= =?us-ascii?Q?J6Dr/5ugKTRy2PlJoe2TQp19J8I+24qV25qgYapoBMWpOrhZNFNmtg9VIZm2?= =?us-ascii?Q?NNwp48yfySqjXk9etfRieIe61hrnHNq1mNr8HD5R+CvqK3pJy5cumOkKdtVp?= =?us-ascii?Q?bFfss8y3XhsAHpQEWUUs6oO3mCoRhIUwfg9QXp5IShl5ZB9yNpA7I1GgV5H/?= =?us-ascii?Q?rWjMSI6eOtv3eRqT4uGN93uFy2R2/x3s3oSiiXYCelGMTKLIbOmktW+VLTSh?= =?us-ascii?Q?DlNLsft3veV0c2IKpV30KTzZ8mfQb4fEygsBG0DAjFZh/B+o0YLvlWzoVlws?= =?us-ascii?Q?5MmWsUIAVYcofoWKQhvRPkoW1aLCGb8RtGSRlCPJ1IbD5PdIZ/m0a9wblSSd?= =?us-ascii?Q?1bgXN8KRKHt1EKGG5ZMjAna10OhZb/VqJ75FboSDc7hokAAdqgpYNDsX/3lY?= =?us-ascii?Q?emymio9Gw01ivp6dcRX9yzPO5hoaeNypDkYvxsUil3poc4++zuTuJwbjq90J?= =?us-ascii?Q?mP60OqVPs85SgwGqeYf7l2zlTeM6LCuDPVu8HBi2a7FRT3vjUXPhJ2LLsVWN?= =?us-ascii?Q?TrOH4AxtKoxYarDWKRUNnkavMKs3dnOl5KKHYbqlGdPDUW2sJIz97p0NPVjJ?= =?us-ascii?Q?KK0xrNDMMyAMnapGD551L14WZiHV3/yq6DPTFJ+T0GeMIxEvfJW8VIZZsel2?= =?us-ascii?Q?YSwrTE=3D?= X-Microsoft-Exchange-Diagnostics: 1; CO2PR03MB2231; 5:OYXXrqO/VO2LR8TSO7Yb7BHHp+cFeevKGI2+hde91/tZIGyU6aSHwMlCpv6ac/KULN9Be0knVaCTiBcWRJns6qZyylSff6zaayMNbExLYbvPG/M7kM57idrvSTrHWruphnBnwzjr31vVSZ9KuM4CKz7QeWzX+ghtV0KV73p9Ikk=; 24:AB/vLXsF2wN6jT5Yol+MWwJDGgwVP2QTrdlu9rSuhS/A3UTR8VV/RhwibrUFRrOByFyIKlPbOIN0Aa/gF1/BANb3HopU3olTJphwNdBGh/8= SpamDiagnosticOutput: 1:23 SpamDiagnosticMetadata: NSPM X-MS-Exchange-CrossTenant-OriginalArrivalTime: 15 Apr 2016 17:37:24.9174 (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.158.2]; Helo=[az84smr01.freescale.net] X-MS-Exchange-CrossTenant-FromEntityHeader: HybridOnPrem X-MS-Exchange-Transport-CrossTenantHeadersStamped: CO2PR03MB2231 Sender: linux-mmc-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-mmc@vger.kernel.org X-Spam-Status: No, score=-7.9 required=5.0 tests=BAYES_00, RCVD_IN_DNSWL_HI, RP_MATCHES_RCVD, UNPARSEABLE_RELAY autolearn=ham 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 Instead of using private VCCQ regulator signal voltage switch code, we switch to use the more robust common function mmc_regulator_set_vqmmc() in MMC core which set the target voltage as close as possible to target voltage. Signed-off-by: Dong Aisheng --- Don't have a board to test mmc_regulator_set_vqmmc() switch way, need others to help verify. --- drivers/mmc/host/sdhci.c | 39 ++------------------------------------- 1 file changed, 2 insertions(+), 37 deletions(-) diff --git a/drivers/mmc/host/sdhci.c b/drivers/mmc/host/sdhci.c index 7f63f5d..2338aab 100644 --- a/drivers/mmc/host/sdhci.c +++ b/drivers/mmc/host/sdhci.c @@ -1726,43 +1726,8 @@ static int sdhci_start_signal_voltage_switch(struct mmc_host *mmc, if (ret) return ret; - if (IS_ERR(mmc->supply.vqmmc)) - return 0; - - switch (ios->signal_voltage) { - case MMC_SIGNAL_VOLTAGE_330: - ret = regulator_set_voltage(mmc->supply.vqmmc, 2700000, - 3600000); - if (ret) { - pr_warn("%s: Switching to 3.3V signalling voltage failed\n", - mmc_hostname(mmc)); - return -EIO; - } - - return 0; - case MMC_SIGNAL_VOLTAGE_180: - ret = regulator_set_voltage(mmc->supply.vqmmc, - 1700000, 1950000); - if (ret) { - pr_warn("%s: Switching to 1.8V signalling voltage failed\n", - mmc_hostname(mmc)); - return -EIO; - } - - return 0; - case MMC_SIGNAL_VOLTAGE_120: - ret = regulator_set_voltage(mmc->supply.vqmmc, 1100000, - 1300000); - if (ret) { - pr_warn("%s: Switching to 1.2V signalling voltage failed\n", - mmc_hostname(mmc)); - return -EIO; - } - return 0; - default: - /* No signal voltage switch required */ - return 0; - } + /* do regulator signal voltage switch if exist */ + return mmc_regulator_set_vqmmc(mmc, ios); } static int sdhci_card_busy(struct mmc_host *mmc)