Skip site navigation (1)Skip section navigation (2)
Date:      Thu, 23 May 2019 11:15:22 +0000 (UTC)
From:      Andriy Gapon <avg@FreeBSD.org>
To:        src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org
Subject:   svn commit: r348153 - head/sys/dev/gpio
Message-ID:  <201905231115.x4NBFMSu037564@repo.freebsd.org>

next in thread | raw e-mail | index | archive | help
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);



Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?201905231115.x4NBFMSu037564>