diff options
| author | Manuel Fombuena <fombuena@outlook.com> | 2026-09-15 13:48:22 +0100 |
|---|---|---|
| committer | Lee Jones <lee@kernel.org> | 2026-09-22 14:26:03 +0100 |
| commit | ca81ea108502817e3841e98f0d3651398d9e1bd9 (patch) | |
| tree | 08afbda5ec59c6eae83c41ab59dceb5a00471a54 /tools/lib/python/kdoc/python_version.py | |
| parent | 865d81a98602c828515fa6ac3c530efc4205f9f6 (diff) | |
leds: st1202: Cap the channel current in st1202_led_set()
st1202_led_set() writes the requested brightness straight into the 8-bit
channel current register. The LED core limits brightness to
max_brightness, which comes from the device tree max-brightness property
and has no upper bound, so on a board declaring more than 255 a
brightness of 256 reaches the register as 0 and turns the LED off, and
larger values wrap around.
Cap the value at U8_MAX, the width of the register, so anything above it
drives the channel at full current. The pattern and blink paths already
cap the current they program the same way.
Fixes: 259230378c65 ("leds: Add LED1202 I2C driver")
Signed-off-by: Manuel Fombuena <fombuena@outlook.com>
Assisted-by: LLM
Link: https://patch.msgid.link/GV1PR08MB8497C60D1D2921DD0384926FC5BA2@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
