leds: convert IDE trigger to common disk trigger
Subsystems (13)
PATCH v3 1/7 leds: convert IDE trigger to common disk trigger
This patch converts the IDE specific LED trigger to a generic disk activity LED trigger. The libata core is now a trigger source just like before the IDE disk driver. It's merely a replacement of the string ide by disk.
The patch is taken from http://dev.gentoo.org/~josejx/ata.patch and is widely used by any ibook/powerbook owners with great satisfaction. Likewise, it is very often used successfully on different ARM platforms.
The original patch was split into different parts to clarify platform independent and dependent changes.
---
Changes in v3:
- Port to kernel 4.x
- Split into platform independent and dependent parts.
v2: https://patchwork.ozlabs.org/patch/117485/
v1: http://dev.gentoo.org/~josejx/ata.patch
---
drivers/ata/libata-core.c | 4 ++++
drivers/ide/ide-disk.c | 2 +-
drivers/leds/leds-hp6xx.c | 2 +-
drivers/leds/trigger/Kconfig | 8 ++++----
drivers/leds/trigger/Makefile | 2 +-
.../trigger/{ledtrig-ide-disk.c => ledtrig-disk.c} | 20 ++++++++++----------
include/linux/leds.h | 6 +++---
7 files changed, 24 insertions(+), 20 deletions(-)
rename drivers/leds/trigger/{ledtrig-ide-disk.c => ledtrig-disk.c} (50%)drivers/ata/libata-core.c +4 -0
@@ -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>
@@ -5072,6 +5073,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. *
drivers/ide/ide-disk.c +1 -1
@@ -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",
drivers/leds/leds-hp6xx.c +1 -1
@@ -50,7 +50,7 @@ static struct led_classdev hp6xx_red_led = {static struct led_classdev hp6xx_green_led = { .name ="hp6xx:green" , - .default_trigger ="ide-disk" , + .default_trigger ="disk-activity" , .brightness_set = hp6xxled_green_set, .flags =LED_CORE_SUSPENDRESUME , };
drivers/leds/trigger/Kconfig +4 -4
@@ -33,12 +33,12 @@ config LEDS_TRIGGER_ONESHOT If unsure, say Y. -config LEDS_TRIGGER_IDE_DISK - bool "LED IDE Disk Trigger" - depends on IDE_GD_ATA +config LEDS_TRIGGER_DISK + bool "LED Disk Trigger" + depends on IDE_GD_ATA || ATA depends on LEDS_TRIGGERS help - This allows LEDs to be controlled by IDE disk activity. + This allows LEDs to be controlled by disk activity. If unsure, say Y. config LEDS_TRIGGER_MTD
drivers/leds/trigger/Makefile +1 -1
@@ -1,6 +1,6 @@ obj-$(CONFIG_LEDS_TRIGGER_TIMER) += ledtrig-timer.o obj-$(CONFIG_LEDS_TRIGGER_ONESHOT) += ledtrig-oneshot.o -obj-$(CONFIG_LEDS_TRIGGER_IDE_DISK) += ledtrig-ide-disk.o +obj-$(CONFIG_LEDS_TRIGGER_DISK) += ledtrig-disk.o obj-$(CONFIG_LEDS_TRIGGER_MTD) += ledtrig-mtd.o obj-$(CONFIG_LEDS_TRIGGER_HEARTBEAT) += ledtrig-heartbeat.o obj-$(CONFIG_LEDS_TRIGGER_BACKLIGHT) += ledtrig-backlight.o
drivers/leds/trigger/ledtrig-disk.c renamed from drivers/leds/trigger/ledtrig-ide-disk.c +10 -10
@@ -1,5 +1,5 @@/* -* LED IDE-Disk Activity Trigger +* LED Disk Activity Trigger * * Copyright 2006 Openedhand Ltd. *
@@ -17,20 +17,20 @@#define BLINK_DELAY 30 -DEFINE_LED_TRIGGER (ledtrig_ide); +DEFINE_LED_TRIGGER (ledtrig_disk); -void ledtrig_ide_activity (void ) +void ledtrig_disk_activity (void ) { -unsigned long ide_blink_delay =BLINK_DELAY ; +unsigned long disk_blink_delay =BLINK_DELAY ; -led_trigger_blink_oneshot (ledtrig_ide, - &ide_blink_delay, &ide_blink_delay,0 ); +led_trigger_blink_oneshot (ledtrig_disk, + &disk_blink_delay, &disk_blink_delay,0 ); } -EXPORT_SYMBOL (ledtrig_ide_activity); +EXPORT_SYMBOL (ledtrig_disk_activity); -static int __init ledtrig_ide_init (void ) +static int __init ledtrig_disk_init (void ) { -led_trigger_register_simple ("ide-disk" , &ledtrig_ide); +led_trigger_register_simple ("disk-activity" , &ledtrig_disk);return 0 ; } -device_initcall (ledtrig_ide_init); +device_initcall (ledtrig_disk_init);
include/linux/leds.h +3 -3
@@ -324,10 +324,10 @@ static inline void *led_get_trigger_data(struct led_classdev *led_cdev)#endif /* CONFIG_LEDS_TRIGGERS */ /* Trigger specific functions */ -#ifdef CONFIG_LEDS_TRIGGER_IDE_DISK -extern void ledtrig_ide_activity (void ); +#ifdef CONFIG_LEDS_TRIGGER_DISK +extern void ledtrig_disk_activity (void );#else -static inline void ledtrig_ide_activity (void ) {} +static inline void ledtrig_disk_activity (void ) {}#endif #ifdef CONFIG_LEDS_TRIGGER_MTD
Signature · 1 line
2.8.4
PATCH v3 2/7 leds: documentation: 'ide-disk' to 'disk-activity'
--- Documentation/devicetree/bindings/leds/common.txt | 2 +- Documentation/devicetree/bindings/leds/leds-gpio.txt | 2 +- Documentation/laptops/asus-laptop.txt | 2 +- Documentation/leds/leds-class.txt | 2 +- 4 files changed, 4 insertions(+), 4 deletions(-)
Documentation/devicetree/bindings/leds/common.txt +1 -1
@@ -26,7 +26,7 @@ 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 "timer" - LED flashes at a fixed, configurable rate - led-max-microamp : Maximum LED supply current in microamperes. This property
Documentation/devicetree/bindings/leds/leds-gpio.txt +1 -1
@@ -35,7 +35,7 @@ leds { hdd { label = "IDE Activity"; gpios = <&mcu_pio 0 GPIO_ACTIVE_LOW>; - linux,default-trigger = "ide-disk"; + linux,default-trigger = "disk-activity"; }; fault {
Documentation/laptops/asus-laptop.txt +1 -1
@@ -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 ---------
Documentation/leds/leds-class.txt +1 -1
@@ -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.
Signature · 1 line
2.8.4
Re: [PATCH v3 2/7] leds: documentation: 'ide-disk' to 'disk-activity'
Quoted 16 lines · Stephan Linz
Cc Joseph Jezak <[email protected]>Cc Nico Macrionitis <[email protected]>Cc Jörg Sommer <[email protected]>Signed-off-by Stephan Linz <[email protected]>--- Documentation/devicetree/bindings/leds/common.txt | 2 +- Documentation/devicetree/bindings/leds/leds-gpio.txt | 2 +- Documentation/laptops/asus-laptop.txt | 2 +- Documentation/leds/leds-class.txt | 2 +- 4 files changed, 4 insertions(+), 4 deletions(-)Documentation/devicetree/bindings/leds/common.txt +0
-0
Documentation/devicetree/bindings/leds/common.txt Optional properties for child nodes: · line 30
Quoted 6 lines
Documentation/devicetree/bindings/leds/common.txt +1
-1@@ -26,7 +26,7 @@ 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 "timer" - LED flashes at a fixed, configurable rate
We should not break the binding.
Code must continue to support "ide-disk", though we can mark it deprecated in the binding documentation, and update the in-kernel dts files to use "disk-activity".
Thanks,
Mark.
Re: [PATCH v3 2/7] leds: documentation: 'ide-disk' to 'disk-activity'
Quoted 26 lines · Mark Rutland
Quoted 16 lines · Stephan Linz
Cc Joseph Jezak <[email protected]>Cc Nico Macrionitis <[email protected]>Cc Jörg Sommer <[email protected]>Signed-off-by Stephan Linz <[email protected]>--- Documentation/devicetree/bindings/leds/common.txt | 2 +- Documentation/devicetree/bindings/leds/leds-gpio.txt | 2 +- Documentation/laptops/asus-laptop.txt | 2 +- Documentation/leds/leds-class.txt | 2 +- 4 files changed, 4 insertions(+), 4 deletions(-)Documentation/devicetree/bindings/leds/common.txt +0
-0Documentation/devicetree/bindings/leds/common.txt Optional properties for child nodes: · line 30
Quoted 6 lines
Documentation/devicetree/bindings/leds/common.txt +1
-1@@ -26,7 +26,7 @@ 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 "timer" - LED flashes at a fixed, configurable rateWe should not break the binding.
Quoted 3 lines
Code must continue to support "ide-disk", though we can mark it deprecated in the binding documentation, and update the in-kernel dts files to use "disk-activity".
The code in the version 4 of the patchset supports also "ide-disk".
Stephan, could you send a new version of this patch, with preserved "ide-disk" property, marked as deprecated?
Signature · 2 lines
Best regards, Jacek Anaszewski
Mark Rutland
Acked-byRe: [PATCH v3 2/7] leds: documentation: 'ide-disk' to 'disk-activity'
Quoted 27 lines · Jacek Anaszewski
Quoted 26 lines · Mark Rutland
Quoted 16 lines · Stephan Linz
Cc Joseph Jezak <[email protected]>Cc Nico Macrionitis <[email protected]>Cc Jörg Sommer <[email protected]>Signed-off-by Stephan Linz <[email protected]>--- Documentation/devicetree/bindings/leds/common.txt | 2 +- Documentation/devicetree/bindings/leds/leds-gpio.txt | 2 +- Documentation/laptops/asus-laptop.txt | 2 +- Documentation/leds/leds-class.txt | 2 +- 4 files changed, 4 insertions(+), 4 deletions(-)Documentation/devicetree/bindings/leds/common.txt +0
-0Documentation/devicetree/bindings/leds/common.txt Optional properties for child nodes: · line 30
Quoted 6 lines
Documentation/devicetree/bindings/leds/common.txt +1
-1@@ -26,7 +26,7 @@ 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 "timer" - LED flashes at a fixed, configurable rateWe should not break the binding.
Quoted 5 lines
Quoted 3 lines
Code must continue to support "ide-disk", though we can mark it deprecated in the binding documentation, and update the in-kernel dts files to use "disk-activity".
The code in the version 4 of the patchset supports also "ide-disk".
Ah, sorry, I missed v4.
Quoted 2 lines
Stephan, could you send a new version of this patch, with preserved "ide-disk" property, marked as deprecated?
With that, feel free to add:
Thanks,
Mark.
Re: [PATCH v3 2/7] leds: documentation: 'ide-disk' to 'disk-activity'
In reply to Jacek AnaszewskiHi Jacek,
Am 22.06.2016 um 09:55 schrieb Jacek Anaszewski:
Quoted 30 lines · Mark Rutland
Quoted 29 lines · Stephan Linz
Quoted 22 lines
Cc Joseph Jezak <[email protected]>Cc Nico Macrionitis <[email protected]>Cc Jörg Sommer <[email protected]>Signed-off-by Stephan Linz <[email protected]>--- Documentation/devicetree/bindings/leds/common.txt | 2 +- Documentation/devicetree/bindings/leds/leds-gpio.txt | 2 +- Documentation/laptops/asus-laptop.txt | 2 +- Documentation/leds/leds-class.txt | 2 +- 4 files changed, 4 insertions(+), 4 deletions(-)Documentation/devicetree/bindings/leds/common.txt +0
-0@@ -26,7 +26,7 @@ Optional properties for child nodes: "default-on" - LED will turn on (but for leds-gpio see"default-state"
property inDocumentation/devicetree/bindings/gpio/led.txt)
"heartbeat" - LED "double" flashes at a load average based rateDocumentation/devicetree/bindings/leds/common.txt Optional properties for child nodes: · line 30
Quoted 3 lines
Documentation/devicetree/bindings/leds/common.txt +1
-1- "ide-disk" - LED indicates disk activity + "disk-activity" - LED indicates disk activity "timer" - LED flashes at a fixed, configurable rateWe should not break the binding.
Quoted 8 lines
Quoted 3 lines
Code must continue to support "ide-disk", though we can mark it deprecated in the binding documentation, and update the in-kernel dts files to use "disk-activity".
The code in the version 4 of the patchset supports also "ide-disk".
Stephan, could you send a new version of this patch, with preserved "ide-disk" property, marked as deprecated?
Yes, I can. I'll submit a new v5 patch set. You can pick out then the right patch for the LED for-next branch, okay?
br,
Stephan
Quoted 1 line
Re: [PATCH v3 2/7] leds: documentation: 'ide-disk' to 'disk-activity'
Quoted 37 lines · Stephan Linz
Hi Jacek,
Am 22.06.2016 um 09:55 schrieb Jacek Anaszewski:
Quoted 34 lines · Mark Rutland
Quoted 32 lines · Stephan Linz
Quoted 22 lines
Cc Joseph Jezak <[email protected]>Cc Nico Macrionitis <[email protected]>Cc Jörg Sommer <[email protected]>Signed-off-by Stephan Linz <[email protected]>--- Documentation/devicetree/bindings/leds/common.txt | 2 +- Documentation/devicetree/bindings/leds/leds-gpio.txt | 2 +- Documentation/laptops/asus-laptop.txt | 2 +- Documentation/leds/leds-class.txt | 2 +- 4 files changed, 4 insertions(+), 4 deletions(-)Documentation/devicetree/bindings/leds/common.txt +0
-0@@ -26,7 +26,7 @@ Optional properties for child nodes: "default-on" - LED will turn on (but for leds-gpio see"default-state"
property inDocumentation/devicetree/bindings/gpio/led.txt)
"heartbeat" - LED "double" flashes at a load average based rateDocumentation/devicetree/bindings/leds/common.txt Optional properties for child nodes: · line 30
Quoted 3 lines
Documentation/devicetree/bindings/leds/common.txt +1
-1- "ide-disk" - LED indicates disk activity + "disk-activity" - LED indicates disk activity "timer" - LED flashes at a fixed, configurable rateWe should not break the binding.
Code must continue to support "ide-disk", though we can mark it deprecated in the binding documentation, and update the in-kernel dts files to use "disk-activity".
Quoted 7 lines
Quoted 4 lines
The code in the version 4 of the patchset supports also "ide-disk".
Stephan, could you send a new version of this patch, with preserved "ide-disk" property, marked as deprecated?
Yes, I can. I'll submit a new v5 patch set. You can pick out then the right patch for the LED for-next branch, okay?
You don't need to submit whole patch set, only the affected patch.
Signature · 2 lines
Best regards, Jacek Anaszewski
PATCH v5 1/1 leds: documentation: 'ide-disk' to 'disk-activity'
---
Changes in v5:
- Keep documentation for the old 'ide-disk' device tree binding, but mark as deprecated and refer to the new trigger 'disk-activity'.
Changes in v4:
- Keep the 'ide-disk' trigger and add a second one for 'disk-activity'.
Changes in v3:
- Port to kernel 4.x
- Split into platform independent and dependent parts.
v2: https://patchwork.ozlabs.org/patch/117485/
v1: http://dev.gentoo.org/~josejx/ata.patch
--- Documentation/devicetree/bindings/leds/common.txt | 5 ++++- Documentation/devicetree/bindings/leds/leds-gpio.txt | 4 ++-- Documentation/laptops/asus-laptop.txt | 2 +- Documentation/leds/leds-class.txt | 2 +- 4 files changed, 8 insertions(+), 5 deletions(-)
Documentation/devicetree/bindings/leds/common.txt +4 -1
@@ -25,8 +25,11 @@ Optional properties for child nodes: system "default-on" - LED will turn on (but for leds-gpio see "default-state" property in Documentation/devicetree/bindings/gpio/led.txt) + "disk-activity" - LED indicates disk activity, the old name "ide-disk" is + still valid for backward compatibility "heartbeat" - LED "double" flashes at a load average based rate - "ide-disk" - LED indicates disk activity + "ide-disk" - LED indicates IDE disk activity (deprecated), do not use for + new implementation, use the new "disk-activity" name instead "timer" - LED flashes at a fixed, configurable rate - led-max-microamp : Maximum LED supply current in microamperes. This property
Documentation/devicetree/bindings/leds/leds-gpio.txt +2 -2
@@ -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 {
Documentation/laptops/asus-laptop.txt +1 -1
@@ -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 ---------
Documentation/leds/leds-class.txt +1 -1
@@ -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.
Signature · 1 line
2.9.0
Re: [PATCH v5] leds: documentation: 'ide-disk' to 'disk-activity'
Hi Stephan,
Quoted 34 lines · Stephan Linz
Cc Joseph Jezak <[email protected]>Cc Jörg Sommer <[email protected]>Cc Mark Rutland <[email protected]>Signed-off-by Stephan Linz <[email protected]>Acked-by Rob Herring <[email protected]>Signed-off-by Jacek Anaszewski <[email protected]>---
Changes in v5:
- Keep documentation for the old 'ide-disk' device tree binding, but mark as deprecated and refer to the new trigger 'disk-activity'.Changes in v4:
- Keep the 'ide-disk' trigger and add a second one for 'disk-activity'.Changes in v3:
- Port to kernel 4.x
- Split into platform independent and dependent parts.v2: https://patchwork.ozlabs.org/patch/117485/
v1: http://dev.gentoo.org/~josejx/ata.patch--- Documentation/devicetree/bindings/leds/common.txt | 5 ++++- Documentation/devicetree/bindings/leds/leds-gpio.txt | 4 ++-- Documentation/laptops/asus-laptop.txt | 2 +- Documentation/leds/leds-class.txt | 2 +- 4 files changed, 8 insertions(+), 5 deletions(-)Documentation/devicetree/bindings/leds/common.txt +0
-0
Documentation/devicetree/bindings/leds/common.txt Optional properties for child nodes: · line 32
Quoted 9 lines
Documentation/devicetree/bindings/leds/common.txt +4
-1@@ -25,8 +25,11 @@ Optional properties for child nodes: system "default-on" - LED will turn on (but for leds-gpio see "default-state" property in Documentation/devicetree/bindings/gpio/led.txt) + "disk-activity" - LED indicates disk activity, the old name "ide-disk" is + still valid for backward compatibility "heartbeat" - LED "double" flashes at a load average based rate - "ide-disk" - LED indicates disk activity + "ide-disk" - LED indicates IDE disk activity (deprecated), do not use for + new implementation, use the new "disk-activity" name instead
I'd like to reorganize this change.
I think that the two affected properties should be placed next to each other. I'd also remove the remark about ide-disk at disk-activity, since we're leaving ide-disk, with added reference to disk-activity.
How about following:
+ "disk-activity" - LED indicates disk activity - "ide-disk" - LED indicates disk activity + "ide-disk" - LED indicates IDE disk activity (deprecated),
in new implementations use "disk-activity"
Quoted 46 lines
Documentation/devicetree/bindings/leds/common.txt +0
-0"timer" - LED flashes at a fixed, configurable rate - led-max-microamp : Maximum LED supply current in microamperes. This propertyDocumentation/devicetree/bindings/leds/leds-gpio.txt +2
-2@@ -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 {Documentation/laptops/asus-laptop.txt +1
-1@@ -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 ---------Documentation/leds/leds-class.txt +1
-1@@ -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.
Signature · 2 lines
Best regards, Jacek Anaszewski
Re: [PATCH v5] leds: documentation: 'ide-disk' to 'disk-activity'
Hi Jacek,
thanks for your help. The new patch is on the way (v6).
br,
Stephan
Am 24.06.2016 um 08:50 schrieb Jacek Anaszewski:
Quoted 124 lines
Hi Stephan,
Quoted 45 lines · Stephan Linz
Cc Joseph Jezak <[email protected]>Cc Jörg Sommer <[email protected]>Cc Mark Rutland <[email protected]>Signed-off-by Stephan Linz <[email protected]>Acked-by Rob Herring <[email protected]>Signed-off-by Jacek Anaszewski <[email protected]>---
Changes in v5:
- Keep documentation for the old 'ide-disk' device tree binding, but mark as deprecated and refer to the new trigger 'disk-activity'.Changes in v4:
- Keep the 'ide-disk' trigger and add a second one for 'disk-activity'.Changes in v3:
- Port to kernel 4.x
- Split into platform independent and dependent parts.v2: https://patchwork.ozlabs.org/patch/117485/
v1: http://dev.gentoo.org/~josejx/ata.patch--- Documentation/devicetree/bindings/leds/common.txt | 5 ++++- Documentation/devicetree/bindings/leds/leds-gpio.txt | 4 ++-- Documentation/laptops/asus-laptop.txt | 2 +- Documentation/leds/leds-class.txt | 2 +- 4 files changed, 8 insertions(+), 5 deletions(-)Documentation/devicetree/bindings/leds/common.txt +0
-0@@ -25,8 +25,11 @@ Optional properties for child nodes: system "default-on" - LED will turn on (but for leds-gpio see"default-state"
property inDocumentation/devicetree/bindings/gpio/led.txt)
+ "disk-activity" - LED indicates disk activity, the old name
"ide-disk" isDocumentation/devicetree/bindings/leds/common.txt +2
-1+ still valid for backward compatibility "heartbeat" - LED "double" flashes at a load average based rate - "ide-disk" - LED indicates disk activity + "ide-disk" - LED indicates IDE disk activity (deprecated), doQuoted 3 lines
not use for
+ new implementation, use the new "disk-activity"
name insteadI'd like to reorganize this change.
I think that the two affected properties should be placed next to each other. I'd also remove the remark about ide-disk at disk-activity, since we're leaving ide-disk, with added reference to disk-activity.
How about following:
(quoted diff) +2
-1+ "disk-activity" - LED indicates disk activity - "ide-disk" - LED indicates disk activity + "ide-disk" - LED indicates IDE disk activity (deprecated), in new implementations use "disk-activity"Quoted 58 lines
"timer" - LED flashes at a fixed, configurable rate
- led-max-microamp : Maximum LED supply current in microamperes.
This propertyDocumentation/devicetree/bindings/leds/leds-gpio.txt +2
-2@@ -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 {Documentation/laptops/asus-laptop.txt +1
-1@@ -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 ---------Documentation/leds/leds-class.txt +0
-0@@ -11,7 +11,7 @@ brightness support so will just be turned on fornon-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.
PATCH v3 3/7 powerpc: use the new LED disk activity trigger
In reply to Stephan Linz- dts: rename 'ide-disk' to 'disk-activity'
- defconfig: rename 'ADB_PMU_LED_IDE' to 'ADB_PMU_LED_DISK'
--- arch/powerpc/boot/dts/mpc8315erdb.dts | 2 +- arch/powerpc/boot/dts/mpc8377_rdb.dts | 2 +- arch/powerpc/boot/dts/mpc8378_rdb.dts | 2 +- arch/powerpc/boot/dts/mpc8379_rdb.dts | 2 +- arch/powerpc/configs/pmac32_defconfig | 2 +- arch/powerpc/configs/ppc6xx_defconfig | 2 +- drivers/macintosh/Kconfig | 13 ++++++------- drivers/macintosh/via-pmu-led.c | 4 ++-- 8 files changed, 14 insertions(+), 15 deletions(-)
arch/powerpc/boot/dts/mpc8315erdb.dts +1 -1
@@ -472,7 +472,7 @@ hdd { gpios = <&mcu_pio 1 0>; - linux,default-trigger = "ide-disk"; + linux,default-trigger = "disk-activity"; }; }; };
arch/powerpc/boot/dts/mpc8377_rdb.dts +1 -1
@@ -496,7 +496,7 @@ hdd { gpios = <&mcu_pio 1 0>; - linux,default-trigger = "ide-disk"; + linux,default-trigger = "disk-activity"; }; }; };
arch/powerpc/boot/dts/mpc8378_rdb.dts +1 -1
@@ -480,7 +480,7 @@ hdd { gpios = <&mcu_pio 1 0>; - linux,default-trigger = "ide-disk"; + linux,default-trigger = "disk-activity"; }; }; };
arch/powerpc/boot/dts/mpc8379_rdb.dts +1 -1
@@ -446,7 +446,7 @@ hdd { gpios = <&mcu_pio 1 0>; - linux,default-trigger = "ide-disk"; + linux,default-trigger = "disk-activity"; }; }; };
arch/powerpc/configs/pmac32_defconfig +1 -1
@@ -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
arch/powerpc/configs/ppc6xx_defconfig +1 -1
@@ -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
drivers/macintosh/Kconfig +6 -7
@@ -96,19 +96,18 @@ config ADB_PMU_LED Support the front LED on Power/iBooks as a generic LED that can be triggered by any of the supported triggers. To get the behaviour of the old CONFIG_BLK_DEV_IDE_PMAC_BLINK, select this - and the ide-disk LED trigger and configure appropriately through - sysfs. + and the disk LED trigger and configure appropriately through sysfs. -config ADB_PMU_LED_IDE - bool "Use front LED as IDE LED by default" +config ADB_PMU_LED_DISK + bool "Use front LED as DISK LED by default" depends on ADB_PMU_LED depends on LEDS_CLASS depends on IDE_GD_ATA select LEDS_TRIGGERS - select LEDS_TRIGGER_IDE_DISK + select LEDS_TRIGGER_DISK help - This option makes the front LED default to the IDE trigger - so that it blinks on IDE activity. + This option makes the front LED default to the disk trigger + so that it blinks on disk activity. config PMAC_SMU bool "Support for SMU based PowerMacs"
drivers/macintosh/via-pmu-led.c +2 -2
@@ -73,8 +73,8 @@ static void pmu_led_set(struct led_classdev *led_cdev,static struct led_classdev pmu_led = { .name ="pmu-led::front" , -#ifdef CONFIG_ADB_PMU_LED_IDE - .default_trigger ="ide-disk" , +#ifdef CONFIG_ADB_PMU_LED_DISK + .default_trigger ="disk-activity" , #endif .brightness_set = pmu_led_set, };
Signature · 1 line
2.8.4
PATCH v3 4/7 arm: use the new LED disk activity trigger
In reply to Stephan Linz- dts: rename 'ide-disk' to 'disk-activity'
- platform: rename 'ide-disk' to 'disk-activity'
- defconfig: rename 'LEDS_TRIGGER_IDE_DISK' to 'LEDS_TRIGGER_DISK'
--- arch/arm/boot/dts/am57xx-beagle-x15.dts | 2 +- arch/arm/boot/dts/kirkwood-ns2lite.dts | 2 +- arch/arm/boot/dts/kirkwood-topkick.dts | 2 +- arch/arm/configs/collie_defconfig | 2 +- arch/arm/configs/ixp4xx_defconfig | 2 +- arch/arm/mach-davinci/board-dm644x-evm.c | 2 +- arch/arm/mach-omap1/board-osk.c | 2 +- arch/arm/mach-pxa/spitz.c | 2 +- 8 files changed, 8 insertions(+), 8 deletions(-)
arch/arm/boot/dts/am57xx-beagle-x15.dts +1 -1
@@ -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"; }; };
arch/arm/boot/dts/kirkwood-ns2lite.dts +1 -1
@@ -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"; }; }; };
arch/arm/boot/dts/kirkwood-topkick.dts +1 -1
@@ -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";
arch/arm/configs/collie_defconfig +1 -1
@@ -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
arch/arm/configs/ixp4xx_defconfig +1 -1
@@ -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
arch/arm/mach-davinci/board-dm644x-evm.c +1 -1
@@ -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 = {
arch/arm/mach-omap1/board-osk.c +1 -1
@@ -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", },
arch/arm/mach-pxa/spitz.c +1 -1
@@ -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, }, };
Signature · 1 line
2.8.4
Re: [PATCH v3 4/7] arm: use the new LED disk activity trigger
Hi Stephan,
Quoted 6 lines · Stephan Linz
- dts: rename 'ide-disk' to 'disk-activity'
- platform: rename 'ide-disk' to 'disk-activity'
- defconfig: rename 'LEDS_TRIGGER_IDE_DISK' to 'LEDS_TRIGGER_DISK'Signed-off-by Stephan Linz <[email protected]>---
I don't comment about the change itslef but if the change is OK for the dt and led maintainer then you will have to split this patch in 3 chunks (on for each subystem):
Quoted 1 line
arch/arm/boot/dts/am57xx-beagle-x15.dts | 2 +-
for omap
Quoted 2 lines
arch/arm/boot/dts/kirkwood-ns2lite.dts | 2 +- arch/arm/boot/dts/kirkwood-topkick.dts | 2 +-
for mvebu
Quoted 2 lines
arch/arm/configs/collie_defconfig | 2 +- arch/arm/configs/ixp4xx_defconfig | 2 +-
for pxa
Quoted 2 lines
arch/arm/mach-davinci/board-dm644x-evm.c | 2 +- arch/arm/mach-omap1/board-osk.c | 2 +-
for omap
Quoted 1 line
arch/arm/mach-pxa/spitz.c | 2 +-
for pxa
Thanks,
Gregory
Quoted 109 lines
8 files changed, 8 insertions(+), 8 deletions(-)arch/arm/boot/dts/am57xx-beagle-x15.dts +1
-1@@ -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"; }; };arch/arm/boot/dts/kirkwood-ns2lite.dts +1
-1@@ -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"; }; }; };arch/arm/boot/dts/kirkwood-topkick.dts +1
-1@@ -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";arch/arm/configs/collie_defconfig +1
-1@@ -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=yarch/arm/configs/ixp4xx_defconfig +1
-1@@ -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=yarch/arm/mach-davinci/board-dm644x-evm.c +1
-1@@ -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 = {arch/arm/mach-omap1/board-osk.c +1
-1@@ -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", },arch/arm/mach-pxa/spitz.c +1
-1@@ -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, }, };Signature · 1 line
2.8.4
Signature · 4 lines
Gregory Clement, Free Electrons Kernel, drivers, real-time and embedded Linux development, consulting, training and support. http://free-electrons.com
PATCH v3 5/7 mips: use the new LED disk activity trigger
In reply to Stephan Linz- platform: rename 'ide-disk' to 'disk-activity'
- defconfig: rename 'LEDS_TRIGGER_IDE_DISK' to 'LEDS_TRIGGER_DISK'
--- arch/mips/configs/malta_qemu_32r6_defconfig | 2 +- arch/mips/configs/maltaaprp_defconfig | 2 +- arch/mips/configs/maltasmvp_eva_defconfig | 2 +- arch/mips/configs/maltaup_defconfig | 2 +- arch/mips/configs/rbtx49xx_defconfig | 2 +- arch/mips/txx9/generic/setup.c | 2 +- arch/mips/txx9/rbtx4939/setup.c | 2 +- 7 files changed, 7 insertions(+), 7 deletions(-)
arch/mips/configs/malta_qemu_32r6_defconfig +1 -1
@@ -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
arch/mips/configs/maltaaprp_defconfig +1 -1
@@ -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
arch/mips/configs/maltasmvp_eva_defconfig +1 -1
@@ -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
arch/mips/configs/maltaup_defconfig +1 -1
@@ -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
arch/mips/configs/rbtx49xx_defconfig +1 -1
@@ -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
arch/mips/txx9/generic/setup.c +1 -1
@@ -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 , };
arch/mips/txx9/rbtx4939/setup.c +1 -1
@@ -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" , };
Signature · 1 line
2.8.4
PATCH v3 6/7 parisc: use the new LED disk activity trigger
In reply to Stephan Linz- platform: rename 'ide-disk' to 'disk-activity'
--- arch/parisc/configs/generic-32bit_defconfig | 2 +- arch/parisc/configs/generic-64bit_defconfig | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-)
arch/parisc/configs/generic-32bit_defconfig +1 -1
@@ -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
arch/parisc/configs/generic-64bit_defconfig +1 -1
@@ -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
Signature · 1 line
2.8.4
PATCH v3 7/7 unicore32: use the new LED disk activity trigger
In reply to Stephan Linz- platform: rename 'ide-disk' to 'disk-activity'
- defconfig: rename 'LEDS_TRIGGER_IDE_DISK' to 'LEDS_TRIGGER_DISK'
--- arch/unicore32/configs/unicore32_defconfig | 2 +- arch/unicore32/kernel/gpio.c | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-)
arch/unicore32/configs/unicore32_defconfig +1 -1
@@ -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
arch/unicore32/kernel/gpio.c +1 -1
@@ -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 = {
Signature · 1 line
2.8.4
Hi Stephan,
Thanks for the patch.
Generally it looks ok, with one exception: we have to keep ide-disk trigger, so as not to break existing users. Please just register two triggers in ledtrig_disk_init, similarly as it was done for mtd trigger:
drivers/leds/trigger/ledtrig-mtd.c
Thanks,
Jacek Anaszewski
Quoted 180 lines · Stephan Linz
This patch converts the IDE specific LED trigger to a generic disk activity LED trigger. The libata core is now a trigger source just like before the IDE disk driver. It's merely a replacement of the string ide by disk.
The patch is taken from http://dev.gentoo.org/~josejx/ata.patch and is widely used by any ibook/powerbook owners with great satisfaction. Likewise, it is very often used successfully on different ARM platforms.
The original patch was split into different parts to clarify platform independent and dependent changes.
Cc Joseph Jezak <[email protected]>Cc Nico Macrionitis <[email protected]>Cc Jörg Sommer <[email protected]>Cc Richard Purdie <[email protected]>Cc Jacek Anaszewski <[email protected]>Signed-off-by Stephan Linz <[email protected]>---
Changes in v3:
- Port to kernel 4.x
- Split into platform independent and dependent parts.v2: https://patchwork.ozlabs.org/patch/117485/
v1: http://dev.gentoo.org/~josejx/ata.patch--- drivers/ata/libata-core.c | 4 ++++ drivers/ide/ide-disk.c | 2 +- drivers/leds/leds-hp6xx.c | 2 +- drivers/leds/trigger/Kconfig | 8 ++++---- drivers/leds/trigger/Makefile | 2 +- .../trigger/{ledtrig-ide-disk.c => ledtrig-disk.c} | 20 ++++++++++---------- include/linux/leds.h | 6 +++--- 7 files changed, 24 insertions(+), 20 deletions(-)rename
drivers/leds/trigger/{ledtrig-ide-disk.c=>ledtrig-disk.c} (50%)drivers/ata/libata-core.c +4
-0@@ -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> @@ -5072,6 +5073,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. * drivers/ide/ide-disk.c +1
-1@@ -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",drivers/leds/leds-hp6xx.c +1
-1@@ -50,7 +50,7 @@ static struct led_classdev hp6xx_red_led = {static struct led_classdev hp6xx_green_led = { .name ="hp6xx:green" , - .default_trigger ="ide-disk" , + .default_trigger ="disk-activity" , .brightness_set = hp6xxled_green_set, .flags =LED_CORE_SUSPENDRESUME , };drivers/leds/trigger/Kconfig +4
-4@@ -33,12 +33,12 @@ config LEDS_TRIGGER_ONESHOT If unsure, say Y. -config LEDS_TRIGGER_IDE_DISK - bool "LED IDE Disk Trigger" - depends on IDE_GD_ATA +config LEDS_TRIGGER_DISK + bool "LED Disk Trigger" + depends on IDE_GD_ATA || ATA depends on LEDS_TRIGGERS help - This allows LEDs to be controlled by IDE disk activity. + This allows LEDs to be controlled by disk activity. If unsure, say Y. config LEDS_TRIGGER_MTDdrivers/leds/trigger/Makefile +1
-1@@ -1,6 +1,6 @@ obj-$(CONFIG_LEDS_TRIGGER_TIMER) += ledtrig-timer.o obj-$(CONFIG_LEDS_TRIGGER_ONESHOT) += ledtrig-oneshot.o -obj-$(CONFIG_LEDS_TRIGGER_IDE_DISK) += ledtrig-ide-disk.o +obj-$(CONFIG_LEDS_TRIGGER_DISK) += ledtrig-disk.o obj-$(CONFIG_LEDS_TRIGGER_MTD) += ledtrig-mtd.o obj-$(CONFIG_LEDS_TRIGGER_HEARTBEAT) += ledtrig-heartbeat.o obj-$(CONFIG_LEDS_TRIGGER_BACKLIGHT) += ledtrig-backlight.odrivers/leds/trigger/ledtrig-disk.c renamed from drivers/leds/trigger/ledtrig-ide-disk.c +10
-10@@ -1,5 +1,5 @@/* -* LED IDE-Disk Activity Trigger +* LED Disk Activity Trigger * * Copyright 2006 Openedhand Ltd. * @@ -17,20 +17,20 @@#define BLINK_DELAY 30 -DEFINE_LED_TRIGGER (ledtrig_ide); +DEFINE_LED_TRIGGER (ledtrig_disk); -void ledtrig_ide_activity (void ) +void ledtrig_disk_activity (void ) { -unsigned long ide_blink_delay =BLINK_DELAY ; +unsigned long disk_blink_delay =BLINK_DELAY ; -led_trigger_blink_oneshot (ledtrig_ide, - &ide_blink_delay, &ide_blink_delay,0 ); +led_trigger_blink_oneshot (ledtrig_disk, + &disk_blink_delay, &disk_blink_delay,0 ); } -EXPORT_SYMBOL (ledtrig_ide_activity); +EXPORT_SYMBOL (ledtrig_disk_activity); -static int __init ledtrig_ide_init (void ) +static int __init ledtrig_disk_init (void ) { -led_trigger_register_simple ("ide-disk" , &ledtrig_ide); +led_trigger_register_simple ("disk-activity" , &ledtrig_disk);return 0 ; } -device_initcall (ledtrig_ide_init); +device_initcall (ledtrig_disk_init);include/linux/leds.h +3
-3@@ -324,10 +324,10 @@ static inline void *led_get_trigger_data(struct led_classdev *led_cdev)#endif /* CONFIG_LEDS_TRIGGERS */ /* Trigger specific functions */ -#ifdef CONFIG_LEDS_TRIGGER_IDE_DISK -extern void ledtrig_ide_activity (void ); +#ifdef CONFIG_LEDS_TRIGGER_DISK +extern void ledtrig_disk_activity (void );#else -static inline void ledtrig_ide_activity (void ) {} +static inline void ledtrig_disk_activity (void ) {}#endif #ifdef CONFIG_LEDS_TRIGGER_MTD
Hi Jacek,
to keep the original ide-disk trigger is good idea to be backward compatible. I'll submit a new v4 patch set.
br,
Stephan
Am 09.06.2016 um 09:29 schrieb Jacek Anaszewski:
Quoted 205 lines
Hi Stephan,
Thanks for the patch.
Generally it looks ok, with one exception: we have to keep ide-disk trigger, so as not to break existing users. Please just register two triggers in
ledtrig_disk_init, similarly as it was done for mtd trigger:
drivers/leds/trigger/ledtrig-mtd.cThanks,
Jacek AnaszewskiQuoted 186 lines · Stephan Linz
This patch converts the IDE specific LED trigger to a generic disk activity LED trigger. The libata core is now a trigger source just like before the IDE disk driver. It's merely a replacement of the string ide by disk.
The patch is taken from http://dev.gentoo.org/~josejx/ata.patch and is widely used by any ibook/powerbook owners with great satisfaction. Likewise, it is very often used successfully on different ARM platforms.
The original patch was split into different parts to clarify platform independent and dependent changes.
Cc Joseph Jezak <[email protected]>Cc Nico Macrionitis <[email protected]>Cc Jörg Sommer <[email protected]>Cc Richard Purdie <[email protected]>Cc Jacek Anaszewski <[email protected]>Signed-off-by Stephan Linz <[email protected]>---
Changes in v3:
- Port to kernel 4.x
- Split into platform independent and dependent parts.v2: https://patchwork.ozlabs.org/patch/117485/
v1: http://dev.gentoo.org/~josejx/ata.patch--- drivers/ata/libata-core.c | 4 ++++ drivers/ide/ide-disk.c | 2 +- drivers/leds/leds-hp6xx.c | 2 +- drivers/leds/trigger/Kconfig | 8 ++++---- drivers/leds/trigger/Makefile | 2 +- .../trigger/{ledtrig-ide-disk.c => ledtrig-disk.c} | 20 ++++++++++---------- include/linux/leds.h | 6 +++--- 7 files changed, 24 insertions(+), 20 deletions(-)rename
drivers/leds/trigger/{ledtrig-ide-disk.c=>ledtrig-disk.c}
(50%)drivers/ata/libata-core.c +4
-0@@ -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> @@ -5072,6 +5073,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. * drivers/ide/ide-disk.c +1
-1@@ -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",drivers/leds/leds-hp6xx.c +1
-1@@ -50,7 +50,7 @@ static struct led_classdev hp6xx_red_led = {static struct led_classdev hp6xx_green_led = { .name ="hp6xx:green" , - .default_trigger ="ide-disk" , + .default_trigger ="disk-activity" , .brightness_set = hp6xxled_green_set, .flags =LED_CORE_SUSPENDRESUME , };drivers/leds/trigger/Kconfig +4
-4@@ -33,12 +33,12 @@ config LEDS_TRIGGER_ONESHOT If unsure, say Y. -config LEDS_TRIGGER_IDE_DISK - bool "LED IDE Disk Trigger" - depends on IDE_GD_ATA +config LEDS_TRIGGER_DISK + bool "LED Disk Trigger" + depends on IDE_GD_ATA || ATA depends on LEDS_TRIGGERS help - This allows LEDs to be controlled by IDE disk activity. + This allows LEDs to be controlled by disk activity. If unsure, say Y. config LEDS_TRIGGER_MTDdrivers/leds/trigger/Makefile +1
-1@@ -1,6 +1,6 @@ obj-$(CONFIG_LEDS_TRIGGER_TIMER) += ledtrig-timer.o obj-$(CONFIG_LEDS_TRIGGER_ONESHOT) += ledtrig-oneshot.o -obj-$(CONFIG_LEDS_TRIGGER_IDE_DISK) += ledtrig-ide-disk.o +obj-$(CONFIG_LEDS_TRIGGER_DISK) += ledtrig-disk.o obj-$(CONFIG_LEDS_TRIGGER_MTD) += ledtrig-mtd.o obj-$(CONFIG_LEDS_TRIGGER_HEARTBEAT) += ledtrig-heartbeat.o obj-$(CONFIG_LEDS_TRIGGER_BACKLIGHT) += ledtrig-backlight.odrivers/leds/trigger/ledtrig-disk.c renamed from drivers/leds/trigger/ledtrig-ide-disk.c +10
-10@@ -1,5 +1,5 @@/* -* LED IDE-Disk Activity Trigger +* LED Disk Activity Trigger * * Copyright 2006 Openedhand Ltd. * @@ -17,20 +17,20 @@#define BLINK_DELAY 30 -DEFINE_LED_TRIGGER (ledtrig_ide); +DEFINE_LED_TRIGGER (ledtrig_disk); -void ledtrig_ide_activity (void ) +void ledtrig_disk_activity (void ) { -unsigned long ide_blink_delay =BLINK_DELAY ; +unsigned long disk_blink_delay =BLINK_DELAY ; -led_trigger_blink_oneshot (ledtrig_ide, - &ide_blink_delay, &ide_blink_delay,0 ); +led_trigger_blink_oneshot (ledtrig_disk, + &disk_blink_delay, &disk_blink_delay,0 ); } -EXPORT_SYMBOL (ledtrig_ide_activity); +EXPORT_SYMBOL (ledtrig_disk_activity); -static int __init ledtrig_ide_init (void ) +static int __init ledtrig_disk_init (void ) { -led_trigger_register_simple ("ide-disk" , &ledtrig_ide); +led_trigger_register_simple ("disk-activity" , &ledtrig_disk);return 0 ; } -device_initcall (ledtrig_ide_init); +device_initcall (ledtrig_disk_init);include/linux/leds.h +3
-3@@ -324,10 +324,10 @@ static inline void *led_get_trigger_data(struct led_classdev *led_cdev)#endif /* CONFIG_LEDS_TRIGGERS */ /* Trigger specific functions */ -#ifdef CONFIG_LEDS_TRIGGER_IDE_DISK -extern void ledtrig_ide_activity (void ); +#ifdef CONFIG_LEDS_TRIGGER_DISK +extern void ledtrig_disk_activity (void );#else -static inline void ledtrig_ide_activity (void ) {} +static inline void ledtrig_disk_activity (void ) {}#endif #ifdef CONFIG_LEDS_TRIGGER_MTD
Jacek Anaszewski
AppliedHi Stephan,
Quoted 170 lines · Stephan Linz
This patch converts the IDE specific LED trigger to a generic disk activity LED trigger. The libata core is now a trigger source just like before the IDE disk driver. It's merely a replacement of the string ide by disk.
The patch is taken from http://dev.gentoo.org/~josejx/ata.patch and is widely used by any ibook/powerbook owners with great satisfaction. Likewise, it is very often used successfully on different ARM platforms.
The original patch was split into different parts to clarify platform independent and dependent changes.
Cc Joseph Jezak <[email protected]>Cc Nico Macrionitis <[email protected]>Cc Jörg Sommer <[email protected]>Cc Richard Purdie <[email protected]>Cc Jacek Anaszewski <[email protected]>Signed-off-by Stephan Linz <[email protected]>---
Changes in v3:
- Port to kernel 4.x
- Split into platform independent and dependent parts.v2: https://patchwork.ozlabs.org/patch/117485/
v1: http://dev.gentoo.org/~josejx/ata.patch--- drivers/ata/libata-core.c | 4 ++++ drivers/ide/ide-disk.c | 2 +- drivers/leds/leds-hp6xx.c | 2 +- drivers/leds/trigger/Kconfig | 8 ++++---- drivers/leds/trigger/Makefile | 2 +- .../trigger/{ledtrig-ide-disk.c => ledtrig-disk.c} | 20 ++++++++++---------- include/linux/leds.h | 6 +++--- 7 files changed, 24 insertions(+), 20 deletions(-)rename
drivers/leds/trigger/{ledtrig-ide-disk.c=>ledtrig-disk.c} (50%)drivers/ata/libata-core.c +4
-0@@ -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> @@ -5072,6 +5073,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. * drivers/ide/ide-disk.c +1
-1@@ -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",drivers/leds/leds-hp6xx.c +1
-1@@ -50,7 +50,7 @@ static struct led_classdev hp6xx_red_led = {static struct led_classdev hp6xx_green_led = { .name ="hp6xx:green" , - .default_trigger ="ide-disk" , + .default_trigger ="disk-activity" , .brightness_set = hp6xxled_green_set, .flags =LED_CORE_SUSPENDRESUME , };drivers/leds/trigger/Kconfig +4
-4@@ -33,12 +33,12 @@ config LEDS_TRIGGER_ONESHOT If unsure, say Y. -config LEDS_TRIGGER_IDE_DISK - bool "LED IDE Disk Trigger" - depends on IDE_GD_ATA +config LEDS_TRIGGER_DISK + bool "LED Disk Trigger" + depends on IDE_GD_ATA || ATA depends on LEDS_TRIGGERS help - This allows LEDs to be controlled by IDE disk activity. + This allows LEDs to be controlled by disk activity. If unsure, say Y. config LEDS_TRIGGER_MTDdrivers/leds/trigger/Makefile +1
-1@@ -1,6 +1,6 @@ obj-$(CONFIG_LEDS_TRIGGER_TIMER) += ledtrig-timer.o obj-$(CONFIG_LEDS_TRIGGER_ONESHOT) += ledtrig-oneshot.o -obj-$(CONFIG_LEDS_TRIGGER_IDE_DISK) += ledtrig-ide-disk.o +obj-$(CONFIG_LEDS_TRIGGER_DISK) += ledtrig-disk.o obj-$(CONFIG_LEDS_TRIGGER_MTD) += ledtrig-mtd.o obj-$(CONFIG_LEDS_TRIGGER_HEARTBEAT) += ledtrig-heartbeat.o obj-$(CONFIG_LEDS_TRIGGER_BACKLIGHT) += ledtrig-backlight.odrivers/leds/trigger/ledtrig-disk.c renamed from drivers/leds/trigger/ledtrig-ide-disk.c +10
-10@@ -1,5 +1,5 @@/* -* LED IDE-Disk Activity Trigger +* LED Disk Activity Trigger * * Copyright 2006 Openedhand Ltd. * @@ -17,20 +17,20 @@#define BLINK_DELAY 30 -DEFINE_LED_TRIGGER (ledtrig_ide); +DEFINE_LED_TRIGGER (ledtrig_disk); -void ledtrig_ide_activity (void ) +void ledtrig_disk_activity (void ) { -unsigned long ide_blink_delay =BLINK_DELAY ; +unsigned long disk_blink_delay =BLINK_DELAY ; -led_trigger_blink_oneshot (ledtrig_ide, - &ide_blink_delay, &ide_blink_delay,0 ); +led_trigger_blink_oneshot (ledtrig_disk, + &disk_blink_delay, &disk_blink_delay,0 ); } -EXPORT_SYMBOL (ledtrig_ide_activity); +EXPORT_SYMBOL (ledtrig_disk_activity); -static int __init ledtrig_ide_init (void ) +static int __init ledtrig_disk_init (void ) { -led_trigger_register_simple ("ide-disk" , &ledtrig_ide); +led_trigger_register_simple ("disk-activity" , &ledtrig_disk);return 0 ; } -device_initcall (ledtrig_ide_init); +device_initcall (ledtrig_disk_init);include/linux/leds.h +0
-0@@ -324,10 +324,10 @@ static inline void *led_get_trigger_data(struct led_classdev *led_cdev)#endif /* CONFIG_LEDS_TRIGGERS */ /* Trigger specific functions */
include/linux/leds.h static inline void *led_get_trigger_data(struct led_classdev *led_cdev) · line 333
Quoted 10 lines
include/linux/leds.h +3
-3-#ifdef CONFIG_LEDS_TRIGGER_IDE_DISK -extern void ledtrig_ide_activity (void ); +#ifdef CONFIG_LEDS_TRIGGER_DISK +extern void ledtrig_disk_activity (void );#else -static inline void ledtrig_ide_activity (void ) {} +static inline void ledtrig_disk_activity (void ) {}#endif #ifdef CONFIG_LEDS_TRIGGER_MTD
Applied the patchset to the for-next branch of linux-leds.git.
Thanks,
Jacek Anaszewski
Hi Jacek,
thanks a lot. Can you tell me, when the LED for-next branch will merge into mainline?
br,
Stephan
Am 20.06.2016 um 10:36 schrieb Jacek Anaszewski:
Quoted 195 lines
Hi Stephan,
Quoted 184 lines · Stephan Linz
This patch converts the IDE specific LED trigger to a generic disk activity LED trigger. The libata core is now a trigger source just like before the IDE disk driver. It's merely a replacement of the string ide by disk.
The patch is taken from http://dev.gentoo.org/~josejx/ata.patch and is widely used by any ibook/powerbook owners with great satisfaction. Likewise, it is very often used successfully on different ARM platforms.
The original patch was split into different parts to clarify platform independent and dependent changes.
Cc Joseph Jezak <[email protected]>Cc Nico Macrionitis <[email protected]>Cc Jörg Sommer <[email protected]>Cc Richard Purdie <[email protected]>Cc Jacek Anaszewski <[email protected]>Signed-off-by Stephan Linz <[email protected]>---
Changes in v3:
- Port to kernel 4.x
- Split into platform independent and dependent parts.v2: https://patchwork.ozlabs.org/patch/117485/
v1: http://dev.gentoo.org/~josejx/ata.patch--- drivers/ata/libata-core.c | 4 ++++ drivers/ide/ide-disk.c | 2 +- drivers/leds/leds-hp6xx.c | 2 +- drivers/leds/trigger/Kconfig | 8 ++++---- drivers/leds/trigger/Makefile | 2 +- .../trigger/{ledtrig-ide-disk.c => ledtrig-disk.c} | 20 ++++++++++---------- include/linux/leds.h | 6 +++--- 7 files changed, 24 insertions(+), 20 deletions(-)rename
drivers/leds/trigger/{ledtrig-ide-disk.c=>ledtrig-disk.c}
(50%)drivers/ata/libata-core.c +4
-0@@ -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> @@ -5072,6 +5073,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. * drivers/ide/ide-disk.c +1
-1@@ -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",drivers/leds/leds-hp6xx.c +1
-1@@ -50,7 +50,7 @@ static struct led_classdev hp6xx_red_led = {static struct led_classdev hp6xx_green_led = { .name ="hp6xx:green" , - .default_trigger ="ide-disk" , + .default_trigger ="disk-activity" , .brightness_set = hp6xxled_green_set, .flags =LED_CORE_SUSPENDRESUME , };drivers/leds/trigger/Kconfig +4
-4@@ -33,12 +33,12 @@ config LEDS_TRIGGER_ONESHOT If unsure, say Y. -config LEDS_TRIGGER_IDE_DISK - bool "LED IDE Disk Trigger" - depends on IDE_GD_ATA +config LEDS_TRIGGER_DISK + bool "LED Disk Trigger" + depends on IDE_GD_ATA || ATA depends on LEDS_TRIGGERS help - This allows LEDs to be controlled by IDE disk activity. + This allows LEDs to be controlled by disk activity. If unsure, say Y. config LEDS_TRIGGER_MTDdrivers/leds/trigger/Makefile +1
-1@@ -1,6 +1,6 @@ obj-$(CONFIG_LEDS_TRIGGER_TIMER) += ledtrig-timer.o obj-$(CONFIG_LEDS_TRIGGER_ONESHOT) += ledtrig-oneshot.o -obj-$(CONFIG_LEDS_TRIGGER_IDE_DISK) += ledtrig-ide-disk.o +obj-$(CONFIG_LEDS_TRIGGER_DISK) += ledtrig-disk.o obj-$(CONFIG_LEDS_TRIGGER_MTD) += ledtrig-mtd.o obj-$(CONFIG_LEDS_TRIGGER_HEARTBEAT) += ledtrig-heartbeat.o obj-$(CONFIG_LEDS_TRIGGER_BACKLIGHT) += ledtrig-backlight.odrivers/leds/trigger/ledtrig-disk.c renamed from drivers/leds/trigger/ledtrig-ide-disk.c +10
-10@@ -1,5 +1,5 @@/* -* LED IDE-Disk Activity Trigger +* LED Disk Activity Trigger * * Copyright 2006 Openedhand Ltd. * @@ -17,20 +17,20 @@#define BLINK_DELAY 30 -DEFINE_LED_TRIGGER (ledtrig_ide); +DEFINE_LED_TRIGGER (ledtrig_disk); -void ledtrig_ide_activity (void ) +void ledtrig_disk_activity (void ) { -unsigned long ide_blink_delay =BLINK_DELAY ; +unsigned long disk_blink_delay =BLINK_DELAY ; -led_trigger_blink_oneshot (ledtrig_ide, - &ide_blink_delay, &ide_blink_delay,0 ); +led_trigger_blink_oneshot (ledtrig_disk, + &disk_blink_delay, &disk_blink_delay,0 ); } -EXPORT_SYMBOL (ledtrig_ide_activity); +EXPORT_SYMBOL (ledtrig_disk_activity); -static int __init ledtrig_ide_init (void ) +static int __init ledtrig_disk_init (void ) { -led_trigger_register_simple ("ide-disk" , &ledtrig_ide); +led_trigger_register_simple ("disk-activity" , &ledtrig_disk);return 0 ; } -device_initcall (ledtrig_ide_init); +device_initcall (ledtrig_disk_init);include/linux/leds.h +3
-3@@ -324,10 +324,10 @@ static inline void *led_get_trigger_data(struct led_classdev *led_cdev)#endif /* CONFIG_LEDS_TRIGGERS */ /* Trigger specific functions */ -#ifdef CONFIG_LEDS_TRIGGER_IDE_DISK -extern void ledtrig_ide_activity (void ); +#ifdef CONFIG_LEDS_TRIGGER_DISK +extern void ledtrig_disk_activity (void );#else -static inline void ledtrig_ide_activity (void ) {} +static inline void ledtrig_disk_activity (void ) {}#endif Quoted 2 lines
#ifdef CONFIG_LEDS_TRIGGER_MTDApplied the patchset to the for-next branch of linux-leds.git.
Thanks,
Jacek Anaszewski
Hi Stephan,
Quoted 4 lines · Stephan Linz
Hi Jacek,
thanks a lot. Can you tell me, when the LED for-next branch will merge into mainline?
If everything will go as usually then the merge window will start in four weeks.
Best regards,
Jacek Anaszewski