Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]


Groups > linux.kernel > #1442584

[PATCH v2 28/30] HID: wacom: power_supply: mark the type as USB

From Benjamin Tissoires <benjamin.tissoires@redhat.com>
Newsgroups linux.kernel
Subject [PATCH v2 28/30] HID: wacom: power_supply: mark the type as USB
Date 2016-07-13 18:20 +0200
Message-ID <rUv3c-5rv-9@gated-at.bofh.it> (permalink)
References <rUuTv-5nh-3@gated-at.bofh.it>
Organization linux.* mail to news gateway

Show all headers | View raw


When upowerd detects a new device, it tries to map this new device to
an input to guess its kind. It works OK for wired tablets when the
wireless module and its battery are attached, but not so well when
connected over wireless.
In that case, the battery is attached to the wireless HID node, not
the Pen or Pad HID node. So there is no input node as a parent of the
reported battery, which means it will be showed as a computer battery
in gnome-control-center.

If we set the power supply type to USB, upowerd has a heuristic that
detects "wacom_" in the name of the power_supply, and set the type to
tablet. So it's now clear that the reported battery of from a tablet.
(see https://cgit.freedesktop.org/upower/tree/src/linux/up-device-supply.c)

Signed-off-by: Benjamin Tissoires <benjamin.tissoires@redhat.com>
---

New in v2
---
 drivers/hid/wacom_sys.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/drivers/hid/wacom_sys.c b/drivers/hid/wacom_sys.c
index 7e83352..792708b 100644
--- a/drivers/hid/wacom_sys.c
+++ b/drivers/hid/wacom_sys.c
@@ -1429,7 +1429,7 @@ static int __wacom_initialize_battery(struct wacom *wacom,
 	bat_desc->get_property = wacom_battery_get_property;
 	sprintf(battery->bat_name, "wacom_battery_%ld", n);
 	bat_desc->name = battery->bat_name;
-	bat_desc->type = POWER_SUPPLY_TYPE_BATTERY;
+	bat_desc->type = POWER_SUPPLY_TYPE_USB;
 	bat_desc->use_for_apm = 0;
 
 	ac_desc->properties = wacom_ac_props;
-- 
2.5.5

Back to linux.kernel | Previous | NextPrevious in thread | Next in thread | Find similar | Unroll thread


Thread

[PATCH v2 00/30] HID: wacom: cleanup/EKR/LED Benjamin Tissoires <benjamin.tissoires@redhat.com> - 2016-07-13 18:10 +0200
  [PATCH v2 02/30] HID: wacom: store the type in wacom->shared for INTUOSHT and INTUOSHT2 Benjamin Tissoires <benjamin.tissoires@redhat.com> - 2016-07-13 18:10 +0200
    Re: [PATCH v2 02/30] HID: wacom: store the type in wacom->shared for  INTUOSHT and INTUOSHT2 Ping Cheng <pinglinux@gmail.com> - 2016-07-15 06:20 +0200
      Re: [PATCH v2 02/30] HID: wacom: store the type in wacom->shared for  INTUOSHT and INTUOSHT2 Benjamin Tissoires <benjamin.tissoires@redhat.com> - 2016-07-18 17:00 +0200
  [PATCH v2 11/30] HID: wacom: use devres to allocate driver data Benjamin Tissoires <benjamin.tissoires@redhat.com> - 2016-07-13 18:10 +0200
  [PATCH v2 13/30] HID: wacom: leds: dynamically allocate LED groups Benjamin Tissoires <benjamin.tissoires@redhat.com> - 2016-07-13 18:10 +0200
  [PATCH v2 28/30] HID: wacom: power_supply: mark the type as USB Benjamin Tissoires <benjamin.tissoires@redhat.com> - 2016-07-13 18:20 +0200
  [PATCH v2 23/30] HID: wacom: leds: use the ledclass instead of custom made sysfs files Benjamin Tissoires <benjamin.tissoires@redhat.com> - 2016-07-13 18:20 +0200
  [PATCH v2 24/30] HID: wacom: leds: actually release the LEDs on disconnect Benjamin Tissoires <benjamin.tissoires@redhat.com> - 2016-07-13 18:20 +0200
  [PATCH v2 22/30] HID: wacom: EKR: attach the power_supply on first connection Benjamin Tissoires <benjamin.tissoires@redhat.com> - 2016-07-13 18:20 +0200
  [PATCH v2 30/30] HID: wacom: power_supply: provide the actual model_name Benjamin Tissoires <benjamin.tissoires@redhat.com> - 2016-07-13 18:20 +0200
  [PATCH v2 05/30] HID: wacom: use one work queue per task Benjamin Tissoires <benjamin.tissoires@redhat.com> - 2016-07-13 18:20 +0200
  [PATCH v2 18/30] HID: wacom: EKR: use devres groups to manage resources Benjamin Tissoires <benjamin.tissoires@redhat.com> - 2016-07-13 18:20 +0200
  [PATCH v2 15/30] HID: wacom: EKR: have the wacom resources dynamically allocated Benjamin Tissoires <benjamin.tissoires@redhat.com> - 2016-07-13 18:20 +0200
  [PATCH v2 10/30] HID: wacom: use devm_kasprintf for allocating the name of the remote Benjamin Tissoires <benjamin.tissoires@redhat.com> - 2016-07-13 18:20 +0200
  [PATCH v2 19/30] HID: wacom: EKR: have one array of struct remotes instead of many arrays Benjamin Tissoires <benjamin.tissoires@redhat.com> - 2016-07-13 18:20 +0200
  [PATCH v2 04/30] HID: wacom: untie leds from inputs Benjamin Tissoires <benjamin.tissoires@redhat.com> - 2016-07-13 18:20 +0200
  [PATCH v2 16/30] HID: wacom: rework fail path in probe() and parse_and_register() Benjamin Tissoires <benjamin.tissoires@redhat.com> - 2016-07-13 18:20 +0200
  [PATCH v2 27/30] HID: wacom: leds: handle Cintiq 24HD leds buttons Benjamin Tissoires <benjamin.tissoires@redhat.com> - 2016-07-13 18:20 +0200
  [PATCH v2 25/30] HID: wacom: leds: handle the switch of the LEDs directly in the kernel Benjamin Tissoires <benjamin.tissoires@redhat.com> - 2016-07-13 18:20 +0200
  [PATCH v2 26/30] HID: wacom: leds: make sure Cintiq 21UX2 and 24HD control the right LEDs Benjamin Tissoires <benjamin.tissoires@redhat.com> - 2016-07-13 18:20 +0200
  [PATCH v2 06/30] HID: wacom: switch battery to devres Benjamin Tissoires <benjamin.tissoires@redhat.com> - 2016-07-13 18:20 +0200
  [PATCH v2 12/30] HID: wacom: devres manage the shared data too Benjamin Tissoires <benjamin.tissoires@redhat.com> - 2016-07-13 18:20 +0200
  [PATCH v2 08/30] HID: wacom: put the managed resources in a group Benjamin Tissoires <benjamin.tissoires@redhat.com> - 2016-07-13 18:20 +0200
  [PATCH v2 29/30] HID: wacom: power_supply: remove ac information Benjamin Tissoires <benjamin.tissoires@redhat.com> - 2016-07-13 18:20 +0200
  [PATCH v2 21/30] HID: wacom: EKR: have one power_supply per remote Benjamin Tissoires <benjamin.tissoires@redhat.com> - 2016-07-13 18:20 +0200
  [PATCH v2 14/30] HID: wacom: EKR: add a worker to add/remove resources on addition/removal Benjamin Tissoires <benjamin.tissoires@redhat.com> - 2016-07-13 18:20 +0200
  [PATCH v2 20/30] HID: wacom: EKR: allocate one input node per remote Benjamin Tissoires <benjamin.tissoires@redhat.com> - 2016-07-13 18:20 +0200
  Re: [PATCH v2 00/30] HID: wacom: cleanup/EKR/LED Aaron Armstrong Skomra <skomra@gmail.com> - 2016-07-13 23:40 +0200

csiph-web