Skip to content

Commit

Permalink
Merge branch 'for-linus' of git://git.o-hand.com/linux-rpurdie-leds
Browse files Browse the repository at this point in the history
* 'for-linus' of git://git.o-hand.com/linux-rpurdie-leds:
  leds: Add HP Jornada 6xx driver
  leds: Remove the now uneeded ixp4xx driver
  leds: Add power LED to the wrap driver
  leds: Fix led-gpio active_low default brightness
  leds: hw acceleration for Clevo mail LED driver
  leds: Add support for hardware accelerated LED flashing
  leds: Standardise LED naming scheme
  leds: Add clevo notebook LED driver
  • Loading branch information
Linus Torvalds committed Feb 7, 2008
2 parents 5b808a5 + d39a7a6 commit 3d50337
Show file tree
Hide file tree
Showing 23 changed files with 519 additions and 277 deletions.
29 changes: 23 additions & 6 deletions Documentation/leds-class.txt
Original file line number Diff line number Diff line change
Expand Up @@ -39,12 +39,33 @@ LED Device Naming

Is currently of the form:

"devicename:colour"
"devicename:colour:function"

There have been calls for LED properties such as colour to be exported as
individual led class attributes. As a solution which doesn't incur as much
overhead, I suggest these become part of the device name. The naming scheme
above leaves scope for further attributes should they be needed.
above leaves scope for further attributes should they be needed. If sections
of the name don't apply, just leave that section blank.


Hardware accelerated blink of LEDs
==================================

Some LEDs can be programmed to blink without any CPU interaction. To
support this feature, a LED driver can optionally implement the
blink_set() function (see <linux/leds.h>). If implemeted, triggers can
attempt to use it before falling back to software timers. The blink_set()
function should return 0 if the blink setting is supported, or -EINVAL
otherwise, which means that LED blinking will be handled by software.

The blink_set() function should choose a user friendly blinking
value if it is called with *delay_on==0 && *delay_off==0 parameters. In
this case the driver should give back the chosen value through delay_on
and delay_off parameters to the leds subsystem.

Any call to the brightness_set() callback function should cancel the
previously programmed hardware blinking function so setting the brightness
to 0 can also cancel the blinking of the LED.


Known Issues
Expand All @@ -55,10 +76,6 @@ would cause nightmare dependency issues. I see this as a minor issue
compared to the benefits the simple trigger functionality brings. The
rest of the LED subsystem can be modular.

Some leds can be programmed to flash in hardware. As this isn't a generic
LED device property, this should be exported as a device specific sysfs
attribute rather than part of the class if this functionality is required.


Future Development
==================
Expand Down
4 changes: 2 additions & 2 deletions arch/arm/mach-ixp4xx/dsmg600-setup.c
Original file line number Diff line number Diff line change
Expand Up @@ -71,11 +71,11 @@ static struct i2c_board_info __initdata dsmg600_i2c_board_info [] = {

static struct gpio_led dsmg600_led_pins[] = {
{
.name = "power",
.name = "dsmg600:green:power",
.gpio = DSMG600_LED_PWR_GPIO,
},
{
.name = "wlan",
.name = "dsmg600:green:wlan",
.gpio = DSMG600_LED_WLAN_GPIO,
.active_low = true,
},
Expand Down
6 changes: 3 additions & 3 deletions arch/arm/mach-ixp4xx/nas100d-setup.c
Original file line number Diff line number Diff line change
Expand Up @@ -60,17 +60,17 @@ static struct i2c_board_info __initdata nas100d_i2c_board_info [] = {

static struct gpio_led nas100d_led_pins[] = {
{
.name = "wlan", /* green led */
.name = "nas100d:green:wlan",
.gpio = NAS100D_LED_WLAN_GPIO,
.active_low = true,
},
{
.name = "power", /* blue power led (off=flashing) */
.name = "nas100d:blue:power", /* (off=flashing) */
.gpio = NAS100D_LED_PWR_GPIO,
.active_low = true,
},
{
.name = "disk", /* yellow led */
.name = "nas100d:yellow:disk",
.gpio = NAS100D_LED_DISK_GPIO,
.active_low = true,
},
Expand Down
8 changes: 4 additions & 4 deletions arch/arm/mach-ixp4xx/nslu2-setup.c
Original file line number Diff line number Diff line change
Expand Up @@ -63,20 +63,20 @@ static struct i2c_board_info __initdata nslu2_i2c_board_info [] = {

static struct gpio_led nslu2_led_pins[] = {
{
.name = "ready", /* green led */
.name = "nslu2:green:ready",
.gpio = NSLU2_LED_GRN_GPIO,
},
{
.name = "status", /* red led */
.name = "nslu2:red:status",
.gpio = NSLU2_LED_RED_GPIO,
},
{
.name = "disk-1",
.name = "nslu2:green:disk-1",
.gpio = NSLU2_LED_DISK1_GPIO,
.active_low = true,
},
{
.name = "disk-2",
.name = "nslu2:green:disk-2",
.gpio = NSLU2_LED_DISK2_GPIO,
.active_low = true,
},
Expand Down
2 changes: 1 addition & 1 deletion drivers/hwmon/applesmc.c
Original file line number Diff line number Diff line change
Expand Up @@ -905,7 +905,7 @@ static ssize_t applesmc_key_at_index_store(struct device *dev,
}

static struct led_classdev applesmc_backlight = {
.name = "smc:kbd_backlight",
.name = "smc::kbd_backlight",
.default_trigger = "nand-disk",
.brightness_set = applesmc_brightness_set,
};
Expand Down
4 changes: 2 additions & 2 deletions drivers/input/misc/wistron_btns.c
Original file line number Diff line number Diff line change
Expand Up @@ -998,12 +998,12 @@ static void wistron_wifi_led_set(struct led_classdev *led_cdev,
}

static struct led_classdev wistron_mail_led = {
.name = "mail:green",
.name = "wistron:green:mail",
.brightness_set = wistron_mail_led_set,
};

static struct led_classdev wistron_wifi_led = {
.name = "wifi:red",
.name = "wistron:red:wifi",
.brightness_set = wistron_wifi_led_set,
};

Expand Down
48 changes: 38 additions & 10 deletions drivers/leds/Kconfig
Original file line number Diff line number Diff line change
Expand Up @@ -39,15 +39,6 @@ config LEDS_SPITZ
This option enables support for the LEDs on Sharp Zaurus
SL-Cxx00 series (C1000, C3000, C3100).

config LEDS_IXP4XX
tristate "LED Support for GPIO connected LEDs on IXP4XX processors"
depends on LEDS_CLASS && ARCH_IXP4XX
help
This option enables support for the LEDs connected to GPIO
outputs of the Intel IXP4XX processors. To be useful the
particular board must have LEDs and they must be connected
to the GPIO lines. If unsure, say Y.

config LEDS_TOSA
tristate "LED Support for the Sharp SL-6000 series"
depends on LEDS_CLASS && PXA_SHARPSL
Expand Down Expand Up @@ -100,6 +91,13 @@ config LEDS_COBALT_RAQ
help
This option enables support for the Cobalt Raq series LEDs.

config LEDS_HP6XX
tristate "LED Support for the HP Jornada 6xx"
depends on LEDS_CLASS && SH_HP6XX
help
This option enables led support for the handheld
HP Jornada 620/660/680/690.

config LEDS_GPIO
tristate "LED Support for GPIO connected LEDs"
depends on LEDS_CLASS && GENERIC_GPIO
Expand All @@ -114,6 +112,32 @@ config LEDS_CM_X270
help
This option enables support for the CM-X270 LEDs.

config LEDS_CLEVO_MAIL
tristate "Mail LED on Clevo notebook (EXPERIMENTAL)"
depends on LEDS_CLASS && X86 && SERIO_I8042 && DMI && EXPERIMENTAL
help
This driver makes the mail LED accessible from userspace
programs through the leds subsystem. This LED have three
known mode: off, blink at 0.5Hz and blink at 1Hz.

The driver supports two kinds of interface: using ledtrig-timer
or through /sys/class/leds/clevo::mail/brightness. As this LED
cannot change it's brightness it blinks instead. The brightness
value 0 means off, 1..127 means blink at 0.5Hz and 128..255 means
blink at 1Hz.

This module can drive the mail LED for the following notebooks:

Clevo D410J
Clevo D410V
Clevo D400V/D470V (not tested, but might work)
Clevo M540N
Clevo M5x0N (not tested, but might work)
Positivo Mobile (Clevo M5x0V)

To compile this driver as a module, choose M here: the
module will be called leds-clevo-mail.

comment "LED Triggers"

config LEDS_TRIGGERS
Expand All @@ -128,7 +152,11 @@ config LEDS_TRIGGER_TIMER
depends on LEDS_TRIGGERS
help
This allows LEDs to be controlled by a programmable timer
via sysfs. If unsure, say Y.
via sysfs. Some LED hardware can be programmed to start
blinking the LED without any further software interaction.
For more details read Documentation/leds-class.txt.

If unsure, say Y.

config LEDS_TRIGGER_IDE_DISK
bool "LED IDE Disk Trigger"
Expand Down
3 changes: 2 additions & 1 deletion drivers/leds/Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,6 @@ obj-$(CONFIG_LEDS_TRIGGERS) += led-triggers.o
obj-$(CONFIG_LEDS_CORGI) += leds-corgi.o
obj-$(CONFIG_LEDS_LOCOMO) += leds-locomo.o
obj-$(CONFIG_LEDS_SPITZ) += leds-spitz.o
obj-$(CONFIG_LEDS_IXP4XX) += leds-ixp4xx-gpio.o
obj-$(CONFIG_LEDS_TOSA) += leds-tosa.o
obj-$(CONFIG_LEDS_S3C24XX) += leds-s3c24xx.o
obj-$(CONFIG_LEDS_AMS_DELTA) += leds-ams-delta.o
Expand All @@ -19,6 +18,8 @@ obj-$(CONFIG_LEDS_COBALT_QUBE) += leds-cobalt-qube.o
obj-$(CONFIG_LEDS_COBALT_RAQ) += leds-cobalt-raq.o
obj-$(CONFIG_LEDS_GPIO) += leds-gpio.o
obj-$(CONFIG_LEDS_CM_X270) += leds-cm-x270.o
obj-$(CONFIG_LEDS_CLEVO_MAIL) += leds-clevo-mail.o
obj-$(CONFIG_LEDS_HP6XX) += leds-hp6xx.o

# LED Triggers
obj-$(CONFIG_LEDS_TRIGGER_TIMER) += ledtrig-timer.o
Expand Down
12 changes: 6 additions & 6 deletions drivers/leds/leds-ams-delta.c
Original file line number Diff line number Diff line change
Expand Up @@ -37,42 +37,42 @@ static void ams_delta_led_set(struct led_classdev *led_cdev,
static struct ams_delta_led ams_delta_leds[] = {
{
.cdev = {
.name = "ams-delta:camera",
.name = "ams-delta::camera",
.brightness_set = ams_delta_led_set,
},
.bitmask = AMS_DELTA_LATCH1_LED_CAMERA,
},
{
.cdev = {
.name = "ams-delta:advert",
.name = "ams-delta::advert",
.brightness_set = ams_delta_led_set,
},
.bitmask = AMS_DELTA_LATCH1_LED_ADVERT,
},
{
.cdev = {
.name = "ams-delta:email",
.name = "ams-delta::email",
.brightness_set = ams_delta_led_set,
},
.bitmask = AMS_DELTA_LATCH1_LED_EMAIL,
},
{
.cdev = {
.name = "ams-delta:handsfree",
.name = "ams-delta::handsfree",
.brightness_set = ams_delta_led_set,
},
.bitmask = AMS_DELTA_LATCH1_LED_HANDSFREE,
},
{
.cdev = {
.name = "ams-delta:voicemail",
.name = "ams-delta::voicemail",
.brightness_set = ams_delta_led_set,
},
.bitmask = AMS_DELTA_LATCH1_LED_VOICEMAIL,
},
{
.cdev = {
.name = "ams-delta:voice",
.name = "ams-delta::voice",
.brightness_set = ams_delta_led_set,
},
.bitmask = AMS_DELTA_LATCH1_LED_VOICE,
Expand Down
Loading

0 comments on commit 3d50337

Please sign in to comment.