xref: /linux/Documentation/ABI/testing/sysfs-class-led (revision 41c177cf354126a22443b5c80cec9fdd313e67e1)
15f634c65SCorentin CharyWhat:		/sys/class/leds/<led>/brightness
25f634c65SCorentin CharyDate:		March 2006
35f634c65SCorentin CharyKernelVersion:	2.6.17
45f634c65SCorentin CharyContact:	Richard Purdie <rpurdie@rpsys.net>
55f634c65SCorentin CharyDescription:
6*edef2fa2SMauro Carvalho Chehab		Set the brightness of the LED.
7*edef2fa2SMauro Carvalho Chehab
8*edef2fa2SMauro Carvalho Chehab		Most LEDs don't have hardware brightness support, so will
9*edef2fa2SMauro Carvalho Chehab		just be turned on for non-zero brightness settings.
10*edef2fa2SMauro Carvalho Chehab
11*edef2fa2SMauro Carvalho Chehab		.. Note::
12*edef2fa2SMauro Carvalho Chehab
13*edef2fa2SMauro Carvalho Chehab		  For multicolor LEDs, writing to this file will update all
14*edef2fa2SMauro Carvalho Chehab		  LEDs within the group to a calculated percentage of what
15*edef2fa2SMauro Carvalho Chehab		  each color LED intensity is set to.
16*edef2fa2SMauro Carvalho Chehab
17*edef2fa2SMauro Carvalho Chehab		  The percentage is calculated for each grouped LED via
18*edef2fa2SMauro Carvalho Chehab		  the equation below::
19*edef2fa2SMauro Carvalho Chehab
20*edef2fa2SMauro Carvalho Chehab		    led_brightness = brightness * multi_intensity/max_brightness
21*edef2fa2SMauro Carvalho Chehab
22*edef2fa2SMauro Carvalho Chehab		  For additional details please refer to
23*edef2fa2SMauro Carvalho Chehab		  Documentation/leds/leds-class-multicolor.rst.
24*edef2fa2SMauro Carvalho Chehab
25*edef2fa2SMauro Carvalho Chehab		The value is between 0 and
265f634c65SCorentin Chary		/sys/class/leds/<led>/max_brightness.
275f634c65SCorentin Chary
28ed25e9caSPavel Machek		Writing 0 to this file clears active trigger.
29ed25e9caSPavel Machek
30ed25e9caSPavel Machek		Writing non-zero to this file while trigger is active changes the
31ed25e9caSPavel Machek		top brightness trigger is going to use.
32ed25e9caSPavel Machek
33*edef2fa2SMauro Carvalho Chehab
34*edef2fa2SMauro Carvalho Chehab
355f634c65SCorentin CharyWhat:		/sys/class/leds/<led>/max_brightness
365f634c65SCorentin CharyDate:		March 2006
375f634c65SCorentin CharyKernelVersion:	2.6.17
385f634c65SCorentin CharyContact:	Richard Purdie <rpurdie@rpsys.net>
395f634c65SCorentin CharyDescription:
40ed25e9caSPavel Machek		Maximum brightness level for this LED, default is 255 (LED_FULL).
41ed25e9caSPavel Machek
42ed25e9caSPavel Machek		If the LED does not support different brightness levels, this
43ed25e9caSPavel Machek		should be 1.
445f634c65SCorentin Chary
450cb8eb30SHans de GoedeWhat:		/sys/class/leds/<led>/brightness_hw_changed
460cb8eb30SHans de GoedeDate:		January 2017
470cb8eb30SHans de GoedeKernelVersion:	4.11
480cb8eb30SHans de GoedeDescription:
490cb8eb30SHans de Goede		Last hardware set brightness level for this LED. Some LEDs
500cb8eb30SHans de Goede		may be changed autonomously by hardware/firmware. Only LEDs
510cb8eb30SHans de Goede		where this happens and the driver can detect this, will have
520cb8eb30SHans de Goede		this file.
530cb8eb30SHans de Goede
540cb8eb30SHans de Goede		This file supports poll() to detect when the hardware changes
550cb8eb30SHans de Goede		the brightness.
560cb8eb30SHans de Goede
570cb8eb30SHans de Goede		Reading this file will return the last brightness level set
580cb8eb30SHans de Goede		by the hardware, this may be different from the current
590cb8eb30SHans de Goede		brightness. Reading this file when no hw brightness change
600cb8eb30SHans de Goede		event has happened will return an ENODATA error.
610cb8eb30SHans de Goede
625f634c65SCorentin CharyWhat:		/sys/class/leds/<led>/trigger
635f634c65SCorentin CharyDate:		March 2006
645f634c65SCorentin CharyKernelVersion:	2.6.17
655f634c65SCorentin CharyContact:	Richard Purdie <rpurdie@rpsys.net>
665f634c65SCorentin CharyDescription:
675f634c65SCorentin Chary		Set the trigger for this LED. A trigger is a kernel based source
68ed25e9caSPavel Machek		of LED events.
6954a19b4dSMauro Carvalho Chehab
705f634c65SCorentin Chary		You can change triggers in a similar manner to the way an IO
715f634c65SCorentin Chary		scheduler is chosen. Trigger specific parameters can appear in
721f70cb40SRafał Miłecki		/sys/class/leds/<led> once a given trigger is selected. For
7334433332SMauro Carvalho Chehab		their documentation see `sysfs-class-led-trigger-*`.
745f634c65SCorentin Chary
759f9455aeSJanusz KrzysztofikWhat:		/sys/class/leds/<led>/inverted
769f9455aeSJanusz KrzysztofikDate:		January 2011
779f9455aeSJanusz KrzysztofikKernelVersion:	2.6.38
789f9455aeSJanusz KrzysztofikContact:	Richard Purdie <rpurdie@rpsys.net>
799f9455aeSJanusz KrzysztofikDescription:
809f9455aeSJanusz Krzysztofik		Invert the LED on/off state. This parameter is specific to
819f9455aeSJanusz Krzysztofik		gpio and backlight triggers. In case of the backlight trigger,
8225985edcSLucas De Marchi		it is useful when driving a LED which is intended to indicate
839f9455aeSJanusz Krzysztofik		a device in a standby like state.
84