mirror of https://lore.kernel.org/lkml/
 help / color / mirror / Atom feed
From: Antonio Borneo <antonio.borneo@foss.st.com>
To: Linus Walleij <linus.walleij@linaro.org>,
	Rob Herring <robh@kernel.org>,
	Krzysztof Kozlowski <krzk+dt@kernel.org>,
	Conor Dooley <conor+dt@kernel.org>,
	Maxime Coquelin <mcoquelin.stm32@gmail.com>,
	Alexandre Torgue <alexandre.torgue@foss.st.com>,
	Catalin Marinas <catalin.marinas@arm.com>,
	Will Deacon <will@kernel.org>, <linux-gpio@vger.kernel.org>,
	<devicetree@vger.kernel.org>,
	<linux-arm-kernel@lists.infradead.org>
Cc: "Antonio Borneo" <antonio.borneo@foss.st.com>,
	linux-kernel@vger.kernel.org,
	"Clément Le Goffic" <clement.legoffic@foss.st.com>,
	"Stephane Danieau" <stephane.danieau@foss.st.com>,
	"Amelie Delaunay" <amelie.delaunay@foss.st.com>,
	"Fabien Dessenne" <fabien.dessenne@foss.st.com>,
	"Valentin Caron" <valentin.caron@foss.st.com>,
	"Gatien Chevallier" <gatien.chevallier@foss.st.com>,
	"Cheick Traore" <cheick.traore@foss.st.com>,
	linux-stm32@st-md-mailman.stormreply.com
Subject: [PATCH 03/14] pinctrl: stm32: Handle RSVD pin configuration
Date: Tue, 22 Oct 2024 17:56:47 +0200	[thread overview]
Message-ID: <20241022155658.1647350-4-antonio.borneo@foss.st.com> (raw)
In-Reply-To: <20241022155658.1647350-1-antonio.borneo@foss.st.com>

From: Fabien Dessenne <fabien.dessenne@foss.st.com>

When a pin is assigned to a coprocessor not running Linux, the pin
should be flagged in the DT as reserved and not usable by Linux.

Add pin configuration RSVD (Reserved) and instrument the driver to
not update the mux setting.

Signed-off-by: Fabien Dessenne <fabien.dessenne@foss.st.com>
Signed-off-by: Antonio Borneo <antonio.borneo@foss.st.com>
---
 drivers/pinctrl/stm32/pinctrl-stm32.c | 9 +++++++++
 drivers/pinctrl/stm32/pinctrl-stm32.h | 3 ++-
 2 files changed, 11 insertions(+), 1 deletion(-)

diff --git a/drivers/pinctrl/stm32/pinctrl-stm32.c b/drivers/pinctrl/stm32/pinctrl-stm32.c
index 30fa39688a8c0..cb7929feb6a0a 100644
--- a/drivers/pinctrl/stm32/pinctrl-stm32.c
+++ b/drivers/pinctrl/stm32/pinctrl-stm32.c
@@ -76,6 +76,7 @@ static const char * const stm32_gpio_functions[] = {
 	"af8", "af9", "af10",
 	"af11", "af12", "af13",
 	"af14", "af15", "analog",
+	"reserved",
 };
 
 struct stm32_pinctrl_group {
@@ -540,6 +541,9 @@ static bool stm32_pctrl_is_function_valid(struct stm32_pinctrl *pctl,
 		if (pin->pin.number != pin_num)
 			continue;
 
+		if (fnum == STM32_PIN_RSVD)
+			return true;
+
 		for (k = 0; k < STM32_CONFIG_NUM; k++) {
 			if (func->num == fnum)
 				return true;
@@ -839,6 +843,11 @@ static int stm32_pmx_set_mux(struct pinctrl_dev *pctldev,
 		return -EINVAL;
 	}
 
+	if (function == STM32_PIN_RSVD) {
+		dev_dbg(pctl->dev, "Reserved pins, skipping HW update.\n");
+		return 0;
+	}
+
 	bank = gpiochip_get_data(range->gc);
 	pin = stm32_gpio_pin(g->pin);
 
diff --git a/drivers/pinctrl/stm32/pinctrl-stm32.h b/drivers/pinctrl/stm32/pinctrl-stm32.h
index 8790fef2d58a2..a5f62fb271442 100644
--- a/drivers/pinctrl/stm32/pinctrl-stm32.h
+++ b/drivers/pinctrl/stm32/pinctrl-stm32.h
@@ -17,7 +17,8 @@
 #define STM32_PIN_GPIO		0
 #define STM32_PIN_AF(x)		((x) + 1)
 #define STM32_PIN_ANALOG	(STM32_PIN_AF(15) + 1)
-#define STM32_CONFIG_NUM	(STM32_PIN_ANALOG + 1)
+#define STM32_PIN_RSVD		(STM32_PIN_ANALOG + 1)
+#define STM32_CONFIG_NUM	(STM32_PIN_RSVD + 1)
 
 /*  package information */
 #define STM32MP_PKG_AA		BIT(0)
-- 
2.34.1


  parent reply	other threads:[~2024-10-22 15:59 UTC|newest]

Thread overview: 28+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2024-10-22 15:56 [PATCH 00/14] pinctrl: stm32: Add new features and support for more SoC Antonio Borneo
2024-10-22 15:56 ` [PATCH 01/14] pinctrl: stm32: Declare stm32_pmx_get_mode() as static Antonio Borneo
2024-10-22 15:56 ` [PATCH 02/14] pinctrl: stm32: Manage irq affinity settings Antonio Borneo
2024-10-22 15:56 ` Antonio Borneo [this message]
2024-10-22 15:56 ` [PATCH 04/14] dt-bindings: pinctrl: stm32: add RSVD mux function Antonio Borneo
2024-10-23  8:46   ` Krzysztof Kozlowski
2024-10-23  8:47   ` Krzysztof Kozlowski
2024-10-23  8:56     ` Antonio Borneo
2024-10-24 13:22       ` Krzysztof Kozlowski
2024-10-22 15:56 ` [PATCH 05/14] pinctrl: stm32: Rework stm32_pconf_parse_conf() Antonio Borneo
2024-10-22 15:56 ` [PATCH 06/14] pinctrl: stm32: Support IO synchronization parameters Antonio Borneo
2024-10-22 15:56 ` [PATCH 07/14] dt-bindings: pinctrl: stm32: support " Antonio Borneo
2024-10-23  8:49   ` Krzysztof Kozlowski
2024-10-24 22:38   ` Linus Walleij
2024-10-31 13:42     ` Antonio Borneo
2024-11-01 10:24       ` Linus Walleij
2024-10-22 15:56 ` [PATCH 08/14] pinctrl: stm32: Add RIF support for stm32mp257 Antonio Borneo
2024-10-22 15:56 ` [PATCH 09/14] pinctrl: stm32: Allow compile as module " Antonio Borneo
2024-10-22 15:56 ` [PATCH 10/14] pinctrl: stm32: Add stm32mp215 pinctrl support Antonio Borneo
2024-10-22 15:56 ` [PATCH 11/14] dt-bindings: pinctrl: stm32: support for stm32mp215 and additional packages Antonio Borneo
2024-10-23  8:51   ` Krzysztof Kozlowski
2024-10-23 10:08     ` Antonio Borneo
2024-10-24 13:25       ` Krzysztof Kozlowski
2024-10-22 15:56 ` [PATCH 12/14] pinctrl: stm32: Add stm32mp235 pinctrl support Antonio Borneo
2024-10-22 15:56 ` [PATCH 13/14] dt-bindings: pinctrl: stm32: add support for stm32mp235 Antonio Borneo
2024-10-23  8:52   ` Krzysztof Kozlowski
2024-10-22 15:56 ` [PATCH 14/14] pinctrl: stm32: Add new package to stm32mp257 pinctrl support Antonio Borneo
2024-10-24 22:20 ` [PATCH 00/14] pinctrl: stm32: Add new features and support for more SoC Linus Walleij

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20241022155658.1647350-4-antonio.borneo@foss.st.com \
    --to=antonio.borneo@foss.st.com \
    --cc=alexandre.torgue@foss.st.com \
    --cc=amelie.delaunay@foss.st.com \
    --cc=catalin.marinas@arm.com \
    --cc=cheick.traore@foss.st.com \
    --cc=clement.legoffic@foss.st.com \
    --cc=conor+dt@kernel.org \
    --cc=devicetree@vger.kernel.org \
    --cc=fabien.dessenne@foss.st.com \
    --cc=gatien.chevallier@foss.st.com \
    --cc=krzk+dt@kernel.org \
    --cc=linus.walleij@linaro.org \
    --cc=linux-arm-kernel@lists.infradead.org \
    --cc=linux-gpio@vger.kernel.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=linux-stm32@st-md-mailman.stormreply.com \
    --cc=mcoquelin.stm32@gmail.com \
    --cc=robh@kernel.org \
    --cc=stephane.danieau@foss.st.com \
    --cc=valentin.caron@foss.st.com \
    --cc=will@kernel.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox

all inboxes | Powered by JetHome®