Received: by 10.213.65.68 with SMTP id h4csp924672imn; Wed, 28 Mar 2018 15:56:02 -0700 (PDT) X-Google-Smtp-Source: AIpwx48cwPb6areu5vNienKFvevN3Pw4YDbXGrYWecCP+i4Uei+i2miqz6xCbRZmkNR0OIH/xjfO X-Received: by 10.98.153.204 with SMTP id t73mr4381269pfk.121.1522277762713; Wed, 28 Mar 2018 15:56:02 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1522277762; cv=none; d=google.com; s=arc-20160816; b=zUhI+KMHOnq/XGect8UkWKnpbuxnnFC1buINdO85CwnkN5vRW89+fIknazkiEcW2RN /i7AOtLc3lNt70OrfhqLz9pk0fK5mcBJY3DbdZTp3NoJlwKUKPQvrqQPnEugKiQLtD5n NKP5nSSsYDX+MkMSBDZ5adF3XbBPPfXYGq8SFyhP4dxno94k4kR3DOZTjXAoR582Ggpp IC8svoSdG6SnPiQMNZonLldd4apF2HTXb8s5F4RSlKPdccHR4o+hqs/89yOqA3oUhjld HbvbHMGmahzLEPesqb6KS0CFFIb4tsvsV/Ru/4piWWSn8EDy7d3WqUZPsKoViK9Kr+6Q zRRw== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:cc:to:subject:message-id:date:from :references:in-reply-to:mime-version:dkim-signature:dkim-signature :arc-authentication-results; bh=hgnzXEHHcuea0sqNj0aebM3xAmiooKdP7Bu+bv6er1c=; b=bvzpKDKHuQOmMCYa149MUH6T0gGiXWC8Jza6FWfHvUa7+jx0t9VQiqifT7QeM7P32a TbQjtEp7QtwazDsLluyRLpBzWz2r2hFIxs7SDUmsjkySJbhb3dp55HCrGwAllPhCSbmS JZedG+r0Mq2XrdQLFvCLQ2y2qu8C/sGrlCigU7bfjQsQgzCvtmjRmRIBwLOURFQzZQOg YxT3TCxhT8ed5EAFbfoZlsYvaQ69J5xfl8ib3893cQfxbs218X+75YraTnY9/5xdRhoH dlfGbD8HWIguY6/ItncchXTfKxPD9Ni1wUdZNPG/sCRKQaZEIul6xjMYd89IvVh7Nfp9 S/HA== ARC-Authentication-Results: i=1; mx.google.com; dkim=fail header.i=@google.com header.s=20161025 header.b=kIPaza8P; dkim=fail header.i=@chromium.org header.s=google header.b=gcFvKQuE; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=chromium.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id p126si3128839pga.86.2018.03.28.15.55.47; Wed, 28 Mar 2018 15:56:02 -0700 (PDT) Received-SPF: pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) client-ip=209.132.180.67; Authentication-Results: mx.google.com; dkim=fail header.i=@google.com header.s=20161025 header.b=kIPaza8P; dkim=fail header.i=@chromium.org header.s=google header.b=gcFvKQuE; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=chromium.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1753375AbeC1Ww5 (ORCPT + 99 others); Wed, 28 Mar 2018 18:52:57 -0400 Received: from mail-ua0-f193.google.com ([209.85.217.193]:39776 "EHLO mail-ua0-f193.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1753068AbeC1Wwz (ORCPT ); Wed, 28 Mar 2018 18:52:55 -0400 Received: by mail-ua0-f193.google.com with SMTP id m47so2563456uae.6 for ; Wed, 28 Mar 2018 15:52:54 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=20161025; h=mime-version:sender:in-reply-to:references:from:date:message-id :subject:to:cc; bh=hgnzXEHHcuea0sqNj0aebM3xAmiooKdP7Bu+bv6er1c=; b=kIPaza8Phz+KZE3tUQ+T+ogYVUdkXnsjxOKz2HQkiyBMgMfyiyT0/S6JK+27uCRbdv 1h+ulyCe/zpTYNfYjcx0AQF7tdaBSPrkz1ueRCLnKbl3gHwlsaKd4mkx6KlDi3ilgiaN TCDAWurTlUodPchN5b2hC3gjkH0xSFBdBpHHebXrhb8I5kztVmxUWrp2yTv6LoPF5oJG dblCFfo/gRiX+B4sHL6vgw3c5JysLImiPOrsK5QHgUscmoeOHerxPZTFZZQ5U5Y5D4ZF f14dCDD5LBTe1EUiCLxuiCF+vmjPNkgU5vTBF/0hmY7zqWhRPZ1ak9lqqyqKFFzr69HW b0Gg== DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=chromium.org; s=google; h=mime-version:sender:in-reply-to:references:from:date:message-id :subject:to:cc; bh=hgnzXEHHcuea0sqNj0aebM3xAmiooKdP7Bu+bv6er1c=; b=gcFvKQuESWbyAXyFMuKOXd1Rb91+Z/RoaG0NlnkEe/Bgf4dE9ZhYpYnicVgwurzYI8 Gn+OHCGuuJCzg9sxYLUCVYH8IPbb+aGereuiH0OwhUa6XJEbgkkk4Z21NBJtoEAzf0yz eg5RkolwlQkt8UJj+sm1REVC299PpsWLtgrT4= X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:mime-version:sender:in-reply-to:references:from :date:message-id:subject:to:cc; bh=hgnzXEHHcuea0sqNj0aebM3xAmiooKdP7Bu+bv6er1c=; b=lH/sCZdTE8Zrx/0+Ovo8JpSC7bXr7OuhSQx9JRAeKCEYdNTIe1pcJK3TuMQ5pJz6pI M2NEVJdrZUVs8PWMQEHOO7mnMszlx8E+FIbeu7yFteQ+160G+gbx5gaXoUTrn63zVY7e T/ivPvY5owedPE5vMWFnzsp6yQvn/EY0TX0HUWv0QETxh6q/AuBukT9yvc/pnHcW51u4 nyDJYvKLwtj1xeJuyEJ0hffymvSKAHM3B7GMX+/3M9lvZzLYke2yyccF2rOqdQ9Rpm5f dPAQ5mj1cONywM3jVd808bpnYTN3SL3kkRK4PlnMp6O71z+GdCnosFQqkGKp6duogWdL rvgg== X-Gm-Message-State: AElRT7HgQ1bwljijcZTNSorqylqaLmLe580DxDGCLC26wzlPVqOOW6Vs aX1lyWOjTxREp7EF1uJVjT3eQsCx9+wm7uQYkttp5w== X-Received: by 10.159.60.161 with SMTP id s33mr3906359uai.64.1522277573637; Wed, 28 Mar 2018 15:52:53 -0700 (PDT) MIME-Version: 1.0 Received: by 10.31.4.8 with HTTP; Wed, 28 Mar 2018 15:52:52 -0700 (PDT) In-Reply-To: <1522242500-10556-2-git-send-email-vviswana@codeaurora.org> References: <1522242500-10556-1-git-send-email-vviswana@codeaurora.org> <1522242500-10556-2-git-send-email-vviswana@codeaurora.org> From: Doug Anderson Date: Wed, 28 Mar 2018 15:52:52 -0700 X-Google-Sender-Auth: uFED4nXeU6suH0egp7-4AUPYSqo Message-ID: Subject: Re: [PATCH V4 1/2] mmc: sdhci-msm: Add support to store supported vdd-io voltages To: Vijay Viswanath Cc: Adrian Hunter , Ulf Hansson , linux-mmc@vger.kernel.org, LKML , Shawn Lin , linux-arm-msm@vger.kernel.org, georgi.djakov@linaro.org, asutoshd@codeaurora.org, stummala@codeaurora.org, venkatg@codeaurora.org, pramod.gurav@linaro.org, jeremymc@redhat.com, Bjorn Andersson , riteshh@codeaurora.org Content-Type: text/plain; charset="UTF-8" Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Hi, On Wed, Mar 28, 2018 at 6:08 AM, Vijay Viswanath wrote: > During probe check whether the vdd-io regulator of sdhc platform device > can support 1.8V and 3V and store this information as a capability of > platform device. > > Signed-off-by: Vijay Viswanath > --- > drivers/mmc/host/sdhci-msm.c | 35 ++++++++++++++++++++++++++++++++++- > 1 file changed, 34 insertions(+), 1 deletion(-) Since I commented on v2, please copy me for this series going forward. Thanks. > diff --git a/drivers/mmc/host/sdhci-msm.c b/drivers/mmc/host/sdhci-msm.c > index c283291..2fcd9010 100644 > --- a/drivers/mmc/host/sdhci-msm.c > +++ b/drivers/mmc/host/sdhci-msm.c > @@ -21,6 +21,7 @@ > #include > #include > #include > +#include > > #include "sdhci-pltfm.h" > > @@ -81,6 +82,9 @@ > #define CORE_HC_SELECT_IN_HS400 (6 << 19) > #define CORE_HC_SELECT_IN_MASK (7 << 19) > > +#define CORE_3_0V_SUPPORT (1 << 25) > +#define CORE_1_8V_SUPPORT (1 << 26) > + > #define CORE_CSR_CDC_CTLR_CFG0 0x130 > #define CORE_SW_TRIG_FULL_CALIB BIT(16) > #define CORE_HW_AUTOCAL_ENA BIT(17) > @@ -148,6 +152,7 @@ struct sdhci_msm_host { > u32 curr_io_level; > wait_queue_head_t pwr_irq_wait; > bool pwr_irq_flag; > + u32 caps_0; > }; > > static unsigned int msm_get_clock_rate_for_bus_mode(struct sdhci_host *host, > @@ -1103,7 +1108,7 @@ static void sdhci_msm_handle_pwr_irq(struct sdhci_host *host, int irq) > struct sdhci_msm_host *msm_host = sdhci_pltfm_priv(pltfm_host); > u32 irq_status, irq_ack = 0; > int retry = 10; > - int pwr_state = 0, io_level = 0; > + u32 pwr_state = 0, io_level = 0; > > > irq_status = readl_relaxed(msm_host->core_mem + CORE_PWRCTL_STATUS); > @@ -1313,6 +1318,30 @@ static void sdhci_msm_writeb(struct sdhci_host *host, u8 val, int reg) > sdhci_msm_check_power_status(host, req_type); > } > > +static int sdhci_msm_set_regulator_caps(struct sdhci_msm_host *msm_host) This function always returns 0. Make it void. > +{ > + struct mmc_host *mmc = msm_host->mmc; > + struct regulator *supply = mmc->supply.vqmmc; > + u32 caps = 0; > + > + if (!IS_ERR(mmc->supply.vqmmc)) { > + if (regulator_is_supported_voltage(supply, 1700000, 1950000)) > + caps |= CORE_1_8V_SUPPORT; > + if (regulator_is_supported_voltage(supply, 2700000, 3600000)) > + caps |= CORE_3_0V_SUPPORT; > + > + if (!caps) > + pr_warn("%s: %s: 1.8/3V not supported for vqmmc\n", > + mmc_hostname(mmc), __func__); Please remove __func__. You already have the unique thing to find the right driver (AKA mmc_hostname(mmc)) and the string itself should be enough from there. > + } > + > + msm_host->caps_0 |= caps; > + pr_debug("%s: %s: supported caps: 0x%08x\n", mmc_hostname(mmc), > + __func__, caps); Same, no need for __func__. > + > + return 0; > +} > + > static const struct of_device_id sdhci_msm_dt_match[] = { > { .compatible = "qcom,sdhci-msm-v4" }, > {}, > @@ -1530,6 +1559,10 @@ static int sdhci_msm_probe(struct platform_device *pdev) > ret = sdhci_add_host(host); > if (ret) > goto pm_runtime_disable; > + ret = sdhci_msm_set_regulator_caps(msm_host); > + if (ret) > + dev_err(&pdev->dev, "Failed to set regulator caps: %d\n", > + ret); If you find some reason _not_ to make sdhci_msm_set_regulator_caps() return "void" as per above, you should actually do something about this error. You've used "dev_err" which makes me feel like you consider this a serious error. Presumably it should cause the probe to fail? -Doug