* [PATCH] pinctrl: fix PINCTRL_SPPCTL=m
@ 2026-09-04 12:18 Julian Braha
2026-09-16 10:31 ` Andrew Gaylard
0 siblings, 1 reply; 3+ messages in thread
From: Julian Braha @ 2026-09-04 12:18 UTC (permalink / raw)
To: linux, dvorkin, wellslutw, linusw
Cc: arnd, afd, aaro.koskinen, linux-arm-kernel, linux-kernel,
linux-gpio, Julian Braha
The PINCTRL_SPPCTL option is defined as a tristate in Kconfig, and the
help text suggests that the user can build it as a module by setting to
'm'.
However, it cannot currently be set to 'm', because SOC_SP7021, the only
platform that supports it, is a bool option that uses 'select' on it.
To allow users to actually set PINCTRL_SPPCTL=m, let's remove the select
from the SOC_SP7021 option, and instead have PINCTRL_SPPCTL default to y
when SOC_SP7021=y, then users can configure PINCTRL_SPPCTL=m in the
kconfig frontend if desired.
Note that I have only compile-tested this change, since I do not have the
hardware to runtime-test it. Please advise if it would be better to change
PINCTRL_SPPCTL to 'bool' and remove the help text suggesting that it can
be set to 'm'.
This impossible tristate was detected by kconfirm, a static analysis tool
for Kconfig.
Fixes: aa74c44be19c ("pinctrl: Add driver for Sunplus SP7021")
Signed-off-by: Julian Braha <julianbraha@gmail.com>
---
arch/arm/Kconfig.platforms | 1 -
drivers/pinctrl/sunplus/Kconfig | 3 ++-
drivers/pinctrl/sunplus/sppctl.c | 3 ++-
3 files changed, 4 insertions(+), 3 deletions(-)
diff --git a/arch/arm/Kconfig.platforms b/arch/arm/Kconfig.platforms
index 2e118b65f93b..dc880addadc5 100644
--- a/arch/arm/Kconfig.platforms
+++ b/arch/arm/Kconfig.platforms
@@ -177,7 +177,6 @@ config SOC_SP7021
select ARM_GIC
select ARM_PSCI
select PINCTRL
- select PINCTRL_SPPCTL
select SERIAL_SUNPLUS if TTY
select SERIAL_SUNPLUS_CONSOLE if TTY
help
diff --git a/drivers/pinctrl/sunplus/Kconfig b/drivers/pinctrl/sunplus/Kconfig
index 69f82590f6d2..7719838b39b6 100644
--- a/drivers/pinctrl/sunplus/Kconfig
+++ b/drivers/pinctrl/sunplus/Kconfig
@@ -5,7 +5,8 @@
config PINCTRL_SPPCTL
tristate "Sunplus SP7021 PinMux and GPIO driver"
- depends on SOC_SP7021
+ default SOC_SP7021
+ depends on SOC_SP7021 || COMPILE_TEST
depends on OF && HAS_IOMEM
select GENERIC_PINCTRL_GROUPS
select GENERIC_PINMUX_FUNCTIONS
diff --git a/drivers/pinctrl/sunplus/sppctl.c b/drivers/pinctrl/sunplus/sppctl.c
index 67e036d66245..89c6e2e92f07 100644
--- a/drivers/pinctrl/sunplus/sppctl.c
+++ b/drivers/pinctrl/sunplus/sppctl.c
@@ -1113,6 +1113,7 @@ static const struct of_device_id sppctl_match_table[] = {
{ .compatible = "sunplus,sp7021-pctl" },
{ /* sentinel */ }
};
+MODULE_DEVICE_TABLE(of, sppctl_match_table);
static struct platform_driver sppctl_pinctrl_driver = {
.driver = {
@@ -1121,7 +1122,7 @@ static struct platform_driver sppctl_pinctrl_driver = {
},
.probe = sppctl_probe,
};
-builtin_platform_driver(sppctl_pinctrl_driver)
+module_platform_driver(sppctl_pinctrl_driver);
MODULE_AUTHOR("Dvorkin Dmitry <dvorkin@tibbo.com>");
MODULE_AUTHOR("Wells Lu <wellslutw@gmail.com>");
--
2.55.0
^ permalink raw reply [flat|nested] 3+ messages in thread* Re: [PATCH] pinctrl: fix PINCTRL_SPPCTL=m
2026-09-04 12:18 [PATCH] pinctrl: fix PINCTRL_SPPCTL=m Julian Braha
@ 2026-09-16 10:31 ` Andrew Gaylard
0 siblings, 0 replies; 3+ messages in thread
From: Andrew Gaylard @ 2026-09-16 10:31 UTC (permalink / raw)
To: Julian Braha
Cc: linux, dvorkin, wellslutw, linusw, arnd, afd, aaro.koskinen,
linux-arm-kernel, linux-kernel, linux-gpio
Julian Braha <julianbraha@gmail.com> writes:
> The PINCTRL_SPPCTL option is defined as a tristate in Kconfig, and the
> help text suggests that the user can build it as a module by setting to
> 'm'.
[...]
> Note that I have only compile-tested this change, since I do not have the
> hardware to runtime-test it. Please advise if it would be better to change
> PINCTRL_SPPCTL to 'bool' and remove the help text suggesting that it can
> be set to 'm'.
Hi Julian,
I've tested this on real hardware, and it fails to boot. I don't think
it makes sense for this to be a module, since most of the devices in
this SoC are pin-mappable and need muxing to be configured before they
can be probed.
Let's rather fix this by making it a bool. I'll send a patch shortly.
--
Andrew
^ permalink raw reply [flat|nested] 3+ messages in thread
* [PATCH] pinctrl: fix PINCTRL_SPPCTL=m
@ 2026-09-16 10:49 Andrew Gaylard
0 siblings, 0 replies; 3+ messages in thread
From: Andrew Gaylard @ 2026-09-16 10:49 UTC (permalink / raw)
To: linux, dvorkin, wellslutw, linusw
Cc: arnd, afd, aaro.koskinen, linux-arm-kernel, linux-kernel,
linux-gpio, Julian Braha
The PINCTRL_SPPCTL option is defined as a tristate in Kconfig, and the
help text suggests that the user can build it as a module by setting to
'm'.
However, it cannot currently be set to 'm', because SOC_SP7021, the only
platform that supports it, is a bool option that uses 'select' on it.
Also, the SP7021 requires this driver to be built in, in order to boot.
Change the tristate to bool and fix the help text.
Tested on linux-next-2026-09-14 on a LTPP3G2 board.
This impossible tristate was detected by kconfirm, a static analysis tool
for Kconfig, by Julian Braha <julianbraha@gmail.com>.
Fixes: aa74c44be19c ("pinctrl: Add driver for Sunplus SP7021")
Signed-off-by: Andrew Gaylard <ag@ffroot.co.za>
---
drivers/pinctrl/sunplus/Kconfig | 8 +++-----
1 file changed, 3 insertions(+), 5 deletions(-)
diff --git a/drivers/pinctrl/sunplus/Kconfig b/drivers/pinctrl/sunplus/Kconfig
index 69f82590f6d2..aa9435d023d8 100644
--- a/drivers/pinctrl/sunplus/Kconfig
+++ b/drivers/pinctrl/sunplus/Kconfig
@@ -4,8 +4,8 @@
#
config PINCTRL_SPPCTL
- tristate "Sunplus SP7021 PinMux and GPIO driver"
- depends on SOC_SP7021
+ bool "Sunplus SP7021 PinMux and GPIO driver"
+ depends on SOC_SP7021 || COMPILE_TEST
depends on OF && HAS_IOMEM
select GENERIC_PINCTRL_GROUPS
select GENERIC_PINMUX_FUNCTIONS
@@ -16,6 +16,4 @@ config PINCTRL_SPPCTL
help
Say Y here to support Sunplus SP7021 pinmux controller.
This driver requires the pinctrl framework.
- GPIO is provided by the same driver.
- To compile this driver as a module, choose M here.
- The module will be called sppinctrl.
+ This driver also provides GPIO.
^ permalink raw reply [flat|nested] 3+ messages in thread
end of thread, other threads:[~2026-09-16 10:49 UTC | newest]
Thread overview: 3+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2026-09-04 12:18 [PATCH] pinctrl: fix PINCTRL_SPPCTL=m Julian Braha
2026-09-16 10:31 ` Andrew Gaylard
2026-09-16 10:49 Andrew Gaylard
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®