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: 52943 Return-Path: X-Original-To: linaro@patches.linaro.org Delivered-To: linaro@patches.linaro.org Received: from mail-wi0-f200.google.com (mail-wi0-f200.google.com [209.85.212.200]) by patches.linaro.org (Postfix) with ESMTPS id 73D302300F for ; Tue, 1 Sep 2015 19:35:56 +0000 (UTC) Received: by wicgc1 with SMTP id gc1sf15120478wic.3 for ; Tue, 01 Sep 2015 12:35:55 -0700 (PDT) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20130820; h=x-gm-message-state:mime-version:delivered-to:from:to:cc:subject :date:message-id:in-reply-to:references:sender:precedence:list-id :x-original-sender:x-original-authentication-results:mailing-list :list-post:list-help:list-archive:list-unsubscribe; bh=EXulJANpYNJFD4C9LPyUovKHYtLpssr5bmibqtgAoqw=; b=azIsqp8Pzx6pno7NVeZ/01G8yuqPP3hkf1Oh5guB4EclzrzpPOcaHqRVI4u2VI4NeG djMdSOtcu3YbcdglDno0DOFR0E2e03eDcSi9knMqAZBMRWsQRTi2j63/qU8830HJse6m 8QZupWxCNAl0QnEwJabU0XNIeI5aYrGPN5Tt5v/uZgMnPvhKq8YLV0g50USET3OADuK6 yFoVEg0w0f0WkaRFPQ95xx4ukGhEDIaoPxyfUoaqpBbAfIg3PL7yc1BnfhKwVoAvKdrg rjNVF3qMDHaoAthdwdF2nkAmHTiWah5x3jkgg5QwSt8OLpeQL8vPQjmD+Ot5NYXyATpA WLQQ== X-Gm-Message-State: ALoCoQlAroUg0uWZyEPnFRdGEhWew68W+5TL3kaSRCLycF7S+0AHpN7AnDixKFOqfSHCgzpRUX8f X-Received: by 10.180.87.199 with SMTP id ba7mr1279702wib.5.1441136155798; Tue, 01 Sep 2015 12:35:55 -0700 (PDT) MIME-Version: 1.0 X-BeenThere: patchwork-forward@linaro.org Received: by 10.152.1.101 with SMTP id 5ls709990lal.59.gmail; Tue, 01 Sep 2015 12:35:55 -0700 (PDT) X-Received: by 10.153.4.40 with SMTP id cb8mr6157269lad.121.1441136155649; Tue, 01 Sep 2015 12:35:55 -0700 (PDT) Received: from mail-lb0-f175.google.com (mail-lb0-f175.google.com. [209.85.217.175]) by mx.google.com with ESMTPS id s12si17351979lbp.106.2015.09.01.12.35.55 for (version=TLSv1.2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Tue, 01 Sep 2015 12:35:55 -0700 (PDT) Received-SPF: pass (google.com: domain of patch+caf_=patchwork-forward=linaro.org@linaro.org designates 209.85.217.175 as permitted sender) client-ip=209.85.217.175; Received: by lbpo4 with SMTP id o4so5798512lbp.2 for ; Tue, 01 Sep 2015 12:35:55 -0700 (PDT) X-Received: by 10.152.44.196 with SMTP id g4mr14018822lam.56.1441136155543; Tue, 01 Sep 2015 12:35:55 -0700 (PDT) X-Forwarded-To: patchwork-forward@linaro.org X-Forwarded-For: patch@linaro.org patchwork-forward@linaro.org Delivered-To: patch@linaro.org Received: by 10.112.164.42 with SMTP id yn10csp73630lbb; Tue, 1 Sep 2015 12:35:54 -0700 (PDT) X-Received: by 10.66.227.2 with SMTP id rw2mr32648171pac.98.1441136149014; Tue, 01 Sep 2015 12:35:49 -0700 (PDT) Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id ix3si747471pbb.46.2015.09.01.12.35.48; Tue, 01 Sep 2015 12:35:49 -0700 (PDT) Received-SPF: pass (google.com: best guess record for domain of linux-mmc-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) client-ip=209.132.180.67; Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1751525AbbIATfp (ORCPT + 2 others); Tue, 1 Sep 2015 15:35:45 -0400 Received: from mail-pa0-f52.google.com ([209.85.220.52]:35243 "EHLO mail-pa0-f52.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1753395AbbIATf3 (ORCPT ); Tue, 1 Sep 2015 15:35:29 -0400 Received: by pacfv12 with SMTP id fv12so5379153pac.2 for ; Tue, 01 Sep 2015 12:35:29 -0700 (PDT) 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 Cc: ulf.hansson@linaro.org, linux-kernel@vger.kernel.org, linux-arm-kernel@lists.infradead.org, Vaibhav Hiremath 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> Sender: linux-mmc-owner@vger.kernel.org Precedence: list List-ID: X-Mailing-List: linux-mmc@vger.kernel.org X-Removed-Original-Auth: Dkim didn't pass. X-Original-Sender: vaibhav.hiremath@linaro.org X-Original-Authentication-Results: mx.google.com; spf=pass (google.com: domain of patch+caf_=patchwork-forward=linaro.org@linaro.org designates 209.85.217.175 as permitted sender) smtp.mailfrom=patch+caf_=patchwork-forward=linaro.org@linaro.org Mailing-list: list patchwork-forward@linaro.org; contact patchwork-forward+owners@linaro.org X-Google-Group-Id: 836684582541 List-Post: , List-Help: , List-Archive: List-Unsubscribe: , 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 */