GPIO API

Robert Swindells <[email protected]>
Newsgroups gmane.os.netbsd.ports.arm
Message-ID <[email protected]>
Is there a good example to copy on how to setup a GPIO as an input?

I would like to use the USB-C PHY on the Pinebook Pro, it connects to
one pin on the CPU to signal when there is a status change.

I am trying to adapt the fusbtc driver from OpenBSD but their device
tree API is a bit lower level than our one.

The Pinebook Pro device tree has this for the PHY itself:

                fusb30x@22 {
                        compatible = "fcs,fusb302";
                        reg = <0x22>;
                        interrupt-parent = <0x86>;
                        interrupts = <0x02 0x08>;
                        pinctrl-names = "default";
                        pinctrl-0 = <0x87>;
                        vbus-supply = <0x88>; 
                        phandle = <0x8e>;

then a pin definition of:

		fusb302x { 
                        fusb0-int-pin {
                                rockchip,pins = <0x01 0x02 0x00 0xbf>;
                                phandle = <0x87>;
                        };
                };      

Is this enough to be able to use fdtbus_gpio_acquire()?

Also, has anyone done any thinking on how to extend the API to get
GPIO inputs wired up to interrupts?

Robert Swindells
lmpx.com only provides a reader for public news (NNTP) servers. It is not affiliated with the servers or forums shown here and is not responsible for the content of articles, which is written by their respective authors.