Search Linux Wireless

[PATCH] compat: use LED blinking HW offload

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

 



From: Johannes Berg <johannes.berg@xxxxxxxxx>

Felix's patch backported my software blink emulation,
but if the kernel is 2.6.25 or newer we can also try
the HW offload first.

Signed-off-by: Johannes Berg <johannes.berg@xxxxxxxxx>
---
 compat/compat-2.6.37.c |    9 ++++++++-
 1 file changed, 8 insertions(+), 1 deletion(-)

--- compat.orig/compat/compat-2.6.37.c	2010-11-28 13:05:01.000000000 +0100
+++ compat/compat/compat-2.6.37.c	2010-11-28 13:05:56.000000000 +0100
@@ -253,9 +253,16 @@ void led_blink_set(struct led_classdev *
 		   unsigned long *delay_on,
 		   unsigned long *delay_off)
 {
-	struct led_timer *led = led_get_timer(led_cdev);
+	struct led_timer *led;
 	int current_brightness;
 
+#if (LINUX_VERSION_CODE >= KERNEL_VERSION(2,6,25))
+	if (led_cdev->blink_set &&
+	    !led_cdev->blink_set(led_cdev, delay_on, delay_off))
+		return;
+#endif
+
+	led = led_get_timer(led_cdev);
 	if (!led) {
 		led = led_new_timer(led_cdev);
 		if (!led)


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


[Index of Archives]     [Linux Host AP]     [ATH6KL]     [Linux Bluetooth]     [Linux Netdev]     [Kernel Newbies]     [Linux Kernel]     [IDE]     [Security]     [Git]     [Netfilter]     [Bugtraq]     [Yosemite News]     [MIPS Linux]     [ARM Linux]     [Linux Security]     [Linux RAID]     [Linux ATA RAID]     [Samba]     [Device Mapper]
  Powered by Linux