diff mbox

Input: atkbd - correct MSC_SCAN events for force_release keys

Message ID 2075303.cGkXBhvpNe@pebbles.site (mailing list archive)
State New, archived
Headers show

Commit Message

Stefan Brüns Sept. 28, 2014, 9:13 p.m. UTC
Without the change either no scancode would be reported on release
of force_release keys, or - if the key is marked as force_release
erroneously - the release event and the scancode would be reported
in separate reports to the input layer.

Signed-off-by: Stefan Brüns <stefan.bruens@rwth-aachen.de>
---
 drivers/input/keyboard/atkbd.c | 6 ++++--
 1 file changed, 4 insertions(+), 2 deletions(-)

Comments

Stefan Brüns Oct. 17, 2014, 10:48 p.m. UTC | #1
On Sunday, September 28, 2014 11:13:24 PM you wrote:
> Without the change either no scancode would be reported on release
> of force_release keys, or - if the key is marked as force_release
> erroneously - the release event and the scancode would be reported
> in separate reports to the input layer.
> 
> Signed-off-by: Stefan Brüns <stefan.bruens@rwth-aachen.de>
> ---
>  drivers/input/keyboard/atkbd.c | 6 ++++--
>  1 file changed, 4 insertions(+), 2 deletions(-)
> 
> diff --git a/drivers/input/keyboard/atkbd.c b/drivers/input/keyboard/atkbd.c
> index 2dd1d0d..6375ae6 100644
> --- a/drivers/input/keyboard/atkbd.c
> +++ b/drivers/input/keyboard/atkbd.c
> @@ -456,8 +456,9 @@ static irqreturn_t atkbd_interrupt(struct serio *serio, unsigned char data,
>  
>  	keycode = atkbd->keycode[code];
>  
> -	if (keycode != ATKBD_KEY_NULL)
> -		input_event(dev, EV_MSC, MSC_SCAN, code);
> +	if (!(atkbd->release && test_bit(code, atkbd->force_release_mask)))
> +		if (keycode != ATKBD_KEY_NULL)
> +			input_event(dev, EV_MSC, MSC_SCAN, code);
>  
>  	switch (keycode) {
>  	case ATKBD_KEY_NULL:
> @@ -511,6 +512,7 @@ static irqreturn_t atkbd_interrupt(struct serio *serio, unsigned char data,
>  		input_sync(dev);
>  
>  		if (value && test_bit(code, atkbd->force_release_mask)) {
> +			input_event(dev, EV_MSC, MSC_SCAN, code);
>  			input_report_key(dev, keycode, 0);
>  			input_sync(dev);
>  		}
> 

Ping!

Kind regards,

Stefan
Dmitry Torokhov Oct. 23, 2014, 11:44 p.m. UTC | #2
On Sat, Oct 18, 2014 at 12:48:59AM +0200, Stefan Brüns wrote:
> On Sunday, September 28, 2014 11:13:24 PM you wrote:
> > Without the change either no scancode would be reported on release
> > of force_release keys, or - if the key is marked as force_release
> > erroneously - the release event and the scancode would be reported
> > in separate reports to the input layer.
> > 
> > Signed-off-by: Stefan Brüns <stefan.bruens@rwth-aachen.de>
> > ---
> >  drivers/input/keyboard/atkbd.c | 6 ++++--
> >  1 file changed, 4 insertions(+), 2 deletions(-)
> > 
> > diff --git a/drivers/input/keyboard/atkbd.c b/drivers/input/keyboard/atkbd.c
> > index 2dd1d0d..6375ae6 100644
> > --- a/drivers/input/keyboard/atkbd.c
> > +++ b/drivers/input/keyboard/atkbd.c
> > @@ -456,8 +456,9 @@ static irqreturn_t atkbd_interrupt(struct serio *serio, unsigned char data,
> >  
> >  	keycode = atkbd->keycode[code];
> >  
> > -	if (keycode != ATKBD_KEY_NULL)
> > -		input_event(dev, EV_MSC, MSC_SCAN, code);
> > +	if (!(atkbd->release && test_bit(code, atkbd->force_release_mask)))
> > +		if (keycode != ATKBD_KEY_NULL)
> > +			input_event(dev, EV_MSC, MSC_SCAN, code);
> >  
> >  	switch (keycode) {
> >  	case ATKBD_KEY_NULL:
> > @@ -511,6 +512,7 @@ static irqreturn_t atkbd_interrupt(struct serio *serio, unsigned char data,
> >  		input_sync(dev);
> >  
> >  		if (value && test_bit(code, atkbd->force_release_mask)) {
> > +			input_event(dev, EV_MSC, MSC_SCAN, code);
> >  			input_report_key(dev, keycode, 0);
> >  			input_sync(dev);
> >  		}
> > 
> 
> Ping!
> 
> Kind regards,

I do not see the original patch mail, could you please resend (and CC
me)?

Thanks.
diff mbox

Patch

diff --git a/drivers/input/keyboard/atkbd.c b/drivers/input/keyboard/atkbd.c
index 2dd1d0d..6375ae6 100644
--- a/drivers/input/keyboard/atkbd.c
+++ b/drivers/input/keyboard/atkbd.c
@@ -456,8 +456,9 @@  static irqreturn_t atkbd_interrupt(struct serio *serio, unsigned char data,
 
 	keycode = atkbd->keycode[code];
 
-	if (keycode != ATKBD_KEY_NULL)
-		input_event(dev, EV_MSC, MSC_SCAN, code);
+	if (!(atkbd->release && test_bit(code, atkbd->force_release_mask)))
+		if (keycode != ATKBD_KEY_NULL)
+			input_event(dev, EV_MSC, MSC_SCAN, code);
 
 	switch (keycode) {
 	case ATKBD_KEY_NULL:
@@ -511,6 +512,7 @@  static irqreturn_t atkbd_interrupt(struct serio *serio, unsigned char data,
 		input_sync(dev);
 
 		if (value && test_bit(code, atkbd->force_release_mask)) {
+			input_event(dev, EV_MSC, MSC_SCAN, code);
 			input_report_key(dev, keycode, 0);
 			input_sync(dev);
 		}