diff options
Diffstat (limited to 'drivers/hid/hid-input.c')
-rw-r--r-- | drivers/hid/hid-input.c | 9 |
1 files changed, 8 insertions, 1 deletions
diff --git a/drivers/hid/hid-input.c b/drivers/hid/hid-input.c index 627850a54d34..002781c5a616 100644 --- a/drivers/hid/hid-input.c +++ b/drivers/hid/hid-input.c | |||
@@ -279,7 +279,8 @@ static enum power_supply_property hidinput_battery_props[] = { | |||
279 | POWER_SUPPLY_PROP_ONLINE, | 279 | POWER_SUPPLY_PROP_ONLINE, |
280 | POWER_SUPPLY_PROP_CAPACITY, | 280 | POWER_SUPPLY_PROP_CAPACITY, |
281 | POWER_SUPPLY_PROP_MODEL_NAME, | 281 | POWER_SUPPLY_PROP_MODEL_NAME, |
282 | POWER_SUPPLY_PROP_STATUS | 282 | POWER_SUPPLY_PROP_STATUS, |
283 | POWER_SUPPLY_PROP_SCOPE, | ||
283 | }; | 284 | }; |
284 | 285 | ||
285 | #define HID_BATTERY_QUIRK_PERCENT (1 << 0) /* always reports percent */ | 286 | #define HID_BATTERY_QUIRK_PERCENT (1 << 0) /* always reports percent */ |
@@ -344,6 +345,10 @@ static int hidinput_get_battery_property(struct power_supply *psy, | |||
344 | val->intval = POWER_SUPPLY_STATUS_DISCHARGING; | 345 | val->intval = POWER_SUPPLY_STATUS_DISCHARGING; |
345 | break; | 346 | break; |
346 | 347 | ||
348 | case POWER_SUPPLY_PROP_SCOPE: | ||
349 | val->intval = POWER_SUPPLY_SCOPE_DEVICE; | ||
350 | break; | ||
351 | |||
347 | default: | 352 | default: |
348 | ret = -EINVAL; | 353 | ret = -EINVAL; |
349 | break; | 354 | break; |
@@ -403,6 +408,8 @@ static bool hidinput_setup_battery(struct hid_device *dev, unsigned report_type, | |||
403 | battery->name = NULL; | 408 | battery->name = NULL; |
404 | } | 409 | } |
405 | 410 | ||
411 | power_supply_powers(battery, &dev->dev); | ||
412 | |||
406 | out: | 413 | out: |
407 | return true; | 414 | return true; |
408 | } | 415 | } |