battery          1159 arch/arm/mach-pxa/em-x270.c 	DA9030_SUBDEV(battery, BAT, &em_x270_batterty_info),
battery            32 arch/sh/boards/mach-hp6xx/hp6xx_apm.c 	int battery, backup, charging, percentage;
battery            35 arch/sh/boards/mach-hp6xx/hp6xx_apm.c 	battery		= adc_single(ADC_CHANNEL_BATTERY);
battery            39 arch/sh/boards/mach-hp6xx/hp6xx_apm.c 	percentage = 100 * (battery - HP680_BATTERY_MIN) /
battery            49 arch/sh/boards/mach-hp6xx/hp6xx_apm.c 	info->time = (2 * battery);
battery            51 arch/sh/boards/mach-hp6xx/hp6xx_apm.c 	info->ac_line_status = (battery > HP680_BATTERY_AC_ON) ?
battery           150 drivers/acpi/battery.c static inline int acpi_battery_present(struct acpi_battery *battery)
battery           152 drivers/acpi/battery.c 	return battery->device->status.battery_present;
battery           155 drivers/acpi/battery.c static int acpi_battery_technology(struct acpi_battery *battery)
battery           157 drivers/acpi/battery.c 	if (!strcasecmp("NiCd", battery->type))
battery           159 drivers/acpi/battery.c 	if (!strcasecmp("NiMH", battery->type))
battery           161 drivers/acpi/battery.c 	if (!strcasecmp("LION", battery->type))
battery           163 drivers/acpi/battery.c 	if (!strncasecmp("LI-ION", battery->type, 6))
battery           165 drivers/acpi/battery.c 	if (!strcasecmp("LiP", battery->type))
battery           170 drivers/acpi/battery.c static int acpi_battery_get_state(struct acpi_battery *battery);
battery           172 drivers/acpi/battery.c static int acpi_battery_is_charged(struct acpi_battery *battery)
battery           175 drivers/acpi/battery.c 	if (battery->state != 0)
battery           179 drivers/acpi/battery.c 	if (battery->capacity_now == ACPI_BATTERY_VALUE_UNKNOWN ||
battery           180 drivers/acpi/battery.c 	    battery->capacity_now == 0)
battery           184 drivers/acpi/battery.c 	if (battery->full_charge_capacity == battery->capacity_now)
battery           188 drivers/acpi/battery.c 	if (battery->design_capacity == battery->capacity_now)
battery           195 drivers/acpi/battery.c static bool acpi_battery_is_degraded(struct acpi_battery *battery)
battery           197 drivers/acpi/battery.c 	return ACPI_BATTERY_CAPACITY_VALID(battery->full_charge_capacity) &&
battery           198 drivers/acpi/battery.c 		ACPI_BATTERY_CAPACITY_VALID(battery->design_capacity) &&
battery           199 drivers/acpi/battery.c 		battery->full_charge_capacity < battery->design_capacity;
battery           202 drivers/acpi/battery.c static int acpi_battery_handle_discharging(struct acpi_battery *battery)
battery           210 drivers/acpi/battery.c 	    battery->rate_now == 0)
battery           221 drivers/acpi/battery.c 	struct acpi_battery *battery = to_acpi_battery(psy);
battery           223 drivers/acpi/battery.c 	if (acpi_battery_present(battery)) {
battery           225 drivers/acpi/battery.c 		acpi_battery_get_state(battery);
battery           230 drivers/acpi/battery.c 		if (battery->state & ACPI_BATTERY_STATE_DISCHARGING)
battery           231 drivers/acpi/battery.c 			val->intval = acpi_battery_handle_discharging(battery);
battery           232 drivers/acpi/battery.c 		else if (battery->state & ACPI_BATTERY_STATE_CHARGING)
battery           234 drivers/acpi/battery.c 		else if (acpi_battery_is_charged(battery))
battery           240 drivers/acpi/battery.c 		val->intval = acpi_battery_present(battery);
battery           243 drivers/acpi/battery.c 		val->intval = acpi_battery_technology(battery);
battery           246 drivers/acpi/battery.c 		val->intval = battery->cycle_count;
battery           249 drivers/acpi/battery.c 		if (battery->design_voltage == ACPI_BATTERY_VALUE_UNKNOWN)
battery           252 drivers/acpi/battery.c 			val->intval = battery->design_voltage * 1000;
battery           255 drivers/acpi/battery.c 		if (battery->voltage_now == ACPI_BATTERY_VALUE_UNKNOWN)
battery           258 drivers/acpi/battery.c 			val->intval = battery->voltage_now * 1000;
battery           262 drivers/acpi/battery.c 		if (battery->rate_now == ACPI_BATTERY_VALUE_UNKNOWN)
battery           265 drivers/acpi/battery.c 			val->intval = battery->rate_now * 1000;
battery           269 drivers/acpi/battery.c 		if (!ACPI_BATTERY_CAPACITY_VALID(battery->design_capacity))
battery           272 drivers/acpi/battery.c 			val->intval = battery->design_capacity * 1000;
battery           276 drivers/acpi/battery.c 		if (!ACPI_BATTERY_CAPACITY_VALID(battery->full_charge_capacity))
battery           279 drivers/acpi/battery.c 			val->intval = battery->full_charge_capacity * 1000;
battery           283 drivers/acpi/battery.c 		if (battery->capacity_now == ACPI_BATTERY_VALUE_UNKNOWN)
battery           286 drivers/acpi/battery.c 			val->intval = battery->capacity_now * 1000;
battery           289 drivers/acpi/battery.c 		if (ACPI_BATTERY_CAPACITY_VALID(battery->full_charge_capacity))
battery           290 drivers/acpi/battery.c 			full_capacity = battery->full_charge_capacity;
battery           291 drivers/acpi/battery.c 		else if (ACPI_BATTERY_CAPACITY_VALID(battery->design_capacity))
battery           292 drivers/acpi/battery.c 			full_capacity = battery->design_capacity;
battery           294 drivers/acpi/battery.c 		if (battery->capacity_now == ACPI_BATTERY_VALUE_UNKNOWN ||
battery           298 drivers/acpi/battery.c 			val->intval = battery->capacity_now * 100/
battery           302 drivers/acpi/battery.c 		if (battery->state & ACPI_BATTERY_STATE_CRITICAL)
battery           304 drivers/acpi/battery.c 		else if (test_bit(ACPI_BATTERY_ALARM_PRESENT, &battery->flags) &&
battery           305 drivers/acpi/battery.c 			(battery->capacity_now <= battery->alarm))
battery           307 drivers/acpi/battery.c 		else if (acpi_battery_is_charged(battery))
battery           313 drivers/acpi/battery.c 		val->strval = battery->model_number;
battery           316 drivers/acpi/battery.c 		val->strval = battery->oem_info;
battery           319 drivers/acpi/battery.c 		val->strval = battery->serial_number;
battery           445 drivers/acpi/battery.c static int extract_package(struct acpi_battery *battery,
battery           458 drivers/acpi/battery.c 			u8 *ptr = (u8 *)battery + offsets[i].offset;
battery           469 drivers/acpi/battery.c 			int *x = (int *)((u8 *)battery + offsets[i].offset);
battery           477 drivers/acpi/battery.c static int acpi_battery_get_status(struct acpi_battery *battery)
battery           479 drivers/acpi/battery.c 	if (acpi_bus_get_status(battery->device)) {
battery           488 drivers/acpi/battery.c 			 struct acpi_battery *battery,
battery           494 drivers/acpi/battery.c 		result = extract_package(battery, buffer->pointer,
battery           498 drivers/acpi/battery.c 		result = extract_package(battery, buffer->pointer,
battery           502 drivers/acpi/battery.c 		result = extract_package(battery, buffer->pointer,
battery           504 drivers/acpi/battery.c 	if (test_bit(ACPI_BATTERY_QUIRK_PERCENTAGE_CAPACITY, &battery->flags))
battery           505 drivers/acpi/battery.c 		battery->full_charge_capacity = battery->design_capacity;
battery           506 drivers/acpi/battery.c 	if (test_bit(ACPI_BATTERY_QUIRK_THINKPAD_MAH, &battery->flags) &&
battery           507 drivers/acpi/battery.c 	    battery->power_unit && battery->design_voltage) {
battery           508 drivers/acpi/battery.c 		battery->design_capacity = battery->design_capacity *
battery           509 drivers/acpi/battery.c 		    10000 / battery->design_voltage;
battery           510 drivers/acpi/battery.c 		battery->full_charge_capacity = battery->full_charge_capacity *
battery           511 drivers/acpi/battery.c 		    10000 / battery->design_voltage;
battery           512 drivers/acpi/battery.c 		battery->design_capacity_warning =
battery           513 drivers/acpi/battery.c 		    battery->design_capacity_warning *
battery           514 drivers/acpi/battery.c 		    10000 / battery->design_voltage;
battery           521 drivers/acpi/battery.c 	if (test_bit(ACPI_BATTERY_QUIRK_DEGRADED_FULL_CHARGE, &battery->flags) &&
battery           522 drivers/acpi/battery.c 	    battery->capacity_now > battery->full_charge_capacity)
battery           523 drivers/acpi/battery.c 		battery->capacity_now = battery->full_charge_capacity;
battery           528 drivers/acpi/battery.c static int acpi_battery_get_info(struct acpi_battery *battery)
battery           530 drivers/acpi/battery.c 	const int xinfo = test_bit(ACPI_BATTERY_XINFO_PRESENT, &battery->flags);
battery           534 drivers/acpi/battery.c 	if (!acpi_battery_present(battery))
battery           542 drivers/acpi/battery.c 		mutex_lock(&battery->lock);
battery           543 drivers/acpi/battery.c 		status = acpi_evaluate_object(battery->device->handle,
battery           546 drivers/acpi/battery.c 		mutex_unlock(&battery->lock);
battery           553 drivers/acpi/battery.c 						      battery,
battery           567 drivers/acpi/battery.c static int acpi_battery_get_state(struct acpi_battery *battery)
battery           573 drivers/acpi/battery.c 	if (!acpi_battery_present(battery))
battery           576 drivers/acpi/battery.c 	if (battery->update_time &&
battery           577 drivers/acpi/battery.c 	    time_before(jiffies, battery->update_time +
battery           581 drivers/acpi/battery.c 	mutex_lock(&battery->lock);
battery           582 drivers/acpi/battery.c 	status = acpi_evaluate_object(battery->device->handle, "_BST",
battery           584 drivers/acpi/battery.c 	mutex_unlock(&battery->lock);
battery           591 drivers/acpi/battery.c 	result = extract_package(battery, buffer.pointer,
battery           593 drivers/acpi/battery.c 	battery->update_time = jiffies;
battery           600 drivers/acpi/battery.c 	if (battery->power_unit == ACPI_BATTERY_POWER_UNIT_MA &&
battery           601 drivers/acpi/battery.c 		battery->rate_now != ACPI_BATTERY_VALUE_UNKNOWN &&
battery           602 drivers/acpi/battery.c 		(s16)(battery->rate_now) < 0) {
battery           603 drivers/acpi/battery.c 		battery->rate_now = abs((s16)battery->rate_now);
battery           607 drivers/acpi/battery.c 	if (test_bit(ACPI_BATTERY_QUIRK_PERCENTAGE_CAPACITY, &battery->flags)
battery           608 drivers/acpi/battery.c 	    && battery->capacity_now >= 0 && battery->capacity_now <= 100)
battery           609 drivers/acpi/battery.c 		battery->capacity_now = (battery->capacity_now *
battery           610 drivers/acpi/battery.c 				battery->full_charge_capacity) / 100;
battery           611 drivers/acpi/battery.c 	if (test_bit(ACPI_BATTERY_QUIRK_THINKPAD_MAH, &battery->flags) &&
battery           612 drivers/acpi/battery.c 	    battery->power_unit && battery->design_voltage) {
battery           613 drivers/acpi/battery.c 		battery->capacity_now = battery->capacity_now *
battery           614 drivers/acpi/battery.c 		    10000 / battery->design_voltage;
battery           616 drivers/acpi/battery.c 	if (test_bit(ACPI_BATTERY_QUIRK_DEGRADED_FULL_CHARGE, &battery->flags) &&
battery           617 drivers/acpi/battery.c 	    battery->capacity_now > battery->full_charge_capacity)
battery           618 drivers/acpi/battery.c 		battery->capacity_now = battery->full_charge_capacity;
battery           623 drivers/acpi/battery.c static int acpi_battery_set_alarm(struct acpi_battery *battery)
battery           627 drivers/acpi/battery.c 	if (!acpi_battery_present(battery) ||
battery           628 drivers/acpi/battery.c 	    !test_bit(ACPI_BATTERY_ALARM_PRESENT, &battery->flags))
battery           631 drivers/acpi/battery.c 	mutex_lock(&battery->lock);
battery           632 drivers/acpi/battery.c 	status = acpi_execute_simple_method(battery->device->handle, "_BTP",
battery           633 drivers/acpi/battery.c 					    battery->alarm);
battery           634 drivers/acpi/battery.c 	mutex_unlock(&battery->lock);
battery           639 drivers/acpi/battery.c 	ACPI_DEBUG_PRINT((ACPI_DB_INFO, "Alarm set to %d\n", battery->alarm));
battery           643 drivers/acpi/battery.c static int acpi_battery_init_alarm(struct acpi_battery *battery)
battery           646 drivers/acpi/battery.c 	if (!acpi_has_method(battery->device->handle, "_BTP")) {
battery           647 drivers/acpi/battery.c 		clear_bit(ACPI_BATTERY_ALARM_PRESENT, &battery->flags);
battery           650 drivers/acpi/battery.c 	set_bit(ACPI_BATTERY_ALARM_PRESENT, &battery->flags);
battery           651 drivers/acpi/battery.c 	if (!battery->alarm)
battery           652 drivers/acpi/battery.c 		battery->alarm = battery->design_capacity_warning;
battery           653 drivers/acpi/battery.c 	return acpi_battery_set_alarm(battery);
battery           660 drivers/acpi/battery.c 	struct acpi_battery *battery = to_acpi_battery(dev_get_drvdata(dev));
battery           661 drivers/acpi/battery.c 	return sprintf(buf, "%d\n", battery->alarm * 1000);
battery           669 drivers/acpi/battery.c 	struct acpi_battery *battery = to_acpi_battery(dev_get_drvdata(dev));
battery           671 drivers/acpi/battery.c 		battery->alarm = x/1000;
battery           672 drivers/acpi/battery.c 	if (acpi_battery_present(battery))
battery           673 drivers/acpi/battery.c 		acpi_battery_set_alarm(battery);
battery           698 drivers/acpi/battery.c 	struct acpi_battery *battery;
battery           705 drivers/acpi/battery.c 	list_for_each_entry(battery, &acpi_battery_list, list) {
battery           706 drivers/acpi/battery.c 		hook->remove_battery(battery->bat);
battery           722 drivers/acpi/battery.c 	struct acpi_battery *battery;
battery           733 drivers/acpi/battery.c 	list_for_each_entry(battery, &acpi_battery_list, list) {
battery           734 drivers/acpi/battery.c 		if (hook->add_battery(battery->bat)) {
battery           757 drivers/acpi/battery.c static void battery_hook_add_battery(struct acpi_battery *battery)
battery           762 drivers/acpi/battery.c 	INIT_LIST_HEAD(&battery->list);
battery           763 drivers/acpi/battery.c 	list_add(&battery->list, &acpi_battery_list);
battery           772 drivers/acpi/battery.c 		if (hook_node->add_battery(battery->bat)) {
battery           785 drivers/acpi/battery.c static void battery_hook_remove_battery(struct acpi_battery *battery)
battery           795 drivers/acpi/battery.c 		hook->remove_battery(battery->bat);
battery           798 drivers/acpi/battery.c 	list_del(&battery->list);
battery           817 drivers/acpi/battery.c static int sysfs_add_battery(struct acpi_battery *battery)
battery           819 drivers/acpi/battery.c 	struct power_supply_config psy_cfg = { .drv_data = battery, };
battery           822 drivers/acpi/battery.c 	if (!ACPI_BATTERY_CAPACITY_VALID(battery->full_charge_capacity) &&
battery           823 drivers/acpi/battery.c 	    !ACPI_BATTERY_CAPACITY_VALID(battery->design_capacity))
battery           826 drivers/acpi/battery.c 	if (battery->power_unit == ACPI_BATTERY_POWER_UNIT_MA) {
battery           828 drivers/acpi/battery.c 			battery->bat_desc.properties =
battery           830 drivers/acpi/battery.c 			battery->bat_desc.num_properties =
battery           833 drivers/acpi/battery.c 			battery->bat_desc.properties = charge_battery_props;
battery           834 drivers/acpi/battery.c 			battery->bat_desc.num_properties =
battery           839 drivers/acpi/battery.c 			battery->bat_desc.properties =
battery           841 drivers/acpi/battery.c 			battery->bat_desc.num_properties =
battery           844 drivers/acpi/battery.c 			battery->bat_desc.properties = energy_battery_props;
battery           845 drivers/acpi/battery.c 			battery->bat_desc.num_properties =
battery           850 drivers/acpi/battery.c 	battery->bat_desc.name = acpi_device_bid(battery->device);
battery           851 drivers/acpi/battery.c 	battery->bat_desc.type = POWER_SUPPLY_TYPE_BATTERY;
battery           852 drivers/acpi/battery.c 	battery->bat_desc.get_property = acpi_battery_get_property;
battery           854 drivers/acpi/battery.c 	battery->bat = power_supply_register_no_ws(&battery->device->dev,
battery           855 drivers/acpi/battery.c 				&battery->bat_desc, &psy_cfg);
battery           857 drivers/acpi/battery.c 	if (IS_ERR(battery->bat)) {
battery           858 drivers/acpi/battery.c 		int result = PTR_ERR(battery->bat);
battery           860 drivers/acpi/battery.c 		battery->bat = NULL;
battery           863 drivers/acpi/battery.c 	battery_hook_add_battery(battery);
battery           864 drivers/acpi/battery.c 	return device_create_file(&battery->bat->dev, &alarm_attr);
battery           867 drivers/acpi/battery.c static void sysfs_remove_battery(struct acpi_battery *battery)
battery           869 drivers/acpi/battery.c 	mutex_lock(&battery->sysfs_lock);
battery           870 drivers/acpi/battery.c 	if (!battery->bat) {
battery           871 drivers/acpi/battery.c 		mutex_unlock(&battery->sysfs_lock);
battery           874 drivers/acpi/battery.c 	battery_hook_remove_battery(battery);
battery           875 drivers/acpi/battery.c 	device_remove_file(&battery->bat->dev, &alarm_attr);
battery           876 drivers/acpi/battery.c 	power_supply_unregister(battery->bat);
battery           877 drivers/acpi/battery.c 	battery->bat = NULL;
battery           878 drivers/acpi/battery.c 	mutex_unlock(&battery->sysfs_lock);
battery           883 drivers/acpi/battery.c 	struct acpi_battery *battery = (struct acpi_battery *)private;
battery           891 drivers/acpi/battery.c 		if (battery->design_capacity * battery->design_voltage / 1000
battery           893 drivers/acpi/battery.c 		    battery->design_capacity * 10 == dmi_capacity)
battery           895 drivers/acpi/battery.c 				&battery->flags);
battery           911 drivers/acpi/battery.c static void acpi_battery_quirks(struct acpi_battery *battery)
battery           913 drivers/acpi/battery.c 	if (test_bit(ACPI_BATTERY_QUIRK_PERCENTAGE_CAPACITY, &battery->flags))
battery           916 drivers/acpi/battery.c 	if (battery->full_charge_capacity == 100 &&
battery           917 drivers/acpi/battery.c 		battery->rate_now == ACPI_BATTERY_VALUE_UNKNOWN &&
battery           918 drivers/acpi/battery.c 		battery->capacity_now >= 0 && battery->capacity_now <= 100) {
battery           919 drivers/acpi/battery.c 		set_bit(ACPI_BATTERY_QUIRK_PERCENTAGE_CAPACITY, &battery->flags);
battery           920 drivers/acpi/battery.c 		battery->full_charge_capacity = battery->design_capacity;
battery           921 drivers/acpi/battery.c 		battery->capacity_now = (battery->capacity_now *
battery           922 drivers/acpi/battery.c 				battery->full_charge_capacity) / 100;
battery           925 drivers/acpi/battery.c 	if (test_bit(ACPI_BATTERY_QUIRK_THINKPAD_MAH, &battery->flags))
battery           928 drivers/acpi/battery.c 	if (battery->power_unit && dmi_name_in_vendors("LENOVO")) {
battery           932 drivers/acpi/battery.c 			dmi_walk(find_battery, battery);
battery           934 drivers/acpi/battery.c 				     &battery->flags) &&
battery           935 drivers/acpi/battery.c 			    battery->design_voltage) {
battery           936 drivers/acpi/battery.c 				battery->design_capacity =
battery           937 drivers/acpi/battery.c 				    battery->design_capacity *
battery           938 drivers/acpi/battery.c 				    10000 / battery->design_voltage;
battery           939 drivers/acpi/battery.c 				battery->full_charge_capacity =
battery           940 drivers/acpi/battery.c 				    battery->full_charge_capacity *
battery           941 drivers/acpi/battery.c 				    10000 / battery->design_voltage;
battery           942 drivers/acpi/battery.c 				battery->design_capacity_warning =
battery           943 drivers/acpi/battery.c 				    battery->design_capacity_warning *
battery           944 drivers/acpi/battery.c 				    10000 / battery->design_voltage;
battery           945 drivers/acpi/battery.c 				battery->capacity_now = battery->capacity_now *
battery           946 drivers/acpi/battery.c 				    10000 / battery->design_voltage;
battery           951 drivers/acpi/battery.c 	if (test_bit(ACPI_BATTERY_QUIRK_DEGRADED_FULL_CHARGE, &battery->flags))
battery           954 drivers/acpi/battery.c 	if (acpi_battery_is_degraded(battery) &&
battery           955 drivers/acpi/battery.c 	    battery->capacity_now > battery->full_charge_capacity) {
battery           956 drivers/acpi/battery.c 		set_bit(ACPI_BATTERY_QUIRK_DEGRADED_FULL_CHARGE, &battery->flags);
battery           957 drivers/acpi/battery.c 		battery->capacity_now = battery->full_charge_capacity;
battery           961 drivers/acpi/battery.c static int acpi_battery_update(struct acpi_battery *battery, bool resume)
battery           963 drivers/acpi/battery.c 	int result = acpi_battery_get_status(battery);
battery           968 drivers/acpi/battery.c 	if (!acpi_battery_present(battery)) {
battery           969 drivers/acpi/battery.c 		sysfs_remove_battery(battery);
battery           970 drivers/acpi/battery.c 		battery->update_time = 0;
battery           977 drivers/acpi/battery.c 	if (!battery->update_time) {
battery           978 drivers/acpi/battery.c 		result = acpi_battery_get_info(battery);
battery           981 drivers/acpi/battery.c 		acpi_battery_init_alarm(battery);
battery           984 drivers/acpi/battery.c 	result = acpi_battery_get_state(battery);
battery           987 drivers/acpi/battery.c 	acpi_battery_quirks(battery);
battery           989 drivers/acpi/battery.c 	if (!battery->bat) {
battery           990 drivers/acpi/battery.c 		result = sysfs_add_battery(battery);
battery           999 drivers/acpi/battery.c 	if ((battery->state & ACPI_BATTERY_STATE_CRITICAL) ||
battery          1000 drivers/acpi/battery.c 	    (test_bit(ACPI_BATTERY_ALARM_PRESENT, &battery->flags) &&
battery          1001 drivers/acpi/battery.c             (battery->capacity_now <= battery->alarm)))
battery          1002 drivers/acpi/battery.c 		acpi_pm_wakeup_event(&battery->device->dev);
battery          1007 drivers/acpi/battery.c static void acpi_battery_refresh(struct acpi_battery *battery)
battery          1011 drivers/acpi/battery.c 	if (!battery->bat)
battery          1014 drivers/acpi/battery.c 	power_unit = battery->power_unit;
battery          1016 drivers/acpi/battery.c 	acpi_battery_get_info(battery);
battery          1018 drivers/acpi/battery.c 	if (power_unit == battery->power_unit)
battery          1022 drivers/acpi/battery.c 	sysfs_remove_battery(battery);
battery          1023 drivers/acpi/battery.c 	sysfs_add_battery(battery);
battery          1033 drivers/acpi/battery.c static const char *acpi_battery_units(const struct acpi_battery *battery)
battery          1035 drivers/acpi/battery.c 	return (battery->power_unit == ACPI_BATTERY_POWER_UNIT_MA) ?
battery          1041 drivers/acpi/battery.c 	struct acpi_battery *battery = seq->private;
battery          1042 drivers/acpi/battery.c 	int result = acpi_battery_update(battery, false);
battery          1048 drivers/acpi/battery.c 		   acpi_battery_present(battery) ? "yes" : "no");
battery          1049 drivers/acpi/battery.c 	if (!acpi_battery_present(battery))
battery          1051 drivers/acpi/battery.c 	if (battery->design_capacity == ACPI_BATTERY_VALUE_UNKNOWN)
battery          1055 drivers/acpi/battery.c 			   battery->design_capacity,
battery          1056 drivers/acpi/battery.c 			   acpi_battery_units(battery));
battery          1058 drivers/acpi/battery.c 	if (battery->full_charge_capacity == ACPI_BATTERY_VALUE_UNKNOWN)
battery          1062 drivers/acpi/battery.c 			   battery->full_charge_capacity,
battery          1063 drivers/acpi/battery.c 			   acpi_battery_units(battery));
battery          1066 drivers/acpi/battery.c 		   battery->technology ? "" : "non-");
battery          1068 drivers/acpi/battery.c 	if (battery->design_voltage == ACPI_BATTERY_VALUE_UNKNOWN)
battery          1072 drivers/acpi/battery.c 			   battery->design_voltage);
battery          1074 drivers/acpi/battery.c 		   battery->design_capacity_warning,
battery          1075 drivers/acpi/battery.c 		   acpi_battery_units(battery));
battery          1077 drivers/acpi/battery.c 		   battery->design_capacity_low,
battery          1078 drivers/acpi/battery.c 		   acpi_battery_units(battery));
battery          1079 drivers/acpi/battery.c 	seq_printf(seq, "cycle count:		  %i\n", battery->cycle_count);
battery          1081 drivers/acpi/battery.c 		   battery->capacity_granularity_1,
battery          1082 drivers/acpi/battery.c 		   acpi_battery_units(battery));
battery          1084 drivers/acpi/battery.c 		   battery->capacity_granularity_2,
battery          1085 drivers/acpi/battery.c 		   acpi_battery_units(battery));
battery          1086 drivers/acpi/battery.c 	seq_printf(seq, "model number:            %s\n", battery->model_number);
battery          1087 drivers/acpi/battery.c 	seq_printf(seq, "serial number:           %s\n", battery->serial_number);
battery          1088 drivers/acpi/battery.c 	seq_printf(seq, "battery type:            %s\n", battery->type);
battery          1089 drivers/acpi/battery.c 	seq_printf(seq, "OEM info:                %s\n", battery->oem_info);
battery          1098 drivers/acpi/battery.c 	struct acpi_battery *battery = seq->private;
battery          1099 drivers/acpi/battery.c 	int result = acpi_battery_update(battery, false);
battery          1105 drivers/acpi/battery.c 		   acpi_battery_present(battery) ? "yes" : "no");
battery          1106 drivers/acpi/battery.c 	if (!acpi_battery_present(battery))
battery          1110 drivers/acpi/battery.c 			(battery->state & 0x04) ? "critical" : "ok");
battery          1111 drivers/acpi/battery.c 	if ((battery->state & 0x01) && (battery->state & 0x02))
battery          1114 drivers/acpi/battery.c 	else if (battery->state & 0x01)
battery          1116 drivers/acpi/battery.c 	else if (battery->state & 0x02)
battery          1121 drivers/acpi/battery.c 	if (battery->rate_now == ACPI_BATTERY_VALUE_UNKNOWN)
battery          1125 drivers/acpi/battery.c 			   battery->rate_now, acpi_battery_units(battery));
battery          1127 drivers/acpi/battery.c 	if (battery->capacity_now == ACPI_BATTERY_VALUE_UNKNOWN)
battery          1131 drivers/acpi/battery.c 			   battery->capacity_now, acpi_battery_units(battery));
battery          1132 drivers/acpi/battery.c 	if (battery->voltage_now == ACPI_BATTERY_VALUE_UNKNOWN)
battery          1136 drivers/acpi/battery.c 			   battery->voltage_now);
battery          1146 drivers/acpi/battery.c 	struct acpi_battery *battery = seq->private;
battery          1147 drivers/acpi/battery.c 	int result = acpi_battery_update(battery, false);
battery          1152 drivers/acpi/battery.c 	if (!acpi_battery_present(battery)) {
battery          1157 drivers/acpi/battery.c 	if (battery->alarm) {
battery          1158 drivers/acpi/battery.c 		seq_printf(seq, "%u %sh\n", battery->alarm,
battery          1159 drivers/acpi/battery.c 				acpi_battery_units(battery));
battery          1176 drivers/acpi/battery.c 	struct acpi_battery *battery = m->private;
battery          1178 drivers/acpi/battery.c 	if (!battery || (count > sizeof(alarm_string) - 1))
battery          1180 drivers/acpi/battery.c 	if (!acpi_battery_present(battery)) {
battery          1189 drivers/acpi/battery.c 	if (kstrtoint(alarm_string, 0, &battery->alarm)) {
battery          1193 drivers/acpi/battery.c 	result = acpi_battery_set_alarm(battery);
battery          1253 drivers/acpi/battery.c 	struct acpi_battery *battery = acpi_driver_data(device);
battery          1256 drivers/acpi/battery.c 	if (!battery)
battery          1258 drivers/acpi/battery.c 	old = battery->bat;
battery          1268 drivers/acpi/battery.c 		acpi_battery_refresh(battery);
battery          1269 drivers/acpi/battery.c 	acpi_battery_update(battery, false);
battery          1272 drivers/acpi/battery.c 					acpi_battery_present(battery));
battery          1273 drivers/acpi/battery.c 	acpi_notifier_call_chain(device, event, acpi_battery_present(battery));
battery          1275 drivers/acpi/battery.c 	if (old && battery->bat)
battery          1276 drivers/acpi/battery.c 		power_supply_changed(battery->bat);
battery          1282 drivers/acpi/battery.c 	struct acpi_battery *battery = container_of(nb, struct acpi_battery,
battery          1289 drivers/acpi/battery.c 		if (!acpi_battery_present(battery))
battery          1292 drivers/acpi/battery.c 		if (battery->bat) {
battery          1293 drivers/acpi/battery.c 			acpi_battery_refresh(battery);
battery          1295 drivers/acpi/battery.c 			result = acpi_battery_get_info(battery);
battery          1299 drivers/acpi/battery.c 			result = sysfs_add_battery(battery);
battery          1304 drivers/acpi/battery.c 		acpi_battery_init_alarm(battery);
battery          1305 drivers/acpi/battery.c 		acpi_battery_get_state(battery);
battery          1395 drivers/acpi/battery.c static int acpi_battery_update_retry(struct acpi_battery *battery)
battery          1400 drivers/acpi/battery.c 		ret = acpi_battery_update(battery, false);
battery          1412 drivers/acpi/battery.c 	struct acpi_battery *battery = NULL;
battery          1420 drivers/acpi/battery.c 	battery = kzalloc(sizeof(struct acpi_battery), GFP_KERNEL);
battery          1421 drivers/acpi/battery.c 	if (!battery)
battery          1423 drivers/acpi/battery.c 	battery->device = device;
battery          1426 drivers/acpi/battery.c 	device->driver_data = battery;
battery          1427 drivers/acpi/battery.c 	mutex_init(&battery->lock);
battery          1428 drivers/acpi/battery.c 	mutex_init(&battery->sysfs_lock);
battery          1429 drivers/acpi/battery.c 	if (acpi_has_method(battery->device->handle, "_BIX"))
battery          1430 drivers/acpi/battery.c 		set_bit(ACPI_BATTERY_XINFO_PRESENT, &battery->flags);
battery          1432 drivers/acpi/battery.c 	result = acpi_battery_update_retry(battery);
battery          1448 drivers/acpi/battery.c 	battery->pm_nb.notifier_call = battery_notify;
battery          1449 drivers/acpi/battery.c 	register_pm_notifier(&battery->pm_nb);
battery          1456 drivers/acpi/battery.c 	sysfs_remove_battery(battery);
battery          1457 drivers/acpi/battery.c 	mutex_destroy(&battery->lock);
battery          1458 drivers/acpi/battery.c 	mutex_destroy(&battery->sysfs_lock);
battery          1459 drivers/acpi/battery.c 	kfree(battery);
battery          1465 drivers/acpi/battery.c 	struct acpi_battery *battery = NULL;
battery          1470 drivers/acpi/battery.c 	battery = acpi_driver_data(device);
battery          1471 drivers/acpi/battery.c 	unregister_pm_notifier(&battery->pm_nb);
battery          1475 drivers/acpi/battery.c 	sysfs_remove_battery(battery);
battery          1476 drivers/acpi/battery.c 	mutex_destroy(&battery->lock);
battery          1477 drivers/acpi/battery.c 	mutex_destroy(&battery->sysfs_lock);
battery          1478 drivers/acpi/battery.c 	kfree(battery);
battery          1486 drivers/acpi/battery.c 	struct acpi_battery *battery;
battery          1491 drivers/acpi/battery.c 	battery = acpi_driver_data(to_acpi_device(dev));
battery          1492 drivers/acpi/battery.c 	if (!battery)
battery          1495 drivers/acpi/battery.c 	battery->update_time = 0;
battery          1496 drivers/acpi/battery.c 	acpi_battery_update(battery, true);
battery            93 drivers/acpi/sbs.c 	struct acpi_battery battery[MAX_SBS_BAT];
battery           103 drivers/acpi/sbs.c static int acpi_battery_get_state(struct acpi_battery *battery);
battery           113 drivers/acpi/sbs.c static inline int acpi_battery_vscale(struct acpi_battery *battery)
battery           115 drivers/acpi/sbs.c 	return battery_scale((battery->spec & 0x0f00) >> 8);
battery           118 drivers/acpi/sbs.c static inline int acpi_battery_ipscale(struct acpi_battery *battery)
battery           120 drivers/acpi/sbs.c 	return battery_scale((battery->spec & 0xf000) >> 12);
battery           123 drivers/acpi/sbs.c static inline int acpi_battery_mode(struct acpi_battery *battery)
battery           125 drivers/acpi/sbs.c 	return (battery->mode & 0x8000);
battery           128 drivers/acpi/sbs.c static inline int acpi_battery_scale(struct acpi_battery *battery)
battery           130 drivers/acpi/sbs.c 	return (acpi_battery_mode(battery) ? 10 : 1) *
battery           131 drivers/acpi/sbs.c 	    acpi_battery_ipscale(battery);
battery           149 drivers/acpi/sbs.c static int acpi_battery_technology(struct acpi_battery *battery)
battery           151 drivers/acpi/sbs.c 	if (!strcasecmp("NiCd", battery->device_chemistry))
battery           153 drivers/acpi/sbs.c 	if (!strcasecmp("NiMH", battery->device_chemistry))
battery           155 drivers/acpi/sbs.c 	if (!strcasecmp("LION", battery->device_chemistry))
battery           157 drivers/acpi/sbs.c 	if (!strcasecmp("LiP", battery->device_chemistry))
battery           166 drivers/acpi/sbs.c 	struct acpi_battery *battery = to_acpi_battery(psy);
battery           168 drivers/acpi/sbs.c 	if ((!battery->present) && psp != POWER_SUPPLY_PROP_PRESENT)
battery           171 drivers/acpi/sbs.c 	acpi_battery_get_state(battery);
battery           174 drivers/acpi/sbs.c 		if (battery->rate_now < 0)
battery           176 drivers/acpi/sbs.c 		else if (battery->rate_now > 0)
battery           182 drivers/acpi/sbs.c 		val->intval = battery->present;
battery           185 drivers/acpi/sbs.c 		val->intval = acpi_battery_technology(battery);
battery           188 drivers/acpi/sbs.c 		val->intval = battery->cycle_count;
battery           191 drivers/acpi/sbs.c 		val->intval = battery->design_voltage *
battery           192 drivers/acpi/sbs.c 			acpi_battery_vscale(battery) * 1000;
battery           195 drivers/acpi/sbs.c 		val->intval = battery->voltage_now *
battery           196 drivers/acpi/sbs.c 				acpi_battery_vscale(battery) * 1000;
battery           200 drivers/acpi/sbs.c 		val->intval = abs(battery->rate_now) *
battery           201 drivers/acpi/sbs.c 				acpi_battery_ipscale(battery) * 1000;
battery           202 drivers/acpi/sbs.c 		val->intval *= (acpi_battery_mode(battery)) ?
battery           203 drivers/acpi/sbs.c 				(battery->voltage_now *
battery           204 drivers/acpi/sbs.c 				acpi_battery_vscale(battery) / 1000) : 1;
battery           208 drivers/acpi/sbs.c 		val->intval = abs(battery->rate_avg) *
battery           209 drivers/acpi/sbs.c 				acpi_battery_ipscale(battery) * 1000;
battery           210 drivers/acpi/sbs.c 		val->intval *= (acpi_battery_mode(battery)) ?
battery           211 drivers/acpi/sbs.c 				(battery->voltage_now *
battery           212 drivers/acpi/sbs.c 				acpi_battery_vscale(battery) / 1000) : 1;
battery           215 drivers/acpi/sbs.c 		val->intval = battery->state_of_charge;
battery           219 drivers/acpi/sbs.c 		val->intval = battery->design_capacity *
battery           220 drivers/acpi/sbs.c 			acpi_battery_scale(battery) * 1000;
battery           224 drivers/acpi/sbs.c 		val->intval = battery->full_charge_capacity *
battery           225 drivers/acpi/sbs.c 			acpi_battery_scale(battery) * 1000;
battery           229 drivers/acpi/sbs.c 		val->intval = battery->capacity_now *
battery           230 drivers/acpi/sbs.c 				acpi_battery_scale(battery) * 1000;
battery           233 drivers/acpi/sbs.c 		val->intval = battery->temp_now - 2730;	// dK -> dC
battery           236 drivers/acpi/sbs.c 		val->strval = battery->device_name;
battery           239 drivers/acpi/sbs.c 		val->strval = battery->manufacturer_name;
battery           342 drivers/acpi/sbs.c static int acpi_battery_get_info(struct acpi_battery *battery)
battery           347 drivers/acpi/sbs.c 		result = acpi_smbus_read(battery->sbs->hc,
battery           351 drivers/acpi/sbs.c 					 (u8 *) battery +
battery           359 drivers/acpi/sbs.c static int acpi_battery_get_state(struct acpi_battery *battery)
battery           363 drivers/acpi/sbs.c 	if (battery->update_time &&
battery           364 drivers/acpi/sbs.c 	    time_before(jiffies, battery->update_time +
battery           368 drivers/acpi/sbs.c 		result = acpi_smbus_read(battery->sbs->hc,
battery           372 drivers/acpi/sbs.c 				         (u8 *)battery +
battery           378 drivers/acpi/sbs.c 	battery->update_time = jiffies;
battery           382 drivers/acpi/sbs.c static int acpi_battery_get_alarm(struct acpi_battery *battery)
battery           384 drivers/acpi/sbs.c 	return acpi_smbus_read(battery->sbs->hc, SMBUS_READ_WORD,
battery           386 drivers/acpi/sbs.c 				 (u8 *)&battery->alarm_capacity);
battery           389 drivers/acpi/sbs.c static int acpi_battery_set_alarm(struct acpi_battery *battery)
battery           391 drivers/acpi/sbs.c 	struct acpi_sbs *sbs = battery->sbs;
battery           392 drivers/acpi/sbs.c 	u16 value, sel = 1 << (battery->id + 12);
battery           413 drivers/acpi/sbs.c 				0x01, (u8 *)&battery->alarm_capacity, 2);
battery           448 drivers/acpi/sbs.c 	struct acpi_battery *battery = to_acpi_battery(dev_get_drvdata(dev));
battery           449 drivers/acpi/sbs.c 	acpi_battery_get_alarm(battery);
battery           450 drivers/acpi/sbs.c 	return sprintf(buf, "%d\n", battery->alarm_capacity *
battery           451 drivers/acpi/sbs.c 				acpi_battery_scale(battery) * 1000);
battery           459 drivers/acpi/sbs.c 	struct acpi_battery *battery = to_acpi_battery(dev_get_drvdata(dev));
battery           461 drivers/acpi/sbs.c 		battery->alarm_capacity = x /
battery           462 drivers/acpi/sbs.c 			(1000 * acpi_battery_scale(battery));
battery           463 drivers/acpi/sbs.c 	if (battery->present)
battery           464 drivers/acpi/sbs.c 		acpi_battery_set_alarm(battery);
battery           477 drivers/acpi/sbs.c static int acpi_battery_read(struct acpi_battery *battery)
battery           479 drivers/acpi/sbs.c 	int result = 0, saved_present = battery->present;
battery           482 drivers/acpi/sbs.c 	if (battery->sbs->manager_present) {
battery           483 drivers/acpi/sbs.c 		result = acpi_smbus_read(battery->sbs->hc, SMBUS_READ_WORD,
battery           486 drivers/acpi/sbs.c 			battery->present = state & (1 << battery->id);
battery           488 drivers/acpi/sbs.c 		state |= 1 << (battery->id + 12);
battery           489 drivers/acpi/sbs.c 		acpi_smbus_write(battery->sbs->hc, SMBUS_WRITE_WORD,
battery           491 drivers/acpi/sbs.c 	} else if (battery->id == 0)
battery           492 drivers/acpi/sbs.c 		battery->present = 1;
battery           494 drivers/acpi/sbs.c 	if (result || !battery->present)
battery           497 drivers/acpi/sbs.c 	if (saved_present != battery->present) {
battery           498 drivers/acpi/sbs.c 		battery->update_time = 0;
battery           499 drivers/acpi/sbs.c 		result = acpi_battery_get_info(battery);
battery           501 drivers/acpi/sbs.c 			battery->present = 0;
battery           505 drivers/acpi/sbs.c 	result = acpi_battery_get_state(battery);
battery           507 drivers/acpi/sbs.c 		battery->present = 0;
battery           514 drivers/acpi/sbs.c 	struct acpi_battery *battery = &sbs->battery[id];
battery           515 drivers/acpi/sbs.c 	struct power_supply_config psy_cfg = { .drv_data = battery, };
battery           518 drivers/acpi/sbs.c 	battery->id = id;
battery           519 drivers/acpi/sbs.c 	battery->sbs = sbs;
battery           520 drivers/acpi/sbs.c 	result = acpi_battery_read(battery);
battery           524 drivers/acpi/sbs.c 	sprintf(battery->name, ACPI_BATTERY_DIR_NAME, id);
battery           525 drivers/acpi/sbs.c 	battery->bat_desc.name = battery->name;
battery           526 drivers/acpi/sbs.c 	battery->bat_desc.type = POWER_SUPPLY_TYPE_BATTERY;
battery           527 drivers/acpi/sbs.c 	if (!acpi_battery_mode(battery)) {
battery           528 drivers/acpi/sbs.c 		battery->bat_desc.properties = sbs_charge_battery_props;
battery           529 drivers/acpi/sbs.c 		battery->bat_desc.num_properties =
battery           532 drivers/acpi/sbs.c 		battery->bat_desc.properties = sbs_energy_battery_props;
battery           533 drivers/acpi/sbs.c 		battery->bat_desc.num_properties =
battery           536 drivers/acpi/sbs.c 	battery->bat_desc.get_property = acpi_sbs_battery_get_property;
battery           537 drivers/acpi/sbs.c 	battery->bat = power_supply_register(&sbs->device->dev,
battery           538 drivers/acpi/sbs.c 					&battery->bat_desc, &psy_cfg);
battery           539 drivers/acpi/sbs.c 	if (IS_ERR(battery->bat)) {
battery           540 drivers/acpi/sbs.c 		result = PTR_ERR(battery->bat);
battery           541 drivers/acpi/sbs.c 		battery->bat = NULL;
battery           545 drivers/acpi/sbs.c 	result = device_create_file(&battery->bat->dev, &alarm_attr);
battery           548 drivers/acpi/sbs.c 	battery->have_sysfs_alarm = 1;
battery           552 drivers/acpi/sbs.c 	       battery->name, battery->present ? "present" : "absent");
battery           558 drivers/acpi/sbs.c 	struct acpi_battery *battery = &sbs->battery[id];
battery           560 drivers/acpi/sbs.c 	if (battery->bat) {
battery           561 drivers/acpi/sbs.c 		if (battery->have_sysfs_alarm)
battery           562 drivers/acpi/sbs.c 			device_remove_file(&battery->bat->dev, &alarm_attr);
battery           563 drivers/acpi/sbs.c 		power_supply_unregister(battery->bat);
battery           614 drivers/acpi/sbs.c 			bat = &sbs->battery[id];
battery           130 drivers/block/umem.c 	} battery[2];
battery           654 drivers/block/umem.c 	if (card->battery[0].good && card->battery[1].good)
battery           656 drivers/block/umem.c 	else if (card->battery[0].warned || card->battery[1].warned)
battery           658 drivers/block/umem.c 	else if (!card->battery[0].good && !card->battery[1].good)
battery           666 drivers/block/umem.c static int check_battery(struct cardinfo *card, int battery, int status)
battery           668 drivers/block/umem.c 	if (status != card->battery[battery].good) {
battery           669 drivers/block/umem.c 		card->battery[battery].good = !card->battery[battery].good;
battery           670 drivers/block/umem.c 		card->battery[battery].last_change = jiffies;
battery           672 drivers/block/umem.c 		if (card->battery[battery].good) {
battery           674 drivers/block/umem.c 				"Battery %d now good\n", battery + 1);
battery           675 drivers/block/umem.c 			card->battery[battery].warned = 0;
battery           678 drivers/block/umem.c 				"Battery %d now FAILED\n", battery + 1);
battery           681 drivers/block/umem.c 	} else if (!card->battery[battery].good &&
battery           682 drivers/block/umem.c 		   !card->battery[battery].warned &&
battery           683 drivers/block/umem.c 		   time_after_eq(jiffies, card->battery[battery].last_change +
battery           686 drivers/block/umem.c 			"Battery %d still FAILED after 5 hours\n", battery + 1);
battery           687 drivers/block/umem.c 		card->battery[battery].warned = 1;
battery           927 drivers/block/umem.c 	card->battery[0].good = !(batt_status & BATTERY_1_FAILURE);
battery           928 drivers/block/umem.c 	card->battery[1].good = !(batt_status & BATTERY_2_FAILURE);
battery           929 drivers/block/umem.c 	card->battery[0].last_change = card->battery[1].last_change = jiffies;
battery           939 drivers/block/umem.c 		       card->battery[0].good ? "OK" : "FAILURE",
battery           941 drivers/block/umem.c 		       card->battery[1].good ? "OK" : "FAILURE");
battery           114 drivers/hid/hid-asus.c 	struct power_supply *battery;
battery           278 drivers/hid/hid-asus.c 	if (drvdata->battery && data[0] == BATTERY_REPORT_ID)
battery           492 drivers/hid/hid-asus.c 		power_supply_changed(drvdata->battery);
battery           594 drivers/hid/hid-asus.c 	drvdata->battery = devm_power_supply_register(&hdev->dev,
battery           596 drivers/hid/hid-asus.c 	if (IS_ERR(drvdata->battery)) {
battery           597 drivers/hid/hid-asus.c 		ret = PTR_ERR(drvdata->battery);
battery           598 drivers/hid/hid-asus.c 		drvdata->battery = NULL;
battery           603 drivers/hid/hid-asus.c 	power_supply_powers(drvdata->battery, &hdev->dev);
battery           439 drivers/hid/hid-input.c 	if (dev->battery)
battery           492 drivers/hid/hid-input.c 	dev->battery = power_supply_register(&dev->dev, psy_desc, &psy_cfg);
battery           493 drivers/hid/hid-input.c 	if (IS_ERR(dev->battery)) {
battery           494 drivers/hid/hid-input.c 		error = PTR_ERR(dev->battery);
battery           499 drivers/hid/hid-input.c 	power_supply_powers(dev->battery, &dev->dev);
battery           506 drivers/hid/hid-input.c 	dev->battery = NULL;
battery           514 drivers/hid/hid-input.c 	if (!dev->battery)
battery           517 drivers/hid/hid-input.c 	psy_desc = dev->battery->desc;
battery           518 drivers/hid/hid-input.c 	power_supply_unregister(dev->battery);
battery           521 drivers/hid/hid-input.c 	dev->battery = NULL;
battery           528 drivers/hid/hid-input.c 	if (!dev->battery)
battery           540 drivers/hid/hid-input.c 		power_supply_changed(dev->battery);
battery           187 drivers/hid/hid-logitech-hidpp.c 	struct hidpp_battery battery;
battery           633 drivers/hid/hid-logitech-hidpp.c 	hidpp->battery.level =
battery           636 drivers/hid/hid-logitech-hidpp.c 	hidpp->battery.status = status;
battery           638 drivers/hid/hid-logitech-hidpp.c 	hidpp->battery.online = status == POWER_SUPPLY_STATUS_DISCHARGING ||
battery           685 drivers/hid/hid-logitech-hidpp.c 	hidpp->battery.capacity = response.rap.params[0];
battery           687 drivers/hid/hid-logitech-hidpp.c 	hidpp->battery.status = status;
battery           689 drivers/hid/hid-logitech-hidpp.c 	hidpp->battery.online = status == POWER_SUPPLY_STATUS_DISCHARGING ||
battery           706 drivers/hid/hid-logitech-hidpp.c 		capacity = hidpp->battery.capacity;
battery           712 drivers/hid/hid-logitech-hidpp.c 		level = hidpp->battery.level;
battery           719 drivers/hid/hid-logitech-hidpp.c 	changed = capacity != hidpp->battery.capacity ||
battery           720 drivers/hid/hid-logitech-hidpp.c 		  level != hidpp->battery.level ||
battery           721 drivers/hid/hid-logitech-hidpp.c 		  status != hidpp->battery.status;
battery           724 drivers/hid/hid-logitech-hidpp.c 	hidpp->battery.online = status == POWER_SUPPLY_STATUS_DISCHARGING ||
battery           728 drivers/hid/hid-logitech-hidpp.c 		hidpp->battery.level = level;
battery           729 drivers/hid/hid-logitech-hidpp.c 		hidpp->battery.status = status;
battery           730 drivers/hid/hid-logitech-hidpp.c 		if (hidpp->battery.ps)
battery           731 drivers/hid/hid-logitech-hidpp.c 			power_supply_changed(hidpp->battery.ps);
battery          1159 drivers/hid/hid-logitech-hidpp.c 	if (hidpp->battery.feature_index == 0xff) {
battery          1162 drivers/hid/hid-logitech-hidpp.c 					     &hidpp->battery.feature_index,
battery          1169 drivers/hid/hid-logitech-hidpp.c 						hidpp->battery.feature_index,
battery          1176 drivers/hid/hid-logitech-hidpp.c 						hidpp->battery.feature_index);
battery          1180 drivers/hid/hid-logitech-hidpp.c 	hidpp->battery.status = status;
battery          1181 drivers/hid/hid-logitech-hidpp.c 	hidpp->battery.capacity = capacity;
battery          1182 drivers/hid/hid-logitech-hidpp.c 	hidpp->battery.level = level;
battery          1184 drivers/hid/hid-logitech-hidpp.c 	hidpp->battery.online = status == POWER_SUPPLY_STATUS_DISCHARGING ||
battery          1197 drivers/hid/hid-logitech-hidpp.c 	if (report->fap.feature_index != hidpp->battery.feature_index ||
battery          1207 drivers/hid/hid-logitech-hidpp.c 	hidpp->battery.online = status == POWER_SUPPLY_STATUS_DISCHARGING ||
battery          1210 drivers/hid/hid-logitech-hidpp.c 	changed = capacity != hidpp->battery.capacity ||
battery          1211 drivers/hid/hid-logitech-hidpp.c 		  level != hidpp->battery.level ||
battery          1212 drivers/hid/hid-logitech-hidpp.c 		  status != hidpp->battery.status;
battery          1215 drivers/hid/hid-logitech-hidpp.c 		hidpp->battery.level = level;
battery          1216 drivers/hid/hid-logitech-hidpp.c 		hidpp->battery.capacity = capacity;
battery          1217 drivers/hid/hid-logitech-hidpp.c 		hidpp->battery.status = status;
battery          1218 drivers/hid/hid-logitech-hidpp.c 		if (hidpp->battery.ps)
battery          1219 drivers/hid/hid-logitech-hidpp.c 			power_supply_changed(hidpp->battery.ps);
battery          1245 drivers/hid/hid-logitech-hidpp.c 			val->intval = hidpp->battery.status;
battery          1248 drivers/hid/hid-logitech-hidpp.c 			val->intval = hidpp->battery.capacity;
battery          1251 drivers/hid/hid-logitech-hidpp.c 			val->intval = hidpp->battery.level;
battery          1257 drivers/hid/hid-logitech-hidpp.c 			val->intval = hidpp->battery.online;
battery          1391 drivers/hid/hid-logitech-hidpp.c 	if (hidpp->battery.feature_index == 0xff) {
battery          1394 drivers/hid/hid-logitech-hidpp.c 					     &hidpp->battery.solar_feature_index,
battery          1401 drivers/hid/hid-logitech-hidpp.c 					  hidpp->battery.solar_feature_index,
battery          1427 drivers/hid/hid-logitech-hidpp.c 	if (report->fap.feature_index != hidpp->battery.solar_feature_index ||
battery          1445 drivers/hid/hid-logitech-hidpp.c 		if (capacity < hidpp->battery.capacity)
battery          1455 drivers/hid/hid-logitech-hidpp.c 	hidpp->battery.online = true;
battery          1456 drivers/hid/hid-logitech-hidpp.c 	if (capacity != hidpp->battery.capacity ||
battery          1457 drivers/hid/hid-logitech-hidpp.c 	    status != hidpp->battery.status) {
battery          1458 drivers/hid/hid-logitech-hidpp.c 		hidpp->battery.capacity = capacity;
battery          1459 drivers/hid/hid-logitech-hidpp.c 		hidpp->battery.status = status;
battery          1460 drivers/hid/hid-logitech-hidpp.c 		if (hidpp->battery.ps)
battery          1461 drivers/hid/hid-logitech-hidpp.c 			power_supply_changed(hidpp->battery.ps);
battery          3218 drivers/hid/hid-logitech-hidpp.c 	struct power_supply_desc *desc = &hidpp->battery.desc;
battery          3220 drivers/hid/hid-logitech-hidpp.c 	struct hidpp_battery *battery;
battery          3225 drivers/hid/hid-logitech-hidpp.c 	if (hidpp->battery.ps)
battery          3228 drivers/hid/hid-logitech-hidpp.c 	hidpp->battery.feature_index = 0xff;
battery          3229 drivers/hid/hid-logitech-hidpp.c 	hidpp->battery.solar_feature_index = 0xff;
battery          3270 drivers/hid/hid-logitech-hidpp.c 	battery = &hidpp->battery;
battery          3276 drivers/hid/hid-logitech-hidpp.c 	sprintf(battery->name, "hidpp_battery_%ld", n);
battery          3277 drivers/hid/hid-logitech-hidpp.c 	desc->name = battery->name;
battery          3281 drivers/hid/hid-logitech-hidpp.c 	battery->ps = devm_power_supply_register(&hidpp->hid_dev->dev,
battery          3282 drivers/hid/hid-logitech-hidpp.c 						 &battery->desc,
battery          3284 drivers/hid/hid-logitech-hidpp.c 	if (IS_ERR(battery->ps))
battery          3285 drivers/hid/hid-logitech-hidpp.c 		return PTR_ERR(battery->ps);
battery          3287 drivers/hid/hid-logitech-hidpp.c 	power_supply_powers(battery->ps, &hidpp->hid_dev->dev);
battery          3359 drivers/hid/hid-logitech-hidpp.c 		if (hidpp->battery.ps) {
battery          3360 drivers/hid/hid-logitech-hidpp.c 			hidpp->battery.online = false;
battery          3361 drivers/hid/hid-logitech-hidpp.c 			hidpp->battery.status = POWER_SUPPLY_STATUS_UNKNOWN;
battery          3362 drivers/hid/hid-logitech-hidpp.c 			hidpp->battery.level = POWER_SUPPLY_CAPACITY_LEVEL_UNKNOWN;
battery          3363 drivers/hid/hid-logitech-hidpp.c 			power_supply_changed(hidpp->battery.ps);
battery          3435 drivers/hid/hid-logitech-hidpp.c 	if (hidpp->battery.ps)
battery          3436 drivers/hid/hid-logitech-hidpp.c 		power_supply_changed(hidpp->battery.ps);
battery           549 drivers/hid/hid-sony.c 	struct power_supply *battery;
battery          2362 drivers/hid/hid-sony.c 	sc->battery = devm_power_supply_register(&hdev->dev, &sc->battery_desc,
battery          2364 drivers/hid/hid-sony.c 	if (IS_ERR(sc->battery)) {
battery          2365 drivers/hid/hid-sony.c 		ret = PTR_ERR(sc->battery);
battery          2370 drivers/hid/hid-sony.c 	power_supply_powers(sc->battery, &hdev->dev);
battery           124 drivers/hid/hid-steam.c 	struct power_supply __rcu *battery;
battery           348 drivers/hid/hid-steam.c 	struct power_supply *battery;
battery           369 drivers/hid/hid-steam.c 	battery = power_supply_register(&steam->hdev->dev,
battery           371 drivers/hid/hid-steam.c 	if (IS_ERR(battery)) {
battery           372 drivers/hid/hid-steam.c 		ret = PTR_ERR(battery);
battery           378 drivers/hid/hid-steam.c 	rcu_assign_pointer(steam->battery, battery);
battery           379 drivers/hid/hid-steam.c 	power_supply_powers(battery, &steam->hdev->dev);
battery           486 drivers/hid/hid-steam.c 	struct power_supply *battery;
battery           489 drivers/hid/hid-steam.c 	battery = rcu_dereference(steam->battery);
battery           492 drivers/hid/hid-steam.c 	if (!battery)
battery           494 drivers/hid/hid-steam.c 	RCU_INIT_POINTER(steam->battery, NULL);
battery           496 drivers/hid/hid-steam.c 	power_supply_unregister(battery);
battery           995 drivers/hid/hid-steam.c 		struct power_supply *battery, u8 *data)
battery          1004 drivers/hid/hid-steam.c 	battery = rcu_dereference(steam->battery);
battery          1005 drivers/hid/hid-steam.c 	if (likely(battery)) {
battery          1010 drivers/hid/hid-steam.c 		power_supply_changed(battery);
battery          1021 drivers/hid/hid-steam.c 	struct power_supply *battery;
battery          1076 drivers/hid/hid-steam.c 			battery = rcu_dereference(steam->battery);
battery          1077 drivers/hid/hid-steam.c 			if (likely(battery)) {
battery          1078 drivers/hid/hid-steam.c 				steam_do_battery_event(steam, battery, data);
battery           250 drivers/hid/hid-wiimote-modules.c 	wdata->battery = power_supply_register(&wdata->hdev->dev,
battery           253 drivers/hid/hid-wiimote-modules.c 	if (IS_ERR(wdata->battery)) {
battery           255 drivers/hid/hid-wiimote-modules.c 		ret = PTR_ERR(wdata->battery);
battery           259 drivers/hid/hid-wiimote-modules.c 	power_supply_powers(wdata->battery, &wdata->hdev->dev);
battery           274 drivers/hid/hid-wiimote-modules.c 	power_supply_unregister(wdata->battery);
battery           150 drivers/hid/hid-wiimote.h 	struct power_supply *battery;
battery           136 drivers/hid/wacom.h 	struct power_supply *battery;
battery           154 drivers/hid/wacom.h 		struct wacom_battery battery;
battery           180 drivers/hid/wacom.h 	struct wacom_battery battery;
battery          1691 drivers/hid/wacom_sys.c 	struct wacom_battery *battery = power_supply_get_drvdata(psy);
battery          1696 drivers/hid/wacom_sys.c 			val->strval = battery->wacom->wacom_wac.name;
battery          1699 drivers/hid/wacom_sys.c 			val->intval = battery->bat_connected;
battery          1705 drivers/hid/wacom_sys.c 			val->intval = battery->battery_capacity;
battery          1708 drivers/hid/wacom_sys.c 			if (battery->bat_status != WACOM_POWER_SUPPLY_STATUS_AUTO)
battery          1709 drivers/hid/wacom_sys.c 				val->intval = battery->bat_status;
battery          1710 drivers/hid/wacom_sys.c 			else if (battery->bat_charging)
battery          1712 drivers/hid/wacom_sys.c 			else if (battery->battery_capacity == 100 &&
battery          1713 drivers/hid/wacom_sys.c 				    battery->ps_connected)
battery          1715 drivers/hid/wacom_sys.c 			else if (battery->ps_connected)
battery          1729 drivers/hid/wacom_sys.c 				      struct wacom_battery *battery)
battery          1733 drivers/hid/wacom_sys.c 	struct power_supply_config psy_cfg = { .drv_data = battery, };
battery          1735 drivers/hid/wacom_sys.c 	struct power_supply_desc *bat_desc = &battery->bat_desc;
battery          1742 drivers/hid/wacom_sys.c 	battery->wacom = wacom;
battery          1749 drivers/hid/wacom_sys.c 	sprintf(battery->bat_name, "wacom_battery_%ld", n);
battery          1750 drivers/hid/wacom_sys.c 	bat_desc->name = battery->bat_name;
battery          1762 drivers/hid/wacom_sys.c 	battery->battery = ps_bat;
battery          1775 drivers/hid/wacom_sys.c 		return __wacom_initialize_battery(wacom, &wacom->battery);
battery          1782 drivers/hid/wacom_sys.c 	if (wacom->battery.battery) {
battery          1784 drivers/hid/wacom_sys.c 				     &wacom->battery.bat_desc);
battery          1785 drivers/hid/wacom_sys.c 		wacom->battery.battery = NULL;
battery          2152 drivers/hid/wacom_sys.c 	     !wacom->battery.battery) {
battery          2156 drivers/hid/wacom_sys.c 		 wacom->battery.battery) {
battery          2503 drivers/hid/wacom_sys.c 			if (remote->remotes[i].battery.battery)
battery          2505 drivers/hid/wacom_sys.c 						     &remote->remotes[i].battery.bat_desc);
battery          2513 drivers/hid/wacom_sys.c 			remote->remotes[i].battery.battery = NULL;
battery          2595 drivers/hid/wacom_sys.c 	if (remote->remotes[index].battery.battery)
battery          2602 drivers/hid/wacom_sys.c 					&wacom->remote->remotes[index].battery);
battery            55 drivers/hid/wacom_wac.c static void __wacom_notify_battery(struct wacom_battery *battery,
battery            60 drivers/hid/wacom_wac.c 	bool changed = battery->bat_status       != bat_status    ||
battery            61 drivers/hid/wacom_wac.c 		       battery->battery_capacity != bat_capacity  ||
battery            62 drivers/hid/wacom_wac.c 		       battery->bat_charging     != bat_charging  ||
battery            63 drivers/hid/wacom_wac.c 		       battery->bat_connected    != bat_connected ||
battery            64 drivers/hid/wacom_wac.c 		       battery->ps_connected     != ps_connected;
battery            67 drivers/hid/wacom_wac.c 		battery->bat_status = bat_status;
battery            68 drivers/hid/wacom_wac.c 		battery->battery_capacity = bat_capacity;
battery            69 drivers/hid/wacom_wac.c 		battery->bat_charging = bat_charging;
battery            70 drivers/hid/wacom_wac.c 		battery->bat_connected = bat_connected;
battery            71 drivers/hid/wacom_wac.c 		battery->ps_connected = ps_connected;
battery            73 drivers/hid/wacom_wac.c 		if (battery->battery)
battery            74 drivers/hid/wacom_wac.c 			power_supply_changed(battery->battery);
battery            84 drivers/hid/wacom_wac.c 	__wacom_notify_battery(&wacom->battery, bat_status, bat_capacity,
battery          1127 drivers/hid/wacom_wac.c 	__wacom_notify_battery(&remote->remotes[index].battery,
battery          3153 drivers/hid/wacom_wac.c 		int pid, battery, charging;
battery          3165 drivers/hid/wacom_wac.c 		battery = (data[5] & 0x3f) * 100 / 31;
battery          3173 drivers/hid/wacom_wac.c 				     battery, charging, 1, 0);
battery          3204 drivers/hid/wacom_wac.c 		int battery = (data[8] & 0x3f) * 100 / 31;
battery          3208 drivers/hid/wacom_wac.c 				     battery, charging, battery || charging, 1);
battery          3210 drivers/hid/wacom_wac.c 		if (!wacom->battery.battery &&
battery          3217 drivers/hid/wacom_wac.c 		 wacom->battery.battery) {
battery           417 drivers/platform/x86/asus-wmi.c static int asus_wmi_battery_add(struct power_supply *battery)
battery           424 drivers/platform/x86/asus-wmi.c 	if (strcmp(battery->desc->name, "BAT0") != 0 &&
battery           425 drivers/platform/x86/asus-wmi.c 	    strcmp(battery->desc->name, "BATT") != 0)
battery           428 drivers/platform/x86/asus-wmi.c 	if (device_create_file(&battery->dev,
battery           442 drivers/platform/x86/asus-wmi.c static int asus_wmi_battery_remove(struct power_supply *battery)
battery           444 drivers/platform/x86/asus-wmi.c 	device_remove_file(&battery->dev,
battery          9384 drivers/platform/x86/thinkpad_acpi.c static int tpacpi_battery_get(int what, int battery, int *ret)
battery          9388 drivers/platform/x86/thinkpad_acpi.c 		if ACPI_FAILURE(tpacpi_battery_acpi_eval(GET_START, ret, battery))
battery          9395 drivers/platform/x86/thinkpad_acpi.c 		if ACPI_FAILURE(tpacpi_battery_acpi_eval(GET_STOP, ret, battery))
battery          9414 drivers/platform/x86/thinkpad_acpi.c static int tpacpi_battery_set(int what, int battery, int value)
battery          9420 drivers/platform/x86/thinkpad_acpi.c 	param |= battery << 8;
battery          9426 drivers/platform/x86/thinkpad_acpi.c 					battery);
battery          9432 drivers/platform/x86/thinkpad_acpi.c 			pr_err("failed to set stop threshold: %d", battery);
battery          9442 drivers/platform/x86/thinkpad_acpi.c static int tpacpi_battery_probe(int battery)
battery          9446 drivers/platform/x86/thinkpad_acpi.c 	memset(&battery_info.batteries[battery], 0,
battery          9447 drivers/platform/x86/thinkpad_acpi.c 		sizeof(battery_info.batteries[battery]));
battery          9456 drivers/platform/x86/thinkpad_acpi.c 		if ACPI_FAILURE(tpacpi_battery_acpi_eval(GET_START, &ret, battery)) {
battery          9457 drivers/platform/x86/thinkpad_acpi.c 			pr_err("Error probing battery %d\n", battery);
battery          9465 drivers/platform/x86/thinkpad_acpi.c 			battery_info.batteries[battery].start_support = 1;
battery          9468 drivers/platform/x86/thinkpad_acpi.c 		if (tpacpi_battery_get(THRESHOLD_START, battery,
battery          9469 drivers/platform/x86/thinkpad_acpi.c 			&battery_info.batteries[battery].charge_start)) {
battery          9470 drivers/platform/x86/thinkpad_acpi.c 			pr_err("Error probing battery %d\n", battery);
battery          9475 drivers/platform/x86/thinkpad_acpi.c 		if ACPI_FAILURE(tpacpi_battery_acpi_eval(GET_STOP, &ret, battery)) {
battery          9476 drivers/platform/x86/thinkpad_acpi.c 			pr_err("Error probing battery stop; %d\n", battery);
battery          9481 drivers/platform/x86/thinkpad_acpi.c 			battery_info.batteries[battery].stop_support = 1;
battery          9484 drivers/platform/x86/thinkpad_acpi.c 		if (tpacpi_battery_get(THRESHOLD_STOP, battery,
battery          9485 drivers/platform/x86/thinkpad_acpi.c 			&battery_info.batteries[battery].charge_stop)) {
battery          9486 drivers/platform/x86/thinkpad_acpi.c 			pr_err("Error probing battery stop: %d\n", battery);
battery          9491 drivers/platform/x86/thinkpad_acpi.c 			battery,
battery          9492 drivers/platform/x86/thinkpad_acpi.c 			battery_info.batteries[battery].charge_start,
battery          9493 drivers/platform/x86/thinkpad_acpi.c 			battery_info.batteries[battery].charge_stop);
battery          9525 drivers/platform/x86/thinkpad_acpi.c 	int battery, rval;
battery          9539 drivers/platform/x86/thinkpad_acpi.c 		battery = tpacpi_battery_get_id(supply->desc->name);
battery          9541 drivers/platform/x86/thinkpad_acpi.c 		battery = BAT_PRIMARY;
battery          9549 drivers/platform/x86/thinkpad_acpi.c 		if (!battery_info.batteries[battery].start_support)
battery          9554 drivers/platform/x86/thinkpad_acpi.c 		if (value > battery_info.batteries[battery].charge_stop)
battery          9556 drivers/platform/x86/thinkpad_acpi.c 		if (tpacpi_battery_set(THRESHOLD_START, battery, value))
battery          9558 drivers/platform/x86/thinkpad_acpi.c 		battery_info.batteries[battery].charge_start = value;
battery          9562 drivers/platform/x86/thinkpad_acpi.c 		if (!battery_info.batteries[battery].stop_support)
battery          9567 drivers/platform/x86/thinkpad_acpi.c 		if (value < battery_info.batteries[battery].charge_start)
battery          9569 drivers/platform/x86/thinkpad_acpi.c 		battery_info.batteries[battery].charge_stop = value;
battery          9577 drivers/platform/x86/thinkpad_acpi.c 		if (tpacpi_battery_set(THRESHOLD_STOP, battery, value))
battery          9592 drivers/platform/x86/thinkpad_acpi.c 	int ret, battery;
battery          9606 drivers/platform/x86/thinkpad_acpi.c 		battery = tpacpi_battery_get_id(supply->desc->name);
battery          9608 drivers/platform/x86/thinkpad_acpi.c 		battery = BAT_PRIMARY;
battery          9609 drivers/platform/x86/thinkpad_acpi.c 	if (tpacpi_battery_get(what, battery, &ret))
battery          9655 drivers/platform/x86/thinkpad_acpi.c static int tpacpi_battery_add(struct power_supply *battery)
battery          9657 drivers/platform/x86/thinkpad_acpi.c 	int batteryid = tpacpi_battery_get_id(battery->desc->name);
battery          9661 drivers/platform/x86/thinkpad_acpi.c 	if (device_add_groups(&battery->dev, tpacpi_battery_groups))
battery          9666 drivers/platform/x86/thinkpad_acpi.c static int tpacpi_battery_remove(struct power_supply *battery)
battery          9668 drivers/platform/x86/thinkpad_acpi.c 	device_remove_groups(&battery->dev, tpacpi_battery_groups);
battery            98 drivers/power/supply/88pm860x_battery.c 	struct power_supply *battery;
battery           954 drivers/power/supply/88pm860x_battery.c 	info->battery = devm_power_supply_register(&pdev->dev,
battery           957 drivers/power/supply/88pm860x_battery.c 	if (IS_ERR(info->battery))
battery           958 drivers/power/supply/88pm860x_battery.c 		return PTR_ERR(info->battery);
battery           959 drivers/power/supply/88pm860x_battery.c 	info->battery->dev.parent = &pdev->dev;
battery           162 drivers/power/supply/bq24190_charger.c 	struct power_supply		*battery;
battery          1600 drivers/power/supply/bq24190_charger.c 	if (alert_battery && bdi->battery)
battery          1601 drivers/power/supply/bq24190_charger.c 		power_supply_changed(bdi->battery);
battery          1771 drivers/power/supply/bq24190_charger.c 		bdi->battery = power_supply_register(dev, &bq24190_battery_desc,
battery          1773 drivers/power/supply/bq24190_charger.c 		if (IS_ERR(bdi->battery)) {
battery          1775 drivers/power/supply/bq24190_charger.c 			ret = PTR_ERR(bdi->battery);
battery          1819 drivers/power/supply/bq24190_charger.c 	if (!IS_ERR_OR_NULL(bdi->battery))
battery          1820 drivers/power/supply/bq24190_charger.c 		power_supply_unregister(bdi->battery);
battery          1842 drivers/power/supply/bq24190_charger.c 	if (bdi->battery)
battery          1843 drivers/power/supply/bq24190_charger.c 		power_supply_unregister(bdi->battery);
battery          1930 drivers/power/supply/bq24190_charger.c 	if (bdi->battery)
battery          1931 drivers/power/supply/bq24190_charger.c 		power_supply_changed(bdi->battery);
battery            30 drivers/power/supply/da9150-charger.c 	struct power_supply *battery;
battery           368 drivers/power/supply/da9150-charger.c 	power_supply_changed(charger->battery);
battery           391 drivers/power/supply/da9150-charger.c 	power_supply_changed(charger->battery);
battery           407 drivers/power/supply/da9150-charger.c 		charger->supply_online = charger->battery;
battery           420 drivers/power/supply/da9150-charger.c 	power_supply_changed(charger->battery);
battery           439 drivers/power/supply/da9150-charger.c 		power_supply_changed(charger->battery);
battery           562 drivers/power/supply/da9150-charger.c 	charger->battery = power_supply_register(dev, &battery_desc, NULL);
battery           563 drivers/power/supply/da9150-charger.c 	if (IS_ERR(charger->battery)) {
battery           564 drivers/power/supply/da9150-charger.c 		ret = PTR_ERR(charger->battery);
battery           574 drivers/power/supply/da9150-charger.c 		charger->supply_online = charger->battery;
battery           666 drivers/power/supply/da9150-charger.c 	power_supply_unregister(charger->battery);
battery            78 drivers/power/supply/da9150-fg.c 	struct power_supply *battery;
battery           360 drivers/power/supply/da9150-fg.c 		power_supply_changed(fg->battery);
battery           467 drivers/power/supply/da9150-fg.c 	fg->battery = devm_power_supply_register(dev, &fg_desc, NULL);
battery           468 drivers/power/supply/da9150-fg.c 	if (IS_ERR(fg->battery)) {
battery           469 drivers/power/supply/da9150-fg.c 		ret = PTR_ERR(fg->battery);
battery            56 drivers/power/supply/ds2782_battery.c 	struct power_supply	*battery;
battery           285 drivers/power/supply/ds2782_battery.c 		power_supply_changed(info->battery);
battery           306 drivers/power/supply/ds2782_battery.c static void ds278x_power_supply_init(struct power_supply_desc *battery)
battery           308 drivers/power/supply/ds2782_battery.c 	battery->type			= POWER_SUPPLY_TYPE_BATTERY;
battery           309 drivers/power/supply/ds2782_battery.c 	battery->properties		= ds278x_battery_props;
battery           310 drivers/power/supply/ds2782_battery.c 	battery->num_properties		= ARRAY_SIZE(ds278x_battery_props);
battery           311 drivers/power/supply/ds2782_battery.c 	battery->get_property		= ds278x_battery_get_property;
battery           312 drivers/power/supply/ds2782_battery.c 	battery->external_power_changed	= NULL;
battery           320 drivers/power/supply/ds2782_battery.c 	power_supply_unregister(info->battery);
battery           427 drivers/power/supply/ds2782_battery.c 	info->battery = power_supply_register(&client->dev,
battery           429 drivers/power/supply/ds2782_battery.c 	if (IS_ERR(info->battery)) {
battery           431 drivers/power/supply/ds2782_battery.c 		ret = PTR_ERR(info->battery);
battery            26 drivers/power/supply/goldfish_battery.c 	struct power_supply *battery;
battery           174 drivers/power/supply/goldfish_battery.c 		power_supply_changed(data->battery);
battery           241 drivers/power/supply/goldfish_battery.c 	data->battery = power_supply_register(&pdev->dev, &battery_desc,
battery           243 drivers/power/supply/goldfish_battery.c 	if (IS_ERR(data->battery)) {
battery           245 drivers/power/supply/goldfish_battery.c 		return PTR_ERR(data->battery);
battery           258 drivers/power/supply/goldfish_battery.c 	power_supply_unregister(data->battery);
battery            20 drivers/power/supply/ingenic-battery.c 	struct power_supply *battery;
battery           149 drivers/power/supply/ingenic-battery.c 	bat->battery = devm_power_supply_register(dev, desc, &psy_cfg);
battery           150 drivers/power/supply/ingenic-battery.c 	if (IS_ERR(bat->battery)) {
battery           152 drivers/power/supply/ingenic-battery.c 		return PTR_ERR(bat->battery);
battery           155 drivers/power/supply/ingenic-battery.c 	ret = power_supply_get_battery_info(bat->battery, &bat->info);
battery           105 drivers/power/supply/lp8788-charger.c 	struct power_supply *battery;
battery           411 drivers/power/supply/lp8788-charger.c 	power_supply_unregister(pchg->battery);
battery           457 drivers/power/supply/lp8788-charger.c 		power_supply_changed(pchg->battery);
battery           689 drivers/power/supply/lp8788-charger.c 	pchg->battery = power_supply_register(&pdev->dev,
battery           691 drivers/power/supply/lp8788-charger.c 	if (IS_ERR(pchg->battery)) {
battery            34 drivers/power/supply/max17040_battery.c 	struct power_supply		*battery;
battery           213 drivers/power/supply/max17040_battery.c 	chip->battery = power_supply_register(&client->dev,
battery           215 drivers/power/supply/max17040_battery.c 	if (IS_ERR(chip->battery)) {
battery           217 drivers/power/supply/max17040_battery.c 		return PTR_ERR(chip->battery);
battery           234 drivers/power/supply/max17040_battery.c 	power_supply_unregister(chip->battery);
battery            58 drivers/power/supply/max17042_battery.c 	struct power_supply *battery;
battery           115 drivers/power/supply/max17042_battery.c 	ret = power_supply_am_i_supplied(chip->battery);
battery           853 drivers/power/supply/max17042_battery.c 	power_supply_changed(chip->battery);
battery          1071 drivers/power/supply/max17042_battery.c 	chip->battery = devm_power_supply_register(&client->dev, max17042_desc,
battery          1073 drivers/power/supply/max17042_battery.c 	if (IS_ERR(chip->battery)) {
battery          1075 drivers/power/supply/max17042_battery.c 		return PTR_ERR(chip->battery);
battery          1091 drivers/power/supply/max17042_battery.c 						chip->battery->desc->name,
battery           283 drivers/power/supply/max77650-charger.c 	struct power_supply *battery;
battery           326 drivers/power/supply/max77650-charger.c 	battery = devm_power_supply_register(dev,
battery           328 drivers/power/supply/max77650-charger.c 	if (IS_ERR(battery))
battery           329 drivers/power/supply/max77650-charger.c 		return PTR_ERR(battery);
battery            70 drivers/power/supply/max8925_power.c 	struct power_supply	*battery;
battery           545 drivers/power/supply/max8925_power.c 	info->battery = power_supply_register(&pdev->dev, &battery_desc, NULL);
battery           546 drivers/power/supply/max8925_power.c 	if (IS_ERR(info->battery)) {
battery           547 drivers/power/supply/max8925_power.c 		ret = PTR_ERR(info->battery);
battery           550 drivers/power/supply/max8925_power.c 	info->battery->dev.parent = &pdev->dev;
battery           576 drivers/power/supply/max8925_power.c 		power_supply_unregister(info->battery);
battery            19 drivers/power/supply/max8997_charger.c 	struct power_supply *battery;
battery           147 drivers/power/supply/max8997_charger.c 	charger->battery = devm_power_supply_register(&pdev->dev,
battery           150 drivers/power/supply/max8997_charger.c 	if (IS_ERR(charger->battery)) {
battery           152 drivers/power/supply/max8997_charger.c 		return PTR_ERR(charger->battery);
battery            20 drivers/power/supply/max8998_charger.c 	struct power_supply *battery;
battery           158 drivers/power/supply/max8998_charger.c 	max8998->battery = devm_power_supply_register(max8998->dev,
battery           161 drivers/power/supply/max8998_charger.c 	if (IS_ERR(max8998->battery)) {
battery           162 drivers/power/supply/max8998_charger.c 		ret = PTR_ERR(max8998->battery);
battery          1011 drivers/power/supply/pm2301_charger.c 	if (!pl_data->battery) {
battery          1017 drivers/power/supply/pm2301_charger.c 	pm2->bat = pl_data->battery;
battery            17 drivers/power/supply/rt5033_battery.c 	struct rt5033_battery *battery = i2c_get_clientdata(client);
battery            20 drivers/power/supply/rt5033_battery.c 	regmap_read(battery->regmap, RT5033_FUEL_REG_SOC_H, &msb);
battery            27 drivers/power/supply/rt5033_battery.c 	struct rt5033_battery *battery = i2c_get_clientdata(client);
battery            30 drivers/power/supply/rt5033_battery.c 	regmap_read(battery->regmap, RT5033_FUEL_REG_CONFIG_L, &val);
battery            38 drivers/power/supply/rt5033_battery.c 	struct rt5033_battery *battery = i2c_get_clientdata(client);
battery            60 drivers/power/supply/rt5033_battery.c 	regmap_read(battery->regmap, regh, &msb);
battery            61 drivers/power/supply/rt5033_battery.c 	regmap_read(battery->regmap, regl, &lsb);
battery            72 drivers/power/supply/rt5033_battery.c 	struct rt5033_battery *battery = power_supply_get_drvdata(psy);
battery            78 drivers/power/supply/rt5033_battery.c 		val->intval = rt5033_battery_get_watt_prop(battery->client,
battery            82 drivers/power/supply/rt5033_battery.c 		val->intval = rt5033_battery_get_present(battery->client);
battery            85 drivers/power/supply/rt5033_battery.c 		val->intval = rt5033_battery_get_capacity(battery->client);
battery           120 drivers/power/supply/rt5033_battery.c 	struct rt5033_battery *battery;
battery           126 drivers/power/supply/rt5033_battery.c 	battery = devm_kzalloc(&client->dev, sizeof(*battery), GFP_KERNEL);
battery           127 drivers/power/supply/rt5033_battery.c 	if (!battery)
battery           130 drivers/power/supply/rt5033_battery.c 	battery->client = client;
battery           131 drivers/power/supply/rt5033_battery.c 	battery->regmap = devm_regmap_init_i2c(client,
battery           133 drivers/power/supply/rt5033_battery.c 	if (IS_ERR(battery->regmap)) {
battery           138 drivers/power/supply/rt5033_battery.c 	i2c_set_clientdata(client, battery);
battery           139 drivers/power/supply/rt5033_battery.c 	psy_cfg.drv_data = battery;
battery           141 drivers/power/supply/rt5033_battery.c 	battery->psy = power_supply_register(&client->dev,
battery           143 drivers/power/supply/rt5033_battery.c 	if (IS_ERR(battery->psy)) {
battery           145 drivers/power/supply/rt5033_battery.c 		ret = PTR_ERR(battery->psy);
battery           154 drivers/power/supply/rt5033_battery.c 	struct rt5033_battery *battery = i2c_get_clientdata(client);
battery           156 drivers/power/supply/rt5033_battery.c 	power_supply_unregister(battery->psy);
battery           741 drivers/power/supply/sbs-battery.c 	struct power_supply *battery = chip->power_supply;
battery           748 drivers/power/supply/sbs-battery.c 	power_supply_changed(battery);
battery            91 drivers/power/supply/sc27xx_fuel_gauge.c 	struct power_supply *battery;
battery           641 drivers/power/supply/sc27xx_fuel_gauge.c 	power_supply_changed(data->battery);
battery           812 drivers/power/supply/sc27xx_fuel_gauge.c 	power_supply_changed(data->battery);
battery           834 drivers/power/supply/sc27xx_fuel_gauge.c 	power_supply_changed(data->battery);
battery           899 drivers/power/supply/sc27xx_fuel_gauge.c 	ret = power_supply_get_battery_info(data->battery, &info);
battery           922 drivers/power/supply/sc27xx_fuel_gauge.c 		power_supply_put_battery_info(data->battery, &info);
battery           932 drivers/power/supply/sc27xx_fuel_gauge.c 	power_supply_put_battery_info(data->battery, &info);
battery          1085 drivers/power/supply/sc27xx_fuel_gauge.c 	data->battery = devm_power_supply_register(dev, &sc27xx_fgu_desc,
battery          1087 drivers/power/supply/sc27xx_fuel_gauge.c 	if (IS_ERR(data->battery)) {
battery          1089 drivers/power/supply/sc27xx_fuel_gauge.c 		return PTR_ERR(data->battery);
battery           141 drivers/power/supply/smb347-charger.c 	struct power_supply	*battery;
battery           741 drivers/power/supply/smb347-charger.c 		power_supply_changed(smb->battery);
battery           752 drivers/power/supply/smb347-charger.c 			power_supply_changed(smb->battery);
battery           766 drivers/power/supply/smb347-charger.c 		power_supply_changed(smb->battery);
battery          1213 drivers/power/supply/smb347-charger.c 	static char *battery[] = { "smb347-battery" };
battery          1245 drivers/power/supply/smb347-charger.c 	mains_usb_cfg.supplied_to = battery;
battery          1246 drivers/power/supply/smb347-charger.c 	mains_usb_cfg.num_supplicants = ARRAY_SIZE(battery);
battery          1266 drivers/power/supply/smb347-charger.c 	smb->battery = power_supply_register(dev, &smb347_battery_desc,
battery          1268 drivers/power/supply/smb347-charger.c 	if (IS_ERR(smb->battery)) {
battery          1273 drivers/power/supply/smb347-charger.c 		return PTR_ERR(smb->battery);
battery          1303 drivers/power/supply/smb347-charger.c 	power_supply_unregister(smb->battery);
battery            24 drivers/power/supply/wm831x_power.c 	struct power_supply *battery;
battery           262 drivers/power/supply/wm831x_power.c 	if (!wm831x_pdata || !wm831x_pdata->battery) {
battery           268 drivers/power/supply/wm831x_power.c 	pdata = wm831x_pdata->battery;
battery           494 drivers/power/supply/wm831x_power.c 		power_supply_changed(wm831x_power->battery);
battery           525 drivers/power/supply/wm831x_power.c 		power_supply_changed(wm831x_power->battery);
battery           602 drivers/power/supply/wm831x_power.c 		power->battery = power_supply_register(&pdev->dev,
battery           605 drivers/power/supply/wm831x_power.c 		if (IS_ERR(power->battery)) {
battery           606 drivers/power/supply/wm831x_power.c 			ret = PTR_ERR(power->battery);
battery           689 drivers/power/supply/wm831x_power.c 		power_supply_unregister(power->battery);
battery           723 drivers/power/supply/wm831x_power.c 		power_supply_unregister(wm831x_power->battery);
battery           196 drivers/power/supply/wm8350_power.c 		power_supply_changed(power->battery);
battery           203 drivers/power/supply/wm8350_power.c 		power_supply_changed(power->battery);
battery           232 drivers/power/supply/wm8350_power.c 		power_supply_changed(power->battery);
battery           478 drivers/power/supply/wm8350_power.c 	power->battery = power_supply_register(&pdev->dev, &wm8350_battery_desc,
battery           480 drivers/power/supply/wm8350_power.c 	if (IS_ERR(power->battery)) {
battery           481 drivers/power/supply/wm8350_power.c 		ret = PTR_ERR(power->battery);
battery           506 drivers/power/supply/wm8350_power.c 	power_supply_unregister(power->battery);
battery           520 drivers/power/supply/wm8350_power.c 	power_supply_unregister(power->battery);
battery           967 drivers/rtc/rtc-ds1685.c static DEVICE_ATTR(battery, S_IRUGO, ds1685_rtc_sysfs_battery_show, NULL);
battery          1369 drivers/scsi/aacraid/aacraid.h 	__le32	battery;
battery            13 include/acpi/battery.h 	int (*add_battery)(struct power_supply *battery);
battery            14 include/acpi/battery.h 	int (*remove_battery)(struct power_supply *battery);
battery           578 include/linux/hid.h 	struct power_supply *battery;
battery           378 include/linux/mfd/max8997-private.h 	struct platform_device *battery; /* battery control (not fuel gauge) */
battery           128 include/linux/mfd/wm831x/pdata.h 	struct wm831x_battery_pdata *battery;
battery           121 include/linux/mfd/wm8350/supply.h 	struct power_supply *battery;
battery            45 include/linux/pm2301_charger.h 	struct pm2xxx_bm_data *battery;