From patchwork Thu Jun 9 07:10:08 2016 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Gregory CLEMENT X-Patchwork-Id: 9166333 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 5209B604DB for ; Thu, 9 Jun 2016 07:11:34 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 434D52830C for ; Thu, 9 Jun 2016 07:11:34 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id 382F528310; Thu, 9 Jun 2016 07:11:34 +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 2E76028337 for ; Thu, 9 Jun 2016 07:11:33 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1162071AbcFIHLb (ORCPT ); Thu, 9 Jun 2016 03:11:31 -0400 Received: from down.free-electrons.com ([37.187.137.238]:46231 "EHLO mail.free-electrons.com" rhost-flags-OK-OK-OK-FAIL) by vger.kernel.org with ESMTP id S1162019AbcFIHL2 (ORCPT ); Thu, 9 Jun 2016 03:11:28 -0400 Received: by mail.free-electrons.com (Postfix, from userid 110) id 36B493E8; Thu, 9 Jun 2016 09:11:26 +0200 (CEST) Received: from localhost (81-67-231-93.rev.numericable.fr [81.67.231.93]) by mail.free-electrons.com (Postfix) with ESMTPSA id F32AD1BC; Thu, 9 Jun 2016 09:11:25 +0200 (CEST) From: Gregory CLEMENT To: Ulf Hansson , Adrian Hunter , linux-mmc@vger.kernel.org Cc: Rob Herring , devicetree@vger.kernel.org, Jason Cooper , Andrew Lunn , Sebastian Hesselbarth , Gregory CLEMENT , Thomas Petazzoni , linux-arm-kernel@lists.infradead.org, Nadav Haklai , Victor Gu , Romain Perier , Omri Itach , Marcin Wojtas , Wilson Ding , Shadi Ammouri , Vincent Yang Subject: [PATCH 02/12] mmc: sdhci_f_sdh30: restrict voltage_switch() callback to the 1.8V case Date: Thu, 9 Jun 2016 09:10:08 +0200 Message-Id: <1465456218-28354-3-git-send-email-gregory.clement@free-electrons.com> X-Mailer: git-send-email 2.5.0 In-Reply-To: <1465456218-28354-1-git-send-email-gregory.clement@free-electrons.com> References: <1465456218-28354-1-git-send-email-gregory.clement@free-electrons.com> 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 Given its name the voltage_switch() should be called for any voltage. However currently it is only called for the 1.8V case. That means that the current implementation of the callback could have made this assumption. It seems the case for the f_sdh3 driver. In order to not adding a regression when the voltage_switch() function will be called for the other voltage targets, this patch ensure that the code of the current callback won't be executed for the other case than 1.8V. Cc: Vincent Yang Signed-off-by: Gregory CLEMENT --- drivers/mmc/host/sdhci_f_sdh30.c | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/drivers/mmc/host/sdhci_f_sdh30.c b/drivers/mmc/host/sdhci_f_sdh30.c index 983b8b32ef96..09a341cbd572 100644 --- a/drivers/mmc/host/sdhci_f_sdh30.c +++ b/drivers/mmc/host/sdhci_f_sdh30.c @@ -54,6 +54,10 @@ static void sdhci_f_sdh30_soft_voltage_switch(struct sdhci_host *host) struct f_sdhost_priv *priv = sdhci_priv(host); u32 ctrl = 0; + /* Initially this function was called only for the 1.8V case */ + if (host->mmc->ios.signal_voltage != MMC_SIGNAL_VOLTAGE_180) + return; + usleep_range(2500, 3000); ctrl = sdhci_readl(host, F_SDH30_IO_CONTROL2); ctrl |= F_SDH30_CRES_O_DN;