@@ -132,3 +132,47 @@ group there are two attibutes:
``value`` - allows to read the current value of the line which may be
different from the pull if the line is being driven from
user-space
+
+An example device-tree code defining a GPIO simulator as interrupt controller:
+
+.. code-block :: none
+
+ gpio-sim {
+ compatible = "gpio-simulator";
+
+ bank0 {
+ gpio-controller;
+ #gpio-cells = <2>;
+ ngpios = <16>;
+
+ interrupt-controller;
+ #interrupt-cells = <2>;
+
+ line0 {
+ gpio-hog;
+ gpios = <0 1>;
+ input;
+ line-name = "irq-sim";
+ }
+ };
+ };
+
+ spi: spi {
+ compatible = "spi-mockup";
+ #address-cells = <1>;
+ #size-cells = <0>;
+
+ can0: can@1 {
+ compatible = "microchip,mcp2515";
+ reg = <1>;
+ interrupt-parent = <&bank0>;
+ interrupts = <0 IRQ_TYPE_EDGE_BOTH>;
+ }
+ };
+
+Trigger irq by writing value to pull setting:
+
+.. code-block :: none
+
+ $ echo pull-down > /sys/devices/platform/gpio-sim/gpiochipX/sim_gpio0/pull
+ $ echo pull-up > /sys/devices/platform/gpio-sim/gpiochipX/sim_gpio0/pull