mirror of
https://github.com/hanwckf/immortalwrt-mt798x.git
synced 2025-01-08 10:23:47 +08:00
redmi-ax6000: add support for ws2812 leds
This commit is contained in:
parent
e048082895
commit
f0d4c5e09e
@ -3,13 +3,22 @@
|
||||
/dts-v1/;
|
||||
#include <dt-bindings/input/input.h>
|
||||
#include <dt-bindings/gpio/gpio.h>
|
||||
#include <dt-bindings/leds/common.h>
|
||||
|
||||
#include "mt7986a.dtsi"
|
||||
#include "mt7986a-pinctrl.dtsi"
|
||||
|
||||
/ {
|
||||
model = "Xiaomi Redmi Router AX6000";
|
||||
compatible = "xiaomi,redmi-router-ax6000", "mediatek,mt7986a";
|
||||
|
||||
aliases {
|
||||
led-boot = &led_status_rgb;
|
||||
led-failsafe = &led_status_rgb;
|
||||
led-running = &led_status_rgb;
|
||||
led-upgrade = &led_status_rgb;
|
||||
};
|
||||
|
||||
chosen {
|
||||
bootargs = "console=ttyS0,115200n1 loglevel=8 earlycon=uart8250,mmio32,0x11002000";
|
||||
};
|
||||
@ -146,6 +155,32 @@
|
||||
};
|
||||
};
|
||||
|
||||
&spi1 {
|
||||
pinctrl-names = "default";
|
||||
pinctrl-0 = <&spic_pins_g2>;
|
||||
status = "okay";
|
||||
|
||||
ws2812b@0 {
|
||||
#address-cells = <1>;
|
||||
#size-cells = <0>;
|
||||
compatible = "worldsemi,ws2812b";
|
||||
reg = <0>;
|
||||
spi-max-frequency = <3000000>;
|
||||
|
||||
led_status_rgb: led@0 {
|
||||
reg = <0>;
|
||||
label = "rgb:status";
|
||||
color-index = <LED_COLOR_ID_RED LED_COLOR_ID_GREEN LED_COLOR_ID_BLUE>;
|
||||
};
|
||||
|
||||
led_network_rgb: led@1 {
|
||||
reg = <1>;
|
||||
label = "rgb:network";
|
||||
color-index = <LED_COLOR_ID_RED LED_COLOR_ID_GREEN LED_COLOR_ID_BLUE>;
|
||||
};
|
||||
};
|
||||
};
|
||||
|
||||
&wbsys {
|
||||
status = "okay";
|
||||
pinctrl-names = "default", "dbdc";
|
||||
|
@ -359,6 +359,7 @@ define Device/xiaomi_redmi-router-ax6000
|
||||
DEVICE_MODEL := Redmi Router AX6000
|
||||
DEVICE_DTS := mt7986a-xiaomi-redmi-router-ax6000
|
||||
DEVICE_DTS_DIR := $(DTS_DIR)/mediatek
|
||||
DEVICE_PACKAGES := kmod-leds-ws2812b
|
||||
SUPPORTED_DEVICES := xiaomi,redmi-router-ax6000
|
||||
UBINIZE_OPTS := -E 5
|
||||
BLOCKSIZE := 128k
|
||||
@ -376,6 +377,7 @@ define Device/xiaomi_redmi-router-ax6000-stock
|
||||
DEVICE_MODEL := Redmi Router AX6000 (stock layout)
|
||||
DEVICE_DTS := mt7986a-xiaomi-redmi-router-ax6000-stock
|
||||
DEVICE_DTS_DIR := $(DTS_DIR)/mediatek
|
||||
DEVICE_PACKAGES := kmod-leds-ws2812b
|
||||
SUPPORTED_DEVICES := xiaomi,redmi-router-ax6000-stock
|
||||
UBINIZE_OPTS := -E 5
|
||||
BLOCKSIZE := 128k
|
||||
|
19
target/linux/mediatek/mt7986/base-files/etc/board.d/01_leds
Executable file
19
target/linux/mediatek/mt7986/base-files/etc/board.d/01_leds
Executable file
@ -0,0 +1,19 @@
|
||||
#!/bin/sh
|
||||
|
||||
. /lib/functions.sh
|
||||
. /lib/functions/leds.sh
|
||||
. /lib/functions/uci-defaults.sh
|
||||
|
||||
board=$(board_name)
|
||||
|
||||
board_config_update
|
||||
|
||||
case $board in
|
||||
xiaomi,redmi-router-ax6000*)
|
||||
ucidef_set_led_netdev "wan" "wan" "rgb:network" "eth1"
|
||||
;;
|
||||
esac
|
||||
|
||||
board_config_flush
|
||||
|
||||
exit 0
|
@ -267,6 +267,7 @@ CONFIG_IRQ_FORCED_THREADING=y
|
||||
CONFIG_IRQ_TIME_ACCOUNTING=y
|
||||
CONFIG_IRQ_WORK=y
|
||||
CONFIG_JUMP_LABEL=y
|
||||
CONFIG_LEDS_CLASS_MULTICOLOR=y
|
||||
# CONFIG_LEDS_UBNT_LEDBAR is not set
|
||||
CONFIG_LIBFDT=y
|
||||
CONFIG_LOCK_DEBUGGING_SUPPORT=y
|
||||
@ -282,7 +283,6 @@ CONFIG_MDIO_DEVICE=y
|
||||
# CONFIG_MEDIATEK_GE_PHY is not set
|
||||
CONFIG_MEDIATEK_MT6577_AUXADC=y
|
||||
CONFIG_MEDIATEK_NETSYS_V2=y
|
||||
# CONFIG_MEDIATEK_NETSYS_V3 is not set
|
||||
CONFIG_MEDIATEK_WATCHDOG=y
|
||||
CONFIG_MEDIA_SUPPORT=y
|
||||
CONFIG_MEMFD_CREATE=y
|
||||
|
@ -0,0 +1,15 @@
|
||||
--- a/drivers/spi/spi-mt65xx.c
|
||||
+++ b/drivers/spi/spi-mt65xx.c
|
||||
@@ -1156,6 +1156,12 @@ static int mtk_spi_probe(struct platform
|
||||
goto err_put_master;
|
||||
}
|
||||
|
||||
+ ret = clk_prepare_enable(mdata->sel_clk);
|
||||
+ if (ret < 0) {
|
||||
+ dev_err(&pdev->dev, "failed to enable sel_clk (%d)\n", ret);
|
||||
+ goto err_put_master;
|
||||
+ }
|
||||
+
|
||||
ret = clk_set_parent(mdata->sel_clk, mdata->parent_clk);
|
||||
if (ret < 0) {
|
||||
dev_err(&pdev->dev, "failed to clk_set_parent (%d)\n", ret);
|
Loading…
x
Reference in New Issue
Block a user