wifi: mt76: pass LED define via ccflags-y in driver submodules
PATCH 1/1 wifi: mt76: pass LED define via ccflags-y in driver submodules
Commit d2b01fbc329b ("mt76: pass LED define via ccflags-y") converted the top-level Makefile from the deprecated EXTRA_CFLAGS to ccflags-y so that -DCONFIG_MT76_LEDS keeps working now that kbuild no longer honours EXTRA_CFLAGS.
However, ccflags-y (like EXTRA_CFLAGS before it) only applies to the kbuild makefile it is set in and is not inherited by subdirectories pulled in via obj-y/obj-m. The mt7603, mt7615 and mt7915 driver subdirectories each set their own "EXTRA_CFLAGS += ... -DCONFIG_MT76_LEDS", which is now a silent no-op. As a result, CONFIG_MT76_LEDS is undefined when building mt7603/init.c, mt7615/init.c, mt7615/pci_init.c and mt7915/init.c, the IS_ENABLED(CONFIG_MT76_LEDS) blocks are compiled out, and the mt76-* LED class devices are never registered for these drivers.
Convert these subdirectory Makefiles to ccflags-y as well.
mt7996/Makefile never carried the define at all, even though mt7996/init.c has the same IS_ENABLED(CONFIG_MT76_LEDS) checks for its LED callbacks and GPIO mux setup. Add ccflags-y there too so mt7996 LED support is enabled consistently with the other drivers.
mt76x0, mt76x2, mt7921 and mt7925 contain no CONFIG_MT76_LEDS references and are left untouched.
---
Notes for reviewers (not for the commit message):
Previously submitted as https://github.com/openwrt/mt76/pull/1090
before I noticed that PRs on the GitHub mirror don't seem to be reviewed.
Tested on a D-Link DIR-882 A1 (dual MT7615 radios) by building OpenWrt at commit e4c35c2eec66 with this change applied to the mt76
package: the mt76-* LED class devices appeared again under /sys/class/leds. The same result was reported on different MT7615 hardware in
https://github.com/openwrt/mt76/issues/1077#issuecomment-4557037203
The mt7603 and mt7915 hunks are the same fix applied for consistency, but I don't have that hardware to test.
mt7996 in particular enables IS_ENABLED(CONFIG_MT76_LEDS) code paths that appear to have never been built with the define before, so it would be good if someone with mt7996 hardware could confirm nothing regresses. I'm happy to drop the mt7996 hunk and keep only the others if preferred.
mt7603/Makefile | 2 +- mt7615/Makefile | 2 +- mt7915/Makefile | 2 +- mt7996/Makefile | 1 + 4 files changed, 4 insertions(+), 3 deletions(-)
mt7603/Makefile +1 -1
@@ -1,5 +1,5 @@ # SPDX-License-Identifier: BSD-3-Clause-Clear -EXTRA_CFLAGS += -Werror -DCONFIG_MT76_LEDS +ccflags-y += -Werror -DCONFIG_MT76_LEDS obj-m += mt7603e.o mt7603e-y := \
mt7615/Makefile +1 -1
@@ -1,6 +1,6 @@ # SPDX-License-Identifier: BSD-3-Clause-Clear -EXTRA_CFLAGS += -DCONFIG_MT76_LEDS +ccflags-y += -DCONFIG_MT76_LEDS obj-$(CONFIG_MT7615_COMMON) += mt7615-common.o obj-$(CONFIG_MT7615E) += mt7615e.o obj-$(CONFIG_MT7663_USB_SDIO_COMMON) += mt7663-usb-sdio-common.o
mt7915/Makefile +1 -1
@@ -1,6 +1,6 @@ # SPDX-License-Identifier: BSD-3-Clause-Clear -EXTRA_CFLAGS += -DCONFIG_MT76_LEDS +ccflags-y += -DCONFIG_MT76_LEDS obj-$(CONFIG_MT7915E) += mt7915e.o mt7915e-y := pci.o init.o dma.o eeprom.o main.o mcu.o mac.o \
mt7996/Makefile +1 -0
@@ -1,5 +1,6 @@ # SPDX-License-Identifier: BSD-3-Clause-Clear +ccflags-y += -DCONFIG_MT76_LEDS obj-$(CONFIG_MT7996E) += mt7996e.o mt7996e-y := pci.o init.o dma.o eeprom.o main.o mcu.o mac.o \
Signature · 1 line
2.43.0
Quoted 5 lines · Mateus B. Cassiano
mt7996 in particular enables
IS_ENABLED(CONFIG_MT76_LEDS)code paths that appear to have never been built with the define before, so it would be good if someone with mt7996 hardware could confirm nothing regresses. I'm happy to drop the mt7996 hunk and keep only the others if preferred.
A user has since confirmed on the closed GitHub PR that the patch also works as expected on mt7996 hardware:
https://github.com/openwrt/mt76/pull/1090#issuecomment-4979596316
https://forum.banana-pi.org/t/bpi-r4-mt7996-be14-per-band-wifi-7-leds-now-work-incl-mlo/27574/11?u=avbohemen
Quoted 5 lines · Mateus B. Cassiano
mt7996 in particular enables
IS_ENABLED(CONFIG_MT76_LEDS)code paths that appear to have never been built with the define before, so it would be good if someone with mt7996 hardware could confirm nothing regresses. I'm happy to drop the mt7996 hunk and keep only the others if preferred.
A user has since confirmed on the closed GitHub PR that the patch also works as expected on mt7996 hardware:
https://github.com/openwrt/mt76/pull/1090#issuecomment-4979596316
https://forum.banana-pi.org/t/bpi-r4-mt7996-be14-per-band-wifi-7-leds-now-work-incl-mlo/27574/11?u=avbohemen
Hi,
Gentle ping on this patch.
The mt7615 change was tested by me, and the mt7996 hunk was also independently confirmed on hardware in the follow-up above.
Any feedback would be appreciated.
Thanks,
Mateus
Hi,
Gentle ping on this patch.
The mt7615 change was tested by me, and the mt7996 hunk was also independently confirmed on hardware in the follow-up above.
Any feedback would be appreciated.
Thanks,
Mateus
Quoted 6 lines · Mateus B. Cassiano
Hi,
Gentle ping on this patch.
The mt7615 change was tested by me, and the mt7996 hunk was also
independently confirmed on hardware in the follow-up above.Please don't send mt76 repo patches to the linux-wireless list. This
belongs purely in the openwrt/mt76 repository, since it is out of tree. I will apply this to the correct tree later.
- Felix
Hi Felix,
Quoted 1 line
I will apply this to the correct tree later.
May I ask when is later?
This has been broken for about three months now. The fix is a trivial compile-flag change, has been tested on hardware, has had an upstream GitHub PR (#1090) open on openwrt/mt76 for two months, and a downstream GitHub PR (#24333) open on openwrt/openwrt for a month already.
I have to say, at this point it feels like this isn't going anywhere. The bottleneck clearly isn't the patch, so what exactly are we waiting for?
Thanks,
Mateus
Em sex., 31 de jul. de 2026 às 04:13, Felix Fietkau <[email protected]> escreveu:
Quoted 12 lines · Mateus B. Cassiano
Quoted 6 lines
Hi,
Gentle ping on this patch.
The mt7615 change was tested by me, and the mt7996 hunk was also
independently confirmed on hardware in the follow-up above.Please don't send mt76 repo patches to the linux-wireless list. Thisbelongs purely in the openwrt/mt76 repository, since it is out of tree. I will apply this to the correct tree later.
- Felix
Signature · 2 lines
Mateus B. Cassiano Eng. Computação - UFMS
Hi Felix,
Quoted 1 line
I will apply this to the correct tree later.
May I ask when is later?
This has been broken for about three months now. The fix is a trivial compile-flag change, has been tested on hardware, has had an upstream GitHub PR (#1090) open on openwrt/mt76 for two months, and a downstream GitHub PR (#24333) open on openwrt/openwrt for a month already.
I have to say, at this point it feels like this isn't going anywhere. The bottleneck clearly isn't the patch, so what exactly are we waiting for?
Thanks,
Mateus
Em sex., 31 de jul. de 2026 às 04:13, Felix Fietkau <[email protected]> escreveu:
Quoted 12 lines · Mateus B. Cassiano
Quoted 6 lines
Hi,
Gentle ping on this patch.
The mt7615 change was tested by me, and the mt7996 hunk was also
independently confirmed on hardware in the follow-up above.Please don't send mt76 repo patches to the linux-wireless list. Thisbelongs purely in the openwrt/mt76 repository, since it is out of tree. I will apply this to the correct tree later.
- Felix
Signature · 2 lines
Mateus B. Cassiano Eng. Computação - UFMS
For the record, this has since been merged upstream as of c5a3bd91aa735b669618610d5f0ebfa5786845a6
For the record, this has since been merged upstream as of c5a3bd91aa735b669618610d5f0ebfa5786845a6