On Thu, Oct 10, 2024 at 11:41 PM Lorenzo Bianconi <lorenzo@xxxxxxxxxx> wrote: > > On Thu, Oct 10, 2024 at 12:14 PM Christian Marangi <ansuelsmth@xxxxxxxxx> wrote: > > I think you want a separate GPIO node inside the system controller: > > > > en7581_gpio: gpio { > > compatible = "airhoa,en7581-gpio"; > > interrupt-parent = <&gic>; > > interrupts = <GIC_SPI 26 IRQ_TYPE_LEVEL_HIGH>; > > > > gpio-controller; > > #gpio-cells = <2>; > > > > interrupt-controller; > > #interrupt-cells = <2>; > > > > gpio-ranges = <&en7581_pinctrl 0 13 47>; > > }; > > So far I implemented the gpio functionalities in the en7581 pinctrl driver > (as it is done for other mtk pinctrl drivers) but I am fine to reuse the > gpio-en7523 driver for it. Do you prefer this second approach? It's fine to combine GPIO and pin control into the same node, especially if you will have a combined driver for it, then it's more or less mandatory. I only wrote this looking at ansuel's sketch. > > This will make subdevices probe and you can put the pure GPIO > > driver in drivers/gpio/gpio-en7581.c > > We could actually reuse gpio-en7523 driver (removing the gpio part from en7581 > pinctrl driver) and extend it to support irq_chip. I do not have a strong > opinion about it. Code reuse is always preferred, if possible. Yours, Linus Walleij