Skip to contentSkip to conversation

pinctrl: mediatek: Enable MT8189 as loadable module

PATCH In review Justin Yeh 3 participants 6 messages May 29 – Jun 23

Subsystems (4)
lore
Share & tools
lore

Justin Yeh

author
#0 lore raw

cover pinctrl: mediatek: Enable MT8189 as loadable module

This series enables PINCTRL_MT8189 to be built as a loadable kernel module, which is required for GKI (Generic Kernel Image) + vendor_dlkm deployments where vendor-specific drivers must be kept separate from the GKI vmlinux.

Patch 1 restores the tristate option that was recently changed to bool, preventing module builds. Patch 2 adds the missing MODULE_LICENSE macro that's required when building as a module.

Together these changes allow MT8189 pinctrl to be properly packaged as a vendor kernel module while maintaining the existing built-in option.

Justin Yeh (2):
pinctrl: mediatek: Restore PINCTRL_MT8189 to tristate
pinctrl: mediatek: mt8189: Add MODULE_LICENSE declaration

 drivers/pinctrl/mediatek/Kconfig          | 2 +-
 drivers/pinctrl/mediatek/pinctrl-mt8189.c | 1 +
 2 files changed, 2 insertions(+), 1 deletion(-)
Signature · 1 line
2.45.2
author
#1 lore raw

PATCH 1/2 pinctrl: mediatek: Restore PINCTRL_MT8189 to tristate

Under the GKI + vendor_dlkm model, vendor-specific pinctrl cannot be built into the GKI vmlinux. Upstream's recent switch of PINCTRL_MT8189 to bool prevents building as a loadable module, which breaks DDK module usage. Restore tristate so MT8189 pinctrl can be packaged as a kernel module in vendor_dlkm.

---
 drivers/pinctrl/mediatek/Kconfig | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
drivers/pinctrl/mediatek/Kconfig +1 -1
index 4819617d9368..a75434e7e989 100644
@@ -270,7 +270,7 @@ config PINCTRL_MT8188
 	  map specific eint which doesn't have real gpio pin.
 
 config PINCTRL_MT8189
-        bool "MediaTek MT8189 pin control"
+        tristate "MediaTek MT8189 pin control"
         depends on OF
         depends on ARM64 || COMPILE_TEST
         default ARM64 && ARCH_MEDIATEK
Signature · 1 line
2.45.2
maintainer Reviewed-by on v1 1/2
#2 lore raw

Re: [PATCH 1/2] pinctrl: mediatek: Restore PINCTRL_MT8189 to tristate

Quoted 7 lines · Justin Yeh

Under the GKI + vendor_dlkm model, vendor-specific pinctrl cannot be built into the GKI vmlinux. Upstream's recent switch of PINCTRL_MT8189 to bool prevents building as a loadable module, which breaks DDK module usage. Restore tristate so MT8189 pinctrl can be packaged as a kernel module in vendor_dlkm.

The MODULE_LICENSE change shall come before this one.

Besides - since there's no problem in having the pinctrl drivers as module for MT8189, I imagine that this is analogously true for all (or most of) the others.

Looks like getting those to build as modules is trivial, too - so, can you at this point please do the same for all of the MediaTek pinctrl drivers that are trivial to enable as tristate?

P.S.: After reordering the commits, this one is

Thanks,
Angelo

Quoted 17 lines
---
  drivers/pinctrl/mediatek/Kconfig | 2 +-
  1 file changed, 1 insertion(+), 1 deletion(-)
drivers/pinctrl/mediatek/Kconfig +1 -1
index 4819617d9368..a75434e7e989 100644
@@ -270,7 +270,7 @@ config PINCTRL_MT8188
  	  map specific eint which doesn't have real gpio pin.
 
  config PINCTRL_MT8189
-        bool "MediaTek MT8189 pin control"
+        tristate "MediaTek MT8189 pin control"
          depends on OF
          depends on ARM64 || COMPILE_TEST
          default ARM64 && ARCH_MEDIATEK
author
#3 lore raw

PATCH 2/2 pinctrl: mediatek: mt8189: Add MODULE_LICENSE declaration

In reply to Justin Yeh

Add missing MODULE_LICENSE("GPL v2") macro to fix modpost error during kernel module build. The license identifier matches the SPDX header (GPL-2.0) at the top of the file.

This fixes the following build error:
ERROR: modpost: missing MODULE_LICENSE() in pinctrl-mt8189.o

---
 drivers/pinctrl/mediatek/pinctrl-mt8189.c | 1 +
 1 file changed, 1 insertion(+)
drivers/pinctrl/mediatek/pinctrl-mt8189.c +1 -0
index cd4cdff309a1..a9c128c514a4 100644
@@ -1696,3 +1696,4 @@ static int __init mt8189_pinctrl_init(void)
 arch_initcall(mt8189_pinctrl_init);
 
 MODULE_DESCRIPTION("MediaTek MT8189 Pinctrl Driver");
+MODULE_LICENSE("GPL v2");
Signature · 1 line
2.45.2
maintainer Reviewed-by on v1 2/2
#4 lore raw

Re: [PATCH 2/2] pinctrl: mediatek: mt8189: Add MODULE_LICENSE declaration

Quoted 8 lines · Justin Yeh

Add missing MODULE_LICENSE("GPL v2") macro to fix modpost error during kernel module build. The license identifier matches the SPDX header (GPL-2.0) at the top of the file.

This fixes the following build error:
ERROR: modpost: missing MODULE_LICENSE() in pinctrl-mt8189.o

Please, do this for all MediaTek pinctrl drivers.

maintainer
#5 lore raw
In reply to Justin Yeh
Quoted 4 lines · Justin Yeh

This series enables PINCTRL_MT8189 to be built as a loadable kernel module, which is required for GKI (Generic Kernel Image) + vendor_dlkm deployments where vendor-specific drivers must be kept separate from the GKI vmlinux.

Maybe tell us that this is for Android?

Quoted 1 line

Patch 1 restores the tristate option that was recently changed to bool,

No the driver was merged with tristate.
See
commit a3fe1324c3c5c292ec79bd756497c1c44ff247d2 (tag: pinctrl-v6.17-1) "pinctrl: mediatek: Add pinctrl driver for mt8189"

Quoted 2 lines

preventing module builds. Patch 2 adds the missing MODULE_LICENSE macro that's required when building as a module.

So that should be squashed into one patch or it will not bisect.

Quoted 2 lines

Together these changes allow MT8189 pinctrl to be properly packaged as a vendor kernel module while maintaining the existing built-in option.

So why do we change this only for MT8189 and not for all Mediatek pinctrl drivers?

I would just add this tristate option and license to all of them while you're at it or I will get like 20 identical patches and it's a waste of time for me.

Yours,
Linus Walleij