svn commit: r348153 - head/sys/dev/gpio

Andriy Gapon avg at FreeBSD.org
Thu May 23 11:15:23 UTC 2019


Author: avg
Date: Thu May 23 11:15:22 2019
New Revision: 348153
URL: https://svnweb.freebsd.org/changeset/base/348153

Log:
  gpioled: add a new hint for initial state
  
  hint.gpioled.%d.state determines the initial state of the LED when the
  driver takes control over it:
    0 - the LED is off
    1 - the LED is on
   -1 - the LED is kept as it was
  
  While here, add a module version declaration.
  
  MFC after:	2 weks

Modified:
  head/sys/dev/gpio/gpioled.c

Modified: head/sys/dev/gpio/gpioled.c
==============================================================================
--- head/sys/dev/gpio/gpioled.c	Thu May 23 11:06:38 2019	(r348152)
+++ head/sys/dev/gpio/gpioled.c	Thu May 23 11:15:22 2019	(r348153)
@@ -115,6 +115,8 @@ gpioled_attach(device_t dev)
 		name = NULL;
 	resource_int_value(device_get_name(dev),
 	    device_get_unit(dev), "invert", &sc->sc_invert);
+	resource_int_value(device_get_name(dev),
+	    device_get_unit(dev), "state", &state);
 
 	sc->sc_leddev = led_create_state(gpioled_control, sc, name ? name :
 	    device_get_nameunit(dev), state);
@@ -155,3 +157,4 @@ static driver_t gpioled_driver = {
 
 DRIVER_MODULE(gpioled, gpiobus, gpioled_driver, gpioled_devclass, 0, 0);
 MODULE_DEPEND(gpioled, gpiobus, 1, 1, 1);
+MODULE_VERSION(gpioled, 1);


More information about the svn-src-head mailing list