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

Commit 61abfd2d authored by Linus Torvalds's avatar Linus Torvalds
Browse files

Merge branch 'for-linus' of git://git.o-hand.com/linux-rpurdie-leds

* 'for-linus' of git://git.o-hand.com/linux-rpurdie-leds:
  leds: Futher document blink_set
  leds: Add options to have GPIO LEDs start on or keep their state
  leds: LED driver for National Semiconductor LP3944 Funlight Chip
  leds: pca9532 - Indent using tabs, not spaces.
  leds: Remove an orphan Kconfig entry
  leds: Further document parameters for blink_set()
  leds: alix-leds2 fixed for Award BIOS
  leds: leds-gpio - fix a section mismatch
  leds: add the sysfs interface into the leds-bd2802 driver for changing wave pattern and led current.
  leds: change the license information
  leds: fix led-bd2802 errors while resuming
parents 4075ea8c a1dd8c61
Loading
Loading
Loading
Loading
+50 −0
Original line number Original line Diff line number Diff line
Kernel driver lp3944
====================

  * National Semiconductor LP3944 Fun-light Chip
    Prefix: 'lp3944'
    Addresses scanned: None (see the Notes section below)
    Datasheet: Publicly available at the National Semiconductor website
               http://www.national.com/pf/LP/LP3944.html

Authors:
        Antonio Ospite <ospite@studenti.unina.it>


Description
-----------
The LP3944 is a helper chip that can drive up to 8 leds, with two programmable
DIM modes; it could even be used as a gpio expander but this driver assumes it
is used as a led controller.

The DIM modes are used to set _blink_ patterns for leds, the pattern is
specified supplying two parameters:
  - period: from 0s to 1.6s
  - duty cycle: percentage of the period the led is on, from 0 to 100

Setting a led in DIM0 or DIM1 mode makes it blink according to the pattern.
See the datasheet for details.

LP3944 can be found on Motorola A910 smartphone, where it drives the rgb
leds, the camera flash light and the lcds power.


Notes
-----
The chip is used mainly in embedded contexts, so this driver expects it is
registered using the i2c_board_info mechanism.

To register the chip at address 0x60 on adapter 0, set the platform data
according to include/linux/leds-lp3944.h, set the i2c board info:

	static struct i2c_board_info __initdata a910_i2c_board_info[] = {
		{
			I2C_BOARD_INFO("lp3944", 0x60),
			.platform_data = &a910_lp3944_leds,
		},
	};

and register it in the platform init function

	i2c_register_board_info(0, a910_i2c_board_info,
			ARRAY_SIZE(a910_i2c_board_info));
+16 −1
Original line number Original line Diff line number Diff line
@@ -16,10 +16,17 @@ LED sub-node properties:
  string defining the trigger assigned to the LED.  Current triggers are:
  string defining the trigger assigned to the LED.  Current triggers are:
    "backlight" - LED will act as a back-light, controlled by the framebuffer
    "backlight" - LED will act as a back-light, controlled by the framebuffer
		  system
		  system
    "default-on" - LED will turn on
    "default-on" - LED will turn on, but see "default-state" below
    "heartbeat" - LED "double" flashes at a load average based rate
    "heartbeat" - LED "double" flashes at a load average based rate
    "ide-disk" - LED indicates disk activity
    "ide-disk" - LED indicates disk activity
    "timer" - LED flashes at a fixed, configurable rate
    "timer" - LED flashes at a fixed, configurable rate
- default-state:  (optional) The initial state of the LED.  Valid
  values are "on", "off", and "keep".  If the LED is already on or off
  and the default-state property is set the to same value, then no
  glitch should be produced where the LED momentarily turns off (or
  on).  The "keep" setting will keep the LED at whatever its current
  state is, without producing a glitch.  The default is off if this
  property is not present.


Examples:
Examples:


@@ -30,14 +37,22 @@ leds {
		gpios = <&mcu_pio 0 1>; /* Active low */
		gpios = <&mcu_pio 0 1>; /* Active low */
		linux,default-trigger = "ide-disk";
		linux,default-trigger = "ide-disk";
	};
	};

	fault {
		gpios = <&mcu_pio 1 0>;
		/* Keep LED on if BIOS detected hardware fault */
		default-state = "keep";
	};
};
};


run-control {
run-control {
	compatible = "gpio-leds";
	compatible = "gpio-leds";
	red {
	red {
		gpios = <&mpc8572 6 0>;
		gpios = <&mpc8572 6 0>;
		default-state = "off";
	};
	};
	green {
	green {
		gpios = <&mpc8572 7 0>;
		gpios = <&mpc8572 7 0>;
		default-state = "on";
	};
	};
}
}
+8 −6
Original line number Original line Diff line number Diff line
@@ -75,6 +75,7 @@ config LEDS_ALIX2
	depends on LEDS_CLASS && X86 && EXPERIMENTAL
	depends on LEDS_CLASS && X86 && EXPERIMENTAL
	help
	help
	  This option enables support for the PCEngines ALIX.2 and ALIX.3 LEDs.
	  This option enables support for the PCEngines ALIX.2 and ALIX.3 LEDs.
	  You have to set leds-alix2.force=1 for boards with Award BIOS.


config LEDS_H1940
config LEDS_H1940
	tristate "LED Support for iPAQ H1940 device"
	tristate "LED Support for iPAQ H1940 device"
@@ -145,15 +146,16 @@ config LEDS_GPIO_OF
	  of_platform devices.  For instance, LEDs which are listed in a "dts"
	  of_platform devices.  For instance, LEDs which are listed in a "dts"
	  file.
	  file.


config LEDS_LP5521
config LEDS_LP3944
	tristate "LED Support for the LP5521 LEDs"
	tristate "LED Support for N.S. LP3944 (Fun Light) I2C chip"
	depends on LEDS_CLASS && I2C
	depends on LEDS_CLASS && I2C
	help
	help
	  If you say 'Y' here you get support for the National Semiconductor
    This option enables support for LEDs connected to the National
	  LP5521 LED driver used in n8x0 boards.
    Semiconductor LP3944 Lighting Management Unit (LMU) also known as
    Fun Light Chip.


	  This driver can be built as a module by choosing 'M'. The module
	  To compile this driver as a module, choose M here: the
	  will be called leds-lp5521.
	  module will be called leds-lp3944.


config LEDS_CLEVO_MAIL
config LEDS_CLEVO_MAIL
	tristate "Mail LED on Clevo notebook"
	tristate "Mail LED on Clevo notebook"
+1 −0
Original line number Original line Diff line number Diff line
@@ -20,6 +20,7 @@ obj-$(CONFIG_LEDS_COBALT_RAQ) += leds-cobalt-raq.o
obj-$(CONFIG_LEDS_SUNFIRE)		+= leds-sunfire.o
obj-$(CONFIG_LEDS_SUNFIRE)		+= leds-sunfire.o
obj-$(CONFIG_LEDS_PCA9532)		+= leds-pca9532.o
obj-$(CONFIG_LEDS_PCA9532)		+= leds-pca9532.o
obj-$(CONFIG_LEDS_GPIO)			+= leds-gpio.o
obj-$(CONFIG_LEDS_GPIO)			+= leds-gpio.o
obj-$(CONFIG_LEDS_LP3944)		+= leds-lp3944.o
obj-$(CONFIG_LEDS_CLEVO_MAIL)		+= leds-clevo-mail.o
obj-$(CONFIG_LEDS_CLEVO_MAIL)		+= leds-clevo-mail.o
obj-$(CONFIG_LEDS_HP6XX)		+= leds-hp6xx.o
obj-$(CONFIG_LEDS_HP6XX)		+= leds-hp6xx.o
obj-$(CONFIG_LEDS_FSG)			+= leds-fsg.o
obj-$(CONFIG_LEDS_FSG)			+= leds-fsg.o
+6 −1
Original line number Original line Diff line number Diff line
@@ -14,7 +14,7 @@


static int force = 0;
static int force = 0;
module_param(force, bool, 0444);
module_param(force, bool, 0444);
MODULE_PARM_DESC(force, "Assume system has ALIX.2 style LEDs");
MODULE_PARM_DESC(force, "Assume system has ALIX.2/ALIX.3 style LEDs");


struct alix_led {
struct alix_led {
	struct led_classdev cdev;
	struct led_classdev cdev;
@@ -155,6 +155,11 @@ static int __init alix_led_init(void)
		goto out;
		goto out;
	}
	}


	/* enable output on GPIO for LED 1,2,3 */
	outl(1 << 6, 0x6104);
	outl(1 << 9, 0x6184);
	outl(1 << 11, 0x6184);

	pdev = platform_device_register_simple(KBUILD_MODNAME, -1, NULL, 0);
	pdev = platform_device_register_simple(KBUILD_MODNAME, -1, NULL, 0);
	if (!IS_ERR(pdev)) {
	if (!IS_ERR(pdev)) {
		ret = platform_driver_probe(&alix_led_driver, alix_led_probe);
		ret = platform_driver_probe(&alix_led_driver, alix_led_probe);
Loading