diff options
author | Christian Marangi <ansuelsmth@gmail.com> | 2024-06-26 18:00:11 +0200 |
---|---|---|
committer | Lee Jones <lee@kernel.org> | 2024-06-26 18:08:30 +0200 |
commit | 409a9dc53682b9f02793584d17721ab3e1b9c86f (patch) | |
tree | d94b96a6d40a729ce095ffaf5890543f5370eb3f /drivers/leds/leds-lp55xx-common.h | |
parent | leds: leds-lp55xx: Generalize load_engine function (diff) | |
download | linux-409a9dc53682b9f02793584d17721ab3e1b9c86f.tar.xz linux-409a9dc53682b9f02793584d17721ab3e1b9c86f.zip |
leds: leds-lp55xx: Generalize load_engine_and_select_page function
Generalize load_engine_and_select_page by reworking the implementation
and making it part of the generic load_engine function.
Add a new option in device_config, pages_per_engine used to define pages
assigned to each engine. With this option set, it's assumed LED chip
supports pages and load_engine will correctly setup the write page.
An equal amount of pages is assigned to each engine and they are
assigned from page 0.
Update any lp55xx based LED driver to define the option and use the new
function.
Suggested-by: Lee Jones <lee@kernel.org>
Signed-off-by: Christian Marangi <ansuelsmth@gmail.com>
Link: https://lore.kernel.org/r/20240626160027.19703-7-ansuelsmth@gmail.com
Signed-off-by: Lee Jones <lee@kernel.org>
Diffstat (limited to 'drivers/leds/leds-lp55xx-common.h')
-rw-r--r-- | drivers/leds/leds-lp55xx-common.h | 3 |
1 files changed, 3 insertions, 0 deletions
diff --git a/drivers/leds/leds-lp55xx-common.h b/drivers/leds/leds-lp55xx-common.h index bb146bcecdcf..015ac2ef4e4d 100644 --- a/drivers/leds/leds-lp55xx-common.h +++ b/drivers/leds/leds-lp55xx-common.h @@ -99,6 +99,8 @@ struct lp55xx_reg { * (if not supported 153 us sleep) * @reset : Chip specific reset command * @enable : Chip specific enable command + * @pages_per_engine : Assigned pages for each engine + * (if not set chip doesn't support pages) * @max_channel : Maximum number of channels * @post_init_device : Chip specific initialization code * @brightness_fn : Brightness function @@ -113,6 +115,7 @@ struct lp55xx_device_config { const struct lp55xx_reg engine_busy; /* addr, mask */ const struct lp55xx_reg reset; const struct lp55xx_reg enable; + const int pages_per_engine; const int max_channel; /* define if the device has specific initialization process */ |