summaryrefslogtreecommitdiffstats
path: root/sys/dev/led
diff options
context:
space:
mode:
authorganbold <ganbold@FreeBSD.org>2015-05-24 07:45:42 +0000
committerganbold <ganbold@FreeBSD.org>2015-05-24 07:45:42 +0000
commitb3dcb943c4b3562db28255732cc34b27b51db46e (patch)
treea53d7f1b99a7ab76d9db828c32eaac6a69db9eb4 /sys/dev/led
parent32ec61f4a321dcbf084978e1841a78162ba43b42 (diff)
downloadFreeBSD-src-b3dcb943c4b3562db28255732cc34b27b51db46e.zip
FreeBSD-src-b3dcb943c4b3562db28255732cc34b27b51db46e.tar.gz
This implements default-state support as described in:
https://www.kernel.org/doc/Documentation/devicetree/bindings/leds/leds-gpio.txt Without this booting the VSATV102 causes the blue "working" led to turn off when the kernel starts up. With this the led (which is turned on by the firmware) stays on since that's the default state specified in the FDT. Expanded the meaning of the led_create_state state parameter in order to implement support for "keep". The original values were: == 0 Off != 0 On The new values are: == -1 don't change / keep current setting == 0 Off != -1 && != 0 On This should have no effect on acpi_asus_attach which only calls led_create_state with state set to 1. Updated acpi_ibm_attach in order to avoid surprises. Differential Revision: https://reviews.freebsd.org/D2615 Submitted by: John Wehle Reviewed by: gonzo, loos
Diffstat (limited to 'sys/dev/led')
-rw-r--r--sys/dev/led/led.c3
1 files changed, 2 insertions, 1 deletions
diff --git a/sys/dev/led/led.c b/sys/dev/led/led.c
index fe0b66b..c519e22 100644
--- a/sys/dev/led/led.c
+++ b/sys/dev/led/led.c
@@ -293,7 +293,8 @@ led_create_state(led_t *func, void *priv, char const *name, int state)
mtx_lock(&led_mtx);
sc->dev->si_drv1 = sc;
LIST_INSERT_HEAD(&led_list, sc, list);
- sc->func(sc->private, state != 0);
+ if (state != -1)
+ sc->func(sc->private, state != 0);
mtx_unlock(&led_mtx);
return (sc->dev);
OpenPOWER on IntegriCloud