This patch series extends hid-input to support features commonly present
in USB HID headsets:
1. Mic mute button and LED.
2. Answer/hangup button and ring/offhook LED(s).
These buttons and LEDs are exposed using standard event device
interfaces. It allows the VoIP applications in userspace to use the new
functionality in a generic device-independent fashion.
This series also contains patches for hid-plantronics and hid-jabra to
expose the new functionality and work around some hardware quirks, and a
fix to hid-input for an issue that prevents the new LED functionality to
work with certain headsets.
Although checkpatch compains about a few lines, they preserve the same
formatting that already exists in hid-input.c.
Maxim Mikityanskiy (6):
HID: hid-input: Add offhook and ring LEDs for headsets
HID: hid-input: Add phone hook and mic mute buttons for headsets
HID: plantronics: Expose headset LEDs
HID: plantronics: Expose headset telephony buttons
HID: hid-input: Update LEDs in all HID reports
HID: jabra: Change mute LED state to avoid missing key press events
drivers/hid/hid-input.c | 183 +++++++++++++++++++++++--
drivers/hid/hid-jabra.c | 35 +++++
drivers/hid/hid-plantronics.c | 6 +
drivers/input/input-leds.c | 2 +
include/uapi/linux/input-event-codes.h | 10 ++
5 files changed, 225 insertions(+), 11 deletions(-)
--
2.32.0
A lot of USBHID headsets available on the market have LEDs that indicate
ringing and off-hook states when used with VoIP applications. This
commit exposes these LEDs via the standard sysfs interface.
Signed-off-by: Maxim Mikityanskiy <redacted>
---
drivers/hid/hid-input.c | 2 ++
drivers/input/input-leds.c | 2 ++
include/uapi/linux/input-event-codes.h | 2 ++
3 files changed, 6 insertions(+)
From: Benjamin Tissoires <hidden> Date: 2021-07-06 08:02:54
Hi Maxim,
On Sun, Jul 4, 2021 at 12:02 AM Maxim Mikityanskiy [off-list ref] wrote:
quoted hunk
A lot of USBHID headsets available on the market have LEDs that indicate
ringing and off-hook states when used with VoIP applications. This
commit exposes these LEDs via the standard sysfs interface.
Signed-off-by: Maxim Mikityanskiy <redacted>
---
drivers/hid/hid-input.c | 2 ++
drivers/input/input-leds.c | 2 ++
include/uapi/linux/input-event-codes.h | 2 ++
3 files changed, 6 insertions(+)
A lot of USBHID headsets available on the market have LEDs that indicate
ringing and off-hook states when used with VoIP applications. This
commit exposes these LEDs via the standard sysfs interface.
Signed-off-by: Maxim Mikityanskiy <redacted>
---
drivers/hid/hid-input.c | 2 ++
drivers/input/input-leds.c | 2 ++
include/uapi/linux/input-event-codes.h | 2 ++
3 files changed, 6 insertions(+)
On Thu, Jul 15, 2021 at 08:57:44PM +0200, Jiri Kosina wrote:
On Tue, 6 Jul 2021, Benjamin Tissoires wrote:
quoted
quoted
A lot of USBHID headsets available on the market have LEDs that indicate
ringing and off-hook states when used with VoIP applications. This
commit exposes these LEDs via the standard sysfs interface.
Signed-off-by: Maxim Mikityanskiy <redacted>
---
drivers/hid/hid-input.c | 2 ++
drivers/input/input-leds.c | 2 ++
include/uapi/linux/input-event-codes.h | 2 ++
3 files changed, 6 insertions(+)
I am pretty sure this also needs to be reviewed by the led folks.
Adding them in Cc.
Can we please get Ack from the LED maintainers? Thanks.
I do not think we should be adding more LED bits to the input
subsystem/events; this functionality should be routed purely though LED
subsystem. input-leds is a bridge for legacy input functionality
reflecting it onto the newer LED subsystem.
Thanks.
--
Dmitry
From: Pavel Machek <hidden> Date: 2021-07-15 22:49:10
On Thu 2021-07-15 13:39:26, Dmitry Torokhov wrote:
On Thu, Jul 15, 2021 at 08:57:44PM +0200, Jiri Kosina wrote:
quoted
On Tue, 6 Jul 2021, Benjamin Tissoires wrote:
quoted
quoted
A lot of USBHID headsets available on the market have LEDs that indicate
ringing and off-hook states when used with VoIP applications. This
commit exposes these LEDs via the standard sysfs interface.
I am pretty sure this also needs to be reviewed by the led folks.
Adding them in Cc.
Can we please get Ack from the LED maintainers? Thanks.
I do not think we should be adding more LED bits to the input
subsystem/events; this functionality should be routed purely though LED
subsystem. input-leds is a bridge for legacy input functionality
reflecting it onto the newer LED subsystem.
If we do it purely through the LED subsystem, will it get trickier to
associate the devices?
Anyway, it is a headset. What does headset have to do with input
subsystem? Sounds like sound device to me... And we already have a
"micmute" LED which sounds quite similar to the "offhook" LED... no?
Best regards,
Pavel
--
http://www.livejournal.com/~pavelmachek
On Fri, Jul 16, 2021 at 1:49 AM Pavel Machek [off-list ref] wrote:
On Thu 2021-07-15 13:39:26, Dmitry Torokhov wrote:
quoted
On Thu, Jul 15, 2021 at 08:57:44PM +0200, Jiri Kosina wrote:
quoted
On Tue, 6 Jul 2021, Benjamin Tissoires wrote:
quoted
quoted
A lot of USBHID headsets available on the market have LEDs that indicate
ringing and off-hook states when used with VoIP applications. This
commit exposes these LEDs via the standard sysfs interface.
I am pretty sure this also needs to be reviewed by the led folks.
Adding them in Cc.
Can we please get Ack from the LED maintainers? Thanks.
I do not think we should be adding more LED bits to the input
subsystem/events; this functionality should be routed purely though LED
subsystem. input-leds is a bridge for legacy input functionality
reflecting it onto the newer LED subsystem.
I'm a bit confused by this answer. I wasn't aware that input-leds was
some legacy stuff. Moreover, hid-input only handles LEDs through
input-leds, it doesn't use any modern replacement. So, does your
answer mean I need to implement this replacement? If so, I anticipate
some issues with this approach:
1. hid-input will handle different LEDs in different ways, which will
make code complicated and error-prone. There will be two parallel
implementations for LEDs.
2. A lot of code will be similar with input-leds, but not shared/reused.
3. New driver callbacks may be needed if drivers want to override the
default behavior, like they do with input_mapping/input_mapped.
4. If some hypothetical input device is a headset, but not HID, it
won't be able to reuse the LED handling code. With input-leds it
wouldn't be a problem.
5. (Minor) LED_MUTE is already there. If we handle LED_OFFHOOK and
LED_RING in a different way, it would be confusing.
Let's discuss the architecture before I write any new code, if we are
going to take this way. However, to me, input-leds looks like a better
fit: the implementation is much simpler and follows existing patterns,
and it integrates well with drivers and hid-input. If we throw away
input-leds, we'll have to do its job ourselves, and if we throw it
away only for part of LEDs, the code will likely be ugly.
If we do it purely through the LED subsystem, will it get trickier to
associate the devices?
I agree with this point. With the current approach, it's easy to look
up all LEDs of an input device. If the suggested approach makes it
hard, it's a serious drawback.
Anyway, it is a headset. What does headset have to do with input
subsystem? Sounds like sound device to me...
That's right, the main function of a headset is of course sound, but
such headsets also have buttons (vol up/down, mic mute, answer the
call) and LEDs (mic muted, ringing, offhook). The sound "subdevice"
(sorry, I'm not really familiar with USB terminology) is handled by
snd-usb-audio, and the buttons/LEDs are handled by usbhid.
Two examples of such headsets are mentioned in commit messages in this
patch series. Such headsets are usually "certified for skype for
business", but of course can be used with a variety of other VoIP
applications. The goal of this series is to provide a standard
interface between headsets and userspace applications, so that VoIP
applications could react to buttons and set LED state, making Linux
more ready for desktop.
And we already have a
"micmute" LED which sounds quite similar to the "offhook" LED... no?
These two are different. A typical headset has three LEDs: micmute,
ring and offhook (ring and offhook are often one physical LED, which
blinks in the ring state and glows constantly in the offhook state).
Offhook indicates that a call is in progress, while micmute shows that
the microphone is muted. These two states are orthogonal and may
happen in any combination. On the tested devices, offhook state didn't
affect sound, it was just a logical indication of an active call.
If you are interested in more details, I can describe the behavior of
the headsets that I tested (some info is actually in the commit
messages), but the short answer is that micmute and offhook are two
different physical LEDs with completely different functions.
Dmitry, what's your opinion on the points that I raised? I would like
to progress with this patch set, let's discuss the direction and sum
up the requirements.
On Fri, Jul 16, 2021 at 8:23 PM Maxim Mikityanskiy [off-list ref] wrote:
On Fri, Jul 16, 2021 at 1:49 AM Pavel Machek [off-list ref] wrote:
quoted
On Thu 2021-07-15 13:39:26, Dmitry Torokhov wrote:
quoted
On Thu, Jul 15, 2021 at 08:57:44PM +0200, Jiri Kosina wrote:
quoted
On Tue, 6 Jul 2021, Benjamin Tissoires wrote:
quoted
quoted
A lot of USBHID headsets available on the market have LEDs that indicate
ringing and off-hook states when used with VoIP applications. This
commit exposes these LEDs via the standard sysfs interface.
I am pretty sure this also needs to be reviewed by the led folks.
Adding them in Cc.
Can we please get Ack from the LED maintainers? Thanks.
I do not think we should be adding more LED bits to the input
subsystem/events; this functionality should be routed purely though LED
subsystem. input-leds is a bridge for legacy input functionality
reflecting it onto the newer LED subsystem.
I'm a bit confused by this answer. I wasn't aware that input-leds was
some legacy stuff. Moreover, hid-input only handles LEDs through
input-leds, it doesn't use any modern replacement. So, does your
answer mean I need to implement this replacement? If so, I anticipate
some issues with this approach:
1. hid-input will handle different LEDs in different ways, which will
make code complicated and error-prone. There will be two parallel
implementations for LEDs.
2. A lot of code will be similar with input-leds, but not shared/reused.
3. New driver callbacks may be needed if drivers want to override the
default behavior, like they do with input_mapping/input_mapped.
4. If some hypothetical input device is a headset, but not HID, it
won't be able to reuse the LED handling code. With input-leds it
wouldn't be a problem.
5. (Minor) LED_MUTE is already there. If we handle LED_OFFHOOK and
LED_RING in a different way, it would be confusing.
Let's discuss the architecture before I write any new code, if we are
going to take this way. However, to me, input-leds looks like a better
fit: the implementation is much simpler and follows existing patterns,
and it integrates well with drivers and hid-input. If we throw away
input-leds, we'll have to do its job ourselves, and if we throw it
away only for part of LEDs, the code will likely be ugly.
quoted
If we do it purely through the LED subsystem, will it get trickier to
associate the devices?
I agree with this point. With the current approach, it's easy to look
up all LEDs of an input device. If the suggested approach makes it
hard, it's a serious drawback.
quoted
Anyway, it is a headset. What does headset have to do with input
subsystem? Sounds like sound device to me...
That's right, the main function of a headset is of course sound, but
such headsets also have buttons (vol up/down, mic mute, answer the
call) and LEDs (mic muted, ringing, offhook). The sound "subdevice"
(sorry, I'm not really familiar with USB terminology) is handled by
snd-usb-audio, and the buttons/LEDs are handled by usbhid.
Two examples of such headsets are mentioned in commit messages in this
patch series. Such headsets are usually "certified for skype for
business", but of course can be used with a variety of other VoIP
applications. The goal of this series is to provide a standard
interface between headsets and userspace applications, so that VoIP
applications could react to buttons and set LED state, making Linux
more ready for desktop.
quoted
And we already have a
"micmute" LED which sounds quite similar to the "offhook" LED... no?
These two are different. A typical headset has three LEDs: micmute,
ring and offhook (ring and offhook are often one physical LED, which
blinks in the ring state and glows constantly in the offhook state).
Offhook indicates that a call is in progress, while micmute shows that
the microphone is muted. These two states are orthogonal and may
happen in any combination. On the tested devices, offhook state didn't
affect sound, it was just a logical indication of an active call.
If you are interested in more details, I can describe the behavior of
the headsets that I tested (some info is actually in the commit
messages), but the short answer is that micmute and offhook are two
different physical LEDs with completely different functions.
Dmitry, what's your opinion on the points that I raised? I would like
to progress with this patch set, let's discuss the direction and sum
up the requirements.
Friendly ping on this one :) Thanks.
--
Jiri Kosina
SUSE Labs
Hi,
On Fri, Jul 16, 2021 at 08:23:02PM +0300, Maxim Mikityanskiy wrote:
Sorry for disappearing for a while.
On Fri, Jul 16, 2021 at 1:49 AM Pavel Machek [off-list ref] wrote:
quoted
On Thu 2021-07-15 13:39:26, Dmitry Torokhov wrote:
quoted
On Thu, Jul 15, 2021 at 08:57:44PM +0200, Jiri Kosina wrote:
quoted
On Tue, 6 Jul 2021, Benjamin Tissoires wrote:
quoted
quoted
A lot of USBHID headsets available on the market have LEDs that indicate
ringing and off-hook states when used with VoIP applications. This
commit exposes these LEDs via the standard sysfs interface.
I am pretty sure this also needs to be reviewed by the led folks.
Adding them in Cc.
Can we please get Ack from the LED maintainers? Thanks.
I do not think we should be adding more LED bits to the input
subsystem/events; this functionality should be routed purely though LED
subsystem. input-leds is a bridge for legacy input functionality
reflecting it onto the newer LED subsystem.
I'm a bit confused by this answer. I wasn't aware that input-leds was
some legacy stuff.
Yes, input-leds provides bridge from legacy leds defined in input
subsystem over to proper LED subsystem that we have now. Now that we
have proper LED subsystem all new LEDs should be introduced via it.
Especially given that some of the LEDs defined in HID have little
relation to input (Printer Out of Paper, Battery OK, RGB LEDs, etc).
Moreover, hid-input only handles LEDs through
input-leds, it doesn't use any modern replacement. So, does your
answer mean I need to implement this replacement?
Yes.
If so, I anticipate
some issues with this approach:
1. hid-input will handle different LEDs in different ways, which will
make code complicated and error-prone. There will be two parallel
implementations for LEDs.
Yes you will need to route currently defined input LEDs as they are now
to keep compatibility with existing userspace, and new LEDs should be
registered directly.
2. A lot of code will be similar with input-leds, but not shared/reused.
Hmm, not really. I mean you will need to call to register LEDs and
toggle them, but that's the same as any other driver registering LEDs.
3. New driver callbacks may be needed if drivers want to override the
default behavior, like they do with input_mapping/input_mapped.
OK.
4. If some hypothetical input device is a headset, but not HID, it
won't be able to reuse the LED handling code. With input-leds it
wouldn't be a problem.
We have a lot of non-HID touchpads, touchscreens, mice, joysticks, etc
that do it for all other data. LEDs are not different.
5. (Minor) LED_MUTE is already there. If we handle LED_OFFHOOK and
LED_RING in a different way, it would be confusing.
Not to userspace that uses LED subsystem. And I admit that adding LEDs
beyond keyboard indicators was a mistake (but we did not have proper LED
subsystem back then).
Let's discuss the architecture before I write any new code, if we are
going to take this way. However, to me, input-leds looks like a better
fit: the implementation is much simpler and follows existing patterns,
and it integrates well with drivers and hid-input. If we throw away
input-leds, we'll have to do its job ourselves, and if we throw it
away only for part of LEDs, the code will likely be ugly.
I think it will be OK. You just need to note how each led should be
routed, and then call appropriate API when handling events.
quoted
If we do it purely through the LED subsystem, will it get trickier to
associate the devices?
I agree with this point. With the current approach, it's easy to look
up all LEDs of an input device. If the suggested approach makes it
hard, it's a serious drawback.
You already need to deal with composite devices and figure a way to
associate all parts of them. And you already need to locate LED devices
associated with the input device because you are supposed to interface
via LED subsystem and not input (i.e. new applications should not be
using EVIOCGLED and writing EV_LED to evdev to control LEDs).
quoted
Anyway, it is a headset. What does headset have to do with input
subsystem? Sounds like sound device to me...
That's right, the main function of a headset is of course sound, but
such headsets also have buttons (vol up/down, mic mute, answer the
call) and LEDs (mic muted, ringing, offhook). The sound "subdevice"
(sorry, I'm not really familiar with USB terminology) is handled by
snd-usb-audio, and the buttons/LEDs are handled by usbhid.
Two examples of such headsets are mentioned in commit messages in this
patch series. Such headsets are usually "certified for skype for
business", but of course can be used with a variety of other VoIP
applications. The goal of this series is to provide a standard
interface between headsets and userspace applications, so that VoIP
applications could react to buttons and set LED state, making Linux
more ready for desktop.
quoted
And we already have a
"micmute" LED which sounds quite similar to the "offhook" LED... no?
These two are different. A typical headset has three LEDs: micmute,
ring and offhook (ring and offhook are often one physical LED, which
blinks in the ring state and glows constantly in the offhook state).
Offhook indicates that a call is in progress, while micmute shows that
the microphone is muted. These two states are orthogonal and may
happen in any combination. On the tested devices, offhook state didn't
affect sound, it was just a logical indication of an active call.
If you are interested in more details, I can describe the behavior of
the headsets that I tested (some info is actually in the commit
messages), but the short answer is that micmute and offhook are two
different physical LEDs with completely different functions.
A lot of USBHID headsets available on the market have buttons to toggle
microphone mute and to answer the call/hang up.
According to the HID Usage Tables specification, these usages are on/off
controls, which may be presented by either two buttons, a single toggle
button or a mechanical switch. This commit adds a function called
hidinput_handle_onoff that handles all these cases in a compliant way.
Signed-off-by: Maxim Mikityanskiy <redacted>
---
drivers/hid/hid-input.c | 140 +++++++++++++++++++++++++
include/uapi/linux/input-event-codes.h | 8 ++
2 files changed, 148 insertions(+)
@@ -1314,6 +1358,92 @@ static void hidinput_handle_scroll(struct hid_usage *usage,input_event(input,EV_REL,usage->code,hi_res);}+/**+*hidinput_handle_onoff-Handleon/offcontrol(OOC).+*@field:HIDfieldthatcorrespondstotheevent.+*@value:HIDvaluethatcorrespondstotheevent.+*@code_toggle:Keycodetosendwhentogglingstateoftheon/offcontrol.+*@code_on:Keycodetosendwhenturningontheon/offcontrol.+*@code_off:Keycodetosendwhenturningofftheon/offcontrol.+*+*Returnstrueiftheeventwashandled,falseifthe@fieldflagsareinvalid.+*+*Handleson/offcontrol(OOC),asdefinedbyHIDUsageTables1.21(3.4.1.2).+*DeterminesthetypeoftheOOCbylookingat@fieldandsendsoneofthekey+*codesaccordingly.Wheneverit'spossibletodistinguishonandoffstates,+*differentkeystrokes(@code_on,@code_off)aresent,otherwise@code_toggle+*issent.+*/+staticboolhidinput_handle_onoff(structhid_field*field,__s32value,unsignedintscan,+__u16code_toggle,__u16code_on,__u16code_off)+{+structinput_dev*input=field->hidinput->input;+__u16code=0;++/* Two buttons, on and off */+if((field->flags&HID_MAIN_ITEM_RELATIVE)&&+(field->flags&HID_MAIN_ITEM_NO_PREFERRED)&&+(field->logical_minimum==-1)&&+(field->logical_maximum==1)){+if(value!=1&&value!=-1)+returntrue;++code=value==1?code_on:code_off;+}++/* A single button that toggles the on/off state each time it is pressed */+if((field->flags&HID_MAIN_ITEM_RELATIVE)&&+!(field->flags&HID_MAIN_ITEM_NO_PREFERRED)&&+(field->logical_minimum==0)&&+(field->logical_maximum==1)){+if(value!=1)+returntrue;++code=code_toggle;+}++/* A toggle switch that maintains the on/off state mechanically */+if(!(field->flags&HID_MAIN_ITEM_RELATIVE)&&+(field->flags&HID_MAIN_ITEM_NO_PREFERRED)&&+(field->logical_minimum==0)&&+(field->logical_maximum==1))+code=value?code_on:code_off;++if(!code)+returnfalse;++input_event(input,EV_MSC,MSC_SCAN,scan);+input_event(input,EV_KEY,code,1);+input_sync(input);+input_event(input,EV_KEY,code,0);++returntrue;+}++/**+*hidinput_handle_onoffs-HandlesanOOCeventiftheHIDusagetypeisOOC.+*@usage:HIDusagetocheck.+*@field:HIDfieldthatcorrespondstotheevent.+*@value:HIDvaluethatcorrespondstotheevent.+*+*Returns:1if@usageisasupportedon/offcontrol(OOC),asdefinedbyHID+*UsageTables1.21(3.4.1.2).+*0if@usageisnotasupportedOOC.+*-EINVALif@usageisnotavalidOOC(@fieldisinvalid).+*/+staticinthidinput_handle_onoffs(structhid_usage*usage,structhid_field*field,__s32value)+{+u16code_on,code_off;++if(!hidinput_get_onoff_keycodes(usage,&code_on,&code_off))+return0;++if(!hidinput_handle_onoff(field,value,usage->hid,usage->code,code_on,code_off))+return-EINVAL;++return1;+}+voidhidinput_hid_event(structhid_device*hid,structhid_field*field,structhid_usage*usage,__s32value){structinput_dev*input;
@@ -1438,6 +1568,16 @@ void hidinput_hid_event(struct hid_device *hid, struct hid_field *field, structvalue==field->value[usage->usage_index])return;+switch(hidinput_handle_onoffs(usage,field,value)){+case1:+return;+case-EINVAL:+hid_warn_once(hid,"Invalid OOC usage: code %u, flags %#x, min %d, max %d\n",+usage->code,field->flags,+field->logical_minimum,field->logical_maximum);+return;+}+/* report the usage code as scancode if the key status has changed */if(usage->type==EV_KEY&&(!test_bit(usage->code,input->key))==value)
@@ -660,6 +661,13 @@/* Select an area of screen to be copied */#define KEY_SELECTIVE_SCREENSHOT 0x27a+/*+*IncontrasttoKEY_MICMUTE(thattogglesthemutestate),thesesetspecific+*(on/off)states.+*/+#define KEY_MICMUTE_ON 0x280+#define KEY_MICMUTE_OFF 0x281+/**Somekeyboardshavekeyswhichdonothaveadefinedmeaning,thesekeys*areintendedtobeprogrammed/boundtomacrosbytheuser.Formost
hid-plantronics uses a custom input mapping, where unhandled usages get
ignored. Although these headsets have LEDs, they aren't handled in
plantronics_input_mapping, hence not exposed to the userspace. This
commit fixes it by adding a case for HID_UP_LED.
Tested with Plantronics Blackwire 3220 Series (047f:c056).
Signed-off-by: Maxim Mikityanskiy <redacted>
---
drivers/hid/hid-plantronics.c | 4 ++++
1 file changed, 4 insertions(+)
hid-plantronics uses a custom input mapping, where unhandled usages get
ignored. Although these headsets have telephony buttons (microphone mute
and answer/hangup), they are not handled in plantronics_input_mapping,
hence not exposed to the userspace. This commit fixes it by adding a
case for HID_UP_TELEPHONY to the "basic telephony compliant" devices.
Tested with Plantronics Blackwire 3220 Series (047f:c056).
Signed-off-by: Maxim Mikityanskiy <redacted>
---
drivers/hid/hid-plantronics.c | 2 ++
1 file changed, 2 insertions(+)
@@ -84,6 +84,8 @@ static int plantronics_input_mapping(struct hid_device *hdev,(plt_type&HID_USAGE)!=PLT_BASIC_EXCEPTION){if(PLT_ALLOW_CONSUMER)gotodefaulted;+if((usage->hid&HID_USAGE_PAGE)==HID_UP_TELEPHONY)+gotodefaulted;}/* not 'basic telephony' - apply legacy mapping *//* only map if the field is in the device's primary vendor page */
hidinput_led_worker is scheduled on a work queue to update all LEDs in a
batch. However, it uses hidinput_get_led_field which gets the first LED
field found, and updates only the report this field belongs to. There
are devices that expose multiple LEDs in multiple reports. The current
implementation of the worker fails to update some LEDs on such devices.
Plantronics Blackwire 3220 Series (047f:c056) is an example of such
device. Only mute LED works, but offhook and ring LEDs don't work.
This commit fixes hidinput_led_worker by making it go over all reports
that contain at least one LED field.
Fixes: 4371ea8202e9 ("HID: usbhid: defer LED setting to a workqueue")
Signed-off-by: Maxim Mikityanskiy <redacted>
---
drivers/hid/hid-input.c | 41 ++++++++++++++++++++++++++++++-----------
1 file changed, 30 insertions(+), 11 deletions(-)
Jabra devices use their discretion regarding when to send the mute key
press events. Although every press on the mute button changes the LED
and actual mute state, key press events are only generated in the
offhook state and only if the mute state set by the host matches the
mute state of the headset.
Without the host's help, every second mute key press will be missed.
This patch addresses it by making the driver update the mute state every
time the mute button is pressed.
Tested with GN Netcom Jabra EVOLVE 20 MS (0b0e:0300). If some other
Jabra device doesn't suffer from this behavior, this workaround
shouldn't hurt.
Signed-off-by: Maxim Mikityanskiy <redacted>
---
drivers/hid/hid-jabra.c | 35 +++++++++++++++++++++++++++++++++++
1 file changed, 35 insertions(+)