LKML Archive on lore.kernel.org
help / color / mirror / Atom feed
From: "Németh Márton" <nm127@freemail.hu>
To: Dmitry Torokhov <dmitry.torokhov@gmail.com>
Cc: linux-input@atrey.karlin.mff.cuni.cz, linux-kernel@vger.kernel.org
Subject: [PATCH] input: extend EV_LED
Date: Sun, 11 Feb 2007 11:02:19 +0100	[thread overview]
Message-ID: <45CEE9AB.2020208@freemail.hu> (raw)


Extend EV_LED handling code so that it can handle not
only two states (on/off) but also others. For example
a LED can blink using hardware acceleration. The code
changed so that it is similar to the code at EV_SND.

Signed-off-by: Márton Németh <nm127@freemail.hu>

---
diff -uprN linux-2.6.20.orig/drivers/input/input.c 
linux/drivers/input/input.c
--- linux-2.6.20.orig/drivers/input/input.c	2007-02-04 
19:44:54.000000000 +0100
+++ linux/drivers/input/input.c	2007-02-10 15:20:28.000000000 +0100
@@ -141,10 +141,11 @@ void input_event(struct input_dev *dev,

  		case EV_LED:

-			if (code > LED_MAX || !test_bit(code, dev->ledbit) || 
!!test_bit(code, dev->led) == value)
+			if (code > LED_MAX || !test_bit(code, dev->ledbit))
  				return;

-			change_bit(code, dev->led);
+			if (!!test_bit(code, dev->led) != !!value)
+				change_bit(code, dev->led);

  			if (dev->event)
  				dev->event(dev, type, code, value);

             reply	other threads:[~2007-02-11 10:17 UTC|newest]

Thread overview: 17+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2007-02-11 10:02 Németh Márton [this message]
2007-02-12 18:31 ` Dmitry Torokhov
2007-02-14 19:06   ` Németh Márton
2007-02-14 19:49     ` Dmitry Torokhov
2007-02-14 23:51       ` Németh Márton
2007-02-15 17:40       ` Pavel Machek
2007-02-15 22:47         ` Németh Márton
2007-02-15 23:09           ` Richard Purdie
2007-02-15 23:24             ` Pavel Machek
2007-02-15 23:36               ` Richard Purdie
2007-02-16  3:12             ` Henrique de Moraes Holschuh
2007-02-18 11:05               ` Richard Purdie
2007-02-18 14:42                 ` Henrique de Moraes Holschuh
2007-02-18  7:45             ` Németh Márton
2007-02-18  8:07               ` Willy Tarreau
2007-02-18 11:12               ` Richard Purdie
2007-02-16 14:04           ` Pavel Machek

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=45CEE9AB.2020208@freemail.hu \
    --to=nm127@freemail.hu \
    --cc=dmitry.torokhov@gmail.com \
    --cc=linux-input@atrey.karlin.mff.cuni.cz \
    --cc=linux-kernel@vger.kernel.org \
    --subject='Re: [PATCH] input: extend EV_LED' \
    /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

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).