Port-arm archive

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index][Old Index]

GPIO API



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


Home | Main Index | Thread Index | Old Index