From patchwork Thu May 7 07:56:40 2015 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Zhangfei Gao X-Patchwork-Id: 48079 Return-Path: X-Original-To: linaro@patches.linaro.org Delivered-To: linaro@patches.linaro.org Received: from mail-la0-f72.google.com (mail-la0-f72.google.com [209.85.215.72]) by ip-10-151-82-157.ec2.internal (Postfix) with ESMTPS id 993EE2121F for ; Thu, 7 May 2015 07:57:16 +0000 (UTC) Received: by lamp14 with SMTP id p14sf10926760lam.3 for ; Thu, 07 May 2015 00:57:15 -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=4o5AwyJbndfGSUdud8K1W80jQRKGYdpGzZUMIuzN2Fs=; b=QyO+qyEfkdI0aMRF67tpDuQEN8TwpLelIvHkTTAGTsFETBcb25/qnaNLKJWd/t3Uz2 ffP7xtOFhBWyYTYcPDKT2ypJM/KOJVzVUtrkSKK3JZOXaNrhmFTsuvr4yWyxLHaz4ann hxUKHOL3RcxB8WBhW4FBpwwDNEtdDNzAJvBszEeuk80WxNtCpfZTj6e8Fly1kGEhN4Nv ZxHM4HdAVAgJeEERtvYbgyfgmH6lJhqocO8Svsd3WlBBFB9E37Wg8fkh95bs79cEABe0 QMqohnhWNzbfBkZlGMzjpP4+trnmlyHcvP7EeguZPr3lWQcPPzBYFY8NcwWxoltkmgNl oGpg== X-Gm-Message-State: ALoCoQkfr0In6GGwW3M9qmBwgtPcXOl91e5C1EomohFWZ3CwiO8T1IpukmzGTECG2YHIlKsXptl6 X-Received: by 10.112.46.172 with SMTP id w12mr1536063lbm.18.1430985435571; Thu, 07 May 2015 00:57:15 -0700 (PDT) MIME-Version: 1.0 X-BeenThere: patchwork-forward@linaro.org Received: by 10.152.180.202 with SMTP id dq10ls164235lac.109.gmail; Thu, 07 May 2015 00:57:15 -0700 (PDT) X-Received: by 10.112.171.101 with SMTP id at5mr2076916lbc.66.1430985435344; Thu, 07 May 2015 00:57:15 -0700 (PDT) Received: from mail-la0-f53.google.com (mail-la0-f53.google.com. [209.85.215.53]) by mx.google.com with ESMTPS id wo9si764947lbb.170.2015.05.07.00.57.15 for (version=TLSv1.2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Thu, 07 May 2015 00:57:15 -0700 (PDT) Received-SPF: pass (google.com: domain of patch+caf_=patchwork-forward=linaro.org@linaro.org designates 209.85.215.53 as permitted sender) client-ip=209.85.215.53; Received: by labbd9 with SMTP id bd9so24695268lab.2 for ; Thu, 07 May 2015 00:57:15 -0700 (PDT) X-Received: by 10.112.204.72 with SMTP id kw8mr2056529lbc.88.1430985435254; Thu, 07 May 2015 00:57:15 -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.67.65 with SMTP id l1csp3289677lbt; Thu, 7 May 2015 00:57:14 -0700 (PDT) X-Received: by 10.67.4.230 with SMTP id ch6mr4678324pad.137.1430985423354; Thu, 07 May 2015 00:57:03 -0700 (PDT) Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id su3si1747894pbc.53.2015.05.07.00.57.01; Thu, 07 May 2015 00:57:03 -0700 (PDT) Received-SPF: none (google.com: devicetree-owner@vger.kernel.org does not designate permitted sender hosts) client-ip=209.132.180.67; Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1752225AbbEGH5A (ORCPT + 6 others); Thu, 7 May 2015 03:57:00 -0400 Received: from mail-pa0-f44.google.com ([209.85.220.44]:34716 "EHLO mail-pa0-f44.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1752220AbbEGH47 (ORCPT ); Thu, 7 May 2015 03:56:59 -0400 Received: by pacyx8 with SMTP id yx8so33335576pac.1 for ; Thu, 07 May 2015 00:56:59 -0700 (PDT) X-Received: by 10.70.134.133 with SMTP id pk5mr4640505pdb.133.1430985419324; Thu, 07 May 2015 00:56:59 -0700 (PDT) Received: from localhost.localdomain ([104.207.83.5]) by mx.google.com with ESMTPSA id l5sm1249389pbq.15.2015.05.07.00.56.56 (version=TLSv1.2 cipher=ECDHE-RSA-AES128-SHA bits=128/128); Thu, 07 May 2015 00:56:58 -0700 (PDT) From: Zhangfei Gao To: Jaehoon Chung , ulf.hansson@linaro.org Cc: linux-mmc@vger.kernel.org, devicetree@vger.kernel.org, Zhangfei Gao , "Jorge A. Ramirez-Ortiz" , Dan Yuan Subject: [PATCH v2 2/3] mmc: dw_mmc: add switch_voltage Date: Thu, 7 May 2015 15:56:40 +0800 Message-Id: <1430985401-12202-3-git-send-email-zhangfei.gao@linaro.org> X-Mailer: git-send-email 1.9.1 In-Reply-To: <1430985401-12202-1-git-send-email-zhangfei.gao@linaro.org> References: <1430985401-12202-1-git-send-email-zhangfei.gao@linaro.org> Sender: devicetree-owner@vger.kernel.org Precedence: list List-ID: X-Mailing-List: devicetree@vger.kernel.org X-Removed-Original-Auth: Dkim didn't pass. X-Original-Sender: zhangfei.gao@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.215.53 as permitted sender) smtp.mail=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: , switch_voltage is required on some platform since special register accessing Signed-off-by: Jorge A. Ramirez-Ortiz Signed-off-by: Dan Yuan Signed-off-by: Zhangfei Gao --- drivers/mmc/host/dw_mmc.c | 4 ++++ drivers/mmc/host/dw_mmc.h | 2 ++ 2 files changed, 6 insertions(+) diff --git a/drivers/mmc/host/dw_mmc.c b/drivers/mmc/host/dw_mmc.c index 5f5adaf..ce66565 100644 --- a/drivers/mmc/host/dw_mmc.c +++ b/drivers/mmc/host/dw_mmc.c @@ -1236,11 +1236,15 @@ static int dw_mci_switch_voltage(struct mmc_host *mmc, struct mmc_ios *ios) { struct dw_mci_slot *slot = mmc_priv(mmc); struct dw_mci *host = slot->host; + const struct dw_mci_drv_data *drv_data = host->drv_data; u32 uhs; u32 v18 = SDMMC_UHS_18V << slot->id; int min_uv, max_uv; int ret; + if (drv_data && drv_data->switch_voltage) + return drv_data->switch_voltage(mmc, ios); + /* * Program the voltage. Note that some instances of dw_mmc may use * the UHS_REG for this. For other instances (like exynos) the UHS_REG diff --git a/drivers/mmc/host/dw_mmc.h b/drivers/mmc/host/dw_mmc.h index f45ab91..c723617 100644 --- a/drivers/mmc/host/dw_mmc.h +++ b/drivers/mmc/host/dw_mmc.h @@ -287,5 +287,7 @@ struct dw_mci_drv_data { int (*execute_tuning)(struct dw_mci_slot *slot); int (*prepare_hs400_tuning)(struct dw_mci *host, struct mmc_ios *ios); + int (*switch_voltage)(struct mmc_host *mmc, + struct mmc_ios *ios); }; #endif /* _DW_MMC_H_ */