summaryrefslogtreecommitdiffstats
path: root/drivers/leds/leds-lp55xx-common.h
diff options
context:
space:
mode:
authorChristian Marangi <ansuelsmth@gmail.com>2024-06-26 18:00:15 +0200
committerLee Jones <lee@kernel.org>2024-06-26 18:08:31 +0200
commitc63580b27a2c638cbae2fc26484b0bf29f303134 (patch)
tree2c08eae93689cff746021a5f6c6a33cba8201772 /drivers/leds/leds-lp55xx-common.h
parentleds: leds-lp55xx: Generalize firmware_loaded function (diff)
downloadlinux-c63580b27a2c638cbae2fc26484b0bf29f303134.tar.xz
linux-c63580b27a2c638cbae2fc26484b0bf29f303134.zip
leds: leds-lp55xx: Generalize led_brightness function
Generalize led_brightness function as the implementation is the same for most of the lp55xx based LED driver. Introduce a new option in device_config, reg_led_pwm_base since the reg value is not the same for every LED chip. Suggested-by: Lee Jones <lee@kernel.org> Signed-off-by: Christian Marangi <ansuelsmth@gmail.com> Link: https://lore.kernel.org/r/20240626160027.19703-11-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.h3
1 files changed, 3 insertions, 0 deletions
diff --git a/drivers/leds/leds-lp55xx-common.h b/drivers/leds/leds-lp55xx-common.h
index cbc122c56828..4578418e5011 100644
--- a/drivers/leds/leds-lp55xx-common.h
+++ b/drivers/leds/leds-lp55xx-common.h
@@ -100,6 +100,7 @@ struct lp55xx_reg {
* @reset : Chip specific reset command
* @enable : Chip specific enable command
* @prog_mem_base : Chip specific base reg address for chip SMEM programming
+ * @reg_led_pwm_base : Chip specific base reg address for LED PWM conf
* @pages_per_engine : Assigned pages for each engine
* (if not set chip doesn't support pages)
* @max_channel : Maximum number of channels
@@ -118,6 +119,7 @@ struct lp55xx_device_config {
const struct lp55xx_reg reset;
const struct lp55xx_reg enable;
const struct lp55xx_reg prog_mem_base;
+ const struct lp55xx_reg reg_led_pwm_base;
const int pages_per_engine;
const int max_channel;
@@ -213,6 +215,7 @@ extern int lp55xx_run_engine_common(struct lp55xx_chip *chip);
extern int lp55xx_update_program_memory(struct lp55xx_chip *chip,
const u8 *data, size_t size);
extern void lp55xx_firmware_loaded_cb(struct lp55xx_chip *chip);
+extern int lp55xx_led_brightness(struct lp55xx_led *led);
/* common probe/remove function */
extern int lp55xx_probe(struct i2c_client *client);