Skip to content

Commit 185d206

Browse files
tuxedo-wserafaeljw
authored andcommitted
ACPI: battery: Make "not-charging" the default on no charging or full info
When the battery is neither charging or discharging and is not full, "not-charging" is a useful status description for the case in general. Currently this state is set as "unknown" by default, expect when this is explicitly replaced with "not-charging" on a per device or per vendor basis. A lot of devices have this state without a BIOS specification available explicitly describing it. e.g. some current Clevo barebones have a BIOS setting to stop charging at a user defined battery level. Signed-off-by: Werner Sembach <[email protected]> Signed-off-by: Rafael J. Wysocki <[email protected]>
1 parent 7dacee0 commit 185d206

File tree

1 file changed

+1
-23
lines changed

1 file changed

+1
-23
lines changed

drivers/acpi/battery.c

Lines changed: 1 addition & 23 deletions
Original file line numberDiff line numberDiff line change
@@ -52,7 +52,6 @@ static bool battery_driver_registered;
5252
static int battery_bix_broken_package;
5353
static int battery_notification_delay_ms;
5454
static int battery_ac_is_broken;
55-
static int battery_quirk_notcharging;
5655
static unsigned int cache_time = 1000;
5756
module_param(cache_time, uint, 0644);
5857
MODULE_PARM_DESC(cache_time, "cache time in milliseconds");
@@ -216,10 +215,8 @@ static int acpi_battery_get_property(struct power_supply *psy,
216215
val->intval = POWER_SUPPLY_STATUS_CHARGING;
217216
else if (acpi_battery_is_charged(battery))
218217
val->intval = POWER_SUPPLY_STATUS_FULL;
219-
else if (battery_quirk_notcharging)
220-
val->intval = POWER_SUPPLY_STATUS_NOT_CHARGING;
221218
else
222-
val->intval = POWER_SUPPLY_STATUS_UNKNOWN;
219+
val->intval = POWER_SUPPLY_STATUS_NOT_CHARGING;
223220
break;
224221
case POWER_SUPPLY_PROP_PRESENT:
225222
val->intval = acpi_battery_present(battery);
@@ -1105,12 +1102,6 @@ battery_ac_is_broken_quirk(const struct dmi_system_id *d)
11051102
return 0;
11061103
}
11071104

1108-
static int __init battery_quirk_not_charging(const struct dmi_system_id *d)
1109-
{
1110-
battery_quirk_notcharging = 1;
1111-
return 0;
1112-
}
1113-
11141105
static const struct dmi_system_id bat_dmi_table[] __initconst = {
11151106
{
11161107
/* NEC LZ750/LS */
@@ -1139,19 +1130,6 @@ static const struct dmi_system_id bat_dmi_table[] __initconst = {
11391130
DMI_MATCH(DMI_BIOS_DATE, "08/22/2014"),
11401131
},
11411132
},
1142-
{
1143-
/*
1144-
* On Lenovo ThinkPads the BIOS specification defines
1145-
* a state when the bits for charging and discharging
1146-
* are both set to 0. That state is "Not Charging".
1147-
*/
1148-
.callback = battery_quirk_not_charging,
1149-
.ident = "Lenovo ThinkPad",
1150-
.matches = {
1151-
DMI_MATCH(DMI_SYS_VENDOR, "LENOVO"),
1152-
DMI_MATCH(DMI_PRODUCT_VERSION, "ThinkPad"),
1153-
},
1154-
},
11551133
{
11561134
/* Microsoft Surface Go 3 */
11571135
.callback = battery_notification_delay_quirk,

0 commit comments

Comments
 (0)