// SPDX-License-Identifier: GPL-2.0+

/*
 * For SakuraPi Rk3308B: Enable on-board ws2812 LEDs
 * Need to load an external driver, see https://github.com/Sakura-Pi/ws2812-vleds
 *
 * (C) Copyright 2025 TheSnowfield <thesnowfield@sakurapi.org>
 */

/dts-v1/;
/plugin/;

/ {
	fragment@0 {
		target = <&spi1>;
		__overlay__ {

			status = "okay";

			ws2812@0 {
				compatible = "ws2812-vleds";
				reg = <0>;

				// tested spi clk 6750000hz on rk3308b
				spi-max-frequency = <6750000>;

				leds {

					// user defined
					ws_led3: vled3 {
						label = "ws-led3";
						default-state = "off";
						color-value = "#69b3f2";
					};

					// user defined
					ws_led2: vled2 {
						label = "ws-led2";
						default-state = "off";
						color-value = "#9376c8";
					};

					// user defined
					ws_led1: vled1 {
						label = "ws-led1";
						default-state = "off";
						color-value = "#b66bc3";
					};

					// mmc1(emmc) r/w state
					ws_led0: vled0 {
						label = "ws-led0";
						default-state = "on";
						linux,default-trigger = "mmc1";
						color-value = "#eb698f";
					};

				};
			};
		};
	};
};
