From patchwork Tue Jul 14 19:29:46 2015 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Franklin Cooper X-Patchwork-Id: 6788621 Return-Path: X-Original-To: patchwork-linux-omap@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 C29329F2F0 for ; Tue, 14 Jul 2015 19:30:35 +0000 (UTC) Received: from mail.kernel.org (localhost [127.0.0.1]) by mail.kernel.org (Postfix) with ESMTP id E536C20661 for ; Tue, 14 Jul 2015 19:30:34 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by mail.kernel.org (Postfix) with ESMTP id 43108206AC for ; Tue, 14 Jul 2015 19:30:33 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1753211AbbGNTaM (ORCPT ); Tue, 14 Jul 2015 15:30:12 -0400 Received: from bear.ext.ti.com ([192.94.94.41]:45576 "EHLO bear.ext.ti.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1752627AbbGNTaK (ORCPT ); Tue, 14 Jul 2015 15:30:10 -0400 Received: from dflxv15.itg.ti.com ([128.247.5.124]) by bear.ext.ti.com (8.13.7/8.13.7) with ESMTP id t6EJU94I008031; Tue, 14 Jul 2015 14:30:09 -0500 Received: from DLEE70.ent.ti.com (dlemailx.itg.ti.com [157.170.170.113]) by dflxv15.itg.ti.com (8.14.3/8.13.8) with ESMTP id t6EJU9QY027742; Tue, 14 Jul 2015 14:30:09 -0500 Received: from dflp33.itg.ti.com (10.64.6.16) by DLEE70.ent.ti.com (157.170.170.113) with Microsoft SMTP Server id 14.3.224.2; Tue, 14 Jul 2015 14:29:46 -0500 Received: from dbdmail01.india.ti.com (dbdmail01.india.ti.com [172.24.162.206]) by dflp33.itg.ti.com (8.14.3/8.13.8) with ESMTP id t6EJU8nX001458; Tue, 14 Jul 2015 14:30:08 -0500 Received: from uda0273011.am.dhcp.ti.com (uda0273011.am.dhcp.ti.com [128.247.127.17]) by dbdmail01.india.ti.com (8.14.3/8.14.3/SuSE Linux 0.8) with ESMTP id t6EJU4NM016271; Wed, 15 Jul 2015 01:00:05 +0530 From: Franklin S Cooper Jr To: CC: , , , , Lokesh Vutla , Murali Karicheri , Franklin S Cooper Jr Subject: [PATCH] mmc: omap_hsmmc: Update driver to support without regulators Date: Tue, 14 Jul 2015 14:29:46 -0500 Message-ID: <1436902186-6542-1-git-send-email-fcooper@ti.com> X-Mailer: git-send-email 1.9.1 MIME-Version: 1.0 Sender: linux-omap-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-omap@vger.kernel.org X-Spam-Status: No, score=-8.3 required=5.0 tests=BAYES_00, RCVD_IN_DNSWL_HI, RP_MATCHES_RCVD, UNPARSEABLE_RELAY autolearn=unavailable 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 From: Roger Quadros Update driver to support without regulators. Without this patch boards that do not enable regulator config options will fail to boot with a kernel panic. Signed-off-by: Roger Quadros Signed-off-by: Lokesh Vutla Signed-off-by: Murali Karicheri Signed-off-by: Franklin S Cooper Jr --- Documentation/devicetree/bindings/mmc/ti-omap-hsmmc.txt | 2 ++ drivers/mmc/host/omap_hsmmc.c | 14 ++++++++++---- 2 files changed, 12 insertions(+), 4 deletions(-) diff --git a/Documentation/devicetree/bindings/mmc/ti-omap-hsmmc.txt b/Documentation/devicetree/bindings/mmc/ti-omap-hsmmc.txt index 76bf087..2408e87 100644 --- a/Documentation/devicetree/bindings/mmc/ti-omap-hsmmc.txt +++ b/Documentation/devicetree/bindings/mmc/ti-omap-hsmmc.txt @@ -22,6 +22,8 @@ ti,dual-volt: boolean, supports dual voltage cards ti,non-removable: non-removable slot (like eMMC) ti,needs-special-reset: Requires a special softreset sequence ti,needs-special-hs-handling: HSMMC IP needs special setting for handling High Speed +voltage-ranges: Specify the voltage range supported if regulator framework +isn't enabled. dmas: List of DMA specifiers with the controller specific format as described in the generic DMA client binding. A tx and rx specifier is required. diff --git a/drivers/mmc/host/omap_hsmmc.c b/drivers/mmc/host/omap_hsmmc.c index b2b411d..16c870f 100644 --- a/drivers/mmc/host/omap_hsmmc.c +++ b/drivers/mmc/host/omap_hsmmc.c @@ -1551,10 +1551,13 @@ static void omap_hsmmc_set_ios(struct mmc_host *mmc, struct mmc_ios *ios) if (ios->power_mode != host->power_mode) { switch (ios->power_mode) { case MMC_POWER_OFF: - mmc_pdata(host)->set_power(host->dev, 0, 0); + if (host->use_reg) + mmc_pdata(host)->set_power(host->dev, 0, 0); break; case MMC_POWER_UP: - mmc_pdata(host)->set_power(host->dev, 1, ios->vdd); + if (host->use_reg) + mmc_pdata(host)->set_power(host->dev, 1, + ios->vdd); break; case MMC_POWER_ON: do_send_init_stream = 1; @@ -2082,10 +2085,13 @@ static int omap_hsmmc_probe(struct platform_device *pdev) if (ret) goto err_irq; host->use_reg = 1; + mmc->ocr_avail = mmc_pdata(host)->ocr_mask; + } else { + ret = mmc_of_parse_voltage(pdev->dev.of_node, &mmc->ocr_avail); + if (ret) + goto err_irq; } - mmc->ocr_avail = mmc_pdata(host)->ocr_mask; - omap_hsmmc_disable_irq(host); /*