Movatterモバイル変換


[0]ホーム

URL:


Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up
Appearance settings
forked fromtorvalds/linux

Commit82bf43b

Browse files
dsdrafaeljw
authored andcommitted
Revert "ACPI / battery: Add quirk for Asus GL502VSK and UX305LA"
Revert commitc68f067 ("ACPI / battery: Add quirk for AsusGL502VSK and UX305LA") and commit4446823 ("ACPI / battery: Addquirk for Asus UX360UA and UX410UAK").On many many Asus products, the battery is sometimes reported ascharging or discharging even when it is full and you are on AC power.This change quirked the kernel to avoid advertising the dischargingstate when this happens on 4 laptop models, under the belief thatthis was incorrect information. I presume it originates from userreports who are confused that their battery status icon says that itis discharging.However, the reported information is indeed correct, and the quirkapproach taken is inadequate and more thought is needed first.Specifically: 1. It only quirks discharging state, not charging 2. There are so many different Asus products and DMI naming variants within those product families that behave this way; Linux could grow to quirk hundreds of products and still not even be close at "winning" this battle. 3. Asus previously clarified that this behaviour is intentional. The platform will periodically do a partial discharge/charge cycle when the battery is full, because this is one way to extend the lifetime of the battery (leaving a battery at 100% charge and unused will decrease its usable capacity over time). My understanding is that any decent consumer product will have this behaviour, but it appears that Asus is different in that they expose this info through ACPI. However, the behaviour seems correct. The ACPI spec does not suggest in that the platform should hide the truth. It lets you report that the battery is full of charge, and discharging, and with external power connected; and Asus does this. 4. In terms of not confusing the user, this seems like something that could/should be handled by userspace, which can also detect these same (accurate) conditions in the general case.Revert this quirk before it gets included in a release, while we lookfor better approaches.Signed-off-by: Daniel Drake <drake@endlessm.com>Acked-by: Kai-Heng Feng <kai.heng.feng@canonical.com>Signed-off-by: Rafael J. Wysocki <rafael.j.wysocki@intel.com>
1 parentc698ca5 commit82bf43b

File tree

1 file changed

+3
-45
lines changed

1 file changed

+3
-45
lines changed

‎drivers/acpi/battery.c‎

Lines changed: 3 additions & 45 deletions
Original file line numberDiff line numberDiff line change
@@ -70,7 +70,6 @@ static async_cookie_t async_cookie;
7070
staticboolbattery_driver_registered;
7171
staticintbattery_bix_broken_package;
7272
staticintbattery_notification_delay_ms;
73-
staticintbattery_full_discharging;
7473
staticunsignedintcache_time=1000;
7574
module_param(cache_time,uint,0644);
7675
MODULE_PARM_DESC(cache_time,"cache time in milliseconds");
@@ -215,12 +214,9 @@ static int acpi_battery_get_property(struct power_supply *psy,
215214
return-ENODEV;
216215
switch (psp) {
217216
casePOWER_SUPPLY_PROP_STATUS:
218-
if (battery->state&ACPI_BATTERY_STATE_DISCHARGING) {
219-
if (battery_full_discharging&&battery->rate_now==0)
220-
val->intval=POWER_SUPPLY_STATUS_FULL;
221-
else
222-
val->intval=POWER_SUPPLY_STATUS_DISCHARGING;
223-
}elseif (battery->state&ACPI_BATTERY_STATE_CHARGING)
217+
if (battery->state&ACPI_BATTERY_STATE_DISCHARGING)
218+
val->intval=POWER_SUPPLY_STATUS_DISCHARGING;
219+
elseif (battery->state&ACPI_BATTERY_STATE_CHARGING)
224220
val->intval=POWER_SUPPLY_STATUS_CHARGING;
225221
elseif (acpi_battery_is_charged(battery))
226222
val->intval=POWER_SUPPLY_STATUS_FULL;
@@ -1170,12 +1166,6 @@ battery_notification_delay_quirk(const struct dmi_system_id *d)
11701166
return0;
11711167
}
11721168

1173-
staticint__initbattery_full_discharging_quirk(conststructdmi_system_id*d)
1174-
{
1175-
battery_full_discharging=1;
1176-
return0;
1177-
}
1178-
11791169
staticconststructdmi_system_idbat_dmi_table[]__initconst= {
11801170
{
11811171
.callback=battery_bix_broken_package_quirk,
@@ -1193,38 +1183,6 @@ static const struct dmi_system_id bat_dmi_table[] __initconst = {
11931183
DMI_MATCH(DMI_PRODUCT_NAME,"Aspire V5-573G"),
11941184
},
11951185
},
1196-
{
1197-
.callback=battery_full_discharging_quirk,
1198-
.ident="ASUS GL502VSK",
1199-
.matches= {
1200-
DMI_MATCH(DMI_SYS_VENDOR,"ASUSTeK COMPUTER INC."),
1201-
DMI_MATCH(DMI_PRODUCT_NAME,"GL502VSK"),
1202-
},
1203-
},
1204-
{
1205-
.callback=battery_full_discharging_quirk,
1206-
.ident="ASUS UX305LA",
1207-
.matches= {
1208-
DMI_MATCH(DMI_SYS_VENDOR,"ASUSTeK COMPUTER INC."),
1209-
DMI_MATCH(DMI_PRODUCT_NAME,"UX305LA"),
1210-
},
1211-
},
1212-
{
1213-
.callback=battery_full_discharging_quirk,
1214-
.ident="ASUS UX360UA",
1215-
.matches= {
1216-
DMI_MATCH(DMI_SYS_VENDOR,"ASUSTeK COMPUTER INC."),
1217-
DMI_MATCH(DMI_PRODUCT_NAME,"UX360UA"),
1218-
},
1219-
},
1220-
{
1221-
.callback=battery_full_discharging_quirk,
1222-
.ident="ASUS UX410UAK",
1223-
.matches= {
1224-
DMI_MATCH(DMI_SYS_VENDOR,"ASUSTeK COMPUTER INC."),
1225-
DMI_MATCH(DMI_PRODUCT_NAME,"UX410UAK"),
1226-
},
1227-
},
12281186
{},
12291187
};
12301188

0 commit comments

Comments
 (0)

[8]ページ先頭

©2009-2025 Movatter.jp