On Fri, Nov 1, 2024 at 1:17 PM Conor Dooley <conor@xxxxxxxxxx> wrote: > > On Thu, Oct 31, 2024 at 02:00:22PM +0100, Bartosz Golaszewski wrote: > > On Thu, Oct 31, 2024 at 1:04 PM Conor Dooley <conor@xxxxxxxxxx> wrote: > > > > + mpfs_gpio->gc.direction_input = mpfs_gpio_direction_input; > > > + mpfs_gpio->gc.direction_output = mpfs_gpio_direction_output; > > > + mpfs_gpio->gc.get_direction = mpfs_gpio_get_direction; > > > + mpfs_gpio->gc.get = mpfs_gpio_get; > > > + mpfs_gpio->gc.set = mpfs_gpio_set; > > > + mpfs_gpio->gc.base = -1; > > > + mpfs_gpio->gc.ngpio = ngpios; > > > > The "ngpios" property will be parsed by GPIO core so no need to set it. > > Are you sure it'll work here? I tried dropping the ngpios parsing, but I > get: > gpiochip_add_data_with_key: GPIOs 0..-1 (20122000.gpio) failed to register, -22 > > That's coming from the device_property_read_u32(dev, "ngpios", &ngpios); > in gpiochip_get_ngpios(). Checking against the bluefield driver and the > code in gpiochip_add_data_with_key(), it's not immediately obvious what > I am missing. Does dev have an fwnode correctly assigned? What does dev_fwnode(dev) return? Bart