mirror of https://lore.kernel.org/lkml/
 help / color / mirror / Atom feed
* [PATCH 0/2] Allow mtk-regulator-coupler to be built as a module
@ 2026-09-03  6:20 Justin Yeh
  2026-09-03  6:20 ` [PATCH 1/2] regulator: core: Export helpers used by regulator couplers Justin Yeh
                   ` (4 more replies)
  0 siblings, 5 replies; 8+ messages in thread
From: Justin Yeh @ 2026-09-03  6:20 UTC (permalink / raw)
  To: Liam Girdwood, Mark Brown, Matthias Brugger, AngeloGioacchino Del Regno
  Cc: Project_Global_Chrome_Upstream_Group, linux-arm-kernel,
	linux-kernel, linux-mediatek, Justin Yeh

MTK_REGULATOR_COUPLER can currently only be built into the kernel: it is
a bool, and its prompt is hidden unless COMPILE_TEST is set, so on real
MediaTek configurations the symbol has no prompt and is forced to its
"default ARCH_MEDIATEK" value.

Kernels that ship nearly everything as a module (Android GKI style
kernels, but distro kernels have the same shape) cannot use it that way.
Two things are in the way:

  - the four helpers the coupler calls are declared in
    include/linux/regulator/coupler.h for coupler implementations to
    use, but none of them is exported (patch 1);

  - the Kconfig symbol is a bool without a usable prompt (patch 2).

With both patches applied, CONFIG_MTK_REGULATOR_COUPLER=m builds and
mtk_regulator_coupler.ko loads and registers the coupler. Existing
configurations are unaffected: "default ARCH_MEDIATEK" is kept, so they
keep building the coupler in.

Justin Yeh (2):
  regulator: core: Export helpers used by regulator couplers
  soc: mediatek: mtk-regulator-coupler: Allow building as a module

 drivers/regulator/core.c     | 4 ++++
 drivers/soc/mediatek/Kconfig | 6 +++++-
 2 files changed, 9 insertions(+), 1 deletion(-)

-- 
2.45.2


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

* [PATCH 1/2] regulator: core: Export helpers used by regulator couplers
  2026-09-03  6:20 [PATCH 0/2] Allow mtk-regulator-coupler to be built as a module Justin Yeh
@ 2026-09-03  6:20 ` Justin Yeh
  2026-09-03 23:07   ` Mark Brown
  2026-09-03  6:20 ` [PATCH 2/2] soc: mediatek: mtk-regulator-coupler: Allow building as a module Justin Yeh
                   ` (3 subsequent siblings)
  4 siblings, 1 reply; 8+ messages in thread
From: Justin Yeh @ 2026-09-03  6:20 UTC (permalink / raw)
  To: Liam Girdwood, Mark Brown, Matthias Brugger, AngeloGioacchino Del Regno
  Cc: Project_Global_Chrome_Upstream_Group, linux-arm-kernel,
	linux-kernel, linux-mediatek, Justin Yeh

regulator_check_voltage(), regulator_check_consumers(),
regulator_do_balance_voltage() and regulator_coupler_register() are
already declared in include/linux/regulator/coupler.h for regulator
coupler implementations to use, but none of them is exported. That
limits couplers to being built into the kernel.

Export them so that coupler drivers can be built as loadable modules.

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

diff --git a/drivers/regulator/core.c b/drivers/regulator/core.c
index 6a4008f387b5..6b7e613fbaaa 100644
--- a/drivers/regulator/core.c
+++ b/drivers/regulator/core.c
@@ -462,6 +462,7 @@ int regulator_check_voltage(struct regulator_dev *rdev,
 
 	return 0;
 }
+EXPORT_SYMBOL_GPL(regulator_check_voltage);
 
 /* return 0 if the state is valid */
 static int regulator_check_states(suspend_state_t state)
@@ -502,6 +503,7 @@ int regulator_check_consumers(struct regulator_dev *rdev,
 
 	return 0;
 }
+EXPORT_SYMBOL_GPL(regulator_check_consumers);
 
 /* current constraint check */
 static int regulator_check_current_limit(struct regulator_dev *rdev,
@@ -4468,6 +4470,7 @@ int regulator_do_balance_voltage(struct regulator_dev *rdev,
 out:
 	return ret;
 }
+EXPORT_SYMBOL_GPL(regulator_do_balance_voltage);
 
 static int regulator_balance_voltage(struct regulator_dev *rdev,
 				     suspend_state_t state)
@@ -5797,6 +5800,7 @@ int regulator_coupler_register(struct regulator_coupler *coupler)
 
 	return 0;
 }
+EXPORT_SYMBOL_GPL(regulator_coupler_register);
 
 static struct regulator_coupler *
 regulator_find_coupler(struct regulator_dev *rdev)
-- 
2.45.2


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

* [PATCH 2/2] soc: mediatek: mtk-regulator-coupler: Allow building as a module
  2026-09-03  6:20 [PATCH 0/2] Allow mtk-regulator-coupler to be built as a module Justin Yeh
  2026-09-03  6:20 ` [PATCH 1/2] regulator: core: Export helpers used by regulator couplers Justin Yeh
@ 2026-09-03  6:20 ` Justin Yeh
  2026-09-18  0:37 ` [PATCH 0/2] Allow mtk-regulator-coupler to be built " Justin Yeh
                   ` (2 subsequent siblings)
  4 siblings, 0 replies; 8+ messages in thread
From: Justin Yeh @ 2026-09-03  6:20 UTC (permalink / raw)
  To: Liam Girdwood, Mark Brown, Matthias Brugger, AngeloGioacchino Del Regno
  Cc: Project_Global_Chrome_Upstream_Group, linux-arm-kernel,
	linux-kernel, linux-mediatek, Justin Yeh

MTK_REGULATOR_COUPLER is a bool whose prompt is only visible when
COMPILE_TEST is set, so on real MediaTek configurations the symbol has
no prompt at all and is forced to its default: it can only ever be
built in.

Turn it into a visible tristate so that the coupler can also be built
as a loadable module, which is what kernels shipping most of their
drivers as modules need. The "default ARCH_MEDIATEK" is kept, so
existing configurations keep building it in.

While at it, add the help text that the now user-visible prompt was
missing.

Signed-off-by: Justin Yeh <justin.yeh@mediatek.com>
---
 drivers/soc/mediatek/Kconfig | 6 +++++-
 1 file changed, 5 insertions(+), 1 deletion(-)

diff --git a/drivers/soc/mediatek/Kconfig b/drivers/soc/mediatek/Kconfig
index d7293977f06e..4a2f2bccc213 100644
--- a/drivers/soc/mediatek/Kconfig
+++ b/drivers/soc/mediatek/Kconfig
@@ -56,9 +56,13 @@ config MTK_PMIC_WRAP
 	  hardware to connect the PMIC.
 
 config MTK_REGULATOR_COUPLER
-	bool "MediaTek SoC Regulator Coupler" if COMPILE_TEST
+	tristate "MediaTek SoC Regulator Coupler"
 	default ARCH_MEDIATEK
 	depends on REGULATOR
+	help
+	  Say yes here to add support for the MediaTek regulator coupler,
+	  which keeps the GPU supply and its coupled GPU SRAM supply
+	  voltage-balanced on the MediaTek SoCs that need it.
 
 config MTK_MMSYS
 	tristate "MediaTek MMSYS Support"
-- 
2.45.2


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

* Re: [PATCH 1/2] regulator: core: Export helpers used by regulator couplers
  2026-09-03  6:20 ` [PATCH 1/2] regulator: core: Export helpers used by regulator couplers Justin Yeh
@ 2026-09-03 23:07   ` Mark Brown
  0 siblings, 0 replies; 8+ messages in thread
From: Mark Brown @ 2026-09-03 23:07 UTC (permalink / raw)
  To: Justin Yeh
  Cc: Liam Girdwood, Matthias Brugger, AngeloGioacchino Del Regno,
	Project_Global_Chrome_Upstream_Group, linux-arm-kernel,
	linux-kernel, linux-mediatek

[-- Attachment #1: Type: text/plain, Size: 420 bytes --]

On Thu, Sep 03, 2026 at 02:20:46PM +0800, Justin Yeh wrote:
> regulator_check_voltage(), regulator_check_consumers(),
> regulator_do_balance_voltage() and regulator_coupler_register() are
> already declared in include/linux/regulator/coupler.h for regulator
> coupler implementations to use, but none of them is exported. That
> limits couplers to being built into the kernel.

Acked-by: Mark Brown <broonie@kernel.org>

[-- Attachment #2: signature.asc --]
[-- Type: application/pgp-signature, Size: 488 bytes --]

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

* Re: [PATCH 0/2] Allow mtk-regulator-coupler to be built as a module
  2026-09-03  6:20 [PATCH 0/2] Allow mtk-regulator-coupler to be built as a module Justin Yeh
  2026-09-03  6:20 ` [PATCH 1/2] regulator: core: Export helpers used by regulator couplers Justin Yeh
  2026-09-03  6:20 ` [PATCH 2/2] soc: mediatek: mtk-regulator-coupler: Allow building as a module Justin Yeh
@ 2026-09-18  0:37 ` Justin Yeh
  2026-09-18  9:26   ` Mark Brown
  2026-09-25 17:45 ` (subset) " Mark Brown
  2026-09-25 22:15 ` Mark Brown
  4 siblings, 1 reply; 8+ messages in thread
From: Justin Yeh @ 2026-09-18  0:37 UTC (permalink / raw)
  To: Liam Girdwood, Mark Brown, Matthias Brugger, AngeloGioacchino Del Regno
  Cc: Project_Global_Chrome_Upstream_Group, linux-arm-kernel,
	linux-kernel, linux-mediatek

Hi Mark, Liam, Matthias, Angelo,

Gentle ping on this series, sent two weeks ago:
https://lore.kernel.org/all/20260903062056.1024263-1-justin.yeh@mediatek.com/

Is it OK to pick up as it is, or is there something you would like me to
change first?

One note on the routing: patch 2/2 (soc/mediatek Kconfig) depends on the
exports added by patch 1/2 (regulator core), so the two have to land in
that order - ideally via the same tree.

Thanks,
Justin

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

* Re: [PATCH 0/2] Allow mtk-regulator-coupler to be built as a module
  2026-09-18  0:37 ` [PATCH 0/2] Allow mtk-regulator-coupler to be built " Justin Yeh
@ 2026-09-18  9:26   ` Mark Brown
  0 siblings, 0 replies; 8+ messages in thread
From: Mark Brown @ 2026-09-18  9:26 UTC (permalink / raw)
  To: Justin Yeh
  Cc: Liam Girdwood, Matthias Brugger, AngeloGioacchino Del Regno,
	Project_Global_Chrome_Upstream_Group, linux-arm-kernel,
	linux-kernel, linux-mediatek

[-- Attachment #1: Type: text/plain, Size: 998 bytes --]

On Fri, Sep 18, 2026 at 08:37:22AM +0800, Justin Yeh wrote:
> Hi Mark, Liam, Matthias, Angelo,
> 
> Gentle ping on this series, sent two weeks ago:
> https://lore.kernel.org/all/20260903062056.1024263-1-justin.yeh@mediatek.com/

Please don't send content free pings and please allow a reasonable time
for review.  People get busy, go on holiday, attend conferences and so 
on so unless there is some reason for urgency (like critical bug fixes)
please allow at least a couple of weeks for review.  If there have been
review comments then people may be waiting for those to be addressed.

Sending content free pings adds to the mail volume (if they are seen at
all) which is often the problem and since they can't be reviewed
directly if something has gone wrong you'll have to resend the patches
anyway, so sending again is generally a better approach though there are
some other maintainers who like them - if in doubt look at how patches
for the subsystem are normally handled.

[-- Attachment #2: signature.asc --]
[-- Type: application/pgp-signature, Size: 488 bytes --]

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

* Re: (subset) [PATCH 0/2] Allow mtk-regulator-coupler to be built as a module
  2026-09-03  6:20 [PATCH 0/2] Allow mtk-regulator-coupler to be built as a module Justin Yeh
                   ` (2 preceding siblings ...)
  2026-09-18  0:37 ` [PATCH 0/2] Allow mtk-regulator-coupler to be built " Justin Yeh
@ 2026-09-25 17:45 ` Mark Brown
  2026-09-25 22:15 ` Mark Brown
  4 siblings, 0 replies; 8+ messages in thread
From: Mark Brown @ 2026-09-25 17:45 UTC (permalink / raw)
  To: Liam Girdwood, Matthias Brugger, AngeloGioacchino Del Regno, Justin Yeh
  Cc: Project_Global_Chrome_Upstream_Group, linux-arm-kernel,
	linux-kernel, linux-mediatek

On Thu, 03 Sep 2026 14:20:45 +0800, Justin Yeh wrote:
> Allow mtk-regulator-coupler to be built as a module
> 
> MTK_REGULATOR_COUPLER can currently only be built into the kernel: it is
> a bool, and its prompt is hidden unless COMPILE_TEST is set, so on real
> MediaTek configurations the symbol has no prompt and is forced to its
> "default ARCH_MEDIATEK" value.
> 
> [...]

Applied to

   https://git.kernel.org/pub/scm/linux/kernel/git/broonie/regulator.git for-7.4

Thanks!

[1/2] regulator: core: Export helpers used by regulator couplers
      https://git.kernel.org/broonie/regulator/c/59951bd9c6b6

All being well this means that it will be integrated into the linux-next
tree (usually sometime in the next 24 hours) and sent to Linus during
the next merge window (or sooner if it is a bug fix), however if
problems are discovered then the patch may be dropped or reverted.

You may get further e-mails resulting from automated or manual testing
and review of the tree, please engage with people reporting problems and
send followup patches addressing any issues that are reported if needed.

If any updates are required or you are submitting further changes they
should be sent as incremental updates against current git, existing
patches will not be replaced.

Please add any relevant lists and maintainers to the CCs when replying
to this mail.

Thanks,
Mark


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

* Re: [PATCH 0/2] Allow mtk-regulator-coupler to be built as a module
  2026-09-03  6:20 [PATCH 0/2] Allow mtk-regulator-coupler to be built as a module Justin Yeh
                   ` (3 preceding siblings ...)
  2026-09-25 17:45 ` (subset) " Mark Brown
@ 2026-09-25 22:15 ` Mark Brown
  4 siblings, 0 replies; 8+ messages in thread
From: Mark Brown @ 2026-09-25 22:15 UTC (permalink / raw)
  To: Justin Yeh
  Cc: Liam Girdwood, Matthias Brugger, AngeloGioacchino Del Regno,
	Project_Global_Chrome_Upstream_Group, linux-arm-kernel,
	linux-kernel, linux-mediatek

[-- Attachment #1: Type: text/plain, Size: 1547 bytes --]

On Thu, Sep 03, 2026 at 02:20:45PM +0800, Justin Yeh wrote:
> MTK_REGULATOR_COUPLER can currently only be built into the kernel: it is
> a bool, and its prompt is hidden unless COMPILE_TEST is set, so on real
> MediaTek configurations the symbol has no prompt and is forced to its
> "default ARCH_MEDIATEK" value.

The following changes since commit 940de590b839f71d6dc846160534bf202401b8b7:

  Merge tag 'hardening-v7.3-rc2' of git://git.kernel.org/pub/scm/linux/kernel/git/kees/linux (2026-09-02 16:02:02 -0700)

are available in the Git repository at:

  https://git.kernel.org/pub/scm/linux/kernel/git/broonie/regulator.git tags/regulator-export-coupling-api

for you to fetch changes up to 59951bd9c6b63d4d98539db96becef729ad60b4a:

  regulator: core: Export helpers used by regulator couplers (2026-09-25 18:44:46 +0100)

----------------------------------------------------------------
regulator: core: Export helpers used by regulator couplers

regulator_check_voltage(), regulator_check_consumers(),
regulator_do_balance_voltage() and regulator_coupler_register() are
already declared in include/linux/regulator/coupler.h for regulator
coupler implementations to use, but none of them is exported. That
limits couplers to being built into the kernel.

Export them so that coupler drivers can be built as loadable modules.

----------------------------------------------------------------
Justin Yeh (1):
      regulator: core: Export helpers used by regulator couplers

 drivers/regulator/core.c | 4 ++++
 1 file changed, 4 insertions(+)

[-- Attachment #2: signature.asc --]
[-- Type: application/pgp-signature, Size: 488 bytes --]

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

end of thread, other threads:[~2026-09-25 22:15 UTC | newest]

Thread overview: 8+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2026-09-03  6:20 [PATCH 0/2] Allow mtk-regulator-coupler to be built as a module Justin Yeh
2026-09-03  6:20 ` [PATCH 1/2] regulator: core: Export helpers used by regulator couplers Justin Yeh
2026-09-03 23:07   ` Mark Brown
2026-09-03  6:20 ` [PATCH 2/2] soc: mediatek: mtk-regulator-coupler: Allow building as a module Justin Yeh
2026-09-18  0:37 ` [PATCH 0/2] Allow mtk-regulator-coupler to be built " Justin Yeh
2026-09-18  9:26   ` Mark Brown
2026-09-25 17:45 ` (subset) " Mark Brown
2026-09-25 22:15 ` Mark Brown

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®