Merge branches 'battery-scope', 'logitech' and 'multitouch' into for-linus
[~shefty/rdma-dev.git] / drivers / hid / hid-input.c
index 627850a54d34ecd6da97f281324b1eff98a368fc..002781c5a6164040e90a6a5bab40ed982e50b508 100644 (file)
@@ -279,7 +279,8 @@ static enum power_supply_property hidinput_battery_props[] = {
        POWER_SUPPLY_PROP_ONLINE,
        POWER_SUPPLY_PROP_CAPACITY,
        POWER_SUPPLY_PROP_MODEL_NAME,
-       POWER_SUPPLY_PROP_STATUS
+       POWER_SUPPLY_PROP_STATUS,
+       POWER_SUPPLY_PROP_SCOPE,
 };
 
 #define HID_BATTERY_QUIRK_PERCENT      (1 << 0) /* always reports percent */
@@ -344,6 +345,10 @@ static int hidinput_get_battery_property(struct power_supply *psy,
                val->intval = POWER_SUPPLY_STATUS_DISCHARGING;
                break;
 
+       case POWER_SUPPLY_PROP_SCOPE:
+               val->intval = POWER_SUPPLY_SCOPE_DEVICE;
+               break;
+
        default:
                ret = -EINVAL;
                break;
@@ -403,6 +408,8 @@ static bool hidinput_setup_battery(struct hid_device *dev, unsigned report_type,
                battery->name = NULL;
        }
 
+       power_supply_powers(battery, &dev->dev);
+
 out:
        return true;
 }