mirror of https://lore.kernel.org/lkml/
 help / color / mirror / Atom feed
* [PATCH 0/2] pmdomain: mediatek: Enable module support for mtk-scpsys
@ 2026-06-03  5:11 Justin Yeh
  2026-06-03  5:11 ` [PATCH 1/2] pmdomain: mediatek: Convert MTK_SCPSYS to tristate Justin Yeh
                   ` (2 more replies)
  0 siblings, 3 replies; 4+ messages in thread
From: Justin Yeh @ 2026-06-03  5:11 UTC (permalink / raw)
  To: Ulf Hansson, Matthias Brugger, AngeloGioacchino Del Regno
  Cc: Project_Global_Chrome_Upstream_Group, linux-pm, linux-kernel,
	linux-arm-kernel, linux-mediatek, Justin Yeh

This series enables the MTK_SCPSYS driver to be built as a loadable
module for GKI (Generic Kernel Image) compliance.

This series depends on the following patches currently under review:
  - soc: mediatek: Allow MTK_INFRACFG to be built as module
  - soc: mediatek: mtk-infracfg: Export symbols for DDK modules

The MTK_SCPSYS driver depends on MTK_INFRACFG being available as a
module, which is enabled by these prerequisite patches.

Patch 1 converts the Kconfig option from bool to tristate, allowing
the driver to be built as either built-in or as a module.

Patch 2 adds MODULE_DESCRIPTION() and converts to module_platform_driver()
to complete the modularization and silence modpost warnings.

Together these changes allow the MediaTek SCPSYS power domain driver
to support modern Android GKI/vendor_dlkm module loading requirements
while maintaining backward compatibility with the traditional built-in
configuration.

Justin Yeh (2):
  pmdomain: mediatek: Convert MTK_SCPSYS to tristate
  pmdomain: mediatek: Add MODULE_DESCRIPTION to mtk-scpsys

 drivers/pmdomain/mediatek/Kconfig      | 2 +-
 drivers/pmdomain/mediatek/mtk-scpsys.c | 5 ++++-
 2 files changed, 5 insertions(+), 2 deletions(-)

-- 
2.45.2


^ permalink raw reply	[flat|nested] 4+ messages in thread

* [PATCH 1/2] pmdomain: mediatek: Convert MTK_SCPSYS to tristate
  2026-06-03  5:11 [PATCH 0/2] pmdomain: mediatek: Enable module support for mtk-scpsys Justin Yeh
@ 2026-06-03  5:11 ` Justin Yeh
  2026-06-03  5:11 ` [PATCH 2/2] pmdomain: mediatek: Add MODULE_DESCRIPTION to mtk-scpsys Justin Yeh
  2026-06-23  8:06 ` [PATCH 0/2] pmdomain: mediatek: Enable module support for mtk-scpsys AngeloGioacchino Del Regno
  2 siblings, 0 replies; 4+ messages in thread
From: Justin Yeh @ 2026-06-03  5:11 UTC (permalink / raw)
  To: Ulf Hansson, Matthias Brugger, AngeloGioacchino Del Regno
  Cc: Project_Global_Chrome_Upstream_Group, linux-pm, linux-kernel,
	linux-arm-kernel, linux-mediatek, Justin Yeh

Convert CONFIG_MTK_SCPSYS from bool to tristate to support building
as a loadable module for GKI compliance.

This change allows MTK_SCPSYS to be built as:
- CONFIG_MTK_SCPSYS=y: built-in (traditional approach)
- CONFIG_MTK_SCPSYS=m: module (GKI/vendor_dlkm approach)
- CONFIG_MTK_SCPSYS is not set: disabled

The tristate option is the standard kernel pattern for drivers that
need to support both built-in and modular configurations without
requiring separate Kconfig options.

This aligns common/staging with the equivalent change in
private/desktop-google, ensuring consistent configuration across
both kernel trees.

Signed-off-by: Justin Yeh <justin.yeh@mediatek.com>
---
 drivers/pmdomain/mediatek/Kconfig | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/drivers/pmdomain/mediatek/Kconfig b/drivers/pmdomain/mediatek/Kconfig
index 8923e6516441..bf5108ba360a 100644
--- a/drivers/pmdomain/mediatek/Kconfig
+++ b/drivers/pmdomain/mediatek/Kconfig
@@ -4,7 +4,7 @@ menu "MediaTek PM Domains"
 	depends on ARCH_MEDIATEK || COMPILE_TEST
 
 config MTK_SCPSYS
-	bool "MediaTek SCPSYS Support"
+	tristate "MediaTek SCPSYS Support"
 	default ARCH_MEDIATEK
 	depends on OF
 	select REGMAP
-- 
2.45.2


^ permalink raw reply	[flat|nested] 4+ messages in thread

* [PATCH 2/2] pmdomain: mediatek: Add MODULE_DESCRIPTION to mtk-scpsys
  2026-06-03  5:11 [PATCH 0/2] pmdomain: mediatek: Enable module support for mtk-scpsys Justin Yeh
  2026-06-03  5:11 ` [PATCH 1/2] pmdomain: mediatek: Convert MTK_SCPSYS to tristate Justin Yeh
@ 2026-06-03  5:11 ` Justin Yeh
  2026-06-23  8:06 ` [PATCH 0/2] pmdomain: mediatek: Enable module support for mtk-scpsys AngeloGioacchino Del Regno
  2 siblings, 0 replies; 4+ messages in thread
From: Justin Yeh @ 2026-06-03  5:11 UTC (permalink / raw)
  To: Ulf Hansson, Matthias Brugger, AngeloGioacchino Del Regno
  Cc: Project_Global_Chrome_Upstream_Group, linux-pm, linux-kernel,
	linux-arm-kernel, linux-mediatek, Justin Yeh

Kernel modpost in v6.x emits a warning when a module is missing
MODULE_DESCRIPTION():

  WARNING: modpost: missing MODULE_DESCRIPTION() in mtk-scpsys.o

Add MODULE_DESCRIPTION() to mtk-scpsys.c to silence the warning.

Signed-off-by: Justin Yeh <justin.yeh@mediatek.com>
---
 drivers/pmdomain/mediatek/mtk-scpsys.c | 5 ++++-
 1 file changed, 4 insertions(+), 1 deletion(-)

diff --git a/drivers/pmdomain/mediatek/mtk-scpsys.c b/drivers/pmdomain/mediatek/mtk-scpsys.c
index efc8f276ffce..bfaa6c8f88dc 100644
--- a/drivers/pmdomain/mediatek/mtk-scpsys.c
+++ b/drivers/pmdomain/mediatek/mtk-scpsys.c
@@ -1151,4 +1151,7 @@ static struct platform_driver scpsys_drv = {
 		.of_match_table = of_scpsys_match_tbl,
 	},
 };
-builtin_platform_driver(scpsys_drv);
+
+module_platform_driver(scpsys_drv);
+MODULE_DESCRIPTION("MediaTek SCPSYS power domain driver");
+MODULE_LICENSE("GPL");
-- 
2.45.2


^ permalink raw reply	[flat|nested] 4+ messages in thread

* Re: [PATCH 0/2] pmdomain: mediatek: Enable module support for mtk-scpsys
  2026-06-03  5:11 [PATCH 0/2] pmdomain: mediatek: Enable module support for mtk-scpsys Justin Yeh
  2026-06-03  5:11 ` [PATCH 1/2] pmdomain: mediatek: Convert MTK_SCPSYS to tristate Justin Yeh
  2026-06-03  5:11 ` [PATCH 2/2] pmdomain: mediatek: Add MODULE_DESCRIPTION to mtk-scpsys Justin Yeh
@ 2026-06-23  8:06 ` AngeloGioacchino Del Regno
  2 siblings, 0 replies; 4+ messages in thread
From: AngeloGioacchino Del Regno @ 2026-06-23  8:06 UTC (permalink / raw)
  To: Justin Yeh, Ulf Hansson, Matthias Brugger
  Cc: Project_Global_Chrome_Upstream_Group, linux-pm, linux-kernel,
	linux-arm-kernel, linux-mediatek

On 6/3/26 07:11, Justin Yeh wrote:
> This series enables the MTK_SCPSYS driver to be built as a loadable
> module for GKI (Generic Kernel Image) compliance.
> 
> This series depends on the following patches currently under review:
>    - soc: mediatek: Allow MTK_INFRACFG to be built as module
>    - soc: mediatek: mtk-infracfg: Export symbols for DDK modules
> 
> The MTK_SCPSYS driver depends on MTK_INFRACFG being available as a
> module, which is enabled by these prerequisite patches.
> 
> Patch 1 converts the Kconfig option from bool to tristate, allowing
> the driver to be built as either built-in or as a module.
> 
> Patch 2 adds MODULE_DESCRIPTION() and converts to module_platform_driver()
> to complete the modularization and silence modpost warnings.
> 
> Together these changes allow the MediaTek SCPSYS power domain driver
> to support modern Android GKI/vendor_dlkm module loading requirements
> while maintaining backward compatibility with the traditional built-in
> configuration.
> 

The mtk-scpsys driver should disappear, really.
This is something that was rewritten entirely and is called mtk-pm-domains now.

This driver still contains support for some very old SoCs that were not migrated
to the new mtk-pm-domains driver, but seriously, the strategy here should be to
migrate those and let the mtk-scpsys driver be there just as a legacy one to not
break the ABI for older devicetrees.

Converting this as a module is probably a bad idea, because this one didn't get
any real update for years now, and I'm not sure what is going to break by doing
so - neither I have any way of testing it.

I can say Reviewed-by if you can test booting MT2701, MT2712, MT7622, MT7623A
(all of them, really) on a build that has this driver as module and check that
all functionality is ok... but I guess you may also have difficulties in doing
that (do you even have access to old devices with those SoCs?).

Cheers,
Angelo

> Justin Yeh (2):
>    pmdomain: mediatek: Convert MTK_SCPSYS to tristate
>    pmdomain: mediatek: Add MODULE_DESCRIPTION to mtk-scpsys
> 
>   drivers/pmdomain/mediatek/Kconfig      | 2 +-
>   drivers/pmdomain/mediatek/mtk-scpsys.c | 5 ++++-
>   2 files changed, 5 insertions(+), 2 deletions(-)
> 


^ permalink raw reply	[flat|nested] 4+ messages in thread

end of thread, other threads:[~2026-06-23  8:06 UTC | newest]

Thread overview: 4+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2026-06-03  5:11 [PATCH 0/2] pmdomain: mediatek: Enable module support for mtk-scpsys Justin Yeh
2026-06-03  5:11 ` [PATCH 1/2] pmdomain: mediatek: Convert MTK_SCPSYS to tristate Justin Yeh
2026-06-03  5:11 ` [PATCH 2/2] pmdomain: mediatek: Add MODULE_DESCRIPTION to mtk-scpsys Justin Yeh
2026-06-23  8:06 ` [PATCH 0/2] pmdomain: mediatek: Enable module support for mtk-scpsys AngeloGioacchino Del Regno

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox