[PATCH v2 0/1] leds: st1202: Add hardware-accelerated blink support
Manuel Fombuena <[email protected]> Thu, 23 Jul 2026 23:23:13 +0100
| Newsgroups | org.kernel.vger.linux-leds,org.kernel.vger.linux-kernel |
|---|---|
| Message-ID | <GV1PR08MB84979858573735294D41A189C5C02@GV1PR08MB8497.eurprd08.prod.outlook.com> |
This patch adds blink_set() to the ST1202 LED driver, enabling hardware-accelerated blinking via the timer trigger. A series of nine fixes to the pattern engine and brightness handling was recently applied to for-leds-next: https://lore.kernel.org/all/GV1PR08MB8497C0B898789BB73ACE6EE3C5F52@GV1PR08MB8497.eurprd08.prod.outlook.com/ With those fixes in place, the pattern engine can be used reliably to implement blink_set(): a two-step pattern (full brightness for delay_on, off for delay_off) is programmed and started in infinite repeat mode. Requested delays are clamped to the hardware range and rounded up to the nearest 22ms step. During review of the fix series, several pre-existing issues were identified in the driver — including brightness_set() being assigned to a non-blocking callback, the global sequencer affecting all channels on pattern operations, and missing brightness scaling in pattern_set(). These do not affect blink_set(): the callback is not invoked from atomic context, the function explicitly programs all other channels' PWM slots to zero before starting the sequencer, and channel brightness is set directly via the ILED register. The pre-existing issues will be addressed in a follow-up submission. Tested on LED1202 hardware via I2C on a Linksys MX4200v2 router running OpenWrt. Hardware blinking confirmed functional with the timer trigger. --- Changes in v2 --- Use short-form ternary for default delay substitution. Perform roundup before clamp_val to ensure rounding cannot exceed the hardware maximum. Capitalise commit subject per LED subsystem convention. Drop Assisted-by tag per maintainer suggestion. v1: https://lore.kernel.org/all/GV1PR08MB8497C5B8CEB2CE19743DFCFFC5FA2@GV1PR08MB8497.eurprd08.prod.outlook.com/ Manuel Fombuena (1): leds: st1202: Add hardware-accelerated blink support drivers/leds/leds-st1202.c | 82 ++++++++++++++++++++++++++++++++++++++ 1 file changed, 82 insertions(+) -- 2.55.0