From patchwork Fri Dec 6 17:08:13 2019 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Ulf Hansson X-Patchwork-Id: 11276853 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 B1B0A109A for ; Fri, 6 Dec 2019 17:08:33 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by mail.kernel.org (Postfix) with ESMTP id 8683320706 for ; Fri, 6 Dec 2019 17:08:33 +0000 (UTC) Authentication-Results: mail.kernel.org; dkim=pass (2048-bit key) header.d=linaro.org header.i=@linaro.org header.b="UVN+/T66" Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1726328AbfLFRIc (ORCPT ); Fri, 6 Dec 2019 12:08:32 -0500 Received: from mail-lj1-f195.google.com ([209.85.208.195]:43656 "EHLO mail-lj1-f195.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1726312AbfLFRIc (ORCPT ); Fri, 6 Dec 2019 12:08:32 -0500 Received: by mail-lj1-f195.google.com with SMTP id a13so8395294ljm.10 for ; Fri, 06 Dec 2019 09:08:29 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; h=from:to:cc:subject:date:message-id:in-reply-to:references; bh=Tc0ll2qvZbYOgB1NJXHvXGod64HQcRRr8FCccHB+Mbo=; b=UVN+/T663mUhqim4xp5tSzBrDpM4zamkdPd2rvkI7p0byDS105QidHpYzjZF9WTCIu 2iZQ95AgneiQAgWZ3s+no2dI5E2eoQVv6oUallZjmhGSJwld85N5cGu+CfT06WkLA5nr qIW5tTZn1pINZ0OxEwutwT0W03C7jwLXn9QnJiPHcgKjU97/H1VzlQu7BjbLRhR8bIkN /95c2w8BEBDdbvSL+aHHvT6EWFf4qWcnEFWgYMWhi1mPKzRk2iDHDR4pDQL41Fesjjep ZdqqmjJ7dFyKNOFkdjj7lmX4iMoZzqm/mO1IDMH954dopApBaC8OYv70qsFzaWgDd2Wc Aunw== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:from:to:cc:subject:date:message-id:in-reply-to :references; bh=Tc0ll2qvZbYOgB1NJXHvXGod64HQcRRr8FCccHB+Mbo=; b=tIqRxOCEVsyZ6cwdoMtwsWkIeTYNRjxdLsDcEoYCLzHr7cF7UaIk6aoAfitwZM8DAm bWJ14UOjvMAo9xcKN4bSWpCBsQ1Tycx6bOsSVMsBp/V4RbPQFXfQKkC4ZTUXE45vPT2V l2tM3nhX7rO5KROKPGU6ygrvc4VV4OYO2hRLHEPKJ04GOMXRLmGlVnaPlBJYIwkhmV4L rHP+qNQdP12BKp6Fumu1/mNHs/YiN1oXL02FgYQ+RB9k7uSzezXzPkqLC2NTnBvw33rR /+ufsvoIh5oPo7UtHUxHOXBzFAjfPr2gSH6XmeI6m2DsTWPme0C9KZntkJPfILdgc3zE /prQ== X-Gm-Message-State: APjAAAWEtX69xPrUqLDJrSyH+kz1yk0OevnWBnmh8ooQ81Nb2/q6ntvz znoauTgp7DRxMIyqZaSl1GHDsQ== X-Google-Smtp-Source: APXvYqzIH2UOZMCFS0O7h7tlkyhvsc6gGyD9c/1FA0z09LKEVM71/em3Cz0KCi4ymObLcQ1Gvrb06w== X-Received: by 2002:a2e:5304:: with SMTP id h4mr9565183ljb.75.1575652109117; Fri, 06 Dec 2019 09:08:29 -0800 (PST) Received: from localhost.localdomain (h-158-174-22-210.NA.cust.bahnhof.se. [158.174.22.210]) by smtp.gmail.com with ESMTPSA id z9sm6905283ljm.40.2019.12.06.09.08.27 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Fri, 06 Dec 2019 09:08:28 -0800 (PST) From: Ulf Hansson To: linux-gpio@vger.kernel.org, Linus Walleij Cc: linux-mmc@vger.kernel.org, Ulf Hansson Subject: [PATCH 1/9] pinctrl: core: Add pinctrl_select_default_state() and export it Date: Fri, 6 Dec 2019 18:08:13 +0100 Message-Id: <20191206170821.29711-2-ulf.hansson@linaro.org> X-Mailer: git-send-email 2.17.1 In-Reply-To: <20191206170821.29711-1-ulf.hansson@linaro.org> References: <20191206170821.29711-1-ulf.hansson@linaro.org> Sender: linux-mmc-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-mmc@vger.kernel.org It has turned out that some mmc host drivers, but perhaps also others drivers, needs to reset the pinctrl into the default state (PINCTRL_STATE_DEFAULT). However, they can't use the existing pinctrl_pm_select_default_state(), as that requires CONFIG_PM to be set. This leads to open coding, as they need to look up the default state themselves and then select it. To avoid the open coding, let's introduce pinctrl_select_default_state() and make it available independently of CONFIG_PM. As a matter of fact, this makes it more consistent with the behaviour of the driver core, as it already tries to looks up the default state during probe. Going forward, users of pinctrl_pm_select_default_state() are encouraged to move to pinctrl_select_default_state(), so the old API can be removed. Signed-off-by: Ulf Hansson --- drivers/pinctrl/core.c | 33 ++++++++++++++++++-------------- include/linux/pinctrl/consumer.h | 6 ++++++ 2 files changed, 25 insertions(+), 14 deletions(-) diff --git a/drivers/pinctrl/core.c b/drivers/pinctrl/core.c index 2bbd8ee93507..46600d9380ea 100644 --- a/drivers/pinctrl/core.c +++ b/drivers/pinctrl/core.c @@ -1535,15 +1535,8 @@ int pinctrl_init_done(struct device *dev) return ret; } -#ifdef CONFIG_PM - -/** - * pinctrl_pm_select_state() - select pinctrl state for PM - * @dev: device to select default state for - * @state: state to set - */ -static int pinctrl_pm_select_state(struct device *dev, - struct pinctrl_state *state) +static int pinctrl_select_bound_state(struct device *dev, + struct pinctrl_state *state) { struct dev_pin_info *pins = dev->pins; int ret; @@ -1558,15 +1551,27 @@ static int pinctrl_pm_select_state(struct device *dev, } /** - * pinctrl_pm_select_default_state() - select default pinctrl state for PM + * pinctrl_select_default_state() - select default pinctrl state * @dev: device to select default state for */ -int pinctrl_pm_select_default_state(struct device *dev) +int pinctrl_select_default_state(struct device *dev) { if (!dev->pins) return 0; - return pinctrl_pm_select_state(dev, dev->pins->default_state); + return pinctrl_select_bound_state(dev, dev->pins->default_state); +} +EXPORT_SYMBOL_GPL(pinctrl_select_default_state); + +#ifdef CONFIG_PM + +/** + * pinctrl_pm_select_default_state() - select default pinctrl state for PM + * @dev: device to select default state for + */ +int pinctrl_pm_select_default_state(struct device *dev) +{ + return pinctrl_select_default_state(dev); } EXPORT_SYMBOL_GPL(pinctrl_pm_select_default_state); @@ -1579,7 +1584,7 @@ int pinctrl_pm_select_sleep_state(struct device *dev) if (!dev->pins) return 0; - return pinctrl_pm_select_state(dev, dev->pins->sleep_state); + return pinctrl_select_bound_state(dev, dev->pins->sleep_state); } EXPORT_SYMBOL_GPL(pinctrl_pm_select_sleep_state); @@ -1592,7 +1597,7 @@ int pinctrl_pm_select_idle_state(struct device *dev) if (!dev->pins) return 0; - return pinctrl_pm_select_state(dev, dev->pins->idle_state); + return pinctrl_select_bound_state(dev, dev->pins->idle_state); } EXPORT_SYMBOL_GPL(pinctrl_pm_select_idle_state); #endif diff --git a/include/linux/pinctrl/consumer.h b/include/linux/pinctrl/consumer.h index 7f8c7d9583d3..019fecd75d0c 100644 --- a/include/linux/pinctrl/consumer.h +++ b/include/linux/pinctrl/consumer.h @@ -40,6 +40,7 @@ extern int pinctrl_select_state(struct pinctrl *p, struct pinctrl_state *s); extern struct pinctrl * __must_check devm_pinctrl_get(struct device *dev); extern void devm_pinctrl_put(struct pinctrl *p); +extern int pinctrl_select_default_state(struct device *dev); #ifdef CONFIG_PM extern int pinctrl_pm_select_default_state(struct device *dev); @@ -122,6 +123,11 @@ static inline void devm_pinctrl_put(struct pinctrl *p) { } +static inline int pinctrl_select_default_state(struct device *dev) +{ + return 0; +} + static inline int pinctrl_pm_select_default_state(struct device *dev) { return 0; From patchwork Fri Dec 6 17:08:14 2019 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Ulf Hansson X-Patchwork-Id: 11276855 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 DC95E6C1 for ; Fri, 6 Dec 2019 17:08:33 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by mail.kernel.org (Postfix) with ESMTP id BB92A20706 for ; Fri, 6 Dec 2019 17:08:33 +0000 (UTC) Authentication-Results: mail.kernel.org; dkim=pass (2048-bit key) header.d=linaro.org header.i=@linaro.org header.b="Q44gSt2T" Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1726312AbfLFRIc (ORCPT ); Fri, 6 Dec 2019 12:08:32 -0500 Received: from mail-lf1-f67.google.com ([209.85.167.67]:42668 "EHLO mail-lf1-f67.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1726298AbfLFRIc (ORCPT ); Fri, 6 Dec 2019 12:08:32 -0500 Received: by mail-lf1-f67.google.com with SMTP id y19so5787838lfl.9 for ; Fri, 06 Dec 2019 09:08:30 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; h=from:to:cc:subject:date:message-id:in-reply-to:references; bh=O8WqN3lnEyD9AJPmC5ibEKsr/6UO7fhL7XDNvCov7/A=; b=Q44gSt2TrsiZ2pSroay4LmdmBxBEL+IzpH+ye7xKOGnSPcnZffLFmAWa2J42YbNoEl 5wZpDfG6gkeJYCQny4pRAJwgNaNOlh02jjhm3jaP7eZtu6iuIVsWWm3dbmwII05lg60v 1qJXOgtYyIruva88pR9JPq2OGTeCwB9XGT/ma5OrQgzOsrKnohVx548xlYLKaXpz4S47 7H2W0ldMFGYxbp7rzM060Q5tGJTrHjXqrzL6Z7rZn+X9gGPFFMKDeQWd3E+9zpwFcnTK A7J0BlkerrfC31vur6y5ZyAtCb/NBDQ1jrCJ+/GZm+q8egakeb4qg+NDtuu6B6luiCD7 Wcxg== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:from:to:cc:subject:date:message-id:in-reply-to :references; bh=O8WqN3lnEyD9AJPmC5ibEKsr/6UO7fhL7XDNvCov7/A=; b=MeKxxPV6CHFNVDCYrYwd0cj4y/77Enwm57kVP4sqa8BC0qwpZ0E93qbLey63gFuKR7 MZlg6mikL9y4QFyrkzh396yIx9u67pwxJz0gf4s9NZJDnZcZ/R+RxK7Gyk1x9+UVcFAA 9oB+qNL03NT7OYy3TixhamA8SBjKKdE6Aia8WJrz+UZ00NF/1Pu57aNDb2CxQC1t0OBQ L4Egn7I7drbsRj19SN62nuYN5ubgeN+kOHnTlasTzQVBm4DK51MHSxfITX85tiSYa0u0 AXAIoGy3jqMlbpActO0JpvV1xgAVRdq5lZ4lwYalsBFSmOSbjVEWh6gO+wwqRGTvh7c2 mi6A== X-Gm-Message-State: APjAAAWdpPQlAeCIRluNj9kvO7TedCASzIJZsVPzBbhppc/aiN4bkaTW mMBFfZWCRl1UCEJ1pivpSMLZqg== X-Google-Smtp-Source: APXvYqwHweyq6mEptO8og8uBC9DT4NaGsbDLKM7d70VYzZ2DIG4Qfmb9tMUeAe5weBz+vUhsYYjpjg== X-Received: by 2002:ac2:5b41:: with SMTP id i1mr8691197lfp.82.1575652110129; Fri, 06 Dec 2019 09:08:30 -0800 (PST) Received: from localhost.localdomain (h-158-174-22-210.NA.cust.bahnhof.se. [158.174.22.210]) by smtp.gmail.com with ESMTPSA id z9sm6905283ljm.40.2019.12.06.09.08.29 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Fri, 06 Dec 2019 09:08:29 -0800 (PST) From: Ulf Hansson To: linux-gpio@vger.kernel.org, Linus Walleij Cc: linux-mmc@vger.kernel.org, Ulf Hansson , Kevin Hilman Subject: [PATCH 2/9] mmc: meson-gx: Convert to pinctrl_select_default_state() Date: Fri, 6 Dec 2019 18:08:14 +0100 Message-Id: <20191206170821.29711-3-ulf.hansson@linaro.org> X-Mailer: git-send-email 2.17.1 In-Reply-To: <20191206170821.29711-1-ulf.hansson@linaro.org> References: <20191206170821.29711-1-ulf.hansson@linaro.org> Sender: linux-mmc-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-mmc@vger.kernel.org Let's drop the boilerplate code for managing the default pinctrl state and convert into using the new pinctrl_select_default_state(). Cc: Kevin Hilman Signed-off-by: Ulf Hansson Reviewed-by: Jerome Brunet --- drivers/mmc/host/meson-gx-mmc.c | 10 +--------- 1 file changed, 1 insertion(+), 9 deletions(-) diff --git a/drivers/mmc/host/meson-gx-mmc.c b/drivers/mmc/host/meson-gx-mmc.c index e712315c7e8d..35400cf2a2e4 100644 --- a/drivers/mmc/host/meson-gx-mmc.c +++ b/drivers/mmc/host/meson-gx-mmc.c @@ -161,7 +161,6 @@ struct meson_host { bool dram_access_quirk; struct pinctrl *pinctrl; - struct pinctrl_state *pins_default; struct pinctrl_state *pins_clk_gate; unsigned int bounce_buf_size; @@ -327,7 +326,7 @@ static void meson_mmc_clk_ungate(struct meson_host *host) u32 cfg; if (host->pins_clk_gate) - pinctrl_select_state(host->pinctrl, host->pins_default); + pinctrl_select_default_state(host->dev); /* Make sure the clock is not stopped in the controller */ cfg = readl(host->regs + SD_EMMC_CFG); @@ -1101,13 +1100,6 @@ static int meson_mmc_probe(struct platform_device *pdev) goto free_host; } - host->pins_default = pinctrl_lookup_state(host->pinctrl, - PINCTRL_STATE_DEFAULT); - if (IS_ERR(host->pins_default)) { - ret = PTR_ERR(host->pins_default); - goto free_host; - } - host->pins_clk_gate = pinctrl_lookup_state(host->pinctrl, "clk-gate"); if (IS_ERR(host->pins_clk_gate)) { From patchwork Fri Dec 6 17:08:15 2019 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Ulf Hansson X-Patchwork-Id: 11276857 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 0566C6C1 for ; Fri, 6 Dec 2019 17:08:35 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by mail.kernel.org (Postfix) with ESMTP id D82A32466E for ; Fri, 6 Dec 2019 17:08:34 +0000 (UTC) Authentication-Results: mail.kernel.org; dkim=pass (2048-bit key) header.d=linaro.org header.i=@linaro.org header.b="qatgVOSV" Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1726350AbfLFRId (ORCPT ); Fri, 6 Dec 2019 12:08:33 -0500 Received: from mail-lj1-f193.google.com ([209.85.208.193]:35942 "EHLO mail-lj1-f193.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1726322AbfLFRId (ORCPT ); Fri, 6 Dec 2019 12:08:33 -0500 Received: by mail-lj1-f193.google.com with SMTP id r19so8439526ljg.3 for ; Fri, 06 Dec 2019 09:08:32 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; h=from:to:cc:subject:date:message-id:in-reply-to:references; bh=37DobpBRHG+Arri5XimcII7cjm39P54Z6MB80sywBSk=; b=qatgVOSVmLDVIp7XgklEyOrDj/rrXlD3wp53NTIRuEwUOcHm2tOXL1DzqXSD7Z7wrt KM+uScEywd8QAeCfxvxV/aRUqrb2O4Vl3MgzlqI+EyJodTnO1i7wiVdjpjTuatbTMGMe cMtJH2V5rMA2kFwCC3JgC7Vqgzgi/P9zR8ixpAZ+uNJbnUa5TLwtJDk6twqd8U/zzFE/ qGee7bOUpV8uaBGGP/Y88SYCCnWwB0bknzMjtm4DK84R5/p3UbnQuXM3Bgo3CeE4mZN6 vufKoWaUJyLHWP7un4AjgtF/JrEXV+RZeqkNterX5bq1pTRt0UFpf9ViTWLs9eWiHRmH icNQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:from:to:cc:subject:date:message-id:in-reply-to :references; bh=37DobpBRHG+Arri5XimcII7cjm39P54Z6MB80sywBSk=; b=tBk9jTP0Xn2BI+/PEAf79r1fw2bsTcATQ7UfLdM2/rN5UiN2CikgpSt4qMs5PKY4Su q83I+37lbVElun3hWnDEvGFJSCrjMp/GfD9VRKwO2wL1x8KtKBFIVZBjZsuXw9m3EAkW iqoDHQkPJQDyYlCl1RJYwbk+H6MV+K0o/HBRYePS0m6LbLfwg/BTySovlyuvMCMikWua 1LSUjfOqTMph6wQbX8QHFkvLnN5QQgMcHUMmtocKuCXvhnwyC0415oaiLynmYuOF7FCA 67KEWVbXpC4eqBLhK0FVDkYE3TUajrpo3vNdqtiMih3yNhYq0dHBVFtZAveXIBpxV7ud HoVw== X-Gm-Message-State: APjAAAXjwMGUt/CBThnaCheDpuHfDy/Qi/FsEltkIgAeu2OHINWKFERV dFP1bWwQMogoGs/2qkOIwA+uYw== X-Google-Smtp-Source: APXvYqyn0sVnGRizZai+AQWeTt9ieJhl8y01vZ/9+O7HbMDJ/P3f23zp74dIJYlEog1R0TX0hOvNUg== X-Received: by 2002:a05:651c:112d:: with SMTP id e13mr8015393ljo.99.1575652111308; Fri, 06 Dec 2019 09:08:31 -0800 (PST) Received: from localhost.localdomain (h-158-174-22-210.NA.cust.bahnhof.se. [158.174.22.210]) by smtp.gmail.com with ESMTPSA id z9sm6905283ljm.40.2019.12.06.09.08.30 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Fri, 06 Dec 2019 09:08:30 -0800 (PST) From: Ulf Hansson To: linux-gpio@vger.kernel.org, Linus Walleij Cc: linux-mmc@vger.kernel.org, Ulf Hansson , Russell King Subject: [PATCH 3/9] mmc: mmci: Convert to pinctrl_select_default_state() Date: Fri, 6 Dec 2019 18:08:15 +0100 Message-Id: <20191206170821.29711-4-ulf.hansson@linaro.org> X-Mailer: git-send-email 2.17.1 In-Reply-To: <20191206170821.29711-1-ulf.hansson@linaro.org> References: <20191206170821.29711-1-ulf.hansson@linaro.org> Sender: linux-mmc-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-mmc@vger.kernel.org Let's drop the boilerplate code for managing the default pinctrl state and convert into using the new pinctrl_select_default_state(). Additionally, move away from using pinctrl_pm_select_default_state() as it's scheduled for removal and use pinctrl_select_default_state() instead. Cc: Russell King Signed-off-by: Ulf Hansson --- drivers/mmc/host/mmci.c | 12 ++---------- drivers/mmc/host/mmci.h | 1 - 2 files changed, 2 insertions(+), 11 deletions(-) diff --git a/drivers/mmc/host/mmci.c b/drivers/mmc/host/mmci.c index 40e72c30ea84..caaa4687de93 100644 --- a/drivers/mmc/host/mmci.c +++ b/drivers/mmc/host/mmci.c @@ -1704,7 +1704,7 @@ static void mmci_set_ios(struct mmc_host *mmc, struct mmc_ios *ios) if (ios->bus_mode == MMC_BUSMODE_OPENDRAIN) pinctrl_select_state(host->pinctrl, host->pins_opendrain); else - pinctrl_select_state(host->pinctrl, host->pins_default); + pinctrl_select_default_state(mmc_dev(mmc)); } /* @@ -1877,14 +1877,6 @@ static int mmci_probe(struct amba_device *dev, goto host_free; } - host->pins_default = pinctrl_lookup_state(host->pinctrl, - PINCTRL_STATE_DEFAULT); - if (IS_ERR(host->pins_default)) { - dev_err(mmc_dev(mmc), "Can't select default pins\n"); - ret = PTR_ERR(host->pins_default); - goto host_free; - } - host->pins_opendrain = pinctrl_lookup_state(host->pinctrl, MMCI_PINCTRL_STATE_OPENDRAIN); if (IS_ERR(host->pins_opendrain)) { @@ -2203,7 +2195,7 @@ static int mmci_runtime_resume(struct device *dev) struct mmci_host *host = mmc_priv(mmc); clk_prepare_enable(host->clk); mmci_restore(host); - pinctrl_pm_select_default_state(dev); + pinctrl_select_default_state(dev); } return 0; diff --git a/drivers/mmc/host/mmci.h b/drivers/mmc/host/mmci.h index 158e1231aa23..12d4ed8af88a 100644 --- a/drivers/mmc/host/mmci.h +++ b/drivers/mmc/host/mmci.h @@ -404,7 +404,6 @@ struct mmci_host { struct mmci_host_ops *ops; struct variant_data *variant; struct pinctrl *pinctrl; - struct pinctrl_state *pins_default; struct pinctrl_state *pins_opendrain; u8 hw_designer; From patchwork Fri Dec 6 17:08:16 2019 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Ulf Hansson X-Patchwork-Id: 11276859 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 208F2109A for ; Fri, 6 Dec 2019 17:08:36 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by mail.kernel.org (Postfix) with ESMTP id F36C424659 for ; Fri, 6 Dec 2019 17:08:35 +0000 (UTC) Authentication-Results: mail.kernel.org; dkim=pass (2048-bit key) header.d=linaro.org header.i=@linaro.org header.b="yuBt1Nz6" Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1726336AbfLFRIf (ORCPT ); Fri, 6 Dec 2019 12:08:35 -0500 Received: from mail-lf1-f67.google.com ([209.85.167.67]:44206 "EHLO mail-lf1-f67.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1726321AbfLFRIf (ORCPT ); Fri, 6 Dec 2019 12:08:35 -0500 Received: by mail-lf1-f67.google.com with SMTP id v201so5779308lfa.11 for ; Fri, 06 Dec 2019 09:08:33 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; h=from:to:cc:subject:date:message-id:in-reply-to:references; bh=rFMoiOb3bUP9LxJIzW1x3OJ7y3lUt3rITRuiEhSamMw=; b=yuBt1Nz63ljeeTGifF8LW4UZodTP03zOMvHRkLXlCEc4hZgzUrIZaFmigouYuu/5QQ yW2Wl3wSL6gGLxORyG6LdhioVtzqXg9caEL/Ryo/N24vFCPrG+ajtpk/gwAZibTAIolM ZxNiwoBij19TremrALO0Mx0jMqS9xK3LxRVKlWrDZvOgpjv4zNRvLz8vu1LTr4SMPhjm NH2bLJdJnbCKCWhS5H1DdQE7DKb/kraSjpB509FJqLGrxplNdsmayzsxhC2L8I6IH1RQ BCo/Lh7tZ+yvheB2BEKy4cPrV8Bn90ITFcRxOUUnHwj4pFYVXxiF8ElIUz6a38jUwPPW eXuQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:from:to:cc:subject:date:message-id:in-reply-to :references; bh=rFMoiOb3bUP9LxJIzW1x3OJ7y3lUt3rITRuiEhSamMw=; b=E4Qd3xW1RhPF1+cx7C8pytJaDg7W94uzjDewWfh9MACgDoV9fr9PEoH3oBQflZdfUP yawkPB1kRECB3qYV0Qq09pOulclaFWDnlNNJdPbauwF1Y1b/wH6chJKKx7WM1bav/Ujy kEJVdFyBpUk5UvHW+r1otq1xCiSRgByAScwufDlDdOtL6V6juSSqRL5o7ibTO7sFaUmw vsHUqdy8xAb7r2gPghq7q3KQ/al5nK1tXNHF1jZ5FCemiqFvRNm6ljklLQDvUgJc41rt /hWDWX4Sp4g6gk37hN0yIfYkxKqDabuM5ErxF/cJS1Rq39LuF0ee4QXeXIqPlDRo0x4D VvxQ== X-Gm-Message-State: APjAAAV4gbhhYIkyrKW+pjWC0eynMn1z8l6jHmFyBQZg/MmBFHGif8Yz WfOJjwZN4xX43CzJkUmvW4nY8g== X-Google-Smtp-Source: APXvYqx0qpC5LT1rrt5Z6fK9f1Qoo58inkUhE1J56SLYUqKWNAX18lgbkzE7VWQhJDcOmtomKc3qAA== X-Received: by 2002:a05:6512:21d:: with SMTP id a29mr1570063lfo.186.1575652112299; Fri, 06 Dec 2019 09:08:32 -0800 (PST) Received: from localhost.localdomain (h-158-174-22-210.NA.cust.bahnhof.se. [158.174.22.210]) by smtp.gmail.com with ESMTPSA id z9sm6905283ljm.40.2019.12.06.09.08.31 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Fri, 06 Dec 2019 09:08:31 -0800 (PST) From: Ulf Hansson To: linux-gpio@vger.kernel.org, Linus Walleij Cc: linux-mmc@vger.kernel.org, Ulf Hansson , Jesper Nilsson , Lars Persson Subject: [PATCH 4/9] mmc: usdhi6rol0: Convert to pinctrl_select_default_state() Date: Fri, 6 Dec 2019 18:08:16 +0100 Message-Id: <20191206170821.29711-5-ulf.hansson@linaro.org> X-Mailer: git-send-email 2.17.1 In-Reply-To: <20191206170821.29711-1-ulf.hansson@linaro.org> References: <20191206170821.29711-1-ulf.hansson@linaro.org> Sender: linux-mmc-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-mmc@vger.kernel.org Let's drop the boilerplate code for managing the default pinctrl state and convert into using the new pinctrl_select_default_state(). Cc: Jesper Nilsson Cc: Lars Persson Signed-off-by: Ulf Hansson Acked-by: Jesper Nilsson --- drivers/mmc/host/usdhi6rol0.c | 15 +-------------- 1 file changed, 1 insertion(+), 14 deletions(-) diff --git a/drivers/mmc/host/usdhi6rol0.c b/drivers/mmc/host/usdhi6rol0.c index b11ac2314328..969a34e698f2 100644 --- a/drivers/mmc/host/usdhi6rol0.c +++ b/drivers/mmc/host/usdhi6rol0.c @@ -199,7 +199,6 @@ struct usdhi6_host { /* Pin control */ struct pinctrl *pinctrl; - struct pinctrl_state *pins_default; struct pinctrl_state *pins_uhs; }; @@ -1162,8 +1161,7 @@ static int usdhi6_set_pinstates(struct usdhi6_host *host, int voltage) host->pins_uhs); default: - return pinctrl_select_state(host->pinctrl, - host->pins_default); + return pinctrl_select_default_state(mmc_dev(host->mmc)); } } @@ -1770,17 +1768,6 @@ static int usdhi6_probe(struct platform_device *pdev) } host->pins_uhs = pinctrl_lookup_state(host->pinctrl, "state_uhs"); - if (!IS_ERR(host->pins_uhs)) { - host->pins_default = pinctrl_lookup_state(host->pinctrl, - PINCTRL_STATE_DEFAULT); - - if (IS_ERR(host->pins_default)) { - dev_err(dev, - "UHS pinctrl requires a default pin state.\n"); - ret = PTR_ERR(host->pins_default); - goto e_free_mmc; - } - } res = platform_get_resource(pdev, IORESOURCE_MEM, 0); host->base = devm_ioremap_resource(dev, res); From patchwork Fri Dec 6 17:08:17 2019 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Ulf Hansson X-Patchwork-Id: 11276861 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 D5AD8109A for ; Fri, 6 Dec 2019 17:08:36 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by mail.kernel.org (Postfix) with ESMTP id B44DC20706 for ; Fri, 6 Dec 2019 17:08:36 +0000 (UTC) Authentication-Results: mail.kernel.org; dkim=pass (2048-bit key) header.d=linaro.org header.i=@linaro.org header.b="aJl+9hkZ" Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1726365AbfLFRIg (ORCPT ); Fri, 6 Dec 2019 12:08:36 -0500 Received: from mail-lf1-f67.google.com ([209.85.167.67]:33328 "EHLO mail-lf1-f67.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1726284AbfLFRIg (ORCPT ); Fri, 6 Dec 2019 12:08:36 -0500 Received: by mail-lf1-f67.google.com with SMTP id n25so5855943lfl.0 for ; Fri, 06 Dec 2019 09:08:34 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; h=from:to:cc:subject:date:message-id:in-reply-to:references; bh=P6wkq44hOUaRXToIbJJl7vWgcKUynxHObY8PwUP4zZ8=; b=aJl+9hkZMeoYw7Sp+Ah8kASUSXs35gClU8Xj3C5zggbrGrUybRnN7qlpEHJDlF5Aub 6j9/pXLqhVpsmPFKj3A6G12TKeJ5nGQlILdr8UpaSUpN6VedW63FVN5GvAQJKwHtTl/m blmWxjmifZV6TS7mSz8uWfOPxPD4bU5/ZR9Tw1cNZ9XWNRxK9CBH3ycpTHzDWrVGufwn VAowJ+1E9apNmpsOSk20Csw67uK06DkinJeyvRVl92hS7XLCBOEnqPHlDIpN30dstq8p 8TmX+Lm2foRKawEsnJ/NVYBIE1yC/ZiGC3GaypYVJEFczjWA4HLWY+EAhYK3rQrQf91v leRg== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:from:to:cc:subject:date:message-id:in-reply-to :references; bh=P6wkq44hOUaRXToIbJJl7vWgcKUynxHObY8PwUP4zZ8=; b=rXmuVQ4c5o3+9hTxoL8u8pGZQqAqDlsSbU8cmHnThuLyHugdQdssji0a835JZTSsis EubgX8VFfR437wNknRs5B4GxgXaxaq0sjAeXOw5Xo8WKJ0kQnjZkbY7apaeSBaHR1W2L T4mnxRHkYI7zDahJ0Adk7eMi9aJm/0O8XUHlKoOk57xAeGFrx2O52ga4J1+fRlz1bAFC AyfXh7eIujGAS+oWuKJ+iAehKC+LqSoxaLtJUHsOTbyB3mbMR0VspdTmgIzYQUY8gk0u 3Uo9M4zcQKQDxpzGfhMlyiosITQoVqC9CIiGeVlCnhvPfmu5VpK4Bdl0/4wsqFfnQ3d+ kDJg== X-Gm-Message-State: APjAAAWNHeuYtv0LzNAat2k7XHqaFezCiPRQuiJ7aXCITVRiVtWo5y2P zyAhSifow9Tq8JfTda5BCJ0vRbO2rcg= X-Google-Smtp-Source: APXvYqyXQ/7aXhzLUKmtOFra4sQxFySjBivrm4MghpcnnI5es3eI5GzwgETumQKWJxEB5uEyttz3xg== X-Received: by 2002:ac2:5a43:: with SMTP id r3mr9042656lfn.150.1575652113906; Fri, 06 Dec 2019 09:08:33 -0800 (PST) Received: from localhost.localdomain (h-158-174-22-210.NA.cust.bahnhof.se. [158.174.22.210]) by smtp.gmail.com with ESMTPSA id z9sm6905283ljm.40.2019.12.06.09.08.32 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Fri, 06 Dec 2019 09:08:32 -0800 (PST) From: Ulf Hansson To: linux-gpio@vger.kernel.org, Linus Walleij Cc: linux-mmc@vger.kernel.org, Ulf Hansson Subject: [PATCH 5/9] mmc: omap_hsmmc: Convert to pinctrl_select_default_state() Date: Fri, 6 Dec 2019 18:08:17 +0100 Message-Id: <20191206170821.29711-6-ulf.hansson@linaro.org> X-Mailer: git-send-email 2.17.1 In-Reply-To: <20191206170821.29711-1-ulf.hansson@linaro.org> References: <20191206170821.29711-1-ulf.hansson@linaro.org> Sender: linux-mmc-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-mmc@vger.kernel.org Let's drop the boilerplate code for managing the default pinctrl state and convert into using the new pinctrl_select_default_state(). Additionally, move away from using pinctrl_pm_select_default_state() as it's scheduled for removal and use pinctrl_select_default_state() instead. Signed-off-by: Ulf Hansson --- drivers/mmc/host/omap_hsmmc.c | 10 ++-------- 1 file changed, 2 insertions(+), 8 deletions(-) diff --git a/drivers/mmc/host/omap_hsmmc.c b/drivers/mmc/host/omap_hsmmc.c index 767e964ca5a2..a379c45b985c 100644 --- a/drivers/mmc/host/omap_hsmmc.c +++ b/drivers/mmc/host/omap_hsmmc.c @@ -1605,12 +1605,6 @@ static int omap_hsmmc_configure_wake_irq(struct omap_hsmmc_host *host) ret = PTR_ERR(p); goto err_free_irq; } - if (IS_ERR(pinctrl_lookup_state(p, PINCTRL_STATE_DEFAULT))) { - dev_info(host->dev, "missing default pinctrl state\n"); - devm_pinctrl_put(p); - ret = -EINVAL; - goto err_free_irq; - } if (IS_ERR(pinctrl_lookup_state(p, PINCTRL_STATE_IDLE))) { dev_info(host->dev, "missing idle pinctrl state\n"); @@ -2153,14 +2147,14 @@ static int omap_hsmmc_runtime_resume(struct device *dev) if ((host->mmc->caps & MMC_CAP_SDIO_IRQ) && (host->flags & HSMMC_SDIO_IRQ_ENABLED)) { - pinctrl_pm_select_default_state(host->dev); + pinctrl_select_default_state(host->dev); /* irq lost, if pinmux incorrect */ OMAP_HSMMC_WRITE(host->base, STAT, STAT_CLEAR); OMAP_HSMMC_WRITE(host->base, ISE, CIRQ_EN); OMAP_HSMMC_WRITE(host->base, IE, CIRQ_EN); } else { - pinctrl_pm_select_default_state(host->dev); + pinctrl_select_default_state(host->dev); } spin_unlock_irqrestore(&host->irq_lock, flags); return 0; From patchwork Fri Dec 6 17:08:18 2019 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Ulf Hansson X-Patchwork-Id: 11276863 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 440566C1 for ; Fri, 6 Dec 2019 17:08:38 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by mail.kernel.org (Postfix) with ESMTP id 229F724659 for ; Fri, 6 Dec 2019 17:08:38 +0000 (UTC) Authentication-Results: mail.kernel.org; dkim=pass (2048-bit key) header.d=linaro.org header.i=@linaro.org header.b="dzqIxUO7" Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1726374AbfLFRIh (ORCPT ); Fri, 6 Dec 2019 12:08:37 -0500 Received: from mail-lj1-f195.google.com ([209.85.208.195]:37076 "EHLO mail-lj1-f195.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1726298AbfLFRIh (ORCPT ); Fri, 6 Dec 2019 12:08:37 -0500 Received: by mail-lj1-f195.google.com with SMTP id u17so8433661lja.4 for ; Fri, 06 Dec 2019 09:08:35 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; h=from:to:cc:subject:date:message-id:in-reply-to:references; bh=fTEyh8XCr6qWiWO+Sm26auA9jej3JxBZE/rL5aBzRVY=; b=dzqIxUO7WxQk+plB0N+sxpgJHd9B7Gqjohrdy/hCB+cGg3rfhemNz+2LL8EssKd0MV upCGcYGQYMVNMExbGvN7Qreozlys4r8Q/t+j3QoLCQiSB1xykzvEJ9SOmOISwrA1jlvp 4YqHPRHa85RcGLnuhvUzfCGVkvNFoPHGWUjCMMR7Bjm70zmoMVHvm9rSqeqBhF5pJYET uu3CXmcUMAhftU9pWR0U+AkR1SxsikEKY2Lc1bWHLNgIODEP1QqxizVF1LdyzMUtxcHJ gV5lyhhxeEnapF91t37e5JauaL/D9OqEQjGP+GtxsJTJJaE5TXiESw07H2QqV8NtezBg RuGQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:from:to:cc:subject:date:message-id:in-reply-to :references; bh=fTEyh8XCr6qWiWO+Sm26auA9jej3JxBZE/rL5aBzRVY=; b=IvDy/yr3Sk49/OjVtqTvirOAyhP9yGFUJcTdslkXNCQpKNKkppmCPLfVcnL/6JU/Wj dxUtukz1c8k6QdHXxG7QmJ7cQZv+rBbkq+0H/LzxS/ABU9uEp4goZSo2mKFAAziAo2eo kPrO9p0r7oRUVDx8rsQ4EXDSZekOtlASxnhVq5VyMhE7MSXLTKZAlQnnf6D0FMj84yF0 mpQgUpEJ3FndCCX+tCfli/eIqJfn6N3hSOkaWwNfhnrBw1iDs0KmeSGwQDuihJwfQdLe sf7ne7q8dWPjC5CmExWMkFveno5LaNj29xJ7OVu5bC48otjgMCIY3EA20Yyyw362xCmA Oylg== X-Gm-Message-State: APjAAAWBjLX7hNyA+0kfbrh3f//x1Y8kf3FfbIB35IVHbKFcz4Gy+/PZ 8zYeBOtzO05Bpsk8u7t6A6Mi6g== X-Google-Smtp-Source: APXvYqx2YUEFT3CYqRkqrCF50CxYbiVYSIL4MAtnnjeQmuc33zVtu9572g9p4vEVQvm8MMy9E6jTOQ== X-Received: by 2002:a05:651c:1110:: with SMTP id d16mr9527832ljo.86.1575652115109; Fri, 06 Dec 2019 09:08:35 -0800 (PST) Received: from localhost.localdomain (h-158-174-22-210.NA.cust.bahnhof.se. [158.174.22.210]) by smtp.gmail.com with ESMTPSA id z9sm6905283ljm.40.2019.12.06.09.08.33 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Fri, 06 Dec 2019 09:08:34 -0800 (PST) From: Ulf Hansson To: linux-gpio@vger.kernel.org, Linus Walleij Cc: linux-mmc@vger.kernel.org, Ulf Hansson , Adrian Hunter Subject: [PATCH 6/9] mmc: sdhci-esdhc-imx: Convert to pinctrl_select_default_state() Date: Fri, 6 Dec 2019 18:08:18 +0100 Message-Id: <20191206170821.29711-7-ulf.hansson@linaro.org> X-Mailer: git-send-email 2.17.1 In-Reply-To: <20191206170821.29711-1-ulf.hansson@linaro.org> References: <20191206170821.29711-1-ulf.hansson@linaro.org> Sender: linux-mmc-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-mmc@vger.kernel.org Let's drop the boilerplate code for managing the default pinctrl state and convert into using the new pinctrl_select_default_state(). Cc: Adrian Hunter Signed-off-by: Ulf Hansson --- drivers/mmc/host/sdhci-esdhc-imx.c | 11 ++--------- 1 file changed, 2 insertions(+), 9 deletions(-) diff --git a/drivers/mmc/host/sdhci-esdhc-imx.c b/drivers/mmc/host/sdhci-esdhc-imx.c index 1c988d6a2433..43628c9c05ac 100644 --- a/drivers/mmc/host/sdhci-esdhc-imx.c +++ b/drivers/mmc/host/sdhci-esdhc-imx.c @@ -224,7 +224,6 @@ static struct esdhc_soc_data usdhc_imx8qxp_data = { struct pltfm_imx_data { u32 scratchpad; struct pinctrl *pinctrl; - struct pinctrl_state *pins_default; struct pinctrl_state *pins_100mhz; struct pinctrl_state *pins_200mhz; const struct esdhc_soc_data *socdata; @@ -951,7 +950,6 @@ static int esdhc_change_pinstate(struct sdhci_host *host, dev_dbg(mmc_dev(host->mmc), "change pinctrl state for uhs %d\n", uhs); if (IS_ERR(imx_data->pinctrl) || - IS_ERR(imx_data->pins_default) || IS_ERR(imx_data->pins_100mhz) || IS_ERR(imx_data->pins_200mhz)) return -EINVAL; @@ -968,7 +966,7 @@ static int esdhc_change_pinstate(struct sdhci_host *host, break; default: /* back to default state for other legacy timing */ - pinctrl = imx_data->pins_default; + return pinctrl_select_default_state(mmc_dev(host->mmc)); } return pinctrl_select_state(imx_data->pinctrl, pinctrl); @@ -1338,7 +1336,7 @@ sdhci_esdhc_imx_probe_dt(struct platform_device *pdev, mmc_of_parse_voltage(np, &host->ocr_mask); - if (esdhc_is_usdhc(imx_data) && !IS_ERR(imx_data->pins_default)) { + if (esdhc_is_usdhc(imx_data)) { imx_data->pins_100mhz = pinctrl_lookup_state(imx_data->pinctrl, ESDHC_PINCTRL_STATE_100MHZ); imx_data->pins_200mhz = pinctrl_lookup_state(imx_data->pinctrl, @@ -1492,11 +1490,6 @@ static int sdhci_esdhc_imx_probe(struct platform_device *pdev) goto disable_ahb_clk; } - imx_data->pins_default = pinctrl_lookup_state(imx_data->pinctrl, - PINCTRL_STATE_DEFAULT); - if (IS_ERR(imx_data->pins_default)) - dev_warn(mmc_dev(host->mmc), "could not get default state\n"); - if (esdhc_is_usdhc(imx_data)) { host->quirks2 |= SDHCI_QUIRK2_PRESET_VALUE_BROKEN; host->mmc->caps |= MMC_CAP_1_8V_DDR | MMC_CAP_3_3V_DDR; From patchwork Fri Dec 6 17:08:19 2019 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Ulf Hansson X-Patchwork-Id: 11276865 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 2B375109A for ; Fri, 6 Dec 2019 17:08:39 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by mail.kernel.org (Postfix) with ESMTP id 0954120706 for ; Fri, 6 Dec 2019 17:08:39 +0000 (UTC) Authentication-Results: mail.kernel.org; dkim=pass (2048-bit key) header.d=linaro.org header.i=@linaro.org header.b="snB1J2mQ" Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1726353AbfLFRIi (ORCPT ); Fri, 6 Dec 2019 12:08:38 -0500 Received: from mail-lf1-f68.google.com ([209.85.167.68]:34685 "EHLO mail-lf1-f68.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1726352AbfLFRIi (ORCPT ); Fri, 6 Dec 2019 12:08:38 -0500 Received: by mail-lf1-f68.google.com with SMTP id l18so5837548lfc.1 for ; Fri, 06 Dec 2019 09:08:37 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; h=from:to:cc:subject:date:message-id:in-reply-to:references; bh=R1ZcHKxjvTnD8f3+qXHmLK/liysdFzY/2mwIKJWbEjE=; b=snB1J2mQrwDed9vQ6dC7Zl+t4YtzNd5l9Upj8oNjM6oJzNZYShdR5A2u7Uf4d8piVe ICKb0Yw5W99EiVzQ6JxolBAAv1ZPe7hCDC7pQYW4KjGuEfSlL8bp7pUsC37B00rIlTfz HRvvLDnAw8oqf37WZX0j+ulFexLFRnbWCXupnlPlKm5JFbhu/ugKngduVGfCDHwE0VtF rY5GuY8KP8kVhaq0TTGMlQUkWNle6c8OVZmEwIODywqHXAiXl8CU11Xc+iyaKTj5WFwI gm+o+p2oZTRWv9o3FLXyXYWx1ArZhK65Z7JSAE0khVc89dbxrgxf/0mTmz9Zwnm4Mf1D YYDQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:from:to:cc:subject:date:message-id:in-reply-to :references; bh=R1ZcHKxjvTnD8f3+qXHmLK/liysdFzY/2mwIKJWbEjE=; b=N2F+SGttnL8m/+x7nxsf+K+b9Br0iNIT6nN3+50cdedh/zuEg74LJoJbG+pUHn6+50 JT9AVwKuTiRsa1OAmpZiNI9EQztZ7RtCKbmQAkLjDSR96Mca9V8VumyjoYBoMrYnCzZY CElqb8Weu7vgUIHNsanZUsalfkl2Syfv4+uZGBQWqh5K67AnMntZDCcSpi+0+2dwxWg9 xpw7maF05e2DZGeHMH1P94dVz4Y9ecbH011W/9OrVN4mRsmdVb3vKAGRCuPObCL0C4oj bO3BZRfNCFsuZD0+OLIJPQ9sWGiwT75PnFCaNTd1u1lzJrOilD4ZOO+BYZo/k2NrX462 OTaQ== X-Gm-Message-State: APjAAAX17iisbkXCXYhtnsSqXzDgkvALZCutqaW0Iq94yVNk0MlDjbkU 5G8awFsAnaaLDEzhAVTFk7R73w== X-Google-Smtp-Source: APXvYqz68RutBNs8ELGrRiZRQRVsDFRU3p8tRW4dh1jrbOiSBjEa5lEhO3eZJ3iaO+K/4017KdQj6g== X-Received: by 2002:ac2:4c31:: with SMTP id u17mr8586630lfq.57.1575652116371; Fri, 06 Dec 2019 09:08:36 -0800 (PST) Received: from localhost.localdomain (h-158-174-22-210.NA.cust.bahnhof.se. [158.174.22.210]) by smtp.gmail.com with ESMTPSA id z9sm6905283ljm.40.2019.12.06.09.08.35 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Fri, 06 Dec 2019 09:08:35 -0800 (PST) From: Ulf Hansson To: linux-gpio@vger.kernel.org, Linus Walleij Cc: linux-mmc@vger.kernel.org, Ulf Hansson , Ludovic Desroches Subject: [PATCH 7/9] mmc: atmel-mci: Convert to pinctrl_select_default_state() Date: Fri, 6 Dec 2019 18:08:19 +0100 Message-Id: <20191206170821.29711-8-ulf.hansson@linaro.org> X-Mailer: git-send-email 2.17.1 In-Reply-To: <20191206170821.29711-1-ulf.hansson@linaro.org> References: <20191206170821.29711-1-ulf.hansson@linaro.org> Sender: linux-mmc-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-mmc@vger.kernel.org Let's move away from using pinctrl_pm_select_default_state() as it's scheduled for removal and use pinctrl_select_default_state() instead. Cc: Ludovic Desroches Signed-off-by: Ulf Hansson --- drivers/mmc/host/atmel-mci.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/drivers/mmc/host/atmel-mci.c b/drivers/mmc/host/atmel-mci.c index 6f065bb5c55a..aeaaa5314924 100644 --- a/drivers/mmc/host/atmel-mci.c +++ b/drivers/mmc/host/atmel-mci.c @@ -2645,7 +2645,7 @@ static int atmci_runtime_resume(struct device *dev) { struct atmel_mci *host = dev_get_drvdata(dev); - pinctrl_pm_select_default_state(dev); + pinctrl_select_default_state(dev); return clk_prepare_enable(host->mck); } From patchwork Fri Dec 6 17:08:20 2019 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Ulf Hansson X-Patchwork-Id: 11276867 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 7CAF8109A for ; Fri, 6 Dec 2019 17:08:40 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by mail.kernel.org (Postfix) with ESMTP id 595A621835 for ; Fri, 6 Dec 2019 17:08:40 +0000 (UTC) Authentication-Results: mail.kernel.org; dkim=pass (2048-bit key) header.d=linaro.org header.i=@linaro.org header.b="T3j6q9yy" Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1726377AbfLFRIk (ORCPT ); Fri, 6 Dec 2019 12:08:40 -0500 Received: from mail-lf1-f68.google.com ([209.85.167.68]:34687 "EHLO mail-lf1-f68.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1726298AbfLFRIj (ORCPT ); Fri, 6 Dec 2019 12:08:39 -0500 Received: by mail-lf1-f68.google.com with SMTP id l18so5837599lfc.1 for ; Fri, 06 Dec 2019 09:08:38 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; h=from:to:cc:subject:date:message-id:in-reply-to:references; bh=xG/TtMVmPt3YpqGKMEzSfHDWIvjefdWJoE6sWzREm9w=; b=T3j6q9yyJwGRnHfgLKReG38xnZcDjDAGoSs4KkNm6DxdV9IJWSMvIgc8IuTjgqPy2x XQnBk+IP+wLfnwBxIcr+A7ZjXoF4jLZHI55vCBxYMfUM/EPGh1AzGSzLcR/XDlfVs2F9 fxgoiqzdo7IT16q1CPsWg2HXv600IRpsmwp69Wke0RU15Yqsd3DODVLEYPzq/aSPB482 KOl827S/v2o5NJiqDzXxu31GgDYWGNofv06JMYca67U8AFSQ2DjktV0d0T2ELYHAINrB smMvP4jXvNW8YxnoaoPLvoSq4V0qlCYzwZRCvqdxzJfltyF7Lfr3VJEcu4/jAeV4vas/ 0jgQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:from:to:cc:subject:date:message-id:in-reply-to :references; bh=xG/TtMVmPt3YpqGKMEzSfHDWIvjefdWJoE6sWzREm9w=; b=d+Q4mefMVJMGekXDXNVm0EEqoaqMR9e/7+X07WMJo2V7efPAegHXm/KokjoiQ9Ch2g SSn6I0H8OLhnAomp6LMWPdNmzVbPKCxtW7TLIAedypP+ksz3Fp0nThUB4/V48GollM/j zxVfluGkUFYJHuwSvJWbeO5TXkreGJ/1NU4K9KftFTUoLZiNSOWDMjX0ma9FeXn0yCYL grgDIgOJYZq1G+EVe2W7TBtio3NFCHrQvxOTR/bidDEBbi2/KG/FsVx0qMfCpU9e3Q9o OA1lw1xmUWYwwUYwQWH736frGV+iX7yqQCdGmyLfm6NmAaQpaEEhVJrS1mzSWeHysxZe mSog== X-Gm-Message-State: APjAAAWahknCmjq9c1T2oiUvQhos4kNcQQaxLpi0ae4iIqTi49/v5jBD J/WjxNNrYTWVQXNniBkzKCfmtw== X-Google-Smtp-Source: APXvYqx+65bHTzp79RZZPbKO9pZhUqV0hmJgvWeR0vfzi0w5W1n7PA9yW/kjlvKOR9fmTzlvKt4jgQ== X-Received: by 2002:a05:6512:284:: with SMTP id j4mr8351775lfp.109.1575652117781; Fri, 06 Dec 2019 09:08:37 -0800 (PST) Received: from localhost.localdomain (h-158-174-22-210.NA.cust.bahnhof.se. [158.174.22.210]) by smtp.gmail.com with ESMTPSA id z9sm6905283ljm.40.2019.12.06.09.08.36 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Fri, 06 Dec 2019 09:08:37 -0800 (PST) From: Ulf Hansson To: linux-gpio@vger.kernel.org, Linus Walleij Cc: linux-mmc@vger.kernel.org, Ulf Hansson , Paul Cercueil Subject: [PATCH 8/9] mmc: jz4740: Convert to pinctrl_select_default_state() Date: Fri, 6 Dec 2019 18:08:20 +0100 Message-Id: <20191206170821.29711-9-ulf.hansson@linaro.org> X-Mailer: git-send-email 2.17.1 In-Reply-To: <20191206170821.29711-1-ulf.hansson@linaro.org> References: <20191206170821.29711-1-ulf.hansson@linaro.org> Sender: linux-mmc-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-mmc@vger.kernel.org Let's move away from using pinctrl_pm_select_default_state() as it's scheduled for removal and use pinctrl_select_default_state() instead. Cc: Paul Cercueil Signed-off-by: Ulf Hansson Acked-by: Paul Cercueil Acked-by: Linus Walleij --- drivers/mmc/host/jz4740_mmc.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/drivers/mmc/host/jz4740_mmc.c b/drivers/mmc/host/jz4740_mmc.c index 78383f60a3dc..fbae87d1f017 100644 --- a/drivers/mmc/host/jz4740_mmc.c +++ b/drivers/mmc/host/jz4740_mmc.c @@ -1108,7 +1108,7 @@ static int jz4740_mmc_suspend(struct device *dev) static int jz4740_mmc_resume(struct device *dev) { - return pinctrl_pm_select_default_state(dev); + return pinctrl_select_default_state(dev); } static SIMPLE_DEV_PM_OPS(jz4740_mmc_pm_ops, jz4740_mmc_suspend, From patchwork Fri Dec 6 17:08:21 2019 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Ulf Hansson X-Patchwork-Id: 11276869 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 D5A0C6C1 for ; Fri, 6 Dec 2019 17:08:41 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by mail.kernel.org (Postfix) with ESMTP id B47CE24659 for ; Fri, 6 Dec 2019 17:08:41 +0000 (UTC) Authentication-Results: mail.kernel.org; dkim=pass (2048-bit key) header.d=linaro.org header.i=@linaro.org header.b="X9+uU+AY" Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1726352AbfLFRIl (ORCPT ); Fri, 6 Dec 2019 12:08:41 -0500 Received: from mail-lj1-f194.google.com ([209.85.208.194]:38852 "EHLO mail-lj1-f194.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1726371AbfLFRIl (ORCPT ); Fri, 6 Dec 2019 12:08:41 -0500 Received: by mail-lj1-f194.google.com with SMTP id k8so8414782ljh.5 for ; Fri, 06 Dec 2019 09:08:39 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; h=from:to:cc:subject:date:message-id:in-reply-to:references; bh=Bena7hxM6Q5CJen1XKF9/qXFjbtAx0rdagpDLN6ovkc=; b=X9+uU+AYohCgYCEkPNcJ5fhTjP243QbHdbgFzdpvm7JZMjhzz7TPWGnPWgcRm69nGz jsvzcimEHNE5dwSluVSH6tk2OnrsVGfoHOaIlFpN3nlEGAXx3qTfRKj7q7knpSMLJ0pJ qky1f5fry4paJxZLbulff8VP3rb/8yDaceyR9hRoc5+10MW0CW+ezcawH2lomDLs94GD rSBR3tfVGbgCRFvFlC0osU4As2yBRTqMsHz49weRtD7FanceXxm3VI2QLzr5iPOYZf/G twvactJN9GSLPbml17ZFHwSMwybk0VDyJYaEpjlY3iJa6sVXuNBePPSKzMsvgp/j+hkZ kcvg== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:from:to:cc:subject:date:message-id:in-reply-to :references; bh=Bena7hxM6Q5CJen1XKF9/qXFjbtAx0rdagpDLN6ovkc=; b=kemNxdpu5varPlMfZECsz/BsU+0FsVeFExb/a7LNYfDqZzSm7/c/ub4pFlxWlOHncE 4YU/RWmGfq6xHXQWyq44ndWMWPmHZCPZ0iYx4qtL7GJVzaIP6XN9WJY5UJxs5xOrlIsV dbWPPIsEQqDKUgkGRdCSe55nGVfqG0RVPGqkoMbDqO3EWLHqMCefz/naTZBaBXMgIkp9 Rq9iKboCQdTgzakki9bOSIlUCRm5p1QObY4jdu7kybnLfBinUsmnVC9Nm9/aZdduEDmt HDlLn4z19evuJpzRUQSSdNsE7lDxzgYU/hTqhJgo9riYroiHyoqRsXxA5+xHXfE4mMJ4 /apA== X-Gm-Message-State: APjAAAWHW0B686+OXyfroCO7LvwZ9XwgOZ+v8eIuCNsO46a8LuN3VmJF 5X1hZ//orIk6R44gSbiBXuC0fg== X-Google-Smtp-Source: APXvYqyzRis2mN3JfJuOhE7couVt+BvfwzvIsTBrVXasuhhX9uFysTzSF44YDY3ZqVA+ggR5Nir32Q== X-Received: by 2002:a2e:9b55:: with SMTP id o21mr7778784ljj.147.1575652118999; Fri, 06 Dec 2019 09:08:38 -0800 (PST) Received: from localhost.localdomain (h-158-174-22-210.NA.cust.bahnhof.se. [158.174.22.210]) by smtp.gmail.com with ESMTPSA id z9sm6905283ljm.40.2019.12.06.09.08.38 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Fri, 06 Dec 2019 09:08:38 -0800 (PST) From: Ulf Hansson To: linux-gpio@vger.kernel.org, Linus Walleij Cc: linux-mmc@vger.kernel.org, Ulf Hansson , Masahiro Yamada Subject: [PATCH 9/9] mmc: uniphier-sd: Convert to pinctrl_select_default_state() Date: Fri, 6 Dec 2019 18:08:21 +0100 Message-Id: <20191206170821.29711-10-ulf.hansson@linaro.org> X-Mailer: git-send-email 2.17.1 In-Reply-To: <20191206170821.29711-1-ulf.hansson@linaro.org> References: <20191206170821.29711-1-ulf.hansson@linaro.org> Sender: linux-mmc-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-mmc@vger.kernel.org Let's drop the boilerplate code for managing the default pinctrl state and convert into using the new pinctrl_select_default_state(). Cc: Masahiro Yamada Signed-off-by: Ulf Hansson Acked-by: Masahiro Yamada --- drivers/mmc/host/uniphier-sd.c | 14 +++++--------- 1 file changed, 5 insertions(+), 9 deletions(-) diff --git a/drivers/mmc/host/uniphier-sd.c b/drivers/mmc/host/uniphier-sd.c index 0c72ec5546c3..a1683c49cb90 100644 --- a/drivers/mmc/host/uniphier-sd.c +++ b/drivers/mmc/host/uniphier-sd.c @@ -59,7 +59,6 @@ struct uniphier_sd_priv { struct tmio_mmc_data tmio_data; struct pinctrl *pinctrl; - struct pinctrl_state *pinstate_default; struct pinctrl_state *pinstate_uhs; struct clk *clk; struct reset_control *rst; @@ -500,13 +499,12 @@ static int uniphier_sd_start_signal_voltage_switch(struct mmc_host *mmc, { struct tmio_mmc_host *host = mmc_priv(mmc); struct uniphier_sd_priv *priv = uniphier_sd_priv(host); - struct pinctrl_state *pinstate; + struct pinctrl_state *pinstate = NULL; u32 val, tmp; switch (ios->signal_voltage) { case MMC_SIGNAL_VOLTAGE_330: val = UNIPHIER_SD_VOLT_330; - pinstate = priv->pinstate_default; break; case MMC_SIGNAL_VOLTAGE_180: val = UNIPHIER_SD_VOLT_180; @@ -521,7 +519,10 @@ static int uniphier_sd_start_signal_voltage_switch(struct mmc_host *mmc, tmp |= FIELD_PREP(UNIPHIER_SD_VOLT_MASK, val); writel(tmp, host->ctl + UNIPHIER_SD_VOLT); - pinctrl_select_state(priv->pinctrl, pinstate); + if (pinstate) + pinctrl_select_state(priv->pinctrl, pinstate); + else + pinctrl_select_default_state(mmc_dev(mmc)); return 0; } @@ -533,11 +534,6 @@ static int uniphier_sd_uhs_init(struct tmio_mmc_host *host, if (IS_ERR(priv->pinctrl)) return PTR_ERR(priv->pinctrl); - priv->pinstate_default = pinctrl_lookup_state(priv->pinctrl, - PINCTRL_STATE_DEFAULT); - if (IS_ERR(priv->pinstate_default)) - return PTR_ERR(priv->pinstate_default); - priv->pinstate_uhs = pinctrl_lookup_state(priv->pinctrl, "uhs"); if (IS_ERR(priv->pinstate_uhs)) return PTR_ERR(priv->pinstate_uhs);