linux-input.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [PATCH] HID: wacom: Add Dell Latitude 7275 battery quirk
@ 2021-09-04 20:58 Jérôme de Bretagne
       [not found] ` <CANRwn3S1qTcDWXrXr0WBoC4RSrB=CjrRom3=GXD8Tby=Y+W=8g@mail.gmail.com>
  2021-09-04 22:56 ` Filipe Laíns
  0 siblings, 2 replies; 3+ messages in thread
From: Jérôme de Bretagne @ 2021-09-04 20:58 UTC (permalink / raw)
  To: Jiri Kosina, Benjamin Tissoires, linux-input
  Cc: jerome.debretagne, Jason Gerecke, Ping Cheng

The Wacom touchscreen/digitizer in the Dell Latitude 7275
mistakenly reports having a battery, add a quirk to ignore it.

Signed-off-by: Jérôme de Bretagne <jerome.debretagne@gmail.com>
Tested-by: Jérôme de Bretagne <jerome.debretagne@gmail.com>
---
 drivers/hid/wacom_wac.c | 7 +++++++
 1 file changed, 7 insertions(+)

diff --git a/drivers/hid/wacom_wac.c b/drivers/hid/wacom_wac.c
index 81ba642adcb7..4d4503cbe308 100644
--- a/drivers/hid/wacom_wac.c
+++ b/drivers/hid/wacom_wac.c
@@ -3574,6 +3574,13 @@ void wacom_setup_device_quirks(struct wacom *wacom)
 		__clear_bit(MSC_SERIAL, wacom_wac->pen_input->mscbit);
 		__clear_bit(EV_MSC, wacom_wac->pen_input->evbit);
 	}
+
+	/*
+	 * The Wacom touchscreen/digitizer in the Dell Latitude 7275 mistakenly
+	 * reports having a battery, let's ignore it.
+	 */
+	if (wacom->hdev->product == 0x4804)
+		features->quirks &= ~WACOM_QUIRK_BATTERY;
 }
 
 int wacom_setup_pen_input_capabilities(struct input_dev *input_dev,
-- 
2.30.2


^ permalink raw reply related	[flat|nested] 3+ messages in thread

* Re: [PATCH] HID: wacom: Add Dell Latitude 7275 battery quirk
       [not found] ` <CANRwn3S1qTcDWXrXr0WBoC4RSrB=CjrRom3=GXD8Tby=Y+W=8g@mail.gmail.com>
@ 2021-09-04 22:53   ` Jérôme de Bretagne
  0 siblings, 0 replies; 3+ messages in thread
From: Jérôme de Bretagne @ 2021-09-04 22:53 UTC (permalink / raw)
  To: Jason Gerecke
  Cc: Jiri Kosina, Benjamin Tissoires, Linux Input, Jason Gerecke, Ping Cheng

Le sam. 4 sept. 2021 à 23:25, Jason Gerecke <killertofu@gmail.com> a écrit :
>
> Are you sure that the device is actually unnecessary? Looking online, I believe the 7275 uses an AES sensor which reports the status of the stylus battery when one is in proximity.

Its AES sensor reports the stylus battery level when one is in
proximity indeed. However, I'm not quite sure if this is a kernel API
or a userspace issue but this digitizer device is really confusing as
an end user (within Gnome Settings for instance) :

- it exposes a 0% battery level by default after boot when no stylus
is in proximity (or simply if the user has no stylus at all)
   => it shouldn't display anything at this stage in my opinion

- it exposes a fixed battery level once a stylus is in proximity
(let's say 25%) and it will keep this value until the next reboot,
whether the stylus remains in proximity or not
   => ok, why not

- the above battery level is displayed linked to a device named "Wacom
HID 4804", not obvious that this is the actual battery level of a
recently-used stylus
   => could it report the name of the actual stylus instead? or
something like "Dell Latitude 7275 (Wacom) stylus" at least?

- a connected Bluetooth stylus (an HP Active Pen G2 in my case) will
appear with its own line in the Power settings, somehow duplicating
the "Wacom HID 4804" one
   => should find a way to merge the two lines into one

- the battery level reported by the "HP Active Pen G2" line is
erroneously stuck at 100%
   => not sure yet if this stylus model can report its battery level
on its own via Bluetooth

You can forget about this patch, I'm not convinced anymore this is the
right approach to improve the situation. If you have a better
understanding of the data exposed by the kernel to userspace in these
cases, any pointers for other improvements would be appreciated (in
the kernel or in userspace).

Thanks,
Jérôme

> On Sat, Sep 4, 2021, 2:15 PM Jérôme de Bretagne <jerome.debretagne@gmail.com> wrote:
>>
>> The Wacom touchscreen/digitizer in the Dell Latitude 7275
>> mistakenly reports having a battery, add a quirk to ignore it.
>>
>> Signed-off-by: Jérôme de Bretagne <jerome.debretagne@gmail.com>
>> Tested-by: Jérôme de Bretagne <jerome.debretagne@gmail.com>
>> ---
>>  drivers/hid/wacom_wac.c | 7 +++++++
>>  1 file changed, 7 insertions(+)
>>
>> diff --git a/drivers/hid/wacom_wac.c b/drivers/hid/wacom_wac.c
>> index 81ba642adcb7..4d4503cbe308 100644
>> --- a/drivers/hid/wacom_wac.c
>> +++ b/drivers/hid/wacom_wac.c
>> @@ -3574,6 +3574,13 @@ void wacom_setup_device_quirks(struct wacom *wacom)
>>                 __clear_bit(MSC_SERIAL, wacom_wac->pen_input->mscbit);
>>                 __clear_bit(EV_MSC, wacom_wac->pen_input->evbit);
>>         }
>> +
>> +       /*
>> +        * The Wacom touchscreen/digitizer in the Dell Latitude 7275 mistakenly
>> +        * reports having a battery, let's ignore it.
>> +        */
>> +       if (wacom->hdev->product == 0x4804)
>> +               features->quirks &= ~WACOM_QUIRK_BATTERY;
>>  }
>>
>>  int wacom_setup_pen_input_capabilities(struct input_dev *input_dev,
>> --
>> 2.30.2
>>

^ permalink raw reply	[flat|nested] 3+ messages in thread

* Re: [PATCH] HID: wacom: Add Dell Latitude 7275 battery quirk
  2021-09-04 20:58 [PATCH] HID: wacom: Add Dell Latitude 7275 battery quirk Jérôme de Bretagne
       [not found] ` <CANRwn3S1qTcDWXrXr0WBoC4RSrB=CjrRom3=GXD8Tby=Y+W=8g@mail.gmail.com>
@ 2021-09-04 22:56 ` Filipe Laíns
  1 sibling, 0 replies; 3+ messages in thread
From: Filipe Laíns @ 2021-09-04 22:56 UTC (permalink / raw)
  To: Jérôme de Bretagne, Jiri Kosina, Benjamin Tissoires,
	linux-input
  Cc: Jason Gerecke, Ping Cheng

[-- Attachment #1: Type: text/plain, Size: 1358 bytes --]

On Sat, 2021-09-04 at 22:58 +0200, Jérôme de Bretagne wrote:
> The Wacom touchscreen/digitizer in the Dell Latitude 7275
> mistakenly reports having a battery, add a quirk to ignore it.
> 
> Signed-off-by: Jérôme de Bretagne <jerome.debretagne@gmail.com>
> Tested-by: Jérôme de Bretagne <jerome.debretagne@gmail.com>
> ---
>  drivers/hid/wacom_wac.c | 7 +++++++
>  1 file changed, 7 insertions(+)
> 
> diff --git a/drivers/hid/wacom_wac.c b/drivers/hid/wacom_wac.c
> index 81ba642adcb7..4d4503cbe308 100644
> --- a/drivers/hid/wacom_wac.c
> +++ b/drivers/hid/wacom_wac.c
> @@ -3574,6 +3574,13 @@ void wacom_setup_device_quirks(struct wacom *wacom)
>                 __clear_bit(MSC_SERIAL, wacom_wac->pen_input->mscbit);
>                 __clear_bit(EV_MSC, wacom_wac->pen_input->evbit);
>         }
> +
> +       /*
> +        * The Wacom touchscreen/digitizer in the Dell Latitude 7275
> mistakenly
> +        * reports having a battery, let's ignore it.
> +        */
> +       if (wacom->hdev->product == 0x4804)

We probably want a define for this ID.

> +               features->quirks &= ~WACOM_QUIRK_BATTERY;
>  }
>  
>  int wacom_setup_pen_input_capabilities(struct input_dev *input_dev,

Cheers,
Filipe Laíns

[-- Attachment #2: This is a digitally signed message part --]
[-- Type: application/pgp-signature, Size: 833 bytes --]

^ permalink raw reply	[flat|nested] 3+ messages in thread

end of thread, other threads:[~2021-09-04 23:05 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2021-09-04 20:58 [PATCH] HID: wacom: Add Dell Latitude 7275 battery quirk Jérôme de Bretagne
     [not found] ` <CANRwn3S1qTcDWXrXr0WBoC4RSrB=CjrRom3=GXD8Tby=Y+W=8g@mail.gmail.com>
2021-09-04 22:53   ` Jérôme de Bretagne
2021-09-04 22:56 ` Filipe Laíns

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).