boards: Add chain length and colour mapping to LED strips

Adds chain length and colour mapping properties to LED strip devices
on boards where these parameters are now required

Signed-off-by: Jamie McCrae <spam@helper3000.net>
This commit is contained in:
Jamie McCrae 2024-04-17 19:51:55 +01:00 committed by Henrik Brix Andersen
commit 8ca399919b
6 changed files with 33 additions and 0 deletions

View file

@ -8,6 +8,7 @@
#include <nordic/nrf52840_qiaa.dtsi> #include <nordic/nrf52840_qiaa.dtsi>
#include "adafruit_itsybitsy_nrf52840-pinctrl.dtsi" #include "adafruit_itsybitsy_nrf52840-pinctrl.dtsi"
#include <zephyr/dt-bindings/input/input-event-codes.h> #include <zephyr/dt-bindings/input/input-event-codes.h>
#include <zephyr/dt-bindings/led/led.h>
/ { / {
model = "Adafruit ItsyBitsy nRF52840 Express"; model = "Adafruit ItsyBitsy nRF52840 Express";
@ -107,6 +108,10 @@
compatible = "apa,apa102"; compatible = "apa,apa102";
reg = <0>; reg = <0>;
spi-max-frequency = <5250000>; spi-max-frequency = <5250000>;
chain-length = <1>;
color-mapping = <LED_COLOR_ID_BLUE
LED_COLOR_ID_GREEN
LED_COLOR_ID_RED>;
}; };
}; };

View file

@ -8,6 +8,7 @@
#include <atmel/samd21.dtsi> #include <atmel/samd21.dtsi>
#include <atmel/samx2xx18.dtsi> #include <atmel/samx2xx18.dtsi>
#include "adafruit_trinket_m0-pinctrl.dtsi" #include "adafruit_trinket_m0-pinctrl.dtsi"
#include <zephyr/dt-bindings/led/led.h>
/ { / {
model = "Adafruit Trinket M0"; model = "Adafruit Trinket M0";
@ -87,6 +88,10 @@
compatible = "apa,apa102"; compatible = "apa,apa102";
reg = <0>; reg = <0>;
spi-max-frequency = <24000000>; spi-max-frequency = <24000000>;
chain-length = <1>;
color-mapping = <LED_COLOR_ID_BLUE
LED_COLOR_ID_GREEN
LED_COLOR_ID_RED>;
}; };
}; };

View file

@ -8,6 +8,7 @@
#include <nordic/nrf52832_qfaa.dtsi> #include <nordic/nrf52832_qfaa.dtsi>
#include "blueclover_plt_demo_v2_nrf52832-pinctrl.dtsi" #include "blueclover_plt_demo_v2_nrf52832-pinctrl.dtsi"
#include <zephyr/dt-bindings/input/input-event-codes.h> #include <zephyr/dt-bindings/input/input-event-codes.h>
#include <zephyr/dt-bindings/led/led.h>
/ { / {
model = "Blue Clover PLT Demo Board V2"; model = "Blue Clover PLT Demo Board V2";
@ -107,6 +108,10 @@
compatible = "apa,apa102"; compatible = "apa,apa102";
reg = <0>; reg = <0>;
spi-max-frequency = <5250000>; spi-max-frequency = <5250000>;
chain-length = <4>;
color-mapping = <LED_COLOR_ID_BLUE
LED_COLOR_ID_GREEN
LED_COLOR_ID_RED>;
}; };
}; };

View file

@ -4,12 +4,18 @@
* SPDX-License-Identifier: Apache-2.0 * SPDX-License-Identifier: Apache-2.0
*/ */
#include <zephyr/dt-bindings/led/led.h>
&spi2 { &spi2 {
lpd8806: lpd8806@0 { lpd8806: lpd8806@0 {
compatible = "greeled,lpd8806"; compatible = "greeled,lpd8806";
reg = <0>; reg = <0>;
spi-max-frequency = <2000000>; spi-max-frequency = <2000000>;
chain-length = <1>;
color-mapping = <LED_COLOR_ID_RED
LED_COLOR_ID_GREEN
LED_COLOR_ID_BLUE>;
}; };
}; };

View file

@ -4,12 +4,18 @@
* SPDX-License-Identifier: Apache-2.0 * SPDX-License-Identifier: Apache-2.0
*/ */
#include <zephyr/dt-bindings/led/led.h>
&spi1 { &spi1 {
apa102: apa102@0 { apa102: apa102@0 {
compatible = "apa,apa102"; compatible = "apa,apa102";
reg = <0>; reg = <0>;
spi-max-frequency = <5250000>; spi-max-frequency = <5250000>;
chain-length = <1>;
color-mapping = <LED_COLOR_ID_BLUE
LED_COLOR_ID_GREEN
LED_COLOR_ID_RED>;
}; };
}; };

View file

@ -10,6 +10,8 @@
* (and be extended to test) real hardware. * (and be extended to test) real hardware.
*/ */
#include <zephyr/dt-bindings/led/led.h>
/ { / {
test { test {
#address-cells = <1>; #address-cells = <1>;
@ -83,6 +85,10 @@
compatible = "greeled,lpd8806"; compatible = "greeled,lpd8806";
reg = <2>; reg = <2>;
spi-max-frequency = <2000000>; spi-max-frequency = <2000000>;
chain-length = <1>;
color-mapping = <LED_COLOR_ID_RED
LED_COLOR_ID_GREEN
LED_COLOR_ID_BLUE>;
}; };
test_led_strip_1: ws2812_spi@3 { test_led_strip_1: ws2812_spi@3 {