aboutsummaryrefslogtreecommitdiff
path: root/sys/dev/led
Commit message (Collapse)AuthorAgeFilesLines
* sys: Automated cleanup of cdefs and other formattingWarner Losh2023-11-271-1/+0
| | | | | | | | | | | | | | | | Apply the following automated changes to try to eliminate no-longer-needed sys/cdefs.h includes as well as now-empty blank lines in a row. Remove /^#if.*\n#endif.*\n#include\s+<sys/cdefs.h>.*\n/ Remove /\n+#include\s+<sys/cdefs.h>.*\n+#if.*\n#endif.*\n+/ Remove /\n+#if.*\n#endif.*\n+/ Remove /^#if.*\n#endif.*\n/ Remove /\n+#include\s+<sys/cdefs.h>\n#include\s+<sys/types.h>/ Remove /\n+#include\s+<sys/cdefs.h>\n#include\s+<sys/param.h>/ Remove /\n+#include\s+<sys/cdefs.h>\n#include\s+<sys/capsicum.h>/ Sponsored by: Netflix
* sys: Remove $FreeBSD$: one-line .c patternWarner Losh2023-08-161-2/+0
| | | | Remove /^[\s*]*__FBSDID\("\$FreeBSD\$"\);?\s*\n/
* sys: Remove $FreeBSD$: two-line .h patternWarner Losh2023-08-161-2/+0
| | | | Remove /^\s*\*\n \*\s+\$FreeBSD\$$\n/
* Extract eventfilter declarations to sys/_eventfilter.hConrad Meyer2019-05-201-5/+8
| | | | | | | | | | | | | | | | | | | | | | | | This allows replacing "sys/eventfilter.h" includes with "sys/_eventfilter.h" in other header files (e.g., sys/{bus,conf,cpu}.h) and reduces header pollution substantially. EVENTHANDLER_DECLARE and EVENTHANDLER_LIST_DECLAREs were moved out of .c files into appropriate headers (e.g., sys/proc.h, powernv/opal.h). As a side effect of reduced header pollution, many .c files and headers no longer contain needed definitions. The remainder of the patch addresses adding appropriate includes to fix those files. LOCK_DEBUG and LOCK_FILE_LINE_ARG are moved to sys/_lock.h, as required by sys/mutex.h since r326106 (but silently protected by header pollution prior to this change). No functional change (intended). Of course, any out of tree modules that relied on header pollution for sys/eventhandler.h, sys/lock.h, or sys/mutex.h inclusion need to be fixed. __FreeBSD_version has been bumped. Notes: svn path=/head/; revision=347984
* [led] propagate error from set_led() to the callerOleksandr Tymoshenko2019-01-151-1/+1
| | | | | | | | | | | | | Do not lose error condition by always returning 0 from set_led. None of the calls to set_led checks for return value at the moment so none of API consumers in base is affected. PR: 231567 Submitted by: Bertrand Petit <bsdpr@phoe.frmug.org> MFC after: 1 week Notes: svn path=/head/; revision=343029
* SPDX: use the Beerware identifier.Pedro F. Giffuni2017-11-301-0/+2
| | | | Notes: svn path=/head/; revision=326408
* This implements default-state support as described in:Ganbold Tsagaankhuu2015-05-241-1/+2
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | 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 Notes: svn path=/head/; revision=283360
* MFcalloutng:Alexander Motin2013-02-191-8/+13
| | | | | | | | Make led(4) fire callouts at 10Hz only when there is at least one LED that is requested to blink. Do not fire if all LEDs are static (usual case). Notes: svn path=/head/; revision=247008
* MFgraid/head r218174:Alexander Motin2011-03-242-64/+94
| | | | | | | Add simple in-kernel API for controlling leds. Notes: svn path=/head/; revision=219951
* Fix an incorrect use of sbuf_overflowed() after a call to sbuf_finish().Matthew D Fleming2010-09-091-7/+3
| | | | Notes: svn path=/head/; revision=212371
* (S)LIST_HEAD_INITIALIZER takes a (S)LIST_HEAD as an argument.Antoine Brodin2009-12-281-1/+1
| | | | | | | | | | | | Fix some wrong usages. Note: this does not affect generated binaries as this argument is not used. PR: 137213 Submitted by: Eygene Ryabinkin (initial version) MFC after: 1 month Notes: svn path=/head/; revision=201145
* Remove unit2minor() use from kernel code.Ed Schouten2008-09-261-1/+1
| | | | | | | | | | | | | | | | | | When I changed kern_conf.c three months ago I made device unit numbers equal to (unneeded) device minor numbers. We used to require bitshifting, because there were eight bits in the middle that were reserved for a device major number. Not very long after I turned dev2unit(), minor(), unit2minor() and minor2unit() into macro's. The unit2minor() and minor2unit() macro's were no-ops. We'd better not remove these four macro's from the kernel, because there is a lot of (external) code that may still depend on them. For now it's harmless to remove all invocations of unit2minor() and minor2unit(). Reviewed by: kib Notes: svn path=/head/; revision=183381
* Add sbuf_new_auto as a shortcut for the very common case of creating aDag-Erling Smørgrav2008-08-091-1/+1
| | | | | | | | | | completely dynamic sbuf. Obtained from: Varnish MFC after: 2 weeks Notes: svn path=/head/; revision=181463
* Remove the distinction between device minor and unit numbers.Ed Schouten2008-05-291-1/+2
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Even though we got rid of device major numbers some time ago, device drivers still need to provide unique device minor numbers to make_dev(). These numbers are only used inside the kernel. They are not related to device major and minor numbers which are visible in devfs. These are actually based on the inode number of the device. It would eventually be nice to remove minor numbers entirely, but we don't want to be too agressive here. Because the 8-15 bits of the device number field (si_drv0) are still reserved for the major number, there is no 1:1 mapping of the device minor and unit numbers. Because this is now unused, remove the restrictions on these numbers. The MAXMAJOR definition was actually used for two purposes. It was used to convert both the userspace and kernelspace device numbers to their major/minor pair, which is why it is now named UMINORMASK. minor2unit() and unit2minor() have now become useless. Both minor() and dev2unit() now serve the same purpose. We should eventually remove some of them, at least turning them into macro's. If devfs would become completely minor number unaware, we could consider using si_drv0 directly, just like si_drv1 and si_drv2. Approved by: philip (mentor) Notes: svn path=/head/; revision=179413
* Make it possible to specify an initial state for the LED.Poul-Henning Kamp2007-04-232-1/+8
| | | | | | | | Requested by: Henrik Brix Andersen <henrik@brixandersen.dk> PR: 112008 Notes: svn path=/head/; revision=168974
* Add placeholder mutex argument to new_unrhdr().Poul-Henning Kamp2005-03-071-1/+1
| | | | Notes: svn path=/head/; revision=143238
* Make a bunch of malloc types static.Poul-Henning Kamp2005-02-101-1/+1
| | | | | | | Found by: src/tools/tools/kernxref Notes: svn path=/head/; revision=141616
* Better locking.Poul-Henning Kamp2005-01-291-54/+83
| | | | | | | Add 'u' and 'U' "wait for next UTC second" in sequence mode. Notes: svn path=/head/; revision=140966
* Remove a pointless check.Poul-Henning Kamp2004-07-101-2/+0
| | | | Notes: svn path=/head/; revision=131896
* Second half of the dev_t cleanup.Poul-Henning Kamp2004-06-171-2/+2
| | | | | | | | | | | | | | The big lines are: NODEV -> NULL NOUDEV -> NODEV udev_t -> dev_t udev2dev() -> findcdev() Various minor adjustments including handling of userland access to kernel space struct cdev etc. Notes: svn path=/head/; revision=130640
* Do the dreaded s/dev_t/struct cdev */Poul-Henning Kamp2004-06-162-6/+6
| | | | | | | Bump __FreeBSD_version accordingly. Notes: svn path=/head/; revision=130585
* - Remove the __FBSDID and put the $FreeBSD$ tag in the comment above,Maxime Henrion2004-05-101-6/+5
| | | | | | | | so that including this file more than once works. - Fix some style bugs while I'm here. Notes: svn path=/head/; revision=129085
* Fix off by one error.Poul-Henning Kamp2004-05-031-0/+1
| | | | Notes: svn path=/head/; revision=128867
* Add the ability to avoid repetition of s.... sequences with a '.'Poul-Henning Kamp2004-04-271-7/+11
| | | | Notes: svn path=/head/; revision=128678
* Device megapatch 4/6:Poul-Henning Kamp2004-02-211-0/+2
| | | | | | | | | | | Introduce d_version field in struct cdevsw, this must always be initialized to D_VERSION. Flip sense of D_NOGIANT flag to D_NEEDGIANT, this involves removing four D_NOGIANT flags and adding 145 D_NEEDGIANT flags. Notes: svn path=/head/; revision=126080
* Use standard style for cdevsw initialization.Poul-Henning Kamp2004-02-141-2/+2
| | | | Notes: svn path=/head/; revision=125810
* DUH!Poul-Henning Kamp2003-12-121-10/+16
| | | | | | | | | | Write 100 times for tomorrow: I will never again free(9) a modified pointer. Pointy Hat: yeah, yeah, yeah, can you just put it in the pile over there... Notes: svn path=/head/; revision=123494
* Correct usage of mtx_init() API. This is not a functional change sinceDon Lewis2003-12-071-1/+1
| | | | | | | | | the code happened to work because MTX_DEF and NULL are both defined as 0. Reviewed by: phk Notes: svn path=/head/; revision=123272
* Improve semantics of the 'sequence' command to led(4) devices:Poul-Henning Kamp2003-11-271-12/+12
| | | | | | | | | use lowercase for off and upper case for on. Approved by: re@ Notes: svn path=/head/; revision=123014
* Avoid NULL pointer dereference.Poul-Henning Kamp2003-11-231-1/+2
| | | | | | | Approved by: re@ Notes: svn path=/head/; revision=122963
* Fix prototypoPoul-Henning Kamp2003-11-031-1/+1
| | | | Notes: svn path=/head/; revision=121957
* Get word spacing right in morse mode.Poul-Henning Kamp2003-11-032-1/+3
| | | | | | | Fix a prototype. Notes: svn path=/head/; revision=121956
* Add a generic LED driver for flashing lamps.Poul-Henning Kamp2003-11-032-0/+279
The hardware driver decides the name under /dev/led and provides the function to turn the lamp on/off. All leds are serviced by a single timeout which runs at a basic rate of hz/10. The LED is controlled by ascii strings as follows. 0 Turn off. 1 Turn on. f Flash: _- f2 Flash: __-- f3 Flash: ___--- f4...f9 etc. d%d Digits. "d12": -__________-_-______________________________ s%s String, roll your own: 'a-j' gives on for (1...10)/10 sec. 'A-J' gives on for (1...10)/10 sec. 'sAaAbBa': _-_--__- m%s Morse '.' dot '-' dash ' ' letter space '\n' word space My mdoc skills do not reach to express that. Notes: svn path=/head/; revision=121941