diff options
author | Joseph Strauss <jstrauss@mailbox.org> | 2024-07-10 21:48:44 +0300 |
---|---|---|
committer | Lee Jones <lee@kernel.org> | 2024-08-01 15:40:02 +0300 |
commit | 56e8c56c9af0df8b6de7bc4b6d9a2f4570b055db (patch) | |
tree | 5197f130b04be7fc0028b33139e2a65db5d5c2a3 /drivers/leds/Kconfig | |
parent | 6b08d07cac64c0dcf1dbb4584bdf95d0f789a520 (diff) | |
download | linux-56e8c56c9af0df8b6de7bc4b6d9a2f4570b055db.tar.xz |
leds: Add multicolor support to BlinkM LED driver
Add multicolor support to the BlinkM driver, making it easier to control
from userspace. The BlinkM LED is a programmable RGB LED. The driver
currently supports only the regular LED sysfs class, resulting in the
creation of three distinct classes, one for red, green, and blue. The
user then has to input three values into the three seperate brightness
files within those classes. The multicolor LED framework makes the
device easier to control with the multi_intensity file: the user can
input three values at once to form a color, while still controlling the
lightness with the brightness file.
The main struct blinkm_led has changed slightly. The struct led_classdev
for the regular sysfs classes remain. The blinkm_probe function checks
CONFIG_LEDS_BLINKM_MULTICOLOR to decide whether to load the seperate
sysfs classes or the single multicolor one, but never both. The
blinkm_set_mc_brightness() function had to be added to calculate the
three color components and then set the fields of the blinkm_data
structure accordingly.
Signed-off-by: Joseph Strauss <jstrauss@mailbox.org>
Link: https://lore.kernel.org/r/20240710184844.108006-1-jstrauss@mailbox.org
Signed-off-by: Lee Jones <lee@kernel.org>
Diffstat (limited to 'drivers/leds/Kconfig')
-rw-r--r-- | drivers/leds/Kconfig | 8 |
1 files changed, 8 insertions, 0 deletions
diff --git a/drivers/leds/Kconfig b/drivers/leds/Kconfig index 8d9d8da376e4..2e7831867315 100644 --- a/drivers/leds/Kconfig +++ b/drivers/leds/Kconfig @@ -825,6 +825,14 @@ config LEDS_BLINKM This option enables support for the BlinkM RGB LED connected through I2C. Say Y to enable support for the BlinkM LED. +config LEDS_BLINKM_MULTICOLOR + bool "Enable multicolor support for BlinkM I2C RGB LED" + depends on LEDS_BLINKM + depends on LEDS_CLASS_MULTICOLOR + help + This option enables multicolor sysfs class support for BlinkM LED and + disables the older, separated sysfs interface + config LEDS_POWERNV tristate "LED support for PowerNV Platform" depends on LEDS_CLASS |