+ led-add-led-heartbeat-trigger-update.patch added to -mm tree

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



The patch titled

     LED: add LED heartbeat trigger (update)

has been added to the -mm tree.  Its filename is

     led-add-led-heartbeat-trigger-update.patch

See http://www.zip.com.au/~akpm/linux/patches/stuff/added-to-mm.txt to find
out what to do about this

------------------------------------------------------
Subject: LED: add LED heartbeat trigger (update)
From: Atsushi Nemoto <anemo@xxxxxxxxxxxxx>


Signed-off-by: Atsushi Nemoto <anemo@xxxxxxxxxxxxx>
Signed-off-by: Andrew Morton <akpm@xxxxxxxx>
---

 drivers/leds/Kconfig             |    2 +-
 drivers/leds/ledtrig-heartbeat.c |   24 ++++++++++++------------
 2 files changed, 13 insertions(+), 13 deletions(-)

diff -puN drivers/leds/Kconfig~led-add-led-heartbeat-trigger-update drivers/leds/Kconfig
--- a/drivers/leds/Kconfig~led-add-led-heartbeat-trigger-update
+++ a/drivers/leds/Kconfig
@@ -98,7 +98,7 @@ config LEDS_TRIGGER_HEARTBEAT
 	depends LEDS_TRIGGERS
 	help
 	  This allows LEDs to be controlled by a CPU load average.
-	  The flash frequency is a hyperbolic function of the 5-minute
+	  The flash frequency is a hyperbolic function of the 1-minute
 	  load average.
 	  If unsure, say Y.
 
diff -puN drivers/leds/ledtrig-heartbeat.c~led-add-led-heartbeat-trigger-update drivers/leds/ledtrig-heartbeat.c
--- a/drivers/leds/ledtrig-heartbeat.c~led-add-led-heartbeat-trigger-update
+++ a/drivers/leds/ledtrig-heartbeat.c
@@ -38,28 +38,29 @@ static void led_heartbeat_function(unsig
 		/*
 		 * The hyperbolic function below modifies the
 		 * heartbeat period length in dependency of the
-		 * current (5min) load. It goes through the points
-		 * f(0)=126, f(1)=86, f(5)=51, f(inf)->30.
+		 * current (1min) load. It goes through the points
+		 * f(0)=1260, f(1)=860, f(5)=510, f(inf)->300.
 		 */
-		heartbeat_data->period = 30 +
-			(672 << FSHIFT) / (5 * avenrun[0] + (7 << FSHIFT));
-		heartbeat_data->period = heartbeat_data->period * HZ / 100;
-		delay = 7 * HZ / 100;
+		heartbeat_data->period = 300 +
+			(6720 << FSHIFT) / (5 * avenrun[0] + (7 << FSHIFT));
+		heartbeat_data->period =
+			msecs_to_jiffies(heartbeat_data->period);
+		delay = msecs_to_jiffies(70);
 		heartbeat_data->phase++;
 		brightness = LED_FULL;
 		break;
 	case 1:
-		delay = heartbeat_data->period / 4 - 7 * HZ / 100;
+		delay = heartbeat_data->period / 4 - msecs_to_jiffies(70);
 		heartbeat_data->phase++;
 		break;
 	case 2:
-		delay = 7 * HZ / 100;
+		delay = msecs_to_jiffies(70);
 		heartbeat_data->phase++;
 		brightness = LED_FULL;
 		break;
 	default:
 		delay = heartbeat_data->period - heartbeat_data->period / 4 -
-			7 * HZ / 100;
+			msecs_to_jiffies(70);
 		heartbeat_data->phase = 0;
 		break;
 	}
@@ -77,9 +78,8 @@ static void heartbeat_trig_activate(stru
 		return;
 
 	led_cdev->trigger_data = heartbeat_data;
-	init_timer(&heartbeat_data->timer);
-	heartbeat_data->timer.function = led_heartbeat_function;
-	heartbeat_data->timer.data = (unsigned long) led_cdev;
+	setup_timer(&heartbeat_data->timer,
+		    led_heartbeat_function, (unsigned long) led_cdev);
 	heartbeat_data->phase = 0;
 	led_heartbeat_function(heartbeat_data->timer.data);
 }
_

Patches currently in -mm which might be from anemo@xxxxxxxxxxxxx are

origin.patch
git-cryptodev.patch
fix-broken-vm86-interrupt-signal-handling.patch
rtc-rtc-dev-uie-emulation.patch
led-add-led-heartbeat-trigger.patch
led-add-led-heartbeat-trigger-update.patch

-
To unsubscribe from this list: send the line "unsubscribe mm-commits" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at  http://vger.kernel.org/majordomo-info.html

[Index of Archives]     [Kernel Newbies FAQ]     [Kernel Archive]     [IETF Annouce]     [DCCP]     [Netdev]     [Networking]     [Security]     [Bugtraq]     [Photo]     [Yosemite]     [MIPS Linux]     [ARM Linux]     [Linux Security]     [Linux RAID]     [Linux SCSI]

  Powered by Linux