Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit e7c82412 authored by Linus Torvalds's avatar Linus Torvalds
Browse files
Pull LED subsystem updates from Bryan Wu:
 "In this cycle, we merged some fix and update for LED Flash class
  driver.  Then the core code of LED Flash class driver is in the kernel
  now.  Moreover, we also got some bug fixes, code cleanup and new
  drivers for LED controllers"

* 'for-next' of git://git.kernel.org/pub/scm/linux/kernel/git/cooloney/linux-leds:
  leds: Don't treat the LED name as a format string
  leds: Use log level warn instead of info when telling about a name clash
  leds/led-class: Handle LEDs with the same name
  leds: lp8860: Fix typo in MODULE_DESCRIPTION in leds-lp8860.c
  leds: lp8501: Fix typo in MODULE_DESCRIPTION in leds-lp8501.c
  DT: leds: Add uniqueness requirement for 'label' property.
  dt-binding: leds: Add common LED DT bindings macros
  leds: add Qualcomm PM8941 WLED driver
  leds: add DT binding for Qualcomm PM8941 WLED block
  leds: pca963x: Add missing initialiation of struct led_info.flags
  leds: flash: Fix the size of sysfs_groups array
  Documentation: leds: Add description of LED Flash class extension
  leds: flash: document sysfs interface
  leds: flash: Remove synchronized flash strobe feature
  leds: Introduce devres helper for led_classdev_register
  leds: lp8860: make use of devm_gpiod_get_optional
  leds: Let the binding document example for leds-gpio follow the gpio bindings
  leds: flash: remove stray include directive
  leds: leds-pwm: drop one pwm_get_period() call
parents d0a3997c ccdc4507
Loading
Loading
Loading
Loading
+80 −0
Original line number Diff line number Diff line
What:		/sys/class/leds/<led>/flash_brightness
Date:		March 2015
KernelVersion:	4.0
Contact:	Jacek Anaszewski <j.anaszewski@samsung.com>
Description:	read/write
		Set the brightness of this LED in the flash strobe mode, in
		microamperes. The file is created only for the flash LED devices
		that support setting flash brightness.

		The value is between 0 and
		/sys/class/leds/<led>/max_flash_brightness.

What:		/sys/class/leds/<led>/max_flash_brightness
Date:		March 2015
KernelVersion:	4.0
Contact:	Jacek Anaszewski <j.anaszewski@samsung.com>
Description:	read only
		Maximum brightness level for this LED in the flash strobe mode,
		in microamperes.

What:		/sys/class/leds/<led>/flash_timeout
Date:		March 2015
KernelVersion:	4.0
Contact:	Jacek Anaszewski <j.anaszewski@samsung.com>
Description:	read/write
		Hardware timeout for flash, in microseconds. The flash strobe
		is stopped after this period of time has passed from the start
		of the strobe. The file is created only for the flash LED
		devices that support setting flash timeout.

What:		/sys/class/leds/<led>/max_flash_timeout
Date:		March 2015
KernelVersion:	4.0
Contact:	Jacek Anaszewski <j.anaszewski@samsung.com>
Description:	read only
		Maximum flash timeout for this LED, in microseconds.

What:		/sys/class/leds/<led>/flash_strobe
Date:		March 2015
KernelVersion:	4.0
Contact:	Jacek Anaszewski <j.anaszewski@samsung.com>
Description:	read/write
		Flash strobe state. When written with 1 it triggers flash strobe
		and when written with 0 it turns the flash off.

		On read 1 means that flash is currently strobing and 0 means
		that flash is off.

What:		/sys/class/leds/<led>/flash_fault
Date:		March 2015
KernelVersion:	4.0
Contact:	Jacek Anaszewski <j.anaszewski@samsung.com>
Description:	read only
		Space separated list of flash faults that may have occurred.
		Flash faults are re-read after strobing the flash. Possible
		flash faults:

		* led-over-voltage - flash controller voltage to the flash LED
			has exceeded the limit specific to the flash controller
		* flash-timeout-exceeded - the flash strobe was still on when
			the timeout set by the user has expired; not all flash
			controllers may set this in all such conditions
		* controller-over-temperature - the flash controller has
			overheated
		* controller-short-circuit - the short circuit protection
			of the flash controller has been triggered
		* led-power-supply-over-current - current in the LED power
			supply has exceeded the limit specific to the flash
			controller
		* indicator-led-fault - the flash controller has detected
			a short or open circuit condition on the indicator LED
		* led-under-voltage - flash controller voltage to the flash
			LED has been below the minimum limit specific to
			the flash
		* controller-under-voltage - the input voltage of the flash
			controller is below the limit under which strobing the
			flash at full current will not be possible;
			the condition persists until this flag is no longer set
		* led-over-temperature - the temperature of the LED has exceeded
			its allowed upper limit
+4 −2
Original line number Diff line number Diff line
@@ -14,8 +14,10 @@ Optional properties for child nodes:
- led-sources : List of device current outputs the LED is connected to. The
		outputs are identified by the numbers that must be defined
		in the LED device binding documentation.
- label : The label for this LED.  If omitted, the label is
  taken from the node name (excluding the unit address).
- label : The label for this LED. If omitted, the label is taken from the node
	  name (excluding the unit address). It has to uniquely identify
	  a device, i.e. no other LED class device can be assigned the same
	  label.

- linux,default-trigger :  This parameter, if present, is a
    string defining the trigger assigned to the LED.  Current triggers are:
+7 −5
Original line number Diff line number Diff line
@@ -26,16 +26,18 @@ LED sub-node properties:

Examples:

#include <dt-bindings/gpio/gpio.h>

leds {
	compatible = "gpio-leds";
	hdd {
		label = "IDE Activity";
		gpios = <&mcu_pio 0 1>; /* Active low */
		gpios = <&mcu_pio 0 GPIO_ACTIVE_LOW>;
		linux,default-trigger = "ide-disk";
	};

	fault {
		gpios = <&mcu_pio 1 0>;
		gpios = <&mcu_pio 1 GPIO_ACTIVE_HIGH>;
		/* Keep LED on if BIOS detected hardware fault */
		default-state = "keep";
	};
@@ -44,11 +46,11 @@ leds {
run-control {
	compatible = "gpio-leds";
	red {
		gpios = <&mpc8572 6 0>;
		gpios = <&mpc8572 6 GPIO_ACTIVE_HIGH>;
		default-state = "off";
	};
	green {
		gpios = <&mpc8572 7 0>;
		gpios = <&mpc8572 7 GPIO_ACTIVE_HIGH>;
		default-state = "on";
	};
};
@@ -57,7 +59,7 @@ leds {
	compatible = "gpio-leds";

	charger-led {
		gpios = <&gpio1 2 0>;
		gpios = <&gpio1 2 GPIO_ACTIVE_HIGH>;
		linux,default-trigger = "max8903-charger-charging";
		retain-state-suspended;
	};
+43 −0
Original line number Diff line number Diff line
Binding for Qualcomm PM8941 WLED driver

Required properties:
- compatible: should be "qcom,pm8941-wled"
- reg: slave address

Optional properties:
- label: The label for this led
  See Documentation/devicetree/bindings/leds/common.txt
- linux,default-trigger: Default trigger assigned to the LED
  See Documentation/devicetree/bindings/leds/common.txt
- qcom,cs-out: bool; enable current sink output
- qcom,cabc: bool; enable content adaptive backlight control
- qcom,ext-gen: bool; use externally generated modulator signal to dim
- qcom,current-limit: mA; per-string current limit; value from 0 to 25
	default: 20mA
- qcom,current-boost-limit: mA; boost current limit; one of:
	105, 385, 525, 805, 980, 1260, 1400, 1680
	default: 805mA
- qcom,switching-freq: kHz; switching frequency; one of:
	600, 640, 685, 738, 800, 872, 960, 1066, 1200, 1371,
	1600, 1920, 2400, 3200, 4800, 9600,
	default: 1600kHz
- qcom,ovp: V; Over-voltage protection limit; one of:
	27, 29, 32, 35
	default: 29V
- qcom,num-strings: #; number of led strings attached; value from 1 to 3
	default: 2

Example:

pm8941-wled@d800 {
	compatible = "qcom,pm8941-wled";
	reg = <0xd800>;
	label = "backlight";

	qcom,cs-out;
	qcom,current-limit = <20>;
	qcom,current-boost-limit = <805>;
	qcom,switching-freq = <1600>;
	qcom,ovp = <29>;
	qcom,num-strings = <2>;
};
+4 −0
Original line number Diff line number Diff line
@@ -289,6 +289,10 @@ IRQ
  devm_request_irq()
  devm_request_threaded_irq()

LED
  devm_led_classdev_register()
  devm_led_classdev_unregister()

MDIO
  devm_mdiobus_alloc()
  devm_mdiobus_alloc_size()
Loading