OSDN Git Service

leds: cht-wcove: Add support for breathing mode use hw_pattern sysfs API
authorHans de Goede <hdegoede@redhat.com>
Sun, 30 Apr 2023 19:59:50 +0000 (21:59 +0200)
committerLee Jones <lee@kernel.org>
Thu, 25 May 2023 11:16:15 +0000 (12:16 +0100)
commit5b916aa755551058c0e88e45a8c7db31d7718d59
treed0ff43a3db44c3b1bc8fe283d7bddfa4d2ec5194
parent9697e2f01f1364acea110e808fde4386b0cc159f
leds: cht-wcove: Add support for breathing mode use hw_pattern sysfs API

The hw-blinking of the LED controller in the Whiskey Cove PMIC can also
be used for a hw-breathing effect.

As discussed during review of v2 of the submission of the new
leds-cht-wcove driver, the LED subsystem already supports breathing mode
on several other LED controllers using the hw_pattern interface.

Implement a pattern_set callback to implement breathing mode modelled
after the breathing mode supported by the SC27xx breathing light and
Crane EL15203000 LED drivers. The Whiskey Cove PMIC's breathing mode
is closer to the EL15203000 one then to the SC27xx one since it does
not support staying high / low for a specific time, it only supports
rise and fall times.

As such the supported hw_pattern and the documentation for this is almost
a 1:1 copy of the pattern/docs for the EL15203000 breathing mode.

Suggested-by: Jacek Anaszewski <jacek.anaszewski@gmail.com>
Link: https://lore.kernel.org/all/6beed61c-1fc6-6525-e873-a8978f5fbffb@gmail.com/
Signed-off-by: Hans de Goede <hdegoede@redhat.com>
Link: https://lore.kernel.org/r/20230430195952.862527-4-hdegoede@redhat.com
Signed-off-by: Lee Jones <lee@kernel.org>
Documentation/leds/index.rst
Documentation/leds/leds-cht-wcove.rst [new file with mode: 0644]
drivers/leds/leds-cht-wcove.c