Linux-Kernel Archive: Re: [PATCH 2/5] dt-bindings: gpio: gpio-thunderx: Describe pin-cfg option Re: [PATCH 2/5] dt-bindings: gpio: gpio-thunderx: Describe pin-cfg option From: Linus Walleij Date: Sun May 01 2022 - 18:16:05 EST Next message: Linus Walleij: "Re: [PATCH 5/5] gpio: thunderx: change handler for level interrupt" Previous message: Maciej W. Rozycki: "[PATCH v3 2/2] MIPS: IP30: Remove incorrect `cpu_has_fpu' override" Messages sorted by: [ date ] [ thread ] [ subject ] [ author ] On Wed, Apr 27, 2022 at 4:47 PM Piyush Malgujar
wrote: > Add support for pin-cfg to configure GPIO Pins > > Signed-off-by: Piyush Malgujar > --- > Documentation/devicetree/bindings/gpio/gpio-thunderx.txt | 4 ++++ Would be nice to rewrite this binding in YAML > - First cell is the GPIO pin number relative to the controller. > - Second cell is triggering flags as defined in interrupts.txt. > +- pin-cfg: Configuration of pin's function, filters, XOR and output mode. > + - First cell is the GPIO pin number > + - Second cell is a value written to GPIO_BIT_CFG register at driver probe. Just poking magic hex values into some random register as part of a binding is not a good idea. This looks like trying to reinvent the pin config subsystem. GPIO is using the standard pin configurations in the second cell of the handle, use them in this driver as well and add new ones if we need. You find the existing flags here: include/dt-bindings/gpio/gpio.h If you need something more sophisticated than a simple flag, I think you need to implement proper pin config. Yours, Linus Walleij Next message: Linus Walleij: "Re: [PATCH 5/5] gpio: thunderx: change handler for level interrupt" Previous message: Maciej W. Rozycki: "[PATCH v3 2/2] MIPS: IP30: Remove incorrect `cpu_has_fpu' override" Messages sorted by: [ date ] [ thread ] [ subject ] [ author ]