From patchwork Tue Sep 1 19:32:17 2015 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Vaibhav Hiremath X-Patchwork-Id: 7106701 Return-Path: X-Original-To: patchwork-linux-arm@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 E0316BEEC1 for ; Tue, 1 Sep 2015 19:37:48 +0000 (UTC) Received: from mail.kernel.org (localhost [127.0.0.1]) by mail.kernel.org (Postfix) with ESMTP id 10B69205EE for ; Tue, 1 Sep 2015 19:37:48 +0000 (UTC) Received: from bombadil.infradead.org (bombadil.infradead.org [198.137.202.9]) (using TLSv1.2 with cipher AES128-GCM-SHA256 (128/128 bits)) (No client certificate requested) by mail.kernel.org (Postfix) with ESMTPS id 2AEED205EC for ; Tue, 1 Sep 2015 19:37:47 +0000 (UTC) Received: from localhost ([127.0.0.1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.80.1 #2 (Red Hat Linux)) id 1ZWrLY-0000vd-Dj; Tue, 01 Sep 2015 19:35:56 +0000 Received: from mail-pa0-f41.google.com ([209.85.220.41]) by bombadil.infradead.org with esmtps (Exim 4.80.1 #2 (Red Hat Linux)) id 1ZWrLR-0000md-QO for linux-arm-kernel@lists.infradead.org; Tue, 01 Sep 2015 19:35:50 +0000 Received: by pary6 with SMTP id y6so429471par.0 for ; Tue, 01 Sep 2015 12:35:29 -0700 (PDT) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20130820; h=x-gm-message-state:from:to:cc:subject:date:message-id:in-reply-to :references; bh=1WHeZvzJD5r92PNq2vjudUOMOyCQ9ethvp1Tslk1vfo=; b=gVBN2LnwAxi6xcmyf0gyTlljY/4mD2iRihj3yPIW5j94YA6GYAN5pcO4GnV+TCjCMr ulqxKMuW0dkQqQVnV/OGdc6nSsI4j9nYU+dx+9X/dCDDmD4BePWfyMmMlk5VYqFPd0pA 4i4xnUGbVO425Kuf9ZJmym8CyzgoZoYeNuTP4EyYIuLLX4TeOWGiGzuPMn6QMfReTjTh duaVVesXcexuq14BZR97GCh9GJcdiTTiWqu4ObnFYdurtMC27CyMoUFQ8uj8hkqTWuH8 5MIxUSrqZb9r4ZGevc6POYZn9bTcUkGEznDTI0L7DFivUkNUvpAvdqf2DrkDQ+ec3hYA DOTA== X-Gm-Message-State: ALoCoQlcxwI7QR/lQqPl0zDXISgIN9iI/yECa+fuhyDzygHKlOOUuizNYrzAnisJssrwDX/lSsAV X-Received: by 10.68.231.5 with SMTP id tc5mr50404569pbc.54.1441136129119; Tue, 01 Sep 2015 12:35:29 -0700 (PDT) Received: from localhost.localdomain ([202.62.93.143]) by smtp.gmail.com with ESMTPSA id gw3sm19019035pbc.46.2015.09.01.12.35.24 (version=TLSv1.2 cipher=ECDHE-RSA-AES128-SHA bits=128/128); Tue, 01 Sep 2015 12:35:28 -0700 (PDT) From: Vaibhav Hiremath To: linux-mmc@vger.kernel.org Subject: [RFC 2/3] mmc: sdhci: add host_ops->voltage_switch callback for all other voltages Date: Wed, 2 Sep 2015 01:02:17 +0530 Message-Id: <1441135938-8056-3-git-send-email-vaibhav.hiremath@linaro.org> X-Mailer: git-send-email 1.9.1 In-Reply-To: <1441135938-8056-1-git-send-email-vaibhav.hiremath@linaro.org> References: <1441135938-8056-1-git-send-email-vaibhav.hiremath@linaro.org> X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20150901_123549_908385_0E36C857 X-CRM114-Status: GOOD ( 15.81 ) X-Spam-Score: -2.6 (--) X-BeenThere: linux-arm-kernel@lists.infradead.org X-Mailman-Version: 2.1.20 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: ulf.hansson@linaro.org, linux-kernel@vger.kernel.org, linux-arm-kernel@lists.infradead.org, Vaibhav Hiremath MIME-Version: 1.0 Sender: "linux-arm-kernel" Errors-To: linux-arm-kernel-bounces+patchwork-linux-arm=patchwork.kernel.org@lists.infradead.org X-Spam-Status: No, score=-4.2 required=5.0 tests=BAYES_00, RCVD_IN_DNSWL_MED, T_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 Currently, the sdhci_do_start_signal_voltage_switch() function invokes controller specific voltage switch configuration only for 1.8v usecase; but it is required for others as well. For example, in case of PXA1928 SDH controller, we need to set different configuration for 3.3, 1.8 and 1.2 volt support (I/O domain power control register). Signed-off-by: Vaibhav Hiremath --- Note: Currently ->voltage_switch() callback is only supported in f_sdh30 driver. And I am not sure on the dependency of execution sequence for that device. I could have moved ->voltage_switch() call at one common place (above/below), but was not quite sure about it. So, replicated/duplicated the call for other voltages. drivers/mmc/host/sdhci.c | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/drivers/mmc/host/sdhci.c b/drivers/mmc/host/sdhci.c index 3dd295f..b59b76d 100644 --- a/drivers/mmc/host/sdhci.c +++ b/drivers/mmc/host/sdhci.c @@ -1753,6 +1753,10 @@ static int sdhci_do_start_signal_voltage_switch(struct sdhci_host *host, /* Wait for 5ms */ usleep_range(5000, 5500); + /* Some controller need to do more when switching */ + if (host->ops->voltage_switch) + host->ops->voltage_switch(host, MMC_SIGNAL_VOLTAGE_330); + /* 3.3V regulator output should be stable within 5 ms */ ctrl = sdhci_readw(host, SDHCI_HOST_CONTROL2); if (!(ctrl & SDHCI_CTRL_VDD_180)) @@ -1803,6 +1807,10 @@ static int sdhci_do_start_signal_voltage_switch(struct sdhci_host *host, return -EIO; } } + /* Some controller need to do more when switching */ + if (host->ops->voltage_switch) + host->ops->voltage_switch(host, MMC_SIGNAL_VOLTAGE_120); + return 0; default: /* No signal voltage switch required */