[PATCH] regulator: sy8827n: make enable gpio NONEXCLUSIVE

Jisheng Zhang posted 1 patch 3 months, 1 week ago
drivers/regulator/sy8827n.c | 3 ++-
1 file changed, 2 insertions(+), 1 deletion(-)
[PATCH] regulator: sy8827n: make enable gpio NONEXCLUSIVE
Posted by Jisheng Zhang 3 months, 1 week ago
On some platforms, the sy8827n enable gpio may also be used for other
purpose, so make it NONEXCLUSIVE to support this case.

Signed-off-by: Jisheng Zhang <jszhang@kernel.org>
---
 drivers/regulator/sy8827n.c | 3 ++-
 1 file changed, 2 insertions(+), 1 deletion(-)

diff --git a/drivers/regulator/sy8827n.c b/drivers/regulator/sy8827n.c
index f11ff38b36c9..0b811514782f 100644
--- a/drivers/regulator/sy8827n.c
+++ b/drivers/regulator/sy8827n.c
@@ -140,7 +140,8 @@ static int sy8827n_i2c_probe(struct i2c_client *client)
 		return -EINVAL;
 	}
 
-	di->en_gpio = devm_gpiod_get_optional(dev, "enable", GPIOD_OUT_HIGH);
+	di->en_gpio = devm_gpiod_get_optional(dev, "enable",
+			GPIOD_OUT_HIGH | GPIOD_FLAGS_BIT_NONEXCLUSIVE);
 	if (IS_ERR(di->en_gpio))
 		return PTR_ERR(di->en_gpio);
 
-- 
2.49.0
Re: [PATCH] regulator: sy8827n: make enable gpio NONEXCLUSIVE
Posted by Mark Brown 3 months ago
On Sun, 29 Jun 2025 17:57:16 +0800, Jisheng Zhang wrote:
> On some platforms, the sy8827n enable gpio may also be used for other
> purpose, so make it NONEXCLUSIVE to support this case.
> 
> 

Applied to

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

Thanks!

[1/1] regulator: sy8827n: make enable gpio NONEXCLUSIVE
      commit: 5054740e0092aac528c0589251f612b3b41c9e7b

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
Re: [PATCH] regulator: sy8827n: make enable gpio NONEXCLUSIVE
Posted by Mark Brown 3 months, 1 week ago
On Sun, Jun 29, 2025 at 05:57:16PM +0800, Jisheng Zhang wrote:
> On some platforms, the sy8827n enable gpio may also be used for other
> purpose, so make it NONEXCLUSIVE to support this case.

When you say "other purpose" which other purposes do you mean - another
regulator, or something else?
Re: [PATCH] regulator: sy8827n: make enable gpio NONEXCLUSIVE
Posted by Jisheng Zhang 3 months ago
On Mon, Jun 30, 2025 at 04:02:24PM +0100, Mark Brown wrote:
> On Sun, Jun 29, 2025 at 05:57:16PM +0800, Jisheng Zhang wrote:
> > On some platforms, the sy8827n enable gpio may also be used for other
> > purpose, so make it NONEXCLUSIVE to support this case.
> 
> When you say "other purpose" which other purposes do you mean - another
> regulator, or something else?

Yep, other regulators in my usage case.
Re: [PATCH] regulator: sy8827n: make enable gpio NONEXCLUSIVE
Posted by Bartosz Golaszewski 3 months, 1 week ago
On Sun, Jun 29, 2025 at 12:14 PM Jisheng Zhang <jszhang@kernel.org> wrote:
>
> On some platforms, the sy8827n enable gpio may also be used for other
> purpose, so make it NONEXCLUSIVE to support this case.
>
> Signed-off-by: Jisheng Zhang <jszhang@kernel.org>
> ---
>  drivers/regulator/sy8827n.c | 3 ++-
>  1 file changed, 2 insertions(+), 1 deletion(-)
>
> diff --git a/drivers/regulator/sy8827n.c b/drivers/regulator/sy8827n.c
> index f11ff38b36c9..0b811514782f 100644
> --- a/drivers/regulator/sy8827n.c
> +++ b/drivers/regulator/sy8827n.c
> @@ -140,7 +140,8 @@ static int sy8827n_i2c_probe(struct i2c_client *client)
>                 return -EINVAL;
>         }
>
> -       di->en_gpio = devm_gpiod_get_optional(dev, "enable", GPIOD_OUT_HIGH);
> +       di->en_gpio = devm_gpiod_get_optional(dev, "enable",
> +                       GPIOD_OUT_HIGH | GPIOD_FLAGS_BIT_NONEXCLUSIVE);
>         if (IS_ERR(di->en_gpio))
>                 return PTR_ERR(di->en_gpio);
>
> --
> 2.49.0
>

As explained in the discussion about this flag: I hate this but I
haven't yet gotten around to proposing an alternative, so reluctantly:

Acked-by: Bartosz Golaszewski <bartosz.golaszewski@linaro.org>