From patchwork Mon Oct 8 13:18:56 2018 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Veerabhadrarao Badiganti X-Patchwork-Id: 10630715 Return-Path: Received: from mail.wl.linuxfoundation.org (pdx-wl-mail.web.codeaurora.org [172.30.200.125]) by pdx-korg-patchwork-2.web.codeaurora.org (Postfix) with ESMTP id 45A2B14BD for ; Mon, 8 Oct 2018 13:20:26 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 35993292C2 for ; Mon, 8 Oct 2018 13:20:26 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id 332E9292BF; Mon, 8 Oct 2018 13:20:26 +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.7 required=2.0 tests=BAYES_00,DKIM_INVALID, DKIM_SIGNED,MAILING_LIST_MULTI,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 BFCC4291A0 for ; Mon, 8 Oct 2018 13:20:25 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1726085AbeJHUcG (ORCPT ); Mon, 8 Oct 2018 16:32:06 -0400 Received: from smtp.codeaurora.org ([198.145.29.96]:35750 "EHLO smtp.codeaurora.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1726006AbeJHUcG (ORCPT ); Mon, 8 Oct 2018 16:32:06 -0400 Received: by smtp.codeaurora.org (Postfix, from userid 1000) id 43B2860BFA; Mon, 8 Oct 2018 13:20:24 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=codeaurora.org; s=default; t=1539004824; bh=/xJiXFS8mKbLmyVlLUtROaxvgL85B4fY0J5HMCe0Fck=; h=From:To:Cc:Subject:Date:From; b=cd9d3FuaTG/lDt9IgU9HgOJPWp2Z4uOB6V+h+3ee6AhDKURj0eWvN0nMtLnZq264G YeP1O1512+Q95GvMunjOl1j52Cdc0oc8PEiCu6F5leXDei0ljWI2/Nrz61D0CBQKFP hjz0E+/LSj//R5YYo0iOU/JDu4r4iY/x22DQVwhw= Received: from vbadigan-linux.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: vbadigan@smtp.codeaurora.org) by smtp.codeaurora.org (Postfix) with ESMTPSA id 8CDC2600C1; Mon, 8 Oct 2018 13:20:08 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=codeaurora.org; s=default; t=1539004823; bh=/xJiXFS8mKbLmyVlLUtROaxvgL85B4fY0J5HMCe0Fck=; h=From:To:Cc:Subject:Date:From; b=Y6SXuRpQFD9n53Ro/RftABieNnIniwDLGchpH1avdCA+x051eYVFq3+WJ/OC2K1Mc 2LHT6qJfgj6hnHi7xJDkgnmQ1EH5C2EEJfPlra6RJSXNpIqpEchpOEYbsyLOYoLs0F TKRnpxpCbNp4lTFlNDCl+OKVV93COmz/glEpv2nM= DMARC-Filter: OpenDMARC Filter v1.3.2 smtp.codeaurora.org 8CDC2600C1 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=vbadigan@codeaurora.org From: Veerabhadrarao Badiganti To: adrian.hunter@intel.com, ulf.hansson@linaro.org, robh+dt@kernel.org, evgreen@chromium.org, dianders@google.com Cc: asutoshd@codeaurora.org, riteshh@codeaurora.org, stummala@codeaurora.org, sayalil@codeaurora.org, linux-mmc@vger.kernel.org, linux-arm-msm@vger.kernel.org, Veerabhadrarao Badiganti Subject: [PATCH V3 0/3] Internal voltage control for platform drivers Date: Mon, 8 Oct 2018 18:48:56 +0530 Message-Id: <1539004739-32060-1-git-send-email-vbadigan@codeaurora.org> X-Mailer: git-send-email 1.9.1 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 Certain SDHC controllers may require that voltage switching happen after sepcial conditions. For SDHCI-MSM controllers, power irq is a signal from controller to SW that it is ready for voltage switch. So added support to register voltage regulators from the msm driver and use them. Voltage switching from core layer is causing CRC/cmd timeout errors in some chipsets. Changes since RFC: - Added DT option to pass regulator load values the sdhci-msm driver should vote during BUS_ON and BUS_OFF power irq. - Removed quirk and used local flags in sdhci_add_host to to avoid scenario of both sdhci & sdhci-msm layer controlling the regulators. - Introduced two sdhci msm layer APIs to replace the respective sdhci layer APIs. This is again to stop sdhci layer from controlling regulators if sdhci_msm layer is present. Changes since V1: - Introduced vqmmc_enabled flag in sdhci_host to track if vqmmc is enabled or not. - Updated DT option name with vendor prefix and unit suffix. - Introduced sdhci_msm_set_vmmc/vqmmc APIs for configuring vmmc and vqmmc. And moved all relevant code to these functions. - Removed pltfm_init_done flag from sdhci_msm_host which is not needed. As long as the device is in power-off state, SDHCI-MSM controller doesn't trigger power irq. So this flag is not needed. Changes since V2: - Updated conditional check with vqmmc instead of vmmc for mmc_regulator_get_supply() in sdhci_setup_host(). - Turning vmmc off if enabling vqmmc fails in sdhci_msm_init_pwr_irq_wait. - Without supplying load values of vmmc, observing turning errors. So removed optional flag for this DT option. Tested on: sdm845 Vijay Viswanath (3): mmc: sdhci: Allow platform controlled voltage switching dt-bindings: mmc: sdhci-msm: Add entries for passing load values mmc: sdhci-msm: Use internal voltage control .../devicetree/bindings/mmc/sdhci-msm.txt | 8 + drivers/mmc/host/sdhci-msm.c | 212 ++++++++++++++++++++- drivers/mmc/host/sdhci.c | 32 ++-- drivers/mmc/host/sdhci.h | 1 + 4 files changed, 232 insertions(+), 21 deletions(-)