From patchwork Thu Mar 2 09:47:23 2017 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Yangbo Lu X-Patchwork-Id: 9599805 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 6864860414 for ; Thu, 2 Mar 2017 10:04:29 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 5856C2858F for ; Thu, 2 Mar 2017 10:04:29 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id 4D2112859B; Thu, 2 Mar 2017 10:04:29 +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=ham 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 DBEF22858F for ; Thu, 2 Mar 2017 10:04:28 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1750743AbdCBKE2 (ORCPT ); Thu, 2 Mar 2017 05:04:28 -0500 Received: from mail-bn3nam01on0047.outbound.protection.outlook.com ([104.47.33.47]:10486 "EHLO NAM01-BN3-obe.outbound.protection.outlook.com" rhost-flags-OK-OK-OK-FAIL) by vger.kernel.org with ESMTP id S1750714AbdCBKEU (ORCPT ); Thu, 2 Mar 2017 05:04:20 -0500 Received: from BN3PR03CA0112.namprd03.prod.outlook.com (10.174.66.30) by CY4PR03MB2950.namprd03.prod.outlook.com (10.175.116.140) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_CBC_SHA384_P384) id 15.1.933.12; Thu, 2 Mar 2017 10:01:38 +0000 Received: from BN1AFFO11FD040.protection.gbl (2a01:111:f400:7c10::155) by BN3PR03CA0112.outlook.office365.com (2603:10b6:400:4::30) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_CBC_SHA384_P384) id 15.1.933.12 via Frontend Transport; Thu, 2 Mar 2017 10:01:37 +0000 Authentication-Results: spf=fail (sender IP is 192.88.168.50) smtp.mailfrom=nxp.com; nxp.com; dkim=none (message not signed) header.d=none;nxp.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 BN1AFFO11FD040.mail.protection.outlook.com (10.58.52.251) with Microsoft SMTP Server (version=TLS1_0, cipher=TLS_RSA_WITH_AES_256_CBC_SHA) id 15.1.933.11 via Frontend Transport; Thu, 2 Mar 2017 10:01:37 +0000 Received: from titan.ap.freescale.net ([10.192.208.233]) by tx30smr01.am.freescale.net (8.14.3/8.14.0) with ESMTP id v22A1OJ7007146; Thu, 2 Mar 2017 03:01:33 -0700 From: Yangbo Lu To: , , Adrian Hunter , Rob Herring , Mark Rutland , Catalin Marinas , "Will Deacon" CC: , , Xiaobo Xie , Yangbo Lu Subject: [PATCH 2/9] mmc: sdhci: add a callback for signal voltage switching Date: Thu, 2 Mar 2017 17:47:23 +0800 Message-ID: <1488448050-7574-3-git-send-email-yangbo.lu@nxp.com> X-Mailer: git-send-email 2.1.0.27.g96db324 In-Reply-To: <1488448050-7574-1-git-send-email-yangbo.lu@nxp.com> References: <1488448050-7574-1-git-send-email-yangbo.lu@nxp.com> X-EOPAttributedMessage: 0 X-Matching-Connectors: 131329224976660625; (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)(336005)(39450400003)(39400400002)(39840400002)(39380400002)(39850400002)(39410400002)(39860400002)(2980300002)(1110001)(1109001)(339900001)(189002)(199003)(9170700003)(8676002)(47776003)(81166006)(38730400002)(5003940100001)(36756003)(50986999)(76176999)(2906002)(53936002)(92566002)(2950100002)(104016004)(4326008)(7416002)(626004)(48376002)(189998001)(50466002)(54906002)(77096006)(6666003)(8656002)(86362001)(105606002)(106466001)(8936002)(356003)(68736007)(33646002)(5660300001)(85426001)(50226002)(305945005); DIR:OUT; SFP:1101; SCL:1; SRVR:CY4PR03MB2950; H:tx30smr01.am.freescale.net; FPR:; SPF:Fail; MLV:ovrnspm; MX:1; A:1; PTR:InfoDomainNonexistent; LANG:en; X-Microsoft-Exchange-Diagnostics: 1; BN1AFFO11FD040; 1:Ke3wFqChQ5h2/benIU/Qx5Y8BDg3UTOijvNt6MJzhK7z5dOwt/7jeM80a+42cp8mSOBfsqTvfEX158ZwcB/iDEiwEytoDRB/HVX8et5HIEZT8cB6NnxDD3SO6DO/g+fhFKQhDn6y/srkTrXn2h9OlKbX/4W5GYBeOYVbuJzzQ6+1yidPrfUfJ5wvuEV1NbfjLXzfiryXhI5OgQyCKQhlpYvIGUjLzjSwy0vJ7aPsUxuYVxRMcGgeunhZm49nOgFA0JRrcyaANksBiHxkXBiCmK0MgmmqN1D+BuLLL1q+y+7CDOgKrdQ67AKxmVzGxjscncFCSh4ig8spWC4kgW2XkUbOclKOhaHMK7ouYEAnEDW0IQhwqQHlnQzPD8ab3RwTeXqLEsVffksYDHvCmDiE4Lr9I7VUlycn+mXdpehrg501RLevj0x6rJ0SFqWb8cYIANSAMLzBA1k8oWFkJQ4Uaq1keZBqzxt16qKziKN5HEYeuuDjRU+A9oXH84Gb1ktCg9NVSgA6qpQiCL1RMWGfhGlCEyjEFMw3/geEgWHqLEmrHvYGsphGKJsm4GpyHAPYTV0482AnEYLkilfvtnJ0cahVYecd2+G+DQoGTqbosT3B24Da85ms0rWAvlQwU3zJanaVSEycbOP6Qqsim5N1cJl6EhG1zCCUXwBFhKbxE0A61Uh16ynu0W2ICA+z7ZRmfA3YqJuyb8HMc1YIacpF+Vj0xRB0fz+BT0SDWR40keC03ISMnFLCIwFJsHvbpA8l MIME-Version: 1.0 X-MS-Office365-Filtering-Correlation-Id: bb6faba3-c7ba-4d15-1731-08d461531dd1 X-Microsoft-Antispam: UriScan:; BCL:0; PCL:0; RULEID:(22001); SRVR:CY4PR03MB2950; X-Microsoft-Exchange-Diagnostics: 1; CY4PR03MB2950; 3:AWIBK6KvFP5208REV5j+lueb4oYeDDZ0cweBOJLPgZJf8dTXabJWJgThzYujT0JZCbC68rJ4DNYyMe39UTD1IccO+I5DseYZR1QMmGKiPQtHfssCyGmpd/2ac18MAoF3omS0QBg3dPc99E9dozTxpFUWuKbn7/wGQZ7gbbVvXLTofSHwpC3P+gKRW6DZnyqlwCjIE6RMnCTx5ZenYeFnQUG/VPMUYPTORWgAk9pXu4qqTE7RNIcyJRUVDxc/lNMGfS/upbi0tIIx5mlsHE7FI7T3YIFP3zr4X1TdsE4qLzckLibTj+H21pkceRmymdICYlK8jhjvF/YwtkDKQul68h/cnqOe0Dvgqn3n4+9Z9jXzCV5xuGgEuk/qtdO/U/Ud; 25:1+0oGzalcQMnRrefteb0kbf7Ug1Woco0c4z5YHNkfmZy+SmKBcOATpp57q9rMJe7D2A2dhSwkSbCRKU0c4P2p8VH0MHO3IzcxiE2BierKQSBjEmrt055PT50mwfAGnY5oD/iYhYT8LdjYmetj9r0YPQLBCaxbW5jTFPPTgq1kCGQfBOqtVhlvcCIvADW1111rOi+Dl2MrNEnKFm3u2d5g5bcrymUuZFMBkuUK2zuF7O8fNtI6tyVop56/GCJsmq3tzeYGBFgDd22DGRw1EFnqbk6koU9P/Q7jxLxv3TiE6ib1/YopDDkVcWGvcBTKLFOR9eX8DTWmyvkjgvl5ppX7aEFCh9hR384QWkFlaxIlQR5+1qh+gJmWnuHnallLgi+S2UNtDvbIGDSgQ3BILfEaIagbzA0pQkHiwvsavicJ7hoZFkiZNG+FtrDTDUN7Ea3IKj/Zpf/Ep8wW1iOfzr5uQ== X-Microsoft-Exchange-Diagnostics: 1; CY4PR03MB2950; 31:TbMdK8ru9Ui6j7SrhlOpHECUJ9STpxtfOzCGtcpa0u2/kon+eoOB+bF11+KYj7DdU20Xpi5J1D6HfcYPI1iTIqtGjmRIPWRqqraSXvPCQ3xZmbA2pCtwx2NtjUAGgJM/JCib09g9zuaUL1/urMbzeGqpzaGmVhfX0VnKehJrPwvT0M+QmSzNIHMx8n6NdGYzcyZFaHvTf+JdrIQUpe9wxtXmio2HETpx+fyEZcmer1mhHOtFPat6prn7lSXWDRr72vavhsS941vtzPrNioT4sQlEDiU5kmvnAldPoEe1URA= X-Microsoft-Antispam-PRVS: X-Exchange-Antispam-Report-Test: UriScan:(185117386973197); X-Exchange-Antispam-Report-CFA-Test: BCL:0; PCL:0; RULEID:(6095060)(601004)(2401047)(13015025)(13017025)(13023025)(13024025)(13018025)(8121501046)(5005006)(3002001)(10201501046)(6055026)(6096035)(20161123559025)(20161123561025)(20161123563025)(20161123565025)(20161123556025); SRVR:CY4PR03MB2950; BCL:0; PCL:0; RULEID:(400006); SRVR:CY4PR03MB2950; X-Microsoft-Exchange-Diagnostics: 1; CY4PR03MB2950; 4:JMbr1KeUkl32z8EdzIUGN/xrneVirZuz2Og6fWNYyRoVNUcOqelw8Ug4wNfrZctl5pPYANCByhNGZ2AlG0ky9QNWwb2Te2riXWMu+6v51Cu3l+cySiA/MMJQ4JGY7eExf9OP154iy/3qvEyQd8QMvgR8CpEgmhcxikZJpbiltLTZWqBmR+9yhymZo4YOVPgV65yxqpkm7vNogb1yAwel/BsG4lfWZ9QkLCR1cKmwQ5a3ocr9PxddaPQm+aC5dLSRTwrarpFTS9iNmooA6HzEhyda0xehtnzr/1QfF7DMqV+9c28RM+/SH2Q5onan7ehBAKip1nl5OoIgy8ERRZ94+cH3n0DXfayyaRqA9TBJG+Cv4D0qukDA3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ange-CrossTenant-OriginalArrivalTime: 02 Mar 2017 10:01:37.4632 (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: CY4PR03MB2950 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 Add a callback for signal voltage switching to let host driver switch signal voltage in its own way. Signed-off-by: Yangbo Lu --- drivers/mmc/host/sdhci.c | 6 ++++++ drivers/mmc/host/sdhci.h | 2 ++ 2 files changed, 8 insertions(+) diff --git a/drivers/mmc/host/sdhci.c b/drivers/mmc/host/sdhci.c index 6fdd7a7..3c9a924 100644 --- a/drivers/mmc/host/sdhci.c +++ b/drivers/mmc/host/sdhci.c @@ -1852,6 +1852,12 @@ static int sdhci_start_signal_voltage_switch(struct mmc_host *mmc, if (host->version < SDHCI_SPEC_300) return 0; + if (host->ops->start_signal_voltage_switch) { + ret = host->ops->start_signal_voltage_switch( + host, ios->signal_voltage); + return ret; + } + ctrl = sdhci_readw(host, SDHCI_HOST_CONTROL2); switch (ios->signal_voltage) { diff --git a/drivers/mmc/host/sdhci.h b/drivers/mmc/host/sdhci.h index edf3adf..04af687 100644 --- a/drivers/mmc/host/sdhci.h +++ b/drivers/mmc/host/sdhci.h @@ -566,6 +566,8 @@ struct sdhci_ops { struct mmc_card *card, unsigned int max_dtr, int host_drv, int card_drv, int *drv_type); + int (*start_signal_voltage_switch)(struct sdhci_host *host, + unsigned char signal_voltage); }; #ifdef CONFIG_MMC_SDHCI_IO_ACCESSORS