From patchwork Fri Mar 6 10:38:46 2020 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Nicolas Saenz Julienne X-Patchwork-Id: 11423515 Return-Path: Received: from mail.kernel.org (pdx-korg-mail-1.web.codeaurora.org [172.30.200.123]) by pdx-korg-patchwork-2.web.codeaurora.org (Postfix) with ESMTP id 2661B14BC for ; Fri, 6 Mar 2020 10:41:31 +0000 (UTC) Received: from bombadil.infradead.org (bombadil.infradead.org [198.137.202.133]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mail.kernel.org (Postfix) with ESMTPS id 04EE82072D for ; Fri, 6 Mar 2020 10:41:31 +0000 (UTC) Authentication-Results: mail.kernel.org; dkim=pass (2048-bit key) header.d=lists.infradead.org header.i=@lists.infradead.org header.b="V513pRUf" DMARC-Filter: OpenDMARC Filter v1.3.2 mail.kernel.org 04EE82072D Authentication-Results: mail.kernel.org; dmarc=none (p=none dis=none) header.from=suse.de Authentication-Results: mail.kernel.org; spf=none smtp.mailfrom=linux-arm-kernel-bounces+patchwork-linux-arm=patchwork.kernel.org@lists.infradead.org DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=lists.infradead.org; s=bombadil.20170209; h=Sender: Content-Transfer-Encoding:Content-Type:Cc:List-Subscribe:List-Help:List-Post: List-Archive:List-Unsubscribe:List-Id:MIME-Version:References:In-Reply-To: Message-Id:Date:Subject:To:From:Reply-To:Content-ID:Content-Description: Resent-Date:Resent-From:Resent-Sender:Resent-To:Resent-Cc:Resent-Message-ID: List-Owner; bh=KEtCaVbC/dgd9MxXNyeKIvfLxmBN/Tg5ADoGFwc45ck=; b=V513pRUfWaoMkZ qqhEZhOtT3iTYt2R+2PxX1nPngaOe45onkY4KbOyPzBVuJmyT4H2EIQ96+kruxp5qms5snw/uTYYs 2A8WQeQ+qgYRflvtUF07oR/Wg72y5TYOeGmMly6pdKH9fgd9BhV39odffUODVR1jICDwK5dFdZcnd G/hUqBQa/S+vBXa3Yf86ukH+BAKRqzT7wdi3GWre4rSulzHPYEX6inDQPGjvCtUVq9w9Z0xChepUI 6PTAPmOnFO5xQE4A8vqLfWSCRnPSuE4aLcq19UkhsVYuyHpYFgcH02iPa8t0SVUzWKiD1VrDLHHxv BNTU1EFuEO9CEdH07GRg==; Received: from localhost ([127.0.0.1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.92.3 #3 (Red Hat Linux)) id 1jAAQ4-000387-9v; Fri, 06 Mar 2020 10:41:28 +0000 Received: from mx2.suse.de ([195.135.220.15]) by bombadil.infradead.org with esmtps (Exim 4.92.3 #3 (Red Hat Linux)) id 1jAAO3-0007yG-1R; Fri, 06 Mar 2020 10:39:26 +0000 X-Virus-Scanned: by amavisd-new at test-mx.suse.de Received: from relay2.suse.de (unknown [195.135.220.254]) by mx2.suse.de (Postfix) with ESMTP id ABC6EAC46; Fri, 6 Mar 2020 10:39:20 +0000 (UTC) From: Nicolas Saenz Julienne To: devicetree@vger.kernel.org, bcm-kernel-feedback-list@broadcom.com, linux-rpi-kernel@lists.infradead.org, linux-arm-kernel@lists.infradead.org, linux-mmc@vger.kernel.org, Adrian Hunter Subject: [PATCH 01/10] mmc: sdhci: Add quirk SDHCI_QUIRK2_SET_BUS_VOLTAGE Date: Fri, 6 Mar 2020 11:38:46 +0100 Message-Id: <20200306103857.23962-2-nsaenzjulienne@suse.de> X-Mailer: git-send-email 2.25.1 In-Reply-To: <20200306103857.23962-1-nsaenzjulienne@suse.de> References: <20200306103857.23962-1-nsaenzjulienne@suse.de> MIME-Version: 1.0 X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20200306_023923_290306_A00BD225 X-CRM114-Status: GOOD ( 10.25 ) X-Spam-Score: -2.3 (--) X-Spam-Report: SpamAssassin version 3.4.3 on bombadil.infradead.org summary: Content analysis details: (-2.3 points) pts rule name description ---- ---------------------- -------------------------------------------------- 0.0 RCVD_IN_MSPIKE_H3 RBL: Good reputation (+3) [195.135.220.15 listed in wl.mailspike.net] -2.3 RCVD_IN_DNSWL_MED RBL: Sender listed at https://www.dnswl.org/, medium trust [195.135.220.15 listed in list.dnswl.org] 0.0 SPF_HELO_NONE SPF: HELO does not publish an SPF Record -0.0 SPF_PASS SPF: sender matches SPF record 0.0 RCVD_IN_MSPIKE_WL Mailspike good senders X-BeenThere: linux-arm-kernel@lists.infradead.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: ulf.hansson@linaro.org, f.fainelli@gmail.com, phil@raspberrypi.org, linux-kernel@vger.kernel.org, Nicolas Saenz Julienne Sender: "linux-arm-kernel" Errors-To: linux-arm-kernel-bounces+patchwork-linux-arm=patchwork.kernel.org@lists.infradead.org Adds quirk for controllers whose bus power select register has to be set even when powering SD cards from a regulator. Signed-off-by: Nicolas Saenz Julienne --- drivers/mmc/host/sdhci.c | 5 +++++ drivers/mmc/host/sdhci.h | 2 ++ 2 files changed, 7 insertions(+) diff --git a/drivers/mmc/host/sdhci.c b/drivers/mmc/host/sdhci.c index c59566363a42..c7fd87447457 100644 --- a/drivers/mmc/host/sdhci.c +++ b/drivers/mmc/host/sdhci.c @@ -1920,6 +1920,11 @@ static void sdhci_set_power_reg(struct sdhci_host *host, unsigned char mode, mmc_regulator_set_ocr(mmc, mmc->supply.vmmc, vdd); + if (host->quirks2 & SDHCI_QUIRK2_SET_BUS_VOLTAGE) { + sdhci_set_power_noreg(host, mode, vdd); + return; + } + if (mode != MMC_POWER_OFF) sdhci_writeb(host, SDHCI_POWER_ON, SDHCI_POWER_CONTROL); else diff --git a/drivers/mmc/host/sdhci.h b/drivers/mmc/host/sdhci.h index cac2d97782e6..9531a4e5b148 100644 --- a/drivers/mmc/host/sdhci.h +++ b/drivers/mmc/host/sdhci.h @@ -484,6 +484,8 @@ struct sdhci_host { * block count. */ #define SDHCI_QUIRK2_USE_32BIT_BLK_CNT (1<<18) +/* Set bus voltage even when powering from an external regulator */ +#define SDHCI_QUIRK2_SET_BUS_VOLTAGE (1<<19) int irq; /* Device IRQ */ void __iomem *ioaddr; /* Mapped address */ From patchwork Fri Mar 6 10:38:47 2020 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Nicolas Saenz Julienne X-Patchwork-Id: 11423497 Return-Path: Received: from mail.kernel.org (pdx-korg-mail-1.web.codeaurora.org [172.30.200.123]) by pdx-korg-patchwork-2.web.codeaurora.org (Postfix) with ESMTP id 74B771395 for ; Fri, 6 Mar 2020 10:40:04 +0000 (UTC) Received: from bombadil.infradead.org (bombadil.infradead.org [198.137.202.133]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mail.kernel.org (Postfix) with ESMTPS id EA54A20848 for ; Fri, 6 Mar 2020 10:40:03 +0000 (UTC) Authentication-Results: mail.kernel.org; dkim=pass (2048-bit key) header.d=lists.infradead.org header.i=@lists.infradead.org header.b="MBfuB+Zs" DMARC-Filter: OpenDMARC Filter v1.3.2 mail.kernel.org EA54A20848 Authentication-Results: mail.kernel.org; dmarc=none (p=none dis=none) header.from=suse.de Authentication-Results: mail.kernel.org; spf=none smtp.mailfrom=linux-arm-kernel-bounces+patchwork-linux-arm=patchwork.kernel.org@lists.infradead.org DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=lists.infradead.org; s=bombadil.20170209; h=Sender: Content-Transfer-Encoding:Content-Type:Cc:List-Subscribe:List-Help:List-Post: List-Archive:List-Unsubscribe:List-Id:MIME-Version:References:In-Reply-To: Message-Id:Date:Subject:To:From:Reply-To:Content-ID:Content-Description: Resent-Date:Resent-From:Resent-Sender:Resent-To:Resent-Cc:Resent-Message-ID: List-Owner; bh=EAOCPPGJkVLFZYxKRDlGr6dIhIchG+U23JXjWA51BfQ=; b=MBfuB+ZsRRavtC 3SNmTrlXlfUjbt5lKdnBV9lGrmBHz2fCKxRcsuzxK3qXsddjMDeIR/ErwKDvTx61Ev/vZh4iJdny4 UCXnsQDpXotpbV+IdTtlgfB0QtizhmQ04ZilgUpv3nRAHKJMwJ2VeOzqe8YKcthA8YYBgFUwSZOE0 olfScvrMfXFPpFei6z2sQnABAIyy5PDBPQPvzt+RMCpsFdbJbVTNxHij5IUJDG2r+px4y7Iwsnvpm KFmdRrq6DRarc4iCWPwfjuegE7Cxb1Zgf2qhiMYRtFJVDxRp32ubyrDmLKT5PvD/uZ4uQkwR4hjij d6TwuGwgAit2UX5eVPiQ==; Received: from localhost ([127.0.0.1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.92.3 #3 (Red Hat Linux)) id 1jAAOd-00009G-6w; Fri, 06 Mar 2020 10:39:59 +0000 Received: from mx2.suse.de ([195.135.220.15]) by bombadil.infradead.org with esmtps (Exim 4.92.3 #3 (Red Hat Linux)) id 1jAAO3-0007zU-1T; Fri, 06 Mar 2020 10:39:24 +0000 X-Virus-Scanned: by amavisd-new at test-mx.suse.de Received: from relay2.suse.de (unknown [195.135.220.254]) by mx2.suse.de (Postfix) with ESMTP id A510AADC9; Fri, 6 Mar 2020 10:39:21 +0000 (UTC) From: Nicolas Saenz Julienne To: devicetree@vger.kernel.org, bcm-kernel-feedback-list@broadcom.com, linux-rpi-kernel@lists.infradead.org, linux-arm-kernel@lists.infradead.org, linux-mmc@vger.kernel.org, Adrian Hunter Subject: [PATCH 02/10] mmc: sdhci: milbeaut: Use quirk instead of custom set_power() Date: Fri, 6 Mar 2020 11:38:47 +0100 Message-Id: <20200306103857.23962-3-nsaenzjulienne@suse.de> X-Mailer: git-send-email 2.25.1 In-Reply-To: <20200306103857.23962-1-nsaenzjulienne@suse.de> References: <20200306103857.23962-1-nsaenzjulienne@suse.de> MIME-Version: 1.0 X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20200306_023923_281318_EC25DC97 X-CRM114-Status: GOOD ( 12.48 ) X-Spam-Score: -2.3 (--) X-Spam-Report: SpamAssassin version 3.4.3 on bombadil.infradead.org summary: Content analysis details: (-2.3 points) pts rule name description ---- ---------------------- -------------------------------------------------- -2.3 RCVD_IN_DNSWL_MED RBL: Sender listed at https://www.dnswl.org/, medium trust [195.135.220.15 listed in list.dnswl.org] 0.0 SPF_HELO_NONE SPF: HELO does not publish an SPF Record -0.0 SPF_PASS SPF: sender matches SPF record 0.0 RCVD_IN_MSPIKE_H3 RBL: Good reputation (+3) [195.135.220.15 listed in wl.mailspike.net] 0.0 RCVD_IN_MSPIKE_WL Mailspike good senders X-BeenThere: linux-arm-kernel@lists.infradead.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: ulf.hansson@linaro.org, f.fainelli@gmail.com, phil@raspberrypi.org, linux-kernel@vger.kernel.org, Nicolas Saenz Julienne Sender: "linux-arm-kernel" Errors-To: linux-arm-kernel-bounces+patchwork-linux-arm=patchwork.kernel.org@lists.infradead.org With the introduction of SDHCI_QUIRK2_SET_BUS_VOLTAGE there is no need to use a custom set_power() implementation as the quirk takes care of configuring the bus voltage register even when powering trough a regulator. Signed-off-by: Nicolas Saenz Julienne --- drivers/mmc/host/sdhci-milbeaut.c | 15 ++------------- 1 file changed, 2 insertions(+), 13 deletions(-) diff --git a/drivers/mmc/host/sdhci-milbeaut.c b/drivers/mmc/host/sdhci-milbeaut.c index 92f30a1db435..6a935554c54d 100644 --- a/drivers/mmc/host/sdhci-milbeaut.c +++ b/drivers/mmc/host/sdhci-milbeaut.c @@ -121,17 +121,6 @@ static void sdhci_milbeaut_reset(struct sdhci_host *host, u8 mask) } } -static void sdhci_milbeaut_set_power(struct sdhci_host *host, - unsigned char mode, unsigned short vdd) -{ - if (!IS_ERR(host->mmc->supply.vmmc)) { - struct mmc_host *mmc = host->mmc; - - mmc_regulator_set_ocr(mmc, mmc->supply.vmmc, vdd); - } - sdhci_set_power_noreg(host, mode, vdd); -} - static const struct sdhci_ops sdhci_milbeaut_ops = { .voltage_switch = sdhci_milbeaut_soft_voltage_switch, .get_min_clock = sdhci_milbeaut_get_min_clock, @@ -139,7 +128,6 @@ static const struct sdhci_ops sdhci_milbeaut_ops = { .set_clock = sdhci_set_clock, .set_bus_width = sdhci_set_bus_width, .set_uhs_signaling = sdhci_set_uhs_signaling, - .set_power = sdhci_milbeaut_set_power, }; static void sdhci_milbeaut_bridge_reset(struct sdhci_host *host, @@ -262,7 +250,8 @@ static int sdhci_milbeaut_probe(struct platform_device *pdev) SDHCI_QUIRK_DELAY_AFTER_POWER; host->quirks2 = SDHCI_QUIRK2_SUPPORT_SINGLE | SDHCI_QUIRK2_TUNING_WORK_AROUND | - SDHCI_QUIRK2_PRESET_VALUE_BROKEN; + SDHCI_QUIRK2_PRESET_VALUE_BROKEN | + SDHCI_QUIRK2_SET_BUS_VOLTAGE; priv->enable_cmd_dat_delay = device_property_read_bool(dev, "fujitsu,cmd-dat-delay-select"); From patchwork Fri Mar 6 10:38:48 2020 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Nicolas Saenz Julienne X-Patchwork-Id: 11423513 Return-Path: Received: from mail.kernel.org (pdx-korg-mail-1.web.codeaurora.org [172.30.200.123]) by pdx-korg-patchwork-2.web.codeaurora.org (Postfix) with ESMTP id B5FBB14BC for ; Fri, 6 Mar 2020 10:41:17 +0000 (UTC) Received: from bombadil.infradead.org (bombadil.infradead.org [198.137.202.133]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mail.kernel.org (Postfix) with ESMTPS id 92C792072D for ; Fri, 6 Mar 2020 10:41:17 +0000 (UTC) Authentication-Results: mail.kernel.org; dkim=pass (2048-bit key) header.d=lists.infradead.org header.i=@lists.infradead.org header.b="qPdiWLZU" DMARC-Filter: OpenDMARC Filter v1.3.2 mail.kernel.org 92C792072D Authentication-Results: mail.kernel.org; dmarc=none (p=none dis=none) header.from=suse.de Authentication-Results: mail.kernel.org; spf=none smtp.mailfrom=linux-arm-kernel-bounces+patchwork-linux-arm=patchwork.kernel.org@lists.infradead.org DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=lists.infradead.org; s=bombadil.20170209; h=Sender: Content-Transfer-Encoding:Content-Type:Cc:List-Subscribe:List-Help:List-Post: List-Archive:List-Unsubscribe:List-Id:MIME-Version:References:In-Reply-To: Message-Id:Date:Subject:To:From:Reply-To:Content-ID:Content-Description: Resent-Date:Resent-From:Resent-Sender:Resent-To:Resent-Cc:Resent-Message-ID: List-Owner; bh=ecKXo7Agr9DIagKHnb5G1zElthk8PAMoUOFj577caHM=; b=qPdiWLZUtfL5kj N44b1MHKDIplU6+7UuirRZhvuzUMdKP4ZWfjcd8PHj2tExoxmNroPooosimIITsiV/8siHJtouKuv rtUVylBxWn5J3SCEiKvbGjdPzXDd9nqXuURn6BdOvihFJW/v2E1B5dfbXz95J5DhMwS60rQ0DdBHq Phu7D8q0QTG4FtpPjIeHsRzBQnQ7sTnLTKqdQbxCCGKmqqK7q1l1K1ue7IdJwf81B2Pb6FBsQ7EDF Mfg+J1cIUnaeXAonQ9ePfQOg2z/gTF4oXU2a3w4kMSLRZuaeKT/E2rLWM8Hm69ttdxO2cczV3c7lR HckyT/lKE5jq08EPHVmA==; Received: from localhost ([127.0.0.1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.92.3 #3 (Red Hat Linux)) id 1jAAPp-0002uE-PL; Fri, 06 Mar 2020 10:41:13 +0000 Received: from mx2.suse.de ([195.135.220.15]) by bombadil.infradead.org with esmtps (Exim 4.92.3 #3 (Red Hat Linux)) id 1jAAO4-00081R-JZ; Fri, 06 Mar 2020 10:39:27 +0000 X-Virus-Scanned: by amavisd-new at test-mx.suse.de Received: from relay2.suse.de (unknown [195.135.220.254]) by mx2.suse.de (Postfix) with ESMTP id BAF70B1A6; Fri, 6 Mar 2020 10:39:22 +0000 (UTC) From: Nicolas Saenz Julienne To: devicetree@vger.kernel.org, bcm-kernel-feedback-list@broadcom.com, linux-rpi-kernel@lists.infradead.org, linux-arm-kernel@lists.infradead.org, linux-mmc@vger.kernel.org, Michal Simek , Adrian Hunter Subject: [PATCH 03/10] mmc: sdhci: arsan: Use quirk instead of custom set_power() Date: Fri, 6 Mar 2020 11:38:48 +0100 Message-Id: <20200306103857.23962-4-nsaenzjulienne@suse.de> X-Mailer: git-send-email 2.25.1 In-Reply-To: <20200306103857.23962-1-nsaenzjulienne@suse.de> References: <20200306103857.23962-1-nsaenzjulienne@suse.de> MIME-Version: 1.0 X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20200306_023925_053390_5108CC0B X-CRM114-Status: GOOD ( 12.66 ) X-Spam-Score: -2.3 (--) X-Spam-Report: SpamAssassin version 3.4.3 on bombadil.infradead.org summary: Content analysis details: (-2.3 points) pts rule name description ---- ---------------------- -------------------------------------------------- 0.0 RCVD_IN_MSPIKE_H3 RBL: Good reputation (+3) [195.135.220.15 listed in wl.mailspike.net] -2.3 RCVD_IN_DNSWL_MED RBL: Sender listed at https://www.dnswl.org/, medium trust [195.135.220.15 listed in list.dnswl.org] 0.0 SPF_HELO_NONE SPF: HELO does not publish an SPF Record -0.0 SPF_PASS SPF: sender matches SPF record 0.0 RCVD_IN_MSPIKE_WL Mailspike good senders X-BeenThere: linux-arm-kernel@lists.infradead.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: ulf.hansson@linaro.org, f.fainelli@gmail.com, phil@raspberrypi.org, linux-kernel@vger.kernel.org, Nicolas Saenz Julienne Sender: "linux-arm-kernel" Errors-To: linux-arm-kernel-bounces+patchwork-linux-arm=patchwork.kernel.org@lists.infradead.org With the introduction of SDHCI_QUIRK2_SET_BUS_VOLTAGE there is no need to use a custom set_power() implementation as the quirk takes care of configuring the bus voltage register even when powering trough a regulator. Signed-off-by: Nicolas Saenz Julienne --- drivers/mmc/host/sdhci-of-arasan.c | 22 ++++++---------------- 1 file changed, 6 insertions(+), 16 deletions(-) diff --git a/drivers/mmc/host/sdhci-of-arasan.c b/drivers/mmc/host/sdhci-of-arasan.c index 0146d7dd315b..928953bbdc10 100644 --- a/drivers/mmc/host/sdhci-of-arasan.c +++ b/drivers/mmc/host/sdhci-of-arasan.c @@ -325,17 +325,6 @@ static int sdhci_arasan_voltage_switch(struct mmc_host *mmc, return -EINVAL; } -static void sdhci_arasan_set_power(struct sdhci_host *host, unsigned char mode, - unsigned short vdd) -{ - if (!IS_ERR(host->mmc->supply.vmmc)) { - struct mmc_host *mmc = host->mmc; - - mmc_regulator_set_ocr(mmc, mmc->supply.vmmc, vdd); - } - sdhci_set_power_noreg(host, mode, vdd); -} - static const struct sdhci_ops sdhci_arasan_ops = { .set_clock = sdhci_arasan_set_clock, .get_max_clock = sdhci_pltfm_clk_get_max_clock, @@ -343,7 +332,6 @@ static const struct sdhci_ops sdhci_arasan_ops = { .set_bus_width = sdhci_set_bus_width, .reset = sdhci_arasan_reset, .set_uhs_signaling = sdhci_set_uhs_signaling, - .set_power = sdhci_arasan_set_power, }; static const struct sdhci_pltfm_data sdhci_arasan_pdata = { @@ -351,7 +339,8 @@ static const struct sdhci_pltfm_data sdhci_arasan_pdata = { .quirks = SDHCI_QUIRK_CAP_CLOCK_BASE_BROKEN, .quirks2 = SDHCI_QUIRK2_PRESET_VALUE_BROKEN | SDHCI_QUIRK2_CLOCK_DIV_ZERO_BROKEN | - SDHCI_QUIRK2_STOP_WITH_TC, + SDHCI_QUIRK2_STOP_WITH_TC | + SDHCI_QUIRK2_SET_BUS_VOLTAGE, }; static struct sdhci_arasan_of_data sdhci_arasan_data = { @@ -362,7 +351,8 @@ static const struct sdhci_pltfm_data sdhci_arasan_zynqmp_pdata = { .ops = &sdhci_arasan_ops, .quirks2 = SDHCI_QUIRK2_PRESET_VALUE_BROKEN | SDHCI_QUIRK2_CLOCK_DIV_ZERO_BROKEN | - SDHCI_QUIRK2_STOP_WITH_TC, + SDHCI_QUIRK2_STOP_WITH_TC | + SDHCI_QUIRK2_SET_BUS_VOLTAGE, }; static struct sdhci_arasan_of_data sdhci_arasan_zynqmp_data = { @@ -414,7 +404,6 @@ static const struct sdhci_ops sdhci_arasan_cqe_ops = { .set_bus_width = sdhci_set_bus_width, .reset = sdhci_arasan_reset, .set_uhs_signaling = sdhci_set_uhs_signaling, - .set_power = sdhci_arasan_set_power, .irq = sdhci_arasan_cqhci_irq, }; @@ -422,7 +411,8 @@ static const struct sdhci_pltfm_data sdhci_arasan_cqe_pdata = { .ops = &sdhci_arasan_cqe_ops, .quirks = SDHCI_QUIRK_CAP_CLOCK_BASE_BROKEN, .quirks2 = SDHCI_QUIRK2_PRESET_VALUE_BROKEN | - SDHCI_QUIRK2_CLOCK_DIV_ZERO_BROKEN, + SDHCI_QUIRK2_CLOCK_DIV_ZERO_BROKEN | + SDHCI_QUIRK2_SET_BUS_VOLTAGE, }; static struct sdhci_arasan_of_data sdhci_arasan_rk3399_data = { From patchwork Fri Mar 6 10:38:49 2020 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Nicolas Saenz Julienne X-Patchwork-Id: 11423507 Return-Path: Received: from mail.kernel.org (pdx-korg-mail-1.web.codeaurora.org [172.30.200.123]) by pdx-korg-patchwork-2.web.codeaurora.org (Postfix) with ESMTP id 22F1C14E3 for ; Fri, 6 Mar 2020 10:40:31 +0000 (UTC) Received: from bombadil.infradead.org (bombadil.infradead.org [198.137.202.133]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mail.kernel.org (Postfix) with ESMTPS id 01163208C3 for ; Fri, 6 Mar 2020 10:40:31 +0000 (UTC) Authentication-Results: mail.kernel.org; dkim=pass (2048-bit key) header.d=lists.infradead.org header.i=@lists.infradead.org header.b="m1/xoQOA" DMARC-Filter: OpenDMARC Filter v1.3.2 mail.kernel.org 01163208C3 Authentication-Results: mail.kernel.org; dmarc=none (p=none dis=none) header.from=suse.de Authentication-Results: mail.kernel.org; spf=none smtp.mailfrom=linux-arm-kernel-bounces+patchwork-linux-arm=patchwork.kernel.org@lists.infradead.org DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=lists.infradead.org; s=bombadil.20170209; h=Sender: Content-Transfer-Encoding:Content-Type:Cc:List-Subscribe:List-Help:List-Post: List-Archive:List-Unsubscribe:List-Id:MIME-Version:References:In-Reply-To: Message-Id:Date:Subject:To:From:Reply-To:Content-ID:Content-Description: Resent-Date:Resent-From:Resent-Sender:Resent-To:Resent-Cc:Resent-Message-ID: List-Owner; bh=HjQulHhiPaEAYWwMM9J7GRrwFNDwyyHvlWGdsxSlw9s=; b=m1/xoQOAvC8DSu 9hXopqsvPUsnLBstb1ypciBiAxW0A5tMwlydZvM35fYPOXo4zoD+Cjy5ECNAYwNzykfyz+snvGghJ kUMQq3z7RsD14SZ8V2tpQjOYo9N/PSn6vYLKcD3rcbQkC04/MGkgkG7Cw4OXr7J3iLwe6c3Rzt724 8IKzJIOjliCe/wqaZ5I7CzjkaLS1eUPPmvCx4E77u9h2hBsNBWm6Q6fPtZMwERBLKxvynKHBD51g0 IuA1BXKPwaaR2EAAAS27P55ms+/xa8Eu3XwnQflDyTGefobt9GpQgwjZyne9ruC7Ni+dFaU3dkjoK ewOTlDdXCepveVO/ps9w==; Received: from localhost ([127.0.0.1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.92.3 #3 (Red Hat Linux)) id 1jAAP6-0001yb-JL; Fri, 06 Mar 2020 10:40:28 +0000 Received: from mx2.suse.de ([195.135.220.15]) by bombadil.infradead.org with esmtps (Exim 4.92.3 #3 (Red Hat Linux)) id 1jAAO5-00083o-KH; Fri, 06 Mar 2020 10:39:29 +0000 X-Virus-Scanned: by amavisd-new at test-mx.suse.de Received: from relay2.suse.de (unknown [195.135.220.254]) by mx2.suse.de (Postfix) with ESMTP id 12A2AB225; Fri, 6 Mar 2020 10:39:24 +0000 (UTC) From: Nicolas Saenz Julienne To: devicetree@vger.kernel.org, bcm-kernel-feedback-list@broadcom.com, linux-rpi-kernel@lists.infradead.org, linux-arm-kernel@lists.infradead.org, linux-mmc@vger.kernel.org, Adrian Hunter , Ludovic Desroches , Nicolas Ferre , Alexandre Belloni Subject: [PATCH 04/10] mmc: sdhci: at-91: Use quirk instead of custom set_power() Date: Fri, 6 Mar 2020 11:38:49 +0100 Message-Id: <20200306103857.23962-5-nsaenzjulienne@suse.de> X-Mailer: git-send-email 2.25.1 In-Reply-To: <20200306103857.23962-1-nsaenzjulienne@suse.de> References: <20200306103857.23962-1-nsaenzjulienne@suse.de> MIME-Version: 1.0 X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20200306_023925_836160_4C526C23 X-CRM114-Status: GOOD ( 13.58 ) X-Spam-Score: -2.3 (--) X-Spam-Report: SpamAssassin version 3.4.3 on bombadil.infradead.org summary: Content analysis details: (-2.3 points) pts rule name description ---- ---------------------- -------------------------------------------------- 0.0 RCVD_IN_MSPIKE_H3 RBL: Good reputation (+3) [195.135.220.15 listed in wl.mailspike.net] -2.3 RCVD_IN_DNSWL_MED RBL: Sender listed at https://www.dnswl.org/, medium trust [195.135.220.15 listed in list.dnswl.org] 0.0 SPF_HELO_NONE SPF: HELO does not publish an SPF Record -0.0 SPF_PASS SPF: sender matches SPF record 0.0 RCVD_IN_MSPIKE_WL Mailspike good senders X-BeenThere: linux-arm-kernel@lists.infradead.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: ulf.hansson@linaro.org, f.fainelli@gmail.com, phil@raspberrypi.org, linux-kernel@vger.kernel.org, Nicolas Saenz Julienne Sender: "linux-arm-kernel" Errors-To: linux-arm-kernel-bounces+patchwork-linux-arm=patchwork.kernel.org@lists.infradead.org With the introduction of SDHCI_QUIRK2_SET_BUS_VOLTAGE there is no need to use a custom set_power() implementation as the quirk takes care of configuring the bus voltage register even when powering trough a regulator. Signed-off-by: Nicolas Saenz Julienne --- drivers/mmc/host/sdhci-of-at91.c | 18 +----------------- 1 file changed, 1 insertion(+), 17 deletions(-) diff --git a/drivers/mmc/host/sdhci-of-at91.c b/drivers/mmc/host/sdhci-of-at91.c index ab2bd314a390..395fe93b78d3 100644 --- a/drivers/mmc/host/sdhci-of-at91.c +++ b/drivers/mmc/host/sdhci-of-at91.c @@ -101,22 +101,6 @@ static void sdhci_at91_set_clock(struct sdhci_host *host, unsigned int clock) sdhci_writew(host, clk, SDHCI_CLOCK_CONTROL); } -/* - * In this specific implementation of the SDHCI controller, the power register - * needs to have a valid voltage set even when the power supply is managed by - * an external regulator. - */ -static void sdhci_at91_set_power(struct sdhci_host *host, unsigned char mode, - unsigned short vdd) -{ - if (!IS_ERR(host->mmc->supply.vmmc)) { - struct mmc_host *mmc = host->mmc; - - mmc_regulator_set_ocr(mmc, mmc->supply.vmmc, vdd); - } - sdhci_set_power_noreg(host, mode, vdd); -} - static void sdhci_at91_set_uhs_signaling(struct sdhci_host *host, unsigned int timing) { @@ -145,11 +129,11 @@ static const struct sdhci_ops sdhci_at91_sama5d2_ops = { .set_bus_width = sdhci_set_bus_width, .reset = sdhci_at91_reset, .set_uhs_signaling = sdhci_at91_set_uhs_signaling, - .set_power = sdhci_at91_set_power, }; static const struct sdhci_pltfm_data sdhci_sama5d2_pdata = { .ops = &sdhci_at91_sama5d2_ops, + .quirks2 = SDHCI_QUIRK2_SET_BUS_VOLTAGE, }; static const struct sdhci_at91_soc_data soc_data_sama5d2 = { From patchwork Fri Mar 6 10:38:50 2020 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Nicolas Saenz Julienne X-Patchwork-Id: 11423505 Return-Path: Received: from mail.kernel.org (pdx-korg-mail-1.web.codeaurora.org [172.30.200.123]) by pdx-korg-patchwork-2.web.codeaurora.org (Postfix) with ESMTP id AE70514E3 for ; Fri, 6 Mar 2020 10:40:23 +0000 (UTC) Received: from bombadil.infradead.org (bombadil.infradead.org [198.137.202.133]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mail.kernel.org (Postfix) with ESMTPS id 86F022072D for ; Fri, 6 Mar 2020 10:40:23 +0000 (UTC) Authentication-Results: mail.kernel.org; dkim=pass (2048-bit key) header.d=lists.infradead.org header.i=@lists.infradead.org header.b="ucTzmwRx" DMARC-Filter: OpenDMARC Filter v1.3.2 mail.kernel.org 86F022072D Authentication-Results: mail.kernel.org; dmarc=none (p=none dis=none) header.from=suse.de Authentication-Results: mail.kernel.org; spf=none smtp.mailfrom=linux-arm-kernel-bounces+patchwork-linux-arm=patchwork.kernel.org@lists.infradead.org DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=lists.infradead.org; s=bombadil.20170209; h=Sender: Content-Transfer-Encoding:Content-Type:Cc:List-Subscribe:List-Help:List-Post: List-Archive:List-Unsubscribe:List-Id:MIME-Version:References:In-Reply-To: Message-Id:Date:Subject:To:From:Reply-To:Content-ID:Content-Description: Resent-Date:Resent-From:Resent-Sender:Resent-To:Resent-Cc:Resent-Message-ID: List-Owner; bh=rrGTF7SSOy0i+h91FVxhO5+ZgQwTDtgZlJ+VplXMRPQ=; b=ucTzmwRx4Z3Zc7 YqjGP4caur2dGzGlLLcterWXOdTKav3G4z/rquwHh0VuuidyAa0SXABt2HmmnwMLeEChXaC3o3JmI 0TrPXWlq9wZ18ZY5FoHMnDD6+E2Yupzqpm3RyvPjX7BKXh8HfTPr1E9aFS/YXuYm5RDg6JwrTIR5O xQQ2TJL9IT37LdjuDrWOht3xZlCIdXX/E1AKw6A89XoFRv8UVMmsoTKPbBP14/dUX/dUaiMFDBGRv cUy9cnjX98ugikIfLcSo1/Lvy54ZLm+abovQDjYvu4TUThY4ZD8sG6bR1MozrhYiU1oQewKdBW+yh fidWNvbGH5rnsP5nJJlg==; Received: from localhost ([127.0.0.1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.92.3 #3 (Red Hat Linux)) id 1jAAOu-0000Ss-Ph; Fri, 06 Mar 2020 10:40:17 +0000 Received: from mx2.suse.de ([195.135.220.15]) by bombadil.infradead.org with esmtps (Exim 4.92.3 #3 (Red Hat Linux)) id 1jAAO6-00084H-5H; Fri, 06 Mar 2020 10:39:29 +0000 X-Virus-Scanned: by amavisd-new at test-mx.suse.de Received: from relay2.suse.de (unknown [195.135.220.254]) by mx2.suse.de (Postfix) with ESMTP id 9FF06B22D; Fri, 6 Mar 2020 10:39:24 +0000 (UTC) From: Nicolas Saenz Julienne To: devicetree@vger.kernel.org, bcm-kernel-feedback-list@broadcom.com, linux-rpi-kernel@lists.infradead.org, linux-arm-kernel@lists.infradead.org, linux-mmc@vger.kernel.org, Adrian Hunter Subject: [PATCH 05/10] mmc: sdhci: pxav3: Use quirk instead of custom set_power() Date: Fri, 6 Mar 2020 11:38:50 +0100 Message-Id: <20200306103857.23962-6-nsaenzjulienne@suse.de> X-Mailer: git-send-email 2.25.1 In-Reply-To: <20200306103857.23962-1-nsaenzjulienne@suse.de> References: <20200306103857.23962-1-nsaenzjulienne@suse.de> MIME-Version: 1.0 X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20200306_023926_363892_11461EBF X-CRM114-Status: GOOD ( 12.36 ) X-Spam-Score: -2.3 (--) X-Spam-Report: SpamAssassin version 3.4.3 on bombadil.infradead.org summary: Content analysis details: (-2.3 points) pts rule name description ---- ---------------------- -------------------------------------------------- 0.0 RCVD_IN_MSPIKE_H3 RBL: Good reputation (+3) [195.135.220.15 listed in wl.mailspike.net] -2.3 RCVD_IN_DNSWL_MED RBL: Sender listed at https://www.dnswl.org/, medium trust [195.135.220.15 listed in list.dnswl.org] 0.0 SPF_HELO_NONE SPF: HELO does not publish an SPF Record -0.0 SPF_PASS SPF: sender matches SPF record 0.0 RCVD_IN_MSPIKE_WL Mailspike good senders X-BeenThere: linux-arm-kernel@lists.infradead.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: ulf.hansson@linaro.org, f.fainelli@gmail.com, phil@raspberrypi.org, linux-kernel@vger.kernel.org, Nicolas Saenz Julienne Sender: "linux-arm-kernel" Errors-To: linux-arm-kernel-bounces+patchwork-linux-arm=patchwork.kernel.org@lists.infradead.org With the introduction of SDHCI_QUIRK2_SET_BUS_VOLTAGE there is no need to use a custom set_power() implementation as the quirk takes care of configuring the bus voltage register even when powering trough a regulator. Signed-off-by: Nicolas Saenz Julienne --- drivers/mmc/host/sdhci-pxav3.c | 20 +------------------- 1 file changed, 1 insertion(+), 19 deletions(-) diff --git a/drivers/mmc/host/sdhci-pxav3.c b/drivers/mmc/host/sdhci-pxav3.c index e55037ceda73..dc4a1e69e6f6 100644 --- a/drivers/mmc/host/sdhci-pxav3.c +++ b/drivers/mmc/host/sdhci-pxav3.c @@ -297,27 +297,8 @@ static void pxav3_set_uhs_signaling(struct sdhci_host *host, unsigned int uhs) __func__, uhs, ctrl_2); } -static void pxav3_set_power(struct sdhci_host *host, unsigned char mode, - unsigned short vdd) -{ - struct mmc_host *mmc = host->mmc; - u8 pwr = host->pwr; - - sdhci_set_power_noreg(host, mode, vdd); - - if (host->pwr == pwr) - return; - - if (host->pwr == 0) - vdd = 0; - - if (!IS_ERR(mmc->supply.vmmc)) - mmc_regulator_set_ocr(mmc, mmc->supply.vmmc, vdd); -} - static const struct sdhci_ops pxav3_sdhci_ops = { .set_clock = sdhci_set_clock, - .set_power = pxav3_set_power, .platform_send_init_74_clocks = pxav3_gen_init_74_clocks, .get_max_clock = sdhci_pltfm_clk_get_max_clock, .set_bus_width = sdhci_set_bus_width, @@ -330,6 +311,7 @@ static const struct sdhci_pltfm_data sdhci_pxav3_pdata = { | SDHCI_QUIRK_NO_ENDATTR_IN_NOPDESC | SDHCI_QUIRK_32BIT_ADMA_SIZE | SDHCI_QUIRK_CAP_CLOCK_BASE_BROKEN, + .quirks2 = SDHCI_QUIRK2_SET_BUS_VOLTAGE, .ops = &pxav3_sdhci_ops, }; From patchwork Fri Mar 6 10:38:51 2020 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Nicolas Saenz Julienne X-Patchwork-Id: 11423509 Return-Path: Received: from mail.kernel.org (pdx-korg-mail-1.web.codeaurora.org [172.30.200.123]) by pdx-korg-patchwork-2.web.codeaurora.org (Postfix) with ESMTP id 9959C1395 for ; Fri, 6 Mar 2020 10:40:49 +0000 (UTC) Received: from bombadil.infradead.org (bombadil.infradead.org [198.137.202.133]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mail.kernel.org (Postfix) with ESMTPS id 74CAB2072D for ; Fri, 6 Mar 2020 10:40:49 +0000 (UTC) Authentication-Results: mail.kernel.org; dkim=pass (2048-bit key) header.d=lists.infradead.org header.i=@lists.infradead.org header.b="X0DiHAdP" DMARC-Filter: OpenDMARC Filter v1.3.2 mail.kernel.org 74CAB2072D Authentication-Results: mail.kernel.org; dmarc=none (p=none dis=none) header.from=suse.de Authentication-Results: mail.kernel.org; spf=none smtp.mailfrom=linux-arm-kernel-bounces+patchwork-linux-arm=patchwork.kernel.org@lists.infradead.org DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=lists.infradead.org; s=bombadil.20170209; h=Sender: Content-Transfer-Encoding:Content-Type:Cc:List-Subscribe:List-Help:List-Post: List-Archive:List-Unsubscribe:List-Id:MIME-Version:References:In-Reply-To: Message-Id:Date:Subject:To:From:Reply-To:Content-ID:Content-Description: Resent-Date:Resent-From:Resent-Sender:Resent-To:Resent-Cc:Resent-Message-ID: List-Owner; bh=yzDZA6AcDmodol4yLDlOhowHJ5BxDSneBzS7bYtZEi4=; b=X0DiHAdPfgiXPF j42+OmudnHYbpFoUtFMJlgxqDregfYx/HsLngSfomrJetDMwZ/rh06bbXlQ1NboWPxDcLNpOA2N3v X4keAKMVG0NtlF0ps0Oj8dQ63Ym5j7YjRibqLxScURWsIKCTngQT2YDzd6MOI/r3RYkQZFvERtCG4 XsHAvj42onZ+S6Heiuym2Tq6Hc+Xo7/ItPOhVYhVo9lBKSc8AAlJeQ+O1zFMdggNb6zO8NUkCyrqL I6VqjZ4qyCGV0vh+nnVv8GaiZtdVjmFs4I0RIHsBWpjs3tnk9wSqD3CfsxkVtyYnOHbv2r1xlWsTu Tg+sLhjpd5AvSpABP41w==; Received: from localhost ([127.0.0.1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.92.3 #3 (Red Hat Linux)) id 1jAAPN-0002Gb-7Y; Fri, 06 Mar 2020 10:40:45 +0000 Received: from mx2.suse.de ([195.135.220.15]) by bombadil.infradead.org with esmtps (Exim 4.92.3 #3 (Red Hat Linux)) id 1jAAO7-00085c-FH; Fri, 06 Mar 2020 10:39:29 +0000 X-Virus-Scanned: by amavisd-new at test-mx.suse.de Received: from relay2.suse.de (unknown [195.135.220.254]) by mx2.suse.de (Postfix) with ESMTP id 987C7ADE8; Fri, 6 Mar 2020 10:39:25 +0000 (UTC) From: Nicolas Saenz Julienne To: devicetree@vger.kernel.org, bcm-kernel-feedback-list@broadcom.com, linux-rpi-kernel@lists.infradead.org, linux-arm-kernel@lists.infradead.org, linux-mmc@vger.kernel.org, Hu Ziji , Adrian Hunter Subject: [PATCH 06/10] mmc: sdhci: xenon: Use quirk instead of custom set_power() Date: Fri, 6 Mar 2020 11:38:51 +0100 Message-Id: <20200306103857.23962-7-nsaenzjulienne@suse.de> X-Mailer: git-send-email 2.25.1 In-Reply-To: <20200306103857.23962-1-nsaenzjulienne@suse.de> References: <20200306103857.23962-1-nsaenzjulienne@suse.de> MIME-Version: 1.0 X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20200306_023927_761480_FE5E52DD X-CRM114-Status: GOOD ( 12.89 ) X-Spam-Score: -2.3 (--) X-Spam-Report: SpamAssassin version 3.4.3 on bombadil.infradead.org summary: Content analysis details: (-2.3 points) pts rule name description ---- ---------------------- -------------------------------------------------- 0.0 RCVD_IN_MSPIKE_H3 RBL: Good reputation (+3) [195.135.220.15 listed in wl.mailspike.net] -2.3 RCVD_IN_DNSWL_MED RBL: Sender listed at https://www.dnswl.org/, medium trust [195.135.220.15 listed in list.dnswl.org] 0.0 SPF_HELO_NONE SPF: HELO does not publish an SPF Record -0.0 SPF_PASS SPF: sender matches SPF record 0.0 RCVD_IN_MSPIKE_WL Mailspike good senders X-BeenThere: linux-arm-kernel@lists.infradead.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: ulf.hansson@linaro.org, f.fainelli@gmail.com, phil@raspberrypi.org, linux-kernel@vger.kernel.org, Nicolas Saenz Julienne Sender: "linux-arm-kernel" Errors-To: linux-arm-kernel-bounces+patchwork-linux-arm=patchwork.kernel.org@lists.infradead.org With the introduction of SDHCI_QUIRK2_SET_BUS_VOLTAGE there is no need to use a custom set_power() implementation as the quirk takes care of configuring the bus voltage register even when powering trough a regulator. Signed-off-by: Nicolas Saenz Julienne --- drivers/mmc/host/sdhci-xenon.c | 20 +------------------- 1 file changed, 1 insertion(+), 19 deletions(-) diff --git a/drivers/mmc/host/sdhci-xenon.c b/drivers/mmc/host/sdhci-xenon.c index 1dea1ba66f7b..5bca5f9e5660 100644 --- a/drivers/mmc/host/sdhci-xenon.c +++ b/drivers/mmc/host/sdhci-xenon.c @@ -213,24 +213,6 @@ static void xenon_set_uhs_signaling(struct sdhci_host *host, sdhci_writew(host, ctrl_2, SDHCI_HOST_CONTROL2); } -static void xenon_set_power(struct sdhci_host *host, unsigned char mode, - unsigned short vdd) -{ - struct mmc_host *mmc = host->mmc; - u8 pwr = host->pwr; - - sdhci_set_power_noreg(host, mode, vdd); - - if (host->pwr == pwr) - return; - - if (host->pwr == 0) - vdd = 0; - - if (!IS_ERR(mmc->supply.vmmc)) - mmc_regulator_set_ocr(mmc, mmc->supply.vmmc, vdd); -} - static void xenon_voltage_switch(struct sdhci_host *host) { /* Wait for 5ms after set 1.8V signal enable bit */ @@ -240,7 +222,6 @@ static void xenon_voltage_switch(struct sdhci_host *host) static const struct sdhci_ops sdhci_xenon_ops = { .voltage_switch = xenon_voltage_switch, .set_clock = sdhci_set_clock, - .set_power = xenon_set_power, .set_bus_width = sdhci_set_bus_width, .reset = xenon_reset, .set_uhs_signaling = xenon_set_uhs_signaling, @@ -252,6 +233,7 @@ static const struct sdhci_pltfm_data sdhci_xenon_pdata = { .quirks = SDHCI_QUIRK_NO_ENDATTR_IN_NOPDESC | SDHCI_QUIRK_NO_SIMULT_VDD_AND_POWER | SDHCI_QUIRK_CAP_CLOCK_BASE_BROKEN, + .quirks2 = SDHCI_QUIRK2_SET_BUS_VOLTAGE, }; /* From patchwork Fri Mar 6 10:38:52 2020 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Nicolas Saenz Julienne X-Patchwork-Id: 11423511 Return-Path: Received: from mail.kernel.org (pdx-korg-mail-1.web.codeaurora.org [172.30.200.123]) by pdx-korg-patchwork-2.web.codeaurora.org (Postfix) with ESMTP id 696B814BC for ; Fri, 6 Mar 2020 10:41:00 +0000 (UTC) Received: from bombadil.infradead.org (bombadil.infradead.org [198.137.202.133]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mail.kernel.org (Postfix) with ESMTPS id 2386B2072D for ; Fri, 6 Mar 2020 10:41:00 +0000 (UTC) Authentication-Results: mail.kernel.org; dkim=pass (2048-bit key) header.d=lists.infradead.org header.i=@lists.infradead.org header.b="a03b+dmA" DMARC-Filter: OpenDMARC Filter v1.3.2 mail.kernel.org 2386B2072D Authentication-Results: mail.kernel.org; dmarc=none (p=none dis=none) header.from=suse.de Authentication-Results: mail.kernel.org; spf=none smtp.mailfrom=linux-arm-kernel-bounces+patchwork-linux-arm=patchwork.kernel.org@lists.infradead.org DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=lists.infradead.org; s=bombadil.20170209; h=Sender: Content-Transfer-Encoding:Content-Type:Cc:List-Subscribe:List-Help:List-Post: List-Archive:List-Unsubscribe:List-Id:MIME-Version:References:In-Reply-To: Message-Id:Date:Subject:To:From:Reply-To:Content-ID:Content-Description: Resent-Date:Resent-From:Resent-Sender:Resent-To:Resent-Cc:Resent-Message-ID: List-Owner; bh=Xwe+HVqeTXwCKSj2ueST5ZDsNA6bg03Bb5P9zQ7g3L4=; b=a03b+dmAms6m77 8IZoVx9EQrClo5y2WhBqxtpcrF84i3U/M4g+vg8i0rrIFWsrvivqo8C7ihaGlRwQiVDW4cn2ciFPP B6Oe45MiL/Idrm6q+mSrAYdKtTH6oiFi6Nay/8Vh47u0izs7mu+FOIHIVqDqYbhiGt28WcXuDjjnU Jc/GNYcG0Pr7nQXpWyOOXEPY5VnvtOQ4AlzUrQmKqiWmAluNTx8lTt+wsEwoaKb4cm3wUjSiK29cY 00++V8n4uISwasn8d96Jk9gz+QQCOyAyaCq8rJ5KHgmgCii/p8gckBbSJKB/Oc7OFxac9Xvfmasut XgSJPwrKpqKoP88AN7eg==; Received: from localhost ([127.0.0.1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.92.3 #3 (Red Hat Linux)) id 1jAAPZ-0002du-8w; Fri, 06 Mar 2020 10:40:57 +0000 Received: from mx2.suse.de ([195.135.220.15]) by bombadil.infradead.org with esmtps (Exim 4.92.3 #3 (Red Hat Linux)) id 1jAAO8-00086Z-0H; Fri, 06 Mar 2020 10:39:30 +0000 X-Virus-Scanned: by amavisd-new at test-mx.suse.de Received: from relay2.suse.de (unknown [195.135.220.254]) by mx2.suse.de (Postfix) with ESMTP id 7C308B230; Fri, 6 Mar 2020 10:39:26 +0000 (UTC) From: Nicolas Saenz Julienne To: devicetree@vger.kernel.org, bcm-kernel-feedback-list@broadcom.com, linux-rpi-kernel@lists.infradead.org, linux-arm-kernel@lists.infradead.org, linux-mmc@vger.kernel.org, Adrian Hunter Subject: [PATCH 07/10] mmc: sdhci: am654: Use quirk instead of custom set_power() Date: Fri, 6 Mar 2020 11:38:52 +0100 Message-Id: <20200306103857.23962-8-nsaenzjulienne@suse.de> X-Mailer: git-send-email 2.25.1 In-Reply-To: <20200306103857.23962-1-nsaenzjulienne@suse.de> References: <20200306103857.23962-1-nsaenzjulienne@suse.de> MIME-Version: 1.0 X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20200306_023928_351666_8F01E856 X-CRM114-Status: GOOD ( 12.12 ) X-Spam-Score: -2.3 (--) X-Spam-Report: SpamAssassin version 3.4.3 on bombadil.infradead.org summary: Content analysis details: (-2.3 points) pts rule name description ---- ---------------------- -------------------------------------------------- 0.0 RCVD_IN_MSPIKE_H3 RBL: Good reputation (+3) [195.135.220.15 listed in wl.mailspike.net] -2.3 RCVD_IN_DNSWL_MED RBL: Sender listed at https://www.dnswl.org/, medium trust [195.135.220.15 listed in list.dnswl.org] 0.0 SPF_HELO_NONE SPF: HELO does not publish an SPF Record -0.0 SPF_PASS SPF: sender matches SPF record 0.0 RCVD_IN_MSPIKE_WL Mailspike good senders X-BeenThere: linux-arm-kernel@lists.infradead.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: ulf.hansson@linaro.org, f.fainelli@gmail.com, phil@raspberrypi.org, linux-kernel@vger.kernel.org, Nicolas Saenz Julienne Sender: "linux-arm-kernel" Errors-To: linux-arm-kernel-bounces+patchwork-linux-arm=patchwork.kernel.org@lists.infradead.org With the introduction of SDHCI_QUIRK2_SET_BUS_VOLTAGE there is no need to use a custom set_power() implementation as the quirk takes care of configuring the bus voltage register even when powering trough a regulator. Signed-off-by: Nicolas Saenz Julienne --- drivers/mmc/host/sdhci_am654.c | 23 ++++++----------------- 1 file changed, 6 insertions(+), 17 deletions(-) diff --git a/drivers/mmc/host/sdhci_am654.c b/drivers/mmc/host/sdhci_am654.c index 58183b5f4e82..4629596da86a 100644 --- a/drivers/mmc/host/sdhci_am654.c +++ b/drivers/mmc/host/sdhci_am654.c @@ -255,17 +255,6 @@ static void sdhci_j721e_4bit_set_clock(struct sdhci_host *host, sdhci_set_clock(host, clock); } -static void sdhci_am654_set_power(struct sdhci_host *host, unsigned char mode, - unsigned short vdd) -{ - if (!IS_ERR(host->mmc->supply.vmmc)) { - struct mmc_host *mmc = host->mmc; - - mmc_regulator_set_ocr(mmc, mmc->supply.vmmc, vdd); - } - sdhci_set_power_noreg(host, mode, vdd); -} - static void sdhci_am654_write_b(struct sdhci_host *host, u8 val, int reg) { unsigned char timing = host->mmc->ios.timing; @@ -321,7 +310,6 @@ static struct sdhci_ops sdhci_am654_ops = { .get_timeout_clock = sdhci_pltfm_clk_get_max_clock, .set_uhs_signaling = sdhci_set_uhs_signaling, .set_bus_width = sdhci_set_bus_width, - .set_power = sdhci_am654_set_power, .set_clock = sdhci_am654_set_clock, .write_b = sdhci_am654_write_b, .irq = sdhci_am654_cqhci_irq, @@ -331,7 +319,8 @@ static struct sdhci_ops sdhci_am654_ops = { static const struct sdhci_pltfm_data sdhci_am654_pdata = { .ops = &sdhci_am654_ops, .quirks = SDHCI_QUIRK_MULTIBLOCK_READ_ACMD12, - .quirks2 = SDHCI_QUIRK2_PRESET_VALUE_BROKEN, + .quirks2 = SDHCI_QUIRK2_PRESET_VALUE_BROKEN | + SDHCI_QUIRK2_SET_BUS_VOLTAGE, }; static const struct sdhci_am654_driver_data sdhci_am654_drvdata = { @@ -344,7 +333,6 @@ static struct sdhci_ops sdhci_j721e_8bit_ops = { .get_timeout_clock = sdhci_pltfm_clk_get_max_clock, .set_uhs_signaling = sdhci_set_uhs_signaling, .set_bus_width = sdhci_set_bus_width, - .set_power = sdhci_am654_set_power, .set_clock = sdhci_am654_set_clock, .write_b = sdhci_am654_write_b, .irq = sdhci_am654_cqhci_irq, @@ -354,7 +342,8 @@ static struct sdhci_ops sdhci_j721e_8bit_ops = { static const struct sdhci_pltfm_data sdhci_j721e_8bit_pdata = { .ops = &sdhci_j721e_8bit_ops, .quirks = SDHCI_QUIRK_MULTIBLOCK_READ_ACMD12, - .quirks2 = SDHCI_QUIRK2_PRESET_VALUE_BROKEN, + .quirks2 = SDHCI_QUIRK2_PRESET_VALUE_BROKEN | + SDHCI_QUIRK2_SET_BUS_VOLTAGE, }; static const struct sdhci_am654_driver_data sdhci_j721e_8bit_drvdata = { @@ -367,7 +356,6 @@ static struct sdhci_ops sdhci_j721e_4bit_ops = { .get_timeout_clock = sdhci_pltfm_clk_get_max_clock, .set_uhs_signaling = sdhci_set_uhs_signaling, .set_bus_width = sdhci_set_bus_width, - .set_power = sdhci_am654_set_power, .set_clock = sdhci_j721e_4bit_set_clock, .write_b = sdhci_am654_write_b, .irq = sdhci_am654_cqhci_irq, @@ -377,7 +365,8 @@ static struct sdhci_ops sdhci_j721e_4bit_ops = { static const struct sdhci_pltfm_data sdhci_j721e_4bit_pdata = { .ops = &sdhci_j721e_4bit_ops, .quirks = SDHCI_QUIRK_MULTIBLOCK_READ_ACMD12, - .quirks2 = SDHCI_QUIRK2_PRESET_VALUE_BROKEN, + .quirks2 = SDHCI_QUIRK2_PRESET_VALUE_BROKEN | + SDHCI_QUIRK2_SET_BUS_VOLTAGE, }; static const struct sdhci_am654_driver_data sdhci_j721e_4bit_drvdata = { From patchwork Fri Mar 6 10:38:53 2020 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Nicolas Saenz Julienne X-Patchwork-Id: 11423519 Return-Path: Received: from mail.kernel.org (pdx-korg-mail-1.web.codeaurora.org [172.30.200.123]) by pdx-korg-patchwork-2.web.codeaurora.org (Postfix) with ESMTP id F28F914BC for ; Fri, 6 Mar 2020 10:42:02 +0000 (UTC) Received: from bombadil.infradead.org (bombadil.infradead.org [198.137.202.133]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mail.kernel.org (Postfix) with ESMTPS id CCE8D20848 for ; Fri, 6 Mar 2020 10:42:02 +0000 (UTC) Authentication-Results: mail.kernel.org; dkim=pass (2048-bit key) header.d=lists.infradead.org header.i=@lists.infradead.org header.b="kGVj86m/" DMARC-Filter: OpenDMARC Filter v1.3.2 mail.kernel.org CCE8D20848 Authentication-Results: mail.kernel.org; dmarc=none (p=none dis=none) header.from=suse.de Authentication-Results: mail.kernel.org; spf=none smtp.mailfrom=linux-arm-kernel-bounces+patchwork-linux-arm=patchwork.kernel.org@lists.infradead.org DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=lists.infradead.org; s=bombadil.20170209; h=Sender: Content-Transfer-Encoding:Content-Type:Cc:List-Subscribe:List-Help:List-Post: List-Archive:List-Unsubscribe:List-Id:MIME-Version:References:In-Reply-To: Message-Id:Date:Subject:To:From:Reply-To:Content-ID:Content-Description: Resent-Date:Resent-From:Resent-Sender:Resent-To:Resent-Cc:Resent-Message-ID: List-Owner; bh=06VEoC9cVM8Z/5Cu83q/CvVRY4rFSRxs5SLLL8PzOcs=; b=kGVj86m/AKQfuM Wb52LeN2a492lMrJ/9Ab1UmyCZw+pyCjea3hotnxtamF3c4WhQtEjK3etePjR87cUljdVF4euTLoj 6kxZqNXdXiN/v79ck2CnFzSxGBeRZHAtjYamblyd/88yww6wXVG/RJ3j3rD7sAH+g7CFjRAmjf8/t uits3PYY4xltUQygDaU+r5IuY+rluP9qgj991r1z51ZS6OSUVHLZQALzTB/r/SzsM9nqOD2ezO2CC iMN+Z+258c/35s1VNo5FHlIyDxD5Y2UV5n+BtyqC9yJCTrl1pMOiDB5p+dAWtMLKC0yxEH91IVh5Z 0ytvu5PQKnCDkGk7wNNA==; Received: from localhost ([127.0.0.1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.92.3 #3 (Red Hat Linux)) id 1jAAQa-0003eA-0A; Fri, 06 Mar 2020 10:42:00 +0000 Received: from mx2.suse.de ([195.135.220.15]) by bombadil.infradead.org with esmtps (Exim 4.92.3 #3 (Red Hat Linux)) id 1jAAO9-00088E-Rp; Fri, 06 Mar 2020 10:39:32 +0000 X-Virus-Scanned: by amavisd-new at test-mx.suse.de Received: from relay2.suse.de (unknown [195.135.220.254]) by mx2.suse.de (Postfix) with ESMTP id AE761B282; Fri, 6 Mar 2020 10:39:27 +0000 (UTC) From: Nicolas Saenz Julienne To: devicetree@vger.kernel.org, bcm-kernel-feedback-list@broadcom.com, linux-rpi-kernel@lists.infradead.org, linux-arm-kernel@lists.infradead.org, linux-mmc@vger.kernel.org, Adrian Hunter Subject: [PATCH 08/10] mmc: sdhci: Unexport sdhci_set_power_noreg() Date: Fri, 6 Mar 2020 11:38:53 +0100 Message-Id: <20200306103857.23962-9-nsaenzjulienne@suse.de> X-Mailer: git-send-email 2.25.1 In-Reply-To: <20200306103857.23962-1-nsaenzjulienne@suse.de> References: <20200306103857.23962-1-nsaenzjulienne@suse.de> MIME-Version: 1.0 X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20200306_023930_087795_9DEDDC56 X-CRM114-Status: GOOD ( 12.15 ) X-Spam-Score: -2.3 (--) X-Spam-Report: SpamAssassin version 3.4.3 on bombadil.infradead.org summary: Content analysis details: (-2.3 points) pts rule name description ---- ---------------------- -------------------------------------------------- 0.0 RCVD_IN_MSPIKE_H3 RBL: Good reputation (+3) [195.135.220.15 listed in wl.mailspike.net] -2.3 RCVD_IN_DNSWL_MED RBL: Sender listed at https://www.dnswl.org/, medium trust [195.135.220.15 listed in list.dnswl.org] 0.0 SPF_HELO_NONE SPF: HELO does not publish an SPF Record -0.0 SPF_PASS SPF: sender matches SPF record 0.0 RCVD_IN_MSPIKE_WL Mailspike good senders X-BeenThere: linux-arm-kernel@lists.infradead.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: ulf.hansson@linaro.org, f.fainelli@gmail.com, phil@raspberrypi.org, linux-kernel@vger.kernel.org, Nicolas Saenz Julienne Sender: "linux-arm-kernel" Errors-To: linux-arm-kernel-bounces+patchwork-linux-arm=patchwork.kernel.org@lists.infradead.org There are no users left and, ideally, it's not a function that should be called outside of the core sdhci code. As sdhci_set_power_reg() depends on sdhci_set_power_noreg() it was moved underneath it. Signed-off-by: Nicolas Saenz Julienne --- drivers/mmc/host/sdhci.c | 39 +++++++++++++++++++-------------------- drivers/mmc/host/sdhci.h | 2 -- 2 files changed, 19 insertions(+), 22 deletions(-) diff --git a/drivers/mmc/host/sdhci.c b/drivers/mmc/host/sdhci.c index c7fd87447457..728442b129f4 100644 --- a/drivers/mmc/host/sdhci.c +++ b/drivers/mmc/host/sdhci.c @@ -1913,25 +1913,7 @@ void sdhci_set_clock(struct sdhci_host *host, unsigned int clock) } EXPORT_SYMBOL_GPL(sdhci_set_clock); -static void sdhci_set_power_reg(struct sdhci_host *host, unsigned char mode, - unsigned short vdd) -{ - struct mmc_host *mmc = host->mmc; - - mmc_regulator_set_ocr(mmc, mmc->supply.vmmc, vdd); - - if (host->quirks2 & SDHCI_QUIRK2_SET_BUS_VOLTAGE) { - sdhci_set_power_noreg(host, mode, vdd); - return; - } - - if (mode != MMC_POWER_OFF) - sdhci_writeb(host, SDHCI_POWER_ON, SDHCI_POWER_CONTROL); - else - sdhci_writeb(host, 0, SDHCI_POWER_CONTROL); -} - -void sdhci_set_power_noreg(struct sdhci_host *host, unsigned char mode, +static void sdhci_set_power_noreg(struct sdhci_host *host, unsigned char mode, unsigned short vdd) { u8 pwr = 0; @@ -2003,7 +1985,24 @@ void sdhci_set_power_noreg(struct sdhci_host *host, unsigned char mode, mdelay(10); } } -EXPORT_SYMBOL_GPL(sdhci_set_power_noreg); + +static void sdhci_set_power_reg(struct sdhci_host *host, unsigned char mode, + unsigned short vdd) +{ + struct mmc_host *mmc = host->mmc; + + mmc_regulator_set_ocr(mmc, mmc->supply.vmmc, vdd); + + if (host->quirks2 & SDHCI_QUIRK2_SET_BUS_VOLTAGE) { + sdhci_set_power_noreg(host, mode, vdd); + return; + } + + if (mode != MMC_POWER_OFF) + sdhci_writeb(host, SDHCI_POWER_ON, SDHCI_POWER_CONTROL); + else + sdhci_writeb(host, 0, SDHCI_POWER_CONTROL); +} void sdhci_set_power(struct sdhci_host *host, unsigned char mode, unsigned short vdd) diff --git a/drivers/mmc/host/sdhci.h b/drivers/mmc/host/sdhci.h index 9531a4e5b148..330557434519 100644 --- a/drivers/mmc/host/sdhci.h +++ b/drivers/mmc/host/sdhci.h @@ -774,8 +774,6 @@ void sdhci_set_clock(struct sdhci_host *host, unsigned int clock); void sdhci_enable_clk(struct sdhci_host *host, u16 clk); void sdhci_set_power(struct sdhci_host *host, unsigned char mode, unsigned short vdd); -void sdhci_set_power_noreg(struct sdhci_host *host, unsigned char mode, - unsigned short vdd); void sdhci_request(struct mmc_host *mmc, struct mmc_request *mrq); void sdhci_set_bus_width(struct sdhci_host *host, int width); void sdhci_reset(struct sdhci_host *host, u8 mask); From patchwork Fri Mar 6 10:38:54 2020 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Nicolas Saenz Julienne X-Patchwork-Id: 11423517 Return-Path: Received: from mail.kernel.org (pdx-korg-mail-1.web.codeaurora.org [172.30.200.123]) by pdx-korg-patchwork-2.web.codeaurora.org (Postfix) with ESMTP id 15B0614BC for ; Fri, 6 Mar 2020 10:41:44 +0000 (UTC) Received: from bombadil.infradead.org (bombadil.infradead.org [198.137.202.133]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mail.kernel.org (Postfix) with ESMTPS id E81422084E for ; Fri, 6 Mar 2020 10:41:43 +0000 (UTC) Authentication-Results: mail.kernel.org; dkim=pass (2048-bit key) header.d=lists.infradead.org header.i=@lists.infradead.org header.b="QsTqNMxm" DMARC-Filter: OpenDMARC Filter v1.3.2 mail.kernel.org E81422084E Authentication-Results: mail.kernel.org; dmarc=none (p=none dis=none) header.from=suse.de Authentication-Results: mail.kernel.org; spf=none smtp.mailfrom=linux-arm-kernel-bounces+patchwork-linux-arm=patchwork.kernel.org@lists.infradead.org DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=lists.infradead.org; s=bombadil.20170209; h=Sender: Content-Transfer-Encoding:Content-Type:Cc:List-Subscribe:List-Help:List-Post: List-Archive:List-Unsubscribe:List-Id:MIME-Version:References:In-Reply-To: Message-Id:Date:Subject:To:From:Reply-To:Content-ID:Content-Description: Resent-Date:Resent-From:Resent-Sender:Resent-To:Resent-Cc:Resent-Message-ID: List-Owner; bh=vnu/2g5HKtjTHyzmbSo0+BYujs9xvauWQbKyRlwloH8=; b=QsTqNMxmMauGGD zanij2QLpZGv2Mo93LRdYqpjGHyxdtCCn+Ihr40tL2sL0anMuyKxKMDzAa6KibzwKDCl0qzBeaQor 4YcScKS2eQtHQswRhC26LJVPJEgD3YU6vFoDMwB/q7531X/lz/SCe7iqS3LmX9StPqd89UXoJItrj d9vk9oVcy/3ttVG/3NkEPTiHTl5L8Cg5WEhZH1btUgMFDccKylZNYG5BLZ8Sj1xoaMAjkB97bs8Un bA1MH6ap2uZXSdLiJs8Rbdwjo9eHcxyheoVAGYWWoMAnf/UuWyubKWXUm15Oo4Hdaq6a07a4i/J6u sYY8sKJXBFX4oiZ7N5lA==; Received: from localhost ([127.0.0.1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.92.3 #3 (Red Hat Linux)) id 1jAAQI-0003OQ-IN; Fri, 06 Mar 2020 10:41:42 +0000 Received: from mx2.suse.de ([195.135.220.15]) by bombadil.infradead.org with esmtps (Exim 4.92.3 #3 (Red Hat Linux)) id 1jAAOA-00089T-4Q; Fri, 06 Mar 2020 10:39:33 +0000 X-Virus-Scanned: by amavisd-new at test-mx.suse.de Received: from relay2.suse.de (unknown [195.135.220.254]) by mx2.suse.de (Postfix) with ESMTP id B28D3B31F; Fri, 6 Mar 2020 10:39:28 +0000 (UTC) From: Nicolas Saenz Julienne To: devicetree@vger.kernel.org, bcm-kernel-feedback-list@broadcom.com, linux-rpi-kernel@lists.infradead.org, linux-arm-kernel@lists.infradead.org, linux-mmc@vger.kernel.org, Adrian Hunter , Ray Jui , Scott Branden Subject: [PATCH 09/10] mmc: sdhci: iproc: Use SDHCI_QUIRK2_SET_BUS_VOLTAGE on bcm2711 Date: Fri, 6 Mar 2020 11:38:54 +0100 Message-Id: <20200306103857.23962-10-nsaenzjulienne@suse.de> X-Mailer: git-send-email 2.25.1 In-Reply-To: <20200306103857.23962-1-nsaenzjulienne@suse.de> References: <20200306103857.23962-1-nsaenzjulienne@suse.de> MIME-Version: 1.0 X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20200306_023930_386015_49FEC2F3 X-CRM114-Status: GOOD ( 12.49 ) X-Spam-Score: -2.3 (--) X-Spam-Report: SpamAssassin version 3.4.3 on bombadil.infradead.org summary: Content analysis details: (-2.3 points) pts rule name description ---- ---------------------- -------------------------------------------------- 0.0 RCVD_IN_MSPIKE_H3 RBL: Good reputation (+3) [195.135.220.15 listed in wl.mailspike.net] -2.3 RCVD_IN_DNSWL_MED RBL: Sender listed at https://www.dnswl.org/, medium trust [195.135.220.15 listed in list.dnswl.org] 0.0 SPF_HELO_NONE SPF: HELO does not publish an SPF Record -0.0 SPF_PASS SPF: sender matches SPF record 0.0 RCVD_IN_MSPIKE_WL Mailspike good senders X-BeenThere: linux-arm-kernel@lists.infradead.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: ulf.hansson@linaro.org, f.fainelli@gmail.com, phil@raspberrypi.org, linux-kernel@vger.kernel.org, Nicolas Saenz Julienne Sender: "linux-arm-kernel" Errors-To: linux-arm-kernel-bounces+patchwork-linux-arm=patchwork.kernel.org@lists.infradead.org Although vmmc is provided by a regulator, bcm2711's sdhci-iproc needs its bus voltage register to be set to a non-zero value. Failure to do so turns the core off. Signed-off-by: Nicolas Saenz Julienne --- drivers/mmc/host/sdhci-iproc.c | 1 + 1 file changed, 1 insertion(+) diff --git a/drivers/mmc/host/sdhci-iproc.c b/drivers/mmc/host/sdhci-iproc.c index f4f5f0a70cda..e2fab52d6721 100644 --- a/drivers/mmc/host/sdhci-iproc.c +++ b/drivers/mmc/host/sdhci-iproc.c @@ -263,6 +263,7 @@ static const struct sdhci_iproc_data bcm2835_data = { static const struct sdhci_pltfm_data sdhci_bcm2711_pltfm_data = { .quirks = SDHCI_QUIRK_MULTIBLOCK_READ_ACMD12, + .quirks2 = SDHCI_QUIRK2_SET_BUS_VOLTAGE, .ops = &sdhci_iproc_32only_ops, }; From patchwork Fri Mar 6 10:38:55 2020 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Nicolas Saenz Julienne X-Patchwork-Id: 11423521 Return-Path: Received: from mail.kernel.org (pdx-korg-mail-1.web.codeaurora.org [172.30.200.123]) by pdx-korg-patchwork-2.web.codeaurora.org (Postfix) with ESMTP id DF84D1395 for ; Fri, 6 Mar 2020 10:42:15 +0000 (UTC) Received: from bombadil.infradead.org (bombadil.infradead.org [198.137.202.133]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mail.kernel.org (Postfix) with ESMTPS id B8FAC2072D for ; Fri, 6 Mar 2020 10:42:15 +0000 (UTC) Authentication-Results: mail.kernel.org; dkim=pass (2048-bit key) header.d=lists.infradead.org header.i=@lists.infradead.org header.b="He+5WL2D" DMARC-Filter: OpenDMARC Filter v1.3.2 mail.kernel.org B8FAC2072D Authentication-Results: mail.kernel.org; dmarc=none (p=none dis=none) header.from=suse.de Authentication-Results: mail.kernel.org; spf=none smtp.mailfrom=linux-arm-kernel-bounces+patchwork-linux-arm=patchwork.kernel.org@lists.infradead.org DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=lists.infradead.org; s=bombadil.20170209; h=Sender: Content-Transfer-Encoding:Content-Type:Cc:List-Subscribe:List-Help:List-Post: List-Archive:List-Unsubscribe:List-Id:MIME-Version:References:In-Reply-To: Message-Id:Date:Subject:To:From:Reply-To:Content-ID:Content-Description: Resent-Date:Resent-From:Resent-Sender:Resent-To:Resent-Cc:Resent-Message-ID: List-Owner; bh=yqt5wsawJXojODomhVYwLVYqrxpoApg2qH+58FrIjjo=; b=He+5WL2DATYrEo JlkSBclf3Nr01QUI5vKM+ALdwyw12kBAx1iSy2TkvcZgbL+a9Lc89ChMG05BFeV8SaiMpELekh5IG rEb9wphuxf6gST+VZyVKdzT3ydnuCQx3tzneo8NyS0k4Jc9tJmqkkAs/m1DWgaSw4K7syKMbrWyiM 01X6AZand4+T2EZErukJDw5uBhevaswVMkoh/AkyCiAzfuaJi8QsN8RQyPRuTxa/bxFJdn8C9HJWP FPveL+0nxbFDW2qhRhpW+p6jM4MsvP+/+fa2F854IfayOPbwkYRp1Gr1bY1lYVS2WXysKHV5bigog NuIWkWGW7tadPqvhUOpg==; Received: from localhost ([127.0.0.1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.92.3 #3 (Red Hat Linux)) id 1jAAQm-0003qW-E6; Fri, 06 Mar 2020 10:42:12 +0000 Received: from mx2.suse.de ([195.135.220.15]) by bombadil.infradead.org with esmtps (Exim 4.92.3 #3 (Red Hat Linux)) id 1jAAOB-0008B5-Fs; Fri, 06 Mar 2020 10:39:34 +0000 X-Virus-Scanned: by amavisd-new at test-mx.suse.de Received: from relay2.suse.de (unknown [195.135.220.254]) by mx2.suse.de (Postfix) with ESMTP id E9EE2ADE8; Fri, 6 Mar 2020 10:39:29 +0000 (UTC) From: Nicolas Saenz Julienne To: devicetree@vger.kernel.org, bcm-kernel-feedback-list@broadcom.com, linux-rpi-kernel@lists.infradead.org, linux-arm-kernel@lists.infradead.org, linux-mmc@vger.kernel.org, Rob Herring , Nicolas Saenz Julienne Subject: [PATCH 10/10] ARM: dts: bcm2711: Add vmmc regulator in emmc2 Date: Fri, 6 Mar 2020 11:38:55 +0100 Message-Id: <20200306103857.23962-11-nsaenzjulienne@suse.de> X-Mailer: git-send-email 2.25.1 In-Reply-To: <20200306103857.23962-1-nsaenzjulienne@suse.de> References: <20200306103857.23962-1-nsaenzjulienne@suse.de> MIME-Version: 1.0 X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20200306_023931_760009_F49D5BF7 X-CRM114-Status: GOOD ( 10.18 ) X-Spam-Score: -2.3 (--) X-Spam-Report: SpamAssassin version 3.4.3 on bombadil.infradead.org summary: Content analysis details: (-2.3 points) pts rule name description ---- ---------------------- -------------------------------------------------- 0.0 RCVD_IN_MSPIKE_H3 RBL: Good reputation (+3) [195.135.220.15 listed in wl.mailspike.net] -2.3 RCVD_IN_DNSWL_MED RBL: Sender listed at https://www.dnswl.org/, medium trust [195.135.220.15 listed in list.dnswl.org] 0.0 SPF_HELO_NONE SPF: HELO does not publish an SPF Record -0.0 SPF_PASS SPF: sender matches SPF record 0.0 RCVD_IN_MSPIKE_WL Mailspike good senders X-BeenThere: linux-arm-kernel@lists.infradead.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: ulf.hansson@linaro.org, f.fainelli@gmail.com, phil@raspberrypi.org, adrian.hunter@intel.com, linux-kernel@vger.kernel.org Sender: "linux-arm-kernel" Errors-To: linux-arm-kernel-bounces+patchwork-linux-arm=patchwork.kernel.org@lists.infradead.org The SD card power can be controlled trough a pin routed into the board's external GPIO expander. Turn that into a regulator and provide it to emmc2. Signed-off-by: Nicolas Saenz Julienne --- arch/arm/boot/dts/bcm2711-rpi-4-b.dts | 11 +++++++++++ 1 file changed, 11 insertions(+) diff --git a/arch/arm/boot/dts/bcm2711-rpi-4-b.dts b/arch/arm/boot/dts/bcm2711-rpi-4-b.dts index e26ea9006378..8e98e917f9f4 100644 --- a/arch/arm/boot/dts/bcm2711-rpi-4-b.dts +++ b/arch/arm/boot/dts/bcm2711-rpi-4-b.dts @@ -56,6 +56,16 @@ sd_io_1v8_reg: sd_io_1v8_reg { 3300000 0x0>; status = "okay"; }; + + sd_vcc_reg: sd_vcc_reg { + compatible = "regulator-fixed"; + regulator-name = "vcc-sd"; + regulator-min-microvolt = <3300000>; + regulator-max-microvolt = <3300000>; + regulator-boot-on; + enable-active-high; + gpio = <&expgpio 6 GPIO_ACTIVE_HIGH>; + }; }; &firmware { @@ -174,6 +184,7 @@ brcmf: wifi@1 { /* EMMC2 is used to drive the SD card */ &emmc2 { vqmmc-supply = <&sd_io_1v8_reg>; + vmmc-supply = <&sd_vcc_reg>; broken-cd; status = "okay"; };