kernel: ar8327: support LED device tree bindings
authorLech Perczak <[email protected]>
Tue, 14 Sep 2021 21:39:41 +0000 (23:39 +0200)
committerHauke Mehrtens <[email protected]>
Mon, 17 Mar 2025 15:40:46 +0000 (16:40 +0100)
commit3ba4a4e32cb21e49911e19c0988f48a9f69993d7
tree5e8f352c625e83a0f3867dddef929520583d1efa
parent5a4f8b26f0185f392bfb0e5f31acdebcf4a10334
kernel: ar8327: support LED device tree bindings

The ar8216 switch driver supports exposing configuration of AR8327 and
AR8337 switch LEDs to the userspace, however it is only configurable
through platform data, causing the devices ported from ar71xx target to
lack the support.
Since there is still a long way to go until we can migrate the target to
qca8k, an interim solution is needed.
Extend ar8327_hw_config_of function to parse a "leds"
subnode, which will populate the missing platform data based on device
tree contents, and restore the existing support for the LEDs.
Standard bindings apply, mapping "reg" property to LED index, with
addition of "qca,led-mode" property, which selects HW (0) or SW (1)
mode, defaulting to HW mode.

Signed-off-by: Lech Perczak <[email protected]>
Link: https://github.com/openwrt/openwrt/pull/12487
Signed-off-by: Hauke Mehrtens <[email protected]>
target/linux/generic/files/drivers/net/phy/ar8327.c
target/linux/generic/files/drivers/net/phy/ar8327.h
target/linux/generic/files/include/linux/ar8216_platform.h