linux/drivers/leds/rgb
Abel Vesa 4b037851ed leds: rgb: leds-qcom-lpg: Fix calculation of best period Hi-Res PWMs
commit 2528eec7da upstream.

When determining the actual best period by looping through all
possible PWM configs, the resolution currently used is based on
bit shift value which is off-by-one above the possible maximum
PWM value allowed.

So subtract one from the resolution before determining the best
period so that the maximum duty cycle requested by the PWM user
won't result in a value above the maximum allowed by the selected
resolution.

Cc: stable@vger.kernel.org    # 6.4
Fixes: b00d2ed376 ("leds: rgb: leds-qcom-lpg: Add support for high resolution PWM")
Signed-off-by: Abel Vesa <abel.vesa@linaro.org>
Reviewed-by: Sebastian Reichel <sre@kernel.org>
Link: https://lore.kernel.org/r/20250305-leds-qcom-lpg-fix-max-pwm-on-hi-res-v4-3-bfe124a53a9f@linaro.org
Signed-off-by: Lee Jones <lee@kernel.org>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
History 2025-04-20 10:15:44 +02:00
..
Kconfig leds: rgb: leds-ktd202x: Get device properties through fwnode to support ACPI 2024-05-31 12:55:44 +01:00
leds-group-multicolor.c leds: rgb: leds-group-multicolor: Allow LEDs to stay on in suspend 2024-03-07 08:48:08 +00:00
leds-ktd202x.c leds: rgb: leds-ktd202x: Initialize mutex earlier 2024-05-31 12:57:34 +01:00
leds-mt6370-rgb.c move asm/unaligned.h to linux/unaligned.h 2024-10-02 17:23:23 -04:00
leds-ncp5623.c leds: ncp5623: Use common error handling code in ncp5623_probe() 2024-06-26 16:56:02 +01:00
leds-pwm-multicolor.c pwm: Rename pwm_apply_state() to pwm_apply_might_sleep() 2023-12-20 16:07:04 +01:00
leds-qcom-lpg.c leds: rgb: leds-qcom-lpg: Fix calculation of best period Hi-Res PWMs 2025-04-20 10:15:44 +02:00
Makefile leds: Add NCP5623 multi-led driver 2024-03-07 08:48:18 +00:00