Skip to content

Commit

Permalink
Merge tag 'leds_for_4.8' of git://git.kernel.org/pub/scm/linux/kernel…
Browse files Browse the repository at this point in the history
…/git/j.anaszewski/linux-leds

Pull LED updates from Jacek Anaszewski:
 "New LED class driver:
   - LED driver for TI LP3952 6-Channel Color LED

  LED core improvements:
   - Only descend into leds directory when CONFIG_NEW_LEDS is set
   - Add no-op gpio_led_register_device when LED subsystem is disabled
   - MAINTAINERS: Add file patterns for led device tree bindings

  LED Trigger core improvements:
   - return error if invalid trigger name is provided via sysfs

  LED class drivers improvements
   - is31fl32xx: define complete i2c_device_id table
   - is31fl32xx: fix typo in id and match table names
   - leds-gpio: Set of_node for created LED devices
   - pca9532: Add device tree support

  Conversion of IDE trigger to common disk trigger:
   - leds: convert IDE trigger to common disk trigger
   - leds: documentation: 'ide-disk' to 'disk-activity'
   - unicore32: use the new LED disk activity trigger
   - parisc: use the new LED disk activity trigger
   - mips: use the new LED disk activity trigger
   - arm: use the new LED disk activity trigger
   - powerpc: use the new LED disk activity trigger"

* tag 'leds_for_4.8' of git://git.kernel.org/pub/scm/linux/kernel/git/j.anaszewski/linux-leds:
  leds: is31fl32xx: define complete i2c_device_id table
  leds: is31fl32xx: fix typo in id and match table names
  leds: LED driver for TI LP3952 6-Channel Color LED
  leds: leds-gpio: Set of_node for created LED devices
  leds: triggers: return error if invalid trigger name is provided via sysfs
  leds: Only descend into leds directory when CONFIG_NEW_LEDS is set
  leds: Add no-op gpio_led_register_device when LED subsystem is disabled
  unicore32: use the new LED disk activity trigger
  parisc: use the new LED disk activity trigger
  mips: use the new LED disk activity trigger
  arm: use the new LED disk activity trigger
  powerpc: use the new LED disk activity trigger
  leds: documentation: 'ide-disk' to 'disk-activity'
  leds: convert IDE trigger to common disk trigger
  leds: pca9532: Add device tree support
  MAINTAINERS: Add file patterns for led device tree bindings
  • Loading branch information
torvalds committed Jul 27, 2016
2 parents 78d51ae + 5706c01 commit 607e11a
Show file tree
Hide file tree
Showing 51 changed files with 669 additions and 77 deletions.
4 changes: 3 additions & 1 deletion Documentation/devicetree/bindings/leds/common.txt
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,9 @@ Optional properties for child nodes:
"default-on" - LED will turn on (but for leds-gpio see "default-state"
property in Documentation/devicetree/bindings/gpio/led.txt)
"heartbeat" - LED "double" flashes at a load average based rate
"ide-disk" - LED indicates disk activity
"disk-activity" - LED indicates disk activity
"ide-disk" - LED indicates IDE disk activity (deprecated),
in new implementations use "disk-activity"
"timer" - LED flashes at a fixed, configurable rate

- led-max-microamp : Maximum LED supply current in microamperes. This property
Expand Down
4 changes: 2 additions & 2 deletions Documentation/devicetree/bindings/leds/leds-gpio.txt
Original file line number Diff line number Diff line change
Expand Up @@ -33,9 +33,9 @@ Examples:
leds {
compatible = "gpio-leds";
hdd {
label = "IDE Activity";
label = "Disk Activity";
gpios = <&mcu_pio 0 GPIO_ACTIVE_LOW>;
linux,default-trigger = "ide-disk";
linux,default-trigger = "disk-activity";
};

fault {
Expand Down
39 changes: 39 additions & 0 deletions Documentation/devicetree/bindings/leds/leds-pca9532.txt
Original file line number Diff line number Diff line change
@@ -0,0 +1,39 @@
*NXP - pca9532 PWM LED Driver

The PCA9532 family is SMBus I/O expander optimized for dimming LEDs.
The PWM support 256 steps.

Required properties:
- compatible:
"nxp,pca9530"
"nxp,pca9531"
"nxp,pca9532"
"nxp,pca9533"
- reg - I2C slave address

Each led is represented as a sub-node of the nxp,pca9530.

Optional sub-node properties:
- label: see Documentation/devicetree/bindings/leds/common.txt
- type: Output configuration, see dt-bindings/leds/leds-pca9532.h (default NONE)
- linux,default-trigger: see Documentation/devicetree/bindings/leds/common.txt

Example:
#include <dt-bindings/leds/leds-pca9532.h>

leds: pca9530@60 {
compatible = "nxp,pca9530";
reg = <0x60>;

red-power {
label = "pca:red:power";
type = <PCA9532_TYPE_LED>;
};
green-power {
label = "pca:green:power";
type = <PCA9532_TYPE_LED>;
};
};

For more product information please see the link below:
http://nxp.com/documents/data_sheet/PCA9532.pdf
2 changes: 1 addition & 1 deletion Documentation/laptops/asus-laptop.txt
Original file line number Diff line number Diff line change
Expand Up @@ -72,7 +72,7 @@ LEDs
echo 1 > /sys/class/leds/asus::mail/brightness
will switch the mail LED on.
You can also know if they are on/off by reading their content and use
kernel triggers like ide-disk or heartbeat.
kernel triggers like disk-activity or heartbeat.

Backlight
---------
Expand Down
2 changes: 1 addition & 1 deletion Documentation/leds/leds-class.txt
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@ brightness support so will just be turned on for non-zero brightness settings.
The class also introduces the optional concept of an LED trigger. A trigger
is a kernel based source of led events. Triggers can either be simple or
complex. A simple trigger isn't configurable and is designed to slot into
existing subsystems with minimal additional code. Examples are the ide-disk,
existing subsystems with minimal additional code. Examples are the disk-activity,
nand-disk and sharpsl-charge triggers. With led triggers disabled, the code
optimises away.

Expand Down
1 change: 1 addition & 0 deletions MAINTAINERS
Original file line number Diff line number Diff line change
Expand Up @@ -6783,6 +6783,7 @@ M: Jacek Anaszewski <[email protected]>
L: [email protected]
T: git git://git.kernel.org/pub/scm/linux/kernel/git/j.anaszewski/linux-leds.git
S: Maintained
F: Documentation/devicetree/bindings/leds/
F: drivers/leds/
F: include/linux/leds.h

Expand Down
2 changes: 1 addition & 1 deletion arch/arm/boot/dts/am57xx-beagle-x15.dts
Original file line number Diff line number Diff line change
Expand Up @@ -86,7 +86,7 @@
led@3 {
label = "beagle-x15:usr3";
gpios = <&gpio7 15 GPIO_ACTIVE_HIGH>;
linux,default-trigger = "ide-disk";
linux,default-trigger = "disk-activity";
default-state = "off";
};
};
Expand Down
2 changes: 1 addition & 1 deletion arch/arm/boot/dts/kirkwood-ns2lite.dts
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,7 @@
blue-sata {
label = "ns2:blue:sata";
gpios = <&gpio0 30 GPIO_ACTIVE_LOW>;
linux,default-trigger = "ide-disk";
linux,default-trigger = "disk-activity";
};
};
};
Expand Down
2 changes: 1 addition & 1 deletion arch/arm/boot/dts/kirkwood-topkick.dts
Original file line number Diff line number Diff line change
Expand Up @@ -129,7 +129,7 @@
disk {
label = "topkick:yellow:disk";
gpios = <&gpio0 21 GPIO_ACTIVE_LOW>;
linux,default-trigger = "ide-disk";
linux,default-trigger = "disk-activity";
};
system2 {
label = "topkick:red:system";
Expand Down
2 changes: 1 addition & 1 deletion arch/arm/configs/collie_defconfig
Original file line number Diff line number Diff line change
Expand Up @@ -76,7 +76,7 @@ CONFIG_LEDS_CLASS=y
CONFIG_LEDS_LOCOMO=y
CONFIG_LEDS_TRIGGERS=y
CONFIG_LEDS_TRIGGER_TIMER=y
CONFIG_LEDS_TRIGGER_IDE_DISK=y
CONFIG_LEDS_TRIGGER_DISK=y
# CONFIG_DNOTIFY is not set
CONFIG_VFAT_FS=y
CONFIG_TMPFS=y
Expand Down
2 changes: 1 addition & 1 deletion arch/arm/configs/ixp4xx_defconfig
Original file line number Diff line number Diff line change
Expand Up @@ -180,7 +180,7 @@ CONFIG_LEDS_FSG=y
CONFIG_LEDS_GPIO=y
CONFIG_LEDS_TRIGGERS=y
CONFIG_LEDS_TRIGGER_TIMER=y
CONFIG_LEDS_TRIGGER_IDE_DISK=y
CONFIG_LEDS_TRIGGER_DISK=y
CONFIG_LEDS_TRIGGER_HEARTBEAT=y
CONFIG_RTC_CLASS=y
CONFIG_RTC_DRV_ISL1208=y
Expand Down
2 changes: 1 addition & 1 deletion arch/arm/mach-davinci/board-dm644x-evm.c
Original file line number Diff line number Diff line change
Expand Up @@ -288,7 +288,7 @@ static struct gpio_led evm_leds[] = {
{ .name = "DS2", .active_low = 1,
.default_trigger = "mmc0", },
{ .name = "DS1", .active_low = 1,
.default_trigger = "ide-disk", },
.default_trigger = "disk-activity", },
};

static const struct gpio_led_platform_data evm_led_data = {
Expand Down
2 changes: 1 addition & 1 deletion arch/arm/mach-omap1/board-osk.c
Original file line number Diff line number Diff line change
Expand Up @@ -172,7 +172,7 @@ static struct gpio_led tps_leds[] = {
* Also, D9 requires non-battery power.
*/
{ .gpio = OSK_TPS_GPIO_LED_D9, .name = "d9",
.default_trigger = "ide-disk", },
.default_trigger = "disk-activity", },
{ .gpio = OSK_TPS_GPIO_LED_D2, .name = "d2", },
{ .gpio = OSK_TPS_GPIO_LED_D3, .name = "d3", .active_low = 1,
.default_trigger = "heartbeat", },
Expand Down
2 changes: 1 addition & 1 deletion arch/arm/mach-pxa/spitz.c
Original file line number Diff line number Diff line change
Expand Up @@ -464,7 +464,7 @@ static struct gpio_led spitz_gpio_leds[] = {
},
{
.name = "spitz:green:hddactivity",
.default_trigger = "ide-disk",
.default_trigger = "disk-activity",
.gpio = SPITZ_GPIO_LED_GREEN,
},
};
Expand Down
2 changes: 1 addition & 1 deletion arch/mips/configs/malta_qemu_32r6_defconfig
Original file line number Diff line number Diff line change
Expand Up @@ -146,7 +146,7 @@ CONFIG_NEW_LEDS=y
CONFIG_LEDS_CLASS=y
CONFIG_LEDS_TRIGGERS=y
CONFIG_LEDS_TRIGGER_TIMER=y
CONFIG_LEDS_TRIGGER_IDE_DISK=y
CONFIG_LEDS_TRIGGER_DISK=y
CONFIG_LEDS_TRIGGER_HEARTBEAT=y
CONFIG_LEDS_TRIGGER_BACKLIGHT=y
CONFIG_LEDS_TRIGGER_DEFAULT_ON=y
Expand Down
2 changes: 1 addition & 1 deletion arch/mips/configs/maltaaprp_defconfig
Original file line number Diff line number Diff line change
Expand Up @@ -147,7 +147,7 @@ CONFIG_NEW_LEDS=y
CONFIG_LEDS_CLASS=y
CONFIG_LEDS_TRIGGERS=y
CONFIG_LEDS_TRIGGER_TIMER=y
CONFIG_LEDS_TRIGGER_IDE_DISK=y
CONFIG_LEDS_TRIGGER_DISK=y
CONFIG_LEDS_TRIGGER_HEARTBEAT=y
CONFIG_LEDS_TRIGGER_BACKLIGHT=y
CONFIG_LEDS_TRIGGER_DEFAULT_ON=y
Expand Down
2 changes: 1 addition & 1 deletion arch/mips/configs/maltasmvp_eva_defconfig
Original file line number Diff line number Diff line change
Expand Up @@ -152,7 +152,7 @@ CONFIG_NEW_LEDS=y
CONFIG_LEDS_CLASS=y
CONFIG_LEDS_TRIGGERS=y
CONFIG_LEDS_TRIGGER_TIMER=y
CONFIG_LEDS_TRIGGER_IDE_DISK=y
CONFIG_LEDS_TRIGGER_DISK=y
CONFIG_LEDS_TRIGGER_HEARTBEAT=y
CONFIG_LEDS_TRIGGER_BACKLIGHT=y
CONFIG_LEDS_TRIGGER_DEFAULT_ON=y
Expand Down
2 changes: 1 addition & 1 deletion arch/mips/configs/maltaup_defconfig
Original file line number Diff line number Diff line change
Expand Up @@ -146,7 +146,7 @@ CONFIG_NEW_LEDS=y
CONFIG_LEDS_CLASS=y
CONFIG_LEDS_TRIGGERS=y
CONFIG_LEDS_TRIGGER_TIMER=y
CONFIG_LEDS_TRIGGER_IDE_DISK=y
CONFIG_LEDS_TRIGGER_DISK=y
CONFIG_LEDS_TRIGGER_HEARTBEAT=y
CONFIG_LEDS_TRIGGER_BACKLIGHT=y
CONFIG_LEDS_TRIGGER_DEFAULT_ON=y
Expand Down
2 changes: 1 addition & 1 deletion arch/mips/configs/rbtx49xx_defconfig
Original file line number Diff line number Diff line change
Expand Up @@ -90,7 +90,7 @@ CONFIG_NEW_LEDS=y
CONFIG_LEDS_CLASS=y
CONFIG_LEDS_GPIO=y
CONFIG_LEDS_TRIGGERS=y
CONFIG_LEDS_TRIGGER_IDE_DISK=y
CONFIG_LEDS_TRIGGER_DISK=y
CONFIG_LEDS_TRIGGER_HEARTBEAT=y
CONFIG_RTC_CLASS=y
CONFIG_RTC_INTF_DEV_UIE_EMUL=y
Expand Down
2 changes: 1 addition & 1 deletion arch/mips/txx9/generic/setup.c
Original file line number Diff line number Diff line change
Expand Up @@ -727,7 +727,7 @@ void __init txx9_iocled_init(unsigned long baseaddr,
int i;
static char *default_triggers[] __initdata = {
"heartbeat",
"ide-disk",
"disk-activity",
"nand-disk",
NULL,
};
Expand Down
2 changes: 1 addition & 1 deletion arch/mips/txx9/rbtx4939/setup.c
Original file line number Diff line number Diff line change
Expand Up @@ -215,7 +215,7 @@ static int __init rbtx4939_led_probe(struct platform_device *pdev)
int i;
static char *default_triggers[] __initdata = {
"heartbeat",
"ide-disk",
"disk-activity",
"nand-disk",
};

Expand Down
2 changes: 1 addition & 1 deletion arch/parisc/configs/generic-32bit_defconfig
Original file line number Diff line number Diff line change
Expand Up @@ -214,7 +214,7 @@ CONFIG_NEW_LEDS=y
CONFIG_LEDS_CLASS=y
CONFIG_LEDS_TRIGGERS=y
CONFIG_LEDS_TRIGGER_TIMER=y
CONFIG_LEDS_TRIGGER_IDE_DISK=y
CONFIG_LEDS_TRIGGER_DISK=y
CONFIG_LEDS_TRIGGER_HEARTBEAT=y
CONFIG_LEDS_TRIGGER_DEFAULT_ON=y
CONFIG_DMADEVICES=y
Expand Down
2 changes: 1 addition & 1 deletion arch/parisc/configs/generic-64bit_defconfig
Original file line number Diff line number Diff line change
Expand Up @@ -231,7 +231,7 @@ CONFIG_LEDS_CLASS=y
CONFIG_LEDS_TRIGGERS=y
CONFIG_LEDS_TRIGGER_TIMER=y
CONFIG_LEDS_TRIGGER_ONESHOT=y
CONFIG_LEDS_TRIGGER_IDE_DISK=y
CONFIG_LEDS_TRIGGER_DISK=y
CONFIG_LEDS_TRIGGER_HEARTBEAT=m
CONFIG_LEDS_TRIGGER_BACKLIGHT=m
CONFIG_LEDS_TRIGGER_DEFAULT_ON=m
Expand Down
2 changes: 1 addition & 1 deletion arch/powerpc/boot/dts/mpc8315erdb.dts
Original file line number Diff line number Diff line change
Expand Up @@ -472,7 +472,7 @@

hdd {
gpios = <&mcu_pio 1 0>;
linux,default-trigger = "ide-disk";
linux,default-trigger = "disk-activity";
};
};
};
2 changes: 1 addition & 1 deletion arch/powerpc/boot/dts/mpc8377_rdb.dts
Original file line number Diff line number Diff line change
Expand Up @@ -496,7 +496,7 @@

hdd {
gpios = <&mcu_pio 1 0>;
linux,default-trigger = "ide-disk";
linux,default-trigger = "disk-activity";
};
};
};
2 changes: 1 addition & 1 deletion arch/powerpc/boot/dts/mpc8378_rdb.dts
Original file line number Diff line number Diff line change
Expand Up @@ -480,7 +480,7 @@

hdd {
gpios = <&mcu_pio 1 0>;
linux,default-trigger = "ide-disk";
linux,default-trigger = "disk-activity";
};
};
};
2 changes: 1 addition & 1 deletion arch/powerpc/boot/dts/mpc8379_rdb.dts
Original file line number Diff line number Diff line change
Expand Up @@ -446,7 +446,7 @@

hdd {
gpios = <&mcu_pio 1 0>;
linux,default-trigger = "ide-disk";
linux,default-trigger = "disk-activity";
};
};
};
2 changes: 1 addition & 1 deletion arch/powerpc/configs/pmac32_defconfig
Original file line number Diff line number Diff line change
Expand Up @@ -158,7 +158,7 @@ CONFIG_ADB=y
CONFIG_ADB_CUDA=y
CONFIG_ADB_PMU=y
CONFIG_ADB_PMU_LED=y
CONFIG_ADB_PMU_LED_IDE=y
CONFIG_ADB_PMU_LED_DISK=y
CONFIG_PMAC_APM_EMU=m
CONFIG_PMAC_MEDIABAY=y
CONFIG_PMAC_BACKLIGHT=y
Expand Down
2 changes: 1 addition & 1 deletion arch/powerpc/configs/ppc6xx_defconfig
Original file line number Diff line number Diff line change
Expand Up @@ -442,7 +442,7 @@ CONFIG_ADB=y
CONFIG_ADB_CUDA=y
CONFIG_ADB_PMU=y
CONFIG_ADB_PMU_LED=y
CONFIG_ADB_PMU_LED_IDE=y
CONFIG_ADB_PMU_LED_DISK=y
CONFIG_PMAC_APM_EMU=y
CONFIG_PMAC_MEDIABAY=y
CONFIG_PMAC_BACKLIGHT=y
Expand Down
2 changes: 1 addition & 1 deletion arch/unicore32/configs/unicore32_defconfig
Original file line number Diff line number Diff line change
Expand Up @@ -161,7 +161,7 @@ CONFIG_LEDS_GPIO=y
# LED Triggers
CONFIG_LEDS_TRIGGERS=y
CONFIG_LEDS_TRIGGER_TIMER=y
CONFIG_LEDS_TRIGGER_IDE_DISK=y
CONFIG_LEDS_TRIGGER_DISK=y
CONFIG_LEDS_TRIGGER_HEARTBEAT=y

# Real Time Clock
Expand Down
2 changes: 1 addition & 1 deletion arch/unicore32/kernel/gpio.c
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,7 @@ static const struct gpio_led puv3_gpio_leds[] = {
{ .name = "cpuhealth", .gpio = GPO_CPU_HEALTH, .active_low = 0,
.default_trigger = "heartbeat", },
{ .name = "hdd_led", .gpio = GPO_HDD_LED, .active_low = 1,
.default_trigger = "ide-disk", },
.default_trigger = "disk-activity", },
};

static const struct gpio_led_platform_data puv3_gpio_led_data = {
Expand Down
2 changes: 1 addition & 1 deletion drivers/Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -122,7 +122,7 @@ obj-$(CONFIG_CPU_FREQ) += cpufreq/
obj-$(CONFIG_CPU_IDLE) += cpuidle/
obj-y += mmc/
obj-$(CONFIG_MEMSTICK) += memstick/
obj-y += leds/
obj-$(CONFIG_NEW_LEDS) += leds/
obj-$(CONFIG_INFINIBAND) += infiniband/
obj-$(CONFIG_SGI_SN) += sn/
obj-y += firmware/
Expand Down
4 changes: 4 additions & 0 deletions drivers/ata/libata-core.c
Original file line number Diff line number Diff line change
Expand Up @@ -69,6 +69,7 @@
#include <asm/unaligned.h>
#include <linux/cdrom.h>
#include <linux/ratelimit.h>
#include <linux/leds.h>
#include <linux/pm_runtime.h>
#include <linux/platform_device.h>

Expand Down Expand Up @@ -5078,6 +5079,9 @@ void ata_qc_complete(struct ata_queued_cmd *qc)
{
struct ata_port *ap = qc->ap;

/* Trigger the LED (if available) */
ledtrig_disk_activity();

/* XXX: New EH and old EH use different mechanisms to
* synchronize EH with regular execution path.
*
Expand Down
2 changes: 1 addition & 1 deletion drivers/ide/ide-disk.c
Original file line number Diff line number Diff line change
Expand Up @@ -186,7 +186,7 @@ static ide_startstop_t ide_do_rw_disk(ide_drive_t *drive, struct request *rq,
BUG_ON(drive->dev_flags & IDE_DFLAG_BLOCKED);
BUG_ON(rq->cmd_type != REQ_TYPE_FS);

ledtrig_ide_activity();
ledtrig_disk_activity();

pr_debug("%s: %sing: block=%llu, sectors=%u\n",
drive->name, rq_data_dir(rq) == READ ? "read" : "writ",
Expand Down
14 changes: 14 additions & 0 deletions drivers/leds/Kconfig
Original file line number Diff line number Diff line change
Expand Up @@ -228,6 +228,20 @@ config LEDS_LP3944
To compile this driver as a module, choose M here: the
module will be called leds-lp3944.

config LEDS_LP3952
tristate "LED Support for TI LP3952 2 channel LED driver"
depends on LEDS_CLASS
depends on I2C
depends on ACPI
depends on GPIOLIB
select REGMAP_I2C
help
This option enables support for LEDs connected to the Texas
Instruments LP3952 LED driver.

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

config LEDS_LP55XX_COMMON
tristate "Common Driver for TI/National LP5521/5523/55231/5562/8501"
depends on LEDS_LP5521 || LEDS_LP5523 || LEDS_LP5562 || LEDS_LP8501
Expand Down
1 change: 1 addition & 0 deletions drivers/leds/Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -26,6 +26,7 @@ obj-$(CONFIG_LEDS_PCA9532) += leds-pca9532.o
obj-$(CONFIG_LEDS_GPIO_REGISTER) += leds-gpio-register.o
obj-$(CONFIG_LEDS_GPIO) += leds-gpio.o
obj-$(CONFIG_LEDS_LP3944) += leds-lp3944.o
obj-$(CONFIG_LEDS_LP3952) += leds-lp3952.o
obj-$(CONFIG_LEDS_LP55XX_COMMON) += leds-lp55xx-common.o
obj-$(CONFIG_LEDS_LP5521) += leds-lp5521.o
obj-$(CONFIG_LEDS_LP5523) += leds-lp5523.o
Expand Down
2 changes: 2 additions & 0 deletions drivers/leds/led-triggers.c
Original file line number Diff line number Diff line change
Expand Up @@ -60,6 +60,8 @@ ssize_t led_trigger_store(struct device *dev, struct device_attribute *attr,
goto unlock;
}
}
/* we come here only if buf matches no trigger */
ret = -EINVAL;
up_read(&triggers_list_lock);

unlock:
Expand Down
Loading

0 comments on commit 607e11a

Please sign in to comment.