diff options
| author | Manuel Fombuena <fombuena@outlook.com> | 2026-09-15 13:48:51 +0100 |
|---|---|---|
| committer | Lee Jones <lee@kernel.org> | 2026-09-22 14:26:04 +0100 |
| commit | e264a106d8fc45fd82891cb0c4f8bd9e2c48c152 (patch) | |
| tree | 1beac49bc72df40a13d410712bec48a4ed9e25e4 /tools/lib/python/kdoc/python_version.py | |
| parent | ca81ea108502817e3841e98f0d3651398d9e1bd9 (diff) | |
leds: st1202: Give the channel current ceiling a single helper
The channel current register is 8 bits wide, while max_brightness comes
from the device tree and can be larger. The brightness, pattern and
blink paths each apply that limit on their own, open-coding the same
min_t() against U8_MAX, and the blink path previously drifted from the
others by ignoring max_brightness altogether.
Move the limit into st1202_iled_max() and use it in all three places.
Each path programs the same value as before: the LED core already limits
brightness to max_brightness, so capping it against st1202_iled_max() in
st1202_led_set() gives the same result as capping it against U8_MAX.
Signed-off-by: Manuel Fombuena <fombuena@outlook.com>
Assisted-by: LLM
Link: https://patch.msgid.link/GV1PR08MB8497935DA426302FB808A81EC5BA2@GV1PR08MB8497.eurprd08.prod.outlook.com
Signed-off-by: Lee Jones <lee@kernel.org>
Diffstat (limited to 'tools/lib/python/kdoc/python_version.py')
0 files changed, 0 insertions, 0 deletions
