* [PATCH RESEND] arm64: dts: mediatek: add LED and key support on Xiaomi AX3000T
@ 2026-05-23 10:18 Aleksander Jan Bajkowski
2026-05-23 10:37 ` sashiko-bot
2026-05-25 8:43 ` AngeloGioacchino Del Regno
0 siblings, 2 replies; 3+ messages in thread
From: Aleksander Jan Bajkowski @ 2026-05-23 10:18 UTC (permalink / raw)
To: robh, krzk+dt, conor+dt, matthias.bgg, angelogioacchino.delregno,
devicetree, linux-kernel, linux-arm-kernel, linux-mediatek
Cc: Aleksander Jan Bajkowski
This patch adds support for keys and LEDs on the Xiaomi AX3000T.
Signed-off-by: Aleksander Jan Bajkowski <olek2@wp.pl>
---
.../dts/mediatek/mt7981b-xiaomi-ax3000t.dts | 36 +++++++++++++++++++
1 file changed, 36 insertions(+)
diff --git a/arch/arm64/boot/dts/mediatek/mt7981b-xiaomi-ax3000t.dts b/arch/arm64/boot/dts/mediatek/mt7981b-xiaomi-ax3000t.dts
index a314c3e05e50..db399cb3ead7 100644
--- a/arch/arm64/boot/dts/mediatek/mt7981b-xiaomi-ax3000t.dts
+++ b/arch/arm64/boot/dts/mediatek/mt7981b-xiaomi-ax3000t.dts
@@ -1,6 +1,9 @@
// SPDX-License-Identifier: GPL-2.0-only OR MIT
/dts-v1/;
+#include <dt-bindings/input/input.h>
+#include <dt-bindings/gpio/gpio.h>
+#include <dt-bindings/leds/common.h>
#include "mt7981b.dtsi"
@@ -12,4 +15,37 @@ memory@40000000 {
reg = <0 0x40000000 0 0x10000000>;
device_type = "memory";
};
+
+ keys {
+ compatible = "gpio-keys";
+
+ key-mesh {
+ label = "MESH";
+ gpios = <&pio 0 GPIO_ACTIVE_LOW>;
+ linux,code = <BTN_9>;
+ linux,input-type = <EV_SW>;
+ };
+
+ key-reset {
+ label = "RESET";
+ gpios = <&pio 1 GPIO_ACTIVE_LOW>;
+ linux,code = <KEY_RESTART>;
+ };
+ };
+
+ leds {
+ compatible = "gpio-leds";
+
+ led-0 {
+ color = <LED_COLOR_ID_BLUE>;
+ function = LED_FUNCTION_STATUS;
+ gpios = <&pio 9 GPIO_ACTIVE_LOW>;
+ };
+
+ led-1 {
+ color = <LED_COLOR_ID_YELLOW>;
+ function = LED_FUNCTION_STATUS;
+ gpios = <&pio 10 GPIO_ACTIVE_LOW>;
+ };
+ };
};
--
2.53.0
^ permalink raw reply related [flat|nested] 3+ messages in thread* Re: [PATCH RESEND] arm64: dts: mediatek: add LED and key support on Xiaomi AX3000T
2026-05-23 10:18 [PATCH RESEND] arm64: dts: mediatek: add LED and key support on Xiaomi AX3000T Aleksander Jan Bajkowski
@ 2026-05-23 10:37 ` sashiko-bot
2026-05-25 8:43 ` AngeloGioacchino Del Regno
1 sibling, 0 replies; 3+ messages in thread
From: sashiko-bot @ 2026-05-23 10:37 UTC (permalink / raw)
To: Aleksander Jan Bajkowski; +Cc: conor+dt, devicetree, robh
Thank you for your contribution! Sashiko AI review found 1 potential issue(s) to consider:
- [Medium] The `key-mesh` node incorrectly pairs `linux,code = <BTN_9>` with `linux,input-type = <EV_SW>`. Since `BTN_9` (265) exceeds `SW_MAX`, the input subsystem rejects the capability, causing a kernel error splat on boot and rendering the button completely non-functional.
--
commit b3e6ab558b15225bf59d262cc68b446d232036a9
Author: Aleksander Jan Bajkowski <olek2@wp.pl>
arm64: dts: mediatek: add LED and key support on Xiaomi AX3000T
This commit adds device tree support for the physical buttons and
status LEDs present on the Xiaomi AX3000T router.
> diff --git a/arch/arm64/boot/dts/mediatek/mt7981b-xiaomi-ax3000t.dts b/arch/arm64/boot/dts/mediatek/mt7981b-xiaomi-ax3000t.dts
> index a314c3e05e500..db399cb3ead73 100644
> --- a/arch/arm64/boot/dts/mediatek/mt7981b-xiaomi-ax3000t.dts
> +++ b/arch/arm64/boot/dts/mediatek/mt7981b-xiaomi-ax3000t.dts
[ ... ]
> @@ -12,4 +15,37 @@ memory@40000000 {
> reg = <0 0x40000000 0 0x10000000>;
> device_type = "memory";
> };
> +
> + keys {
> + compatible = "gpio-keys";
> +
> + key-mesh {
> + label = "MESH";
> + gpios = <&pio 0 GPIO_ACTIVE_LOW>;
> + linux,code = <BTN_9>;
> + linux,input-type = <EV_SW>;
[Severity: Medium]
Will this combination of EV_SW and BTN_9 cause a capability rejection
during boot?
During the gpio-keys driver probe, input_set_capability() is called to
register the button capability. This function strictly bounds-checks the
event code against the maximum for the given type.
For EV_SW, input_max_code is SW_MAX (17). Since BTN_9 (265) exceeds SW_MAX,
the check fails, causing the kernel to print an error splat and return
early without registering the switch capability.
Does this leave the mesh button completely non-functional when pressed?
> + };
> +
> + key-reset {
[ ... ]
--
Sashiko AI review · https://sashiko.dev/#/patchset/20260523101904.293215-1-olek2@wp.pl?part=1
^ permalink raw reply [flat|nested] 3+ messages in thread* Re: [PATCH RESEND] arm64: dts: mediatek: add LED and key support on Xiaomi AX3000T
2026-05-23 10:18 [PATCH RESEND] arm64: dts: mediatek: add LED and key support on Xiaomi AX3000T Aleksander Jan Bajkowski
2026-05-23 10:37 ` sashiko-bot
@ 2026-05-25 8:43 ` AngeloGioacchino Del Regno
1 sibling, 0 replies; 3+ messages in thread
From: AngeloGioacchino Del Regno @ 2026-05-25 8:43 UTC (permalink / raw)
To: robh, krzk+dt, conor+dt, matthias.bgg, devicetree, linux-kernel,
linux-arm-kernel, linux-mediatek, Aleksander Jan Bajkowski
On Sat, 23 May 2026 12:18:55 +0200, Aleksander Jan Bajkowski wrote:
> This patch adds support for keys and LEDs on the Xiaomi AX3000T.
Applied to v7.1-next/dts64, thanks!
[1/1] arm64: dts: mediatek: add LED and key support on Xiaomi AX3000T
commit: 9897c586b09f79ebcf2e67a888743c046b20d254
Cheers,
Angelo
^ permalink raw reply [flat|nested] 3+ messages in thread
end of thread, other threads:[~2026-05-25 8:43 UTC | newest]
Thread overview: 3+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2026-05-23 10:18 [PATCH RESEND] arm64: dts: mediatek: add LED and key support on Xiaomi AX3000T Aleksander Jan Bajkowski
2026-05-23 10:37 ` sashiko-bot
2026-05-25 8:43 ` AngeloGioacchino Del Regno
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox