]> www.infradead.org Git - users/jedix/linux-maple.git/commit
leds: leds-lp55xx: Generalize update_program_memory function
authorChristian Marangi <ansuelsmth@gmail.com>
Wed, 26 Jun 2024 16:00:13 +0000 (18:00 +0200)
committerLee Jones <lee@kernel.org>
Wed, 26 Jun 2024 16:08:30 +0000 (17:08 +0100)
commit31379a57cf2f155eb147ace86547b7143592945a
treecc9bdceab05004ddec8ef2857f5e8928c94d4d31
parent42a9eaac9784e9b3df56f1947526d7d4d0ed9b26
leds: leds-lp55xx: Generalize update_program_memory function

LED Driver based on lp55xx all use the same logic to write memory in
SMEM. The only difference is that legacy chip doesn't support pages and
have the engine regs one after another.

To handle this apply the same logic used for load_engine also for
update_program_memory.

Introduce a new config in device_config, base_prog. For LED chip
that doesn't support pages, offset this values of 32 for each engine.

Update all lp55xx based LED driver to use this new function and define
all the required bits.

Suggested-by: Lee Jones <lee@kernel.org>
Signed-off-by: Christian Marangi <ansuelsmth@gmail.com>
Link: https://lore.kernel.org/r/20240626160027.19703-9-ansuelsmth@gmail.com
Signed-off-by: Lee Jones <lee@kernel.org>
drivers/leds/leds-lp5521.c
drivers/leds/leds-lp5523.c
drivers/leds/leds-lp5562.c
drivers/leds/leds-lp55xx-common.c
drivers/leds/leds-lp55xx-common.h
drivers/leds/leds-lp8501.c