Skip to contentSkip to conversation

gpio: regmap: Make use of 'ngpios' property

PATCH Applied Andy Shevchenko 5 participants 22 messages Feb 13, 2025 – Feb 21, 2025

Subsystems (2)
lore
Share & tools
lore
#0 lore raw

cover gpio: regmap: Make use of 'ngpios' property

It appears that regmap GPIO doesn't take into account 'ngpios' property and requires hard coded values or duplication of the parsing the same outside of GPIO library. This miniseries addresses that.

For the record, I have checked all bgpio_init() users and haven't seen the suspicious code that this series might break, e.g., an equivalent of something like this:

static int foo_probe(struct device *dev)

{
	struct gpio_chip *gc = devm_kzalloc(...);
	struct fwnode_handle *fwnode = ...; // NOT dev_fwnode(dev)!

	...
	gc->parent = dev;
	gc->fwnode = fwnode;

	ret = bgpio_init(gc, dev, ...);
	...
}

Andy Shevchenko (5):
gpiolib: Extract gpiochip_choose_fwnode() for wider use
gpiolib: Use fwnode instead of device in gpiochip_get_ngpios()
gpio: regmap: Group optional assignments together for better
understanding
gpio: regmap: Move optional assignments down in the code
gpio: regmap: Allow ngpio to be read from the property

 drivers/gpio/gpio-regmap.c  | 41 +++++++++++++++++++++----------------
 drivers/gpio/gpiolib.c      | 27 ++++++++++++++++--------
 include/linux/gpio/regmap.h |  4 ++--
 3 files changed, 43 insertions(+), 29 deletions(-)
Signature · 1 line
2.45.1.3035.g276e886db78b
#1 lore raw

PATCH 1/5 gpiolib: Extract gpiochip_choose_fwnode() for wider use

Extract gpiochip_choose_fwnode() for the future use in another function.

---
 drivers/gpio/gpiolib.c | 24 ++++++++++++++++--------
 1 file changed, 16 insertions(+), 8 deletions(-)
drivers/gpio/gpiolib.c +16 -8
index d6ebdb2f2e92..0f93aa7736c6 100644
@@ -883,6 +883,21 @@ void *gpiochip_get_data(struct gpio_chip *gc)
 }
 EXPORT_SYMBOL_GPL(gpiochip_get_data);
 
+/*
+ * If the calling driver provides the specific firmware node,
+ * use it. Otherwise use the one from the parent device, if any.
+ */
+static struct fwnode_handle *gpiochip_choose_fwnode(struct gpio_chip *gc)
+{
+	if (gc->fwnode)
+		return gc->fwnode;
+
+	if (gc->parent)
+		return dev_fwnode(gc->parent);
+
+	return NULL;
+}
+
 int gpiochip_get_ngpios(struct gpio_chip *gc, struct device *dev)
 {
 	u32 ngpios = gc->ngpio;
@@ -942,14 +957,7 @@ int gpiochip_add_data_with_key(struct gpio_chip *gc, void *data,
 	gc->gpiodev = gdev;
 	gpiochip_set_data(gc, data);
 
-	/*
-	 * If the calling driver did not initialize firmware node,
-	 * do it here using the parent device, if any.
-	 */
-	if (gc->fwnode)
-		device_set_node(&gdev->dev, gc->fwnode);
-	else if (gc->parent)
-		device_set_node(&gdev->dev, dev_fwnode(gc->parent));
+	device_set_node(&gdev->dev, gpiochip_choose_fwnode(gc));
 
 	gdev->id = ida_alloc(&gpio_ida, GFP_KERNEL);
 	if (gdev->id < 0) {
Signature · 1 line
2.45.1.3035.g276e886db78b
#2 lore raw

PATCH 2/5 gpiolib: Use fwnode instead of device in gpiochip_get_ngpios()

In reply to Andy Shevchenko

The gpiochip_get_ngpios() can be used in the cases where passed device is not a provider of the certain property. Use fwnode instead.

---
 drivers/gpio/gpiolib.c | 3 ++-
 1 file changed, 2 insertions(+), 1 deletion(-)
drivers/gpio/gpiolib.c +2 -1
index 0f93aa7736c6..0ede5e3eecfd 100644
@@ -900,11 +900,12 @@ static struct fwnode_handle *gpiochip_choose_fwnode(struct gpio_chip *gc)
 
 int gpiochip_get_ngpios(struct gpio_chip *gc, struct device *dev)
 {
+	struct fwnode_handle *fwnode = gpiochip_choose_fwnode(gc);
 	u32 ngpios = gc->ngpio;
 	int ret;
 
 	if (ngpios == 0) {
-		ret = device_property_read_u32(dev, "ngpios", &ngpios);
+		ret = fwnode_property_read_u32(fwnode, "ngpios", &ngpios);
 		if (ret == -ENODATA)
 			/*
 			 * -ENODATA means that there is no property found and
Signature · 1 line
2.45.1.3035.g276e886db78b
#3 lore raw

PATCH 3/5 gpio: regmap: Group optional assignments together for better understanding

In reply to Andy Shevchenko

Group ngpio_per_reg, reg_stride, and reg_mask_xlate assignments together with the respective conditional for better understanding what's going on in the code.

While at it, mark ngpio_per_reg as (Optional) in the kernel-doc in accordance with what code actually does.

---
 drivers/gpio/gpio-regmap.c  | 6 +++---
 include/linux/gpio/regmap.h | 2 +-
 2 files changed, 4 insertions(+), 4 deletions(-)
drivers/gpio/gpio-regmap.c +3 -3
index 05f8781b5204..7775b0c56602 100644
@@ -233,9 +233,6 @@ struct gpio_regmap *gpio_regmap_register(const struct gpio_regmap_config *config
 	gpio->parent = config->parent;
 	gpio->driver_data = config->drvdata;
 	gpio->regmap = config->regmap;
-	gpio->ngpio_per_reg = config->ngpio_per_reg;
-	gpio->reg_stride = config->reg_stride;
-	gpio->reg_mask_xlate = config->reg_mask_xlate;
 	gpio->reg_dat_base = config->reg_dat_base;
 	gpio->reg_set_base = config->reg_set_base;
 	gpio->reg_clr_base = config->reg_clr_base;
@@ -243,13 +240,16 @@ struct gpio_regmap *gpio_regmap_register(const struct gpio_regmap_config *config
 	gpio->reg_dir_out_base = config->reg_dir_out_base;
 
 	/* if not set, assume there is only one register */
+	gpio->ngpio_per_reg = config->ngpio_per_reg;
 	if (!gpio->ngpio_per_reg)
 		gpio->ngpio_per_reg = config->ngpio;
 
 	/* if not set, assume they are consecutive */
+	gpio->reg_stride = config->reg_stride;
 	if (!gpio->reg_stride)
 		gpio->reg_stride = 1;
 
+	gpio->reg_mask_xlate = config->reg_mask_xlate;
 	if (!gpio->reg_mask_xlate)
 		gpio->reg_mask_xlate = gpio_regmap_simple_xlate;
 
include/linux/gpio/regmap.h +1 -1
index a9f7b7faf57b..b9240e4156cc 100644
@@ -30,7 +30,7 @@ struct regmap;
  * @reg_dir_out_base:	(Optional) out setting register base address
  * @reg_stride:		(Optional) May be set if the registers (of the
  *			same type, dat, set, etc) are not consecutive.
- * @ngpio_per_reg:	Number of GPIOs per register
+ * @ngpio_per_reg:	(Optional) Number of GPIOs per register
  * @irq_domain:		(Optional) IRQ domain if the controller is
  *			interrupt-capable
  * @reg_mask_xlate:     (Optional) Translates base address and GPIO
Signature · 1 line
2.45.1.3035.g276e886db78b
maintainer Reviewed-by on v1 3/5
#4 lore raw

Re: [PATCH v1 3/5] gpio: regmap: Group optional assignments together for better understanding

Quoted 8 lines · Andy Shevchenko

Group ngpio_per_reg, reg_stride, and reg_mask_xlate assignments together with the respective conditional for better understanding what's going on in the code.

While at it, mark ngpio_per_reg as (Optional) in the kernel-doc in accordance with what code actually does.

#5 lore raw

PATCH 4/5 gpio: regmap: Move optional assignments down in the code

In reply to Andy Shevchenko

Move optional assignments down in the code, so they may use some values from the (updated) struct gpio_chip later on.

---
 drivers/gpio/gpio-regmap.c | 28 ++++++++++++++--------------
 1 file changed, 14 insertions(+), 14 deletions(-)
drivers/gpio/gpio-regmap.c +14 -14
index 7775b0c56602..41ee576e7cd0 100644
@@ -239,20 +239,6 @@ struct gpio_regmap *gpio_regmap_register(const struct gpio_regmap_config *config
 	gpio->reg_dir_in_base = config->reg_dir_in_base;
 	gpio->reg_dir_out_base = config->reg_dir_out_base;
 
-	/* if not set, assume there is only one register */
-	gpio->ngpio_per_reg = config->ngpio_per_reg;
-	if (!gpio->ngpio_per_reg)
-		gpio->ngpio_per_reg = config->ngpio;
-
-	/* if not set, assume they are consecutive */
-	gpio->reg_stride = config->reg_stride;
-	if (!gpio->reg_stride)
-		gpio->reg_stride = 1;
-
-	gpio->reg_mask_xlate = config->reg_mask_xlate;
-	if (!gpio->reg_mask_xlate)
-		gpio->reg_mask_xlate = gpio_regmap_simple_xlate;
-
 	chip = &gpio->gpio_chip;
 	chip->parent = config->parent;
 	chip->fwnode = config->fwnode;
@@ -276,6 +262,20 @@ struct gpio_regmap *gpio_regmap_register(const struct gpio_regmap_config *config
 		chip->direction_output = gpio_regmap_direction_output;
 	}
 
+	/* if not set, assume there is only one register */
+	gpio->ngpio_per_reg = config->ngpio_per_reg;
+	if (!gpio->ngpio_per_reg)
+		gpio->ngpio_per_reg = config->ngpio;
+
+	/* if not set, assume they are consecutive */
+	gpio->reg_stride = config->reg_stride;
+	if (!gpio->reg_stride)
+		gpio->reg_stride = 1;
+
+	gpio->reg_mask_xlate = config->reg_mask_xlate;
+	if (!gpio->reg_mask_xlate)
+		gpio->reg_mask_xlate = gpio_regmap_simple_xlate;
+
 	ret = gpiochip_add_data(chip, gpio);
 	if (ret < 0)
 		goto err_free_gpio;
Signature · 1 line
2.45.1.3035.g276e886db78b
#7 lore raw

PATCH 5/5 gpio: regmap: Allow ngpio to be read from the property

In reply to Andy Shevchenko

GPIOLIB supports the case when number of supported GPIOs can be read from the device property. Enable this for drivers that are using GPIO regmap layer.

---
 drivers/gpio/gpio-regmap.c  | 13 +++++++++----
 include/linux/gpio/regmap.h |  2 +-
 2 files changed, 10 insertions(+), 5 deletions(-)
drivers/gpio/gpio-regmap.c +9 -4
index 41ee576e7cd0..856f8569566e 100644
@@ -17,6 +17,8 @@
 #include <linux/gpio/driver.h>
 #include <linux/gpio/regmap.h>
 
+#include "gpiolib.h"
+
 struct gpio_regmap {
 	struct device *parent;
 	struct regmap *regmap;
@@ -210,9 +212,6 @@ struct gpio_regmap *gpio_regmap_register(const struct gpio_regmap_config *config
 	if (!config->parent)
 		return ERR_PTR(-EINVAL);
 
-	if (!config->ngpio)
-		return ERR_PTR(-EINVAL);
-
 	/* we need at least one */
 	if (!config->reg_dat_base && !config->reg_set_base)
 		return ERR_PTR(-EINVAL);
@@ -243,7 +242,6 @@ struct gpio_regmap *gpio_regmap_register(const struct gpio_regmap_config *config
 	chip->parent = config->parent;
 	chip->fwnode = config->fwnode;
 	chip->base = -1;
-	chip->ngpio = config->ngpio;
 	chip->names = config->names;
 	chip->label = config->label ?: dev_name(config->parent);
 	chip->can_sleep = regmap_might_sleep(config->regmap);
@@ -262,6 +260,13 @@ struct gpio_regmap *gpio_regmap_register(const struct gpio_regmap_config *config
 		chip->direction_output = gpio_regmap_direction_output;
 	}
 
+	chip->ngpio = config->ngpio;
+	if (!chip->ngpio) {
+		ret = gpiochip_get_ngpios(chip, chip->parent);
+		if (ret)
+			return ERR_PTR(ret);
+	}
+
 	/* if not set, assume there is only one register */
 	gpio->ngpio_per_reg = config->ngpio_per_reg;
 	if (!gpio->ngpio_per_reg)
include/linux/gpio/regmap.h +1 -1
index b9240e4156cc..c722c67668c6 100644
@@ -21,7 +21,7 @@ struct regmap;
  *			If not given, the fwnode of the parent is used.
  * @label:		(Optional) Descriptive name for GPIO controller.
  *			If not given, the name of the device is used.
- * @ngpio:		Number of GPIOs
+ * @ngpio:		(Optional) Number of GPIOs
  * @names:		(Optional) Array of names for gpios
  * @reg_dat_base:	(Optional) (in) register base address
  * @reg_set_base:	(Optional) set register base address
Signature · 1 line
2.45.1.3035.g276e886db78b
#9 lore raw
In reply to Andy Shevchenko
Quoted 31 lines · Andy Shevchenko

It appears that regmap GPIO doesn't take into account 'ngpios' property and requires hard coded values or duplication of the parsing the same outside of GPIO library. This miniseries addresses that.

For the record, I have checked all bgpio_init() users and haven't seen the suspicious code that this series might break, e.g., an equivalent of something like this:

static int foo_probe(struct device *dev)

{
	struct gpio_chip *gc = devm_kzalloc(...);
	struct fwnode_handle *fwnode = ...; // NOT dev_fwnode(dev)!

	...
	gc->parent = dev;
	gc->fwnode = fwnode;

	ret = bgpio_init(gc, dev, ...);
	...
}

Andy Shevchenko (5):
gpiolib: Extract gpiochip_choose_fwnode() for wider use
gpiolib: Use fwnode instead of device in gpiochip_get_ngpios()
gpio: regmap: Group optional assignments together for better
understanding
gpio: regmap: Move optional assignments down in the code
gpio: regmap: Allow ngpio to be read from the property

Quoted 4 lines
 drivers/gpio/gpio-regmap.c  | 41 +++++++++++++++++++++----------------
 drivers/gpio/gpiolib.c      | 27 ++++++++++++++++--------
 include/linux/gpio/regmap.h |  4 ++--
 3 files changed, 43 insertions(+), 29 deletions(-)

Hi Andy,

Thanks, I confirm I tested this series and it does fix my case: I can leave the ngpio field uninitialized and its value will be correctly retrieved from the "ngpios" property.

Also the whole series looks good to me.

Signature · 3 lines
Mathieu Dubois-Briand, Bootlin
Embedded Linux and Kernel engineering
https://bootlin.com
#10 lore raw
Quoted 23 lines · Mathieu Dubois-Briand
Quoted 22 lines · Andy Shevchenko

It appears that regmap GPIO doesn't take into account 'ngpios' property and requires hard coded values or duplication of the parsing the same outside of GPIO library. This miniseries addresses that.

For the record, I have checked all bgpio_init() users and haven't seen the suspicious code that this series might break, e.g., an equivalent of something like this:

static int foo_probe(struct device *dev)

{
	struct gpio_chip *gc = devm_kzalloc(...);
	struct fwnode_handle *fwnode = ...; // NOT dev_fwnode(dev)!

	...
	gc->parent = dev;
	gc->fwnode = fwnode;

	ret = bgpio_init(gc, dev, ...);
	...
}

...

Quoted 5 lines

Thanks, I confirm I tested this series and it does fix my case: I can leave the ngpio field uninitialized and its value will be correctly retrieved from the "ngpios" property.

Also the whole series looks good to me.

Thank you! Can you give a formal tag(s)?

Signature · 2 lines
With Best Regards,
Andy Shevchenko
Tested-by Reviewed-by
#11 lore raw
Quoted 27 lines · Andy Shevchenko
Quoted 23 lines · Mathieu Dubois-Briand
Quoted 22 lines · Andy Shevchenko

It appears that regmap GPIO doesn't take into account 'ngpios' property and requires hard coded values or duplication of the parsing the same outside of GPIO library. This miniseries addresses that.

For the record, I have checked all bgpio_init() users and haven't seen the suspicious code that this series might break, e.g., an equivalent of something like this:

static int foo_probe(struct device *dev)

{
	struct gpio_chip *gc = devm_kzalloc(...);
	struct fwnode_handle *fwnode = ...; // NOT dev_fwnode(dev)!

	...
	gc->parent = dev;
	gc->fwnode = fwnode;

	ret = bgpio_init(gc, dev, ...);
	...
}

...

Quoted 7 lines
Quoted 5 lines

Thanks, I confirm I tested this series and it does fix my case: I can leave the ngpio field uninitialized and its value will be correctly retrieved from the "ngpios" property.

Also the whole series looks good to me.

Thank you! Can you give a formal tag(s)?

Sure!

Signature · 3 lines
Mathieu Dubois-Briand, Bootlin
Embedded Linux and Kernel engineering
https://bootlin.com
Reviewed-by on the v1 series
#12 lore raw
In reply to Andy Shevchenko
Quoted 21 lines · Andy Shevchenko

It appears that regmap GPIO doesn't take into account 'ngpios' property and requires hard coded values or duplication of the parsing the same outside of GPIO library. This miniseries addresses that.

For the record, I have checked all bgpio_init() users and haven't seen the suspicious code that this series might break, e.g., an equivalent of something like this:

static int foo_probe(struct device *dev)

{
        struct gpio_chip *gc = devm_kzalloc(...);
        struct fwnode_handle *fwnode = ...; // NOT dev_fwnode(dev)!

        ...
        gc->parent = dev;
        gc->fwnode = fwnode;

        ret = bgpio_init(gc, dev, ...);
        ...
}
Quoted 1 line

Thanks for fixing this Andy!

Yours,
Linus Walleij

#13 lore raw
Quoted 20 lines · Linus Walleij
Quoted 17 lines · Andy Shevchenko

It appears that regmap GPIO doesn't take into account 'ngpios' property and requires hard coded values or duplication of the parsing the same outside of GPIO library. This miniseries addresses that.

For the record, I have checked all bgpio_init() users and haven't seen the suspicious code that this series might break, e.g., an equivalent of something like this:

static int foo_probe(struct device *dev)

{
        struct gpio_chip *gc = devm_kzalloc(...);
        struct fwnode_handle *fwnode = ...; // NOT dev_fwnode(dev)!

        ...
        gc->parent = dev;
        gc->fwnode = fwnode;
Quoted 8 lines
Quoted 5 lines
        ret = bgpio_init(gc, dev, ...);
        ...
}

Thanks for fixing this Andy!

Thank you for the review!

Bart, do you think it can be applied?

Signature · 2 lines
With Best Regards,
Andy Shevchenko
#14 lore raw
Quoted 26 lines · Andy Shevchenko
Quoted 24 lines · Linus Walleij
Quoted 21 lines · Andy Shevchenko

It appears that regmap GPIO doesn't take into account 'ngpios' property and requires hard coded values or duplication of the parsing the same outside of GPIO library. This miniseries addresses that.

For the record, I have checked all bgpio_init() users and haven't seen the suspicious code that this series might break, e.g., an equivalent of something like this:

static int foo_probe(struct device *dev)

{
        struct gpio_chip *gc = devm_kzalloc(...);
        struct fwnode_handle *fwnode = ...; // NOT dev_fwnode(dev)!

        ...
        gc->parent = dev;
        gc->fwnode = fwnode;

        ret = bgpio_init(gc, dev, ...);
        ...
}
Quoted 9 lines
Quoted 4 lines
Quoted 1 line

Thanks for fixing this Andy!

Thank you for the review!

Bart, do you think it can be applied?

Andy,

I really rarely lose track of patches. It's been just under a week since this was posted. Please don't ping me to pick things up unless I'm not reacting for at least two weeks. I typically leave patches on the list for some time to give bots some time to react.

Bartosz

#15 lore raw
Quoted 3 lines · Bartosz Golaszewski
Quoted 1 line · Andy Shevchenko

On Fri, Feb 14, 2025 at 11:50:53AM +0100, Linus Walleij wrote:

...

Quoted 8 lines
Quoted 1 line

Bart, do you think it can be applied?

Andy,

I really rarely lose track of patches. It's been just under a week since this was posted. Please don't ping me to pick things up unless I'm not reacting for at least two weeks. I typically leave patches on the list for some time to give bots some time to react.

I see, I thought your cadence is one week, that's why I have pinged you. Will try to keep this in mind for the future and sorry to interrupt!

Signature · 2 lines
With Best Regards,
Andy Shevchenko
#16 lore raw
Quoted 4 lines · Andy Shevchenko
Quoted 3 lines · Bartosz Golaszewski
Quoted 1 line · Andy Shevchenko

On Fri, Feb 14, 2025 at 11:50:53AM +0100, Linus Walleij wrote:

...

Quoted 11 lines
Quoted 8 lines
Quoted 1 line

Bart, do you think it can be applied?

Andy,

I really rarely lose track of patches. It's been just under a week since this was posted. Please don't ping me to pick things up unless I'm not reacting for at least two weeks. I typically leave patches on the list for some time to give bots some time to react.

I see, I thought your cadence is one week, that's why I have pinged you. Will try to keep this in mind for the future and sorry to interrupt!

Btw, if it's easier to you, I can just combine this to my usual PR to you.

Signature · 2 lines
With Best Regards,
Andy Shevchenko
#17 lore raw
Quoted 18 lines · Andy Shevchenko
Quoted 4 lines · Andy Shevchenko
Quoted 3 lines · Bartosz Golaszewski
Quoted 1 line · Andy Shevchenko

On Fri, Feb 14, 2025 at 11:50:53AM +0100, Linus Walleij wrote:

...

Quoted 9 lines
Quoted 8 lines
Quoted 1 line

Bart, do you think it can be applied?

Andy,

I really rarely lose track of patches. It's been just under a week since this was posted. Please don't ping me to pick things up unless I'm not reacting for at least two weeks. I typically leave patches on the list for some time to give bots some time to react.

Quoted 5 lines
Quoted 2 lines

I see, I thought your cadence is one week, that's why I have pinged you. Will try to keep this in mind for the future and sorry to interrupt!

Btw, if it's easier to you, I can just combine this to my usual PR to you.

No, that's fine, let's stick to ACPI-only PRs.

Bart

#18 lore raw
Quoted 7 lines · Bartosz Golaszewski
Quoted 5 lines · Andy Shevchenko
Quoted 4 lines · Andy Shevchenko
Quoted 3 lines · Bartosz Golaszewski
Quoted 1 line · Andy Shevchenko

On Fri, Feb 14, 2025 at 11:50:53AM +0100, Linus Walleij wrote:

...

Quoted 9 lines
Quoted 9 lines
Quoted 9 lines
Quoted 8 lines
Quoted 1 line

Bart, do you think it can be applied?

Andy,

I really rarely lose track of patches. It's been just under a week since this was posted. Please don't ping me to pick things up unless I'm not reacting for at least two weeks. I typically leave patches on the list for some time to give bots some time to react.

Quoted 6 lines
Quoted 4 lines
Quoted 2 lines

I see, I thought your cadence is one week, that's why I have pinged you. Will try to keep this in mind for the future and sorry to interrupt!

Btw, if it's easier to you, I can just combine this to my usual PR to you.

No, that's fine, let's stick to ACPI-only PRs.

Hmm... Is the Intel GPIO stuff should go directly to your tree? Seems I missed some changes in the flow...

Signature · 2 lines
With Best Regards,
Andy Shevchenko
#19 lore raw
Quoted 24 lines · Andy Shevchenko
Quoted 7 lines · Bartosz Golaszewski
Quoted 5 lines · Andy Shevchenko
Quoted 4 lines · Andy Shevchenko
Quoted 3 lines · Bartosz Golaszewski
Quoted 1 line · Andy Shevchenko

On Fri, Feb 14, 2025 at 11:50:53AM +0100, Linus Walleij wrote:

...

Quoted 12 lines
Quoted 12 lines
Quoted 11 lines
Quoted 8 lines
Quoted 1 line

Bart, do you think it can be applied?

Andy,

I really rarely lose track of patches. It's been just under a week since this was posted. Please don't ping me to pick things up unless I'm not reacting for at least two weeks. I typically leave patches on the list for some time to give bots some time to react.

I see, I thought your cadence is one week, that's why I have pinged you. Will try to keep this in mind for the future and sorry to interrupt!

Quoted 7 lines
Quoted 3 lines
Quoted 1 line

Btw, if it's easier to you, I can just combine this to my usual PR to you.

No, that's fine, let's stick to ACPI-only PRs.

Hmm... Is the Intel GPIO stuff should go directly to your tree? Seems I missed some changes in the flow...

Ah, no, sure, intel and ACPI and whatever you did up until this point.

Bart

#20 lore raw
Quoted 10 lines · Bartosz Golaszewski
Quoted 8 lines · Andy Shevchenko
Quoted 7 lines · Bartosz Golaszewski
Quoted 5 lines · Andy Shevchenko
Quoted 4 lines · Andy Shevchenko
Quoted 3 lines · Bartosz Golaszewski
Quoted 1 line · Andy Shevchenko

On Fri, Feb 14, 2025 at 11:50:53AM +0100, Linus Walleij wrote:

...

Quoted 12 lines
Quoted 12 lines
Quoted 12 lines
Quoted 12 lines
Quoted 11 lines
Quoted 8 lines
Quoted 1 line

Bart, do you think it can be applied?

Andy,

I really rarely lose track of patches. It's been just under a week since this was posted. Please don't ping me to pick things up unless I'm not reacting for at least two weeks. I typically leave patches on the list for some time to give bots some time to react.

I see, I thought your cadence is one week, that's why I have pinged you. Will try to keep this in mind for the future and sorry to interrupt!

Quoted 8 lines
Quoted 6 lines
Quoted 3 lines
Quoted 1 line

Btw, if it's easier to you, I can just combine this to my usual PR to you.

No, that's fine, let's stick to ACPI-only PRs.

Hmm... Is the Intel GPIO stuff should go directly to your tree? Seems I missed some changes in the flow...

Ah, no, sure, intel and ACPI and whatever you did up until this point.

Got it, thanks!

Signature · 2 lines
With Best Regards,
Andy Shevchenko
#21 lore raw
In reply to Andy Shevchenko

From: Bartosz Golaszewski <[email protected]>

Quoted 9 lines · Andy Shevchenko

It appears that regmap GPIO doesn't take into account 'ngpios' property and requires hard coded values or duplication of the parsing the same outside of GPIO library. This miniseries addresses that.

For the record, I have checked all bgpio_init() users and haven't seen the suspicious code that this series might break, e.g., an equivalent of something like this:

[...]

Applied, thanks!

[1/5] gpiolib: Extract gpiochip_choose_fwnode() for wider use

      commit: 375790f18396b2ba706e031b150c58cd37b45a11
[2/5] gpiolib: Use fwnode instead of device in gpiochip_get_ngpios()
      commit: 6f077e575893214136f9739f993bd9fedf61731a
[3/5] gpio: regmap: Group optional assignments together for better understanding
      commit: 97673ea38a77e42eaafcf5181c84f6c8d40b97e7
[4/5] gpio: regmap: Move optional assignments down in the code
      commit: a630d3960b6ac3c37cb0789605056e8845ffbf16
[5/5] gpio: regmap: Allow ngpio to be read from the property
      commit: db305161880a024a43f4b1cbafa7a294793d7a9e

Best regards,

Signature · 1 line
Bartosz Golaszewski <[email protected]>