From patchwork Tue May 1 10:39:13 2018 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Vijay Viswanath X-Patchwork-Id: 10373529 X-Patchwork-Delegate: agross@codeaurora.org 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 9CCCB6032A for ; Tue, 1 May 2018 10:40:22 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 8D3EF28C28 for ; Tue, 1 May 2018 10:40:22 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id 8189B28C2D; Tue, 1 May 2018 10:40:22 +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=-7.8 required=2.0 tests=BAYES_00,DKIM_SIGNED, MAILING_LIST_MULTI, RCVD_IN_DNSWL_HI, T_DKIM_INVALID 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 1CFDC28C28 for ; Tue, 1 May 2018 10:40:22 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1754837AbeEAKjw (ORCPT ); Tue, 1 May 2018 06:39:52 -0400 Received: from smtp.codeaurora.org ([198.145.29.96]:39306 "EHLO smtp.codeaurora.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1754198AbeEAKju (ORCPT ); Tue, 1 May 2018 06:39:50 -0400 Received: by smtp.codeaurora.org (Postfix, from userid 1000) id 1B1AC607CF; Tue, 1 May 2018 10:39:49 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=codeaurora.org; s=default; t=1525171190; bh=/EXheJJra8TkyY+xDJNrEy1GuJdqy7PWhxD4SwGkthw=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=aks1anb2qdgmGwaqC/MYq/MPDfnO8To4YRBp5uygUQB9f9ko0wTgIXgYX+3lmVQ47 K/67bmLr0FV7H9l9biraKDiHmedHfSBt/wrdVyFvS0AW3UZDVUM5eF3w4IKa7/yEsC Ct/N3Nf+7NbjO2IjfetSJSL16mQE3sfhTJXjFmiE= Received: from hydcbspbld03.qualcomm.com (blr-c-bdr-fw-01_globalnat_allzones-outside.qualcomm.com [103.229.19.19]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-SHA256 (128/128 bits)) (No client certificate requested) (Authenticated sender: vviswana@smtp.codeaurora.org) by smtp.codeaurora.org (Postfix) with ESMTPSA id 0CD0C6079C; Tue, 1 May 2018 10:39:43 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=codeaurora.org; s=default; t=1525171189; bh=/EXheJJra8TkyY+xDJNrEy1GuJdqy7PWhxD4SwGkthw=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=O7J6+2qJZ1+lQkR+SscUqHBa4CelxXHvqHUfT2Y16HhDxjCNjG+Gz/4m8i3kg/9Y4 RXADqK2hGmdqIassAEppPlWF4JMklSgsg3ueAG1yRHhOY9im1/pCJaR+xKxzOWkNky Rzaa8Xv43VwQAMwZGLboAj4Nxql1aNRSSZcnLQHo= DMARC-Filter: OpenDMARC Filter v1.3.2 smtp.codeaurora.org 0CD0C6079C Authentication-Results: pdx-caf-mail.web.codeaurora.org; dmarc=none (p=none dis=none) header.from=codeaurora.org Authentication-Results: pdx-caf-mail.web.codeaurora.org; spf=none smtp.mailfrom=vviswana@codeaurora.org From: Vijay Viswanath To: adrian.hunter@intel.com, ulf.hansson@linaro.org Cc: linux-mmc@vger.kernel.org, linux-kernel@vger.kernel.org, shawn.lin@rock-chips.com, linux-arm-msm@vger.kernel.org, georgi.djakov@linaro.org, asutoshd@codeaurora.org, stummala@codeaurora.org, venkatg@codeaurora.org, jeremymc@redhat.com, vviswana@codeaurora.org, bjorn.andersson@linaro.org, riteshh@codeaurora.org, vbadigan@codeaurora.org, dianders@google.com, sayalil@codeaurora.org Subject: [PATCH RFC 4/4] host: sdhci-msm: implement get_current_limit() host op Date: Tue, 1 May 2018 16:09:13 +0530 Message-Id: <1525171153-24476-5-git-send-email-vviswana@codeaurora.org> X-Mailer: git-send-email 1.9.1 In-Reply-To: <1525171153-24476-1-git-send-email-vviswana@codeaurora.org> References: <1525171153-24476-1-git-send-email-vviswana@codeaurora.org> Sender: linux-arm-msm-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-arm-msm@vger.kernel.org X-Virus-Scanned: ClamAV using ClamSMTP From: Sahitya Tummala This is needed to get the current capabilities of vdd regulator that is not managed by SDHCI driver. Change-Id: I927c14b9890f1d672fe8a3e89d0b334f43463b36 Signed-off-by: Sahitya Tummala Signed-off-by: Sayali Lokhande Signed-off-by: Vijay Viswanath --- drivers/mmc/host/sdhci-msm.c | 13 +++++++++++++ 1 file changed, 13 insertions(+) diff --git a/drivers/mmc/host/sdhci-msm.c b/drivers/mmc/host/sdhci-msm.c index 0e0f12d..083b4a5 100644 --- a/drivers/mmc/host/sdhci-msm.c +++ b/drivers/mmc/host/sdhci-msm.c @@ -2079,6 +2079,18 @@ static void sdhci_msm_set_default_hw_caps(struct device *dev, {}, }; +static unsigned int sdhci_msm_get_current_limit(struct sdhci_host *host) +{ + struct sdhci_pltfm_host *pltfm_host = sdhci_priv(host); + struct sdhci_msm_host *msm_host = sdhci_pltfm_priv(pltfm_host); + struct sdhci_msm_reg_data *vdd_data = msm_host->pdata.vdd_data; + u32 max_curr = 0; + + if (vdd_data) + max_curr = vdd_data->hpm_uA; + return max_curr; +} + MODULE_DEVICE_TABLE(of, sdhci_msm_dt_match); static const struct sdhci_ops sdhci_msm_ops = { @@ -2090,6 +2102,7 @@ static void sdhci_msm_set_default_hw_caps(struct device *dev, .set_uhs_signaling = sdhci_msm_set_uhs_signaling, .write_w = sdhci_msm_writew, .write_b = sdhci_msm_writeb, + .get_current_limit = sdhci_msm_get_current_limit, }; static const struct sdhci_pltfm_data sdhci_msm_pdata = {