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: 180929 Delivered-To: patches@linaro.org Received: by 2002:a92:3001:0:0:0:0:0 with SMTP id x1csp1054016ile; Fri, 6 Dec 2019 09:08:29 -0800 (PST) X-Received: by 2002:ac2:44d9:: with SMTP id d25mr1901450lfm.15.1575652109529; Fri, 06 Dec 2019 09:08:29 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1575652109; cv=none; d=google.com; s=arc-20160816; b=WNgXYjCg/W6pNo1WI8yOSxKy7AwU5exC2axlDewNVKcgDXIhaPwcVYGnlkEQtPFo9a yWEFaLv19HbfYVLSrKPXIV7OJibA7PvcBqFJqQ5ivaKLoLK0QLz158Tl62mGkOkYQcRI LCI/paTj9F87PwnOZGgUiUdmEHrj57szlbAs2mWZTL9mA2To/KVLlT+1qonfMsTe0+C+ K4V+A3ukipCwVE/xxD6XY06Bk2zsK+T9/GTuDU494u0JBQDtTSbBKgIA5jMPrDwvRkhW zVUWKd/+Vizjy6nx/qBv5glDMi8QA1Sx1RAhqUZwfJAZbr+zhk5zaYS26prlHfDahsKm k7og== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=references:in-reply-to:message-id:date:subject:cc:to:from :dkim-signature; bh=Tc0ll2qvZbYOgB1NJXHvXGod64HQcRRr8FCccHB+Mbo=; b=v6hHWsOAFcPHXnrxZLkPYmNOdqN3vI2mYRihTFXomM7GLdAtjHdt2uee11ZJ2gwN5W mP9LfHd9Lmqe0Z5QgDZDCjV9rBjdhUPcz0Um12CJpOz91zoE/czhx+PnDRvL/rxdyGDL Ci2HPZtxsQzbqDt+dMDWmQp3O/ryAxyJTrY+7JwUxslyIz5GRrIugS55+nPuyOv5aHzB 79Q6/+avgVKikku6a4v+hwMyIHNBVLu4IKszrgUH4Gt4Nu08YK6WPMujwNCNaMpn2GMd 93as0Q1w+qI5wRNgwZG9TAP1N5z6zB2ZvnhYZJbLkjYHAtTrVOOrmT18dnMDp9kMpq3l sxZg== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b="UVN+/T66"; spf=pass (google.com: domain of ulf.hansson@linaro.org designates 209.85.220.65 as permitted sender) smtp.mailfrom=ulf.hansson@linaro.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=linaro.org Return-Path: Received: from mail-sor-f65.google.com (mail-sor-f65.google.com. [209.85.220.65]) by mx.google.com with SMTPS id z22sor9758940ljk.32.2019.12.06.09.08.29 for (Google Transport Security); Fri, 06 Dec 2019 09:08:29 -0800 (PST) Received-SPF: pass (google.com: domain of ulf.hansson@linaro.org designates 209.85.220.65 as permitted sender) client-ip=209.85.220.65; Authentication-Results: mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b="UVN+/T66"; spf=pass (google.com: domain of ulf.hansson@linaro.org designates 209.85.220.65 as permitted sender) smtp.mailfrom=ulf.hansson@linaro.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=linaro.org 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=MRoeWBdHtco9CgHseipgJzpfyj8a3rEi2PjoUUYVv/Us5uLFLnZtGdkivTyybsY0Sm Hj6OXcfp8173vdN9bO8INEUfBn+nPDwce9Er0IX+tRFwk9Z9TI/V7MrTrBX0Jc+snp3Q M9mcqX/7JS009toHL1FymfF1eEf9gW/4fGQP5DMBORzmOajGjdp7wbE/weTK6+pZPOvc wsXliaK3IUmjEzOWOsl/eB/Gk/S6x6CtXkOyqjEEu82GAGZkx5AqvpJq+C/Tqn6CqMuY 9dEYRqbvyD53+lSGcz1xAqEFQNa3gv8t7zbRRHYl1QPZV5UCJNzFdoXmFI9eJykzdRz1 c44Q== X-Gm-Message-State: APjAAAUtXp83FIDBRg+snW7m6uu5YGEIWSa7R1hFhpEe4JJZufmOETK7 OKvjSOSpMA+LnKCtSNxIb7YBbF4F 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) Return-Path: 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> 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(-) -- 2.17.1 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: 180930 Delivered-To: patches@linaro.org Received: by 2002:a92:3001:0:0:0:0:0 with SMTP id x1csp1054030ile; Fri, 6 Dec 2019 09:08:30 -0800 (PST) X-Received: by 2002:a19:4906:: with SMTP id w6mr8678472lfa.168.1575652110470; Fri, 06 Dec 2019 09:08:30 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1575652110; cv=none; d=google.com; s=arc-20160816; b=So1C+9+ciI4e52Tbe5T5MoDOrmEjv+lkAqpuK1CuamcfCMyw4IPm6qtPxQCpJElm6Y Oum5lfzoIv/78ipTMwEwdfM3rZF+xQyRtNqxSqWRkdRUmMKcKGRA7K//r0cw4ydN3EkX Eo2Umz0RDMmrPb1pzA/IOOKnw5Ad5bnJeWxsPhz8sAIC0bVogOsQGc/nt6BWh+AUvjLq GSKwJkco1UbzeyaAhX3pnZz8M9RFnkzqUJmst+Cudap8xg8jKEmvsO5j7+P0AGNY3Q3x fFL3xPqyURn4l9RPGKP28Mzp6dkQLHIrxgiYKLW/hbrpx6AT9MhdIfzH7kX2UoITa9Z9 eGgQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=references:in-reply-to:message-id:date:subject:cc:to:from :dkim-signature; bh=O8WqN3lnEyD9AJPmC5ibEKsr/6UO7fhL7XDNvCov7/A=; b=ndDqRTLIYV4kBWxDLl7GBeFzNrK8Vjkun48HvwtujUC+AXsTcNe/TGZmJRJx6QJtK7 IlIGec0LDdLItF3z9puN5zLq2Sxw6BqBH43HvFpDGsVh7TXvpeiRRNlEgSLLTGCL4OCP K3nzukbyK3dSLCdvFcT4HTUgDrNTnxcc3yoIV5M3k44it1WmB3i5FSLRqaTXLwqYMcFK uF85E4HMQpygXcUixD+hGRLcVQAumwcE/mL9LllAJ4+2YeBD/3/XSEGf3Q+tJ6xR0P31 wkxKcS1Gys2mLL9OyBWc09uQcCfHcEFWNIKSXbRk7ZUVRQTS8AZn60w6mJG9zgz/w76J ODsQ== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b=Q44gSt2T; spf=pass (google.com: domain of ulf.hansson@linaro.org designates 209.85.220.65 as permitted sender) smtp.mailfrom=ulf.hansson@linaro.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=linaro.org Return-Path: Received: from mail-sor-f65.google.com (mail-sor-f65.google.com. [209.85.220.65]) by mx.google.com with SMTPS id t4sor484526lff.42.2019.12.06.09.08.30 for (Google Transport Security); Fri, 06 Dec 2019 09:08:30 -0800 (PST) Received-SPF: pass (google.com: domain of ulf.hansson@linaro.org designates 209.85.220.65 as permitted sender) client-ip=209.85.220.65; Authentication-Results: mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b=Q44gSt2T; spf=pass (google.com: domain of ulf.hansson@linaro.org designates 209.85.220.65 as permitted sender) smtp.mailfrom=ulf.hansson@linaro.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=linaro.org 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=WmcSCgUFIUGYjmLCY5y3u9SHrGMm6S+5zL8y9PFvkwFYfspFD8SXXYrTWGZ6N1KFuE qontWLuo6UN/HboiBx+PrrjSOk8Ydljwfw7yntzIovqLOU5n8n4sbWvXkGn6Bkf3DnKR E3IRYLH/r7YYegSa5UhiBRCaprYbOtrUIkcD1HRkcv2CQNxAep7GFhW6K9YlD1S2DETU 1QjqPW5tZFFxISqwyAZdwYdLguzm4BWwXx5b5Tz3IQJAfEOAu6bgbon6yXJmfPx3X97u soG78u1h8TvzIlCK+1lv2VFuQ6XmkvXFdE4KUcotXHeSvLe+CwUOZZ5qITVQXCP9Ho92 591Q== X-Gm-Message-State: APjAAAWApOKbwZBIjf900pSNR4bB55jRipiT6ayir3cZujT39RREkjOV U7NnC2eMbttB78eXIUfkn55KCssy 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) Return-Path: 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> 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 --- drivers/mmc/host/meson-gx-mmc.c | 10 +--------- 1 file changed, 1 insertion(+), 9 deletions(-) -- 2.17.1 Reviewed-by: Jerome Brunet 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: 180931 Delivered-To: patches@linaro.org Received: by 2002:a92:3001:0:0:0:0:0 with SMTP id x1csp1054058ile; Fri, 6 Dec 2019 09:08:31 -0800 (PST) X-Received: by 2002:a2e:9e55:: with SMTP id g21mr9067889ljk.245.1575652111640; Fri, 06 Dec 2019 09:08:31 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1575652111; cv=none; d=google.com; s=arc-20160816; b=Z+EMjMUYSsA5Y4IETN/bZAP8slHlTBgwUOEEqANsONrc61kKXoMPeS4t/8kDnMnJXJ Pq8cKlv68hcLLG3ohSjhhK3M8tSCj1jHbrsaip+NTxPmshQym2aX4aAerttYOpLkiLMg DClYLOYh3+swU7PO5OvTGRFw0IUl3rW0HdGH7xIzR5OU7waOE1miieWis9tJ0bgu38vv Fr+NUhoNFhQDHNVmIpCXDCxt/sR0MxIXtwXAEFXSmYroTkznK6MkGZO8gDX0gPCTjXug +zm06NIDez0M4COozMjUdwAot64zI7D9rcyeWu9cDNY7/RJmRhqqDbMIBZwMwK/wtj92 Ambg== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=references:in-reply-to:message-id:date:subject:cc:to:from :dkim-signature; bh=37DobpBRHG+Arri5XimcII7cjm39P54Z6MB80sywBSk=; b=bY5R/GUqKxMNqH/+WYmIJaKOEdbO+n1BpXIEQhHlUkzwSbPNcwsNZ77ZH13CuubYSu AmmHVu2zEvhw74u07EPrA4PM4BEeRzmVAMiLz3a/3c7dPikEZ1Ortw/TGgDB69IdM55x 3qjyIPavnUTVZL19tbO7dvASySDrIYtyKtuMoZ1I0ErgFYfGRdxCc1F2xNM9Xl2BFOKk 1yDpLJxp1E5qvu8Dtx9W5WUIJEApiedG7860/9r0TXFkWNgJCs7iI9DQHpa1pZ1aijCK //nM9180aEIOUSO/JlKmG+bZGywMDx9n5ZdD0Hp0Y1FETV6eSHsTXFoZnO5e8NrHiHZM Cr+w== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b=qatgVOSV; spf=pass (google.com: domain of ulf.hansson@linaro.org designates 209.85.220.65 as permitted sender) smtp.mailfrom=ulf.hansson@linaro.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=linaro.org Return-Path: Received: from mail-sor-f65.google.com (mail-sor-f65.google.com. [209.85.220.65]) by mx.google.com with SMTPS id 17sor10007932ljp.4.2019.12.06.09.08.31 for (Google Transport Security); Fri, 06 Dec 2019 09:08:31 -0800 (PST) Received-SPF: pass (google.com: domain of ulf.hansson@linaro.org designates 209.85.220.65 as permitted sender) client-ip=209.85.220.65; Authentication-Results: mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b=qatgVOSV; spf=pass (google.com: domain of ulf.hansson@linaro.org designates 209.85.220.65 as permitted sender) smtp.mailfrom=ulf.hansson@linaro.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=linaro.org 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=cEcQEzkm1TW1769zh8QjQ/0B1A+tR8caXdz3EfEUzU44Gov4PQifZa9oJX/Eqp4ptB Bvve6KI2E23pTUzct/Y8FjFZHB3RQztGJXUN1DPSBetgvlNXSPT3n/VJU3B3NRz7Ztox RrAFKfqzuGlxNFS966l/1CxQ5mPXdaMN9BGZ5hZP3GZbs5VoIF34W7Dj9MQdcnAF8Q/q yDkWw+9zZ6srOEL1i5HQGR6rgPaSdODY0DOVCLwHXlX45wKHdIZPkPGdI6Cf9TC1/38U 5EewdrAsr0JqWCLVXUlqDDbtftcPta03wZvB5Hx0lSNlpzToVgQCX3Kwq+1LOb6uHgTG eEgw== X-Gm-Message-State: APjAAAUn8nmId6q5D5dTHupwHt3i9wpqAnNLSVDrFnn68bPk/CHyvYOL us33FQ8FyoOOQDxh8xPbH30jBVsT 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) Return-Path: 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> 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(-) -- 2.17.1 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: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: 180932 Delivered-To: patches@linaro.org Received: by 2002:a92:3001:0:0:0:0:0 with SMTP id x1csp1054122ile; Fri, 6 Dec 2019 09:08:34 -0800 (PST) X-Received: by 2002:a2e:9a93:: with SMTP id p19mr9475247lji.158.1575652114249; Fri, 06 Dec 2019 09:08:34 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1575652114; cv=none; d=google.com; s=arc-20160816; b=njvV82/jM6FxvU4FEr1xsnY/fO/FoXUv3QUjjjVVN/9MFhEaYWJUuS9xRMVS2Ogt/D ME9Z97ZK1M+Its+0qWv/sxwMpGNojYvB4ao4I/QZNygupntoW7TbAw9+zcNB9WM3FLUt +7WMVL+i/6damJBafkWzoXsbwD1wnPNyvENG8YWFVFsYlkomDIspGj8DghpeldohzDPE b7zMmIwXHwtSXZhDB/mIY9MSfIKLOHQ47yS1GvzKuIy8+67MZKB5wTA+qmRqQTbc9taw q6NbdlUW1Roqx/09h5O3CEeCj2J3dY8PnDLI6JIEeYXabw/H8dot5T5S0Yn+g9/Bx6r5 JG+Q== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=references:in-reply-to:message-id:date:subject:cc:to:from :dkim-signature; bh=P6wkq44hOUaRXToIbJJl7vWgcKUynxHObY8PwUP4zZ8=; b=Ay8mpPC3IoBNkI8eU80bx0g000k3NwkGqsID/xA3uwbM2Soa7GV5Yok69QNcQQoDh5 61SJnf5tSGWrDRtpWrr34Y5Uv/L+XAHT1QufAKe11lfHpqFc15XHR2R1rEOXgDyDPBYv kbKnW+1NUHcs4k5n/Mm2qNGksjgMROtbDzllXBM3KdJuJ3XTAAEslFqG5w1FtdbNjvyn 1iHz8/LuE/2tP/Ajm6a9v06l3W/sbF1LbDNWpF4t6Mf2A/6B2EQVq4KmfkXKnIuGhLQp 56NHLZtXmqa9zBavqoWRdjaiEG4YyDDut5rKNpxzyFsX/QUlFnNgJ/tTp+zK6gILeTAi TRbw== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b=aJl+9hkZ; spf=pass (google.com: domain of ulf.hansson@linaro.org designates 209.85.220.65 as permitted sender) smtp.mailfrom=ulf.hansson@linaro.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=linaro.org Return-Path: Received: from mail-sor-f65.google.com (mail-sor-f65.google.com. [209.85.220.65]) by mx.google.com with SMTPS id e15sor4740430lfc.37.2019.12.06.09.08.34 for (Google Transport Security); Fri, 06 Dec 2019 09:08:34 -0800 (PST) Received-SPF: pass (google.com: domain of ulf.hansson@linaro.org designates 209.85.220.65 as permitted sender) client-ip=209.85.220.65; Authentication-Results: mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b=aJl+9hkZ; spf=pass (google.com: domain of ulf.hansson@linaro.org designates 209.85.220.65 as permitted sender) smtp.mailfrom=ulf.hansson@linaro.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=linaro.org 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=oHh7vNErW0mhVBHnDXYa0dPUhgVXsO8DPtotW7buDVN/IW6lqcQsqbvtuhJYyrEcPn Hb3Yko7VLF6tA6RI3/VOQchdyB473d37fPQSuA1mHwiAWaaVPUCAbG4L5MmqcalMkpUF yV5ChQ9gcteBSItTeWM/KNj1ysQe1mCJgIOB0FurcwkSq7pNSxvEvSc4tTUpRVaW/OBF sEe4V+tT0xT8dKHftu0lM7FQM6rSHkvNRHIIK7sBA84bwerc1MwCPkDvt/XxBxj5+llf gkF3fs9hVgPg3TfoWPZvaasw2HjI5NMj+kAxQT51Vljp0TruJ77xu2liLHaaxynPZZIp xJJw== X-Gm-Message-State: APjAAAVUkhKMnevvdbF7UPqxNBVcuNEAERBrk5JFtDelAo8FAwRf6JyC QxlKeP/Ovf3X4lHwkBThAlMejAM3 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) Return-Path: 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> 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(-) -- 2.17.1 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: 180933 Delivered-To: patches@linaro.org Received: by 2002:a92:3001:0:0:0:0:0 with SMTP id x1csp1054163ile; Fri, 6 Dec 2019 09:08:35 -0800 (PST) X-Received: by 2002:a2e:6e03:: with SMTP id j3mr9550143ljc.32.1575652115846; Fri, 06 Dec 2019 09:08:35 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1575652115; cv=none; d=google.com; s=arc-20160816; b=sEUTMBTUgg0kLgynVfDn7JJIrdQ5VnK5spB0KWpGOx4XVmmLOedfaMv6D2MDnEkNj8 bVPsWGKcFU/fJ+BxKtgqV7W5T6V0XjDrJ/21XJRgM2JtjGDvbeIe0CZ78CShp8dcFTaj rZFuofoAFi69CreFj5Puj/7VZk72i+mV2DU/eEBsgpsOW9n89NXs7qzrkMAQHaQJ+3T6 7zHF+SCZNs3GfH9NCNbkheJVwTu1BV/1KGZV5p1N/6vnyNeONDSrC31DiPAJuphd3jDd ra9WaO8kchtRrpbervbQrXrLqNFClYDdMGF44R8rFlmGfZMnncNZXc0FMpK7f/4imEdj EkTw== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=references:in-reply-to:message-id:date:subject:cc:to:from :dkim-signature; bh=fTEyh8XCr6qWiWO+Sm26auA9jej3JxBZE/rL5aBzRVY=; b=bT5KQYNkkcGdwASwrrQJRq+PvZvWHquTWldDMAaGn1VIOytpXHVePeXlrhfmgjD5xO HcfZPX/ts6onOcFCmIXbIPeOyWzhO/7YrBAsxliPZo8jR6HzEsD++26rkmON56hOkrC5 o97V1dzGFQRobE/MLtycamiZVIhgJ6B4wMNH40TeeoVfsNSRNrDVlgoDz7w4EA6qNQoG oUSKUHb030JhbEXQ8fTFm6TFC1EDnov06OT48SH5fgVn+GqWS5aIiaIwmPgOOZ2kKZjC YmwbTLxqqb1HFt41ncItRQRNcFPkxA2TvksHxR4bP2uRd6scE2Jq4q4xTlJr+C/+BZG2 TLhg== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b=dzqIxUO7; spf=pass (google.com: domain of ulf.hansson@linaro.org designates 209.85.220.65 as permitted sender) smtp.mailfrom=ulf.hansson@linaro.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=linaro.org Return-Path: Received: from mail-sor-f65.google.com (mail-sor-f65.google.com. [209.85.220.65]) by mx.google.com with SMTPS id l15sor2883189lji.27.2019.12.06.09.08.35 for (Google Transport Security); Fri, 06 Dec 2019 09:08:35 -0800 (PST) Received-SPF: pass (google.com: domain of ulf.hansson@linaro.org designates 209.85.220.65 as permitted sender) client-ip=209.85.220.65; Authentication-Results: mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b=dzqIxUO7; spf=pass (google.com: domain of ulf.hansson@linaro.org designates 209.85.220.65 as permitted sender) smtp.mailfrom=ulf.hansson@linaro.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=linaro.org 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=tOe53QJYl4XJbTvYDSjeYR+eItnCRyGlEMouNF7NkK+aRmWuG/iyzmCFJu9V7NlkVH xxxctsFRCWAGq+ixQDPtObboTEkNTalbwrCSoMybwyl4pRXBhlshUa1tID/x+xH6np7E U23lvMRCtr0BbqzUPYPb3bZQ274mJFt+bwfoNb7FFTA16toCcj550w/gwQ/x3zAjd8Tc 6xqdCEI5LJXXO5W/iyHcCVQNEY7ULuhyg5cw2Y3TFdRRCb5DeesfUYhJOeIKEu+1+GP/ ajhrpGug6LDoCqaLt7lbSwFx6pEAoFtyX+3vLJihJqXrzHBCjw2G23PH8Pjb1ihX6Cvu Bfpg== X-Gm-Message-State: APjAAAXeuL6Wg4ZmoKX/WOReXK4Dj4zV8RgcQPNE5h5w+5Aq+ell6kzT 6Rvq8+u2/DrYnDwnjt6zn+3bvzxZ7NSBAw== 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) Return-Path: 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> 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(-) -- 2.17.1 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: 180935 Delivered-To: patches@linaro.org Received: by 2002:a92:3001:0:0:0:0:0 with SMTP id x1csp1054191ile; Fri, 6 Dec 2019 09:08:36 -0800 (PST) X-Received: by 2002:ac2:5a1a:: with SMTP id q26mr8774854lfn.33.1575652116721; Fri, 06 Dec 2019 09:08:36 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1575652116; cv=none; d=google.com; s=arc-20160816; b=MEi86c/Y+MO767FRRWs57sXsmaL3iIKIdKcx2pGk6sARnOefbYwPnmewz17wToKdL8 wfM/sRXBFsM1ALarY/fKnbEn4R8N2mkMjBwesV9n6zvqRnxSPloqveA9RuAaRjGHiICH s1nwMHhSVUBq0c+45e6aA0s7ztXUKiksUaVWtLAjwvXbi9GnVXnpTwPzNcDJ51kd01q9 fs5swbeawoStMgcL7YN4MCuTg7uUprBjsQKLERyu/ESH03gFJJWz5Nrc+zwVkdluZOMg dfVJxCoOECYNcWtYXVC9J1adM4UtRCSbWDkeIK/F9t0cdeALzgYMbzCb89gr7uv5iAny UiQQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=references:in-reply-to:message-id:date:subject:cc:to:from :dkim-signature; bh=R1ZcHKxjvTnD8f3+qXHmLK/liysdFzY/2mwIKJWbEjE=; b=LiPSQ+Ct+kTNm+bUsZTQ6rDjDDq0gvgMLKjPv2B75w9E28WRJuIfiqXJ3iXyq0OHJo scOI3k1PIcIj7EKSiveobLiUKJI/RqJ36rglDz5ESE7463jbe+RU6aVxiTu7O0YNOpOF XmuJUsfg8qTlvTNOqY8sze2Yyu0gEl1svKJW430mVYJB3F+8/KHmlYiyBayKa6VJCMw9 wS1jHIpAEGwG47Qt6uc5rzoXY3go83siVaagnqrUPsLqfi2ZW7LCtt3YmHdSmzbJqTqz hdZq3Cq81n4s5m3rrShwM0ny2RVaoks5kpLbLSGByar5jRqXRtoZeHM2XafXFE0Svsed 7pzw== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b=snB1J2mQ; spf=pass (google.com: domain of ulf.hansson@linaro.org designates 209.85.220.65 as permitted sender) smtp.mailfrom=ulf.hansson@linaro.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=linaro.org Return-Path: Received: from mail-sor-f65.google.com (mail-sor-f65.google.com. [209.85.220.65]) by mx.google.com with SMTPS id i15sor3532321lfi.47.2019.12.06.09.08.36 for (Google Transport Security); Fri, 06 Dec 2019 09:08:36 -0800 (PST) Received-SPF: pass (google.com: domain of ulf.hansson@linaro.org designates 209.85.220.65 as permitted sender) client-ip=209.85.220.65; Authentication-Results: mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b=snB1J2mQ; spf=pass (google.com: domain of ulf.hansson@linaro.org designates 209.85.220.65 as permitted sender) smtp.mailfrom=ulf.hansson@linaro.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=linaro.org 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=Kr1rMshsZLR5dzHrxG0gGUO+ROx77EyGVOald3aVwa+suG+Quhq7/VddAW/pisVbnH gzH51QyfkFJdt33uLFAIea3y0vqg5fptLNaWLQaYYRJhA+fvxX2P/Vl0GLy9p9P8SKi6 nJ4u0VkwaBAlaus9knPMeVduhQAqSBcnVwgXwYr5iOa5Wql/OFCEO6vTZ4vV2B9hRA2I w4JfA3ZUELHxF5WtZOcPSF2qWD1COglEh50bj49UvoAZ6b5J6/6sa3KYL1DRUbH/2BT3 wPAMNBWpM5bVrLpO3/AiLHiujWCJo/rOiHP545NDLsd23F2Sl5XElRRPMJIbklJ9Y/dm u7/w== X-Gm-Message-State: APjAAAXtGP6SKnh1juSGu/CXJta2fzGXMZN/c0+DJ0PoYRakMbKfCSPL uQro8xp3QNJADOjW0BK2NDkD9i1m 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) Return-Path: 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> 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(-) -- 2.17.1 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: 180936 Delivered-To: patches@linaro.org Received: by 2002:a92:3001:0:0:0:0:0 with SMTP id x1csp1054225ile; Fri, 6 Dec 2019 09:08:38 -0800 (PST) X-Received: by 2002:a2e:8e69:: with SMTP id t9mr9200473ljk.91.1575652118114; Fri, 06 Dec 2019 09:08:38 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1575652118; cv=none; d=google.com; s=arc-20160816; b=FV+iOPQNIbi8B1/9UCht3WGcZPd43uzAP+gfX6xwVs7ajxql5L9aFBF5OJPSNeSBWK brsUhCDauzG8ckL9kfbAKFDvw1k4IZjGliOcJAvfgUTI0aN709T2Ta9L6ydnuSwNTPHJ Y6ViQ88JtudRPREP4FJEdvrX4YGxItsyvTeMHhRJfwaLx5V6JaWm61jtWyeqpdpOq5uq 0LwVkYtL6zLEHSRQPc8WrjHu8axnoZBUe+ZpYP2BNpWd8M7QKyw8dD1O5BukSEszkUOu awFhN3J+xhakaYISz8lfBQd6KDxt6RruIEJYk9tbxNYTk/dWUYH0+Ss1lqcxribHH4ZS MIEw== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=references:in-reply-to:message-id:date:subject:cc:to:from :dkim-signature; bh=xG/TtMVmPt3YpqGKMEzSfHDWIvjefdWJoE6sWzREm9w=; b=F5B6rgqEAFalM5fF9/pQ3e9qH8KTxO6P4ZFLXhv7fwawVWqWFnqIRM3aPEl2w8DC4A i2x8Jmq8uii8nKgviKn9w4n2vXylfJ9Qpvj7GxD/C+Z+geK0PmGzEynqXR/Ed/yH2/1G a4p7nqHNWBwau8IFhvv5U8FAGyTdryNLEDRUp2WnNY46Wizwfc7YV2LBL72kDO2tH3bf N1CfOSqvHKPCEwRiClrvhmhjo8JT3dLrwR8eb8vICZhxOEG93SMuQMRYRr9OdLHnknpq LbI0La2hFCJAjuYU2+msVGjH+YdoWBWHODAKeAlmwY9Ts8uaPMsrGFIPfpdcA6DNs8xu Qb2A== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b=T3j6q9yy; spf=pass (google.com: domain of ulf.hansson@linaro.org designates 209.85.220.65 as permitted sender) smtp.mailfrom=ulf.hansson@linaro.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=linaro.org Return-Path: Received: from mail-sor-f65.google.com (mail-sor-f65.google.com. [209.85.220.65]) by mx.google.com with SMTPS id x15sor4748782lfn.40.2019.12.06.09.08.37 for (Google Transport Security); Fri, 06 Dec 2019 09:08:38 -0800 (PST) Received-SPF: pass (google.com: domain of ulf.hansson@linaro.org designates 209.85.220.65 as permitted sender) client-ip=209.85.220.65; Authentication-Results: mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b=T3j6q9yy; spf=pass (google.com: domain of ulf.hansson@linaro.org designates 209.85.220.65 as permitted sender) smtp.mailfrom=ulf.hansson@linaro.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=linaro.org 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=NE6xeE/FanJ4Cgc1GML4Dhp3+KIa2Y4T296ReZ1nAWwh1IxdzeTr9vHG0ecquhVnQv ZJ4aaBA+37FWpoPhjyoRwjZyGYV/jPaVF54Nj6x404VgB/873LSbpJuxvFHhW0b+7jM+ nPMrQetIYJH8kFZmRAJMmtVcp3eWzY9oWwP/J4Uuo40Onbw5PjYW5JwvyrpojbRB2xIh +BXuPmr9Hrv1Qh1Gisx0DRbx97RFef8DufjLfViOGn2LMnacqXQjT88yEQqMTGay9yxS 25IAPm/dgGqS+fTq0n9FAXVUWN0ArIP3rjMeZDJ+rYD3tkmAJX3yGbU7uXhbng0uQkK+ 9gRw== X-Gm-Message-State: APjAAAWrLz2YJ6PLJcGa8eZCy4b5B0hKVKNQFW1A1tIP0HCHlYF2jNBX ktt9rj8YnVAo+K0CE64WAIKrCrtQ 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) Return-Path: 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> 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 --- drivers/mmc/host/jz4740_mmc.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) -- 2.17.1 Acked-by: Paul Cercueil Acked-by: Linus Walleij 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: 180937 Delivered-To: patches@linaro.org Received: by 2002:a92:3001:0:0:0:0:0 with SMTP id x1csp1054268ile; Fri, 6 Dec 2019 09:08:39 -0800 (PST) X-Received: by 2002:a2e:808a:: with SMTP id i10mr8838807ljg.151.1575652119502; Fri, 06 Dec 2019 09:08:39 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1575652119; cv=none; d=google.com; s=arc-20160816; b=kfvf5ybNMrUCxUntmgE73KeTQkJNZwIW7QgK5z5V5oNBN9n2gTnqF222GMAW/O3nAY 5TXY41+IXErtSII0moLHaQ+eTz1dnRCNUpMelsdc9ccEA0hj6pHNnLp/mZnqHZKtEw2W M5GNsHZ2B3QpXGf+6XeA7NS8zYeUoDPOTD8BWoJmcUM+YDP2I4AiuRdjpXQGyDRMGcep 3ZySbqPgpHSuKAk/B6wsHDT2hnVrSjVSo0t7kHAVLXTkzL6R9LUC66eDuY/xZ27qoZMa haaN8Ut1IvJVQbqzK7vU4TBclDPTkxfc6AQuiI1Pa/a8z4LA78IprfEbqR7EwF1rhbiV jajw== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=references:in-reply-to:message-id:date:subject:cc:to:from :dkim-signature; bh=Bena7hxM6Q5CJen1XKF9/qXFjbtAx0rdagpDLN6ovkc=; b=jx4JSqXu7azfU7JrFU9hSTZBwsTFy42yuu0UCMAEEaruYINQi8vqFP11XSjs8Z4UoB iUjCX/HDLTspMHhfc95zAM18EXX6jgThwVqmV7hYgihIleAybq0sIBDVRUwnYSPkNFiv WIT+O2VfqUz82TIlAIgGOWaWljyF34s7/WiickNjr2EUXLQZ3oxykfIQklcMMXa0iCgY 0wEfHVSQ29j/Ac/zv9P0YbVHue3WtrTCM9rrNuFz0SKmXf/rly28CO91LPDTSEsdoU56 djeZ3bRnHK8+tCuM3ubmCZPeZlnGNRlbd073a4MpkgB+alcEUu9tiIVBo8PvDyN9edip C9Nw== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b=X9+uU+AY; spf=pass (google.com: domain of ulf.hansson@linaro.org designates 209.85.220.65 as permitted sender) smtp.mailfrom=ulf.hansson@linaro.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=linaro.org Return-Path: Received: from mail-sor-f65.google.com (mail-sor-f65.google.com. [209.85.220.65]) by mx.google.com with SMTPS id r22sor9721745ljk.30.2019.12.06.09.08.39 for (Google Transport Security); Fri, 06 Dec 2019 09:08:39 -0800 (PST) Received-SPF: pass (google.com: domain of ulf.hansson@linaro.org designates 209.85.220.65 as permitted sender) client-ip=209.85.220.65; Authentication-Results: mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b=X9+uU+AY; spf=pass (google.com: domain of ulf.hansson@linaro.org designates 209.85.220.65 as permitted sender) smtp.mailfrom=ulf.hansson@linaro.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=linaro.org 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=n7YTazJzVago87/OrREYzrBLmUhB0AoZtOPQCZq3lz+418ZHPVX5ODtGRmh7tiJNRF Msi+GejFn8LF2UJo0wygi8fSqb1qzD8cytE6OhQFQjN2/vfB5OodCeIFJwUdXVFYmNaR 2xDXTV53ktSVPAITCIg8DNv1qG8B0tOWT7suW1ZnQ/b0O5HAskqdSM8SW4uyxWY74jyL xeTsXmWhqiHL19pbOeSJpV9tcly/0zjky9t+kwhgSk2xkig61Q+n/2b+eR21LFdg/n7y kAzjdtZSoZM5j8h+ww5ykXr4xzOxXb971xsK6fhvQ62wpv8+kF7lmdZNeHkWOKqfR8uI zm1g== X-Gm-Message-State: APjAAAWN/JBLKUgtTLKYvchJuoESmMtVNF/J4FSuF8V7e+pxeEhbN92m jsfoPeBizzxqIGGCbsBLUwsoaZ+T 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) Return-Path: 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> 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 --- drivers/mmc/host/uniphier-sd.c | 14 +++++--------- 1 file changed, 5 insertions(+), 9 deletions(-) -- 2.17.1 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);