Commit 4162877d authored by Linus Torvalds's avatar Linus Torvalds
Browse files
Pull LED updates from Bryan Wu:
 "This cycle we got:
   - new driver for leds-mc13783
   - bug fixes
   - code cleanup"

* 'for-next' of git://git.kernel.org/pub/scm/linux/kernel/git/cooloney/linux-leds:
  leds: make sure we unregister a trigger only once
  leds: leds-pwm: properly clean up after probe failure
  leds: clevo-mail: Make probe function __init
  leds-ot200: Fix dependencies
  leds-gpio: of: introduce MODULE_DEVICE_TABLE for module autoloading
  leds: clevo-mail: remove __initdata marker
  leds: leds-ss4200: remove __initdata marker
  leds: blinkm: remove unnecessary spaces
  leds: lp5562: remove unnecessary parentheses
  leds: leds-ss4200: remove DEFINE_PCI_DEVICE_TABLE macro
  leds: leds-s3c24xx: Trivial cleanup in header file
  drivers/leds: delete non-required instances of include <linux/init.h>
  leds: leds-gpio: add retain-state-suspended property
  leds: leds-mc13783: Add devicetree support
  leds: leds-mc13783: Remove unnecessary cleaning of registers on exit
  leds: leds-mc13783: Use proper "max_brightness" value fo LEDs
  leds: leds-mc13783: Use LED core PM functions
  leds: leds-mc13783: Add MC34708 LED support
  leds: Turn off led if blinking is disabled
  ledtrig-cpu: Handle CPU hot(un)plugging
parents 6c61403a 14f5716b
Loading
Loading
Loading
Loading
+12 −0
Original line number Original line Diff line number Diff line
@@ -21,6 +21,8 @@ LED sub-node properties:
  on).  The "keep" setting will keep the LED at whatever its current
  on).  The "keep" setting will keep the LED at whatever its current
  state is, without producing a glitch.  The default is off if this
  state is, without producing a glitch.  The default is off if this
  property is not present.
  property is not present.
- retain-state-suspended: (optional) The suspend state can be retained.Such
  as charge-led gpio.


Examples:
Examples:


@@ -50,3 +52,13 @@ run-control {
		default-state = "on";
		default-state = "on";
	};
	};
};
};

leds {
	compatible = "gpio-leds";

	charger-led {
		gpios = <&gpio1 2 0>;
		linux,default-trigger = "max8903-charger-charging";
		retain-state-suspended;
	};
};
+47 −0
Original line number Original line Diff line number Diff line
@@ -10,9 +10,44 @@ Optional properties:
- fsl,mc13xxx-uses-touch : Indicate the touchscreen controller is being used
- fsl,mc13xxx-uses-touch : Indicate the touchscreen controller is being used


Sub-nodes:
Sub-nodes:
- leds : Contain the led nodes and initial register values in property
  "led-control". Number of register depends of used IC, for MC13783 is 6,
  for MC13892 is 4, for MC34708 is 1. See datasheet for bits definitions of
  these registers.
  - #address-cells: Must be 1.
  - #size-cells: Must be 0.
  Each led node should contain "reg", which used as LED ID (described below).
  Optional properties "label" and "linux,default-trigger" is described in
  Documentation/devicetree/bindings/leds/common.txt.
- regulators : Contain the regulator nodes. The regulators are bound using
- regulators : Contain the regulator nodes. The regulators are bound using
  their names as listed below with their registers and bits for enabling.
  their names as listed below with their registers and bits for enabling.


MC13783 LED IDs:
    0  : Main display
    1  : AUX display
    2  : Keypad
    3  : Red 1
    4  : Green 1
    5  : Blue 1
    6  : Red 2
    7  : Green 2
    8  : Blue 2
    9  : Red 3
    10 : Green 3
    11 : Blue 3

MC13892 LED IDs:
    0  : Main display
    1  : AUX display
    2  : Keypad
    3  : Red
    4  : Green
    5  : Blue

MC34708 LED IDs:
    0  : Charger Red
    1  : Charger Green

MC13783 regulators:
MC13783 regulators:
    sw1a      : regulator SW1A      (register 24, bit 0)
    sw1a      : regulator SW1A      (register 24, bit 0)
    sw1b      : regulator SW1B      (register 25, bit 0)
    sw1b      : regulator SW1B      (register 25, bit 0)
@@ -89,6 +124,18 @@ ecspi@70010000 { /* ECSPI1 */
		interrupt-parent = <&gpio0>;
		interrupt-parent = <&gpio0>;
		interrupts = <8>;
		interrupts = <8>;


		leds {
			#address-cells = <1>;
			#size-cells = <0>;
			led-control = <0x000 0x000 0x0e0 0x000>;

			sysled {
				reg = <3>;
				label = "system:red:live";
				linux,default-trigger = "heartbeat";
			};
		};

		regulators {
		regulators {
			sw1_reg: mc13892__sw1 {
			sw1_reg: mc13892__sw1 {
				regulator-min-microvolt = <600000>;
				regulator-min-microvolt = <600000>;
+2 −2
Original line number Original line Diff line number Diff line
@@ -416,7 +416,7 @@ config LEDS_MC13783
	depends on MFD_MC13XXX
	depends on MFD_MC13XXX
	help
	help
	  This option enable support for on-chip LED drivers found
	  This option enable support for on-chip LED drivers found
	  on Freescale Semiconductor MC13783/MC13892 PMIC.
	  on Freescale Semiconductor MC13783/MC13892/MC34708 PMIC.


config LEDS_NS2
config LEDS_NS2
	tristate "LED support for Network Space v2 GPIO LEDs"
	tristate "LED support for Network Space v2 GPIO LEDs"
@@ -474,7 +474,7 @@ config LEDS_LM355x


config LEDS_OT200
config LEDS_OT200
	tristate "LED support for the Bachmann OT200"
	tristate "LED support for the Bachmann OT200"
	depends on LEDS_CLASS && HAS_IOMEM
	depends on LEDS_CLASS && HAS_IOMEM && (X86_32 || COMPILE_TEST)
	help
	help
	  This option enables support for the LEDs on the Bachmann OT200.
	  This option enables support for the LEDs on the Bachmann OT200.
	  Say Y to enable LEDs on the Bachmann OT200.
	  Say Y to enable LEDs on the Bachmann OT200.
+4 −2
Original line number Original line Diff line number Diff line
@@ -39,9 +39,11 @@ static void led_set_software_blink(struct led_classdev *led_cdev,
	led_cdev->blink_delay_on = delay_on;
	led_cdev->blink_delay_on = delay_on;
	led_cdev->blink_delay_off = delay_off;
	led_cdev->blink_delay_off = delay_off;


	/* never on - don't blink */
	/* never on - just set to off */
	if (!delay_on)
	if (!delay_on) {
		__led_set_brightness(led_cdev, LED_OFF);
		return;
		return;
	}


	/* never off - just set to brightness */
	/* never off - just set to brightness */
	if (!delay_off) {
	if (!delay_off) {
+4 −2
Original line number Original line Diff line number Diff line
@@ -13,7 +13,6 @@


#include <linux/module.h>
#include <linux/module.h>
#include <linux/kernel.h>
#include <linux/kernel.h>
#include <linux/init.h>
#include <linux/list.h>
#include <linux/list.h>
#include <linux/spinlock.h>
#include <linux/spinlock.h>
#include <linux/device.h>
#include <linux/device.h>
@@ -220,9 +219,12 @@ void led_trigger_unregister(struct led_trigger *trig)
{
{
	struct led_classdev *led_cdev;
	struct led_classdev *led_cdev;


	if (list_empty_careful(&trig->next_trig))
		return;

	/* Remove from the list of led triggers */
	/* Remove from the list of led triggers */
	down_write(&triggers_list_lock);
	down_write(&triggers_list_lock);
	list_del(&trig->next_trig);
	list_del_init(&trig->next_trig);
	up_write(&triggers_list_lock);
	up_write(&triggers_list_lock);


	/* Remove anyone actively using this trigger */
	/* Remove anyone actively using this trigger */
Loading