diff options
author | Christian Marangi <ansuelsmth@gmail.com> | 2024-06-26 18:00:18 +0200 |
---|---|---|
committer | Lee Jones <lee@kernel.org> | 2024-06-26 17:08:31 +0100 |
commit | e35bc5d8a023a55a5f895d6648a455ed83dc0db2 (patch) | |
tree | 5b94c619c384c513a8b00d08c58ed2f1c4f23f9e /drivers/leds/leds-lp5523.c | |
parent | 01e0290d17b2fb9717ee80fed512b32e0460b14c (diff) | |
download | lwn-e35bc5d8a023a55a5f895d6648a455ed83dc0db2.tar.gz lwn-e35bc5d8a023a55a5f895d6648a455ed83dc0db2.zip |
leds: leds-lp55xx: Generalize turn_off_channels function
Generalize turn_off_channels 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-14-ansuelsmth@gmail.com
Signed-off-by: Lee Jones <lee@kernel.org>
Diffstat (limited to 'drivers/leds/leds-lp5523.c')
-rw-r--r-- | drivers/leds/leds-lp5523.c | 10 |
1 files changed, 1 insertions, 9 deletions
diff --git a/drivers/leds/leds-lp5523.c b/drivers/leds/leds-lp5523.c index 3030a4495808..4a4463cb44a4 100644 --- a/drivers/leds/leds-lp5523.c +++ b/drivers/leds/leds-lp5523.c @@ -167,20 +167,12 @@ static void lp5523_stop_engine(struct lp55xx_chip *chip) lp5523_wait_opmode_done(); } -static void lp5523_turn_off_channels(struct lp55xx_chip *chip) -{ - int i; - - for (i = 0; i < LP5523_MAX_LEDS; i++) - lp55xx_write(chip, LP5523_REG_LED_PWM_BASE + i, 0); -} - static void lp5523_run_engine(struct lp55xx_chip *chip, bool start) { /* stop engine */ if (!start) { lp5523_stop_engine(chip); - lp5523_turn_off_channels(chip); + lp55xx_turn_off_channels(chip); return; } |