diff options
author | Christian Marangi <ansuelsmth@gmail.com> | 2024-06-26 18:00:19 +0200 |
---|---|---|
committer | Lee Jones <lee@kernel.org> | 2024-06-26 18:08:31 +0200 |
commit | 43e91e5eb9c8b36ddd1dc239e0d8c36cc034e8ca (patch) | |
tree | 45a236a81bb926f4417d077003862be1ed8dcafb /drivers/leds/leds-lp55xx-common.c | |
parent | leds: leds-lp55xx: Generalize turn_off_channels function (diff) | |
download | linux-43e91e5eb9c8b36ddd1dc239e0d8c36cc034e8ca.tar.xz linux-43e91e5eb9c8b36ddd1dc239e0d8c36cc034e8ca.zip |
leds: leds-lp55xx: Generalize stop_engine function
Generalize stop_engine 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-15-ansuelsmth@gmail.com
Signed-off-by: Lee Jones <lee@kernel.org>
Diffstat (limited to 'drivers/leds/leds-lp55xx-common.c')
-rw-r--r-- | drivers/leds/leds-lp55xx-common.c | 13 |
1 files changed, 13 insertions, 0 deletions
diff --git a/drivers/leds/leds-lp55xx-common.c b/drivers/leds/leds-lp55xx-common.c index 58121f27f17b..cecff34e6e15 100644 --- a/drivers/leds/leds-lp55xx-common.c +++ b/drivers/leds/leds-lp55xx-common.c @@ -298,6 +298,19 @@ void lp55xx_turn_off_channels(struct lp55xx_chip *chip) } EXPORT_SYMBOL_GPL(lp55xx_turn_off_channels); +void lp55xx_stop_engine(struct lp55xx_chip *chip) +{ + enum lp55xx_engine_index idx = chip->engine_idx; + const struct lp55xx_device_config *cfg = chip->cfg; + u8 mask; + + mask = LP55xx_MODE_ENGn_MASK(idx, cfg->reg_op_mode.shift); + lp55xx_update_bits(chip, cfg->reg_op_mode.addr, mask, 0); + + lp55xx_wait_opmode_done(chip); +} +EXPORT_SYMBOL_GPL(lp55xx_stop_engine); + static void lp55xx_reset_device(struct lp55xx_chip *chip) { const struct lp55xx_device_config *cfg = chip->cfg; |