summaryrefslogtreecommitdiffstats
path: root/include
diff options
context:
space:
mode:
authorJean-Christophe PLAGNIOL-VILLARD <plagnioj@jcrosoft.com>2012-11-16 21:17:23 +0100
committerSascha Hauer <s.hauer@pengutronix.de>2012-11-19 11:25:55 +0100
commit06e641353e8304c033c05de95da64af5656b2ec2 (patch)
treee9a1605055d51e7814435c7a200254b4852e927c /include
parentcc37eb4a4de76a5f5f26613b73e83edf56b8ef1f (diff)
downloadbarebox-06e641353e8304c033c05de95da64af5656b2ec2.tar.gz
barebox-06e641353e8304c033c05de95da64af5656b2ec2.tar.xz
led-gpio: add bicolor led support
those led can have 2 colors but one at a time otherwise they are black Signed-off-by: Jean-Christophe PLAGNIOL-VILLARD <plagnioj@jcrosoft.com> Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
Diffstat (limited to 'include')
-rw-r--r--include/led.h20
1 files changed, 20 insertions, 0 deletions
diff --git a/include/led.h b/include/led.h
index 9ec1f0d37b..dd551fe161 100644
--- a/include/led.h
+++ b/include/led.h
@@ -65,6 +65,12 @@ struct gpio_led {
struct led led;
};
+struct gpio_bicolor_led {
+ int gpio_c0, gpio_c1;
+ bool active_low;
+ struct led led;
+};
+
struct gpio_rgb_led {
int gpio_r, gpio_g, gpio_b;
bool active_low;
@@ -85,6 +91,20 @@ static inline void led_gpio_unregister(struct gpio_led *led)
}
#endif
+#ifdef CONFIG_LED_GPIO_BICOLOR
+int led_gpio_bicolor_register(struct gpio_bicolor_led *led);
+void led_gpio_bicolor_unregister(struct gpio_bicolor_led *led);
+#else
+static inline int led_gpio_bicolor_register(struct gpio_bicolor_led *led)
+{
+ return -ENOSYS;
+}
+
+static inline void led_gpio_bicolor_unregister(struct gpio_bicolor_led *led)
+{
+}
+#endif
+
#ifdef CONFIG_LED_GPIO_RGB
int led_gpio_rgb_register(struct gpio_rgb_led *led);
void led_gpio_rgb_unregister(struct gpio_led *led);