Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit 903b126b authored by Vojtech Pavlik's avatar Vojtech Pavlik Committed by Dmitry Torokhov
Browse files

Input: atkbd - handle keyboards generating scancode 0x7f



Extend bat_xl handling to do err_xl handling, so that
keyboards using 0x7f scancode for regular keys can work.

Signed-off-by: default avatarVojtech Pavlik <vojtech@suse.cz>
Signed-off-by: default avatarDmitry Torokhov <dtor@mail.ru>
parent 8a409b01
Loading
Loading
Loading
Loading
+7 −3
Original line number Diff line number Diff line
@@ -208,6 +208,7 @@ struct atkbd {
	unsigned char resend;
	unsigned char release;
	unsigned char bat_xl;
	unsigned char err_xl;
	unsigned int last;
	unsigned long time;
};
@@ -296,15 +297,18 @@ static irqreturn_t atkbd_interrupt(struct serio *serio, unsigned char data,
		if (atkbd->emul ||
		    !(code == ATKBD_RET_EMUL0 || code == ATKBD_RET_EMUL1 ||
		      code == ATKBD_RET_HANGUEL || code == ATKBD_RET_HANJA ||
		      code == ATKBD_RET_ERR ||
		     (code == ATKBD_RET_ERR && !atkbd->err_xl) ||
	             (code == ATKBD_RET_BAT && !atkbd->bat_xl))) {
			atkbd->release = code >> 7;
			code &= 0x7f;
		}

		if (!atkbd->emul &&
		     (code & 0x7f) == (ATKBD_RET_BAT & 0x7f))
		if (!atkbd->emul) {
		     if ((code & 0x7f) == (ATKBD_RET_BAT & 0x7f))
			atkbd->bat_xl = !atkbd->release;
		     if ((code & 0x7f) == (ATKBD_RET_ERR & 0x7f))
			atkbd->err_xl = !atkbd->release;
		}
	}

	switch (code) {