Linux GPIO subsystem development
 help / color / mirror / Atom feed
* [PATCH V2 1/2] gpiolib: of: Add polarity quirk for s5m8767
@ 2025-03-27  0:49 Peng Fan (OSS)
  2025-03-27  0:49 ` [PATCH V2 2/2] regulator: s5m8767: Convert to GPIO descriptors Peng Fan (OSS)
                   ` (5 more replies)
  0 siblings, 6 replies; 13+ messages in thread
From: Peng Fan (OSS) @ 2025-03-27  0:49 UTC (permalink / raw)
  To: linus.walleij, brgl, krzk, lgirdwood, broonie, andriy.shevchenko
  Cc: linux-gpio, linux-kernel, linux-samsung-soc, Peng Fan

From: Peng Fan <peng.fan@nxp.com>

This is prepare patch for switching s5m8767 regulator driver to
use GPIO descriptor. DTS for exynos5250 spring incorrectly specifies
"active low" polarity for the DVS and DS line. But per datasheet,
they are actually active high. So add polarity quirk for it.

Signed-off-by: Peng Fan <peng.fan@nxp.com>
---

V2:
 New patch

 drivers/gpio/gpiolib-of.c | 9 +++++++++
 1 file changed, 9 insertions(+)

diff --git a/drivers/gpio/gpiolib-of.c b/drivers/gpio/gpiolib-of.c
index eb667f8f1ead..83559dd24f32 100644
--- a/drivers/gpio/gpiolib-of.c
+++ b/drivers/gpio/gpiolib-of.c
@@ -222,6 +222,15 @@ static void of_gpio_try_fixup_polarity(const struct device_node *np,
 		 */
 		{ "lantiq,pci-xway",	"gpio-reset",	false },
 #endif
+#if IS_ENABLED(CONFIG_REGULATOR_S5M8767)
+		/*
+		 * According to S5M8767, the DVS and DS pin are
+		 * active-high signals. However, exynos5250-spring.dts use
+		 * active-low setting.
+		 */
+		{ "samsung,s5m8767-pmic", "s5m8767,pmic-buck-dvs-gpios", true },
+		{ "samsung,s5m8767-pmic", "s5m8767,pmic-buck-ds-gpios", true },
+#endif
 #if IS_ENABLED(CONFIG_TOUCHSCREEN_TSC2005)
 		/*
 		 * DTS for Nokia N900 incorrectly specified "active high"
-- 
2.37.1


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

* [PATCH V2 2/2] regulator: s5m8767: Convert to GPIO descriptors
  2025-03-27  0:49 [PATCH V2 1/2] gpiolib: of: Add polarity quirk for s5m8767 Peng Fan (OSS)
@ 2025-03-27  0:49 ` Peng Fan (OSS)
  2025-03-27 11:37   ` Andy Shevchenko
                     ` (3 more replies)
  2025-03-27  8:55 ` [PATCH V2 1/2] gpiolib: of: Add polarity quirk for s5m8767 Bartosz Golaszewski
                   ` (4 subsequent siblings)
  5 siblings, 4 replies; 13+ messages in thread
From: Peng Fan (OSS) @ 2025-03-27  0:49 UTC (permalink / raw)
  To: linus.walleij, brgl, krzk, lgirdwood, broonie, andriy.shevchenko
  Cc: linux-gpio, linux-kernel, linux-samsung-soc, Peng Fan

From: Peng Fan <peng.fan@nxp.com>

Update the driver to fetch buck_gpio and buck_ds as GPIO descriptors.
Then drop the usage of 'of_gpio.h' which should be deprecated.
Based on commit 84618d5e31cf ("regulator: max8997:
Convert to GPIO descriptors") as a reference to make the changes.

With the quirk fix for s5m8767 in of_gpio_try_fixup_polarity,
the polarity will be active-high, even if exynos5250 spring DTS
wrongly use active-low polarity. So using GPIO descriptors,
it should work as before.

Signed-off-by: Peng Fan <peng.fan@nxp.com>
---

V2:
 To address Andy's comments:
  Typo fix
  Format update
  Use !!(temp_index & BIT(x))

  I not have devices to test, just my best practice to work out this patch.

 drivers/regulator/s5m8767.c | 146 ++++++++++--------------------------
 1 file changed, 38 insertions(+), 108 deletions(-)

diff --git a/drivers/regulator/s5m8767.c b/drivers/regulator/s5m8767.c
index d25cd81e3f36..fe2631378ccd 100644
--- a/drivers/regulator/s5m8767.c
+++ b/drivers/regulator/s5m8767.c
@@ -5,7 +5,7 @@
 
 #include <linux/cleanup.h>
 #include <linux/err.h>
-#include <linux/of_gpio.h>
+#include <linux/of.h>
 #include <linux/gpio/consumer.h>
 #include <linux/module.h>
 #include <linux/platform_device.h>
@@ -35,8 +35,8 @@ struct s5m8767_info {
 	u8 buck2_vol[8];
 	u8 buck3_vol[8];
 	u8 buck4_vol[8];
-	int buck_gpios[3];
-	int buck_ds[3];
+	struct gpio_desc *buck_gpios[3];
+	struct gpio_desc *buck_ds[3];
 	int buck_gpioindex;
 };
 
@@ -272,9 +272,9 @@ static inline int s5m8767_set_high(struct s5m8767_info *s5m8767)
 {
 	int temp_index = s5m8767->buck_gpioindex;
 
-	gpio_set_value(s5m8767->buck_gpios[0], (temp_index >> 2) & 0x1);
-	gpio_set_value(s5m8767->buck_gpios[1], (temp_index >> 1) & 0x1);
-	gpio_set_value(s5m8767->buck_gpios[2], temp_index & 0x1);
+	gpiod_set_value(s5m8767->buck_gpios[0], !!(temp_index & BIT(2)));
+	gpiod_set_value(s5m8767->buck_gpios[1], !!(temp_index & BIT(1)));
+	gpiod_set_value(s5m8767->buck_gpios[2], !!(temp_index & BIT(0)));
 
 	return 0;
 }
@@ -283,9 +283,9 @@ static inline int s5m8767_set_low(struct s5m8767_info *s5m8767)
 {
 	int temp_index = s5m8767->buck_gpioindex;
 
-	gpio_set_value(s5m8767->buck_gpios[2], temp_index & 0x1);
-	gpio_set_value(s5m8767->buck_gpios[1], (temp_index >> 1) & 0x1);
-	gpio_set_value(s5m8767->buck_gpios[0], (temp_index >> 2) & 0x1);
+	gpiod_set_value(s5m8767->buck_gpios[2], !!(temp_index & BIT(0)));
+	gpiod_set_value(s5m8767->buck_gpios[1], !!(temp_index & BIT(1)));
+	gpiod_set_value(s5m8767->buck_gpios[0], !!(temp_index & BIT(2)));
 
 	return 0;
 }
@@ -482,42 +482,6 @@ static int s5m8767_enable_ext_control(struct s5m8767_info *s5m8767,
 
 
 #ifdef CONFIG_OF
-static int s5m8767_pmic_dt_parse_dvs_gpio(struct sec_pmic_dev *iodev,
-			struct sec_platform_data *pdata,
-			struct device_node *pmic_np)
-{
-	int i, gpio;
-
-	for (i = 0; i < 3; i++) {
-		gpio = of_get_named_gpio(pmic_np,
-					"s5m8767,pmic-buck-dvs-gpios", i);
-		if (!gpio_is_valid(gpio)) {
-			dev_err(iodev->dev, "invalid gpio[%d]: %d\n", i, gpio);
-			return -EINVAL;
-		}
-		pdata->buck_gpios[i] = gpio;
-	}
-	return 0;
-}
-
-static int s5m8767_pmic_dt_parse_ds_gpio(struct sec_pmic_dev *iodev,
-			struct sec_platform_data *pdata,
-			struct device_node *pmic_np)
-{
-	int i, gpio;
-
-	for (i = 0; i < 3; i++) {
-		gpio = of_get_named_gpio(pmic_np,
-					"s5m8767,pmic-buck-ds-gpios", i);
-		if (!gpio_is_valid(gpio)) {
-			dev_err(iodev->dev, "invalid gpio[%d]: %d\n", i, gpio);
-			return -EINVAL;
-		}
-		pdata->buck_ds[i] = gpio;
-	}
-	return 0;
-}
-
 static int s5m8767_pmic_dt_parse_pdata(struct platform_device *pdev,
 					struct sec_platform_data *pdata)
 {
@@ -525,7 +489,7 @@ static int s5m8767_pmic_dt_parse_pdata(struct platform_device *pdev,
 	struct device_node *pmic_np, *reg_np;
 	struct sec_regulator_data *rdata;
 	struct sec_opmode_data *rmode;
-	unsigned int i, dvs_voltage_nr = 8, ret;
+	unsigned int i, dvs_voltage_nr = 8;
 
 	pmic_np = iodev->dev->of_node;
 	if (!pmic_np) {
@@ -635,10 +599,6 @@ static int s5m8767_pmic_dt_parse_pdata(struct platform_device *pdev,
 
 	if (pdata->buck2_gpiodvs || pdata->buck3_gpiodvs ||
 						pdata->buck4_gpiodvs) {
-		ret = s5m8767_pmic_dt_parse_dvs_gpio(iodev, pdata, pmic_np);
-		if (ret)
-			return -EINVAL;
-
 		if (of_property_read_u32(pmic_np,
 				"s5m8767,pmic-buck-default-dvs-idx",
 				&pdata->buck_default_idx)) {
@@ -652,10 +612,6 @@ static int s5m8767_pmic_dt_parse_pdata(struct platform_device *pdev,
 		}
 	}
 
-	ret = s5m8767_pmic_dt_parse_ds_gpio(iodev, pdata, pmic_np);
-	if (ret)
-		return -EINVAL;
-
 	pdata->buck2_ramp_enable = of_property_read_bool(pmic_np, "s5m8767,pmic-buck2-ramp-enable");
 	pdata->buck3_ramp_enable = of_property_read_bool(pmic_np, "s5m8767,pmic-buck3-ramp-enable");
 	pdata->buck4_ramp_enable = of_property_read_bool(pmic_np, "s5m8767,pmic-buck4-ramp-enable");
@@ -684,6 +640,8 @@ static int s5m8767_pmic_probe(struct platform_device *pdev)
 	struct regulator_config config = { };
 	struct s5m8767_info *s5m8767;
 	int i, ret, buck_init;
+	const char *gpiods_names[3] = { "S5M8767 DS2", "S5M8767 DS3", "S5M8767 DS4" };
+	const char *gpiodvs_names[3] = { "S5M8767 SET1", "S5M8767 SET2", "S5M8767 SET3" };
 
 	if (!pdata) {
 		dev_err(pdev->dev.parent, "Platform data not supplied\n");
@@ -731,12 +689,6 @@ static int s5m8767_pmic_probe(struct platform_device *pdev)
 	s5m8767->buck2_gpiodvs = pdata->buck2_gpiodvs;
 	s5m8767->buck3_gpiodvs = pdata->buck3_gpiodvs;
 	s5m8767->buck4_gpiodvs = pdata->buck4_gpiodvs;
-	s5m8767->buck_gpios[0] = pdata->buck_gpios[0];
-	s5m8767->buck_gpios[1] = pdata->buck_gpios[1];
-	s5m8767->buck_gpios[2] = pdata->buck_gpios[2];
-	s5m8767->buck_ds[0] = pdata->buck_ds[0];
-	s5m8767->buck_ds[1] = pdata->buck_ds[1];
-	s5m8767->buck_ds[2] = pdata->buck_ds[2];
 
 	s5m8767->ramp_delay = pdata->buck_ramp_delay;
 	s5m8767->buck2_ramp = pdata->buck2_ramp_enable;
@@ -787,58 +739,36 @@ static int s5m8767_pmic_probe(struct platform_device *pdev)
 
 	if (pdata->buck2_gpiodvs || pdata->buck3_gpiodvs ||
 						pdata->buck4_gpiodvs) {
+		for (i = 0; i < 3; i++) {
+			enum gpiod_flags flags;
 
-		if (!gpio_is_valid(pdata->buck_gpios[0]) ||
-			!gpio_is_valid(pdata->buck_gpios[1]) ||
-			!gpio_is_valid(pdata->buck_gpios[2])) {
-			dev_err(&pdev->dev, "GPIO NOT VALID\n");
-			return -EINVAL;
-		}
-
-		ret = devm_gpio_request(&pdev->dev, pdata->buck_gpios[0],
-					"S5M8767 SET1");
-		if (ret)
-			return ret;
-
-		ret = devm_gpio_request(&pdev->dev, pdata->buck_gpios[1],
-					"S5M8767 SET2");
-		if (ret)
-			return ret;
-
-		ret = devm_gpio_request(&pdev->dev, pdata->buck_gpios[2],
-					"S5M8767 SET3");
-		if (ret)
-			return ret;
+			if (s5m8767->buck_gpioindex & BIT(2 - i))
+				flags = GPIOD_OUT_HIGH;
+			else
+				flags = GPIOD_OUT_LOW;
+
+			s5m8767->buck_gpios[i] = devm_gpiod_get_index(iodev->dev,
+								      "s5m8767,pmic-buck-dvs", i,
+								      flags);
+			if (IS_ERR(s5m8767->buck_gpios[i])) {
+				return dev_err_probe(iodev->dev, PTR_ERR(s5m8767->buck_gpios[i]),
+						     "invalid gpio[%d]\n", i);
+			}
 
-		/* SET1 GPIO */
-		gpio_direction_output(pdata->buck_gpios[0],
-				(s5m8767->buck_gpioindex >> 2) & 0x1);
-		/* SET2 GPIO */
-		gpio_direction_output(pdata->buck_gpios[1],
-				(s5m8767->buck_gpioindex >> 1) & 0x1);
-		/* SET3 GPIO */
-		gpio_direction_output(pdata->buck_gpios[2],
-				(s5m8767->buck_gpioindex >> 0) & 0x1);
+			gpiod_set_consumer_name(s5m8767->buck_gpios[i], gpiodvs_names[i]);
+		}
 	}
 
-	ret = devm_gpio_request(&pdev->dev, pdata->buck_ds[0], "S5M8767 DS2");
-	if (ret)
-		return ret;
-
-	ret = devm_gpio_request(&pdev->dev, pdata->buck_ds[1], "S5M8767 DS3");
-	if (ret)
-		return ret;
-
-	ret = devm_gpio_request(&pdev->dev, pdata->buck_ds[2], "S5M8767 DS4");
-	if (ret)
-		return ret;
-
-	/* DS2 GPIO */
-	gpio_direction_output(pdata->buck_ds[0], 0x0);
-	/* DS3 GPIO */
-	gpio_direction_output(pdata->buck_ds[1], 0x0);
-	/* DS4 GPIO */
-	gpio_direction_output(pdata->buck_ds[2], 0x0);
+	for (i = 0; i < 3; i++) {
+		s5m8767->buck_ds[i] = devm_gpiod_get_index(iodev->dev,
+							   "s5m8767,pmic-buck-ds", i,
+							   GPIOD_OUT_LOW);
+		if (IS_ERR(s5m8767->buck_ds[i])) {
+			return dev_err_probe(iodev->dev, PTR_ERR(s5m8767->buck_ds[i]),
+					     "can't get GPIO %d\n", i);
+		}
+		gpiod_set_consumer_name(s5m8767->buck_ds[i], gpiods_names[i]);
+	}
 
 	regmap_update_bits(s5m8767->iodev->regmap_pmic,
 			   S5M8767_REG_BUCK2CTRL, 1 << 1,
-- 
2.37.1


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

* Re: [PATCH V2 1/2] gpiolib: of: Add polarity quirk for s5m8767
  2025-03-27  0:49 [PATCH V2 1/2] gpiolib: of: Add polarity quirk for s5m8767 Peng Fan (OSS)
  2025-03-27  0:49 ` [PATCH V2 2/2] regulator: s5m8767: Convert to GPIO descriptors Peng Fan (OSS)
@ 2025-03-27  8:55 ` Bartosz Golaszewski
  2025-03-27 12:05   ` Mark Brown
  2025-03-27 10:15 ` Andy Shevchenko
                   ` (3 subsequent siblings)
  5 siblings, 1 reply; 13+ messages in thread
From: Bartosz Golaszewski @ 2025-03-27  8:55 UTC (permalink / raw)
  To: Peng Fan (OSS), broonie
  Cc: linus.walleij, krzk, lgirdwood, andriy.shevchenko, linux-gpio,
	linux-kernel, linux-samsung-soc, Peng Fan

On Thu, Mar 27, 2025 at 1:50 AM Peng Fan (OSS) <peng.fan@oss.nxp.com> wrote:
>
> From: Peng Fan <peng.fan@nxp.com>
>
> This is prepare patch for switching s5m8767 regulator driver to
> use GPIO descriptor. DTS for exynos5250 spring incorrectly specifies
> "active low" polarity for the DVS and DS line. But per datasheet,
> they are actually active high. So add polarity quirk for it.
>
> Signed-off-by: Peng Fan <peng.fan@nxp.com>
> ---
>
> V2:
>  New patch
>
>  drivers/gpio/gpiolib-of.c | 9 +++++++++
>  1 file changed, 9 insertions(+)
>
> diff --git a/drivers/gpio/gpiolib-of.c b/drivers/gpio/gpiolib-of.c
> index eb667f8f1ead..83559dd24f32 100644
> --- a/drivers/gpio/gpiolib-of.c
> +++ b/drivers/gpio/gpiolib-of.c
> @@ -222,6 +222,15 @@ static void of_gpio_try_fixup_polarity(const struct device_node *np,
>                  */
>                 { "lantiq,pci-xway",    "gpio-reset",   false },
>  #endif
> +#if IS_ENABLED(CONFIG_REGULATOR_S5M8767)
> +               /*
> +                * According to S5M8767, the DVS and DS pin are
> +                * active-high signals. However, exynos5250-spring.dts use
> +                * active-low setting.
> +                */
> +               { "samsung,s5m8767-pmic", "s5m8767,pmic-buck-dvs-gpios", true },
> +               { "samsung,s5m8767-pmic", "s5m8767,pmic-buck-ds-gpios", true },
> +#endif
>  #if IS_ENABLED(CONFIG_TOUCHSCREEN_TSC2005)
>                 /*
>                  * DTS for Nokia N900 incorrectly specified "active high"
> --
> 2.37.1
>

Mark,

Once v6.15-rc1 is tagged, I'd like to pick it up and provide you with
an immutable tag so that you can take the corresponding regulator
patch through your tree, does it sound good to you?

Bartosz

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

* Re: [PATCH V2 1/2] gpiolib: of: Add polarity quirk for s5m8767
  2025-03-27  0:49 [PATCH V2 1/2] gpiolib: of: Add polarity quirk for s5m8767 Peng Fan (OSS)
  2025-03-27  0:49 ` [PATCH V2 2/2] regulator: s5m8767: Convert to GPIO descriptors Peng Fan (OSS)
  2025-03-27  8:55 ` [PATCH V2 1/2] gpiolib: of: Add polarity quirk for s5m8767 Bartosz Golaszewski
@ 2025-03-27 10:15 ` Andy Shevchenko
  2025-03-27 10:25   ` Peng Fan
  2025-03-28  7:50 ` Linus Walleij
                   ` (2 subsequent siblings)
  5 siblings, 1 reply; 13+ messages in thread
From: Andy Shevchenko @ 2025-03-27 10:15 UTC (permalink / raw)
  To: Peng Fan (OSS)
  Cc: linus.walleij, brgl, krzk, lgirdwood, broonie, linux-gpio,
	linux-kernel, linux-samsung-soc, Peng Fan

On Thu, Mar 27, 2025 at 08:49:44AM +0800, Peng Fan (OSS) wrote:
> 
> This is prepare patch for switching s5m8767 regulator driver to
> use GPIO descriptor. DTS for exynos5250 spring incorrectly specifies
> "active low" polarity for the DVS and DS line. But per datasheet,
> they are actually active high. So add polarity quirk for it.

So, to make this clear: this is simply DTS mistake as driver basically ignores
the polarity or other flags in it, correct?

-- 
With Best Regards,
Andy Shevchenko



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

* RE: [PATCH V2 1/2] gpiolib: of: Add polarity quirk for s5m8767
  2025-03-27 10:15 ` Andy Shevchenko
@ 2025-03-27 10:25   ` Peng Fan
  0 siblings, 0 replies; 13+ messages in thread
From: Peng Fan @ 2025-03-27 10:25 UTC (permalink / raw)
  To: Andy Shevchenko, Peng Fan (OSS)
  Cc: linus.walleij@linaro.org, brgl@bgdev.pl, krzk@kernel.org,
	lgirdwood@gmail.com, broonie@kernel.org,
	linux-gpio@vger.kernel.org, linux-kernel@vger.kernel.org,
	linux-samsung-soc@vger.kernel.org

> Subject: Re: [PATCH V2 1/2] gpiolib: of: Add polarity quirk for s5m8767
> 
> On Thu, Mar 27, 2025 at 08:49:44AM +0800, Peng Fan (OSS) wrote:
> >
> > This is prepare patch for switching s5m8767 regulator driver to use
> > GPIO descriptor. DTS for exynos5250 spring incorrectly specifies
> > "active low" polarity for the DVS and DS line. But per datasheet, they
> > are actually active high. So add polarity quirk for it.
> 
> So, to make this clear: this is simply DTS mistake as driver basically
> ignores the polarity or other flags in it, correct?

Correct.

Regards,
Peng.
> 
> --
> With Best Regards,
> Andy Shevchenko
> 


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

* Re: [PATCH V2 2/2] regulator: s5m8767: Convert to GPIO descriptors
  2025-03-27  0:49 ` [PATCH V2 2/2] regulator: s5m8767: Convert to GPIO descriptors Peng Fan (OSS)
@ 2025-03-27 11:37   ` Andy Shevchenko
  2025-03-27 12:03   ` Mark Brown
                     ` (2 subsequent siblings)
  3 siblings, 0 replies; 13+ messages in thread
From: Andy Shevchenko @ 2025-03-27 11:37 UTC (permalink / raw)
  To: Peng Fan (OSS)
  Cc: linus.walleij, brgl, krzk, lgirdwood, broonie, linux-gpio,
	linux-kernel, linux-samsung-soc, Peng Fan

On Thu, Mar 27, 2025 at 08:49:45AM +0800, Peng Fan (OSS) wrote:

> Update the driver to fetch buck_gpio and buck_ds as GPIO descriptors.
> Then drop the usage of 'of_gpio.h' which should be deprecated.
> Based on commit 84618d5e31cf ("regulator: max8997:
> Convert to GPIO descriptors") as a reference to make the changes.
> 
> With the quirk fix for s5m8767 in of_gpio_try_fixup_polarity,
> the polarity will be active-high, even if exynos5250 spring DTS
> wrongly use active-low polarity. So using GPIO descriptors,
> it should work as before.

I was a bit trapped by the set_low and set_high callback implementation,
but I think I understood the idea behind and this code does not change
the original logic.

Reviewed-by: Andy Shevchenko <andriy.shevchenko@linux.intel.com>

-- 
With Best Regards,
Andy Shevchenko



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

* Re: [PATCH V2 2/2] regulator: s5m8767: Convert to GPIO descriptors
  2025-03-27  0:49 ` [PATCH V2 2/2] regulator: s5m8767: Convert to GPIO descriptors Peng Fan (OSS)
  2025-03-27 11:37   ` Andy Shevchenko
@ 2025-03-27 12:03   ` Mark Brown
  2025-03-27 16:54   ` Krzysztof Kozlowski
  2025-03-28  7:49   ` Linus Walleij
  3 siblings, 0 replies; 13+ messages in thread
From: Mark Brown @ 2025-03-27 12:03 UTC (permalink / raw)
  To: Peng Fan (OSS)
  Cc: linus.walleij, brgl, krzk, lgirdwood, andriy.shevchenko,
	linux-gpio, linux-kernel, linux-samsung-soc, Peng Fan

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

On Thu, Mar 27, 2025 at 08:49:45AM +0800, Peng Fan (OSS) wrote:
> From: Peng Fan <peng.fan@nxp.com>
> 
> Update the driver to fetch buck_gpio and buck_ds as GPIO descriptors.
> Then drop the usage of 'of_gpio.h' which should be deprecated.
> Based on commit 84618d5e31cf ("regulator: max8997:
> Convert to GPIO descriptors") as a reference to make the changes.

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

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

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

* Re: [PATCH V2 1/2] gpiolib: of: Add polarity quirk for s5m8767
  2025-03-27  8:55 ` [PATCH V2 1/2] gpiolib: of: Add polarity quirk for s5m8767 Bartosz Golaszewski
@ 2025-03-27 12:05   ` Mark Brown
  0 siblings, 0 replies; 13+ messages in thread
From: Mark Brown @ 2025-03-27 12:05 UTC (permalink / raw)
  To: Bartosz Golaszewski
  Cc: Peng Fan (OSS), linus.walleij, krzk, lgirdwood, andriy.shevchenko,
	linux-gpio, linux-kernel, linux-samsung-soc, Peng Fan

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

On Thu, Mar 27, 2025 at 09:55:03AM +0100, Bartosz Golaszewski wrote:

> Once v6.15-rc1 is tagged, I'd like to pick it up and provide you with
> an immutable tag so that you can take the corresponding regulator
> patch through your tree, does it sound good to you?

Sure.

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

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

* Re: [PATCH V2 2/2] regulator: s5m8767: Convert to GPIO descriptors
  2025-03-27  0:49 ` [PATCH V2 2/2] regulator: s5m8767: Convert to GPIO descriptors Peng Fan (OSS)
  2025-03-27 11:37   ` Andy Shevchenko
  2025-03-27 12:03   ` Mark Brown
@ 2025-03-27 16:54   ` Krzysztof Kozlowski
  2025-03-28  7:49   ` Linus Walleij
  3 siblings, 0 replies; 13+ messages in thread
From: Krzysztof Kozlowski @ 2025-03-27 16:54 UTC (permalink / raw)
  To: Peng Fan (OSS), linus.walleij, brgl, lgirdwood, broonie,
	andriy.shevchenko
  Cc: linux-gpio, linux-kernel, linux-samsung-soc, Peng Fan

On 27/03/2025 01:49, Peng Fan (OSS) wrote:
> From: Peng Fan <peng.fan@nxp.com>
> 
> Update the driver to fetch buck_gpio and buck_ds as GPIO descriptors.
> Then drop the usage of 'of_gpio.h' which should be deprecated.
> Based on commit 84618d5e31cf ("regulator: max8997:
> Convert to GPIO descriptors") as a reference to make the changes.
> 
> With the quirk fix for s5m8767 in of_gpio_try_fixup_polarity,
> the polarity will be active-high, even if exynos5250 spring DTS
> wrongly use active-low polarity. So using GPIO descriptors,
> it should work as before.
> 
> Signed-off-by: Peng Fan <peng.fan@nxp.com>
> ---

Acked-by: Krzysztof Kozlowski <krzysztof.kozlowski@linaro.org>

Best regards,
Krzysztof

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

* Re: [PATCH V2 2/2] regulator: s5m8767: Convert to GPIO descriptors
  2025-03-27  0:49 ` [PATCH V2 2/2] regulator: s5m8767: Convert to GPIO descriptors Peng Fan (OSS)
                     ` (2 preceding siblings ...)
  2025-03-27 16:54   ` Krzysztof Kozlowski
@ 2025-03-28  7:49   ` Linus Walleij
  3 siblings, 0 replies; 13+ messages in thread
From: Linus Walleij @ 2025-03-28  7:49 UTC (permalink / raw)
  To: Peng Fan (OSS)
  Cc: brgl, krzk, lgirdwood, broonie, andriy.shevchenko, linux-gpio,
	linux-kernel, linux-samsung-soc, Peng Fan

On Thu, Mar 27, 2025 at 1:51 AM Peng Fan (OSS) <peng.fan@oss.nxp.com> wrote:

> From: Peng Fan <peng.fan@nxp.com>
>
> Update the driver to fetch buck_gpio and buck_ds as GPIO descriptors.
> Then drop the usage of 'of_gpio.h' which should be deprecated.
> Based on commit 84618d5e31cf ("regulator: max8997:
> Convert to GPIO descriptors") as a reference to make the changes.
>
> With the quirk fix for s5m8767 in of_gpio_try_fixup_polarity,
> the polarity will be active-high, even if exynos5250 spring DTS
> wrongly use active-low polarity. So using GPIO descriptors,
> it should work as before.
>
> Signed-off-by: Peng Fan <peng.fan@nxp.com>

Reviewed-by: Linus Walleij <linus.walleij@linaro.org>

Yours,
Linus Walleij

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

* Re: [PATCH V2 1/2] gpiolib: of: Add polarity quirk for s5m8767
  2025-03-27  0:49 [PATCH V2 1/2] gpiolib: of: Add polarity quirk for s5m8767 Peng Fan (OSS)
                   ` (2 preceding siblings ...)
  2025-03-27 10:15 ` Andy Shevchenko
@ 2025-03-28  7:50 ` Linus Walleij
  2025-04-07  7:42 ` (subset) " Bartosz Golaszewski
  2025-04-07 22:15 ` Mark Brown
  5 siblings, 0 replies; 13+ messages in thread
From: Linus Walleij @ 2025-03-28  7:50 UTC (permalink / raw)
  To: Peng Fan (OSS)
  Cc: brgl, krzk, lgirdwood, broonie, andriy.shevchenko, linux-gpio,
	linux-kernel, linux-samsung-soc, Peng Fan

On Thu, Mar 27, 2025 at 1:50 AM Peng Fan (OSS) <peng.fan@oss.nxp.com> wrote:

> From: Peng Fan <peng.fan@nxp.com>
>
> This is prepare patch for switching s5m8767 regulator driver to
> use GPIO descriptor. DTS for exynos5250 spring incorrectly specifies
> "active low" polarity for the DVS and DS line. But per datasheet,
> they are actually active high. So add polarity quirk for it.
>
> Signed-off-by: Peng Fan <peng.fan@nxp.com>

Reviewed-by: Linus Walleij <linus.walleij@linaro.org>

Yours,
Linus Walleij

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

* Re: (subset) [PATCH V2 1/2] gpiolib: of: Add polarity quirk for s5m8767
  2025-03-27  0:49 [PATCH V2 1/2] gpiolib: of: Add polarity quirk for s5m8767 Peng Fan (OSS)
                   ` (3 preceding siblings ...)
  2025-03-28  7:50 ` Linus Walleij
@ 2025-04-07  7:42 ` Bartosz Golaszewski
  2025-04-07 22:15 ` Mark Brown
  5 siblings, 0 replies; 13+ messages in thread
From: Bartosz Golaszewski @ 2025-04-07  7:42 UTC (permalink / raw)
  To: linus.walleij, brgl, krzk, lgirdwood, broonie, andriy.shevchenko,
	Peng Fan (OSS)
  Cc: Bartosz Golaszewski, linux-gpio, linux-kernel, linux-samsung-soc,
	Peng Fan

From: Bartosz Golaszewski <bartosz.golaszewski@linaro.org>


On Thu, 27 Mar 2025 08:49:44 +0800, Peng Fan (OSS) wrote:
> This is prepare patch for switching s5m8767 regulator driver to
> use GPIO descriptor. DTS for exynos5250 spring incorrectly specifies
> "active low" polarity for the DVS and DS line. But per datasheet,
> they are actually active high. So add polarity quirk for it.
> 
> 

Applied, thanks!

[1/2] gpiolib: of: Add polarity quirk for s5m8767
      commit: 4e310626eb4df52a31a142c1360fead0fcbd3793

Best regards,
-- 
Bartosz Golaszewski <bartosz.golaszewski@linaro.org>

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

* Re: [PATCH V2 1/2] gpiolib: of: Add polarity quirk for s5m8767
  2025-03-27  0:49 [PATCH V2 1/2] gpiolib: of: Add polarity quirk for s5m8767 Peng Fan (OSS)
                   ` (4 preceding siblings ...)
  2025-04-07  7:42 ` (subset) " Bartosz Golaszewski
@ 2025-04-07 22:15 ` Mark Brown
  5 siblings, 0 replies; 13+ messages in thread
From: Mark Brown @ 2025-04-07 22:15 UTC (permalink / raw)
  To: linus.walleij, brgl, krzk, lgirdwood, andriy.shevchenko,
	Peng Fan (OSS)
  Cc: linux-gpio, linux-kernel, linux-samsung-soc, Peng Fan

On Thu, 27 Mar 2025 08:49:44 +0800, Peng Fan (OSS) wrote:
> This is prepare patch for switching s5m8767 regulator driver to
> use GPIO descriptor. DTS for exynos5250 spring incorrectly specifies
> "active low" polarity for the DVS and DS line. But per datasheet,
> they are actually active high. So add polarity quirk for it.
> 
> 

Applied to

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

Thanks!

[1/2] gpiolib: of: Add polarity quirk for s5m8767
      (no commit info)
[2/2] regulator: s5m8767: Convert to GPIO descriptors
      commit: 16b19bfd80402bb98135c4b65344e859883766ec

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] 13+ messages in thread

end of thread, other threads:[~2025-04-07 22:15 UTC | newest]

Thread overview: 13+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2025-03-27  0:49 [PATCH V2 1/2] gpiolib: of: Add polarity quirk for s5m8767 Peng Fan (OSS)
2025-03-27  0:49 ` [PATCH V2 2/2] regulator: s5m8767: Convert to GPIO descriptors Peng Fan (OSS)
2025-03-27 11:37   ` Andy Shevchenko
2025-03-27 12:03   ` Mark Brown
2025-03-27 16:54   ` Krzysztof Kozlowski
2025-03-28  7:49   ` Linus Walleij
2025-03-27  8:55 ` [PATCH V2 1/2] gpiolib: of: Add polarity quirk for s5m8767 Bartosz Golaszewski
2025-03-27 12:05   ` Mark Brown
2025-03-27 10:15 ` Andy Shevchenko
2025-03-27 10:25   ` Peng Fan
2025-03-28  7:50 ` Linus Walleij
2025-04-07  7:42 ` (subset) " Bartosz Golaszewski
2025-04-07 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