[PATCH 44/49] rc-core: don't report scancodes via input devices

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

 



The scancode that is reported via the input device(s) is now incomplete
(missing the protocol) and redundant.

Signed-off-by: David Härdeman <david@xxxxxxxxxxx>
---
 drivers/media/rc/rc-keytable.c |   21 +++++----------------
 1 file changed, 5 insertions(+), 16 deletions(-)

diff --git a/drivers/media/rc/rc-keytable.c b/drivers/media/rc/rc-keytable.c
index 5709ae6..23a66c7 100644
--- a/drivers/media/rc/rc-keytable.c
+++ b/drivers/media/rc/rc-keytable.c
@@ -645,17 +645,10 @@ void rc_keytable_repeat(struct rc_keytable *kt)
 	unsigned long flags;
 
 	spin_lock_irqsave(&kt->key_lock, flags);
-
-	input_event(kt->idev, EV_MSC, MSC_SCAN, kt->last_scancode);
-	input_sync(kt->idev);
-
-	if (!kt->key_pressed)
-		goto out;
-
-	kt->keyup_jiffies = jiffies + msecs_to_jiffies(RC_KEYPRESS_TIMEOUT);
-	mod_timer(&kt->timer_keyup, kt->keyup_jiffies);
-
-out:
+	if (kt->key_pressed) {
+		kt->keyup_jiffies = jiffies + msecs_to_jiffies(RC_KEYPRESS_TIMEOUT);
+		mod_timer(&kt->timer_keyup, kt->keyup_jiffies);
+	}
 	spin_unlock_irqrestore(&kt->key_lock, flags);
 }
 
@@ -695,8 +688,6 @@ void rc_keytable_keydown(struct rc_keytable *kt, enum rc_type protocol,
 	if (new_event)
 		rc_do_keyup(kt, false);
 
-	input_event(kt->idev, EV_MSC, MSC_SCAN, scancode);
-
 	if (new_event && keycode != KEY_RESERVED) {
 		/* Register a keypress */
 		kt->key_pressed = true;
@@ -710,8 +701,8 @@ void rc_keytable_keydown(struct rc_keytable *kt, enum rc_type protocol,
 			   kt->dev->input_name, keycode, protocol,
 			   (long long unsigned)scancode);
 		input_report_key(kt->idev, keycode, 1);
+		input_sync(kt->idev);
 	}
-	input_sync(kt->idev);
 
 	if (autoup && kt->key_pressed) {
 		kt->keyup_jiffies = jiffies + msecs_to_jiffies(RC_KEYPRESS_TIMEOUT);
@@ -811,8 +802,6 @@ struct rc_keytable *rc_keytable_create(struct rc_dev *dev, const char *name,
 	idev->close = rc_input_close;
 	set_bit(EV_KEY, idev->evbit);
 	set_bit(EV_REP, idev->evbit);
-	set_bit(EV_MSC, idev->evbit);
-	set_bit(MSC_SCAN, idev->mscbit);
 	input_set_drvdata(idev, kt);
 	setup_timer(&kt->timer_keyup, rc_timer_keyup, (unsigned long)kt);
 

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




[Index of Archives]     [Linux Input]     [Video for Linux]     [Gstreamer Embedded]     [Mplayer Users]     [Linux USB Devel]     [Linux Audio Users]     [Linux Kernel]     [Linux SCSI]     [Yosemite Backpacking]
  Powered by Linux