Gentoo Forums
Gentoo Forums
Gentoo Forums
Quick Search: in
Does front panel LED work with libata?
View unanswered posts
View posts from last 24 hours

 
Reply to topic    Gentoo Forums Forum Index Gentoo on PPC
View previous topic :: View next topic  
Author Message
bigboote
n00b
n00b


Joined: 27 May 2003
Posts: 14
Location: Chicago, IL USA

PostPosted: Sat Aug 14, 2010 2:48 am    Post subject: Does front panel LED work with libata? Reply with quote

I've completed the update to libata without problems except the front panel LED no longer blinks during disk activity. Does anyone know if this is unsupported with libata?

Here's my config for what it's worth:
Code:
powerbook ~ $ zgrep ^CONFIG.*LED /proc/config.gz
CONFIG_MAC80211_LEDS=y
CONFIG_ADB_PMU_LED=y
CONFIG_ADB_PMU_LED_IDE=y
CONFIG_B43_LEDS=y
CONFIG_B43LEGACY_LEDS=y
CONFIG_P54_LEDS=y
CONFIG_USB_APPLEDISPLAY=m
CONFIG_NEW_LEDS=y
CONFIG_LEDS_CLASS=y
CONFIG_LEDS_TRIGGERS=y
CONFIG_LEDS_TRIGGER_IDE_DISK=y
CONFIG_LEDS_TRIGGER_DEFAULT_ON=y
powerbook ~ $ uname -a
Linux powerbook 2.6.35-gentoo-r1 #1 Fri Aug 13 18:44:39 CDT 2010 ppc 7447A, altivec supported PowerBook6,4 GNU/Linux
powerbook ~ $ cat /proc/cpuinfo
processor   : 0
cpu      : 7447A, altivec supported
clock      : 1333.333000MHz
revision   : 1.1 (pvr 8003 0101)
bogomips   : 73.72
timebase   : 18432000
platform   : PowerMac
model      : PowerBook6,4
machine      : PowerBook6,4
motherboard   : PowerBook6,4 MacRISC3 Power Macintosh
detected as   : 287 (PowerBook G4 12")
pmac flags   : 0000001a
L2 cache   : 512K unified
pmac-generation   : NewWorld
Memory      : 1280 MB

_________________
rundll32.exe shell32.dll,SHExitWindowsEx 1
Back to top
View user's profile Send private message
blob999
n00b
n00b


Joined: 07 Jun 2009
Posts: 64
Location: NATO area

PostPosted: Wed Sep 15, 2010 12:37 pm    Post subject: Reply with quote

no, it doesn't work with new ata drivers...

Code:
# cat /sys/class/leds/pmu-led\:\:front/trigger
none [ide-disk] phy0rx phy0tx phy0assoc phy0radio


that's from a linux-2.6.35.4 .
As you can see the only choose available is yet ide-disk.
_________________
LinuxPPC user!
my blog: http://linuxpowerpc.blogspot.com/
Back to top
View user's profile Send private message
Massimo B.
Veteran
Veteran


Joined: 09 Feb 2005
Posts: 1759
Location: PB, Germany

PostPosted: Mon Jan 17, 2011 9:05 am    Post subject: Reply with quote

Would be nice to see that feature soon on libata...
Got used to that blinking light (which OSX users could never enjoy, as far as I know).
_________________
HP ZBook Power 15.6" G8 i7-11800H|HP EliteDesk 800G1 i7-4790|HP Compaq Pro 6300 i7-3770
Back to top
View user's profile Send private message
JoseJX
Retired Dev
Retired Dev


Joined: 28 Apr 2002
Posts: 2774

PostPosted: Tue Jan 18, 2011 3:40 am    Post subject: Reply with quote

I wrote a patch for this, but never submitted it upstream because I wasn't sure if anybody actually wanted this. Please give it a try:

http://dev.gentoo.org/~josejx/ata.patch
_________________
Gentoo PPC FAQ: http://www.gentoo.org/doc/en/gentoo-ppc-faq.xml
Back to top
View user's profile Send private message
Massimo B.
Veteran
Veteran


Joined: 09 Feb 2005
Posts: 1759
Location: PB, Germany

PostPosted: Tue Jan 18, 2011 11:09 am    Post subject: Reply with quote

Nice, PPC is still alive. JoseJX I hope you stay with the ppc architecture for a long time.
Thanks, I'll try that patch soon. Will that come into gentoo-sources if working?

By the way, did you ever try to tune the fan of the PowerBook powermanagement?
_________________
HP ZBook Power 15.6" G8 i7-11800H|HP EliteDesk 800G1 i7-4790|HP Compaq Pro 6300 i7-3770
Back to top
View user's profile Send private message
Massimo B.
Veteran
Veteran


Joined: 09 Feb 2005
Posts: 1759
Location: PB, Germany

PostPosted: Tue Jan 18, 2011 7:06 pm    Post subject: Reply with quote

Code:
linux-2.6.34-gentoo-r1 # patch -p0 < ata.patch
can't find file to patch at input line 5
Perhaps you used the wrong -p or --strip option?
The text leading up to this was:
--------------------------
|diff --git a/arch/powerpc/configs/pmac32_defconfig b/arch/powerpc/configs/pmac32_defconfig
|index ac4fc41..377d808 100644
|--- a/arch/powerpc/configs/pmac32_defconfig
|+++ b/arch/powerpc/configs/pmac32_defconfig
--------------------------
File to patch:

Which kernel is that patch for?

BTW, what happened to gentoo-sources-2.6.34-r1? That was marked ppc stable once. Is isn't anymore.
_________________
HP ZBook Power 15.6" G8 i7-11800H|HP EliteDesk 800G1 i7-4790|HP Compaq Pro 6300 i7-3770
Back to top
View user's profile Send private message
JoseJX
Retired Dev
Retired Dev


Joined: 28 Apr 2002
Posts: 2774

PostPosted: Wed Jan 19, 2011 6:50 pm    Post subject: Reply with quote

Should be 2.6.36-ish, I forget exactly. I can adjust it to whatever kernel you're using, just let me know.
_________________
Gentoo PPC FAQ: http://www.gentoo.org/doc/en/gentoo-ppc-faq.xml
Back to top
View user's profile Send private message
blob999
n00b
n00b


Joined: 07 Jun 2009
Posts: 64
Location: NATO area

PostPosted: Wed Jan 19, 2011 11:27 pm    Post subject: Reply with quote

@ JoseJX

wow, thank you!
I asked for a rediff[1] to a cruxppc developer and now it works fine with 2.6.37.
It 'd be really awesome if you commit this on linuxppc-dev.
Code:

root@hellas:/usr/src# cat /sys/class/leds/pmu-led\:\:front/trigger
none [disk-activity] phy0rx phy0tx phy0assoc phy0radio


[1] http:/ /cruxppc.org/~acrux/pmu-led-2.6.37.patch
_________________
LinuxPPC user!
my blog: http://linuxpowerpc.blogspot.com/
Back to top
View user's profile Send private message
Massimo B.
Veteran
Veteran


Joined: 09 Feb 2005
Posts: 1759
Location: PB, Germany

PostPosted: Thu Jan 20, 2011 7:46 pm    Post subject: Reply with quote

As I heard in the channel the 2.6.36 will be stabilized soon for ppc...
I'll wait for that to try the patch.
_________________
HP ZBook Power 15.6" G8 i7-11800H|HP EliteDesk 800G1 i7-4790|HP Compaq Pro 6300 i7-3770
Back to top
View user's profile Send private message
gringo
Advocate
Advocate


Joined: 27 Apr 2003
Posts: 3793

PostPosted: Fri Jan 21, 2011 11:20 am    Post subject: Reply with quote

Quote:
http:/ /cruxppc.org/~acrux/pmu-led-2.6.37.patch


cool, thanks a lot. Haven´t tested it yet but will this weekend if i find time enough.

cheers
Back to top
View user's profile Send private message
Massimo B.
Veteran
Veteran


Joined: 09 Feb 2005
Posts: 1759
Location: PB, Germany

PostPosted: Fri Jan 21, 2011 11:44 am    Post subject: Reply with quote

BTW, is there any performance issue with that LED for hd activity? My 4200rpm hd already is kind of sluggish.
_________________
HP ZBook Power 15.6" G8 i7-11800H|HP EliteDesk 800G1 i7-4790|HP Compaq Pro 6300 i7-3770
Back to top
View user's profile Send private message
Massimo B.
Veteran
Veteran


Joined: 09 Feb 2005
Posts: 1759
Location: PB, Germany

PostPosted: Wed Feb 02, 2011 7:16 pm    Post subject: Reply with quote

On gentoo-sources-2.6.36-gentoo-r5:
# patch -p1 < ata.patch
patching file arch/powerpc/configs/pmac32_defconfig
patching file arch/powerpc/configs/ppc6xx_defconfig
patching file drivers/ata/libata-core.c
patching file drivers/ide/ide-disk.c
patching file drivers/leds/Kconfig
patching file drivers/leds/Makefile
can't find file to patch at input line 99
Perhaps you used the wrong -p or --strip option?
The text leading up to this was:
--------------------------
|diff --git a/drivers/leds/ledtrig-disk.c b/drivers/leds/ledtrig-disk.c
|index ec099fc..fb5e1f5 100644
|--- a/drivers/leds/ledtrig-disk.c
|+++ b/drivers/leds/ledtrig-disk.c
--------------------------
File to patch:


# nice make && make modules_install
scripts/kconfig/conf --silentoldconfig arch/powerpc/Kconfig
*
* Restart config...
*
*
* LED Support
*
LED Support (NEW_LEDS) [Y/?] y
  LED Class Support (LEDS_CLASS) [Y/?] y
    *
    * LED drivers
    *
    LED driver for PCA9532 dimmer (LEDS_PCA9532) [N/m/y/?] n
    LED Support for N.S. LP3944 (Fun Light) I2C chip (LEDS_LP3944) [N/m/y/?] n
    LED Support for PCA955x I2C chips (LEDS_PCA955X) [N/m/y/?] n
    LED driver for BD2802 RGB LED (LEDS_BD2802) [N/m/y/?] n
    LED Trigger support (LEDS_TRIGGERS) [Y/?] y
      *
      * LED Triggers
      *
      LED Timer Trigger (LEDS_TRIGGER_TIMER) [N/m/y/?] n
      LED Disk Trigger (LEDS_TRIGGER_DISK) [N/y/?] (NEW) y
      LED Heartbeat Trigger (LEDS_TRIGGER_HEARTBEAT) [N/m/y/?] n
      LED backlight Trigger (LEDS_TRIGGER_BACKLIGHT) [N/m/y/?] n
      LED Default ON Trigger (LEDS_TRIGGER_DEFAULT_ON) [N/m/y/?] n
      *
      * iptables trigger is under Netfilter config (LED target)
      *
#
# configuration written to .config
#
  CHK     include/linux/version.h
  CHK     include/generated/utsrelease.h
  CALL    scripts/checksyscalls.sh
<stdin>:1522:2: Warnung: #warning syscall recvmmsg not implemented
  CHK     include/generated/compile.h
  CALL    arch/powerpc/kernel/systbl_chk.sh
  CALL    arch/powerpc/kernel/prom_init_check.sh
  GZIP    kernel/config_data.gz
  IKCFG   kernel/config_data.h
  CC      kernel/configs.o
  LD      kernel/built-in.o
  CC      drivers/ata/libata-core.o
drivers/ata/libata-core.c: In Funktion »ata_qc_complete«:
drivers/ata/libata-core.c:4958:2: Fehler: Implizite Deklaration der Funktion »ledtrig_disk_activity«
make[2]: *** [drivers/ata/libata-core.o] Fehler 1
make[1]: *** [drivers/ata] Fehler 2
make: *** [drivers] Fehler 2

_________________
HP ZBook Power 15.6" G8 i7-11800H|HP EliteDesk 800G1 i7-4790|HP Compaq Pro 6300 i7-3770
Back to top
View user's profile Send private message
JoseJX
Retired Dev
Retired Dev


Joined: 28 Apr 2002
Posts: 2774

PostPosted: Tue Feb 08, 2011 7:45 am    Post subject: Reply with quote

Massimo B. wrote:
BTW, is there any performance issue with that LED for hd activity? My 4200rpm hd already is kind of sluggish.

I have not measured it, but there would be some overhead yes. I'm not sure it's really significant though, I don't notice any visible difference with it enabled.
_________________
Gentoo PPC FAQ: http://www.gentoo.org/doc/en/gentoo-ppc-faq.xml
Back to top
View user's profile Send private message
Massimo B.
Veteran
Veteran


Joined: 09 Feb 2005
Posts: 1759
Location: PB, Germany

PostPosted: Tue Feb 08, 2011 9:18 am    Post subject: Reply with quote

Useful feature for our LED trigger would be to define the brightness :)
_________________
HP ZBook Power 15.6" G8 i7-11800H|HP EliteDesk 800G1 i7-4790|HP Compaq Pro 6300 i7-3770
Back to top
View user's profile Send private message
Massimo B.
Veteran
Veteran


Joined: 09 Feb 2005
Posts: 1759
Location: PB, Germany

PostPosted: Thu Feb 17, 2011 8:50 am    Post subject: Reply with quote

Works now, thanks!
Patch to current http://dev.gentoo.org/~josejx/ata.patch :
# diff ata.patch.mod ata.patch
91c91
< +obj-$(CONFIG_LEDS_TRIGGER_DISK)              += ledtrig-ide-disk.o
---
> +obj-$(CONFIG_LEDS_TRIGGER_DISK)              += ledtrig-disk.o
95c95
< diff --git a/drivers/leds/ledtrig-ide-disk.c b/drivers/leds/ledtrig-ide-disk.c
---
> diff --git a/drivers/leds/ledtrig-disk.c b/drivers/leds/ledtrig-disk.c
97,98c97,98
< --- a/drivers/leds/ledtrig-ide-disk.c
< +++ b/drivers/leds/ledtrig-ide-disk.c
---
> --- a/drivers/leds/ledtrig-disk.c
> +++ b/drivers/leds/ledtrig-disk.c

On gentoo-sources-2.6.36-gentoo-r5:
# patch -p1 < ata.patch.mod
patching file arch/powerpc/configs/pmac32_defconfig
patching file arch/powerpc/configs/ppc6xx_defconfig
patching file drivers/ata/libata-core.c
patching file drivers/ide/ide-disk.c
patching file drivers/leds/Kconfig
patching file drivers/leds/Makefile
patching file drivers/leds/ledtrig-ide-disk.c
patching file drivers/macintosh/Kconfig
patching file drivers/macintosh/via-pmu-led.c
patching file include/linux/leds.h

_________________
HP ZBook Power 15.6" G8 i7-11800H|HP EliteDesk 800G1 i7-4790|HP Compaq Pro 6300 i7-3770
Back to top
View user's profile Send private message
Massimo B.
Veteran
Veteran


Joined: 09 Feb 2005
Posts: 1759
Location: PB, Germany

PostPosted: Wed Aug 08, 2012 8:51 am    Post subject: Reply with quote

Hi, do you have a more recent patch for 3.* sources? Are there any plans to send that patch upstream? I miss the HD LED.
_________________
HP ZBook Power 15.6" G8 i7-11800H|HP EliteDesk 800G1 i7-4790|HP Compaq Pro 6300 i7-3770
Back to top
View user's profile Send private message
neopablo2000
n00b
n00b


Joined: 21 Jun 2005
Posts: 65

PostPosted: Tue Aug 21, 2012 12:06 am    Post subject: Reply with quote

Massimo B. wrote:
Hi, do you have a more recent patch for 3.* sources? Are there any plans to send that patch upstream? I miss the HD LED.


Mee too!! :)
_________________
Dont blame me for being curious.. Curiosity led to the biggest discoveries in history! :).. And curiosity brought me to Gentoo.. ;-)
Back to top
View user's profile Send private message
lukasz_pl
n00b
n00b


Joined: 12 Nov 2012
Posts: 1
Location: Poland, Silesia, Tychy

PostPosted: Mon Nov 12, 2012 3:10 pm    Post subject: Reply with quote

Massimo B. wrote:
Hi, do you have a more recent patch for 3.* sources? Are there any plans to send that patch upstream? I miss the HD LED.


Hi,

I modified patch to make it work with the recent versions of kernel (3.5 and 3.6). It works well with my ALIX Board and pata_amd driver.

Code:

ipsec ~ # cat /sys/class/leds/alix\:3/trigger
none [disk-activity] default-on timer heartbeat backlight transient oneshot netdev
ipsec ~ #


Maybe it will work with PowerBook. :)

Patch for 3.5 (tested on gentoo-sources-3.5.7)
Code:

diff --git a/arch/powerpc/configs/pmac32_defconfig b/arch/powerpc/configs/pmac32_defconfig
index ac4fc41..377d808 100644
--- a/arch/powerpc/configs/pmac32_defconfig
+++ b/arch/powerpc/configs/pmac32_defconfig
@@ -180,7 +180,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
diff --git a/arch/powerpc/configs/ppc6xx_defconfig b/arch/powerpc/configs/ppc6xx_defconfig
index 9d64a68..767fc14 100644
--- a/arch/powerpc/configs/ppc6xx_defconfig
+++ b/arch/powerpc/configs/ppc6xx_defconfig
@@ -471,7 +471,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
diff --git a/drivers/ata/libata-core.c b/drivers/ata/libata-core.c
index 932eaee..b9ae59e 100644
--- a/drivers/ata/libata-core.c
+++ b/drivers/ata/libata-core.c
@@ -67,6 +67,7 @@
 #include <linux/cdrom.h>
 #include <linux/ratelimit.h>
 #include <linux/pm_runtime.h>
+#include <linux/leds.h>
 
 #include "libata.h"
 #include "libata-transport.h"
@@ -4834,6 +4835,9 @@
 {
    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.
     *
diff --git a/drivers/ide/ide-disk.c b/drivers/ide/ide-disk.c
index 7433e07..e7740b9 100644
--- a/drivers/ide/ide-disk.c
+++ b/drivers/ide/ide-disk.c
@@ -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, buffer=0x%08lx\n",
        drive->name, rq_data_dir(rq) == READ ? "read" : "writ",
diff --git a/drivers/leds/Kconfig b/drivers/leds/Kconfig
index e411262..5cf7c33 100644
--- a/drivers/leds/Kconfig
+++ b/drivers/leds/Kconfig
@@ -443,12 +443,12 @@ config LEDS_TRIGGER_TIMER
 
      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_HEARTBEAT
diff --git a/drivers/leds/Makefile b/drivers/leds/Makefile
index 7d6b958..a0ca1c0 100644
--- a/drivers/leds/Makefile
+++ b/drivers/leds/Makefile
@@ -44,7 +44,7 @@ obj-$(CONFIG_LEDS_DAC124S085)      += leds-dac124s085.o
 
 # LED Triggers
 obj-$(CONFIG_LEDS_TRIGGER_TIMER)   += ledtrig-timer.o
-obj-$(CONFIG_LEDS_TRIGGER_IDE_DISK)   += ledtrig-ide-disk.o
+obj-$(CONFIG_LEDS_TRIGGER_DISK)      += ledtrig-ide-disk.o
 obj-$(CONFIG_LEDS_TRIGGER_HEARTBEAT)   += ledtrig-heartbeat.o
 obj-$(CONFIG_LEDS_TRIGGER_BACKLIGHT)   += ledtrig-backlight.o
 obj-$(CONFIG_LEDS_TRIGGER_GPIO)      += ledtrig-gpio.o
diff --git a/drivers/leds/ledtrig-ide-disk.c b/drivers/leds/ledtrig-ide-disk.c
index ec099fc..fb5e1f5 100644
--- a/drivers/leds/ledtrig-ide-disk.c
+++ b/drivers/leds/ledtrig-ide-disk.c
@@ -1,5 +1,5 @@
 /*
- * LED IDE-Disk Activity Trigger
+ * LED Disk Activity Trigger
  *
  * Copyright 2006 Openedhand Ltd.
  *
@@ -18,46 +18,46 @@
 #include <linux/timer.h>
 #include <linux/leds.h>
 
-static void ledtrig_ide_timerfunc(unsigned long data);
+static void ledtrig_disk_timerfunc(unsigned long data);
 
-DEFINE_LED_TRIGGER(ledtrig_ide);
-static DEFINE_TIMER(ledtrig_ide_timer, ledtrig_ide_timerfunc, 0, 0);
-static int ide_activity;
-static int ide_lastactivity;
+DEFINE_LED_TRIGGER(ledtrig_disk);
+static DEFINE_TIMER(ledtrig_disk_timer, ledtrig_disk_timerfunc, 0, 0);
+static int disk_activity;
+static int disk_lastactivity;
 
-void ledtrig_ide_activity(void)
+void ledtrig_disk_activity(void)
 {
-   ide_activity++;
-   if (!timer_pending(&ledtrig_ide_timer))
-      mod_timer(&ledtrig_ide_timer, jiffies + msecs_to_jiffies(10));
+   disk_activity++;
+   if (!timer_pending(&ledtrig_disk_timer))
+      mod_timer(&ledtrig_disk_timer, jiffies + msecs_to_jiffies(10));
 }
-EXPORT_SYMBOL(ledtrig_ide_activity);
+EXPORT_SYMBOL(ledtrig_disk_activity);
 
-static void ledtrig_ide_timerfunc(unsigned long data)
+static void ledtrig_disk_timerfunc(unsigned long data)
 {
-   if (ide_lastactivity != ide_activity) {
-      ide_lastactivity = ide_activity;
+   if (disk_lastactivity != disk_activity) {
+      disk_lastactivity = disk_activity;
       /* INT_MAX will set each LED to its maximum brightness */
-      led_trigger_event(ledtrig_ide, INT_MAX);
-      mod_timer(&ledtrig_ide_timer, jiffies + msecs_to_jiffies(10));
+      led_trigger_event(ledtrig_disk, INT_MAX);
+      mod_timer(&ledtrig_disk_timer, jiffies + msecs_to_jiffies(10));
    } else {
-      led_trigger_event(ledtrig_ide, LED_OFF);
+      led_trigger_event(ledtrig_disk, LED_OFF);
    }
 }
 
-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;
 }
 
-static void __exit ledtrig_ide_exit(void)
+static void __exit ledtrig_disk_exit(void)
 {
-   led_trigger_unregister_simple(ledtrig_ide);
+   led_trigger_unregister_simple(ledtrig_disk);
 }
 
-module_init(ledtrig_ide_init);
-module_exit(ledtrig_ide_exit);
+module_init(ledtrig_disk_init);
+module_exit(ledtrig_disk_exit);
 
 MODULE_AUTHOR("Richard Purdie <rpurdie@openedhand.com>");
 MODULE_DESCRIPTION("LED IDE Disk Activity Trigger");
diff --git a/drivers/macintosh/Kconfig b/drivers/macintosh/Kconfig
index fd85bde..ac8b1eb 100644
--- a/drivers/macintosh/Kconfig
+++ b/drivers/macintosh/Kconfig
@@ -96,18 +96,17 @@ 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 a disk LED by default"
    depends on ADB_PMU_LED
   depends on LEDS_CLASS
    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"
diff --git a/drivers/macintosh/via-pmu-led.c b/drivers/macintosh/via-pmu-led.c
index d242976..d4631cb 100644
--- a/drivers/macintosh/via-pmu-led.c
+++ b/drivers/macintosh/via-pmu-led.c
@@ -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,
 };
diff --git a/include/linux/leds.h b/include/linux/leds.h
index ba6986a..d7c794d 100644
--- a/include/linux/leds.h
+++ b/include/linux/leds.h
@@ -119,10 +119,10 @@ extern void led_trigger_event(struct led_trigger *trigger,
 #endif
 
 /* 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
-#define ledtrig_ide_activity() do {} while(0)
+#define ledtrig_disk_activity() do {} while(0)
 #endif
 
 /*


Patch for 3.6
Code:

diff --git a/arch/powerpc/configs/pmac32_defconfig b/arch/powerpc/configs/pmac32_defconfig
index ac4fc41..377d808 100644
--- a/arch/powerpc/configs/pmac32_defconfig
+++ b/arch/powerpc/configs/pmac32_defconfig
@@ -180,7 +180,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
diff --git a/arch/powerpc/configs/ppc6xx_defconfig b/arch/powerpc/configs/ppc6xx_defconfig
index 9d64a68..767fc14 100644
--- a/arch/powerpc/configs/ppc6xx_defconfig
+++ b/arch/powerpc/configs/ppc6xx_defconfig
@@ -471,7 +471,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
diff --git a/drivers/ata/libata-core.c b/drivers/ata/libata-core.c
index 932eaee..b9ae59e 100644
--- a/drivers/ata/libata-core.c
+++ b/drivers/ata/libata-core.c
@@ -58,6 +67,7 @@
 #include <linux/cdrom.h>
 #include <linux/ratelimit.h>
 #include <linux/pm_runtime.h>
+#include <linux/leds.h>
 
 #include "libata.h"
 #include "libata-transport.h"
@@ -4840,6 +4841,9 @@
 {
    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.
     *
diff --git a/drivers/ide/ide-disk.c b/drivers/ide/ide-disk.c
index 7433e07..e7740b9 100644
--- a/drivers/ide/ide-disk.c
+++ b/drivers/ide/ide-disk.c
@@ -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, buffer=0x%08lx\n",
        drive->name, rq_data_dir(rq) == READ ? "read" : "writ",
diff --git a/drivers/leds/Kconfig b/drivers/leds/Kconfig
index e411262..5cf7c33 100644
--- a/drivers/leds/Kconfig
+++ b/drivers/leds/Kconfig
@@ -480,12 +480,12 @@ config LEDS_TRIGGER_TIMER
 
      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_HEARTBEAT
diff --git a/drivers/leds/Makefile b/drivers/leds/Makefile
index 7d6b958..a0ca1c0 100644
--- a/drivers/leds/Makefile
+++ b/drivers/leds/Makefile
@@ -57,7 +57,7 @@
 # LED Triggers
 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-ide-disk.o
 obj-$(CONFIG_LEDS_TRIGGER_HEARTBEAT)   += ledtrig-heartbeat.o
 obj-$(CONFIG_LEDS_TRIGGER_BACKLIGHT)   += ledtrig-backlight.o
 obj-$(CONFIG_LEDS_TRIGGER_GPIO)      += ledtrig-gpio.o
diff --git a/drivers/leds/ledtrig-ide-disk.c b/drivers/leds/ledtrig-ide-disk.c
index ec099fc..fb5e1f5 100644
--- a/drivers/leds/ledtrig-ide-disk.c
+++ b/drivers/leds/ledtrig-ide-disk.c
@@ -1,5 +1,5 @@
 /*
- * LED IDE-Disk Activity Trigger
+ * LED Disk Activity Trigger
  *
  * Copyright 2006 Openedhand Ltd.
  *
@@ -18,30 +18,30 @@
 
 #define BLINK_DELAY 30
 
-DEFINE_LED_TRIGGER(ledtrig_ide);
-static unsigned long ide_blink_delay = BLINK_DELAY;
+DEFINE_LED_TRIGGER(ledtrig_disk);
+static unsigned long disk_blink_delay = BLINK_DELAY;
 
-void ledtrig_ide_activity(void)
+void ledtrig_disk_activity(void)
 {
-   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;
 }
 
-static void __exit ledtrig_ide_exit(void)
+static void __exit ledtrig_disk_exit(void)
 {
-   led_trigger_unregister_simple(ledtrig_ide);
+   led_trigger_unregister_simple(ledtrig_disk);
 }
 
-module_init(ledtrig_ide_init);
-module_exit(ledtrig_ide_exit);
+module_init(ledtrig_disk_init);
+module_exit(ledtrig_disk_exit);
 
 MODULE_AUTHOR("Richard Purdie <rpurdie@openedhand.com>");
-MODULE_DESCRIPTION("LED IDE Disk Activity Trigger");
+MODULE_DESCRIPTION("LED Disk Activity Trigger");
 MODULE_LICENSE("GPL");
diff --git a/drivers/macintosh/Kconfig b/drivers/macintosh/Kconfig
index fd85bde..ac8b1eb 100644
--- a/drivers/macintosh/Kconfig
+++ b/drivers/macintosh/Kconfig
@@ -96,18 +96,17 @@ 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 a disk LED by default"
    depends on ADB_PMU_LED
   depends on LEDS_CLASS
    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"
diff --git a/drivers/macintosh/via-pmu-led.c b/drivers/macintosh/via-pmu-led.c
index d242976..d4631cb 100644
--- a/drivers/macintosh/via-pmu-led.c
+++ b/drivers/macintosh/via-pmu-led.c
@@ -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,
 };
diff --git a/include/linux/leds.h b/include/linux/leds.h
index ba6986a..d7c794d 100644
--- a/include/linux/leds.h
+++ b/include/linux/leds.h
@@ -188,10 +188,10 @@ extern void led_trigger_event(struct led_trigger *trigger,
 #endif
 
 /* 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
-#define ledtrig_ide_activity() do {} while(0)
+#define ledtrig_disk_activity() do {} while(0)
 #endif
 
 /*
--- a/drivers/leds/leds-hp6xx.c
+++ b/drivers/leds/leds-hp6xx.c
@@ -51,7 +51,7 @@
 
 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,
 };
Back to top
View user's profile Send private message
Display posts from previous:   
Reply to topic    Gentoo Forums Forum Index Gentoo on PPC All times are GMT
Page 1 of 1

 
Jump to:  
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum