On Fri Feb 14, 2025 at 12:49 PM CET, Mathieu Dubois-Briand wrote: > Add driver for Maxim Integrated MAX7360 GPIO/GPO controller. > > Two sets of GPIOs are provided by the device: > - Up to 8 GPIOs, shared with the PWM and rotary encoder functionalities. > These GPIOs also provide interrupts on input changes. > - Up to 6 GPOs, on unused keypad columns pins. > > Co-developed-by: Kamel Bouhara <kamel.bouhara@xxxxxxxxxxx> > Signed-off-by: Kamel Bouhara <kamel.bouhara@xxxxxxxxxxx> > Signed-off-by: Mathieu Dubois-Briand <mathieu.dubois-briand@xxxxxxxxxxx> > --- ... > +static int max7360_gpio_probe(struct platform_device *pdev) ... > + } else { > + u32 ngpios; > + > + ret = device_property_read_u32(dev, "ngpios", &ngpios); > + if (ret < 0) { > + dev_err(dev, "Missing ngpios OF property\n"); > + return ret; > + } > + > + gpio_config.reg_set_base = GPIO_REGMAP_ADDR(MAX7360_REG_PORTS); > + gpio_config.reg_mask_xlate = max7360_gpo_reg_mask_xlate; > + gpio_config.ngpio = ngpios; The device_property_read_u32() and setting of gpio_config.ngpio here will be removed, once the "gpio: regmap: Make use of 'ngpios' property" series gets merged. https://lore.kernel.org/linux-gpio/20250213195621.3133406-1-andriy.shevchenko@xxxxxxxxxxxxxxx/ -- Mathieu Dubois-Briand, Bootlin Embedded Linux and Kernel engineering https://bootlin.com