net: dsa: bcm_sf2: refactor LED regs access
authorRafał Miłecki <rafal@milecki.pl>
Wed, 29 Dec 2021 17:16:42 +0000 (18:16 +0100)
committerJakub Kicinski <kuba@kernel.org>
Fri, 31 Dec 2021 01:28:32 +0000 (17:28 -0800)
commitaf30f8eaa8fe4ff1987280f716309711997bd979
tree20da6fd77b6d221ca28f1df0a65169dfe195e1db
parentd6c6d0bb2cb3af91c9c1546af7cdf4770d0df443
net: dsa: bcm_sf2: refactor LED regs access

1. Define more regs. Some switches (e.g. BCM4908) have up to 6 regs.
2. Add helper for handling non-lineral port <-> reg mappings.
3. Add support for 12 B LED reg blocks on BCM4908 (different layout)

Complete support for LEDs setup will be implemented once Linux receives
a proper design & implementation for "hardware" LEDs.

Signed-off-by: Rafał Miłecki <rafal@milecki.pl>
Acked-by: Florian Fainelli <f.fainelli@gmail.com>
Link: https://lore.kernel.org/r/20211229171642.22942-1-zajec5@gmail.com
Signed-off-by: Jakub Kicinski <kuba@kernel.org>
drivers/net/dsa/bcm_sf2.c
drivers/net/dsa/bcm_sf2.h
drivers/net/dsa/bcm_sf2_regs.h