dm: demo: Add a simple GPIO demonstration

Add a new 'demo light' command which uses GPIOs to control imaginary lights.
Each light is assigned a bit number in the overall value. This provides an
example driver for using the new GPIO API.

Signed-off-by: Simon Glass <sjg@chromium.org>
This commit is contained in:
Simon Glass
2015-01-05 20:05:31 -07:00
parent 5d1c17e9a5
commit a02af4aeec
5 changed files with 133 additions and 2 deletions

View File

@@ -19,6 +19,7 @@
colour = "cyan";
sides = <3>;
character = <83>;
light-gpios = <&gpio_a 2>, <&gpio_b 6 0>;
};
square {
compatible = "demo-shape";
@@ -126,7 +127,7 @@
0x070b0067 0x070c0069>;
};
gpio_a: gpios {
gpio_a: gpios@0 {
gpio-controller;
compatible = "sandbox,gpio";
#gpio-cells = <1>;
@@ -134,6 +135,14 @@
num-gpios = <20>;
};
gpio_b: gpios@1 {
gpio-controller;
compatible = "sandbox,gpio";
#gpio-cells = <2>;
gpio-bank-name = "b";
num-gpios = <10>;
};
i2c@0 {
#address-cells = <1>;
#size-cells = <0>;