Skip to contentSkip to conversation

leds: leds-multi-gpio: Add multiple GPIOs LED driver

PATCH New Hermes Zhang 1 participant 1 message Mar 22, 2021 LED

lore
Share & tools
lore
#0 lore raw

PATCH 1/1 leds: leds-multi-gpio: Add multiple GPIOs LED driver

From: Hermes Zhang <[email protected]>

Introduce a new multiple GPIOs LED driver. This LED will made of multiple GPIOs (up to 8) and will map different brightness to different GPIOs states which defined in dts file.

---
 drivers/leds/Kconfig           |  12 +++
 drivers/leds/Makefile          |   1 +
 drivers/leds/leds-multi-gpio.c | 140 +++++++++++++++++++++++++++++++++
 3 files changed, 153 insertions(+)
 create mode 100644 drivers/leds/leds-multi-gpio.c
drivers/leds/Kconfig +12 -0
index b6742b4231bf..e3ff84080192 100644
@@ -370,6 +370,18 @@ config LEDS_GPIO
 	  defined as platform devices and/or OpenFirmware platform devices.
 	  The code to use these bindings can be selected below.
 
+config LEDS_MULTI_GPIO
+	tristate "LED Support for multiple GPIOs LED"
+	depends on LEDS_CLASS
+	depends on GPIOLIB
+	help
+	  This option enables support for a multiple GPIOs LED. Such LED is made
+	  of multiple GPIOs and could change the brightness by setting different
+	  states of the GPIOs.
+
+	  To compile this driver as a module, choose M here: the
+	  module will be called leds-multi-gpio.
+
 config LEDS_LP3944
 	tristate "LED Support for N.S. LP3944 (Fun Light) I2C chip"
 	depends on LEDS_CLASS
drivers/leds/Makefile +1 -0
index 2a698df9da57..984201ec5375 100644
@@ -30,6 +30,7 @@ obj-$(CONFIG_LEDS_DA903X)		+= leds-da903x.o
 obj-$(CONFIG_LEDS_DA9052)		+= leds-da9052.o
 obj-$(CONFIG_LEDS_FSG)			+= leds-fsg.o
 obj-$(CONFIG_LEDS_GPIO)			+= leds-gpio.o
+obj-$(CONFIG_LEDS_MULTI_GPIO)		+= leds-multi-gpio.o
 obj-$(CONFIG_LEDS_GPIO_REGISTER)	+= leds-gpio-register.o
 obj-$(CONFIG_LEDS_HP6XX)		+= leds-hp6xx.o
 obj-$(CONFIG_LEDS_INTEL_SS4200)		+= leds-ss4200.o
drivers/leds/leds-multi-gpio.c new file +140 -0

140 lines not on this page · raw message

Signature · 1 line
2.20.1