Hi Ondřej, many thanks for your reply. You are right, I was not clear enough. My final aim is to write an own driver to manage 4 GPIO inputs + 4 GPIO outputs in a very specific way (including interrupt in falling edge of inputs), so in the end of the road, I´m thinking about to access these pins from the user space, but through my own char device driver, so I will work in kernel and user spaces. It´s my first time with an embedded running over an O.S. so I thought it would be a good idea to play for a while with GPIOs before to face the big problem. I will check documentation that you suggested me. One more time, thank you very much. El dom., 5 may. 2019 a las 16:38, Ondřej Jirman (<[email protected]>) escribió:
> Hi, > > On Fri, May 03, 2019 at 09:41:23AM -0700, [email protected] wrote: > > Hi all, this is my first post, I have a question about dts > implementation > > for my BananaPi m2 ultra. I was looking for hints in previous posts, and > > other places, with no luck. Sorry if it´s a begginer question. > > > > I´m trying to modify my dts file to add support for GPIO (no through > > gpio-leds, direct GPIO support). My scenario is: > > It's not clear if you want to use GPIO from userspace or from the kernel. > > Here's some info on how to access GPIO from userspace: > > http://linux-sunxi.org/GPIO > > regards, > o. > > > HW: BananaPi-m2-ultra > > O.S.: Armbian. > > kernel version: 4.19.36-sunxi > > > > I added a child node to the standard pinctrl descrpition: > > > > pio: pinctrl@1c20800 { > > compatible = "allwinner,sun8i-r40-pinctrl"; > > reg = <0x1c20800 0x400>; > > interrupts = <0x0 0x1c 0x4>; > > clocks = <0x7 0x4f 0x2 0x4>; > > clock-names = "apb", "hosc", "losc"; > > gpio-controller; > > interrupt-controller; > > #interrupt-cells = <0x3>; > > #gpio-cells = <0x3>; > > pinctrl-names = "default"; > > pinctrl-0 = <0x13>; > > phandle = >0xd>; > > > > clk-out-a-pin { > > pins = "PI12"; > > function = "clk_out_a"; > > drive = <0x0>; > > pull = <0x0>; > > phandle = <0x13>; > > }; > > > > /* A lot of child node */ > > > > /* My child node */ > > myCustomOutput { > > allwinner,pins = "PH3"; > > allwinner,function = "myOutput"; > > allwinner,drive = "1"; /* 20mA capable output */ > > }; > > }; /* End of pio */ > > > > So, when I want to implement the client node for myCustomOutputs I don't > > figure what the value for compatible property must to be. > > > > At root level, I want to write: > > > > myOutput { > > compatible = "?????"; /* What value must be here */ > > gpios = <0x7 0x3 GPIO_ACTIVE_HIGH>; > > }; > > > > Could please somebody point me in the right direction? > > > > Thanks in advance! > > > > Mariano > > > > -- > > You received this message because you are subscribed to the Google > Groups "linux-sunxi" group. > > To unsubscribe from this group and stop receiving emails from it, send > an email to [email protected]. > > For more options, visit https://groups.google.com/d/optout. > > -- Mariano H. Caballero -- You received this message because you are subscribed to the Google Groups "linux-sunxi" group. To unsubscribe from this group and stop receiving emails from it, send an email to [email protected]. To view this discussion on the web, visit https://groups.google.com/d/msgid/linux-sunxi/CAPKY2czEtCEEa-71XY53zDY3r06-aMrJPAgdPU3h5tc%2BV8uuLg%40mail.gmail.com. For more options, visit https://groups.google.com/d/optout.
