From patchwork Thu Apr 21 13:55:43 2016 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Lars Persson X-Patchwork-Id: 8901041 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.29.136]) by patchwork1.web.kernel.org (Postfix) with ESMTP id 8F9649F441 for ; Thu, 21 Apr 2016 13:55:58 +0000 (UTC) Received: from mail.kernel.org (localhost [127.0.0.1]) by mail.kernel.org (Postfix) with ESMTP id B0C712020F for ; Thu, 21 Apr 2016 13:55:57 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by mail.kernel.org (Postfix) with ESMTP id 18A78202E9 for ; Thu, 21 Apr 2016 13:55:56 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1751884AbcDUNzy (ORCPT ); Thu, 21 Apr 2016 09:55:54 -0400 Received: from bastet.se.axis.com ([195.60.68.11]:45007 "EHLO bastet.se.axis.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1751871AbcDUNzx (ORCPT ); Thu, 21 Apr 2016 09:55:53 -0400 Received: from localhost (localhost [127.0.0.1]) by bastet.se.axis.com (Postfix) with ESMTP id AAA691817A; Thu, 21 Apr 2016 15:55:50 +0200 (CEST) X-Virus-Scanned: Debian amavisd-new at bastet.se.axis.com X-Amavis-Alert: BAD HEADER SECTION, Duplicate header field: "References" Received: from bastet.se.axis.com ([IPv6:::ffff:127.0.0.1]) by localhost (bastet.se.axis.com [::ffff:127.0.0.1]) (amavisd-new, port 10024) with LMTP id 2whdcuJtL+mJ; Thu, 21 Apr 2016 15:55:49 +0200 (CEST) Received: from boulder.se.axis.com (boulder.se.axis.com [10.0.2.104]) by bastet.se.axis.com (Postfix) with ESMTP id BA178180A9; Thu, 21 Apr 2016 15:55:49 +0200 (CEST) Received: from boulder.se.axis.com (localhost [127.0.0.1]) by postfix.imss71 (Postfix) with ESMTP id A3C57169E; Thu, 21 Apr 2016 15:55:49 +0200 (CEST) Received: from thoth.se.axis.com (thoth.se.axis.com [10.0.2.173]) by boulder.se.axis.com (Postfix) with ESMTP id 98593169C; Thu, 21 Apr 2016 15:55:49 +0200 (CEST) Received: from lnxlarper1.se.axis.com (lnxlarper1.se.axis.com [10.88.41.2]) by thoth.se.axis.com (Postfix) with ESMTP id 9510010AF; Thu, 21 Apr 2016 15:55:49 +0200 (CEST) Received: by lnxlarper1.se.axis.com (Postfix, from userid 20456) id 8FDFE800FD; Thu, 21 Apr 2016 15:55:49 +0200 (CEST) From: Lars Persson To: linux-mmc@vger.kernel.org, devicetree@vger.kernel.org Cc: g.liakhovetski@gmx.de, ulf.hansson@linaro.org, robh+dt@kernel.org, pawel.moll@arm.com, mark.rutland@arm.com, ijc+devicetree@hellion.org.uk, galak@codeaurora.org, Lars Persson Subject: [PATCH v4 2/3] mmc: usdhi6rol0: add support for UHS modes Date: Thu, 21 Apr 2016 15:55:43 +0200 Message-Id: X-Mailer: git-send-email 2.1.4 In-Reply-To: References: In-Reply-To: References: 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 Add a start_signal_voltage_switch() operation to support enabling of UHS modes. Signed-off-by: Lars Persson --- drivers/mmc/host/usdhi6rol0.c | 23 ++++++++++++++++++++++- 1 file changed, 22 insertions(+), 1 deletion(-) diff --git a/drivers/mmc/host/usdhi6rol0.c b/drivers/mmc/host/usdhi6rol0.c index 807c06e..28fe5c7 100644 --- a/drivers/mmc/host/usdhi6rol0.c +++ b/drivers/mmc/host/usdhi6rol0.c @@ -21,6 +21,7 @@ #include #include #include +#include #include #include #include @@ -1147,12 +1148,22 @@ static void usdhi6_enable_sdio_irq(struct mmc_host *mmc, int enable) } } +static int usdhi6_sig_volt_switch(struct mmc_host *mmc, struct mmc_ios *ios) +{ + int ret; + + ret = mmc_regulator_set_vqmmc(mmc, ios); + + return ret; +} + static struct mmc_host_ops usdhi6_ops = { .request = usdhi6_request, .set_ios = usdhi6_set_ios, .get_cd = usdhi6_get_cd, .get_ro = usdhi6_get_ro, .enable_sdio_irq = usdhi6_enable_sdio_irq, + .start_signal_voltage_switch = usdhi6_sig_volt_switch, }; /* State machine handlers */ @@ -1785,7 +1796,17 @@ static int usdhi6_probe(struct platform_device *pdev) mmc->ops = &usdhi6_ops; mmc->caps |= MMC_CAP_SD_HIGHSPEED | MMC_CAP_MMC_HIGHSPEED | - MMC_CAP_UHS_SDR50 | MMC_CAP_UHS_DDR50 | MMC_CAP_SDIO_IRQ; + MMC_CAP_SDIO_IRQ; + + /* + * A vqmmc regulator with a 1.8V mode is mandatory to support + * UHS modes. + */ + if (!of_property_read_bool(dev->of_node, "no-1-8-v") && + !IS_ERR(mmc->supply.vqmmc)) { + mmc->caps |= MMC_CAP_UHS_DDR50 | MMC_CAP_UHS_SDR50; + } + /* Set .max_segs to some random number. Feel free to adjust. */ mmc->max_segs = 32; mmc->max_blk_size = 512;