Hi, > @@ -129,6 +130,13 @@ static int gpio_regmap_get_direction(struct gpio_chip *chip, > unsigned int base, val, reg, mask; > int invert, ret; > > + if (gpio->fixed_direction_output) { > + if (test_bit(offset, gpio->fixed_direction_output)) > + return GPIO_LINE_DIRECTION_OUT; > + else > + return GPIO_LINE_DIRECTION_IN; > + } > + > if (gpio->reg_dat_base && !gpio->reg_set_base) > return GPIO_LINE_DIRECTION_IN; > if (gpio->reg_set_base && !gpio->reg_dat_base) > @@ -277,6 +285,17 @@ struct gpio_regmap *gpio_regmap_register(const struct gpio_regmap_config *config > return ERR_PTR(ret); Not related to your patch, but this line above is wrong. That should be "goto err_free_gpio". Would you mind adding a patch for it? I could do it myself, but it will probably conflict with this series. I'm fine either way (if you do it, don't forget the Fixes: tag). > } > > + if (config->fixed_direction_output) { > + gpio->fixed_direction_output = bitmap_alloc(chip->ngpio, > + GFP_KERNEL); > + if (!gpio->fixed_direction_output) { > + ret = -ENOMEM; > + goto err_free_gpio; > + } > + bitmap_copy(gpio->fixed_direction_output, > + config->fixed_direction_output, chip->ngpio); > + } > + > /* if not set, assume there is only one register */ > gpio->ngpio_per_reg = config->ngpio_per_reg; > if (!gpio->ngpio_per_reg) > @@ -293,7 +312,7 @@ struct gpio_regmap *gpio_regmap_register(const struct gpio_regmap_config *config > > ret = gpiochip_add_data(chip, gpio); > if (ret < 0) > - goto err_free_gpio; > + goto err_free_bitmap; There's also an err_free_gpio jump below, that should also be replaced with err_free_bitmap. Otherwise looks good. -michael