diff options
author | Benjamin Tissoires <benjamin.tissoires@redhat.com> | 2016-07-13 18:06:17 +0200 |
---|---|---|
committer | Jiri Kosina <jkosina@suse.cz> | 2016-08-05 13:39:23 +0200 |
commit | 9956953ec082e9353ee0828538ff37b149cc91c9 (patch) | |
tree | 1be5a9b96707ab72b98c52db0389f9159bf104a8 /drivers/hid/wacom_sys.c | |
parent | 136ae5e9bacebbd8f2a94e8dea69f0dc22fbc8c7 (diff) | |
download | linux-stable-9956953ec082e9353ee0828538ff37b149cc91c9.tar.gz linux-stable-9956953ec082e9353ee0828538ff37b149cc91c9.tar.bz2 linux-stable-9956953ec082e9353ee0828538ff37b149cc91c9.zip |
HID: wacom: power_supply: provide the actual model_name
Instead of displaying a generic "tablet", now g-c-c shows a pretty
"Wacom Intuos Pro S (WL)".
Signed-off-by: Benjamin Tissoires <benjamin.tissoires@redhat.com>
Acked-by: Ping Cheng <pingc@wacom.com>
Signed-off-by: Jiri Kosina <jkosina@suse.cz>
Diffstat (limited to 'drivers/hid/wacom_sys.c')
-rw-r--r-- | drivers/hid/wacom_sys.c | 11 |
1 files changed, 11 insertions, 0 deletions
diff --git a/drivers/hid/wacom_sys.c b/drivers/hid/wacom_sys.c index d8f3d3dc2c88..edde8819e506 100644 --- a/drivers/hid/wacom_sys.c +++ b/drivers/hid/wacom_sys.c @@ -1336,6 +1336,7 @@ static int wacom_initialize_leds(struct wacom *wacom) } static enum power_supply_property wacom_battery_props[] = { + POWER_SUPPLY_PROP_MODEL_NAME, POWER_SUPPLY_PROP_PRESENT, POWER_SUPPLY_PROP_STATUS, POWER_SUPPLY_PROP_SCOPE, @@ -1350,6 +1351,9 @@ static int wacom_battery_get_property(struct power_supply *psy, int ret = 0; switch (psp) { + case POWER_SUPPLY_PROP_MODEL_NAME: + val->strval = battery->wacom->wacom_wac.name; + break; case POWER_SUPPLY_PROP_PRESENT: val->intval = battery->bat_connected; break; @@ -1392,6 +1396,8 @@ static int __wacom_initialize_battery(struct wacom *wacom, if (!devres_open_group(dev, bat_desc, GFP_KERNEL)) return -ENOMEM; + battery->wacom = wacom; + n = atomic_inc_return(&battery_no) - 1; bat_desc->properties = wacom_battery_props; @@ -1863,6 +1869,9 @@ static void wacom_update_name(struct wacom *wacom, const char *suffix) strlcpy(name, features->name, sizeof(name)); } + snprintf(wacom_wac->name, sizeof(wacom_wac->name), "%s%s", + name, suffix); + /* Append the device type to the name */ snprintf(wacom_wac->pen_name, sizeof(wacom_wac->pen_name), "%s%s Pen", name, suffix); @@ -2097,6 +2106,8 @@ static void wacom_wireless_work(struct work_struct *work) goto fail; } + strlcpy(wacom_wac->name, wacom_wac1->name, + sizeof(wacom_wac->name)); error = wacom_initialize_battery(wacom); if (error) goto fail; |