[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <20250704214219.18796-3-rosenp@gmail.com>
Date: Fri, 4 Jul 2025 14:42:18 -0700
From: Rosen Penev <rosenp@...il.com>
To: linux-wireless@...r.kernel.org
Cc: Toke Høiland-Jørgensen <toke@...e.dk>,
nbd@....name,
jeff.johnson@....qualcomm.com,
Johannes Berg <johannes@...solutions.net>,
Rob Herring <robh@...nel.org>,
Krzysztof Kozlowski <krzk+dt@...nel.org>,
Conor Dooley <conor+dt@...nel.org>,
Thomas Bogendoerfer <tsbogend@...ha.franken.de>,
devicetree@...r.kernel.org (open list:OPEN FIRMWARE AND FLATTENED DEVICE TREE BINDINGS),
linux-kernel@...r.kernel.org (open list),
linux-mips@...r.kernel.org (open list:MIPS)
Subject: [PATCH 2/3] wifi: ath9k: ahb: add led pin OF support
The old and removed platform code had support for assigning a value for
the LED pin for when the default is not correct. Effectively a fix for a
non working LED.
It seems that it's preferred to use led-sources as the binding for this
instead of a vendor prefixed variant.
For setting an LED to active high, a negation of led-active-low is used,
as two drivers currently use that and no drivers use led-active-high or
something similar.
Signed-off-by: Rosen Penev <rosenp@...il.com>
---
drivers/net/wireless/ath/ath9k/init.c | 11 +++++++++++
1 file changed, 11 insertions(+)
diff --git a/drivers/net/wireless/ath/ath9k/init.c b/drivers/net/wireless/ath/ath9k/init.c
index 629f66a25307..4f967bc34460 100644
--- a/drivers/net/wireless/ath/ath9k/init.c
+++ b/drivers/net/wireless/ath/ath9k/init.c
@@ -650,6 +650,17 @@ static int ath9k_of_init(struct ath_softc *sc)
if (ret == -EPROBE_DEFER)
return ret;
+ np = of_get_child_by_name(np, "led");
+ if (np && of_device_is_available(np)) {
+ u32 led_pin;
+
+ if (!of_property_read_u32(np, "led-sources", &led_pin))
+ ah->led_pin = led_pin;
+
+ ah->config.led_active_high = !of_property_read_bool(np, "led-active-low");
+ of_node_put(np);
+ }
+
return 0;
}
--
2.50.0
Powered by blists - more mailing lists