]> git.baikalelectronics.ru Git - kernel.git/commit
leds: qcom-lpg: Require pattern to follow documentation
authorBjorn Andersson <bjorn.andersson@linaro.org>
Mon, 23 May 2022 23:37:19 +0000 (16:37 -0700)
committerPavel Machek <pavel@ucw.cz>
Tue, 24 May 2022 20:08:10 +0000 (22:08 +0200)
commitb1938045dd39179b0af011822055b88420c55f06
treea63712ae933948a5b27eca0daba1f706cbac3c4c
parent5568d70354ecdfc4cd5e2ee802fa3a3e83103833
leds: qcom-lpg: Require pattern to follow documentation

The leds-trigger-pattern documentation describes how the brightness of
the LED should transition linearly from one brightness value to the
next, over the given delta_t.

But the pattern engine in the Qualcomm LPG hardware only supports
holding the brightness for each entry for the period.
This subset of patterns can be represented in the leds-trigger-pattern
by injecting zero-time transitions after each entry in the pattern,
resulting in a pattern that pattern that can be rendered by the LPG.

Rework LPG pattern interface to require these zero-time transitions, to
make it comply with this subset of patterns and reject the patterns it
can't render.

Fixes: 55ec01ceafb6 ("leds: Add driver for Qualcomm LPG")
Signed-off-by: Bjorn Andersson <bjorn.andersson@linaro.org>
Signed-off-by: Pavel Machek <pavel@ucw.cz>
Documentation/leds/leds-qcom-lpg.rst
drivers/leds/rgb/leds-qcom-lpg.c