@@ -620,6 +620,10 @@ static int meson_gpiolib_register(struct meson_pinctrl *pc)
pc->chip.base = -1;
pc->chip.ngpio = pc->data->num_pins;
pc->chip.can_sleep = false;
+ if (pc->data->of_xlate) {
+ pc->chip.of_gpio_n_cells = pc->data->of_gpio_n_cells;
+ pc->chip.of_xlate = pc->data->of_xlate;
+ }
ret = gpiochip_add_data(&pc->chip, pc);
if (ret) {
@@ -120,6 +120,10 @@ struct meson_pinctrl_data {
const struct pinmux_ops *pmx_ops;
const void *pmx_data;
int (*parse_dt)(struct meson_pinctrl *pc);
+ int (*of_xlate)(struct gpio_chip *gc,
+ const struct of_phandle_args *gpiospec,
+ u32 *flags);
+ int of_gpio_n_cells;
};
struct meson_pinctrl {