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

Commitc68f067

Browse files
khfengrafaeljw
authored andcommitted
ACPI / battery: Add quirk for Asus GL502VSK and UX305LA
On Asus GL502VSK and UX305LA, ACPI incorrectly reports discharging whenbattery is full and AC is plugged.However rate_now is correct under this circumstance, hence we can use"rate_now == 0" as a predicate to report battery full status correctly.Link:https://bugs.launchpad.net/bugs/1482390Signed-off-by: Kai-Heng Feng <kai.heng.feng@canonical.com>Signed-off-by: Rafael J. Wysocki <rafael.j.wysocki@intel.com>
1 parent6993ce4 commitc68f067

File tree

1 file changed

+29
-3
lines changed

1 file changed

+29
-3
lines changed

‎drivers/acpi/battery.c‎

Lines changed: 29 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -70,6 +70,7 @@ static async_cookie_t async_cookie;
7070
staticboolbattery_driver_registered;
7171
staticintbattery_bix_broken_package;
7272
staticintbattery_notification_delay_ms;
73+
staticintbattery_full_discharging;
7374
staticunsignedintcache_time=1000;
7475
module_param(cache_time,uint,0644);
7576
MODULE_PARM_DESC(cache_time,"cache time in milliseconds");
@@ -214,9 +215,12 @@ static int acpi_battery_get_property(struct power_supply *psy,
214215
return-ENODEV;
215216
switch (psp) {
216217
casePOWER_SUPPLY_PROP_STATUS:
217-
if (battery->state&ACPI_BATTERY_STATE_DISCHARGING)
218-
val->intval=POWER_SUPPLY_STATUS_DISCHARGING;
219-
elseif (battery->state&ACPI_BATTERY_STATE_CHARGING)
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)
220224
val->intval=POWER_SUPPLY_STATUS_CHARGING;
221225
elseif (acpi_battery_is_charged(battery))
222226
val->intval=POWER_SUPPLY_STATUS_FULL;
@@ -1166,6 +1170,12 @@ battery_notification_delay_quirk(const struct dmi_system_id *d)
11661170
return0;
11671171
}
11681172

1173+
staticint__initbattery_full_discharging_quirk(conststructdmi_system_id*d)
1174+
{
1175+
battery_full_discharging=1;
1176+
return0;
1177+
}
1178+
11691179
staticconststructdmi_system_idbat_dmi_table[]__initconst= {
11701180
{
11711181
.callback=battery_bix_broken_package_quirk,
@@ -1183,6 +1193,22 @@ static const struct dmi_system_id bat_dmi_table[] __initconst = {
11831193
DMI_MATCH(DMI_PRODUCT_NAME,"Aspire V5-573G"),
11841194
},
11851195
},
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+
},
11861212
{},
11871213
};
11881214

0 commit comments

Comments
 (0)

[8]ページ先頭

©2009-2025 Movatter.jp