Commit 18f7ad59 authored by Dmitry Torokhov's avatar Dmitry Torokhov

Input: keyboard - don't override beep with a bell

The commit 66d2a595 introduces a bug:
for every beep requested, a bell is also generated.
Reported-by: default avatarPaul Martin <pm@debian.org>
Signed-off-by: default avatarDmitry Torokhov <dtor@mail.ru>
parent 909275bc
...@@ -233,7 +233,8 @@ int setkeycode(unsigned int scancode, unsigned int keycode) ...@@ -233,7 +233,8 @@ int setkeycode(unsigned int scancode, unsigned int keycode)
} }
/* /*
* Making beeps and bells. * Making beeps and bells. Note that we prefer beeps to bells, but when
* shutting the sound off we do both.
*/ */
static int kd_sound_helper(struct input_handle *handle, void *data) static int kd_sound_helper(struct input_handle *handle, void *data)
...@@ -242,9 +243,12 @@ static int kd_sound_helper(struct input_handle *handle, void *data) ...@@ -242,9 +243,12 @@ static int kd_sound_helper(struct input_handle *handle, void *data)
struct input_dev *dev = handle->dev; struct input_dev *dev = handle->dev;
if (test_bit(EV_SND, dev->evbit)) { if (test_bit(EV_SND, dev->evbit)) {
if (test_bit(SND_TONE, dev->sndbit)) if (test_bit(SND_TONE, dev->sndbit)) {
input_inject_event(handle, EV_SND, SND_TONE, *hz); input_inject_event(handle, EV_SND, SND_TONE, *hz);
if (test_bit(SND_BELL, handle->dev->sndbit)) if (*hz)
return 0;
}
if (test_bit(SND_BELL, dev->sndbit))
input_inject_event(handle, EV_SND, SND_BELL, *hz ? 1 : 0); input_inject_event(handle, EV_SND, SND_BELL, *hz ? 1 : 0);
} }
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment