summaryrefslogtreecommitdiff
path: root/drivers/leds/leds-lp5521.c
diff options
context:
space:
mode:
authorChristian Marangi <ansuelsmth@gmail.com>2024-06-26 18:00:16 +0200
committerLee Jones <lee@kernel.org>2024-06-26 17:08:31 +0100
commit794826b2d87538a0fa5429957439f82bb7f32b53 (patch)
tree05ef57e11859fde42dd92ed7a20e624d0550018f /drivers/leds/leds-lp5521.c
parentc63580b27a2c638cbae2fc26484b0bf29f303134 (diff)
leds: leds-lp55xx: Generalize multicolor_brightness function
Generalize multicolor_brightness function as the implementation is the same for most of the lp55xx based LED driver. Suggested-by: Lee Jones <lee@kernel.org> Signed-off-by: Christian Marangi <ansuelsmth@gmail.com> Link: https://lore.kernel.org/r/20240626160027.19703-12-ansuelsmth@gmail.com Signed-off-by: Lee Jones <lee@kernel.org>
Diffstat (limited to 'drivers/leds/leds-lp5521.c')
-rw-r--r--drivers/leds/leds-lp5521.c21
1 files changed, 1 insertions, 20 deletions
diff --git a/drivers/leds/leds-lp5521.c b/drivers/leds/leds-lp5521.c
index e4d0dcdbf11b..dd7e996f22f9 100644
--- a/drivers/leds/leds-lp5521.c
+++ b/drivers/leds/leds-lp5521.c
@@ -222,25 +222,6 @@ static int lp5521_run_selftest(struct lp55xx_chip *chip, char *buf)
return 0;
}
-static int lp5521_multicolor_brightness(struct lp55xx_led *led)
-{
- struct lp55xx_chip *chip = led->chip;
- int ret;
- int i;
-
- mutex_lock(&chip->lock);
- for (i = 0; i < led->mc_cdev.num_colors; i++) {
- ret = lp55xx_write(chip,
- LP5521_REG_LED_PWM_BASE +
- led->mc_cdev.subled_info[i].channel,
- led->mc_cdev.subled_info[i].brightness);
- if (ret)
- break;
- }
- mutex_unlock(&chip->lock);
- return ret;
-}
-
static ssize_t show_engine_mode(struct device *dev,
struct device_attribute *attr,
char *buf, int nr)
@@ -381,7 +362,7 @@ static struct lp55xx_device_config lp5521_cfg = {
.max_channel = LP5521_MAX_LEDS,
.post_init_device = lp5521_post_init_device,
.brightness_fn = lp55xx_led_brightness,
- .multicolor_brightness_fn = lp5521_multicolor_brightness,
+ .multicolor_brightness_fn = lp55xx_multicolor_brightness,
.set_led_current = lp5521_set_led_current,
.firmware_cb = lp55xx_firmware_loaded_cb,
.run_engine = lp5521_run_engine,