Skip to content

gpio: regmap: Make use of 'ngpios' property

Andy Shevchenko linux-gpio lkml 1 version Applied

Status from this message: Applied, thanks!

Get series with b4
b4 am [email protected]

Versions newest first

  1. v1 Latest5 patches 16 repliesApplied

Patches in v1 Applied

#Subject and filesSizeRepliesApplied
1/5gpiolib: Extract gpiochip_choose_fwnode() for wider usedrivers/gpio/gpiolib.c+16 -80 replies
2/5gpiolib: Use fwnode instead of device in gpiochip_get_ngpios()drivers/gpio/gpiolib.c+2 -10 replies
3/5gpio: regmap: Group optional assignments together for better understandingdrivers/gpio/gpio-regmap.c include/linux/gpio/regmap.h+4 -41 reply
4/5gpio: regmap: Move optional assignments down in the codedrivers/gpio/gpio-regmap.c+14 -141 reply
5/5gpio: regmap: Allow ngpio to be read from the propertydrivers/gpio/gpio-regmap.c include/linux/gpio/regmap.h+10 -51 reply

Reviews trailers per patch

3 of 5 patches have a Reviewed-by or Acked-by of their own; the series has one for all of them.

PatchLinus WalleijMathieu Dubois-BriandMichael Walle
SeriesR-b T-b R-b
1/5
2/5
3/5R-b
4/5R-b
5/5R-b

Trailers given in replies are filled; those carried in the patches from earlier versions are outlined with dashes. Scroll the table sideways for all 3 reviewers.

Read the v1 thread

Cover letter [PATCH v1 0/5] 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