Lines Matching refs:battery

203 	struct hidpp_battery battery;  member
660 hidpp->battery.level = in hidpp10_query_battery_status()
663 hidpp->battery.status = status; in hidpp10_query_battery_status()
665 hidpp->battery.online = status == POWER_SUPPLY_STATUS_DISCHARGING || in hidpp10_query_battery_status()
712 hidpp->battery.capacity = response.rap.params[0]; in hidpp10_query_battery_mileage()
714 hidpp->battery.status = status; in hidpp10_query_battery_mileage()
716 hidpp->battery.online = status == POWER_SUPPLY_STATUS_DISCHARGING || in hidpp10_query_battery_mileage()
733 capacity = hidpp->battery.capacity; in hidpp10_battery_event()
739 level = hidpp->battery.level; in hidpp10_battery_event()
746 changed = capacity != hidpp->battery.capacity || in hidpp10_battery_event()
747 level != hidpp->battery.level || in hidpp10_battery_event()
748 status != hidpp->battery.status; in hidpp10_battery_event()
751 hidpp->battery.online = status == POWER_SUPPLY_STATUS_DISCHARGING || in hidpp10_battery_event()
755 hidpp->battery.level = level; in hidpp10_battery_event()
756 hidpp->battery.status = status; in hidpp10_battery_event()
757 if (hidpp->battery.ps) in hidpp10_battery_event()
758 power_supply_changed(hidpp->battery.ps); in hidpp10_battery_event()
1186 if (hidpp->battery.feature_index == 0xff) { in hidpp20_query_battery_info_1000()
1189 &hidpp->battery.feature_index, in hidpp20_query_battery_info_1000()
1196 hidpp->battery.feature_index, in hidpp20_query_battery_info_1000()
1203 hidpp->battery.feature_index); in hidpp20_query_battery_info_1000()
1207 hidpp->battery.status = status; in hidpp20_query_battery_info_1000()
1208 hidpp->battery.capacity = capacity; in hidpp20_query_battery_info_1000()
1209 hidpp->battery.level = level; in hidpp20_query_battery_info_1000()
1211 hidpp->battery.online = status == POWER_SUPPLY_STATUS_DISCHARGING || in hidpp20_query_battery_info_1000()
1224 if (report->fap.feature_index != hidpp->battery.feature_index || in hidpp20_battery_event_1000()
1234 hidpp->battery.online = status == POWER_SUPPLY_STATUS_DISCHARGING || in hidpp20_battery_event_1000()
1237 changed = capacity != hidpp->battery.capacity || in hidpp20_battery_event_1000()
1238 level != hidpp->battery.level || in hidpp20_battery_event_1000()
1239 status != hidpp->battery.status; in hidpp20_battery_event_1000()
1242 hidpp->battery.level = level; in hidpp20_battery_event_1000()
1243 hidpp->battery.capacity = capacity; in hidpp20_battery_event_1000()
1244 hidpp->battery.status = status; in hidpp20_battery_event_1000()
1245 if (hidpp->battery.ps) in hidpp20_battery_event_1000()
1246 power_supply_changed(hidpp->battery.ps); in hidpp20_battery_event_1000()
1377 if (hidpp->battery.voltage_feature_index == 0xff) { in hidpp20_query_battery_voltage_info()
1379 &hidpp->battery.voltage_feature_index, in hidpp20_query_battery_voltage_info()
1386 hidpp->battery.voltage_feature_index, in hidpp20_query_battery_voltage_info()
1392 hidpp->battery.status = status; in hidpp20_query_battery_voltage_info()
1393 hidpp->battery.voltage = voltage; in hidpp20_query_battery_voltage_info()
1394 hidpp->battery.capacity = hidpp20_map_battery_capacity(hidpp->hid_dev, in hidpp20_query_battery_voltage_info()
1396 hidpp->battery.level = level; in hidpp20_query_battery_voltage_info()
1397 hidpp->battery.charge_type = charge_type; in hidpp20_query_battery_voltage_info()
1398 hidpp->battery.online = status != POWER_SUPPLY_STATUS_NOT_CHARGING; in hidpp20_query_battery_voltage_info()
1409 if (report->fap.feature_index != hidpp->battery.voltage_feature_index || in hidpp20_battery_voltage_event()
1416 hidpp->battery.online = status != POWER_SUPPLY_STATUS_NOT_CHARGING; in hidpp20_battery_voltage_event()
1418 if (voltage != hidpp->battery.voltage || status != hidpp->battery.status) { in hidpp20_battery_voltage_event()
1419 hidpp->battery.voltage = voltage; in hidpp20_battery_voltage_event()
1420 hidpp->battery.capacity = hidpp20_map_battery_capacity(hidpp->hid_dev, in hidpp20_battery_voltage_event()
1422 hidpp->battery.status = status; in hidpp20_battery_voltage_event()
1423 hidpp->battery.level = level; in hidpp20_battery_voltage_event()
1424 hidpp->battery.charge_type = charge_type; in hidpp20_battery_voltage_event()
1425 if (hidpp->battery.ps) in hidpp20_battery_voltage_event()
1426 power_supply_changed(hidpp->battery.ps); in hidpp20_battery_voltage_event()
1486 hidpp->battery.supported_levels_1004 = 0; in hidpp20_unifiedbattery_get_capabilities()
1489 hidpp->battery.supported_levels_1004 = params[0]; in hidpp20_unifiedbattery_get_capabilities()
1529 battery_level &= hidpp->battery.supported_levels_1004; in hidpp20_unifiedbattery_map_level()
1581 if (hidpp->battery.feature_index == 0xff) { in hidpp20_query_battery_info_1004()
1584 &hidpp->battery.feature_index, in hidpp20_query_battery_info_1004()
1591 hidpp->battery.feature_index); in hidpp20_query_battery_info_1004()
1596 hidpp->battery.feature_index, in hidpp20_query_battery_info_1004()
1604 hidpp->battery.capacity = state_of_charge; in hidpp20_query_battery_info_1004()
1605 hidpp->battery.status = status; in hidpp20_query_battery_info_1004()
1606 hidpp->battery.level = level; in hidpp20_query_battery_info_1004()
1607 hidpp->battery.online = true; in hidpp20_query_battery_info_1004()
1620 if (report->fap.feature_index != hidpp->battery.feature_index || in hidpp20_battery_event_1004()
1628 changed = status != hidpp->battery.status || in hidpp20_battery_event_1004()
1629 (state_of_charge != hidpp->battery.capacity && in hidpp20_battery_event_1004()
1631 (level != hidpp->battery.level && in hidpp20_battery_event_1004()
1635 hidpp->battery.capacity = state_of_charge; in hidpp20_battery_event_1004()
1636 hidpp->battery.status = status; in hidpp20_battery_event_1004()
1637 hidpp->battery.level = level; in hidpp20_battery_event_1004()
1638 if (hidpp->battery.ps) in hidpp20_battery_event_1004()
1639 power_supply_changed(hidpp->battery.ps); in hidpp20_battery_event_1004()
1670 val->intval = hidpp->battery.status; in hidpp_battery_get_property()
1673 val->intval = hidpp->battery.capacity; in hidpp_battery_get_property()
1676 val->intval = hidpp->battery.level; in hidpp_battery_get_property()
1682 val->intval = hidpp->battery.online; in hidpp_battery_get_property()
1698 val->intval = hidpp->battery.voltage * 1000; in hidpp_battery_get_property()
1701 val->intval = hidpp->battery.charge_type; in hidpp_battery_get_property()
1841 if (hidpp->battery.feature_index == 0xff) { in hidpp_solar_request_battery_event()
1844 &hidpp->battery.solar_feature_index, in hidpp_solar_request_battery_event()
1851 hidpp->battery.solar_feature_index, in hidpp_solar_request_battery_event()
1877 if (report->fap.feature_index != hidpp->battery.solar_feature_index || in hidpp_solar_battery_event()
1895 if (capacity < hidpp->battery.capacity) in hidpp_solar_battery_event()
1905 hidpp->battery.online = true; in hidpp_solar_battery_event()
1906 if (capacity != hidpp->battery.capacity || in hidpp_solar_battery_event()
1907 status != hidpp->battery.status) { in hidpp_solar_battery_event()
1908 hidpp->battery.capacity = capacity; in hidpp_solar_battery_event()
1909 hidpp->battery.status = status; in hidpp_solar_battery_event()
1910 if (hidpp->battery.ps) in hidpp_solar_battery_event()
1911 power_supply_changed(hidpp->battery.ps); in hidpp_solar_battery_event()
3706 struct power_supply_desc *desc = &hidpp->battery.desc; in hidpp_initialize_battery()
3708 struct hidpp_battery *battery; in hidpp_initialize_battery() local
3713 if (hidpp->battery.ps) in hidpp_initialize_battery()
3716 hidpp->battery.feature_index = 0xff; in hidpp_initialize_battery()
3717 hidpp->battery.solar_feature_index = 0xff; in hidpp_initialize_battery()
3718 hidpp->battery.voltage_feature_index = 0xff; in hidpp_initialize_battery()
3773 battery = &hidpp->battery; in hidpp_initialize_battery()
3779 sprintf(battery->name, "hidpp_battery_%ld", n); in hidpp_initialize_battery()
3780 desc->name = battery->name; in hidpp_initialize_battery()
3784 battery->ps = devm_power_supply_register(&hidpp->hid_dev->dev, in hidpp_initialize_battery()
3785 &battery->desc, in hidpp_initialize_battery()
3787 if (IS_ERR(battery->ps)) in hidpp_initialize_battery()
3788 return PTR_ERR(battery->ps); in hidpp_initialize_battery()
3790 power_supply_powers(battery->ps, &hidpp->hid_dev->dev); in hidpp_initialize_battery()
3862 if (hidpp->battery.ps) { in hidpp_connect_event()
3863 hidpp->battery.online = false; in hidpp_connect_event()
3864 hidpp->battery.status = POWER_SUPPLY_STATUS_UNKNOWN; in hidpp_connect_event()
3865 hidpp->battery.level = POWER_SUPPLY_CAPACITY_LEVEL_UNKNOWN; in hidpp_connect_event()
3866 power_supply_changed(hidpp->battery.ps); in hidpp_connect_event()
3943 if (hidpp->battery.ps) in hidpp_connect_event()
3944 power_supply_changed(hidpp->battery.ps); in hidpp_connect_event()