From 6e017db7190f8cb4f2ba49017469512d7657b710 Mon Sep 17 00:00:00 2001 From: AmadeusGhost <42570690+AmadeusGhost@users.noreply.github.com> Date: Sun, 13 Jun 2021 23:20:25 +0800 Subject: [PATCH] ipq806x: m520: add gpio-led sys support Signed-off-by: AmadeusGhost --- target/linux/ipq806x/config-5.10 | 2 ++ target/linux/ipq806x/config-5.4 | 2 ++ .../boot/dts/qcom-ipq8064-rg-mtfi-m520.dts | 31 +++++++++++-------- target/linux/ipq806x/image/Makefile | 2 +- 4 files changed, 23 insertions(+), 14 deletions(-) diff --git a/target/linux/ipq806x/config-5.10 b/target/linux/ipq806x/config-5.10 index 6b8a418d36..ba321dc0be 100644 --- a/target/linux/ipq806x/config-5.10 +++ b/target/linux/ipq806x/config-5.10 @@ -174,6 +174,8 @@ CONFIG_GENERIC_TIME_VSYSCALL=y CONFIG_GENERIC_VDSO_32=y CONFIG_GPIOLIB=y CONFIG_GPIOLIB_IRQCHIP=y +CONFIG_GPIO_PCA953X=y +CONFIG_GPIO_PCA953X_IRQ=y CONFIG_GRO_CELLS=y CONFIG_HANDLE_DOMAIN_IRQ=y CONFIG_HARDEN_BRANCH_PREDICTOR=y diff --git a/target/linux/ipq806x/config-5.4 b/target/linux/ipq806x/config-5.4 index 80549ad304..a684df26b5 100644 --- a/target/linux/ipq806x/config-5.4 +++ b/target/linux/ipq806x/config-5.4 @@ -189,6 +189,8 @@ CONFIG_GENERIC_STRNLEN_USER=y CONFIG_GENERIC_TIME_VSYSCALL=y CONFIG_GPIOLIB=y CONFIG_GPIOLIB_IRQCHIP=y +CONFIG_GPIO_PCA953X=y +CONFIG_GPIO_PCA953X_IRQ=y CONFIG_GRO_CELLS=y CONFIG_HANDLE_DOMAIN_IRQ=y CONFIG_HARDEN_BRANCH_PREDICTOR=y diff --git a/target/linux/ipq806x/files/arch/arm/boot/dts/qcom-ipq8064-rg-mtfi-m520.dts b/target/linux/ipq806x/files/arch/arm/boot/dts/qcom-ipq8064-rg-mtfi-m520.dts index 83f0162d5d..858831a889 100644 --- a/target/linux/ipq806x/files/arch/arm/boot/dts/qcom-ipq8064-rg-mtfi-m520.dts +++ b/target/linux/ipq806x/files/arch/arm/boot/dts/qcom-ipq8064-rg-mtfi-m520.dts @@ -16,12 +16,26 @@ aliases { mdio-gpio0 = &mdio0; sdcc1 = &sdcc1; + + led-boot = &led_sys; + led-failsafe = &led_sys; + led-running = &led_sys; + led-upgrade = &led_sys; }; chosen { bootargs = "root=/dev/mmcblk0p3 rootfstype=squashfs,ext4 rootwait noinitrd"; }; + leds { + compatible = "gpio-leds"; + + led_sys: sys { + label = "m520:green:sys"; + gpios = <&gpio_ext 15 GPIO_ACTIVE_LOW>; + }; + }; + keys { compatible = "gpio-keys"; pinctrl-0 = <&button_pins>; @@ -45,15 +59,6 @@ }; }; - led_pins: led_pins { - mux { - pins = "gpio7", "gpio8", "gpio9", "gpio53"; - function = "gpio"; - drive-strength = <2>; - bias-pull-down; - }; - }; - mdio0_pins: mdio0_pins { clk { pins = "gpio1"; @@ -111,21 +116,21 @@ status = "okay"; lm75@48 { - status = "okay"; compatible = "lm75"; reg = <0x48>; }; pcf8563: rtc@51 { - status = "okay"; compatible = "nxp,pcf8563"; reg = <0x51>; }; - tca9539@74 { - status = "okay"; + gpio_ext: tca9539@74 { compatible = "ti,tca9539"; reg = <0x74>; + + gpio-controller; + #gpio-cells = <2>; }; }; }; diff --git a/target/linux/ipq806x/image/Makefile b/target/linux/ipq806x/image/Makefile index 1220f9d051..c06d8d932f 100644 --- a/target/linux/ipq806x/image/Makefile +++ b/target/linux/ipq806x/image/Makefile @@ -362,7 +362,7 @@ define Device/ruijie_rg-mtfi-m520 IMAGE/mmcblk0p2-kernel.bin := append-kernel | pad-to $$$${KERNEL_SIZE} IMAGE/mmcblk0p3-rootfs.bin := append-rootfs | pad-rootfs DEVICE_PACKAGES := ath10k-firmware-qca988x-ct e2fsprogs f2fs-tools \ - kmod-gpio-pca953x kmod-hwmon-lm75 kmod-fs-ext4 kmod-fs-f2fs kmod-rtc-pcf8563 losetup + kmod-hwmon-lm75 kmod-fs-ext4 kmod-fs-f2fs kmod-rtc-pcf8563 losetup endef TARGET_DEVICES += ruijie_rg-mtfi-m520