There are styluses that only report their battery status when they are
touching the touchscreen; additionally we currently suppress battery
reports if capacity has not changed. To help userspace recognize how long
ago the device reported battery status, let's send the change event through
if either capacity has changed, or at least 30 seconds have passed since
last report we've let through.
Signed-off-by: Dmitry Torokhov <dmitry.torokhov@gmail.com>
---
This is a bit of RFC. Another option would be to mark the power supply
as either offline or not present when stylus leaves the surface instead
of saying it is online... Sebastian, any ideas/suggestions?
drivers/hid/hid-input.c | 5 ++++-
include/linux/hid.h | 1 +
2 files changed, 5 insertions(+), 1 deletion(-)
I've tested this locally backported to a 4.19 variant; it does work,
and provides the expected additional CHANGE events while safely
limiting the rate.
This seems like a reasonable minimum improvement, just ensuring
information already being pushed by HID reports can be utilized.
I'm unsure about mapping Digitizers.InRange to power_supply 'present',
in the abstract. It seems there could be a device where
Digitizers.BatteryStrength is sent, despite Digitizers.InRange=0, and
the HID Usage Tables don't quite seem to rule this out (depending on
how battery status collection interacts with 'the region where
digitizing is possible', section 16.3.1.).
As-is, this is useful and sufficient to get more timely reports up to userspace.
- Kenneth Albanowski
On Wed, Sep 30, 2020 at 3:47 PM [off-list ref] wrote:
quoted hunk
There are styluses that only report their battery status when they are
touching the touchscreen; additionally we currently suppress battery
reports if capacity has not changed. To help userspace recognize how long
ago the device reported battery status, let's send the change event through
if either capacity has changed, or at least 30 seconds have passed since
last report we've let through.
Signed-off-by: Dmitry Torokhov <dmitry.torokhov@gmail.com>
---
This is a bit of RFC. Another option would be to mark the power supply
as either offline or not present when stylus leaves the surface instead
of saying it is online... Sebastian, any ideas/suggestions?
drivers/hid/hid-input.c | 5 ++++-
include/linux/hid.h | 1 +
2 files changed, 5 insertions(+), 1 deletion(-)
M
On Wed, Oct 07, 2020 at 03:05:13PM -0700, Kenneth Albanowski wrote:
I've tested this locally backported to a 4.19 variant; it does work,
and provides the expected additional CHANGE events while safely
limiting the rate.
This seems like a reasonable minimum improvement, just ensuring
information already being pushed by HID reports can be utilized.
I'm unsure about mapping Digitizers.InRange to power_supply 'present',
in the abstract. It seems there could be a device where
Digitizers.BatteryStrength is sent, despite Digitizers.InRange=0, and
the HID Usage Tables don't quite seem to rule this out (depending on
how battery status collection interacts with 'the region where
digitizing is possible', section 16.3.1.).
As-is, this is useful and sufficient to get more timely reports up to userspace.
Jiri, if there are no better ideas, maybe this one can be applied?
Thanks!
- Kenneth Albanowski
On Wed, Sep 30, 2020 at 3:47 PM [off-list ref] wrote:
quoted
There are styluses that only report their battery status when they are
touching the touchscreen; additionally we currently suppress battery
reports if capacity has not changed. To help userspace recognize how long
ago the device reported battery status, let's send the change event through
if either capacity has changed, or at least 30 seconds have passed since
last report we've let through.
Signed-off-by: Dmitry Torokhov <dmitry.torokhov@gmail.com>
---
This is a bit of RFC. Another option would be to mark the power supply
as either offline or not present when stylus leaves the surface instead
of saying it is online... Sebastian, any ideas/suggestions?
drivers/hid/hid-input.c | 5 ++++-
include/linux/hid.h | 1 +
2 files changed, 5 insertions(+), 1 deletion(-)
M
On Wed, Oct 07, 2020 at 03:05:13PM -0700, Kenneth Albanowski wrote:
quoted
I've tested this locally backported to a 4.19 variant; it does work,
and provides the expected additional CHANGE events while safely
limiting the rate.
This seems like a reasonable minimum improvement, just ensuring
information already being pushed by HID reports can be utilized.
I'm unsure about mapping Digitizers.InRange to power_supply 'present',
in the abstract. It seems there could be a device where
Digitizers.BatteryStrength is sent, despite Digitizers.InRange=0, and
the HID Usage Tables don't quite seem to rule this out (depending on
how battery status collection interacts with 'the region where
digitizing is possible', section 16.3.1.).
As-is, this is useful and sufficient to get more timely reports up to userspace.
Jiri, if there are no better ideas, maybe this one can be applied?
Agreed (I certainly don't have better one :) ). Applied, thanks.
--
Jiri Kosina
SUSE Labs