^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 1) * Single Byte SPI LED Device Driver.
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 2)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 3) The driver can be used for controllers with a very simple SPI protocol:
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 4) - one LED is controlled by a single byte on MOSI
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 5) - the value of the byte gives the brightness between two values (lowest to
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 6) highest)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 7) - no return value is necessary (no MISO signal)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 8)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 9) The value for lowest and highest brightness is dependent on the device and
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 10) therefore on the compatible string.
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 11)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 12) Depending on the compatible string some special functions (like hardware
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 13) accelerated blinking) might can be supported too.
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 14)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 15) The driver currently only supports one LED. The properties of the LED are
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 16) configured in a sub-node in the device node.
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 17)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 18) Required properties:
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 19) - compatible: should be one of
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 20) * "ubnt,acb-spi-led" microcontroller (SONiX 8F26E611LA) based device
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 21) used for example in Ubiquiti airCube ISP
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 22)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 23) Property rules described in Documentation/devicetree/bindings/spi/spi-bus.txt
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 24) apply.
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 25)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 26) LED sub-node properties:
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 27) - label:
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 28) see Documentation/devicetree/bindings/leds/common.txt
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 29) - default-state:
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 30) see Documentation/devicetree/bindings/leds/common.txt
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 31) Only "on" and "off" are supported.
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 32)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 33) Example:
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 34)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 35) led-controller@0 {
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 36) compatible = "ubnt,acb-spi-led";
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 37) reg = <0>;
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 38) spi-max-frequency = <100000>;
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 39)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 40) led {
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 41) label = "white:status";
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 42) default-state = "on";
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 43) };
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 44) };