kernel: ar8327: fix active-low LED initialization
authorLech Perczak <lech.perczak@gmail.com>
Tue, 4 Feb 2025 20:14:45 +0000 (21:14 +0100)
committerHauke Mehrtens <hauke@hauke-m.de>
Mon, 17 Mar 2025 15:40:46 +0000 (16:40 +0100)
commit5a4f8b26f0185f392bfb0e5f31acdebcf4a10334
tree81368562be8b22ff704c203c082e05b0bc385faa
parent9f1f918aed6d530add666d116303214deaee8236
kernel: ar8327: fix active-low LED initialization

Switch LEDs configured as active-low remain low instead of high upon
initialization, because in ar8327_leds_init, no distinction is made with
regards to LED pattern based on active_low property - only whether HW
mode is active. Select the proper initial pattern based also on
active_low to fix that.

While at that, simplify the equation ruling pattern selection for
setting brightness, avoiding unnecessary binary XOR operation, not
really valid for 'bool' type.

Signed-off-by: Lech Perczak <lech.perczak@gmail.com>
Link: https://github.com/openwrt/openwrt/pull/12487
Signed-off-by: Hauke Mehrtens <hauke@hauke-m.de>
target/linux/generic/files/drivers/net/phy/ar8327.c