Felix's patch backported my software blink emulation,
authorJohannes Berg <johannes.berg@intel.com>
Sun, 28 Nov 2010 12:17:00 +0000 (13:17 +0100)
committerLuis R. Rodriguez <lrodriguez@atheros.com>
Mon, 29 Nov 2010 21:53:15 +0000 (13:53 -0800)
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@intel.com>
compat/compat-2.6.37.c

index 669402d..48707ff 100644 (file)
@@ -253,9 +253,16 @@ void led_blink_set(struct led_classdev *led_cdev,
                   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)