All of lore.kernel.org
 help / color / mirror / Atom feed
From: Johannes Berg <johannes@sipsolutions.net>
To: Felix Fietkau <nbd@openwrt.org>
Cc: linux-wireless@vger.kernel.org, lrodriguez@atheros.com
Subject: [PATCH] compat: use LED blinking HW offload
Date: Sun, 28 Nov 2010 13:17:00 +0100	[thread overview]
Message-ID: <1290946620.3467.6.camel@jlt3.sipsolutions.net> (raw)
In-Reply-To: <1290945916-95814-1-git-send-email-nbd@openwrt.org>

From: Johannes Berg <johannes.berg@intel.com>

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@intel.com>
---
 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)



  reply	other threads:[~2010-11-28 12:17 UTC|newest]

Thread overview: 7+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2010-11-28 12:05 [PATCH] compat: backport LED class software blinking Felix Fietkau
2010-11-28 12:17 ` Johannes Berg [this message]
2010-11-29 21:53   ` [PATCH] compat: use LED blinking HW offload Luis R. Rodriguez
2010-11-29 21:52 ` [PATCH] compat: backport LED class software blinking Luis R. Rodriguez
2010-12-02 13:14 ` Walter Goldens
2010-12-02 15:27   ` Felix Fietkau
2010-12-02 16:35     ` Walter Goldens

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=1290946620.3467.6.camel@jlt3.sipsolutions.net \
    --to=johannes@sipsolutions.net \
    --cc=linux-wireless@vger.kernel.org \
    --cc=lrodriguez@atheros.com \
    --cc=nbd@openwrt.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.